PUT /api/v3/envs

Add new VMs to an existing Environment.

PUT /api/v3/envs

Request Payload Examples:

{
    "envId": "EN5YTkVIYcD6kL9flyAAYyzg2",
    "itemsCart": [
        {
            "type": 2,
            "name": "VM Name",
            "description": "VM Description",
            "templateVmId": "VMyFyls16PYN0dZRUfYIqskA2"
        }
    ]
}

Parameters

envId The Environment to add VMs to
itemsCart A list of items to create the Environment from.
itemsCart.type Enumeration of values:

  • AddTemplateVm = 2

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

itemsCart.name Applicable for AddTemplateVm type ItemCarts. The name of the VM.
itemsCart.description Applicable for AddTemplateVm type ItemCarts. The description of the VM. Optional.
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.