Develop > API calls > Application design APIs > Import an application design

Import an application design

Import an application design by providing the application design in JSON format as input. If the design already exists, then an error is returned.

URI Method Parameters Returns
http://[host]:[port]/csa/api/codar/app-design/import POST JSON

201 - successful
400 - bad request
401 - authorization failed
500 - internal server error

Example

The following URL was sent:

https://localhost:8444/csa/api/codar/app-design/import

The following JSON was sent:

{
  "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology",
  "groupId" : "com.hp.csa",
  "artifactId" : "3eb835ae-750f-41c9-8861-de70a285ca43",
  "version" : "1.0.0",
  "displayName" : "Test_Design-2",
  "description" : "my design 02",
  "resources" : [ {
    "id" : "VcenterServer0001",
    "name" : "vCenter Server 1",
   "component" : {
      "@self" : "/csa/api/topology-model/component-type/b83f4e21-d8a9-4ff3-a76e-3a69775d1d86"
    },
     ...
}

For complete output, see Import an application design example.

The following JSON was returned:

{
  "@self" : "/csa/api/topology-model/topology/e57673db-0ee7-4061-8f9e-ffdcabc07b4c",
  "@type" : "urn:x-hp:2013:software:cloud:topology_model:topology",
  "groupId" : "com.hp.csa",
  "artifactId" : "3eb835ae-750f-41c9-8861-de70a285ca40",
  "version" : "1.0.0",
  "displayName" : "Test_Design-1",
  "description" : "my design",
  "resources" : [ {
    "id" : "VcenterServer0001",
    "name" : "vCenter Server 1",
    "component" : {
      "@self" : "/csa/api/topology-model/component-type/b83f4e21-d8a9-4ff3-a76e-3a69775d1d86"
    },
    ...
}

For complete output, see Import an application design example.

Note: If you have a Scaling Group component in the design, you must change the ID and remove "@self" attribute as shown in the following example:

"id" : "0c66986b-a62f-4a99-ba1a-1c05e39b4295", ! Modify the ID
"name" : "SG",
"component" : {
  "@self" : "/csa/api/topology-model/component-type/283f9da2-44c7-4208-bcdd-67f9fdddc02e", ! Remove this line
  "groupId" : "com.hp.csa.type.scalingGroup",
  "artifactId" : "ScalingGroupType_0c66986b-a62f-4a99-ba1a-1c05e39b4295", ! Modify the ID
  "version" : "1"
},