With the HPE GreenLake APIs for Device Management you can view, manage, and onboard devices in your workspace. The API allows you to invoke any operation or task that is available through the HPE GreenLake edge-to-cloud platform user interface.
HPE GreenLake APIs for Device Management (latest)
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/
https://global.api.greenlake.hpe.com/
Request
With this API, you can:
- Retrieve a list of devices managed in a workspace.
- Filter devices based on conditional expressions.
NOTE: You need view permissions for Devices and Subscription service to invoke this API.
Rate limits are enforced on this API. 160 requests per minute is supported per workspace. The API returns429
if this threshold is breached.Filter expressions consisting of simple comparison operations joined by logical operators.
CLASS | EXAMPLES |
---|---|
Types | integer, decimal, timestamp, string, boolean, null |
Comparison | eq, ne, gt, ge, lt, le, in |
Logical Expressions | and, or, not |
The following examples are not an exhaustive list of all possible filtering options.
Return devices where a property equals a value. Example syntax, <property> eq <value>.
Return devices where a property does not equal a value. Example syntax, not <property> eq <value>.
Return devices where a property is greater or equal to a value. Example syntax, <property> ge <value>.
Return devices where a property is lesser or equal to a value. Example syntax, <property> ge <value>.
Return devices that exactly satisfy multiple filter queries. Example syntax, <property> eq <value> and <property> eq <value>.
Return devices that exactly satisfy one of multiple filter queries. Example syntax, <property> eq <value> or <property> eq <value>.
Return devices where a property is one of multiple values. Example syntax, <property> in <value>,<value>.
Filter expressions consisting of simple comparison operations joined by logical operators to be applied on the assigned tags or their values.
CLASS | EXAMPLES |
---|---|
Types | string |
Comparison | eq, ne, in |
Logical Expressions | and, or, not |
Return devices where a tag key is equal to a tag value. Example syntax, <tagKey> eq <tagValue>.
Return devices where a tag key does not equal a tag value. Example syntax, not <property> eq <value>.
Return devices that exactly satisfy multiple filter queries applied to tag keys. Example syntax, <property> eq <value> and <property> eq <value>.
Return devices that satisfy any of multiple filter queries applied to tag keys. Example syntax, <property> eq <value> or <property> eq <value>.
Return devices containing the tag key and at least one of the specified values. Example syntax, <property> in <value>,<value>.
A comma separated list of sort expressions. A sort expression is a property name optionally followed by a direction indicator asc
or desc
. The default is ascending order.
A comma separated list of select properties to display in the response. The default is that all properties are returned.
Specifies the number of results to be returned. The default value is 2000.
- Mock server
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/devices/v1/devices
- Url hostname
https://global.api.greenlake.hpe.com/devices/v1/devices
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X GET \
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/devices/v1/devices \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'
Successful response
The unique identifier of the device.
The media access control (MAC) address of the device
The current assignment state of the device.
ASSIGNED_TO_ACTIVATE_CONFIG
—The device was moved to the custom activate configuration.ASSIGNED_TO_DEDICATED_PLATFORM
—The device is used in a dedicated platform workspace.ASSIGNED_TO_SERVICE
—The device is assigned to a service.UNASSIGNED
—The device is available for service provisioning.
Date and time the device was created in UTC.
Date and time the device was last updated in UTC.
A boolean that indicates whether the device has been archived or not. Archived devices are no longer in service.
The unique identifier of the tenant workspace belonging to an MSP. This field is populated only for MSP-owned inventory tenants (the MSP owns the devices and subscriptions and also manages the workspace on behalf of their customers).
{ "items": [ { … } ], "count": 10, "offset": 0, "total": 100 }
Request
Add one or more devices to a workspace. This API provides an asynchronous response and will always return 202 Accepted
if basic input validations are successful. The location header in the response provides the URI to be invoked for fetching the progress of the device addition task. For details about the status fetch URL, refer to the API Get progress or status of async operations in devices.
NOTE: You need edit permissions for the Devices and Subscription service to invoke this API.
Rate limits are enforced on this API. 25 requests per minute is supported per workspace. The API returns429
if this threshold is breached.The dry-run
query parameter is used to perform the resource update operation (POST
, PUT
, PATCH
, DELETE
) and return a response as if the operation had completed, but without actually creating, updating, or deleting the resource. This allows you to test if the request would succeed before making the change. If set to true
, the request is validated but not executed.
Accepts a maximum of five devices per request, combining the count of network, compute, and storage devices.
- Mock server
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/devices/v1/devices
- Url hostname
https://global.api.greenlake.hpe.com/devices/v1/devices
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X POST \
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/devices/v1/devices \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"network": [
{
"serialNumber": "string",
"macAddress": "string"
}
],
"compute": [
{
"serialNumber": "string",
"partNumber": "string"
}
],
"storage": [
{
"serialNumber": "string",
"partNumber": "string"
}
]
}'
{ "code": 0, "status": "100 CONTINUE", "transactionId": "string" }
Request
Update devices by passing one or more device IDs. The API currently supports:
- Assigning and unassigning devices to and from a service.
- Applying and removing subscriptions to and from devices.
id
under application
to null
and 'region' to null
. Set an empty array to the attribute subscription
to remove a subscription. Only one operation is supported in a single API call. For example, you cannot assign devices to an application and assign subscriptions to devices in a single API invocation. You can achieve this with two API calls.
This API provides an asynchronous response and returns
202 Accepted
if basic input validations are successful. The location header in the response provides the URI to be invoked for fetching the progress of the device update task. For details about the status fetch URL, refer to the API Get progress or status of async operations in devices. NOTE: You need edit permissions for the Devices and Subscription service to invoke this API.
Rate limits are enforced on this API. Five requests per minute is supported per workspace. The API returns
429
if this threshold is breached.Array of device resource IDs. Maximum five devices per request.
The dry-run
query parameter is used to perform the resource update operation (POST
, PUT
, PATCH
, DELETE
) and return a response as if the operation had completed, but without actually creating, updating, or deleting the resource. This allows you to test if the request would succeed before making the change. If set to true
, the request is validated but not executed.
- Mock server
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/devices/v1/devices
- Url hostname
https://global.api.greenlake.hpe.com/devices/v1/devices
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X PATCH \
'https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/devices/v1/devices?id=05fc0c47-e517-5709-976e-c0b726977477%26id%3D08a42d07-b144-5602-9a82-7927d6e44616' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/merge-patch+json' \
-d '{}'
{ "code": 0, "status": "100 CONTINUE", "transactionId": "string" }
- Mock server
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/devices/v1/devices/{id}
- Url hostname
https://global.api.greenlake.hpe.com/devices/v1/devices/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X GET \
'https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/devices/v1/devices/{id}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'
Successful response
The unique identifier of the device.
The media access control (MAC) address of the device
The current assignment state of the device.
ASSIGNED_TO_ACTIVATE_CONFIG
—The device was moved to the custom activate configuration.ASSIGNED_TO_DEDICATED_PLATFORM
—The device is used in a dedicated platform workspace.ASSIGNED_TO_SERVICE
—The device is assigned to a service.UNASSIGNED
—The device is available for service provisioning.
Date and time the device was last updated in UTC.
A boolean that indicates whether the device has been archived or not. Archived devices are no longer in service.
The unique identifier of the tenant workspace belonging to an MSP. This field is populated only for MSP-owned inventory tenants (the MSP owns the devices and subscriptions and also manages the workspace on behalf of their customers).
{ "id": "64343c3c-3016-4234-baee-765651aa4bb3", "macAddress": "21:01:18:21:12:22", "serialNumber": "AX17PR347J", "partNumber": "BHD31D9J", "type": "devices/device", "deviceType": "ALS", "assignedState": "ASSIGNED_TO_ACTIVATE_CONFIG", "createdAt": "2024-02-13T09:00:22.920Z", "updatedAt": "2024-02-13T19:30:32.920Z", "model": "COMPUTE", "archived": false, "application": { "id": "0892c36d-40df-4f26-923b-76b5d213b420", "resourceUri": "/service-catalog/v1beta1/service-managers/0892c36d-40df-4f26-923b-76b5d213b420" }, "region": "us-west", "tags": { "property1": "string", "property2": "string" }, "subscription": [ { … } ], "tenantWorkspaceId": "3292c36d-30ef-4f26-823b-76b5d213b670", "location": { "id": "57f2b22e-7923-497b-8120-fd2b94579f13", "resourceUri": "/locations/v1beta1/locations/57f2b22e-7923-497b-8120-fd2b94579f13" }, "warranty": { "country": "string", "currentSupportLevel": { … }, "supportLevels": [ … ] } }
Request
The add and update device APIs are asynchronous. Use this API to find the status of the asynchronous add and update operations.
An asynchronous resource tracks the status of an asynchronous operation. An asynchronous resource that has reached a terminal state (SUCCEEDED
, FAILED
, TIMEOUT
) will no longer be accessible 24 hours after reaching the terminal state.
The TIMEOUT
state indicates that the operation was in an INITIALIZED
or RUNNING
state for a period greater than the timeout set. If an asynchronous operation resource coming from an asynchronous request consists of multiple devices, a breakdown of succeeded devices and failed devices, if there are any, will be returned as the response. In this case, the device serial number identifies each device.
NOTE: You need view permissions for the Devices and Subscription service to invoke this API.
Rate limits are enforced on this API. 90 requests per minute is supported per workspace. The API returns429
if this threshold is breached.- Mock server
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/devices/v1/async-operations/{id}
- Url hostname
https://global.api.greenlake.hpe.com/devices/v1/async-operations/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X GET \
'https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/devices/v1/async-operations/{id}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'
{ "status": "INITIALIZED", "startedAt": "2019-08-24T14:15:22Z", "endedAt": "2019-08-24T14:15:22Z", "progressPercent": 0, "suggestedPollingIntervalSeconds": 0, "timeoutMinutes": 0, "result": {}, "resultType": "string", "id": "3292c36d-30ef-4f26-823b-76b5d213b670", "type": "devices/asyncOperation" }