question

AbdulHayee avatar image
AbdulHayee asked jkho edited

Where can i find authorization key for CloudStress Api

In Cloud Stress Api Guide every api call need a authorization api key where can I get one.

<code>swagger_client.configuration.api_key['Authorization']='YOUR_API_KEY'
automationapiTemevaopenstackcloud stress
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
jkho avatar image
jkho answered jkho edited

The key is an OAuth2 token. You can obtain the token via the Temeva IAM service at https://my_domain.temeva.com/api/iam/oauth2/token using any standard OAuth2 library with the password grant workflow. The workflow requires a scope parameter which is the organization ID. The default organization ID can be retrieved via the "id" property of the response to a GET of https://my_domain.temeva.com/api/iam/organizations/default.

Example curl syntax for obtaining token:

curl -k -X POST \
-H "Accept:application/json" \
 --data-urlencode "grant_type=password" \
 --data-urlencode "username=my_email_addr" \
 --data-urlencode "password=my_password" \
 --data-urlencode "scope=my_org_id" \
 https://mydomain.temeva.com/api/iam/oauth2/token

Response:
HTTP/1.1 200 OK
{
  "access_token":"access_token_value",
  "token_type":"bearer",
  "expires_in":86400,
  "refresh_token":"refresh_token_value",
  "scope":"my_org_id"
}

The Authorization header value format is "Bearer: access_token_value" where access_token_value is the access_token property from the response to the POST to the oauth2 endpoint.

10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.