POST /api/v3/envs

Create a new Environment.

Create a new Environment, either from an existing Snapshot, or from a Template VM.

POST /api/v3/envs

Request Payload Examples:

Create from Blueprint:

{
    "environment": {
        "name": "John's Environment",
        "description": "John's Environment Description",
        "projectId": "PRjTcEu83MXmpDAHTf47b-QQ2",
        "policyId": "POLs3J1NEAESn7ipYMwYq20Q2",
        "regionId": "REKolD1-ab84YIxODeMGob9A2"
    },
    "itemsCart": [
        {
            "type": 1,
            "blueprintId": "BPitsTtiUS27hEsHcVZcZsxw2",
            "snapshotId": "SShJUCH6_S8qI6RReprck7tw2"
        }
    ]
}

Create custom Environment (from Template VMs):

{
    "environment": {
        "name": "John's Environment No. 3",
        "description": "John's Environment Description",
        "projectId": "PRjTcEu83MXmpDAHTf47b-QQ2",
        "policyId": null,
        "regionId": "REKolD1-ab84YIxODeMGob9A2"
    },
    "itemsCart": [
        {
            "type": 2,
            "name": "VM Name",
            "description": "VM Description",
            "templateVmId": "VMyFyls16PYN0dZRUfYIqskA2"
        },
        {
            "type": 2,
            "name": "VM Name 2",
            "description": "VM Description",
            "templateVmId": "VMz08ewmUVWw4CWxjTWE7bxQ2"
        }
    ]
}

Parameters

environment Describes the environment to create.
environment.name The Environment’s Name.
environment.description The Environment’s description. Optional.
environment.projectId The Project the Environment is to be created in. A list of available Projects can be obtained from here.
environment.policyId The Policy to use with the Environment. This is required only when creating from Snapshot. The Policy used when creating from Template VMs is the default Policy defined in the Project.
A list of available Policies can be obtained from here.
To get the default Policy ID used get the Project here.
environment.regionId The Region the Environment is to be created in. A list of available Regions can be obtained from here.
itemsCart A list of items to create the Environment from.
itemsCart.type Enumeration of values:

  • BasedOnBp = 1
  • AddTemplateVm = 2

BasedOnBp ItemCarts are can only be used as the single item in the list. They are used to create an Environment from a Blueprint Snapshot.

AddTemplateVm ItemCarts can appear one or more times. They are used to create an Environment from a set Template VMs.

itemsCart.blueprintId Applicable for BasedOnBp type ItemCarts. The Blueprint to use to create the Environment from. Optional if given a snapshotId. A list of available Blueprints can be obtained from here.
itemsCart.snapshotId Applicable for BasedOnBp type ItemCarts. The Snapshot to use to create the Environment from. Optional, must specify blueprintId, the Environment is created from the default Snapshot on the given Blueprint. A Snapshot can be obtained from here.
itemsCart.name Applicable for AddTemplateVm type ItemCarts. The name of the VM.
itemsCart.description Applicable for AddTemplateVm type ItemCarts. The description of the VM.
itemsCart.templateVmId Applicable for AddTemplateVm type ItemCarts. The Template VM ID to use to create the VM from. A list of available Template VMs can be obtained here.

Response examples

From Blueprint Snapshot:

{
    "resources": {
        "cpuCount": 1,
        "diskSizeMB": 826,
        "memorySizeMB": 128
    },
    "vms": [
        {
            "name": "ApacheSample",
            "description": "My machine",
            "osTypeName": "Linux",
            "imageUrl": "/resources/imgs/cs/machines_icon_orange.png",
            "resources": {
                "cpuCount": 1,
                "diskSizeMB": 826,
                "memorySizeMB": 128
            },
            "domainName": null,
            "internalIPs": [],
            "macAddresses": [],
            "canAddMultipleInstances": true,
            "hostName": "XApacheSample",
            "vanityName": null,
            "httpAccessEnabled": true,
            "startWithHttps": false,
            "user": "root",
            "password": "showmethemoney",
            "id": "MCc2XUhlc4FCSnXs-4r7orTg2"
        }
    ],
    "environmentId": "ENHDFU_rUrgfD1YdDSWJVriQ2"
}

From Template VMs:

{
    "resources": {
        "cpuCount": 2,
        "diskSizeMB": 24576,
        "memorySizeMB": 1024
    },
    "vms": [
        {
            "name": "VM Name",
            "description": "VM Description",
            "osTypeName": null,
            "imageUrl": "/ImageHandler.ashx?rXL5DH0iKAm9EtYscPdMAw2",
            "resources": {
                "cpuCount": 1,
                "diskSizeMB": 12288,
                "memorySizeMB": 512
            },
            "domainName": null,
            "internalIPs": [],
            "macAddresses": [],
            "canAddMultipleInstances": true,
            "hostName": null,
            "vanityName": null,
            "httpAccessEnabled": true,
            "startWithHttps": false,
            "user": "Administrator",
            "password": null,
            "id": "MCWDfD3slTbJNGl-MJEcPg7A2"
        },
        {
            "name": "VM Name 2",
            "description": "VM Description",
            "osTypeName": null,
            "imageUrl": "/ImageHandler.ashx?1YTwBlG87xLZFAtVPBGN_Q2",
            "resources": {
                "cpuCount": 1,
                "diskSizeMB": 12288,
                "memorySizeMB": 512
            },
            "domainName": null,
            "internalIPs": [],
            "macAddresses": [],
            "canAddMultipleInstances": true,
            "hostName": null,
            "vanityName": null,
            "httpAccessEnabled": false,
            "startWithHttps": false,
            "user": "Administrator",
            "password": null,
            "id": "MC0J5KBSmuDMJV0rQRvYiqfw2"
        }
    ],
    "environmentId": "ENrwmIocZbHiNDC1p4jLcNPA2"
}

Not all VMs information is available at this stage, like password and hostName. To query Environment VMs use the request here.