RacksResource


Create a rack


POST https://example.com/api/admin/datacenters/{datacenter}/racks

Roles : [ROLE_PHYS_DC_ALLOW_MODIFY_SERVERS]

Content-Type : rack Accept : rack

Error Codes

  • CONSTR-VLANIDRANGE - The property 'vlanIdRange' is invalid. Max VLAN id must be greater or equal than min VLAN id.
  • RACK-13 - The new VLAN tag range does not contain any available tags, check ''vlanIdMin'', ''vlanIdMax'' and ''vlansIdAvoided''
  • RACK-3 - There is already a rack with that name in this datacenter

Example

List racks


GET https://example.com/api/admin/datacenters/{datacenter}/racks

Roles : [ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_USERS_MANAGE_RESERVED_MACHINES]

Parameter Type Default Value Description
filter String If present, add a filter to the search

Accept : racks

Example

Delete a rack


Deletes a rack and if the "force" parameter is "true", it also deletes the rack's hierarchy.
The rack cannot be deleted if HA is in progress.

DELETE https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}

Roles : [ROLE_PHYS_DC_ALLOW_MODIFY_SERVERS]

Parameter Type Default Value Description
force boolean If true, force cascade deletion (also remove VMs)

Example

Get a rack


GET https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}

Roles : [ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_USERS_MANAGE_RESERVED_MACHINES]

Accept : rack

Error Codes

  • RACK-4 - This rack does not exist

Example

Upate a rack


PUT https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}

Roles : [ROLE_PHYS_DC_ALLOW_MODIFY_SERVERS]

Content-Type : rack Accept : rack

Error Codes

  • CONSTR-VLANIDRANGE - The property 'vlanIdRange' is invalid. Max VLAN id must be greater or equal than min VLAN id.
  • RACK-13 - The new VLAN tag range does not contain any available tags, check ''vlanIdMin'', ''vlanIdMax'' and ''vlansIdAvoided''
  • RACK-3 - There is already a rack with that name in this datacenter
  • RACK-4 - This rack does not exist

Example

Search for alarms on a rack


Retrieve alarms on a rack and with the recursive option also retrieve the alarms for the following entities on the infrastructure path:
  • Machines
  • Virtual machines

GET https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/alarms

Roles : [ROLE_USERS_VIEW_ALARMS]

Parameter Type Default Value Description
startwith Integer 0 First element to retrieve, by default 0
by String alarm Field to order by. Possible values: 'alarm', 'entity_type', 'metric', 'time_range', 'datapoints_limit', 'statistic', 'formula', 'threshold', 'description'. The default value is 'alarm'
limit Integer 25 Number of alarms to return. The default value is 25
asc Boolean true If true, sort in ascending order on the field specified with the 'by' parameter, otherwise sort in descending order. The default value is 'true'
alarm String Filter alarms by name, accepts wildcards. Empty by default
metric String Filter alarm by metric name, accepts wildcards. Empty by default
state String Filter by alarm state. Possible values: 'all', 'active' or 'inactive'
recursive Boolean false If true, the search will be recursive. The default value is false

Accept : alarms

List virtual machines deployed on a rack


GET https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/deployedvms

Roles : [ROLE_PHYS_DC_RETRIEVE_DETAILS]

Accept : virtualmachines

Create a metric metadata on a rack


Create metadata for a new metric on a rack

POST https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/metrics

Roles : [ROLE_USERS_PUSH_METRICS]

Content-Type : metricmetadata Accept : metricmetadata

Error Codes

  • MONITORING-2 - Unable to create a new metric with null or empty name
  • MONITORING-9 - The metric name '5cde3c0e-5b34-4452-8006-8e411d7bab69' is already in use.
  • RACK-4 - This rack does not exist

Example

List metrics metadata on a rack


Retrieve the metadata of all the available, built-in, and custom metrics for the given rack

GET https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/metrics

Roles : [ROLE_USERS_SHOW_METRICS]

Accept : metricsmetadata

Error Codes

  • RACK-4 - This rack does not exist

Example

Push collectd values on a rack


Push values gathered by collectd. The metric metadata may not exist, in this case metadata will be created automatically by the system.

The data should be in JSON format.

POST https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/metrics/collectd

Roles : [ROLE_USERS_PUSH_METRICS]

Content-Type : application/json

Example

Get a metric metadata on a rack


Retrieve the metadata of a metric (built-in or custom) on a rack

GET https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/metrics/{metric}

Roles : [ROLE_USERS_SHOW_METRICS]

Accept : metricmetadata

Error Codes

  • MONITORING-1 - Unknown metric 'f5545d33-1842-4e92-8eaf-b6a177e005fc' for Rack with id '1836'
  • RACK-4 - This rack does not exist

Example

Get a metric statistics on a rack


By default, this query retrieves the available datapoints for the last hour using the 'Average' aggregator with a granularity of 60 seconds. All the defaults can be overridden.

Metric dimensions to filter by can be specified with query parameters in two ways:

  • Comma separated values: ?key1=value1,value2&key2=value3
  • Duplicated key parameters: ?key1=value1&key1=value2&key2=value3

Unknown metric dimensions are filtered and ignored.

GET https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/metrics/{metric}

Roles : [ROLE_USERS_SHOW_METRICS]

Parameter Type Default Value Description
startrelative String Relative start time following the ISO 8601 duration (cannot contain years or months)
startabsolute Long Absolute start time, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC
endabsolute Long Absolute end time, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC
granularity Integer Granularity of the aggregator in seconds. A minimum of 60 seconds.
statistic Enum : average, maximum, minimum, sum, count, dev Aggregator to apply to the datapoints in the given time range

Accept : metric

Error Codes

  • MONITORING-1 - Metadata for metric '32947fe6-5d6a-4098-a65e-665450559466' in namespace 'rack' not found
  • MONITORING-3 - End time must be later than start time
  • MONITORING-38 - The relative start time must be shorter than configured in 'abiquo.monitoring.max.statistic.period.days' property
  • MONITORING-39 - Absolute or relative queries are allowed but not both
  • MONITORING-4 - The supplied relative time contains years or months
  • MONITORING-6 - The supplied relative start time is invalid
  • MONITORING-8 - The minimum granularity is 60 seconds
  • RACK-4 - This rack does not exist

Push metric datapoints on a rack


Push metric datapoints to a custom metric. If the metric metadata does not exist, the system will automatically create it.

Push is not allowed for built-in metrics.

POST https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/metrics/{metric}

Roles : [ROLE_USERS_PUSH_METRICS]

Content-Type : datapoints

Example

Update a metric metadata on a rack


Update existing metric metadata on a rack

PUT https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/metrics/{metric}

Roles : [ROLE_USERS_PUSH_METRICS]

Content-Type : metricmetadata Accept : metricmetadata

Example

Create an alarm on a rack


Creates a new alarm for an existing metric (built-in or custom)

POST https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/metrics/{metric}/alarms

Roles : [ROLE_USERS_MANAGE_ALARMS]

Parameter Type Default Value Description
allowunknowndimensions boolean false If true, the given dimensions are not validated against the available dimensions in the metric metadata. False by default.

Content-Type : alarm Accept : alarm

Error Codes

  • GEN-4 - Not enough permissions to perform this action
  • MONITORING-1 - Metadata for metric '84c7f917-acfe-49c8-8d25-1ec400c89ddd' in namespace 'rack' not found
  • MONITORING-16 - The alarm name is required
  • MONITORING-17 - The alarm formula is required
  • MONITORING-18 - The alarm statistic is required
  • MONITORING-21 - The supplied formula does not exist
  • MONITORING-22 - The supplied statistic does not exist
  • MONITORING-40 - The alarm time range must be >= 1
  • MONITORING-41 - The datapoints limit must be >= 1
  • MONITORING-47 - Unable to create alarm with unknown metric dimensions
  • RACK-4 - This rack does not exist

Example

List alarms on a rack


List the alarms associated with a metric on a rack

GET https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/metrics/{metric}/alarms

Roles : [ROLE_USERS_VIEW_ALARMS]

Accept : alarms

Error Codes

  • GEN-4 - Not enough permissions to perform this action
  • RACK-4 - This rack does not exist

Example

Delete an alarm on a rack


DELETE https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/metrics/{metric}/alarms/{alarm}

Roles : [ROLE_USERS_MANAGE_ALARMS]

Example

Get an alarm on a rack


Retrieve an alarm on a specific metric on a rack

GET https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/metrics/{metric}/alarms/{alarm}

Roles : [ROLE_USERS_VIEW_ALARMS]

Accept : alarm

Error Codes

  • GEN-4 - Not enough permissions to perform this action
  • MONITORING-13 - Alarm with uuid ef5a6649-e2a1-428f-908d-364fb3ce9e1b not found
  • RACK-4 - This rack does not exist

Example

Update an alarm on a rack


PUT https://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/metrics/{metric}/alarms/{alarm}

Roles : [ROLE_USERS_MANAGE_ALARMS]

Parameter Type Default Value Description
allowunknowndimensions boolean false If true, the given dimensions are not validated against the available dimensions in the metric metadata. False by default.

Content-Type : alarm Accept : alarm

Error Codes

  • GEN-4 - Not enough permissions to perform this action
  • MONITORING-13 - Alarm '80f0e1e7-362d-4e5a-b6b5-0a19dbcf43a1' not found for metric '331849ba-44f7-4119-a6cc-407bede91c9c-1828' in namespace 'rack'
  • MONITORING-16 - The alarm name is required
  • MONITORING-17 - The alarm formula is required
  • MONITORING-18 - The alarm statistic is required
  • MONITORING-21 - The supplied formula does not exist
  • MONITORING-22 - The supplied statistic does not exist
  • MONITORING-40 - The alarm time range must be >= 1
  • MONITORING-41 - The datapoints limit must be >= 1
  • MONITORING-47 - Unable to create alarm with unknown metric dimensions
  • RACK-4 - This rack does not exist

Example