Table of Contents |
---|
Introduction
This tutorial continues on from Get Started with the Abiquo API!
Modify an entity through the API
Because the VM entity is a special case, we are going to look at two types of modifications: configuring a VM and changing the state of a VM.
But for most entities you can simply retrieve a data object with a GET request, modify the data object, and then perform a PUT request.
Warning |
---|
Links do more than just take you to related objects–they also define the configuration of a VM. When you edit the data object, take care not to accidentally remove any links because you could accidentally remove a disk or a NIC or perform some other unintended action! |
...
- If your VM is deployed and it doesn't have network hot-reconfigure, then shut it down
- Open the browser console at the Network tab and record actions
- Edit the VM, drag go to Network → Private → select network → drag and drop an IP, and save the VM
- Examine the PUT request and look for the link to the NIC and expand it. It will probably be at the end of the links section.
...
Include Page | ||||
---|---|---|---|---|
|
Delete an entity
To delete an entity, simply perform a DELETE request to the API link. But remember that there may be restrictions on what you can delete. For example, you cannot delete a virtual datacenter that contains virtual appliances. If we delete the VM using the following query, it will be removed from the platform (and if it exists on the hypervisor, it will be destroyed). The NIC we added will be detached and released back into the virtual datacenter.
...