// removed jquery ui css and js

Create Deployment Environment

Details

API Details
NameCreate Deployment Environment
DescriptionCreate deployment environments to map the cloud infrastructure to deployed applications.
MethodPOST
URI/v1/environments
CloudCenter Release
  • Updated in CloudCenter 4.0
  • Enhanced in CloudCenter 4.2 to include the cloudId, totalDeployments, and costDetails attributes and to reflect a modified associatedClouds attribute. 
  • Enhanced in CloudCenter 4.4 to reflect a modified associatedClouds attribute. See the Deployment Environments section for the relevant release for additional context.  
    • Includes the regionId of each associated cloud account.  
    • Contains new sections called cloudAssociationDefaults and default
  • Enhanced in CloudCenter 4.8.2 to include the extensionId attribute. See Example 2 below and the Configuring ServiceNow Extensions section for the relevant release for additional context.
Notes
ESB Header

action: create.environments

See the Enterprise Service Bus (ESB) section for the relevant release for additional context.

Example 1 – Without Extension Details

curl -k -X POST -H "Accept: application/json" -H "Content-Type: application/json" -u cliqradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>/v1/environments"

Request Body

{
    "name": "AllClouds",
    "description": "",
    "allowedClouds": null,
    "defaultSettings": "{\"defaultCloud\":\"Openstack-na-west1\",
\"defaultInstanceType\":\"5073b9a8-....-....-....-..................\"}",
    "requiresApproval": false,
    "associatedClouds": [
        {
            "regionId": "1",
            "regionName": "Openstack-na-west1",
            "regionDisplayName": "North America West",
            "cloudFamily": "Openstack",
            "cloudId": "1",
            "cloudAccountId": "1",
            "cloudName": "Openstack",
            "cloudAccountName": "ClAcc1",
            "cloudAssociationDefaults":
            [
                {
                    "name": "publicIpAllocate",
                    "value": "true"
                },
                {
                    "name": "TenantId",
                    "value": "9ecc4e427d9844.................."
                }, 
                {
                    "name": "TenantName",
                    "value": "arch"
                }, 
                {
                    "name": "networkId",
                    "value": "ae358c6c-....-....-....-............"

                }, 
                {
                    "name": "privateIPAllocationMode",
                    "value": "DHCP"
                },
                {
                    "name": "networkName",
                    "value": "saad-net01"
                }
            ],
            "default": true
        }, 
        {
            "regionId": "1",
            "regionName": "Openstack-na-west1",
            "regionDisplayName": "North America West",
            "cloudFamily": "Openstack",
            "cloudId": "1",
            "cloudAccountId": "2",
            "cloudName": "Openstack",
            "cloudAccountName": "ClAcc2",
            "cloudAssociationDefaults":
            [
                {
                    "name": "publicIpAllocate",
                    "value": "true"
                },
                {
                    "name": "TenantId",
                    "value": "9ecc4e427d98441faeda6cc90decaac1"
                },
                {
                    "name": "TenantName",
                    "value": "arch"
                },
                {
                    "name": "networkId",
                    "value": "acb2b98e-ad27-4dcf-9ec2-78c66b852cf3"
                },
                {
                    "name": "privateIPAllocationMode",
                    "value": "DHCP"
                },
                {
                    "name": "networkName",
                    "value": "arch-net01"
                }
            ],
            "default": false
        }, 
        {
            "regionId": "2",
            "regionName": "VMware-Dev1",
            "regionDisplayName": "Dev1",
            "cloudFamily": "Vmware",
            "cloudId": "2",
            "cloudAccountId": "3",
            "cloudName": "VMware",
            "cloudAccountName": "arch",
            "cloudAssociationDefaults":
            [
                {
                    "name": "publicIpAllocate",
                    "value": "true"
                },
                {
                    "name": "UserClusterName",
                    "value": "test"
                },
                {
                    "name": "networkId",
                    "value": "1015-SE (CliQrDSwitch)"
                },
                {
                    "name": "UserTargetDeploymentFolder",
                    "value": "/arch"
                },
                {
                    "name": "UserDataCenterName",
                    "value": "SCL2"
                },
                {
                    "name": "privateIPAllocationMode",
                    "value": ""
                },
                {
                    "name": "networkName",
                    "value": "1015-SE (CliQrDSwitch)"
                },
                {
                    "name": "UserDatastoreCluster",
                    "value": "QA-DS-cluster"
                }
            ],
            "default": true
        }, {

            "regionId": "3",
            "regionName": "AWSCloud-us-east-1",
            "regionDisplayName": "US East (Virginia)",
            "cloudFamily": "Amazon",
            "cloudId": "4",
            "cloudAccountId": "5",
            "cloudName": "AWSCloud",
            "cloudAccountName": "QA_AWS",
            "cloudAssociationDefaults":
            [
                {
                    "name": "publicIpAllocate",
                    "value": "true"
                },
                {
                    "name": "vpcId",
                    "value": "vpc-3e41595b"
                },
                {
                    "name": "networkId",
                    "value": "subnet-1fafee46"
                }, 
                {
                    "name": "availabilityZoneId",
                    "value": "us-east-1a"
                }, 
                {
                    "name": "subnetId",
                    "value": "subnet-1fafee46"
                }, {

                    "name": "privateIPAllocationMode",
                    "value": "DHCP"
                },
                {
                    "name": "networkName",
                    "value": "subnet-1fafee46 | CIDR: 10.1.1.0/2"
                }
            ],
            "default": true
        },
        {
            "regionId": "2",
            "regionName": "VMware-Dev1",
            "regionDisplayName": "Dev1",
            "cloudFamily": "Vmware",
            "cloudId": "2",
            "cloudAccountId": "10",
            "cloudName": "VMware",
            "cloudAccountName": "sanand",
            "cloudAssociationDefaults": [],
            "default": false
        }
    ],
}

Response

When you issue a GET request using the  HTTP Location URL, you receive the following response:

  {
    "id": "1",
    "resource": "https://<HOST>:<PORT>/v1/environments/1/",
    "perms": [
        "read",
        "delete",
        "execute",
        "write",
        "administration",
        "authorize",
        "move_out",
        "approve",
        "move_in",
        "manage"
    ],
    "name": "AllClouds",
    "description": "",
    "allowedClouds": null,
    "defaultSettings": "{\"defaultCloud\":\"Openstack-na-west1\",
\"defaultInstanceType\":\"5073b9a8-....-....-....-..................\"}",
    "requiresApproval": false,
    "associatedClouds": [
        {
            "regionId": "1",
            "regionName": "Openstack-na-west1",
            "regionDisplayName": "North America West",
            "cloudFamily": "Openstack",
            "cloudId": "1",
            "cloudAccountId": "1",
            "cloudName": "Openstack",
            "cloudAccountName": "ClAcc1",
            "cloudAssociationDefaults":
            [
                {
                    "name": "publicIpAllocate",
                    "value": "true"
                },
                {
                    "name": "TenantId",
                    "value": "9ecc4e427d9844.................."
                }, 
                {
                    "name": "TenantName",
                    "value": "arch"
                }, 
                {
                    "name": "networkId",
                    "value": "ae358c6c-....-....-....-............"

                }, 
                {
                    "name": "privateIPAllocationMode",
                    "value": "DHCP"
                },
                {
                    "name": "networkName",
                    "value": "saad-net01"
                }
            ],
            "default": true
        }, 
        {
            "regionId": "1",
            "regionName": "Openstack-na-west1",
            "regionDisplayName": "North America West",
            "cloudFamily": "Openstack",
            "cloudId": "1",
            "cloudAccountId": "2",
            "cloudName": "Openstack",
            "cloudAccountName": "ClAcc2",
            "cloudAssociationDefaults":
            [
                {
                    "name": "publicIpAllocate",
                    "value": "true"
                },
                {
                    "name": "TenantId",
                    "value": "9ecc4e427d98441faeda6cc90decaac1"
                },
                {
                    "name": "TenantName",
                    "value": "arch"
                },
                {
                    "name": "networkId",
                    "value": "acb2b98e-ad27-4dcf-9ec2-78c66b852cf3"
                },
                {
                    "name": "privateIPAllocationMode",
                    "value": "DHCP"
                },
                {
                    "name": "networkName",
                    "value": "arch-net01"
                }
            ],
            "default": false
        }, 
        {
            "regionId": "2",
            "regionName": "VMware-Dev1",
            "regionDisplayName": "Dev1",
            "cloudFamily": "Vmware",
            "cloudId": "2",
            "cloudAccountId": "3",
            "cloudName": "VMware",
            "cloudAccountName": "arch",
            "cloudAssociationDefaults":
            [
                {
                    "name": "publicIpAllocate",
                    "value": "true"
                },
                {
                    "name": "UserClusterName",
                    "value": "test"
                },
                {
                    "name": "networkId",
                    "value": "1015-SE (CliQrDSwitch)"
                },
                {
                    "name": "UserTargetDeploymentFolder",
                    "value": "/arch"
                },
                {
                    "name": "UserDataCenterName",
                    "value": "SCL2"
                },
                {
                    "name": "privateIPAllocationMode",
                    "value": ""
                },
                {
                    "name": "networkName",
                    "value": "1015-SE (CliQrDSwitch)"
                },
                {
                    "name": "UserDatastoreCluster",
                    "value": "QA-DS-cluster"
                }
            ],
            "default": true
        }, {

            "regionId": "3",
            "regionName": "AWSCloud-us-east-1",
            "regionDisplayName": "US East (Virginia)",
            "cloudFamily": "Amazon",
            "cloudId": "4",
            "cloudAccountId": "5",
            "cloudName": "AWSCloud",
            "cloudAccountName": "QA_AWS",
            "cloudAssociationDefaults":
            [
                {
                    "name": "publicIpAllocate",
                    "value": "true"
                },
                {
                    "name": "vpcId",
                    "value": "vpc-3e41595b"
                },
                {
                    "name": "networkId",
                    "value": "subnet-1fafee46"
                }, 
                {
                    "name": "availabilityZoneId",
                    "value": "us-east-1a"
                }, 
                {
                    "name": "subnetId",
                    "value": "subnet-1fafee46"
                }, {

                    "name": "privateIPAllocationMode",
                    "value": "DHCP"
                },
                {
                    "name": "networkName",
                    "value": "subnet-1fafee46 | CIDR: 10.1.1.0/2"
                }
            ],
            "default": true
        },
        {
            "regionId": "2",
            "regionName": "VMware-Dev1",
            "regionDisplayName": "Dev1",
            "cloudFamily": "Vmware",
            "cloudId": "2",
            "cloudAccountId": "10",
            "cloudName": "VMware",
            "cloudAccountName": "sanand",
            "cloudAssociationDefaults": [],
            "default": false
        }
    ],
    "totalDeployments": 0,
    "costDetails": null
}

Example 2 – With Extension Details

curl -k -X POST -H "Accept: application/json" -H "Content-Type: application/json" -u cliqradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>/v1/environments"

Request

{
   "name":"ENV_17",
   "description":"API Test",
   "allowedClouds":null,
   "extensionId":"2",
   "requiresApproval":false,
   "associatedClouds":[
      {
         "regionId":"1",
         "regionName":"openstack-RegionOne",
         "regionDisplayName":"RegioneOne",
         "cloudFamily":"Openstack",
         "cloudId":"1",
         "cloudAccountId":"1",
         "cloudName":"openstack",
         "cloudAccountName":"openstack-ac",
         "cloudAssociationDefaults":[

         ],
         "default":false
      }
   ]
}

Response

{
    "id": "1",
    "resource": "https://<HOST>:<PORT>/v1/environments/17/",
    "perms": [
        "read",
        "delete",
        "execute",
        "write",
        "administration",
        "authorize",
        "move_out",
        "approve",
        "move_in",
        "manage"
    ],
    "name": "ENV_17",
    "description": "ExtensionID Test",
    "allowedClouds": null,
    "extensionId":"2",
    "defaultSettings": "{\"defaultCloud\":\"Openstack-na-west1\"}",
    "requiresApproval": false,
    "associatedClouds": [
        {
            "regionId": "1",
            "regionName": "Openstack-na-west1",
            "regionDisplayName": "North America West",
            "cloudFamily": "Openstack",
            "cloudId": "1",
            "cloudAccountId": "1",
            "cloudName": "Openstack",
            "cloudAccountName": "ClAcc1",
            "cloudAssociationDefaults": [ ],
            "default": true
        } ],
    "totalDeployments": 0,
    "costDetails": null
}

Request Attributes

name
  • DescriptionThe name assigned for this CloudCenter ResourceValid characters are letters, numbers, underscores, and spaces.

  • Type: String

description
  • DescriptionA brief description for this CloudCenter Resource.

  • Type: String

extensionId
  • DescriptionUnique, system-generated identifier for the extension. See the Extensions section for the relevant release for additional details.
  • Type: String

defaultSettings
  • Description: The default settings for the deployment environment
  • Type: String

requiresApproval
  • Description: A flag to indicate if approval is required to deploy in this environment
  • Type: Boolean
associatedClouds (click for additional details)

Response Attributes

id
  • DescriptionUnique, system-generated identifier for this CloudCenter Resource.

  • Type: String
resource
  • Description: Unique URL to access this resource.
  • Type: String
perms (click for additional details)
name
  • DescriptionThe name assigned for this CloudCenter ResourceValid characters are letters, numbers, underscores, and spaces.

  • Type: String

description
  • DescriptionA brief description for this CloudCenter Resource.

  • Type: String
allowedClouds
  • Description: Identifies cloud infrastructures under the cloud accounts set up and shared by their parent tenant. If the tenant does not have any restriction, this attribute displays "null" to indicate the lack of restrictions.
  • Type: String
defaultSettings
  • Description: The default settings for the deployment environment
  • Type: String
requiresApproval
  • Description: A flag to indicate if approval is required to deploy in this environment
  • Type: Boolean
associatedClouds (click for additional details)
totalDeployments
  • Description: The total number of deployments associated with this deployment environment
  • Type: Long
costDetails
  • Description: A breakdown of multiple costs associated with this cloud.
  • Type: Sequence of cost details

     totalCloudCost 
    • Description: The cloud infrastructure costs charged by the cloud provider. See the Supported Public Clouds or the Supported Datacenters and Private Clouds section for the relevant release for all deployments, runs, users, VMs, instance types, and so forth. See the CloudCenter Cost and Fees section for the relevant release for additional context.
    • Type: Float

     totalAppCost 
    • Description: The total cost of using metered applications. See the CloudCenter Cost and Fees section and the Markterplace Application Fee section for the relevant release for additional context.
    • Type: Float
     totalJobsCost 
    • Description: The total cost associated with the cloud for a particular job, the management cost associated with the jobs run to date.
    • Type: Float



© 2017-2019 Cisco Systems, Inc. All rights reserved