To begin working with vRealize Suite Lifecycle Manager (vRSLCM) to leverage the api, we first need to to authenticate.
Many VMware KBs advise the following for creating the <token>
The Base64 encoded value of ‘username:password’. In this example we use the default username ‘admin@local’, and password.
While the words make sense, lets explore how one might Base64 encode the value of ‘username:password’
I tend to leverage sites like base64encode.org to accomplish quick conversion task’s.
For example lets encode: username: admin@local password: VMwareRocks
This would form the string to encode: admin@local:VMwareRocks
Encoding the string results in the following value: YWRtaW5AbG9jYWw6Vk13YXJlUm9ja3M=
Updating the <token>
with our base64 encoded value, we can now discover our environment details with the following curl command:
root@vrslcm:~$ curl -h "Authorization: Basic <token>" -k https://lcm81.corp.com/lcm/lcops/api/environments
root@vrslcm:~$ curl -h "Authorization: Basic YWRtaW5AbG9jYWw6Vk13YXJlUm9ja3M=" -k https://lcm81.corp.com/lcm/lcops/api/environments