How to remove keynode enterprises via API
- MS (Unlicensed)
This page describes the basic process to remove the VDCs under keynode enterprises via API. For a reseller, you can have customers with their own hierarchies of enterprises. A keynode enterprise is the top of a customer hierarchy and it could represent the customer's headquarters, for example. The scope of the keynode enterprise should be the parent of the scopes of the subsidiary enterprises, which can also have subsidiary enterprises in their child scopes.
You will need the following resources:
- A keynode and its subsidiary enterprises created in the platform
Your user role should have an administrator profile to manage virtual datacenters and resources, and it must include the following privileges
- ENTERPRISE_ENUMERATE
- ENTERPRISE_ADMINISTER_ALL
- USERS_MANAGE_ENTERPRISE
Your user must have the keynode enterprise and its hierarchy branch within their management scope.
The following pages describe the enterprise keynode and reseller hierarchies in the Abiquo UI.
Summary diagram
The steps in this diagram link to the API reference guide resources and data entities sections.
Detailed steps
Get the keynode enterprise by name
Reference: https://wiki.abiquo.com/api/latest/EnterprisesResource.html#list-enterprises
The name search string should be escaped for HTML, so replace spaces in the customer name with %20. For example, to search for "4xCustomer 01" use "4xCustomer%2001".
Remember that you can use the -k option for an unsecured test environment
cURL request
curl -X GET \ 'https://abiquo.example.com/api/admin/enterprises?has=4xCustomer%2001' \ -H 'Accept: application/vnd.abiquo.enterprises+json;version=5.1' \ -u user:password --verbose
Sample response
Click here to expand...{ "totalSize": 1, "links": [ { "rel": "first", "href": "https://abiquo.example.com:443/api/admin/enterprises?limit=25&has=4xCustomer 01&by=name&asc=true" }, { "rel": "last", "href": "https://abiquo.example.com:443/api/admin/enterprises?startwith=0&limit=25&has=4xCustomer 01&by=name&asc=true" } ], "collection": [ { "id": 272, "name": "4xCustomer 01", "isReservationRestricted": false, "idPricingTemplate": 46, "workflow": false, "twoFactorAuthenticationMandatory": false, "reseller": false, "keyNode": true, "diskSoftLimitInMb": 0, "diskHardLimitInMb": 0, "storageSoftInMb": 0, "storageHardInMb": 0, "vmsSoft": 0, "vmsHard": 0, "vlansSoft": 0, "vlansHard": 0, "publicIpsSoft": 0, "publicIpsHard": 0, "repositorySoftInMb": 0, "repositoryHardInMb": 0, "links": [ { "title": "4xCustomer 01", "rel": "edit", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272" }, { "title": "users", "rel": "users", "type": "application/vnd.abiquo.users+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/users" }, { "title": "properties", "rel": "properties", "type": "application/vnd.abiquo.enterpriseproperties+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/properties" }, { "title": "4xCustomerScope", "rel": "scope", "type": "application/vnd.abiquo.scope+json", "href": "https://abiquo.example.com:443/api/admin/scopes/104" }, { "title": "template definitions lists", "rel": "appslib/templateDefinitionLists", "type": "application/vnd.abiquo.templatedefinitionlists+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/appslib/templateDefinitionLists" }, { "title": "template defintion paths", "rel": "appslib/templateDefinitions", "type": "application/vnd.abiquo.templatedefinitions+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/appslib/templateDefinitions" }, { "title": "repositories", "rel": "datacenterrepositories", "type": "application/vnd.abiquo.datacenterrepositories+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/datacenterrepositories" }, { "title": "virtual machines", "rel": "virtualmachines", "type": "application/vnd.abiquo.virtualmachines+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/virtualmachines" }, { "title": "virtual appliances", "rel": "virtualappliances", "type": "application/vnd.abiquo.virtualappliances+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/virtualappliances" }, { "title": "ips", "rel": "ips", "type": "application/vnd.abiquo.privateips+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/ips" }, { "title": "virtual datacenters", "rel": "cloud/virtualdatacenters", "type": "application/vnd.abiquo.virtualdatacenters+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/virtualdatacenters" }, { "title": "res4x customer pricing model", "rel": "pricingtemplate", "type": "application/vnd.abiquo.pricingtemplate+json", "href": "https://abiquo.example.com:443/api/config/pricingtemplates/46" }, { "title": "reserved machines", "rel": "reservedmachines", "type": "application/vnd.abiquo.machines+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/reservedmachines" }, { "title": "limits", "rel": "limits", "type": "application/vnd.abiquo.limits+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/limits" }, { "title": "providerlimits", "rel": "providerlimits", "type": "application/vnd.abiquo.providerlimits+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/providerlimits" }, { "title": "volumes", "rel": "volumes", "type": "application/vnd.abiquo.volumes+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/volumes" }, { "title": "external networks", "rel": "externalnetworks", "type": "application/vnd.abiquo.vlans+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/externalnetworks" }, { "title": "pending tasks", "rel": "pendingtasks", "type": "application/vnd.abiquo.tasks+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/pendingtasks" }, { "title": "credentials", "rel": "credentials", "type": "application/vnd.abiquo.publiccloudcredentialslist+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/credentials" }, { "title": "pricingcredentials", "rel": "pricingcredentials", "type": "application/vnd.abiquo.pricingcredentialslist+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/pricingcredentials" }, { "title": "virtual appliances specs", "rel": "vappspecs", "type": "application/vnd.abiquo.virtualappliancespecs+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/vappspecs" }, { "title": "bills", "rel": "bills", "type": "application/vnd.abiquo.bills+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/272/bills" }, { "title": "billregisters", "rel": "billregisters", "type": "application/vnd.abiquo.bills+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/272/billregisters" }, { "title": "estimation", "rel": "estimation", "type": "text/plain", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/272/billregisters/action/estimate" }, { "title": "Bill providers", "rel": "billproviders", "type": "application/vnd.abiquo.billproviders+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/272/bills/action/providers" }, { "title": "Budgets", "rel": "budgets", "type": "application/vnd.abiquo.budgets+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/budgets" }, { "title": "4xResellerEnterprise", "rel": "reseller", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/268" } ], "ramSoft": 0, "ramHard": 0, "cpuSoft": 0, "cpuHard": 0 } ] }
Find the required enterprise in the collection. The enterprise should have the "keynode" attribute set to "true".
Keep the enterprise "edit" link
{ "title": "4xCustomer 01", "rel": "edit", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272" },
Get the enterprises under the keynode enterprise
Get the link with the "rel" value of "edit" for the keynode enterprise and search for the enterprises under this keynode
Reference: https://wiki.abiquo.com/api/latest/EnterprisesResource.html#list-enterprises-of-a-key-node
cURL
curl -X GET \ 'https://abiquo.example.com/api/admin/enterprises/272/action/keynode/enterprises' \ -H 'Accept: application/vnd.abiquo.enterprises+json;version=5.1'
Sample response. Success status code: 200
Click here to expand...{ "links": [], "collection": [ { "id": 272, "name": "4xCustomer 01", "isReservationRestricted": false, "idPricingTemplate": 46, "workflow": false, "twoFactorAuthenticationMandatory": false, "reseller": false, "keyNode": true, "diskSoftLimitInMb": 0, "diskHardLimitInMb": 0, "storageSoftInMb": 0, "storageHardInMb": 0, "vmsSoft": 0, "vmsHard": 0, "vlansSoft": 0, "vlansHard": 0, "publicIpsSoft": 0, "publicIpsHard": 0, "repositorySoftInMb": 0, "repositoryHardInMb": 0, "links": [ { "title": "4xCustomer 01", "rel": "edit", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272" }, { "title": "users", "rel": "users", "type": "application/vnd.abiquo.users+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/users" }, { "title": "properties", "rel": "properties", "type": "application/vnd.abiquo.enterpriseproperties+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/properties" }, { "title": "4xCustomerScope", "rel": "scope", "type": "application/vnd.abiquo.scope+json", "href": "https://abiquo.example.com:443/api/admin/scopes/104" }, { "title": "template definitions lists", "rel": "appslib/templateDefinitionLists", "type": "application/vnd.abiquo.templatedefinitionlists+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/appslib/templateDefinitionLists" }, { "title": "template defintion paths", "rel": "appslib/templateDefinitions", "type": "application/vnd.abiquo.templatedefinitions+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/appslib/templateDefinitions" }, { "title": "repositories", "rel": "datacenterrepositories", "type": "application/vnd.abiquo.datacenterrepositories+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/datacenterrepositories" }, { "title": "virtual machines", "rel": "virtualmachines", "type": "application/vnd.abiquo.virtualmachines+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/virtualmachines" }, { "title": "virtual appliances", "rel": "virtualappliances", "type": "application/vnd.abiquo.virtualappliances+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/virtualappliances" }, { "title": "ips", "rel": "ips", "type": "application/vnd.abiquo.privateips+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/ips" }, { "title": "virtual datacenters", "rel": "cloud/virtualdatacenters", "type": "application/vnd.abiquo.virtualdatacenters+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/virtualdatacenters" }, { "title": "res4x customer pricing model", "rel": "pricingtemplate", "type": "application/vnd.abiquo.pricingtemplate+json", "href": "https://abiquo.example.com:443/api/config/pricingtemplates/46" }, { "title": "reserved machines", "rel": "reservedmachines", "type": "application/vnd.abiquo.machines+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/reservedmachines" }, { "title": "limits", "rel": "limits", "type": "application/vnd.abiquo.limits+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/limits" }, { "title": "providerlimits", "rel": "providerlimits", "type": "application/vnd.abiquo.providerlimits+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/providerlimits" }, { "title": "volumes", "rel": "volumes", "type": "application/vnd.abiquo.volumes+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/volumes" }, { "title": "external networks", "rel": "externalnetworks", "type": "application/vnd.abiquo.vlans+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/externalnetworks" }, { "title": "pending tasks", "rel": "pendingtasks", "type": "application/vnd.abiquo.tasks+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/action/pendingtasks" }, { "title": "credentials", "rel": "credentials", "type": "application/vnd.abiquo.publiccloudcredentialslist+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/credentials" }, { "title": "pricingcredentials", "rel": "pricingcredentials", "type": "application/vnd.abiquo.pricingcredentialslist+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/pricingcredentials" }, { "title": "virtual appliances specs", "rel": "vappspecs", "type": "application/vnd.abiquo.virtualappliancespecs+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/vappspecs" }, { "title": "bills", "rel": "bills", "type": "application/vnd.abiquo.bills+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/272/bills" }, { "title": "billregisters", "rel": "billregisters", "type": "application/vnd.abiquo.bills+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/272/billregisters" }, { "title": "estimation", "rel": "estimation", "type": "text/plain", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/272/billregisters/action/estimate" }, { "title": "Bill providers", "rel": "billproviders", "type": "application/vnd.abiquo.billproviders+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/272/bills/action/providers" }, { "title": "Budgets", "rel": "budgets", "type": "application/vnd.abiquo.budgets+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272/budgets" }, { "title": "4xResellerEnterprise", "rel": "reseller", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/268" } ], "ramSoft": 0, "ramHard": 0, "cpuSoft": 0, "cpuHard": 0 }, { "id": 274, "name": "4xDepartment", "isReservationRestricted": false, "workflow": false, "twoFactorAuthenticationMandatory": false, "reseller": false, "keyNode": false, "diskSoftLimitInMb": 0, "diskHardLimitInMb": 0, "storageSoftInMb": 0, "storageHardInMb": 0, "vmsSoft": 0, "vmsHard": 0, "vlansSoft": 0, "vlansHard": 0, "publicIpsSoft": 0, "publicIpsHard": 0, "repositorySoftInMb": 0, "repositoryHardInMb": 0, "links": [ { "title": "4xDepartment", "rel": "edit", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274" }, { "title": "users", "rel": "users", "type": "application/vnd.abiquo.users+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/users" }, { "title": "properties", "rel": "properties", "type": "application/vnd.abiquo.enterpriseproperties+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/properties" }, { "title": "4xDepartment", "rel": "scope", "type": "application/vnd.abiquo.scope+json", "href": "https://abiquo.example.com:443/api/admin/scopes/105" }, { "title": "template definitions lists", "rel": "appslib/templateDefinitionLists", "type": "application/vnd.abiquo.templatedefinitionlists+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/appslib/templateDefinitionLists" }, { "title": "template defintion paths", "rel": "appslib/templateDefinitions", "type": "application/vnd.abiquo.templatedefinitions+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/appslib/templateDefinitions" }, { "title": "repositories", "rel": "datacenterrepositories", "type": "application/vnd.abiquo.datacenterrepositories+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/datacenterrepositories" }, { "title": "virtual machines", "rel": "virtualmachines", "type": "application/vnd.abiquo.virtualmachines+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/action/virtualmachines" }, { "title": "virtual appliances", "rel": "virtualappliances", "type": "application/vnd.abiquo.virtualappliances+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/action/virtualappliances" }, { "title": "ips", "rel": "ips", "type": "application/vnd.abiquo.privateips+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/action/ips" }, { "title": "virtual datacenters", "rel": "cloud/virtualdatacenters", "type": "application/vnd.abiquo.virtualdatacenters+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/action/virtualdatacenters" }, { "title": "reserved machines", "rel": "reservedmachines", "type": "application/vnd.abiquo.machines+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/reservedmachines" }, { "title": "limits", "rel": "limits", "type": "application/vnd.abiquo.limits+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/limits" }, { "title": "providerlimits", "rel": "providerlimits", "type": "application/vnd.abiquo.providerlimits+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/providerlimits" }, { "title": "volumes", "rel": "volumes", "type": "application/vnd.abiquo.volumes+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/action/volumes" }, { "title": "external networks", "rel": "externalnetworks", "type": "application/vnd.abiquo.vlans+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/action/externalnetworks" }, { "title": "pending tasks", "rel": "pendingtasks", "type": "application/vnd.abiquo.tasks+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/action/pendingtasks" }, { "title": "credentials", "rel": "credentials", "type": "application/vnd.abiquo.publiccloudcredentialslist+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/credentials" }, { "title": "pricingcredentials", "rel": "pricingcredentials", "type": "application/vnd.abiquo.pricingcredentialslist+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/pricingcredentials" }, { "title": "virtual appliances specs", "rel": "vappspecs", "type": "application/vnd.abiquo.virtualappliancespecs+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/vappspecs" }, { "title": "bills", "rel": "bills", "type": "application/vnd.abiquo.bills+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/274/bills" }, { "title": "billregisters", "rel": "billregisters", "type": "application/vnd.abiquo.bills+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/274/billregisters" }, { "title": "estimation", "rel": "estimation", "type": "text/plain", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/274/billregisters/action/estimate" }, { "title": "Bill providers", "rel": "billproviders", "type": "application/vnd.abiquo.billproviders+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/274/bills/action/providers" }, { "title": "Budgets", "rel": "budgets", "type": "application/vnd.abiquo.budgets+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/budgets" }, { "title": "4xResellerEnterprise", "rel": "reseller", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/268" }, { "title": "4xCustomer 01", "rel": "key-node", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272" } ], "ramSoft": 0, "ramHard": 0, "cpuSoft": 0, "cpuHard": 0 }, { "id": 273, "name": "4xDepartmentOfCustomer", "isReservationRestricted": false, "workflow": false, "twoFactorAuthenticationMandatory": false, "reseller": false, "keyNode": false, "diskSoftLimitInMb": 0, "diskHardLimitInMb": 0, "storageSoftInMb": 0, "storageHardInMb": 0, "vmsSoft": 0, "vmsHard": 0, "vlansSoft": 0, "vlansHard": 0, "publicIpsSoft": 0, "publicIpsHard": 0, "repositorySoftInMb": 0, "repositoryHardInMb": 0, "links": [ { "title": "4xDepartmentOfCustomer", "rel": "edit", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273" }, { "title": "users", "rel": "users", "type": "application/vnd.abiquo.users+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/users" }, { "title": "properties", "rel": "properties", "type": "application/vnd.abiquo.enterpriseproperties+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/properties" }, { "title": "4xDepartment", "rel": "scope", "type": "application/vnd.abiquo.scope+json", "href": "https://abiquo.example.com:443/api/admin/scopes/105" }, { "title": "template definitions lists", "rel": "appslib/templateDefinitionLists", "type": "application/vnd.abiquo.templatedefinitionlists+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/appslib/templateDefinitionLists" }, { "title": "template defintion paths", "rel": "appslib/templateDefinitions", "type": "application/vnd.abiquo.templatedefinitions+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/appslib/templateDefinitions" }, { "title": "repositories", "rel": "datacenterrepositories", "type": "application/vnd.abiquo.datacenterrepositories+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/datacenterrepositories" }, { "title": "virtual machines", "rel": "virtualmachines", "type": "application/vnd.abiquo.virtualmachines+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/action/virtualmachines" }, { "title": "virtual appliances", "rel": "virtualappliances", "type": "application/vnd.abiquo.virtualappliances+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/action/virtualappliances" }, { "title": "ips", "rel": "ips", "type": "application/vnd.abiquo.privateips+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/action/ips" }, { "title": "virtual datacenters", "rel": "cloud/virtualdatacenters", "type": "application/vnd.abiquo.virtualdatacenters+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/action/virtualdatacenters" }, { "title": "reserved machines", "rel": "reservedmachines", "type": "application/vnd.abiquo.machines+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/reservedmachines" }, { "title": "limits", "rel": "limits", "type": "application/vnd.abiquo.limits+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/limits" }, { "title": "providerlimits", "rel": "providerlimits", "type": "application/vnd.abiquo.providerlimits+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/providerlimits" }, { "title": "volumes", "rel": "volumes", "type": "application/vnd.abiquo.volumes+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/action/volumes" }, { "title": "external networks", "rel": "externalnetworks", "type": "application/vnd.abiquo.vlans+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/action/externalnetworks" }, { "title": "pending tasks", "rel": "pendingtasks", "type": "application/vnd.abiquo.tasks+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/action/pendingtasks" }, { "title": "credentials", "rel": "credentials", "type": "application/vnd.abiquo.publiccloudcredentialslist+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/credentials" }, { "title": "pricingcredentials", "rel": "pricingcredentials", "type": "application/vnd.abiquo.pricingcredentialslist+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/pricingcredentials" }, { "title": "virtual appliances specs", "rel": "vappspecs", "type": "application/vnd.abiquo.virtualappliancespecs+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/vappspecs" }, { "title": "bills", "rel": "bills", "type": "application/vnd.abiquo.bills+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/273/bills" }, { "title": "billregisters", "rel": "billregisters", "type": "application/vnd.abiquo.bills+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/273/billregisters" }, { "title": "estimation", "rel": "estimation", "type": "text/plain", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/273/billregisters/action/estimate" }, { "title": "Bill providers", "rel": "billproviders", "type": "application/vnd.abiquo.billproviders+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/273/bills/action/providers" }, { "title": "Budgets", "rel": "budgets", "type": "application/vnd.abiquo.budgets+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/273/budgets" }, { "title": "4xResellerEnterprise", "rel": "reseller", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/268" }, { "title": "4xCustomer 01", "rel": "key-node", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272" } ], "ramSoft": 0, "ramHard": 0, "cpuSoft": 0, "cpuHard": 0 }, { "id": 298, "name": "4xDepartmentOther", "isReservationRestricted": false, "workflow": false, "twoFactorAuthenticationMandatory": false, "reseller": false, "keyNode": false, "diskSoftLimitInMb": 0, "diskHardLimitInMb": 0, "storageSoftInMb": 0, "storageHardInMb": 0, "vmsSoft": 0, "vmsHard": 0, "vlansSoft": 0, "vlansHard": 0, "publicIpsSoft": 0, "publicIpsHard": 0, "repositorySoftInMb": 0, "repositoryHardInMb": 0, "links": [ { "title": "4xDepartmentOther", "rel": "edit", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298" }, { "title": "users", "rel": "users", "type": "application/vnd.abiquo.users+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/users" }, { "title": "properties", "rel": "properties", "type": "application/vnd.abiquo.enterpriseproperties+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/properties" }, { "title": "4xDepartment", "rel": "scope", "type": "application/vnd.abiquo.scope+json", "href": "https://abiquo.example.com:443/api/admin/scopes/105" }, { "title": "template definitions lists", "rel": "appslib/templateDefinitionLists", "type": "application/vnd.abiquo.templatedefinitionlists+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/appslib/templateDefinitionLists" }, { "title": "template defintion paths", "rel": "appslib/templateDefinitions", "type": "application/vnd.abiquo.templatedefinitions+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/appslib/templateDefinitions" }, { "title": "repositories", "rel": "datacenterrepositories", "type": "application/vnd.abiquo.datacenterrepositories+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/datacenterrepositories" }, { "title": "virtual machines", "rel": "virtualmachines", "type": "application/vnd.abiquo.virtualmachines+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/action/virtualmachines" }, { "title": "virtual appliances", "rel": "virtualappliances", "type": "application/vnd.abiquo.virtualappliances+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/action/virtualappliances" }, { "title": "ips", "rel": "ips", "type": "application/vnd.abiquo.privateips+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/action/ips" }, { "title": "virtual datacenters", "rel": "cloud/virtualdatacenters", "type": "application/vnd.abiquo.virtualdatacenters+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/action/virtualdatacenters" }, { "title": "reserved machines", "rel": "reservedmachines", "type": "application/vnd.abiquo.machines+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/reservedmachines" }, { "title": "limits", "rel": "limits", "type": "application/vnd.abiquo.limits+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/limits" }, { "title": "providerlimits", "rel": "providerlimits", "type": "application/vnd.abiquo.providerlimits+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/providerlimits" }, { "title": "volumes", "rel": "volumes", "type": "application/vnd.abiquo.volumes+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/action/volumes" }, { "title": "external networks", "rel": "externalnetworks", "type": "application/vnd.abiquo.vlans+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/action/externalnetworks" }, { "title": "pending tasks", "rel": "pendingtasks", "type": "application/vnd.abiquo.tasks+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/action/pendingtasks" }, { "title": "credentials", "rel": "credentials", "type": "application/vnd.abiquo.publiccloudcredentialslist+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/credentials" }, { "title": "pricingcredentials", "rel": "pricingcredentials", "type": "application/vnd.abiquo.pricingcredentialslist+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/pricingcredentials" }, { "title": "virtual appliances specs", "rel": "vappspecs", "type": "application/vnd.abiquo.virtualappliancespecs+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/vappspecs" }, { "title": "bills", "rel": "bills", "type": "application/vnd.abiquo.bills+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/298/bills" }, { "title": "billregisters", "rel": "billregisters", "type": "application/vnd.abiquo.bills+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/298/billregisters" }, { "title": "estimation", "rel": "estimation", "type": "text/plain", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/298/billregisters/action/estimate" }, { "title": "Bill providers", "rel": "billproviders", "type": "application/vnd.abiquo.billproviders+json", "href": "https://abiquo.example.com:443/api/statistics/enterpriseresources/298/bills/action/providers" }, { "title": "Budgets", "rel": "budgets", "type": "application/vnd.abiquo.budgets+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/298/budgets" }, { "title": "4xResellerEnterprise", "rel": "reseller", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/268" }, { "title": "4xCustomer 01", "rel": "key-node", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/272" } ], "ramSoft": 0, "ramHard": 0, "cpuSoft": 0, "cpuHard": 0 } ] }
For each enterprise, you will need the credentials link
{ "title": "credentials", "rel": "credentials", "type": "application/vnd.abiquo.publiccloudcredentialslist+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/credentials" },
and the "virtual datacenters" link
{ "title": "virtual datacenters", "rel": "cloud/virtualdatacenters", "type": "application/vnd.abiquo.virtualdatacenters+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/action/virtualdatacenters" },
List the public cloud credentials
Perform a GET request to the credentials link to list the public cloud credentials
- Reference: https://wiki.abiquo.com/api/latest/PublicCloudCredentialsListResource.html#list-public-cloud-credentials-of-an-enterprise
cURL request
curl -X GET \ https://abiquo.example.com/api/admin/enterprises/274/credentials \ -H 'Accept: application/vnd.abiquo.publiccloudcredentials+json;version=5.1' \ -u user:password --verbose \
Sample response. Success status code: 200
Click here to expand...{ "links": [], "collection": [ { "id": 479, "access": "03b55688c4246050dd2625e1d4206b7cb036fdfd94fdb782cf6188931ee73d59", "accountId": "228648867604", "alsoForPricing": false, "links": [ { "title": "4xDepartment", "rel": "enterprise", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274" }, { "title": "edit public cloud credentials", "rel": "edit", "type": "application/vnd.abiquo.publiccloudcredentials+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/credentials/479" }, { "title": "AMAZON", "rel": "hypervisortype", "type": "application/vnd.abiquo.hypervisortype+json", "href": "https://abiquo.example.com:443/api/config/hypervisortypes/AMAZON" } ] } ] }
- Keep the edit links for the public cloud credentials and the selected provider types
- Optionally delete the public cloud credentials
- Send a DELETE request to the edit links of the credentials
- Reference: https://wiki.abiquo.com/api/latest/PublicCloudCredentialsListResource.html#delete-a-set-of-public-cloud-credentials
cURL request
curl -X DELETE \ https://abiquo.example.com/api/admin/enterprises/274/credentials/479 \ -u user:password --verbose \
- Success status code: 204
- This step is optional because you can use the VDC logical delete parameter to delete VDCs in the platform only without removing credentials first
- Get the virtual datacenters of the enterprise using the URL from the enterprise's virtual datacenters link
You can also use the "hypervisortype" parameter to search for the VMs from the provider, for example, "AMAZON" or "azurecompute-arm".
Here we will filter the results of the request with the "hypervisorType" attribute of the virtual datacenter
cURL request
curl -X GET \ https://abiquo.example.com:443/api/admin/enterprises/274/action/virtualdatacenters?hypervisortype=AMAZON \ -H "Accept": "application/vnd.abiquo.virtualdatacenters+json", -u user:password --verbose \
Sample response. Success status code: 200
Click here to expand...{ "totalSize": 1, "links": [ { "rel": "first", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/action/virtualdatacenters?hypervisortype=AMAZON&limit=25&by=name&asc=true" }, { "rel": "last", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/action/virtualdatacenters?hypervisortype=AMAZON&startwith=0&limit=25&by=name&asc=true" } ], "collection": [ { "id": 2184, "hypervisorType": "AMAZON", "name": "aws_vdc", "network": { "id": 2961, "name": "default_private_network", "address": "192.168.0.0", "mask": 24, "gateway": "192.168.0.1", "primaryDNS": "10.60.1.4", "secondaryDNS": "8.8.8.8", "sufixDNS": "", "defaultNetwork": false, "type": "INTERNAL", "dhcpOptions": { "links": [], "collection": [] }, "ipv6": false, "strict": false, "providerId": "subnet-04d63f9b7df9d97d2", "restricted": false, "internetGatewayRole": false, "ipRanges": [ { "firstIp": "192.168.0.5", "lastIp": "192.168.0.253" } ], "excludedFromFirewall": false, "notUsableLoadBalancers": false, "notUsableVirtualMachines": false, "links": [ { "title": "aws_vdc", "rel": "virtualdatacenter", "type": "application/vnd.abiquo.virtualdatacenter+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184" }, { "title": "default_private_network", "rel": "edit", "type": "application/vnd.abiquo.vlan+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/privatenetworks/2961" }, { "title": "ips", "rel": "ips", "type": "application/vnd.abiquo.privateips+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/privatenetworks/2961/ips" }, { "title": "eu-west-1a", "rel": "availabilityzone", "type": "application/vnd.abiquo.availabilityzone+json", "href": "https://abiquo.example.com:443/api/cloud/locations/2/availabilityzones/175" }, { "title": "load balancers", "rel": "loadbalancers", "type": "application/vnd.abiquo.loadbalancers+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/privatenetworks/2961/loadbalancers" }, { "title": "configuration", "rel": "configuration", "type": "application/vnd.abiquo.networkconfiguration+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/privatenetworks/2961/configuration" }, { "title": "192.168.0.0/24", "rel": "network_configuration", "type": "application/vnd.abiquo.networkconfiguration+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/privatenetworks/2961/configuration/2961" }, { "title": "reserve a set of ips", "rel": "reserveips", "type": "application/vnd.abiquo.ipliterals+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/privatenetworks/2961/ips/action/reserve" }, { "title": "release a set of ips", "rel": "releaseips", "type": "application/vnd.abiquo.ipliterals+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/privatenetworks/2961/ips/action/release" } ] }, "providerId": "vpc-0ef97a05732bcdd39", "syncState": "NONE", "usersRole": [], "diskSoftLimitInMb": 0, "diskHardLimitInMb": 0, "storageSoftInMb": 0, "storageHardInMb": 0, "vmsSoft": 0, "vmsHard": 0, "vlansSoft": 0, "vlansHard": 0, "publicIpsSoft": 0, "publicIpsHard": 0, "links": [ { "title": "aws_vdc", "rel": "edit", "type": "application/vnd.abiquo.virtualdatacenter+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184" }, { "title": "private networks", "rel": "privatenetworks", "type": "application/vnd.abiquo.vlans+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/privatenetworks" }, { "title": "public networks", "rel": "network", "type": "application/vnd.abiquo.vlans+json", "href": "https://abiquo.example.com:443/api/admin/datacenters/2/network" }, { "rel": "asynctasks", "type": "application/vnd.abiquo.asynctasks+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/asynctasks" }, { "title": "default_private_network", "rel": "defaultvlan", "type": "application/vnd.abiquo.vlan+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/privatenetworks/2961" }, { "title": "4xDepartment", "rel": "enterprise", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274" }, { "title": "virtual appliances", "rel": "virtualappliances", "type": "application/vnd.abiquo.virtualappliances+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/virtualappliances" }, { "title": "private ips", "rel": "privateips", "type": "application/vnd.abiquo.privateips+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/action/privateips" }, { "title": "external ips", "rel": "externalips", "type": "application/vnd.abiquo.externalips+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/action/externalips" }, { "title": "unmanaged ips", "rel": "unmanagedips", "type": "application/vnd.abiquo.unmanagedips+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/action/unmanagedips" }, { "title": "default vlan", "rel": "defaultvlan", "type": "application/vnd.abiquo.vlan+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/action/defaultvlan" }, { "title": "disks", "rel": "disks", "type": "application/vnd.abiquo.harddisks+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/disks" }, { "title": "ips to purchase", "rel": "topurchase", "type": "application/vnd.abiquo.publicips+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/publicips/topurchase" }, { "title": "ips purchased", "rel": "purchased", "type": "application/vnd.abiquo.publicips+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/publicips/purchased" }, { "title": "volumes", "rel": "volumes", "type": "application/vnd.abiquo.volumes+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/volumes" }, { "title": "tiers", "rel": "tiers", "type": "application/vnd.abiquo.tiers+json", "href": "https://abiquo.example.com:443/api/cloud/locations/2/tiers" }, { "title": "available templates", "rel": "templates", "type": "application/vnd.abiquo.virtualmachinetemplates+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/action/templates" }, { "title": "all virtual machines", "rel": "virtualmachines", "type": "application/vnd.abiquo.virtualmachines+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/action/virtualmachines" }, { "title": "000AmazonDC-IReland", "rel": "region", "type": "application/vnd.abiquo.region+json", "href": "https://abiquo.example.com:443/api/config/hypervisortypes/AMAZON/regions/eu-west-1" }, { "title": "amazon-device", "rel": "device", "type": "application/vnd.abiquo.device+json", "href": "https://abiquo.example.com:443/api/cloud/locations/2/devices/1" }, { "title": "firewalls", "rel": "firewalls", "type": "application/vnd.abiquo.firewallpolicies+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/firewalls" }, { "title": "load balancers", "rel": "loadbalancers", "type": "application/vnd.abiquo.loadbalancers+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/loadbalancers" }, { "title": "vpns", "rel": "vpns", "type": "application/vnd.abiquo.vpnsipsec+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/vpns" }, { "title": "000AmazonDC-IReland", "rel": "location", "type": "application/vnd.abiquo.publiccloudregion+json", "href": "https://abiquo.example.com:443/api/cloud/locations/2" }, { "title": "tasks", "rel": "tasks", "type": "application/vnd.abiquo.tasks+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/tasks" }, { "title": "location limit", "rel": "limit", "type": "application/vnd.abiquo.limit+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/limits/1038" }, { "title": "externalnetworks", "rel": "externalnetworks", "type": "application/vnd.abiquo.vlans+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274/limits/1038/externalnetworks" }, { "title": "virtual appliances specs", "rel": "vappspecs", "type": "application/vnd.abiquo.virtualappliancespecs+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/vappspecs" }, { "title": "alarmssearch", "rel": "alarmssearch", "type": "application/vnd.abiquo.alarms+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184/alarms" } ], "ramSoft": 0, "ramHard": 0, "cpuSoft": 0, "cpuHard": 0 } ] }
Keep the edit link for each of these virtual datacenters.
{ "title": "aws_vdc", "rel": "edit", "type": "application/vnd.abiquo.virtualdatacenter+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184" },
Delete the virtual datacenters
- Send a DELETE request to the edit link of each virtual datacenter and use the "logicaldelete " parameter set to "true"
- Reference: https://wiki.abiquo.com/api/latest/VirtualDatacentersResource.html#delete-a-virtual-datacenter
cURL
curl -X DELETE \ https://abiquo.example.com/api/cloud/virtualdatacenters/2184?logicaldelete=true \ -H "Accept: application/vnd.abiquo.asynctask+json; version=5.1" \ -u user:password --verbose
Deleting a VDC is an asynchronous task, so the request returns an asynchronous task media type and a status code of 200. Sample response
Click here to expand...{ "creationTime": 1580916505814, "finished": true, "jobs": { "links": [], "collection": [] }, "links": [ { "rel": "self", "type": "application/vnd.abiquo.asynctask+json", "href": "https://abiquo.example.com:443/api/cloud/locations/2/asynctasks/1839" }, { "title": "aws_vdc", "rel": "owner", "type": "application/vnd.abiquo.virtualdatacenter+json", "href": "https://abiquo.example.com:443/api/cloud/virtualdatacenters/2184" }, { "title": "000AmazonDC-IReland", "rel": "datacenter", "type": "application/vnd.abiquo.publiccloudregion+json", "href": "https://abiquo.example.com:443/api/cloud/locations/2" }, { "title": "4xDepartment", "rel": "enterprise", "type": "application/vnd.abiquo.enterprise+json", "href": "https://abiquo.example.com:443/api/admin/enterprises/274" } ] }
- Delete the enterprises
- After you have deleted the virtual datacenters, you can delete the enterprises
- Reference: https://wiki.abiquo.com/api/latest/EnterprisesResource.html#delete-an-enterprise
cURL request to delete an enterprise
curl -X DELETE \ https://abiquo.example.com/api/admin/enterprises/274 \ -u user:password --verbose
- Success status code: 204
Copyright © 2006-2022, Abiquo Holdings SL. All rights reserved