# How to know if you are in a datacenter instance programmatically

**URL:** <https://community.developer.atlassian.com/t/how-to-know-if-you-are-in-a-datacenter-instance-programmatically/546>\
**Category:** Jira Server\
**Tags:** jira-server, data-center\
**Created:** [March 7, 2017, 9:10am UTC](https://community.developer.atlassian.com/t/how-to-know-if-you-are-in-a-datacenter-instance-programmatically/546 "2017-03-07T09:10:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sax](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/sax/32/35827_2.png) [@sax](https://community.developer.atlassian.com/u/sax)\
**Post date:** [March 7, 2017, 9:10am UTC](https://community.developer.atlassian.com/t/how-to-know-if-you-are-in-a-datacenter-instance-programmatically/546/1 "2017-03-07T09:10:18Z")

</div>

Hi,  
We need to show different options in the configuration page of our add-on accordingly to the type of instance the add-on is running (i.e. Server or Data Center).  
Is there a way to detect the type of instance in a velocity template or programmatically in a servlet?

---

<div class="post-metadata">

**Author:** ![pvandevoorde](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/pvandevoorde/32/37172_2.png) [@pvandevoorde](https://community.developer.atlassian.com/u/pvandevoorde)\
**Post date:** [March 7, 2017, 8:18pm UTC](https://community.developer.atlassian.com/t/how-to-know-if-you-are-in-a-datacenter-instance-programmatically/546/2 "2017-03-07T20:18:53Z")

</div>

Hey Salvatore,

Have you tried looking at the information you get returned from calling the serverInfo REST endpoint? [JIRA 7.6.1](https://docs.atlassian.com/jira/REST/server/#api/2/serverInfo-getServerInfo)

Especially the **deploymentType** attribute might be able to help you out.  
Although I don’t have a Data Center instance to test this on so I cannot guarantee that this works.

Another option would be to use the Java API: [DefaultClusterManager (Atlassian JIRA 7.6.1 API)](https://docs.atlassian.com/jira/server/com/atlassian/jira/cluster/DefaultClusterManager.html)  
specifically the isClusterLicensed method: [DefaultClusterManager (Atlassian JIRA 7.6.1 API)](https://docs.atlassian.com/jira/server/com/atlassian/jira/cluster/DefaultClusterManager.html#isClusterLicensed--)

---

<div class="post-metadata">

**Author:** ![aferrari](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@aferrari](https://community.developer.atlassian.com/u/aferrari)\
**Post date:** [October 11, 2018, 5:04pm UTC](https://community.developer.atlassian.com/t/how-to-know-if-you-are-in-a-datacenter-instance-programmatically/546/3 "2018-10-11T17:04:11Z")

</div>

@pvandevoorde Based on my testing, the **deploymentType** attribute returns “Server” regardless of if it’s a licensed Server or Data Center instance.

The Java API docs look promising but probably more work to interact with.

Have you seen any other ways to detect Server vs DC outside of the Java APIs you referenced below?

---

<div class="post-metadata">

**Author:** ![danielwester](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/danielwester/32/36730_2.png) [@danielwester](https://community.developer.atlassian.com/u/danielwester)\
**Post date:** [October 11, 2018, 10:15pm UTC](https://community.developer.atlassian.com/t/how-to-know-if-you-are-in-a-datacenter-instance-programmatically/546/4 "2018-10-11T22:15:03Z")

</div>

Easiest way that should work against all products is to use SAL:  
[https://docs.atlassian.com/sal-api/3.1.1/sal-api/apidocs/index.html](https://docs.atlassian.com/sal-api/3.1.1/sal-api/apidocs/index.html)

Take a look at LicenseHandler - easiest way to see if there’s a data center license hanging around.
