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
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 edit permissions for the Devices and Subscription service to call this API endpoint.
Rate limits are enforced, and 25 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.
- Mock server
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/devices/v2beta1/devices
- Url hostname
https://global.api.greenlake.hpe.com/devices/v2beta1/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/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 content
Request
Update devices by passing one or more device IDs.
The API supports 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
null
tag 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 edit permissions for the Devices and Subscription service to initiate this API call. Rate limits are enforced, and five 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.
- Mock server
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/devices/v2beta1/devices
- Url hostname
https://global.api.greenlake.hpe.com/devices/v2beta1/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/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 '{
"tags": {
"location": "San Jose",
"purchase month": "April 2023",
"Setup Option": "Default"
}
}'
{ "code": 0, "status": "100 CONTINUE", "transactionId": "string" }