Skip to content

Commit 2e86f58

Browse files
committed
Update Blog “hpe-greenlake-edge-to-cloud-platform-scripting-fundamentals”
1 parent 2012175 commit 2e86f58

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

content/blog/hpe-greenlake-edge-to-cloud-platform-scripting-fundamentals.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,33 @@ ol li{
2323
}
2424
</style>
2525

26-
## What are the HPE GreenLake edge-to-cloud platform APIs  
26+
## What are the HPE GreenLake cloud APIs  
2727

28-
The foundational APIs for common HPE GreenLake platform services allow IT administrators and IT operators to programmatically operate and manage users and resources in an HPE GreenLake platform workspace.   
28+
The foundational APIs for common HPE GreenLake cloud services allow IT administrators and IT operators to programmatically operate and manage users and resources in an HPE GreenLake cloud workspace.   
2929

3030
This set of APIs for common platform services includes APIs for workspace management, identity and access management, device and subscription, locations, audit logs, and wellness.   
3131

32-
> > *Note: The [HPE GreenLake platform documentation](https://developer.greenlake.hpe.com/docs/greenlake/services/) for these APIs leverages OpenAPI specifications and associated reference material. The documentation provides a complete explanation of the operations supported by these APIs for common HPE GreenLake platform services, as well as sample requests and responses.*   
32+
> > *Note: The [HPE GreenLake cloud documentation](https://developer.greenlake.hpe.com/docs/greenlake/services/) for these APIs leverages OpenAPI specifications and associated reference material. The documentation provides a complete explanation of the operations supported by these APIs for common HPE GreenLake cloud services, as well as sample requests and responses.*   
3333
3434
 The following blog posts are an excellent way to learn more about the APIs using Postman. 
3535

3636
* [Get started with the foundational APIs for the HPE GreenLake edge-to-cloud platform – Part 1: Introduction to the APIs](https://developer.hpe.com/blog/get-started-with-the-foundational-apis-for-the-hpe-greenlake-edge-to-cloud-platform-%E2%80%93-part-1-introduction-to-the-apis/)
3737
* [Get started with the foundational APIs for the HPE GreenLake edge-to-cloud platform – Part 2: Configuring and managing a workspace](https://developer.hpe.com/blog/get-started-with-the-foundational-apis-for-the-hpe-greenlake-edge-to-cloud-platform-%E2%80%93-part-2-configuring-and-managing-a-workspace/)
3838
* [Get started with the foundational APIs for the HPE GreenLake edge-to-cloud platform – Part 3: Tracking activities and monitoring health](https://developer.hpe.com/blog/get-started-with-the-foundational-apis-for-the-hpe-greenlake-edge-to-cloud-platform-%E2%80%93-part-3-tracking-activities-and-monitoring-health/)
3939

40-
In this blog post here, I will explore the usage of the HPE GreenLake platform APIs one step further by using the APIs to build automation scripts or custom integrations. To develop my script, I will use bash, python and PowerShell. 
40+
In this blog post here, I will explore the usage of the HPE GreenLake cloud APIs one step further by using the APIs to build automation scripts or custom integrations. To develop my script, I will use bash, python and PowerShell. 
4141

4242
## Let’s pick a use case
4343

4444
Let’s say I’d like to check what is in my audit log at regular intervals in order to keep an eye on my HPE GreenLake workspace. The following graphics explain what I will be doing: 
4545

46-
![Figure 1: Illustrating the interactions made between workspace users and the HPE GreenLake platform](/img/don-picture.png "Figure 1: Illustrating the interactions made between workspace users and the HPE GreenLake platform")
46+
![Figure 1: Illustrating the interactions made between workspace users and the HPE GreenLake cloud](/img/don-picture.png "Figure 1: Illustrating the interactions made between workspace users and the HPE GreenLake cloud")
4747

48-
> Figure 1: Illustrating the interactions made between workspace users and the HPE GreenLake platform
48+
> Figure 1: Illustrating the interactions made between workspace users and the HPE GreenLake cloud
4949
50-
For reference, I can also check the content of this audit log in the HPE GreenLake console, under the Manage Workspace tab. 
50+
For reference, I can also check the content of this audit log in the HPE GreenLake cloud console, under the Manage Workspace tab. 
5151

52-
![Figure 2: Audit log in HPE GreenLake platform console](/img/auditlogui.jpg "Figure 2: Audit log in HPE GreenLake platform console")
52+
![Figure 2: Audit log in HPE GreenLake cloud console](/img/auditlogui.jpg "Figure 2: Audit log in HPE GreenLake cloud console")
5353

5454
> Figure 2: Audit log in HPE GreenLake platform console
5555
@@ -66,13 +66,13 @@ Let’s look at the steps necessary to accomplish this. 
6666

6767
## Give me a token, my friend!
6868

69-
The HPE GreenLake platform console provides a way to create API client credentials (up to 5 per workspace) in the form of a Client ID and a Client Secret pair, which, in turn, I am going to use to generate a session token.
69+
The HPE GreenLake cloud console provides a way to create API client credentials (up to 5 per workspace) in the form of a Client ID and a Client Secret pair, which, in turn, I am going to use to generate a session token.
7070

71-
> > *Note: To make REST API calls to HPE GreenLake platform APIs, you will need to select “HPE GreenLake platform” as an option when configuring API client credentials. To learn how to create API client credentials for HPE GreenLake platform APIs, check out the [Configuring API client credentials](https://support.hpe.com/hpesc/public/docDisplay?docId=a00120892en_us&page=GUID-23E6EE78-AAB7-472C-8D16-7169938BE628.html) and [Requesting access to HPE GreenLake platform APIs](https://support.hpe.com/hpesc/public/docDisplay?docId=a00120892en_us&page=GUID-771F9B3A-B029-43E5-A38F-6D8D04178FAB.html) in the HPE GreenLake edge-to-cloud platform user guide.*
71+
> > *Note: To make REST API calls to HPE GreenLake cloud APIs, you will need to select “HPE GreenLake platform” as an option when configuring API client credentials. To learn how to create API client credentials for HPE GreenLake cloud APIs, check out the [Configuring API client credentials](https://support.hpe.com/hpesc/public/docDisplay?docId=a00120892en_us&page=GUID-23E6EE78-AAB7-472C-8D16-7169938BE628.html) and [Requesting access to HPE GreenLake cloud APIs](https://support.hpe.com/hpesc/public/docDisplay?docId=a00120892en_us&page=GUID-771F9B3A-B029-43E5-A38F-6D8D04178FAB.html) in the HPE GreenLake cloud user guide.*
7272
7373
My script will prompt for these two values (**client_id** and **client_secret**) and will make sure that **client_secret** is never printed anywhere. Because these values are quite long, I will also test the presence of the operating system’s environment variables CLIENTID and CLIENTSECRET. If present, I will use their values and not prompt the user. 
7474

75-
From the HPE GreenLake console, I’ve learned that the cURL command to get a session token is: 
75+
From the HPE GreenLake cloud console, I’ve learned that the cURL command to get a session token is: 
7676

7777
```markdown
7878
curl -s --location 'https://sso.common.cloud.hpe.com/as/token.oauth2' \ 
@@ -82,7 +82,7 @@ curl -s --location 'https://sso.common.cloud.hpe.com/as/token.oauth2' \ 
8282
--data-urlencode 'client_secret='<CLIENTSECRET>'
8383
```
8484

85-
You can see this in the API section of the Manage Workspace screen of the HPE GreenLake console shown below: 
85+
You can see this in the API section of the Manage Workspace screen of the HPE GreenLake cloud console shown below: 
8686

8787
![Figure 3: API access management page](/img/apiaccess.jpg "Figure 3: API access management page")
8888

@@ -560,8 +560,8 @@ Error calling the API or token has expired!
560560
561561
## What’s next? 
562562
563-
The next step for the HPE GreenLake APIs is to provide language specific SDK, which would provide better handling in PowerShell and Python, with stronger type checking and exception handling. In the meantime, I have shown you through this blog post that it is already possible to integrate with HPE GreenLake platform using the most popular scripting languages. You can get the source code for these scripts from [our community tooling repository](https://github.com/hpe-dev-incubator/GLP-API-Tooling).
563+
The next step for the HPE GreenLake cloud APIs is to provide language specific SDK, which would provide better handling in PowerShell and Python, with stronger type checking and exception handling. In the meantime, I have shown you through this blog post that it is already possible to integrate with HPE GreenLake cloud using the most popular scripting languages. You can get the source code for these scripts from [our community tooling repository](https://github.com/hpe-dev-incubator/GLP-API-Tooling).
564564
565-
If you’re interested in trying out what I just discussed, you might first want to check out one of our hands-on Workshops-on-Demand that lets you play with the HPE GreenLake APIs mentioned in this blog post. The workshops are free, available 24/7, and very easy to use. They give you a real-world experience without any risk. Check out our [catalog of workshops](https://developer.hpe.com/hackshack/workshops), register for the one you’re interested and go! It’s as simple as that.
565+
If you’re interested in trying out what I just discussed, you might first want to check out one of our hands-on Workshops-on-Demand that lets you play with the HPE GreenLake cloud APIs mentioned in this blog post. The workshops are free, available 24/7, and very easy to use. They give you a real-world experience without any risk. Check out our [catalog of workshops](https://developer.hpe.com/hackshack/workshops), register for the one you’re interested and go! It’s as simple as that.
566566
567-
If you still have any questions regarding the HPE GreenLake platform APIs, join the [HPE Developer Community Slack Workspace](https://developer.hpe.com/slack-signup/) and start a discussion in our [\#hpe-greenlake-api](https://hpedev.slack.com/archives/C02EG5XFK8Q) channel. We’re always here to help.
567+
If you still have any questions regarding the HPE GreenLake cloud APIs, join the [HPE Developer Community Slack Workspace](https://developer.hpe.com/slack-signup/) and start a discussion in our [\#hpe-greenlake-api](https://hpedev.slack.com/archives/C02EG5XFK8Q) channel. We’re always here to help.

0 commit comments

Comments
 (0)