Counts REST Service

Use Counts REST Service to get the counts of various cryptographic objects or devices from the IBM Security Guardium Key Lifecycle Manager server.

Counts REST Service returns counts for the following count types:
  • Pending device count
  • Low key groups count
  • Pending certificates count
  • Expiring certificates count
  • Pending client certificate count
Operation
GET
URL
Returns counts for all count types: https://<host>:<port>/SKLM/rest/v1/ckms/counts
Returns count for a single count type: https://<host>:<port>/SKLM/rest/v1/ckms/counts/<countType>
Returns counts for multiple count types: https://<host>:<port>/SKLM/rest/v1/ckms/counts?countType=<value>

By default, Guardium Key Lifecycle Manager server listens to the secure port 9443 (HTTPS) for communication. During IBM Security Guardium Key Lifecycle Manager installation, you can modify this default port.

Request

Request parameters
Parameter Description
host Specify the IP address or host name of the IBM Security Guardium Key Lifecycle Manager server.
port Specify the port number on which the IBM Security Guardium Key Lifecycle Manager server listens for requests.
countType Optional. Specify the count type for which you must obtain the count. Counts for all the count types are returned if you do not specify this parameter.

You can specify multiple comma-separated values.

Request Headers
Header name Value
Content-Type application/json
Accept application/json
Authorization SKLMAuth userAuthId=<authIdValue>
Accept-Language Any valid locale that is supported by IBM Security Guardium Key Lifecycle Manager. For example, en or de.

Response

Response Headers
Header name Value and description
Status Code
200 OK
The request was successful. The response body contains the requested representation.
400 Bad Request
The authentication information was not provided in the correct format.
401 Unauthorized
The authentication credentials were missing or incorrect.
404 Not Found Error
The processing of the request fails.
500 Internal Server Error
The processing of the request fails because of an unexpected condition on the server.
Content-Type application/json
Content-Language Locale for the response message.
Success response body

JSON Object with the following specification:

JSON property name Description
PendingDeviceCount Returns a count of devices that must accept or reject pending requests.
LowKeyKeyGroupsCount Returns a count of key groups with 10 percent or fewer available keys.
PendingCertificatesCount Returns a count of certificates that are returned after you sent certificate requests to a certificate authority.
ExpiringCertificatesCount Returns a count of certificates that are in use, but expires soon.
PendingClientCertCount Returns a count of pending client certificates.
Error Response Body

JSON object with the following specification.

JSON property name Description
code Returns the application error code.
message Returns a message that describes the error.

Examples

Service request to get counts for all count types
GET https://localhost:<port>/SKLM/rest/v1/ckms/counts
Content-Type: application/json
Accept : application/json
Authorization : SKLMAuth userAuthId=37ea1939-1374-4db7-84cd-14e399be2d20
Accept-Language : en
Success response
Status Code : 200 OK
Content-Language: en
{"PendingDeviceCount":"10",
"LowKeyKeyGroupsCount":"20”,
"PendingCertificatesCount":"20”,
"ExpiringCertificatesCount":"20”,
"PendingClientCertCount”:"20”}
Service request to get count for a single count type
GET https://localhost:<port>/SKLM/rest/v1/ckms/counts?countType=PendingDevice
OR
GET https://<host>:<port>/SKLM/rest/v1/ckms/counts/PendingDevice
Content-Type: application/json
Accept : application/json
Authorization : SKLMAuth userAuthId=37ea1939-1374-4db7-84cd-14e399be2d20
Accept-Language : en
Success response
Status Code : 200 OK
Content-Language: en
{"PendingDeviceCount" : "10"}
Service request to get counts for multiple count types
GET https://localhost:<port>/SKLM/rest/v1/ckms/counts?countType=
LowKeyKeyGroups,
ExpiringCertificates,PendingClientCert
Content-Type: application/json
Accept : application/json
Authorization : SKLMAuth userAuthId=37ea1939-1374-4db7-84cd-14e399be2d20
Accept-Language : en
Success response
Status Code : 200 OK
Content-Language: en
{"LowKeyKeyGroupsCount":"20”,
"ExpiringCertificatesCount":"20”,
"PendingClientCertCount":"20”}
Error Responses
Status Code : 400 Bad Request
Content-Language: en
{"code":"CTGKM6002E","message":"CTGKM6002E Bad Request: Invalid user
authentication ID or invalid request format."}