This page provides an introduction and quick start guide for the Workspace Management API:
- Overview—See a high-level description of the API.
- Developer guide—Review a quick start guide that helps you get started with the API.
HPE GreenLake for Workspace Management APIs allow programmatic access to the records of workspaces and workspace-user relationships. The Workspace Management APIs allow you to perform tasks without the user interface. You can:
- Retrieve information about workspaces.
- Create, delete, update, and check tenant information using a token from their workspaces.
- API to retrieve workspace information
- Managed Service Provider (MSP) tenant management
| Endpoint | HPE GreenLake cloud | HPE GreenLake Dedicated Platform |
|---|---|---|
GET /workspaces/v1/workspaces/{workspaceId} | Yes | Yes |
GET /workspaces/v1/msp-tenants | Yes | Yes |
POST /workspaces/v1/msp-tenants | Yes | Yes |
PUT /workspaces/v1/msp-tenants/{tenantId} | Yes | Yes |
DELETE /workspaces/v1/msp-tenants/{tenantId} | Yes | Yes |
June 2024
The HPE GreenLake for Workspace Management APIs were relocated to the main navigation menu to make them easier to find.
View the changelog to view a history of changes.
The examples in this guide help you use the Workspace Management APIs for workspace and tenant management.
Endpoints are the host URLs to which you will submit your API requests. To access Workspace Management APIs, use the unified API:
https://global.api.greenlake.hpe.com
Unique Resource Identifiers (URIs) are used to identify a server or resources. A URI is a full API path ending in an identification number. For example:
/workspaces/v1/msp-tenants/{tenantId}
You need the correct role and permissions to use the HPE GreenLake Workspaces API. A role is a group of permissions that you can specify and assign to users in your HPE GreenLake workspace. There are 3 basic role types distinguished by the privileges defined in the authorization service:
- Administrator—has view, edit, and delete privileges in the workspace.
- Operator—has view and edit privileges in the workspace.
- Observer—has only view privileges in the workspace.
The following table lists Workspaces API calls along with the resource and permission required to make the call:
| Workspaces API call | Resource | Permission required |
|---|---|---|
GET /workspaces/v1/workspaces/{workspaceId} | Platform Customer Account | View |
GET /workspaces/v1/msp-tenants | Platform Customer Account | View |
POST /workspaces/v1/msp-tenants | Platform Customer Account | Edit |
PUT /workspaces/v1/msp-tenants/{tenantId} | Platform Customer Account | Edit |
DELETE /workspaces/v1/msp-tenants/{tenantId} | Platform Customer Account | Delete |
You must create a personal API client and generate an access token to make API calls. HPE GreenLake APIs use OAuth-based access tokens as an authorization bearer token. To do this:
- Create a personal API client.
- Select the HPE GreenLake Cloud Platform service.
- Generate an access token.
- Use the access token as an authorization bearer token to make secure REST API calls.
With the workspace API, you can discover information about the workspace the API is configured for.
To see information on the workspace, submit the following GET request specifying the workspace ID:
GET https://global.api.greenlake.hpe.com/workspaces/v1/workspaces/<id>This API call returns workspace information like ID, type, creation, created date and time, updated date and time, created by, and the workspace's name.
Sample response:
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"type": "string",
"generation": 0,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"workspaceName": "string",
"createdBy": "user@example.com"
}To retrieve the workspace address and contact details, use the following GET API call specifying the workspace ID:
GET https://global.api.greenlake.hpe.com/workspaces/v1/workspaces/<id>/contactSample response:
{
"address": {
"streetAddress": "string",
"streetAddressComplement": "string",
"city": "string",
"stateOrRegion": "string",
"zip": "string",
"countryCode": "string"
},
"phoneNumber": "string",
"email": "user@example.com"
}With the tenant management APIs, you can:
- Get a list of tenants
- Create a tenant
- Update tenant information
- Delete a tenant
To retrieve a list of tenants in a managed service provider (MSP) workspace, submit the following GET request:
GET https://global.api.greenlake.hpe.com/workspaces/v1/msp-tenantsThis API call returns:
- Workspace ID, workspace name, and creator
- Pagination information: offset, count, items, and total
Sample response:
{
"offset": 0,
"count": 0,
"total": 0,
"items": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"type": "string",
"generation": 0,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"workspaceName": "string",
"createdBy": "user@example.com"
}
]
}To create a new tenant in an MSP workspace, submit a POST request:
POST https://global.api.greenlake.hpe.com/workspaces/v1/msp-tenantsPayload:
{
"address": {
"streetAddress": "string",
"streetAddressComplement": "string",
"city": "string",
"stateOrRegion": "string",
"zip": "string",
"countryCode": "AW"
},
"phoneNumber": "string",
"email": "user@example.com",
"workspaceName": "string",
"description": "string"
}A valid response generates a location header, and the response payload returns a tenant-created message.
To update tenant information, submit the following PUT request:
PUT https://global.api.greenlake.hpe.com/workspaces/v1/msp-tenants/<id>Payload:
{
"address": {
"streetAddress": "string",
"streetAddressComplement": "string",
"city": "string",
"stateOrRegion": "string",
"zip": "string",
"countryCode": "AW"
},
"phoneNumber": "string",
"email": "user@example.com",
"workspaceName": "string",
"description": "string"
}The response payload returns a tenant-created message.
To delete a tenant from an MSP workspace, submit the following DELETE request specifying the tenant ID in the path:
DELETE https://global.api.greenlake.hpe.com/workspaces/v1/msp-tenants/<id>