Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

Dell ObjectScale 1.3 Administration Guide

Log in and obtain the Access Token for the object store-level APIs

Use CURL for Windows or Linux to log in to ObjectScale and use object store-level APIs.

About this task

ObjectScale uses a token-based authentication system for REST API calls.

This section provides examples of authenticating with the ObjectScale Management APIs. When you are authenticated by ObjectScale, the login API returns an authentication token. You can use this token for authentication in subsequent calls.

Steps

  1. Assign the namespace where ObjectScale is installed to objectscaleNamespace
    objectscaleNamespace=<OBJECTSCALE_NAMESPACE>
  2. Assign the ObjectScale Gateway endpoint IP to OBJECTSCALE_GATEWAY_ENDPOINT.
    All ObjectScale-level login and API request need to be made to the ObjectScale gateway loadbalancer endpoint.
    OBJECTSCALE_GATEWAY_ENDPOINT=$(kubectl get svc -n $objectscaleNamespace| awk '/objectscale-gateway[^-]/{print $4}')
  3. Log in with the username and password of an ObjectScale Management User.
    curl -vk -X POST -d '{"username":"root", "password":"<ROOT_ACCOUNT_PASSWORD>"}' -H 'Content-Type: application/json' https://<OBJECTSCALE_GATEWAY_ENDPOINT>:443/mgmt/auth/login

    The response will contain the access_token for authentication, refresh_token can be used to get a new access_token after the current token expires.

    < HTTP/1.1 200 OK
    < Date: Wed, 01 Mar 2023 16:59:25 GMT
    < Content-Type: application/json
    < Transfer-Encoding: chunked
    < Connection: keep-alive
    <
    { [1114 bytes data]
    100  1199    0  1107  100    92    406     33  0:00:02  0:00:02 --:--:--   440
    * Connection #0 to host 172.17.100.1 left intact
    {
       "access_token" : "OSTOKEN-eyJraWQiOiJzeW01Y2E1MDA4ZjRhMjMzYTJhIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJvc2xkYXA3NTkwNDliZTg5MmIyMWJhL21nbXRfaXNndXNlcjEiLCJvc19yb2wiOlsicmVhZG9ubHkiXSwiaXNzIjoidXJuOm9zYzpvc2NpNGNmYmEwZmYyNGViNGQ2Mjo6c2VydmljZS9vYmplY3RzY2FsZS1mZWRlcmF0aW9uLWNmNjQ0NGQtdHBuYzQiLCJvc19wYXNzY2huZ29ubHkiOmZhbHNlLCJhdWQiOiJvc2NpNGNmYmEwZmYyNGViNGQ2MiIsInR5cCI6IkJlYXJlciIsInNpZCI6ImI0ZTVmYTFjLWYxYjktNDE5NC1iM2I1LTIzZTY3MjE4Y2E4MCIsImlhdCI6MTY3NTIyNzU2NCwiZXhwIjoxNjc1MjI4NDY0LCJqdGkiOiJvc2F0MWQzYWE1NWY0ZjA2ZjIwYSJ9.N8O7Z4fcjNRTbh6dmMw5UCSEpmYYt4jRQ3uVfiyMrJ8",
       "expires_in" : 900,
       "refresh_token" : "eyJraWQiOiJzeW01Y2E1MDA4ZjRhMjMzYTJhIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJvc2xkYXA3NTkwNDliZTg5MmIyMWJhL21nbXRfaXNndXNlcjEiLCJpc3MiOiJ1cm46b3NjOm9zY2k0Y2ZiYTBmZjI0ZWI0ZDYyOjpzZXJ2aWNlL29iamVjdHNjYWxlLWZlZGVyYXRpb24tY2Y2NDQ0ZC10cG5jNCIsImF1ZCI6Im9zY2k0Y2ZiYTBmZjI0ZWI0ZDYyIiwidHlwIjoiUmVmcmVzaCIsInNpZCI6ImI0ZTVmYTFjLWYxYjktNDE5NC1iM2I1LTIzZTY3MjE4Y2E4MCIsImlhdCI6MTY3NTIyNzU2NCwiZXhwIjoxNjc1MjI5MzY0LCJqdGkiOiJvc3J0NTRiYjYwMWY0ZjA2ZjIwYSJ9.NyfzEP7VJK08wutsD7nvQxQSiYkvCp4dOy4ZFpygfOg",
       "refresh_expires_in" : 1800
    }
  4. Copy the generated token so you can add it to each command using the -H "Authorization:$access_token" syntax.

    You can use the following command to set the Access Token as the "$token" environment variable.

    access_token=$(curl -k -X POST -d '{"username":"root","password":"<ROOT_ACCOUNT_PASSWORD>"}' https://$OBJECTSCALE_GATEWAY_ENDPOINT:443/mgmt/auth/login -H 'Content-Type: application/json' -H 'Accept: application/json' | grep access_token | cut -f4 -d'"')

Obtain the endpoint IP for the object store Management Gateway and log in to issue object store-level API calls

  1. Assign the object store's name to the variable objectstoreName and assign the object store's namespace to the variable objectstoreNamespace .
    OBJECTSTORE_MANAGEMENT_GATEWAY=$(kubectl get svc -n $objectstoreNamespace | grep $objectstoreName | awk '/-management-gateway/{print $4}')

    Below is an example of how to use ObjectScale-level token to make and object store API call.

    curl -ks -X GET -H "Authorization:$access_token" -H "Accept:application/xml" -H "X-EMC-Override: true" https://${OBJECTSTORE_MANAGEMENT_GATEWAY}:4443/object/tenants

Rate this content

Accurate
Useful
Easy to understand
Was this article helpful?
0/3000 characters
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please select whether the article was helpful or not.
  Comments cannot contain these special characters: <>()\