0 Replies Latest reply: Mar 27, 2013 10:41 PM by jack.yu RSS

    Determining Network Profile's identifier in VM/Assembly POSTing requests

    jack.yu
      We have been asked to clarify some ambiguities about configuring Network section of the assembly deployment plan and the networks section of the VM when POSTing requests to create service instances through Cloud API. For creating/configuring network profiles, please refer to [Creation Network Profile as of 12.1.0.2 EM|http://docs.oracle.com/cd/E24628_01/doc.121/e28814/cloud_iaas_setup.htm#EMCLO220].

      From Cloud API, the network profiles are modeled as the application/oracle.com.cloud.common.VNet resource. [IaaS Resource Model as of 12.1.0.2 EM with 12.1.0.4 Cloud Service Portal Plugin |http://docs.oracle.com/cd/E24628_01/doc.121/e28814/iaas_api.htm#CDEGBJAB]. For Cloud API clients, VNets may be introspected via the Zone resource.

      For example: (all paths are relative to EM end point)
      <h5>Get the list of Iaas Zones to introspect</h5>
      -----
      GET /em/cloud/service_family_type/iaas?zones
      -----
      Here is the response:
      -----
      {
      "zones" : {
      "media_type" : "application/oracle.com.cloud.common.Zone+json" ,
      "total" : "3" ,
      "elements" :
      [
      {
      "uri" : "/em/cloud/iaas/zone/541C994DD1D06EE6F089D1EA776B2466" ,
      "name" : "IDCZone" ,
      "media_type" : "application/oracle.com.cloud.iaas.Zone+json" ,
      "service_family_type" : "iaas" ,
      "type" : "vm_zone"
      } ,
      {
      "uri" : "/em/cloud/iaas/zone/91865220AC536E78BBF76DD40934AC06" ,
      "name" : "MyCloud" ,
      "media_type" : "application/oracle.com.cloud.iaas.Zone+json" ,
      "service_family_type" : "iaas" ,
      "type" : "vm_zone"
      } ,
      {
      "uri" : "/em/cloud/iaas/zone/11F4CB2F0D394A67AA8C1836059E7345" ,
      "name" : "Zone_sr" ,
      "media_type" : "application/oracle.com.cloud.iaas.Zone+json" ,
      "service_family_type" : "iaas" ,
      "type" : "vm_zone"
      }
      ]
      }
      }
      -----
      <h5>From the Zone resource, determine the VNets that may be used when POSTing service instances on the Zone</h5>
      -----
      GET /em/cloud/iaas/zone/541C994DD1D06EE6F089D1EA776B2466?vnets
      -----
      Here is the response
      -----
      {
      "vnets" : {
      "media_type" : "application/oracle.com.cloud.common.VNet+json" ,
      "total" : "2" ,
      "elements" :
      [
      {
      "uri" : "/em/cloud/iaas/oracle%3AdefaultService%3Aem%3Aprovisioning%3A1%3AnetConfig%3AD7C43DB996A741F5E0431980578CB5C1" ,
      "context_id" : "oracle:defaultService:em:provisioning:1:netConfig:D7C43DB996A741F5E0431980578CB5C1" ,
      "media_type" : "application/oracle.com.cloud.common.VNet+json" ,
      "id" : "oracle:defaultService:em:provisioning:1:netConfig:D7C43DB996A741F5E0431980578CB5C1"
      } ,
      {
      "uri" : "/em/cloud/iaas/oracle%3AdefaultService%3Aem%3Aprovisioning%3A1%3AnetConfig%3AD7C43DB9969841F5E0431980578CB5C1" ,
      "context_id" : "oracle:defaultService:em:provisioning:1:netConfig:D7C43DB9969841F5E0431980578CB5C1" ,
      "media_type" : "application/oracle.com.cloud.common.VNet+json" ,
      "id" : "oracle:defaultService:em:provisioning:1:netConfig:D7C43DB9969841F5E0431980578CB5C1"
      }
      ]
      }
      }
      -----

      The value of "context_id" attribute of the VNet is the identifier for the Network Profile when configuring POSTing content body.