Develop > Appendix A: API return examples > Import an application design example

Import an application design example

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

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"
    },
    "properties" : [ {
      "propertyKey" : "requestedMemorySize",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "vmTemplateReference",
      "propertyValue" : {
        "value" : "test",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "cpuCount",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "ipAddressList",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "closeSession",
      "propertyValue" : {
        "value" : "true",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "privateKey",
      "propertyValue" : {
        "value" : "",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "memorySize",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "requestedCpuCount",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "customizationSpec",
      "propertyValue" : {
        "value" : "test",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "hostname",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "macAddress",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "password",
      "propertyValue" : {
        "value" : "null",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "response",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "_modifiable_properties",
      "propertyValue" : {
        "value" : "",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "username",
      "propertyValue" : {
        "value" : "test",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "vmID",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "ipAddress",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "vmNamePrefix",
      "propertyValue" : {
        "value" : "test",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    } ],
    "outgoingRelations" : [ ],
    "annotations" : {
      "description" : "",
      "displayName" : "vCenter Server 1",
      "y" : "-400",
      "x" : "-400"
    }
  }, {
    "id" : "VcenterNetworkInterface0001",
    "name" : "vCenter Network Interface 1",
    "component" : {
      "@self" : "/csa/api/topology-model/component-type/05c69cad-ad1d-4285-befe-4963c7f86ae1"
    },
    "properties" : [ {
      "propertyKey" : "response",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "_modifiable_properties",
      "propertyValue" : {
        "value" : "",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "networkInterfaceType",
      "propertyValue" : {
        "value" : "E1000",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "networkInterfaceId",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "portGroupName",
      "propertyValue" : {
        "value" : "test",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "vmID",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "macAddress",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "ipAddresses",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    } ],
    "outgoingRelations" : [ {
      "relationType" : "association",
      "id" : "rel0001",
      "properties" : [ {
        "propertyKey" : "_modifiable_properties",
        "propertyValue" : {
          "value" : "",
          "type" : "string",
          "confidential" : false,
          "consumerVisible" : true
        }
      }, {
        "propertyKey" : "_relation_type",
        "propertyValue" : {
          "value" : {
            "first" : "Association",
            "second" : "ASSOCIATION"
          },
          "type" : "pair",
          "confidential" : false,
          "consumerVisible" : true
        }
      } ],
      "relationDescriptorName" : "VcenterNetworkInterfaceTypeToVcenterServerType",
      "resourceReference" : {
        "name" : "vCenter Server 1"
      }
    } ],
    "annotations" : {
      "description" : "",
      "displayName" : "vCenter Network Interface 1",
      "y" : "-400",
      "x" : "-200"
    }
  } ],
  "revision" : 0,
  "properties" : [ {
    "propertyKey" : "metamodelId",
    "propertyValue" : {
      "value" : "test",
      "type" : "string",
      "confidential" : false,
      "consumerVisible" : true
    }
  }, {
    "propertyKey" : "is_express",
    "propertyValue" : {
      "value" : null,
       "type" : "boolean",
       "confidential" : false,
       "consumerVisible" : true
   }
 } ],
 "tagIds" : [ ],
 "state" : "UNLOCKED",
 "profiles" : [ ],
}

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"
    },
    "properties" : [ {
      "propertyKey" : "requestedMemorySize",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "vmTemplateReference",
      "propertyValue" : {
        "value" : "test",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "cpuCount",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "ipAddressList",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "closeSession",
      "propertyValue" : {
        "value" : "true",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "privateKey",
      "propertyValue" : {
        "value" : "",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "memorySize",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "requestedCpuCount",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "customizationSpec",
      "propertyValue" : {
        "value" : "test",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "hostname",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "macAddress",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "password",
      "propertyValue" : {
        "value" : "null",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "response",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "_modifiable_properties",
      "propertyValue" : {
        "value" : "",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "username",
      "propertyValue" : {
        "value" : "test",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "vmID",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "ipAddress",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "vmNamePrefix",
      "propertyValue" : {
        "value" : "test",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
     } ],
     "outgoingRelations" : [ ],
     "annotations" : {
       "description" : "",
       "displayName" : "vCenter Server 1",
       "y" : "-400",
       "x" : "-400"
     }
   }, {
     "id" : "VcenterNetworkInterface0001",
     "name" : "vCenter Network Interface 1",
     "component" : {
       "@self" : "/csa/api/topology-model/component-type/05c69cad-ad1d-4285-befe-4963c7f86ae1"
      },
      "properties" : [ {
      "propertyKey" : "response",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "_modifiable_properties",
      "propertyValue" : {
        "value" : "",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "networkInterfaceType",
      "propertyValue" : {
        "value" : "E1000",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "networkInterfaceId",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "portGroupName",
      "propertyValue" : {
        "value" : "test",
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "vmID",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "macAddress",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    }, {
      "propertyKey" : "ipAddresses",
      "propertyValue" : {
        "value" : null,
        "type" : "string",
        "confidential" : false,
        "consumerVisible" : true
      }
    } ],
    "outgoingRelations" : [ {
      "relationType" : "association",
      "id" : "rel0001",
      "properties" : [ {
        "propertyKey" : "_modifiable_properties",
        "propertyValue" : {
          "value" : "",
          "type" : "string",
          "confidential" : false,
          "consumerVisible" : true
        }
      }, {
        "propertyKey" : "_relation_type",
        "propertyValue" : {
          "value" : {
            "first" : "Association",
            "second" : "ASSOCIATION"
          },
          "type" : "pair",
          "confidential" : false,
          "consumerVisible" : true
        }
      } ],
      "relationDescriptorName" : "VcenterNetworkInterfaceTypeToVcenterServerType",
      "resourceReference" : {
        "name" : "vCenter Server 1"
      }
    } ],
    "annotations" : {
      "description" : "",
      "displayName" : "vCenter Network Interface 1",
      "y" : "-400",
      "x" : "-200"
    }
  } ],
  "revision" : 0,
  "properties" : [ {
    "propertyKey" : "metamodelId",
    "propertyValue" : {
      "value" : "test",
      "type" : "string",
      "confidential" : false,
     "consumerVisible" : true
     }
   }, {
     "propertyKey" : "is_express",
     "propertyValue" : {
       "value" : null,
       "type" : "boolean",
       "confidential" : false,
       "consumerVisible" : true
     }
  } ],
   "tagIds" : [ ],
   "state" : "UNLOCKED",
   "profiles" : [ ],
   "annotations" : {
     "providerType" : "independent",
     "serviceBlueprintId" : "8a818cf045d640b00145d64a7c240017"
   }
}