With the HPE GreenLake APIs for Subscription Management you can add subscriptions, get subscription information, and update auto-subscription settings for your HPE GreenLake workspace.
HPE GreenLake APIs for Subscription Management (latest)
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/subscription-management/public/openapi/nbapi-subscription-latest/
https://global.api.greenlake.hpe.com/
Request
Add one or more subscriptions to a workspace.
NOTE: You need to have the edit permission for the Devices and Subscription service to invoke this API.
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 progress of the subscription addition task. For details about the status fetch URL, refer to the API Get progress or status of async operations in subscriptions.
Rate limits are enforced on this API. Four requests per minute is supported per workspace, and the API returns a 429
status code 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.
Maximum five subscriptions per request.
- Mock server
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/subscription-management/public/openapi/nbapi-subscription-latest/subscriptions/v1/subscriptions
- Url hostname
https://global.api.greenlake.hpe.com/subscriptions/v1/subscriptions
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X POST \
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/subscription-management/public/openapi/nbapi-subscription-latest/subscriptions/v1/subscriptions \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"subscriptions": [
{
"key": "string"
}
]
}'
{ "code": 0, "status": "100 CONTINUE", "transactionId": "string" }
Request
Update subscriptions by passing one or more subscription IDs. Currently, the API supports adding and removing the tags for subscriptions. For each tag provided in the request body:
Tags are created and inserted into the specified subscriptions 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 subscription, but the provided value differs from the existing value.
Tags are removed from subscriptions when a tag key is mapped to a
null
tag value. The tags are removed from any subscription with a matching tag with the same key.
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 used to fetch the progress of the subscription update task. For details about the status fetch URL, see Get progress or status of async operations in subscriptions.
Rate limits are enforced on this API. Five requests per minute are supported per workspace, and the API returns 429
if this threshold is breached.
NOTE: To call this API, you need edit permissions for the Devices and Subscription service.
Subscription resourceIDs.
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 subscriptionID
(or multiple subscriptionID
's).
Tags are saved with the character casing preserved (uppercase, lowercase, mixed, and so on). However, tag searching is not case-sensitive. For example, adding a new tag with the key Location
will fail if the subscription 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/subscription-management/public/openapi/nbapi-subscription-latest/subscriptions/v1/subscriptions
- Url hostname
https://global.api.greenlake.hpe.com/subscriptions/v1/subscriptions
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X PATCH \
'https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/subscription-management/public/openapi/nbapi-subscription-latest/subscriptions/v1/subscriptions?id=string' \
-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" }
Request
Get subscriptions managed in a workspace. Filters can be passed to filter the subscriptions based on conditional expressions.
NOTE: You need to have view permission for the Devices and subscription service to invoke this API.
Rate limits are enforced on this API. 60 requests per minute is supported per workspace. API will result in 429
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 |
Subscriptions can be filtered based on the following properties:
id
subscriptionType
subscriptionStatus
key
quantity
availableQuantity
sku
skuDescription
contract
startTime
endTime
productType
tier
createdAt
updatedAt
The following is a non-exhaustive list of possible filtering options.
Return subscriptions where a property equals a value. Example syntax, <property> eq <value>.
Return subscriptions where a property does not equate to a value. Example syntax, <property> ne <value>.
Return subscriptions where a property does not equal a value. Example syntax, not <property> eq <value>.
Return subscriptions where a property is greater or equal to a value. Example syntax, <property> ge <value>.
Return subscriptions where a property is less than or equal to a value. Example syntax, <property> le <value>.
The AND operator returns results that meet all filter queries. In the example, the query only returns subscriptions with the exact key and with the specified subscription type. Example syntax, <property> eq <value> and <property> eq <value>.
The OR operator returns results that meet any of the filter queries. In the example, the query returns subscriptions with the exact key or with the specified subscription type.
Return subscriptions where the property is one of multiple values. Example syntax, <property> in <value>,<value>.
The AND, OR, and NOT operators can be combined to return results that satisfy all specified filter criteria.
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 |
Logical Expressions | and, or |
Return subscriptions that have a pair of tags with the exact same tag key and tag value. Example syntax, <tagKey> eq <tagValue>.
Return subscriptions that have a pair of tags with the exact same tag key and the exact different tag value. Example syntax, <tagKey> ne <tagValue>.
Return subscriptions containing the tag key and the corresponding value that satisfy all conditionals. Example syntax, <property> eq <value> and <property> eq <value>.
Return subscriptions containing the tag key and the corresponding value that satisfy at least one of the conditionals. Example syntax, <property> eq <value> or <property> eq <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 50.
- Mock server
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/subscription-management/public/openapi/nbapi-subscription-latest/subscriptions/v1/subscriptions
- Url hostname
https://global.api.greenlake.hpe.com/subscriptions/v1/subscriptions
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X GET \
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/subscription-management/public/openapi/nbapi-subscription-latest/subscriptions/v1/subscriptions \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'
Successful response
The primary unique identifier of the subscription.
Type of the subscription.
The status of the subscription. This property indicates if the subscription is started, ended, suspended, cancelled, or locked.
Time when subscription was last updated.
A boolean that states if the subscription is an evaluation subscription or not.
Product type of the subscription.
{ "items": [ { … } ], "count": 30, "offset": 0, "total": 100 }
Request
Get detailed information for a single subscription by id
.
NOTE: You need to have the view permission of device management to invoke this API.
Rate limits are enforced on this API. 20 requests per minute is supported per workspace. The API returns 429
if this threshold is breached.
- Mock server
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/subscription-management/public/openapi/nbapi-subscription-latest/subscriptions/v1/subscriptions/{id}
- Url hostname
https://global.api.greenlake.hpe.com/subscriptions/v1/subscriptions/{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/subscription-management/public/openapi/nbapi-subscription-latest/subscriptions/v1/subscriptions/{id}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'
Successful response
The primary unique identifier of the subscription.
Type of the subscription.
The status of the subscription. This property indicates if the subscription is started, ended, suspended, cancelled, or locked.
{ "id": "64343c3c-3016-4234-baee-765651aa4bb3", "type": "subscriptions/subscription", "subscriptionType": "CENTRAL_AP", "subscriptionStatus": "STARTED", "createdAt": "2024-02-07T11:20:35.290Z", "updatedAt": "2024-02-07T11:22:35.290Z", "key": "string", "quantity": 20, "availableQuantity": 10, "isEval": true, "sku": "string", "skuDescription": "string", "contract": "string", "startTime": "2024-04-01T00:00:00.000Z", "endTime": "2024-04-30T00:00:00.000Z", "tags": { "property1": "string", "property2": "string" }, "productType": "DEVICE", "tier": "AP Device - DM" }
Request
Use this API to find the status of the asynchronous Add and update subscriptions API.
An asynchronous resource is generated to track 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.
An asynchronous resource is set to the TIMEOUT
state if the resource has been 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 subscriptions, a breakdown of succeeded subscriptions and failed subscriptions, if there are any, is returned as the response. In this case, the subscription key identifies each subscription.
Note: You need view permissions for the Devices and Subscription service to invoke this API.
Rate limits are enforced on this API. 30 requests per minute is supported per workspace. The API returns 429
if this threshold is breached.
- Mock server
https://stage-developer-portal-hpe.redocly.app/_mock/docs/greenlake/services/subscription-management/public/openapi/nbapi-subscription-latest/subscriptions/v1/async-operations/{id}
- Url hostname
https://global.api.greenlake.hpe.com/subscriptions/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/subscription-management/public/openapi/nbapi-subscription-latest/subscriptions/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-4£26-823b-76b5d213b670", "type": "subscriptions/asyncOperation" }