VMware Support Community
RichardChu
Contributor
Contributor
Jump to solution

REST API for SHD

Any information about REST API for SHD?

$ curl -k -s -X POST https://{SHD_IP}/api/v1/token/get | jq
{
"message": {
"username": "Required: username"
}
}

How do I put "username" into the POST request?

I can use the following request to get some info of SHD.

$ curl -k -s https://{SHD_IP}/api/v1 | jq
{
"_Product": "VMware Skyline Health Diagnostics",
"_Version": "3.0.2",
"_Build": "000000",
"_ServerTime": "2022-04-27T07:03:18",
"_CEIP": "0",
"_EULA": "1",
"_AppId": "8ff97494-3874-6212-a684-422b12504f12",
"_InstaneId": "ae55ea70-a856-b3e1-3fd0-c7ecd465c9d3",
"_Logstore": 219.25,
"_APIVer": "v1",
"_IAm": "API Server for VMware Skyline Health Diagnostics"
}

Tags (2)
1 Solution

Accepted Solutions
anshumansingh
VMware Employee
VMware Employee
Jump to solution

Hi @richard_kessay ,

 

The new version of SHD 3.5.0 is available for download here Download VMware Skyline Health Diagnostics.

Please refer to "Use the API Explorer" of Installation_Setup_and_Operations_Guide_for_VMware_Skyline_Health_Diagnostics_3.5.0.pdf guide for using the new Rest API

 

Thanks and Regards,

Anshuman

View solution in original post

0 Kudos
8 Replies
RichardChu
Contributor
Contributor
Jump to solution

Hi all,

I seem to find some direction.

**get_Token.py**
```python
import requests
import json
import urllib3

urllib3.disable_warnings()

shd_hostname = '{SHD_IP}'
shd_username = 'shd-admin'
shd_password = '{SHD_ADMIN_PASS}'

api_baseurl = 'https://' + shd_hostname + '/api/v1'

headers = {'Content-Type': 'application/json'}
payload = json.dumps({
"username": shd_username,
"password": shd_password
})

res = requests.post("{}/token/get".format(api_baseurl), verify=False,
headers=headers, data=payload)

if res.status_code == 200:
result = json.loads(res.text.encode('utf8'))
print("Message: " + result["message"])
print("Access Token: " + result["access_token"])
print("Refresh Token: " + result["refresh_token"])
```

**get_VCG_Status.py**
```python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import requests
import json
import urllib3
urllib3.disable_warnings()

shd_hostname = '{SHD_IP}'
shd_username = 'shd-admin'
shd_password = '{SHD_ADMIN_PASS}'

api_baseurl = 'https://' + shd_hostname + '/api/v1'
access_token = "get the token from get_Token.py"

headers = {'Authorization': 'Bearer ' + access_token}
payload = {}

res = requests.get("{}/extentions/vcg/status".format(api_baseurl), verify=False,
headers=headers, data=payload)

if res.status_code == 200:
result = json.loads(res.text.encode('utf8'))
print('\n'+json.dumps(result, indent=4)+'\n')
```
RichardChu
Contributor
Contributor
Jump to solution

Hi all,

I study Skyline Health Diagnostics for a few days and I post four sharing posts.

But I write them in Traditional Chinese, you should translate to English by Google Translation.

[Part1: Installation and Interface](https://hackmd.io/@farmer87/shd_01)

[Part2: Functional operation](https://hackmd.io/@farmer87/shd_02)

[Part3: Scheduler & offline update](https://hackmd.io/@farmer87/shd_03)

[Part4: Use API](https://hackmd.io/@farmer87/shd_04

richard_kessay
Contributor
Contributor
Jump to solution

I have the same issue - i would like to optimize the log upload via script and without API that is quite difficult.

Any Suggestions are most welcome!

0 Kudos
anshumansingh
VMware Employee
VMware Employee
Jump to solution

Hi @RichardChu , @richard_kessay 

 

SHD 3.5.0 version which should be available by 20/Sep/2022 , has API support for log bundle analysis.  We are also shipping the API documentation on swagger interface along with 3.5.0 release which can be accessed on https://<shd_vm_ip>/api/apischema/swagger 

Request you to please let us know the feedback on it.

richard_kessay
Contributor
Contributor
Jump to solution

Thank you, @anshumansingh for this great info about the version 3.5.

I checked on the listed download page for the SHD: 

https://my.vmware.com/group/vmware/get-download?downloadGroup=SKYLINE_HD_VSPHERE

However I cannot find the version 3.5.

Would you be able to help me find this download location?

Thank you, in advance for your swift response!

Kind regards,

Richard

0 Kudos
anshumansingh
VMware Employee
VMware Employee
Jump to solution

Hi @richard_kessay ,

 

As I mentioned before the 3.5.0 release will be out by next week, you can expect it to be available for download by 20/Sep/2022

richard_kessay
Contributor
Contributor
Jump to solution

my apologies - i miss-read the date.

0 Kudos
anshumansingh
VMware Employee
VMware Employee
Jump to solution

Hi @richard_kessay ,

 

The new version of SHD 3.5.0 is available for download here Download VMware Skyline Health Diagnostics.

Please refer to "Use the API Explorer" of Installation_Setup_and_Operations_Guide_for_VMware_Skyline_Health_Diagnostics_3.5.0.pdf guide for using the new Rest API

 

Thanks and Regards,

Anshuman

0 Kudos