Unique identifiers


Each cloud object carries a globally unique identifier, often referred to as a guid, which is a 32-digit hexadecimal number that provides a unique reference to an object. The number is presented as a string and is divided into five hyphen-separated segments, as shown in the following example:


7279a217-07fe-4fae-9821-d9b2d550cdb3

When you create cloud objects or request information about cloud objects, BMC Cloud Lifecycle Management supplies the unique identifiers; you do not need to create unique identifiers yourself. However, you use the identifiers as input in your requests.

Using unique identifiers

Unique identifiers are used within HTTP requests and JSON documents to point to specific cloud resources. For example, you might want to search for a list of pods in your cloud environment and then request information about one of the network containers within a particular pod. You retrieve the network container information using unique identifiers, as shown in the following example.

  1. Send the HTTP request for a list of pods: 


    POST /csm/Pod/search HTTP/1.1
    Host: cloud-service-url
  2. The HTTP response to the request includes the following JSON document that contains a list of pods. The JSON document says that your cloud has one pod and that the pod has several network containers. The network containers for the pod are listed in the containers object that is embedded in the results array. 


    {
      "cloudClass" : "com.bmc.cloud.model.beans.SearchResults",
      "guid" : "e732a930-5949-48c3-8338-f163c388af4f",
      "pageNo" : 0,
      "pageSize" : -1,
      "results" : [
         {
            "cloudClass" : "com.bmc.cloud.model.beans.Pod",
            "containerBlueprints" :
                [ "/containerblueprint/be70ab10-c850-4b80-8e1d-efbb7a4ea587" ],
            "containers" : [
               "/networkcontainer/aa67935f-f636-4801-b941-563317e4f3ae",
               "/networkcontainer/48681735-3535-4e8e-83e0-0cf5d95a7e94",
               "/networkcontainer/b1ed722c-09a8-4614-bf41-818e86b119db",
               "/networkcontainer/0806a334-6a4a-4ec1-8776-f58cc808a197"
             ],
            "externalID" : "392d97a1-efec-423c-a99d-848e1fe1ac35:Austin Pod",
            "guid" : "2ea252f2-a4f3-4671-8e26-f7a480165aed",
            "isOnboarded" : true,
            "location" : "/location/OI-C1121702FB304D90870689BAEDD139E7",
            "name" : "Austin Pod",
            "owner" : "CalbroAdmin",
            "provider" : "/provider/392d97a1-efec-423c-a99d-848e1fe1ac35",
            "reconciliationID" : "OI-738b64479a584e558dd99394eece23a1",
            "staticPools" :
                [ "/staticpool/4d54ba05-d9f2-40c1-b3e9-eb92a6305afe" ],
            "tokenID" : "Austin Pod"
         }
       ],
      "totalRows" : 1
    }
  3. Identify the network container that you want more information about (the first one in the list) and save its guid, which is aa67935f-f636-4801-b941-563317e4f3ae.

  4. Create and send an HTTP request with the saved guid embedded in the request URI: 


    GET /csm/networkcontainer/aa67935f-f636-4801-b941-563317e4f3ae
  5. The JSON document in the response contains detailed information about the network container. The guid referenced in the JSON document is identical to the one in the GET request URI. 


    [{
     "cloudClass" : "com.bmc.cloud.model.beans.NetworkContainer",
     "containerBlueprint" :
        "/containerblueprint/be70ab10-c850-4b80-8e1d-efbb7a4ea587",
     "externalID" : "392d97a1-efec-423c-a99d-848e1fe1ac35:Austin Pod:Sol NC",
     "guid" : "aa67935f-f636-4801-b941-563317e4f3ae",
     "isOnboarded" : true,
     "name" : "Sol NC",
     "owner" : "CalbroAdmin",
     "pod" : "/pod/2ea252f2-a4f3-4671-8e26-f7a480165aed",
     "provider" : "/provider/392d97a1-efec-423c-a99d-848e1fe1ac35",
     "reconciliationID" : "OI-53593909177d4942972020540fa93285",
     "tokenID" : "Sol NC",
     "zones" : [ "/zone/7b9af0d4-2858-4629-b117-5d7810993bcd" ]
    }]

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Cloud Lifecycle Management 2.1.00