Skip to content

Commit 341637c

Browse files
committed
Update Blog “learn-what-you-can-do-with-hpe-data-services-cloud-console-api-in-just-3-minutes”
1 parent accbe84 commit 341637c

3 files changed

+25
-30
lines changed

content/blog/learn-what-you-can-do-with-hpe-data-services-cloud-console-api-in-just-3-minutes.md

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,35 @@ tags:
1212
---
1313
[HPE Data Services Cloud Console](https://developer.hpe.com/greenlake/data-services-cloud-console/home/), available through the [HPE GreenLake edge-to-cloud platform](https://developer.hpe.com/greenlake/hpe-greenlake-cloud-platform/home/), is a Software-as-a-service (SaaS) based cloud console application that delivers a suite of cloud data services that enable a unified data operations as a service for storage infrastructure, simplify storage and data management, and bring the cloud experience to wherever data lives. Data Services Cloud Console also offers a unified and fully programmable API that enables developers to automate data infrastructure management.
1414

15-
If you’re looking for a quick way to discover everything you can do with the HPE GreenLake Data Services Cloud Console API using popular tools that doesn’t require programming such as Postman, this blog post is definitely for you. It helps you get started with the Data Services Cloud Console API for _HPE GreenLake for Block Storage_ cloud data service by taking advantage of the **Postman collection** contributed by one of our HPE Developer Community members.
15+
If you’re looking for a quick way to discover everything you can do with the HPE GreenLake Data Services Cloud Console API using popular tools that doesn’t require programming such as Postman, this blog post is definitely for you.
1616

17-
>**Note:** This blog post assumes you have created an [HPE GreenLake account](https://console.greenlake.hpe.com/) and joined your account to your company account (also called an ***organization***). You also got assigned appropriate roles and permissions by the administrator for your organization in order to access HPE data services resources (for example storage arrays and volumes) through the Data Services Cloud Console application instances. A Data Service Cloud Console application instance is a service cluster running in one of the HPE regions.
17+
As you know, one of the benefits of working within a community is the ability to take advantage of open collaboration, sharing hints, tools, and resources. This is exactly what we are doing here. This post helps you get started with the Data Services Cloud Console API for HPE GreenLake for Block Storage cloud data service by taking advantage of the Postman collection contributed by one of our HPE Developer Community members.
18+
19+
> **Note:** This blog post assumes you have created an [HPE GreenLake account](https://console.greenlake.hpe.com/) and joined your account to your company account (also called an ***organization***). You also got assigned appropriate roles and permissions by the administrator for your organization in order to access HPE data services resources (for example storage arrays and volumes) through the Data Services Cloud Console application instances. A Data Service Cloud Console application instance is a service cluster running in one of the HPE regions.
1820
1921
### Data Services Cloud Console and REST API
2022

2123
Data Services Cloud Console supports a set of REST APIs that allows users to integrate HPE Data Services Cloud Console with their custom applications. By using [OAuth 2.0 protocol](https://oauth.net/2/) to authenticate and authorize applications, secure and time-limited (***120 minutes***) access to HPE data services are provided via an **access token**. The token ensures that client API requests access HPE data services for the requested operation, securely and according to the authorization granted to the user who created it.
2224

23-
>**Note:** You can find the Data Services Cloud Console API Documentation [here](https://console-us1.data.cloud.hpe.com/doc/api/v1/) and in the help section of the [HPE GreenLake Cloud Platform](https://console.greenlake.hpe.com/).
25+
> **Note:** You can find the Data Services Cloud Console API Documentation [here](https://console-us1.data.cloud.hpe.com/doc/api/v1/) and in the help section of the [HPE GreenLake Cloud Platform](https://console.greenlake.hpe.com/).
2426
2527
The REST APIs support standard HTTP request methods (GET, POST, PATCH, PUT and DELETE). A HTTP request is made by providing a specific HPE regional connectivity endpoint for the Data Service Cloud Service application instance, HTTP request method, access token and data payload. The HTTP response for these requests are returned in the JSON format.
2628

2729
Currently, there are three HPE regional Data Services Cloud Console application instance endpoints:
2830

2931
* EU Central
30-
* https://eu1.data.cloud.hpe.com
3132

33+
* https://eu1.data.cloud.hpe.com
3234
* AP Northeast
33-
* https://jp1.data.cloud.hpe.com
3435

36+
* https://jp1.data.cloud.hpe.com
3537
* US West
36-
* https://us1.data.cloud.hpe.com
3738

39+
* https://us1.data.cloud.hpe.com
3840

39-
HPE GreenLake Cloud Platform allows developers to make API calls on a particular regional Data Services Cloud Console customer instances. Using the API functionality in the HPE GreenLake Cloud Platform graphical user interface (GUI), developers can create their **API client application** credentials. The credentials consist of a _ClientID-ClientSecret_ pair that represents the permissions granted to the user who creates the API client application credentials, to access the protected resources. The credentials is then used to generate and refresh expired OAuth based access token. Once the token is generated or refreshed, it can be used as **authorization bearer token** to make further secure REST API calls to HPE data services resources via the regional Data Services Cloud Console application instance.
41+
HPE GreenLake Cloud Platform allows developers to make API calls on a particular regional Data Services Cloud Console customer instances. Using the API functionality in the HPE GreenLake Cloud Platform graphical user interface (GUI), developers can create their **API client application** credentials. The credentials consist of a *ClientID-ClientSecret* pair that represents the permissions granted to the user who creates the API client application credentials, to access the protected resources. The credentials is then used to generate and refresh expired OAuth based access token. Once the token is generated or refreshed, it can be used as **authorization bearer token** to make further secure REST API calls to HPE data services resources via the regional Data Services Cloud Console application instance.
4042

41-
You can refer to [this blog post](https://developer.hpe.com/blog/api-console-for-data-services-cloud-console/) to learn how to create API client application credentials for your specific regional Data Services Cloud Console application instance. Make sure to copy the _ClientID_ and _ClientSecret_ values to a safe location as you will need them to generate the access token via a REST API call as explained in the next sections.
43+
You can refer to [this blog post](https://developer.hpe.com/blog/api-console-for-data-services-cloud-console/) to learn how to create API client application credentials for your specific regional Data Services Cloud Console application instance. Make sure to copy the *ClientID* and *ClientSecret* values to a safe location as you will need them to generate the access token via a REST API call as explained in the next sections.
4244

4345
**Ready? Let’s get started!**
4446

@@ -50,50 +52,45 @@ You can sign in to your Postman account either from the [web app](https://identi
5052

5153
Upon log in to your Postman account, from the ***Search*** bar, look for the public collection "**Data Services Cloud Console API**" and select the public collection from one of our community contributor, [Mark van Silfhout](mailto:[email protected]) as shown below:
5254

53-
[figure 1]
54-
<span style="color:grey; font-family:Arial; font-size:1em">Figure 1: The Data Services Cloud Console API public collection.</span>
55+
![The Data Services Cloud Console API public collection](/img/search-dscc-collection-postman-figure1.png "The Data Services Cloud Console API public collection")
5556

57+
<span style="color:grey; font-family:Arial; font-size:1em">Figure 1: The Data Services Cloud Console API public collection.</span>
5658

5759
You can then fork the collection to make a copy of it in your Postman workspace. You can then work with your own copy of the collection and perform changes without affecting the parent collection. Select the ***more actions*** icon (the ellipsis) next to the collection, then select ***Create a fork***. When you fork the public collection, you can choose to watch the original collection to be notified about changes made to the parent collection. This allows you to pull updates from the parent collection into your forked copy, should the parent collection be updated.
5860

5961
Alternatively, you can export the public collection locally to your local storage as JSON file and import it as a new collection in your Postman workspace.
6062

61-
>**Note:** You must sign in to your Postman account to create a fork or export the public collection. To fork a collection within a public workspace, you must also enable your public profile in your Postman profile settings.
63+
> **Note:** You must sign in to your Postman account to create a fork or export the public collection. To fork a collection within a public workspace, you must also enable your public profile in your Postman profile settings.
6264
6365
### Step 3 – Set your Data Services Cloud Console collection variables
6466

6567
The Data Services Cloud Console API collection built by Mark makes use of collection variables that are available throughout the REST API requests in the collection. Select the collection in your workspace and then select the ***Variables*** tab as shown below.
6668

67-
[Figure 2]
69+
![HPE Data Services Cloud Console collection variables](/img/variables-dscc-collection-postman-figure2.png "HPE Data Services Cloud Console collection variables")
70+
6871
<span style="color:grey; font-family:Arial; font-size:1em">Figure 2: HPE Data Services Cloud Console collection variables.</span>
6972

7073
Define the Current Value of the collection variables to match your Data Services Cloud Console context:
7174

7275
* **baseUrl**: This variable defines the base URL of the REST API requests. It should match the regional endpoint of your Data Services Cloud Console application instance where your storage devices are registered.
73-
7476
* **ClientId** and **ClientSecret**: they should be set with the value of your Client Application API credentials you previously created using the HPE GreenLake Cloud Platform GUI. These variables are used to request an OAuth access token by authenticating with the authorization server referenced in the **sso_URI** variable.
75-
76-
* **sso_URI**: This variable is the URI of the OAuth authorization server. If your organization has set up their own HPE GreenLake SAML Single Sign-On (SSO) authorization server to create access token, replace the current default value with your SSO URI. Otherwise keep the value for this variable as currently set to _sso.common.cloud.hpe.com/as/token.oauth2_.
77-
77+
* **sso_URI**: This variable is the URI of the OAuth authorization server. If your organization has set up their own HPE GreenLake SAML Single Sign-On (SSO) authorization server to create access token, replace the current default value with your SSO URI. Otherwise keep the value for this variable as currently set to *sso.common.cloud.hpe.com/as/token.oauth2*.
7878
* **BearerToken:** Do not edit this variable. Keep the value field empty. The collection variable BearerToken will be set automatically upon successful execution of the ***GetToken*** API call as explained in the next step.
7979

80-
8180
### Step 4 – Acquire an OAuth access token as your session bearer token
8281

8382
Data Services Cloud Console API uses bearer token as authorization type to ensure that all REST API requests access authorized data services securely. So you first need to obtain a token from the OAuth authorization server before you can make any REST API calls to your regional Data Services Cloud Console application instance. To do so, proceed as follows:
8483

8584
* From your collection, generate the token using the ***GetToken*** API call from the ***GetToken-Using-Variables*** folder.
86-
8785
* Verify you get a status code of 200 for a successful response with the token value in the response body.
88-
8986
* Check the token value has been automatically defined for the collection variable ***BearerToken***.
9087

91-
The _GetToken_ API call has defined a script in the ***Tests*** tab to programmatically set the collection variable BearerToken as shown in the picture below. The programmatically defined token is then used to authenticate any subsequent REST API calls.
88+
The *GetToken* API call has defined a script in the ***Tests*** tab to programmatically set the collection variable BearerToken as shown in the picture below. The programmatically defined token is then used to authenticate any subsequent REST API calls.
9289

93-
[Figure 3]
90+
\[Figure 3]\
9491
<span style="color:grey; font-family:Arial; font-size:1em">Figure 3: Defining collection variables programmatically in script.</span>
9592

96-
>**Note:** Access bearer token expires after 120 minutes. Run the _GetToken_ API request again to refresh the token before or after it expires.
93+
> **Note:** Access bearer token expires after 120 minutes. Run the *GetToken* API request again to refresh the token before or after it expires.
9794
9895
### Step 5 – Make subsequent secure REST API calls
9996

@@ -103,20 +100,20 @@ Pick one REST API call from the ***storage-systems*** folder to ***Get all stora
103100

104101
As shown in the two pictures below, all REST API requests in the collection will inherit the authorization bearer token that is specified at the collection level.
105102

106-
[Figure 4]
103+
\[Figure 4]\
107104
<span style="color:grey; font-family:Arial; font-size:1em">Figure 4: Authorization type (bearer token) specified at the collection level.</span>
108105

109-
[Figure 5]
106+
\[Figure 5]\
110107
<span style="color:grey; font-family:Arial; font-size:1em">Figure 5: REST API request with authorization type inherited from parent collection.</span>
111108

112109
As depicted in the figure below, the API supports several query parameters (click on Params tab in the request) depending on the resource type, such as filter (filter the set of resources returned), limit (maximum number of records to return), offset (resource offset to start the response from) and sort (order in which to return the resources in the collection).
113110

114-
[Figure 6]
111+
\[Figure 6]\
115112
<span style="color:grey; font-family:Arial; font-size:1em">Figure 6: REST API request with query parameter to search for storage array of type HPE Alletra 9060.</span>
116113

117114
The query parameters are indicated after the question mark (“?”) in the REST API URL. Select and adjust the query parameters according to your environment. Make sure to refer to [the API documentation](https://console-us1.data.cloud.hpe.com/doc/api/v1/) to understand the query parameters that can be used for each HPE Data Services Cloud Console API requests.
118115

119-
Finally click the **Send** button. You will get a JSON representation of the storage system resources registered based on the query parameters specified. Here, I am getting the list of storage systems of type “_HPE Alletra 9060_”.
116+
Finally click the **Send** button. You will get a JSON representation of the storage system resources registered based on the query parameters specified. Here, I am getting the list of storage systems of type “*HPE Alletra 9060*”.
120117

121118
```json
122119
{
@@ -181,12 +178,10 @@ Finally click the **Send** button. You will get a JSON representation of the sto
181178

182179
**That’s it. No more than 3 minutes!**
183180

184-
185181
## Summary
186182

187-
This blog gives you a great example on how to obtain the access token using API call and help you get started with the Data Services Cloud Console REST API for the _HPE GreenLake for Block Storage_ data service using Postman. Additional HPE data services APIs will be published in accordance to the expansion of cloud data services delivered through the HPE Data Services Cloud Console. So make sure to stay tuned for any update of Mark’s public Postman collection for Data Services Cloud Console API.
183+
This blog gives you a great example on how to obtain the access token using API call and help you get started with the Data Services Cloud Console REST API for the *HPE GreenLake for Block Storage* data service using Postman. Additional HPE data services APIs will be published in accordance to the expansion of cloud data services delivered through the HPE Data Services Cloud Console. So make sure to stay tuned for any update of Mark’s public Postman collection for Data Services Cloud Console API.
188184

189185
If you have more time, I invite you to explore further the rest of the collection on your own while adjusting the query parameters to match your Data Services Cloud Console context. Also, don’t hesitate to provide Mark with feedback on his very convenient collection.
190186

191-
Any questions on HPE GreenLake Data Services Cloud Console API? Please join the [HPE Developer Slack Workspace](https://slack.hpedev.io/) and start a discussion in our [#hpe-greenlake-data-services-cloud-console](https://hpedev.slack.com/archives/C02D6H623JP) channel.
192-
187+
Any questions on HPE GreenLake Data Services Cloud Console API? Please join the [HPE Developer Slack Workspace](https://slack.hpedev.io/) and start a discussion in our [\#hpe-greenlake-data-services-cloud-console](https://hpedev.slack.com/archives/C02D6H623JP) channel.
52.9 KB
Loading
32.8 KB
Loading

0 commit comments

Comments
 (0)