Modifies the hardware for a VM. The number of CPUs, amount or memory, and disk size can be modified.
GET https://use.cloudshare.com/API/v2/Env/EditMachineHardware?envId=<env?&vmID=<vm>&NumCpus=<cpu>&MemorySizeMBs=<mem>&DiskSizeGBs=<disk>&UserApiId=<id>&token=<token>×tamp=<time>&HMAC=<signature>
Parameters
envId | The unique id for the environment. Example: I5ADJ4VCMBTB |
vmId | The unique id for the VM. Example: YWRFJAGBJ1SB |
NumCpus | The number of CPUs to set in the VM. |
MemorySizeMBs | The memory size, in MB, to set in the VM. Must be at least 512MB. Max size is set by quota. Example: 2048 |
DiskSizeGBs | The disk size, in GB, to set in the VM. Disk size cannot be reduced. Example: 100 |
Response example
If the request is successful (status_code is 0x20000), the following response will be returned:
{ { "conflictsFound" : false, "conflicts" : [] }, "remaining_api_calls": 99954, "status_additional_data": null, "status_code": "0x20000", "status_text": "Success" }
If the request is unsuccessful, the status_code and status_text will indicate the problem. The following are possible error codes:
status_code | status_text | description |
---|---|---|
0x50041 | EditHardwareUnspecifiedError | 0x50042 | EditHardwarePerMachineMaxCpusExceeded | the maximum number of CPUs was exceeded | 0x50043 | EditHardwareUnsupportedNumOfCpus | invalid number of CPUs (not supported) |
0x50044 | EditHardwareNegativeRam | memory size cannot be negative |
0x50045 | EditHardwareNegativeDisk | disk size cannot be negative |
0x50046 | EditHardwareNegativeCpus | the number of CPUs cannot be negative |
0x50047 | EditHardwareLoweredDiskSize | disk size cannot be reduced |
0x50048 | EditHardwareRamOverQuota | memory size exceeds quota |
0x50049 | EditHardwareDiskOverQuota | disk size exceeds quota |
0x5004a | EditHardwareCpuOverQuota | number of CPUs exceeds quota |