Restful web services authentication

This section explains how the Restful web service requests are authenticated.

Authentication mechanism  

TrueSight Capacity Optimization uses Basic access authentication (based on Base64-encoded format) to provide access to resources to only those clients that have the correct credentials. This is performed by authenticating user name and password that are passed through the HTTP header. Based on your TrueSight Capacity Optimization setup, the user credentials are authenticated against the information in the TrueSight Capacity Optimization database, the LDAP server, or BMC Remedy Single Sign-On (BMC Remedy SSO).

Base64-encoded format

In this format, a concatenated string of the user name and password separated by a colon (:) is created. This string is encoded in the Base64 format. A client uses this encoded string as the user credentials in the HTTP header. Every Restful web service request must have the Base64-encoded format of the user credentials in the HTTP header. 

For example, if the user name is admin and password is admin, the concatenated string is admin:admin. The Base64-encoded string of admin:admin is YWRtaW46YWRtaW4=. You must use this encoded string as the user credentials in the HTTP header of every Restful web service request. The use of the Base64 encoded string in the header of a Restful web service request is as follows:

Authorization: Basic YWRtaW46YWRtaW4=

 

To authenticate (using admin as the username and password) and retrieve data for an existing reservation along with alert status information, you can use the following information in the request:

Method

GET

URI

/dh-services/rsv/reservations/{reservation-id}

HOST

hostname:8280

Request headers

Authorization: Basic YWRtaW46YWRtaW4=

The following image shows an example of a Reservation API request in a REST client.

 Click here to view the sample response for reservation API...
{
  "href": "hostname:8000/dh-services/rsv/reservations/31279",
  "id": 31279,
  "name": "testReservation_PUT_mergeResourceSpecs",
  "startDate": "08/02/2017",
  "description": "generated as part of JUNIT test, should be automatically deleted",
  "status": "ACCEPTED",
  "priority": "MEDIUM",
  "probability": 100,
  "realizationMode": "MANUAL",
  "highAvailability": "NO",
  "alertstatus": [],
  "resourceRequirementSummary": {
    "numItems": 2,
    "cpuTotalMHz": 8000,
    "memTotal": 4294967296,
    "storageTotal": 107374182400,
    "cpuTotalMHzUsed": 5280,
    "memTotalUsed": 3908420239.36,
    "storageTotalUsed": 35433480192
  },
  "resources": {
    "resourceSpecs": [
      {
        "id": 1932051,
        "name": "item-1",
        "numItems": 1,
        "enttypenm": "gm:vmw",
        "cpuCores": 4,
        "cpuTotalMHz": 4000,
        "memTotal": 2147483648,
        "storageTotal": 53687091200,
        "os": "LINUX",
        "cpuUtilization": 0.66,
        "memUtilization": 0.91,
        "storageUtilization": 0.33
      },
      {
        "id": 1932052,
        "name": "item-2",
        "numItems": 1,
        "enttypenm": "gm:vmw",
        "cpuCores": 4,
        "cpuTotalMHz": 4000,
        "memTotal": 2147483648,
        "storageTotal": 53687091200,
        "os": "LINUX",
        "cpuUtilization": 0.66,
        "memUtilization": 0.91,
        "storageUtilization": 0.33
      }
    ]
  },
  "items": [
    {
      "href": "http://hostname:8000/dh-services/rsv/reservations/31279/items/50748",
      "id": 50748,
      "name": "item-1",
      "resourceSpec": {
        "id": 1932051,
        "name": "item-1",
        "enttypenm": "gm:vmw",
        "cpuCores": 4,
        "cpuTotalMHz": 4000,
        "memTotal": 2147483648,
        "storageTotal": 53687091200,
        "os": "LINUX",
        "cpuUtilization": 0.66,
        "memUtilization": 0.91,
        "storageUtilization": 0.33
      }
    },
    {
      "href": "http://hostname:8000/dh-services/rsv/reservations/31279/items/50749",
      "id": 50749,
      "name": "item-2",
      "resourceSpec": {
        "id": 1932052,
        "name": "item-2",
        "enttypenm": "gm:vmw",
        "cpuCores": 4,
        "cpuTotalMHz": 4000,
        "memTotal": 2147483648,
        "storageTotal": 53687091200,
        "os": "LINUX",
        "cpuUtilization": 0.66,
        "memUtilization": 0.91,
        "storageUtilization": 0.33
      }
    }
  ]
} 

 

Was this page helpful? Yes No Submitting... Thank you

Comments