Skip to content

HPE GreenLake APIs for Device Management (latest)

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.

Download OpenAPI description
Languages
Servers
Mock server

https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/device-management/public/openapi/nbapi-inventory-latest/

Url hostname

https://global.api.greenlake.hpe.com/

Devices - v2beta1

Operations

Add devices

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 returns 429 if this threshold is breached.

Security
Bearer
Query
dry-runboolean

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.

Default false
Bodyapplication/jsonrequired
serialNumberstringrequired

The serial number of the device.

deviceTypestringrequired

The type of device.

Enum"COMPUTE""NETWORK""STORAGE"
tagsobject
macAddressstring

The media access control (MAC) address of the device. This is required for claiming NETWORK devices.

partNumberstring

The part number of the device. This is required for claiming COMPUTE or STORAGE devices.

locationobject

The location ID of the device.

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"
    }
  }'

Responses

Request accepted

Headers
Locationstring

The URI of the accepted asynchronous operation resource

Example: "/devices/v1/async-operations/22d6fbfb-d253-4455-984a-356da827e5fc"
Body
Response
No content

Update devices

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.
The API endpoint supports subscription operations of applying and removing subscriptions to and from 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 endpoint only supports either a device or a subscription operation per API call. For example, you cannot assign devices to an application and assign subscriptions to devices in a single API call. You can achieve this with two separate API calls. However, a single API call can perform device operations together; for example, assigning an application and adding tags can be performed.

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.
Security
Bearer
Query
idArray of stringsuniquerequired

Array of device resource IDs. Maximum twenty five devices per request.

Example: id=05fc0c47-e517-5709-976e-c0b726977477&id=08a42d07-b144-5602-9a82-7927d6e44616
dry-runboolean

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.

Default false
Bodyapplication/merge-patch+jsonrequired
subscriptionArray of objects(RequestSubscription)
applicationobject(RequestApplication)
regionstring

The region of the application the device is provisioned in.

tenantWorkspaceIdstring

The platform customer ID of the tenant.

archivedboolean
tagsobject

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.

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"
    }
  }'

Responses

Request accepted

Headers
Locationstring

The URI of the accepted asynchronous operation resource

Example: "/devices/v1/async-operations/22d6fbfb-d253-4455-984a-356da827e5fc"
Bodyapplication/json
codeinteger(int32)required

Three digit HTTP status code.

statusstringrequired

Three digit HTTPS status code and message.

Enum"100 CONTINUE""101 SWITCHING_PROTOCOLS""102 PROCESSING"
transactionIdstringrequired

The unique identifier of the transaction.

Response
application/json
{ "code": 0, "status": "100 CONTINUE", "transactionId": "string" }

Devices - v1

Operations

Devices - v1beta1

Operations