Retrieval of clusters (deprecated)

You use the GET operation on the api/sam/clusters element to request information about clusters that group your host computer systems. This information represents the current state of your environment and does not include any historical data.

After you retrieve the IDs of your clusters, compare them with the cluster_id column retrieved by API for computer systems to recognize which of these systems belong to which clusters. This information can also be viewed on the Hardware Inventory report in the user interface.
Important:
  • To use this API, you must be assigned to the All Computers group and have the View Hardware Inventory permission.
  • By default, the retrieved data is sorted by id.

Before you begin

9.2.34 Starting from application update 9.2.34, this REST API is disabled by default. To enable it, change the value of the expose_deprecated_api parameter on the Advanced Server Settings panel to true. For more information, see: Advanced server settings.

Important: Deprecated REST APIs are going to be removed at the end of 2024. After that period, these REST APIs are going to be unsupported. Switch to version 2 of the REST APIs as soon as convenient.

Resource URL

To retrieve information about clusters, use the following URL:
https://hostname:port/api/sam/clusters

Resource information

Table 1. Resource information
Operation details Description
Purpose Returns a list of clusters.
HTTP method GET
Resource URI https://server_host_name:port_number/api/sam/clusters
URI query parameters For a list of applicable query parameters, see: Query parameters.
Request headers
Accept-Language (optional)
  • Use: Used to negotiate the language of the response. If this header is not specified, the content is returned in the server language.
  • Values: en-US (only English is supported)
Token
  • Use: Used to authenticate REST API requests. The header is required when you set the value of the api_token_in_url_enabled parameter to false. Otherwise, you can specify the token in the request header or in the URL. For more information, see: Authenticating REST API requests.
  • Values: an alphanumeric string that is generated in License Metric Tool
Request payload n/a
Request Content-Type
  • application/json
Response headers
Content-Type
  • Use: Specifies the content type of the response.
  • Values: application/json
Content-Language
  • Use: Specifies the language of the response content. If this header is not specified, the content is returned in the server language.
  • Values: en-US, …
Import-Mode
  • Use: Specifies the data import status.
  • Values: none, idle, running, pending
Import-Progress
  • Use: Specifies the percentage progress of a data import.
  • Values: A percentage value, for example 59.
Import-Last-Status
  • Specifies the status of the last data import.
  • successful, failed
Import-Last-Success-Time
  • Use: Specifies the time of the last successful data import.
  • Values: Date, for example 2014-06-18T04:00:29Z.
Response payload Clusters element
Response Content-Type
  • application/json
Normal HTTP response codes
  • 200 – OK
Error HTTP response codes
  • 500 – “Bad Request” if a query parameter contains errors or is missing

Message body includes an error message with details.

Query parameters

You can use query parameters to narrow down the results of your search. The following table presents query parameters that you can use for the api/sam/clusters element.
Table 2. Query parameters for retrieving clusters
Parameter Description Required Value
columns[] Specify which columns to retrieve. If you do not specify this parameter, a set of default columns is retrieved. For available columns, see Response body. Example:
Retrieve the name and id columns:
URL?columns[]=name&columns[]=id
No String
order Specify how to sort the returned data. The default direction for sorting columns is ascending. If you want to specify a descending sort, append desc to the column name. Example:
Order by type descending:
URL?order[]=type desc
No String
limit Specify the number of rows to retrieve. If you omit this parameter, all rows are retrieved. No Numeric
offset Specify the number of rows to skip for retrieving results. You can use it together with the limit parameter to paginate results. Example:
Retrieve 50 records starting after record 150:
URL?limit=50&offset=150
No Numeric

Example HTTP conversation

Request
GET https://server_host_name:port_number/api/sam/clusters
Request header
Accept: application/json 
Accept-Language: en-US
Token: <token>
Response header
HTTP/1.1 200 OK
Content-Type: application/json
Content-Language: en-US
The above response header may be followed by different entries, depending on the current status of the data import which is represented by Import-Mode. To understand the returned values, see the following definitions:
  • none - a data import has never been initiated
  • idle - no data imports are currently running
  • running - a data import is in progress
  • pending - an action performed in the user interface requires a data import to be started for the change to take effect
If a data import has never been initiated:
Import-Mode: none
If a data import is in progress:
Import-Mode: running
Import-Progress: 41
If a data import is not running:
Import-Mode: idle/pending
Import-Last-Status: successful
Import-Last-Success-Time: Mon, 23 Jun 2014 12:18:29 GMT
Response body (JSON)
{	
 "id": 1,
 "name": "Production Cluster 1",
 "cores_count": 24,
 "vm_manager_url": "https://<ip_address>/sdk",
}