1

Is there any Rest API that can be used to get the versions of an application in DEV Environment in Urbancode.

I tried using supported Rest API to get List of application and Snapshots(If any) but now I need to get the versions (if any) of that particular application inside DEV Environment.

How do I go about it ?

Any suggestions would be appreciated.

Thanks.

HDJEMAI
  • 9,436
  • 46
  • 67
  • 93
CKK
  • 31
  • 9

1 Answers1

2

In IBM UrbanCode Deploy, applications don't have versions. Components have versions.

If you've got the snapshot that has been deployed to the environment, you can get the component versions in that snapshot with this command:

https://www.ibm.com/support/knowledgecenter/SS4GSP_6.2.4/com.ibm.udeploy.api.doc/topics/rest_cli_snapshot_getsnapshotversions_get.html

If you don't have a snapshot, you can use the internal, unsupported API to get the current desired inventory. The command would be something like this:

GET https://ucdserver.example.com:8443/rest/deploy/environment/9e022848-ca4f-447e-9311-3d77103c612c/latestDesiredInventory/true?rowsPerPage=50&pageNumber=1&orderField=name&sortType=desc

That command returns JSON with the versions that have most recently been deployed to the environment and a lot of other info about the environment inventory.

Tim McMackin
  • 199
  • 1
  • 8
  • Hi Tim, Thank you for ur response. Im working on it. Will update once i am done. – CKK May 23 '17 at 01:02
  • I got the versions as expected. But my question here is do component versions depends on both snapshot and application or only on application. Let's say I want to get the component versions history used in dev environment. How do I go abt it. – CKK May 23 '17 at 17:26
  • Sorry, still not sure what you mean by "do component versions depends on both snapshot and application or only on application". I don't know of any easy way to get the history of an environment based on what component versions have been deployed. The main thing the API will give you is the inventory, the list of all versions that have been deployed to the environment. – Tim McMackin May 24 '17 at 13:07
  • Hi Tim, thank u again and I really appreciate ur respons. On my project , I have to 2 create 2 drop-down list-one for available snapshot and other one is for versions of compoments associated with the app. basically I used rest api to grab all components associated with application, n pass each component to get the versions. The problem is I'm having difficulty passing the component(most app has more than 1 components). What is the recommended way to do it. I tried and it gave me error: Cannot convert object of type \u0027 to type \ u0027 system.collections.Generic.Idictionary'.. – CKK Jun 08 '17 at 21:59