PUT /api/v3/envs

Adds one or more VMs to an existing environment

Request Path

PUT /api/v3/envs

Request Payload Example

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

Parameters

envId The ID of the environment. To retrieve environment IDs, use GET /api/v3/envs.
itemsCart Specifies templates of VMs to add to the environment
itemsCart.type Specifies a type of item to add. Must be 2, which denotes a VM from a VM template.
itemsCart.name A name for the VM
itemsCart.description Optional. A description for the VM.
itemsCart.templateVmId The ID of the VM template from which to create the VM. To retrieve available VM templates, use GET /api/v3/templates.

Response Example

{
    "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 VM information is available at this stage, including password and hostName. To query environment VMs, use GET /api/v3/envs/actions/getextended.