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
Returns devices grouped by the attribute specified in group-by (for example: make, model, or source). For date-based grouping fields, you can optionally apply lower-threshold and upper-threshold to define a date range. The response is paginated and includes each group value with its corresponding device count. Rate limits are enforced on this API. 300 requests per minute is supported per workspace. The API returns 429 if this threshold is breached.
The grouping operation supports the following fields: make, source, category, manufacturedDate, currentSupportLevelEndDate, billingAccountId, billingTier, deviceType, ownership, isFlex and model. currentSupportLevelEndDate groups on warranty.currentSupportLevel.endDate and uses that nested date value.
The filter expressions that are used to narrow down the devices before grouping. Combine multiple conditions using and or or. The following examples are not an exhaustive list of all possible filtering options.
Filter all managed devices in the workspace
Filter devices that are either MANAGED or DISCOVERED
Filter devices assigned to a specific location
Filter devices in either of two locations
Filter managed devices in a specific location
Filter devices by their location resource ID
Lower bound for date-based grouping.
Applies only when group-by is a date field (manufacturedDate or currentSupportLevelEndDate).
Includes devices where the grouped date is greater than or equal to this value.
Use with upper-threshold to group results into four buckets: less_than_lower, lower_to_upper, greater_than_upper, missing.
Upper bound for date-based grouping.
Applies only when group-by is a date field (manufacturedDate or currentSupportLevelEndDate).
Includes devices where the grouped date is less than or equal to this value.
Use with lower-threshold to group results into four buckets: less_than_lower, lower_to_upper, greater_than_upper, missing.
Returns distinct values for the specified field, without counts.
Use this as a distinct-only variant of group-by (for example, get unique make values).
Value for select field should be the same as group-by field. For example, if you are grouping by make, then select should also be make to get distinct makes in the response.
Supports the same fields as group-by.
Zero-based resource offset to start the response from.
- Url hostnamehttps://global.api.greenlake.hpe.com/devices/v2beta1/devices/group
- Mock serverhttps://developer.greenlake.hpe.com/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory/openapi/devices/v2beta1/devices/group
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X GET \
'https://global.api.greenlake.hpe.com/devices/v2beta1/devices/group?group-by=make' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'Devices are grouped by the make attribute, and the count of devices for each make is returned.
{ "items": [ { … }, { … }, { … } ], "count": 3, "total": 3, "offset": 0 }
- Url hostnamehttps://global.api.greenlake.hpe.com/devices/v2beta1/devices/{id}
- Mock serverhttps://developer.greenlake.hpe.com/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory/openapi/devices/v2beta1/devices/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X GET \
'https://global.api.greenlake.hpe.com/devices/v2beta1/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": "NETWORK", "manufacturedDate": "2024-02-13T19:30:32.920Z", "ownership": "MANAGED", "source": "MANAGED", "isFlex": false, "archived": false, "deviceName": "iLO Hostname", "secondaryName": "OS Hostname", "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": "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": [ … ] }, "subscriptionCategory": "ProLiant", "dedicatedPlatformWorkspace": { "id": "a482ff61-1e0e-4818-920b-4cbc017208ee" }, "billingAccountId": "12345-67890-ABCD", "billingAccountName": "12345-67890-ABCD", "billingTier": "Premium", "contact": { "type": "NON-WORKSPACE-USER", "email": "nonworkspace.user@gmail.com", "firstName": "John", "lastName": "Doe", "phoneNumber": "+1-555-123-4567", "id": "4a2e4102-5c05-4713-8fc8-4e82f9704e53", "resourceUri": "/identity/v1/users/4a2e4102-5c05-4713-8fc8-4e82f9704e53" }, "management": "MSP", "inUseWorkspace": { "id": "3292c36d30ef4f26823b76b5d213b670", "resourceUri": "/workspaces/v1/workspaces/3292c36d30ef4f26823b76b5d213b670", "type": "workspaces/workspace" } }
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. 300 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> le <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.
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 100 and the maximum is 500.
- Url hostnamehttps://global.api.greenlake.hpe.com/devices/v2beta1/devices
- Mock serverhttps://developer.greenlake.hpe.com/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory/openapi/devices/v2beta1/devices
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X GET \
https://global.api.greenlake.hpe.com/devices/v2beta1/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": 10, "offset": 0, "total": 100 }
Request
Add one or more devices to a workspace. This API endpoint provides an asynchronous response and returns 202 Accepted if basic input validations are successful. The location header in the response provides the URI to invoke to fetch the progress of the device addition task. For details about the status fetch URL, refer to the API endpoint Get progress or status of async operations in devices.
NOTE: You need create permissions for the Devices and Subscription service to call this API endpoint.
Rate limits are enforced, and 50 requests per minute are supported per workspace. The API endpoint 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.
The media access control (MAC) address of the device. This is required for claiming NETWORK devices.
The part number of the device. This is required for claiming COMPUTE or STORAGE devices.
- Url hostnamehttps://global.api.greenlake.hpe.com/devices/v2beta1/devices
- Mock serverhttps://developer.greenlake.hpe.com/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory/openapi/devices/v2beta1/devices
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X POST \
https://global.api.greenlake.hpe.com/devices/v2beta1/devices \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"serialNumber": "SN12345678",
"macAddress": "00:1B:44:11:3A:B7",
"deviceType": "NETWORK",
"tags": {
"environment": "production"
},
"location": {
"id": "8cd9ad69-a8e5-4529-97ea-804b2c88d123"
}
}'No contentRequest
Update devices by passing one or more device IDs.
The API supports Device operations such as:
API supports updating location and tags for all types of devices, discovered and managed
Supports updating missing warranty information like warranty/currentSupportLevel/endDate, warranty/currentSupportLevel/serviceLevel for discovered devices.
The API supports earlier Device operations such as:
- Assigning and unassigning devices to and from a service.
- Adding, updating and removing tags to devices.
- Archiving and un-archiving the devices.
To remove an application, set the
id under application to null and region to null. Set an empty array to the attribute subscription to remove a subscription. For each tag provided in the request body: - Tags are created and inserted into the specified devices if the provided tags do not map to null and are not already present.
- Tags are updated with the provided if the provided tag key is already present in a device, but the provided value differs from the existing value.
- Tags are removed from devices when a tag key is mapped to a
nulltag value. The tags are removed from any devices with a matching tag with the same key.
The archive device operation is incompatible with any other device operation in the same API call. For example, you cannot remove an application and archive a device using the same API call.
This is an asynchronous API endpoint and it returns the
202 Accepted response code and a Location header containing the URI of the asynchronous operation that can be used to track progress. For details about the status fetch URL, refer to the API Get progress or status of async operations in devices. NOTE: You need update permissions for the Devices to initiate this API call. Rate limits are enforced, and 40 requests per minute are supported per workspace. The API returns
429 if this threshold is breached.Array of device resource IDs. Maximum twenty 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.
Provide a map of tags to create or delete for the given DeviceID (or multiple DeviceID's). Tags are saved with the character casing preserved (uppercase, lowercase, mixed, and so on). For example, adding a new tag with the key Location will fail if the Device already has a tag with the key LOCATION as they are considered the same key. Tag keys and tag values can comprise letters, numbers, spaces (represented in UTF-8), and only the characters: _, ., :, =, +, -, and @. NOTE: Do not store sensitive data, such as personally identifiable information, in tags.
- Url hostnamehttps://global.api.greenlake.hpe.com/devices/v2beta1/devices
- Mock serverhttps://developer.greenlake.hpe.com/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory/openapi/devices/v2beta1/devices
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X PATCH \
'https://global.api.greenlake.hpe.com/devices/v2beta1/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 '{
"location": {
"id": "57f2b22e-7923-497b-8120-fd2b94579f13"
}
}'{ "code": 0, "status": "100 CONTINUE", "transactionId": "22d6fbfb-d253-4455-984a-356da827e5fc" }