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)
Request
With this API, you can:
- Retrieve a list of all devices 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>.
Return devices of a specific make. Example syntax, make eq <value>.
Return devices of a specific category. Example syntax, category eq <value>.
Return devices manufactured on or after specific date. Example syntax, manufacturedDate ge <value>.
Return devices whose current support level end date is on or before specific date. Example syntax, currentSupportLevelEndDate le <value>.
Return devices of a specific source. Example syntax, source eq <value>.
Return devices that are on a flex subscription or not. Example syntax, isFlex eq true|false.
Return devices of a specific billing tier. Example syntax, billingTier eq <value>.
Return devices where a property is null or not null. Example syntax, <property> eq null or <property> ne null.
Return devices where management is MSP. Example syntax, management eq <value>.
Return devices where management is TENANT. Example syntax, management eq <value>.
Return devices where management is null (Enterprise Organization). Example syntax, management eq null.
Return devices assigned to a specific workspace. Example syntax, inUseWorkspaceId eq <value>.
Return MSP managed devices assigned to a specific workspace. Example syntax, management eq <value> and inUseWorkspaceId eq <value>.
Return MSP managed devices where inUseWorkspaceId is null. Example syntax, management eq <value> and inUseWorkspaceId eq null.
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.
- Url hostnamehttps://global.api.greenlake.hpe.com/devices/v1/devices
- Mock serverhttps://developer.greenlake.hpe.com/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory/openapi/devices/v1/devices
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X GET \
https://global.api.greenlake.hpe.com/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.
The date and time the device was created in UTC (RFC 3339 format).
The date and time the device was last updated in UTC (RFC 3339 format).
The computed category of the device based on the device type, for example, Network, Storage, or Compute.
The date the device was manufactured in UTC (RFC 3339 format).
The ownership of the device based on how the device was added to the inventory.
The source of device based on how it was added to the inventory.
A boolean that indicates whether the device has a Flex subscription or not.
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).
The platform subscription category assigned to the device. This field is populated only for Compute devices.
The billing account ID associated with the Flex device.
The billing account name associated with the Flex device.
Indicates whether the device is managed by an MSP or a tenant. Null indicates an enterprise organization device (not MSP/tenant-managed).
The workspace the device belongs to. Null for MSP account types. For other account types (MOI, COI, Enterprise Org Standalone), this field indicates the workspace the device is currently in use by.
{ "items": [ { … } ], "count": 1, "offset": 0, "total": 1 }
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. 50 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.
- Url hostnamehttps://global.api.greenlake.hpe.com/devices/v1/devices
- Mock serverhttps://developer.greenlake.hpe.com/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory/openapi/devices/v1/devices
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X POST \
https://global.api.greenlake.hpe.com/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": "22d6fbfb-d253-4455-984a-356da827e5fc" }
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. 40 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.
- Url hostnamehttps://global.api.greenlake.hpe.com/devices/v1/devices
- Mock serverhttps://developer.greenlake.hpe.com/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory/openapi/devices/v1/devices
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X PATCH \
'https://global.api.greenlake.hpe.com/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": "22d6fbfb-d253-4455-984a-356da827e5fc" }
- Url hostnamehttps://global.api.greenlake.hpe.com/devices/v1/devices/{id}
- Mock serverhttps://developer.greenlake.hpe.com/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory/openapi/devices/v1/devices/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X GET \
'https://global.api.greenlake.hpe.com/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.
The date and time the device was created in UTC (RFC 3339 format).
The date and time the device was last updated in UTC (RFC 3339 format).
The computed category of the device based on the device type, for example, Network, Storage, or Compute.
The date the device was manufactured in UTC (RFC 3339 format).
The ownership of the device based on how the device was added to the inventory.
The source of device based on how it was added to the inventory.
A boolean that indicates whether the device has a Flex subscription or not.
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).
The platform subscription category assigned to the device. This field is populated only for Compute devices.
The billing account ID associated with the Flex device.
The billing account name associated with the Flex device.
Indicates whether the device is managed by an MSP or a tenant. Null indicates an enterprise organization device (not MSP/tenant-managed).
The workspace the device belongs to. Null for MSP account types. For other account types (MOI, COI, Enterprise Org Standalone), this field indicates the workspace the device is currently in use by.
{ "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", "make": "HPE", "category": "COMPUTE", "manufacturedDate": "2024-01-10T00:00:00Z", "ownership": "MANAGED", "source": "MANAGED", "isFlex": true, "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": { "id": "3292c36d-30ef-4f26-823b-76b5d213b670", "key": "SIEIAASTEST018ID", "tier": "ENHANCED_PROLIANT", "startTime": "2024-02-13T19:30:32.920Z", "endTime": "2024-02-13T19:30:32.920Z", "resourceUri": "/subscriptions/v1beta1/subscriptions/3292c36d-30ef-4f26-823b-76b5d213b670" }, "tenantWorkspaceId": "3292c36d30ef4f26823b76b5d213b670", "location": { "id": "57f2b22e-7923-497b-8120-fd2b94579f13", "city": "New York", "state": "NY", "country": "USA", "latitude": 40.7128, "longitude": -74.006, "postalCode": "10001", "locationName": "Main Office", "streetAddress": "123 Main St", "locationSource": "GPS", "resourceUri": "/locations/v1beta1/locations/57f2b22e-7923-497b-8120-fd2b94579f13" }, "warranty": { "country": "string", "currentSupportLevel": { … }, "supportLevels": [ … ] }, "billingAccountId": "123456789", "billingAccountName": "1235-ABCD", "billingTier": "ENHANCED_PROLIANT", "contact": { "type": "WORKSPACE-USER", "WorkspaceUser": { … } }, "management": "MSP", "inUseWorkspace": { "id": "3292c36d30ef4f26823b76b5d213b670", "resourceUri": "/workspaces/v1/workspaces/3292c36d30ef4f26823b76b5d213b670", "type": "workspaces/workspace" } }
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.- Url hostnamehttps://global.api.greenlake.hpe.com/devices/v1/async-operations/{id}
- Mock serverhttps://developer.greenlake.hpe.com/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory/openapi/devices/v1/async-operations/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X GET \
'https://global.api.greenlake.hpe.com/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" }