42ITy REST API API documentation version v1
/api/v1/asset
General call for creating one asset element of any type or group of asset elements. Body of the request create asset has the same structure as the one of the request update asset and also as the one of the response retrieve asset informations.
post /api/v1/asset
General call for creating one asset element of any type or group of asset elements. Body of the request create asset has the same structure as the one of the request update asset and also as the one of the response retrieve asset informations.
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: object
Properties- name: required (string - maxLength: 50)
Name of the given object.
Examples:
MyDataCenter
- type: required (one of datacenter, room, row, rack, device, group)
Asset type. Possible values are datacenter, room, row, rack, device and group.
- sub_type: required (one of epdu, feed, genset, pdu, rack controller, router, server, storage, sts, switch, ups, vm, input_power, sensor, )
In the case of type "device", the subtype has to be specified. Possible values are epdu, feed, genset, pdu, rack controller, router, server, storage, sts, switch, ups, vm and sensor. In the case of type "group", the subtype may be input_power. In other cases, it must be empty.
- status: required (one of active, nonactive, spare, retired)
Current asset status. Possible values are active, nonactive, spare and retired.
- location: required (string - maxLength: 50)
The name of the parent asset element. If the element is unlocated or it is a datacenter, the key must be present but empty.
- location_id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
- location_uri: (string)
The URI address of the parent asset element.
- priority: required (one of P1, P2, P3, P4, P5)
Priority of the asset. Value P1 means the highest priority, value P5 means the lowest priority.
- powers: (array of Asset)
A list of direct power sources; only for devices. Can be empty.
Items: Asset
- groups: (array of Asset)
A list of groups the asset belons to. Can be empty. Every item contains name and identifier of the group.
Items: Asset
- ips: (array of Limited_String)
A list of IP addresses (represented by string).
- hostnames: (array of Limited_String)
A list of hostnames (represented by string).
- macs: (array of Limited_String)
A list of mac addresses (represented by string).
- fqdns: (array of Limited_String)
A list of fqdn names (represented by string).
- id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
- power_devices_in_uri: (string)
A relative URI address which is used to select all power devices powering (or being in) the requested asset. Currently: /api/v1/assets?in=
&sub_type=epdu,pdu,feed,genset,ups. - parents: (array of Asset_Item)
List of parents sorted from nearest element.
Items: Asset_Item
- computed: required (Computed | Empty_Object)
For racks (only), there are three possible properties that may be specified in this list: freeusize, outlet.available and realpower.nominal. For other asset types, "computed" is an empty object.
- ext: (array of Ext_Attribute)
An optional list of extended attributes, that the user is free to fill. Every element of this list must contain name of the attribute with its value, and whether this attribute is only for reading.
Items: Ext_Attribute
Examples:
{
"name": "MyServer",
"type": "device",
"sub_type": "server",
"location": "",
"status": "active",
"priority": "P2",
"parents": [],
"computed": {},
"ext": [
{
"company": "Eaton",
"read_only": false
},
{
"country": "France",
"read_only": false
}
]
}
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
Examples:
{
"id": "37"
}
HTTP status code 400
Bad request.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 46,
"condition": "Missing required data in the request document."
}
{
"code": 47,
"condition": "Unsupported value of the request document key \"type\" or not unique serial_no."
}
{
"code": 48,
"condition": "The request document has wrong format or an error in the syntax."
}
{
"code": 48,
"condition": "The request document is empty."
}
HTTP status code 403
Forbidden.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 51,
"condition": "The request document contains the key \"id\"."
}
HTTP status code 404
Not found.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 44,
"condition": "The specified parent, power source or group does not exist in database."
}
HTTP status code 500
Internal server error.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 42,
"condition": "The asset was created, but error occurred during configuration sending of asset change notification – consult system log."
}
{
"code": 42,
"condition": "Internal error."
}
Exports all asset elements (with their properties) in a CSV (comma-separated values) format.
get /api/v1/asset/export
Exports all asset elements (with their properties) in a CSV (comma-separated values) format.
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
HTTP status code 500
Internal server error.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 42,
"condition": "Internal error; problems with connection to database or database is in inconsistent state – see log for more detail."
}
Imports CSV (comma-separated values) file containing all asset elements with their properties.
post /api/v1/asset/import
Imports CSV (comma-separated values) file containing all asset elements with their properties.
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: object
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- imported_lines: required (integer)
Number of successfully imported rows of the CSV asset description file.
- errors: required (array of Import_Error)
Array that contains informations about errors occurred during attempt to import individual rows of the CSV asset description file.
Items: Import_Error
HTTP status code 400
Bad request.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 46,
"condition": "File \"assets\" is missing."
}
{
"code": 46,
"condition": "Mandatory columns are missing in the CSV file."
}
{
"code": 47,
"condition": "File \"assets\" has bad coding or bad format."
}
{
"code": 48,
"condition": "The request document has invalid syntax. The delimiter cannot be detected – use comma (,) semicolon (;) or tabulator."
}
HTTP status code 405
Method not allowed.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 45,
"condition": "The requested method is not allowed."
}
HTTP status code 413
Request entity is too large.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 53,
"condition": "Request body content size is too big."
}
HTTP status code 500
Internal server error.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 42,
"condition": "Internal error; for example, there is no connection to database."
}
{
"code": 42,
"condition": "Loading of the CVS file was successful, but error occurred during configuration sending of asset change notification – consult system log."
}
Retrieves the list of all devices (of chosen types) regardless the datacenter.
get /api/v1/asset/devices
Retrieves the list of all devices (of chosen types) regardless the datacenter.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Query String
- : required (string)
List of asset subtypes with items separated by comma. Possible item values of the list are epdu, feed, genset, pdu, rack controller, router, server, storage, sts, switch, ups, vm and sensor.
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- devices: required (array of Asset)
Items: Asset
Examples:
{
"devices": [
{
"id": "5",
"name": "serv1"
},
{
"id": "26",
"name": "SRV1-LAB"
}
]
}
Retrieves the list of datacenters.
Retrieves the list of rooms regardless the datacenter.
Retrieves the list of racks regardless the datacenter.
get /api/v1/asset/racks
Retrieves the list of rows regardless the datacenter.
get /api/v1/asset/rows
Retrieves the list of rows regardless the datacenter.
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- rows: required (array of Asset)
Items: Asset
Examples:
{
"rows": [
{
"id": "3",
"name": "ROW1"
},
{
"id": "17",
"name": "ROW4"
},
{
"id": "18",
"name": "ROW6"
}
]
}
Retrieves the list of groups of asset elements.
get /api/v1/asset/groups
Retrieves informations about the requested asset element or group of asset elements.
Updates the requested (existing) asset element or group of asset elements. Body of the request update asset has the same structure as the one of the request create asset and also as the one of the response retrieve asset informations.
Deletes the requested (existing) asset element or group of asset elements. The asset element may be deleted only if there is no child dependences.
get /api/v1/asset/{asset-id}
Retrieves informations about the requested asset element or group of asset elements.
URI Parameters
- asset-id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- name: required (string - maxLength: 50)
Name of the given object.
Examples:
MyDataCenter
- type: required (one of datacenter, room, row, rack, device, group)
Asset type. Possible values are datacenter, room, row, rack, device and group.
- sub_type: required (one of epdu, feed, genset, pdu, rack controller, router, server, storage, sts, switch, ups, vm, input_power, sensor, )
In the case of type "device", the subtype has to be specified. Possible values are epdu, feed, genset, pdu, rack controller, router, server, storage, sts, switch, ups, vm and sensor. In the case of type "group", the subtype may be input_power. In other cases, it must be empty.
- status: required (one of active, nonactive, spare, retired)
Current asset status. Possible values are active, nonactive, spare and retired.
- location: required (string - maxLength: 50)
The name of the parent asset element. If the element is unlocated or it is a datacenter, the key must be present but empty.
- location_id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
- location_uri: (string)
The URI address of the parent asset element.
- priority: required (one of P1, P2, P3, P4, P5)
Priority of the asset. Value P1 means the highest priority, value P5 means the lowest priority.
- powers: (array of Asset)
A list of direct power sources; only for devices. Can be empty.
Items: Asset
- groups: (array of Asset)
A list of groups the asset belons to. Can be empty. Every item contains name and identifier of the group.
Items: Asset
- ips: (array of Limited_String)
A list of IP addresses (represented by string).
- hostnames: (array of Limited_String)
A list of hostnames (represented by string).
- macs: (array of Limited_String)
A list of mac addresses (represented by string).
- fqdns: (array of Limited_String)
A list of fqdn names (represented by string).
- id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
- power_devices_in_uri: (string)
A relative URI address which is used to select all power devices powering (or being in) the requested asset. Currently: /api/v1/assets?in=
&sub_type=epdu,pdu,feed,genset,ups. - parents: (array of Asset_Item)
List of parents sorted from nearest element.
Items: Asset_Item
- computed: required (Computed | Empty_Object)
For racks (only), there are three possible properties that may be specified in this list: freeusize, outlet.available and realpower.nominal. For other asset types, "computed" is an empty object.
- ext: (array of Ext_Attribute)
An optional list of extended attributes, that the user is free to fill. Every element of this list must contain name of the attribute with its value, and whether this attribute is only for reading.
Items: Ext_Attribute
Examples:
{
"id": "30",
"power_devices_in_uri": "/api/v1/assets?in=30&sub_type=epdu,pdu,feed,genset,ups",
"name": "GROUP1-LAB",
"status": "active",
"priority": "P1",
"type": "group",
"location_uri": "/api/v1/asset/datacenter/19",
"location_id": "19",
"location": "DC-LAB",
"groups": [],
"sub_type": "input_power",
"ext": [
{
"asset_tag": "myasset30",
"read_only": true
},
{
"description": "input power chain",
"read_only": false
}
],
"computed": {}
}
put /api/v1/asset/{asset-id}
Updates the requested (existing) asset element or group of asset elements. Body of the request update asset has the same structure as the one of the request create asset and also as the one of the response retrieve asset informations.
URI Parameters
- asset-id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: object
Properties- name: required (string - maxLength: 50)
Name of the given object.
Examples:
MyDataCenter
- type: required (one of datacenter, room, row, rack, device, group)
Asset type. Possible values are datacenter, room, row, rack, device and group.
- sub_type: required (one of epdu, feed, genset, pdu, rack controller, router, server, storage, sts, switch, ups, vm, input_power, sensor, )
In the case of type "device", the subtype has to be specified. Possible values are epdu, feed, genset, pdu, rack controller, router, server, storage, sts, switch, ups, vm and sensor. In the case of type "group", the subtype may be input_power. In other cases, it must be empty.
- status: required (one of active, nonactive, spare, retired)
Current asset status. Possible values are active, nonactive, spare and retired.
- location: required (string - maxLength: 50)
The name of the parent asset element. If the element is unlocated or it is a datacenter, the key must be present but empty.
- location_id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
- location_uri: (string)
The URI address of the parent asset element.
- priority: required (one of P1, P2, P3, P4, P5)
Priority of the asset. Value P1 means the highest priority, value P5 means the lowest priority.
- powers: (array of Asset)
A list of direct power sources; only for devices. Can be empty.
Items: Asset
- groups: (array of Asset)
A list of groups the asset belons to. Can be empty. Every item contains name and identifier of the group.
Items: Asset
- ips: (array of Limited_String)
A list of IP addresses (represented by string).
- hostnames: (array of Limited_String)
A list of hostnames (represented by string).
- macs: (array of Limited_String)
A list of mac addresses (represented by string).
- fqdns: (array of Limited_String)
A list of fqdn names (represented by string).
- id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
- power_devices_in_uri: (string)
A relative URI address which is used to select all power devices powering (or being in) the requested asset. Currently: /api/v1/assets?in=
&sub_type=epdu,pdu,feed,genset,ups. - parents: (array of Asset_Item)
List of parents sorted from nearest element.
Items: Asset_Item
- computed: required (Computed | Empty_Object)
For racks (only), there are three possible properties that may be specified in this list: freeusize, outlet.available and realpower.nominal. For other asset types, "computed" is an empty object.
- ext: (array of Ext_Attribute)
An optional list of extended attributes, that the user is free to fill. Every element of this list must contain name of the attribute with its value, and whether this attribute is only for reading.
Items: Ext_Attribute
Examples:
{
"name": "Rack12",
"type": "rack",
"sub_type": "",
"location": "Row11",
"status": "active",
"priority": "P1",
"parents": [],
"computed": {},
"ext": [
{
"air_input": "front",
"read_only": false
},
{
"u_size": "4",
"read_only": false
}
]
}
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
Examples:
{
"id": "37"
}
HTTP status code 400
Bad request.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 48,
"condition": "The request document has wrong format or an error in the syntax."
}
{
"code": 48,
"condition": "The request document is empty."
}
{
"code": 48,
"condition": "The request document has keys that are not implemented yet."
}
{
"code": 47,
"condition": "Request document key \"type\" has unsupported value."
}
{
"code": 47,
"condition": "Serial_no is not unique."
}
{
"code": 46,
"condition": "The request document does not contain all the required data."
}
HTTP status code 403
Forbidden.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 51,
"condition": "Request document contains the key \"id\"."
}
{
"code": 51,
"condition": "More than two epdu or pdu are placed in the same rack."
}
HTTP status code 404
Not found.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 44,
"condition": "Specified parent, power source or group does not exists in the database."
}
HTTP status code 500
Internal server error.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 42,
"condition": "Internal error; for example, there is no connection to database."
}
{
"code": 42,
"condition": "Asset was updated, but error occurred during configuration sending of asset change notification – consult system log."
}
delete /api/v1/asset/{asset-id}
Deletes the requested (existing) asset element or group of asset elements. The asset element may be deleted only if there is no child dependences.
URI Parameters
- asset-id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
Annotations
- Authorization:
{"profile":["administrator"]}
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
HTTP status code 400
Bad request.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 46,
"condition": "Parameter \"id\" is missing."
}
HTTP status code 404
Not found.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 44,
"condition": "Asset element not found."
}
HTTP status code 409
Conflict.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 50,
"condition": "Delete is not possible as the requested asset contains other asset elements."
}
HTTP status code 500
Internal server error.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 42,
"condition": "Asset was deleted, but error occurred during configuration sending of asset change notification – consult system log."
}
/api/v1/assets
Retrieves the list of assets of specified types/subtypes.
get /api/v1/assets
Retrieves the list of assets of specified types/subtypes.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Query String
- in: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
HTTP status code 200
Success.
Body
Media type: application/json
Type: array of Asset_Item
Items: Asset_Item
- id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of an asset.
- name: required (string - maxLength: 50)
Name of an asset.
- type: required (one of datacenter, room, row, rack, device, group)
Type of the asset.
- sub_type: required (one of epdu, feed, genset, pdu, rack controller, router, server, storage, sts, switch, ups, vm, input_power, sensor, )
Subtype of the asset.
Examples:
[
{
"id": "5",
"name": "serv1",
"type": "device",
"sub_type": "server"
},
{
"id": "6",
"name": "epdu",
"type": "device",
"sub_type": "epdu"
},
{
"id": "7",
"name": "ups",
"type": "device",
"sub_type": "ups"
},
{
"id": "8",
"name": "feed",
"type": "device",
"sub_type": "feed"
}
]
/api/v1/topology/location
Retrieves the location topology from the specific location starting point or to the specific ending point. Or retrieves a list of unlocated asset elements of the requested type.
get /api/v1/topology/location
Retrieves the location topology from the specific location starting point or to the specific ending point. Or retrieves a list of unlocated asset elements of the requested type.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
HTTP status code 400
Bad request.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 52,
"condition": "Parameters \"from\" and \"to\" are both non-empty."
}
{
"code": 46,
"condition": "Parameters \"from\" and \"to\" are both empty."
}
{
"code": 47,
"condition": "Parameter \"recursive\" has bad value."
}
{
"code": 47,
"condition": "Parameter \"filter\" has bad value."
}
{
"code": 52,
"condition": "Wrong type of filter was used for request with parameter filter."
}
{
"code": 52,
"condition": "There was a request for unlocated asset elements feeded by device."
}
HTTP status code 404
Not found.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 44,
"condition": "Value of the parameter \"to\" or \"from\" or \"feed_by\" refers to unknown asset element."
}
/api/v1/topology/power
Retrieves the power topology from the specific location starting point.
get /api/v1/topology/power
Retrieves the power topology from the specific location starting point.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- devices: required (array of Device_Item)
Array of the requested devices.
Items: Device_Item
- powerchains: required (array of Power_Chain)
Array with descriptions of power chains.
Items: Power_Chain
Examples:
{
"devices": [
{
"name": "UPS1-LAB",
"id": "22",
"sub_type": "ups"
},
{
"name": "UPS2-LAB",
"id": "23",
"sub_type": "ups"
}
],
"powerchains": [
{
"src-id": "35",
"dst-id": "23"
},
{
"src-id": "35",
"dst-id": "22"
}
]
}
/api/v1/metric/current
Retrieves current values of all available metrics for the requested elements.
get /api/v1/metric/current
Retrieves current values of all available metrics for the requested elements.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Query String
- : required (string)
List of asset identifiers with items separated by comma.
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- current: required (array of object)
/api/v1/metric/computed/rack_total
Retrieves requested rack statistics.
get /api/v1/metric/computed/rack_total
Retrieves requested rack statistics.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Query String
- : required (string)
List of asset identifiers with items separated by comma.
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- rack_total: required (array of Rack_Power)
Items: Rack_Power
Examples:
{
"rack_total": [
{
"id": "21",
"name": "RACK1-LAB",
"total_power": 0,
"avg_power_last_day": 0
}
]
}
/api/v1/metric/computed/datacenter_indicators
Retrieves requested datacenter statistics.
get /api/v1/metric/computed/datacenter_indicators
Retrieves requested datacenter statistics.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Query String
- : required (string)
List of asset identifiers with items separated by comma.
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- datacenter_indicators: required (array of Datacenter_Statistics)
Items: Datacenter_Statistics
Examples:
{
"datacenter_indicators": [
{
"id": "10",
"name": "DC2",
"min_power_last_month": 0,
"power": 0
}
]
}
/api/v1/metric/computed/average
Retrieves stored averaged data from within the specified time interval, of the specified type and specified granularity.
get /api/v1/metric/computed/average
Retrieves stored averaged data from within the specified time interval, of the specified type and specified granularity.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Query String
- start_ts: (string - pattern: ^[0-9]{14}Z$)
Start of the requested interval in ISO 8601 format without hyphens and colons, i.e. YYYYMMDDThhmmssZ. Not required only if parameter "relative" is specified.
- end_ts: (string - pattern: ^[0-9]{14}Z$)
End of the requested interval in ISO 8601 format without hyphens and colons, i.e. YYYYMMDDThhmmssZ. Not required only if parameter "relative" is specified.
- type: (one of arithmetic_mean, min, max)
Type of the requested statistics. The value may be arithmetic_mean or min or max. If this parameter is not specified, arithmetic mean is returned.
- step: required (one of 15m, 30m, 1h, 8h, 24h, 7d, 30d)
Granularity of the requested statistics. The value may be 15m (fifteen minutes), 30m (thirty minutes), 1h (one hour), 8h (eight hours) or 24h (twenty four hours).
- element_id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the requested asset element.
- source: required (string)
The name of the requested matric. Valid metric names for the given assets element can be found at /api/v1/metric/current.
- relative: (one of 24h, 7d, 30d, )
This parameter overrides parameters "start_ts" and "end_ts". It sets parameter "end_ts" to current timestamp (i.e. now) and parameter "start_ts" to current timestamp minus the value of "relative" parameter. Possible values are 24h, 7d, 30d and "" (empty string).
Value "" behaves as if the parameter "relative" was not specified at all. It is not necessary to specify parameters "start_ts" and "end_ts" when parameter "relative" is specified – specifying them, however, does not create a conflict.
- ordered: (one of true, false)
This is optional parameter with possible values true and false. Default value is false. If this parameter is set to true, the returned data are ordered in ascending order.
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- element_id: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
- start_ts: required (string - pattern: ^[0-9]{14}Z$)
Start of the requested interval in ISO 8601 format without hyphens and colons, i.e. YYYYMMDDThhmmssZ. Not required only if parameter "relative" is specified.
- end_ts: required (string - pattern: ^[0-9]{14}Z$)
End of the requested interval in ISO 8601 format without hyphens and colons, i.e. YYYYMMDDThhmmssZ. Not required only if parameter "relative" is specified.
- units: required (string)
Units, in which the quantity under consideration is stated.
- type: required (one of arithmetic_mean, min, max)
Type of the requested statistics. The value may be arithmetic_mean or min or max. If this parameter is not specified, arithmetic mean is returned.
- step: required (one of 15m, 30m, 1h, 8h, 24h, 7d, 30d)
Granularity of the requested statistics. The value may be 15m (fifteen minutes), 30m (thirty minutes), 1h (one hour), 8h (eight hours) or 24h (twenty four hours).
- source: required (string)
The name of the requested matric. Valid metric names for the given assets element can be found at /api/v1/metric/current.
- data: required (array of Data_Item)
The requested data.
Items: Data_Item
/api/v1/metric/computed/uptime
Retrieves outage time of requested datacenters.
get /api/v1/metric/computed/uptime
Retrieves outage time of requested datacenters.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Query String
- : required (string)
List of asset identifiers with items separated by comma.
/api/v1/alerts/activelist
Retrieves alerts list optionally limited to certain state, element or all elements belonging under specified element in the topology tree.
get /api/v1/alerts/activelist
Retrieves alerts list optionally limited to certain state, element or all elements belonging under specified element in the topology tree.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Query String
- state: required (one of ALL, ALL-ACTIVE, ACTIVE, ACK-WIP, ACK-IGNORE, ACK-PAUSE, ACK-SILENCE, RESOLVED)
State of an alert. Possible values are ALL, ALL-ACTIVE, ACTIVE, ACK-WIP, ACK-IGNORE, ACK-PAUSE, ACK-SILENCE and RESOLVED. State RESOLVED can not be set manually – it is a result of conditions, that triggered an alert, coming back to normal values.
- asset: required (string - pattern: ^[0-9]{0,10}$)
Identifier of the given asset.
- recursive: (one of true, false)
This parameter is used to list alerts recursively for all asset elements that belong under the specified asset element in topology. Possible values are true and false; default value is false.
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
HTTP status code 400
Bad request.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 47,
"condition": "Value of the parameter \"state\" is not valid."
}
{
"code": 47,
"condition": "Value of the parameter \"recursive\" is not valid."
}
{
"code": 47,
"condition": "Value of the parameter \"asset\" is not a valid element identifier."
}
{
"code": 47,
"condition": "Value of the parameter \"asset\" is out of range."
}
/api/v1/alerts/rules
Creates new alert rule.
Retrieves list of alert rule representations, optionally limited to certain type or class of rules.
post /api/v1/alerts/rules
Creates new alert rule.
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: Threshold_Rule | Single_Rule | Pattern_Rule
HTTP status code 200
Success.
Body
Media type: application/json
Type: Threshold_Rule | Single_Rule | Pattern_Rule
HTTP status code 400
Bad request.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 48,
"condition": "The request document is not valid json or does not conform to the specified format or schema."
}
{
"code": 48,
"condition": "The request document is valid json, however lua function contains syntax errors."
}
{
"code": 52,
"condition": "There already exists an alert rule with given name."
}
get /api/v1/alerts/rules
Retrieves list of alert rule representations, optionally limited to certain type or class of rules.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Query String
- type: (one of all, pattern, single, threshold)
A type of the alert rules. Possible values are all, threshold, single, pattern. If the parameter is not specified, value equals to all.
- rule_class: (string)
List the alert rules with the specified class only. The class is an opaque string and equals to the rule property "rule_class".
Retrieves representation of the alert rule with the given name.
Updates the requested alert rule, provided that the rule with the given name exists.
get /api/v1/alerts/rules/{rule_name}
Retrieves representation of the alert rule with the given name.
URI Parameters
- rule_name: required (string - pattern: ^[-_.A-Za-z0-9@]{1,255}$)
Name of the given alert rule.
Examples:
onbypass@ROZ.UPS36
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
HTTP status code 200
Success.
Body
Media type: application/json
Type: Threshold_Rule | Single_Rule | Pattern_Rule
HTTP status code 400
Bad request.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 47,
"condition": "URI prameter \"rule_name\" is empty."
}
{
"code": 54,
"condition": "An alert rule with the name given by the value of the URI prameter \"rule_name\" does not exist."
}
put /api/v1/alerts/rules/{rule_name}
Updates the requested alert rule, provided that the rule with the given name exists.
URI Parameters
- rule_name: required (string - pattern: ^[-_.A-Za-z0-9@]{1,255}$)
Name of the given alert rule.
Examples:
onbypass@ROZ.UPS36
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: Threshold_Rule | Single_Rule | Pattern_Rule
Examples:
{
"threshold": {
"rule_name": "load.default@ROZ.UPS33",
"rule_class": "Default load in UPS",
"rule_hierarchy": "power.load.ups",
"rule_desc": "Load percentage for ups ROZ.UPS33",
"target": [
"load.default@ROZ.UPS33"
],
"element": "ROZ.UPS33",
"values_unit": "%",
"values": [
{
"low_critical": 20
},
{
"low_warning": 30
}
],
"results": [
{
"low_critical": {
"action": [
"EMAIL",
"SMS"
],
"severity": "CRITICAL",
"description": "Default load in ups is critically low."
}
},
{
"low_warning": {
"action": [
"EMAIL",
"SMS"
],
"severity": "WARNING",
"description": "Default load in ups is low."
}
}
],
"evaluation": "function main(f1, f2, f3) local avg = (f1 + f2 + f3) / 3; local deviation = math.max (math.abs (f1 - avg), math.abs (f2 - avg), math.abs (f3 - avg)); local percentage = deviation / avg * 100; if (percentage > high_critical) then return HIGH_CRITICAL end; if (percentage > high_warning) then return HIGH_WARNING end; return OK; end"
}
}
HTTP status code 200
Success.
Body
Media type: application/json
Type: Threshold_Rule | Single_Rule | Pattern_Rule
HTTP status code 400
Bad request.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 48,
"condition": "The request document is not valid json or does not conform to the specified format or schema."
}
{
"code": 48,
"condition": "The request document is valid json, however lua function contains syntax errors."
}
{
"code": 52,
"condition": "There already exists an alert rule with given name."
}
HTTP status code 404
Not found.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 54,
"condition": "Alert rule with the name given by the value of parameter \"name\" does not exist."
}
/api/v1/alerts/ack/{rule_name}/{asset_name}
Sets acknowledge state to an alert identified by the given rule name and name of the element.
put /api/v1/alerts/ack/{rule_name}/{asset_name}
Sets acknowledge state to an alert identified by the given rule name and name of the element.
URI Parameters
- rule_name: required (string - pattern: ^[-_.A-Za-z0-9@]{1,255}$)
Name of the given alert rule.
Examples:
onbypass@ROZ.UPS36
- asset_name: required (string - maxLength: 50)
Name of the given object.
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: object
Properties- state: required (one of ALL, ALL-ACTIVE, ACTIVE, ACK-WIP, ACK-IGNORE, ACK-PAUSE, ACK-SILENCE, RESOLVED)
State of an alert. Possible values are ALL, ALL-ACTIVE, ACTIVE, ACK-WIP, ACK-IGNORE, ACK-PAUSE, ACK-SILENCE and RESOLVED. State RESOLVED can not be set manually – it is a result of conditions, that triggered an alert, coming back to normal values.
Examples:
{
"state": "ACK-PAUSE"
}
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
HTTP status code 400
Bad request.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 48,
"condition": "The request document has invalid syntax."
}
{
"code": 47,
"condition": "The value of the key \"state\" is not valid."
}
{
"code": 52,
"condition": "Alert identified by values of URI parameters \"rule_name\" and \"asset_name\" can not change state to the requested one."
}
HTTP status code 404
Not found.
Body
Media type: application/json
Type: object
Properties- code: required (integer)
- condition: required (string)
Examples:
{
"code": 54,
"condition": "Alert identified by values of URI parameters \"rule_name\" and \"asset_name\" does not exist."
}
/api/v1/admin
Not yet an existing address by itself.
Sets up internal system time.
Retrieves internal system time.
post /api/v1/admin/time
Sets up internal system time.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Body
Media type: application/json
Type: Time | NTP
Examples:
{
"time": "2016-09-07T17:23:00Z"
}
{
"ntp": "pool.ntp.org"
}
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- time: required (object)
Date time typed in the format YYYY-MM-DDThh:mm:ssZ.
- time: required (string - pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$)
- ntp: required (object)
Network time protocol server – IP address or hostname.
- ntp: required (string - pattern: ^[-._a-zA-Z0-9]*$)
get /api/v1/admin/time
Retrieves internal system time.
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- time: required (object)
Date time typed in the format YYYY-MM-DDThh:mm:ssZ.
- time: required (string - pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$)
- ntp: required (object)
Network time protocol server – IP address or hostname.
- ntp: required (string - pattern: ^[-._a-zA-Z0-9]*$)
Updates values of specified configuration settings or creates new configuration settings.
Retrieves value of the specified configuration setting.
post /api/v1/admin/config
Updates values of specified configuration settings or creates new configuration settings.
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: object
Properties- config: required (object)
An object with two properties: "key" (configuration setting name) and "value".
- key: required (string - pattern: ^[.-_a-zA-Z0-9]+$)
- value: required (string - pattern: ^[-._a-zA-Z0-9]*$)
The value of the configuration setting given by "key".
Examples:
{
"config": {
"key": "smtp",
"value": "1.3.2.4"
}
}
get /api/v1/admin/config
Retrieves value of the specified configuration setting.
Annotations
- Authorization:
{"profile":["administrator"]}
Query String
- key: required (string - pattern: ^[.-_a-zA-Z0-9]+$)
HTTP status code 200
Success.
Body
Media type: application/json
Type: object
Properties- config: required (object)
An object with two properties: "key" (configuration setting name) and "value".
- key: required (string - pattern: ^[.-_a-zA-Z0-9]+$)
- value: required (string - pattern: ^[-._a-zA-Z0-9]*$)
The value of the configuration setting given by "key".
Retrieves a list of available services.
get /api/v1/admin/systemctl/list
Retrieves a list of available services.
Retrieves the status of the required service.
get /api/v1/admin/systemctl/status/{service_name}
Retrieves the status of the required service.
URI Parameters
- service_name: required (string)
Name of a system service.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Requests start of the given service.
post /api/v1/admin/systemctl/start
Requests start of the given service.
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: object
Properties- service_name: required (string - maxLength: 50)
Name of the given object.
Examples:
{
"service_name": "42ity-asset"
}
Requests termination of the given service.
post /api/v1/admin/systemctl/stop
Requests termination of the given service.
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: object
Properties- service_name: required (string - maxLength: 50)
Name of the given object.
Examples:
{
"service_name": "42ity-asset"
}
Requests restart of the given service.
post /api/v1/admin/systemctl/restart
Requests restart of the given service.
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: object
Properties- service_name: required (string - maxLength: 50)
Name of the given object.
Examples:
{
"service_name": "42ity-asset"
}
Enables the given service to start during bootup.
post /api/v1/admin/systemctl/enable
Enables the given service to start during bootup.
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: object
Properties- service_name: required (string - maxLength: 50)
Name of the given object.
Examples:
{
"service_name": "42ity-asset"
}
Disables the given service to start during bootup.
post /api/v1/admin/systemctl/disable
Disables the given service to start during bootup.
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: object
Properties- service_name: required (string - maxLength: 50)
Name of the given object.
Examples:
{
"service_name": "42ity-asset"
}
Retrieves a list of configurable network interfaces.
get /api/v1/admin/netcfgs
Retrieves a list of configurable network interfaces.
Retrieves settings of the specified interface.
Updates settings of the specified interface.
get /api/v1/admin/netcfg/{iface_name}
Retrieves settings of the specified interface.
URI Parameters
- iface_name: required (string - pattern: ^[A-Za-z][A-Za-z0-9]{0,14}$)
Interface name – has to fit specified regular expression.
Annotations
- Authorization:
{"profile":["administrator"]}
put /api/v1/admin/netcfg/{iface_name}
Updates settings of the specified interface.
URI Parameters
- iface_name: required (string - pattern: ^[A-Za-z][A-Za-z0-9]{0,14}$)
Interface name – has to fit specified regular expression.
Annotations
- Authorization:
{"profile":["administrator"]}
Body
Media type: application/json
Type: object
Properties- /^[A-Za-z][A-Za-z0-9]{0,14}$/: required (object)
Name of the given interface. The following properties are available:
- method
- address
- netmask
- gateway
- nameservers
- method: (one of static, dhcp)
A kind of the method by which an IP address is assigned. Value static means manually assigned address, and value dhcp means use of Dynamic Host Configuration Protocol.
- address: (string - pattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$)
IP address; only IPv4 addresses are supported.
- netmask: (string - pattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$)
The subnet mask of the IP address.
Examples:
255.255.255.0
- gateway: (string - pattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$)
Default gateway.
- nameservers: (array of items)
Preferred DNS (Domain Name System) servers.
Examples:
{
"LAN2": {
"method": "static",
"address": "192.168.1.10",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"nameservers": [
"192.168.127.1"
]
}
}
Retrieves list of network interfaces that are used at the moment in the system.
get /api/v1/admin/ifaces
Retrieves list of network interfaces that are used at the moment in the system.
Retrieves settings of the specified interface.
get /api/v1/admin/iface/{iface_name}
Retrieves settings of the specified interface.
URI Parameters
- iface_name: required (string - pattern: ^[A-Za-z][A-Za-z0-9]{0,14}$)
Interface name – has to fit specified regular expression.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Accepts current license agreement.
Retrieves text of the latest license agreement.
post /api/v1/admin/license
Accepts current license agreement.
get /api/v1/admin/license
Retrieves text of the latest license agreement.
Retrieves status of license acceptance.
get /api/v1/admin/license/status
Retrieves status of license acceptance.
Changes user's password.
post /api/v1/admin/passwd
Changes user's password.
Annotations
- Authorization:
{"profile":["dashboard","administrator"]}
Body
Media type: application/json
Type: object
Properties- user: required (string - maxLength: 50 - pattern: ^[-_A-Za-z0-9]{1,50}$)
Valid user name.
- old_passwd: required (string - pattern: ^.{0,150}$)
Old (valid) password of the concerned user.
- new_passwd: required (string - pattern: ^.{0,150}$)
New (valid) password of the concerned user.
Retrieves various system informations.
get /api/v1/admin/sysinfo
Retrieves various system informations.
Annotations
- Authorization:
{"profile":["anonymous","dashboard","administrator"]}
Query String
- detail: required (yes)
There is only one possible value: yes. If the value is set to something else, the parameter is considered not specified.
/api/v1/admin/email_test
Sends test email to the requested email address.
TODO the whole call
post /api/v1/admin/email_test
Sends test email to the requested email address.
TODO the whole call
/api/v1/oauth2/token
Retrieves a new authentication token.
post /api/v1/oauth2/token
Retrieves a new authentication token.
Annotations
- Authorization:
{"profile":["anonymous","dashboard","administrator"]}
Body
Media type: application/json
Type: object
Properties- username: required (string - maxLength: 50 - pattern: ^[-_A-Za-z0-9]{1,50}$)
Valid user name.
- password: required (string - pattern: ^.{0,150}$)
(Valid) password of the concerned user.
- grant_type: required (password)
Property "grant_type" has to be set to password.
Examples:
{
"username": "admin",
"password": "pwd?1234",
"grant_type": "password"
}
/api/v1/oauth2/revoke
Invalidates the given token.
post /api/v1/oauth2/revoke
Invalidates the given token.
Annotations
- Authorization:
{"profile":["anonymous","dashboard","administrator"]}
Body
Media type: application/x-www-form-urlencoded
Type: object
Properties- token: required (string - pattern: ^[-/._~+/a-zA-Z0-9]{0,255}={0,10}$)
Access token.
Examples:
{
"token": "jgWCdeM8Ik9GbSBCVLTk9K-oRqzR-7qt7SwZSekzORx_-uqLIKsUvIKL5w=="
}