POST Config/CountObjects

Returns the number of subordinate objects.

Requirements

  • Permissions:  In order for the object count to work properly, the caller must have View permission to the Distinguished Name (DN).
  • Token scope:  Configuration

Headers

  • Content type: Content-Type:application/json.

  • Token: The bearer access token that you received. For example, Authorization:Bearer 4MyGeneratedBearerTknz==. For more information, see Passing a bearer token in your API calls.

Parameters

Input parameters

Name

Description

ObjectDN

Begin counting subordinate objects at the Distinguished Name (DN).

Type

The class name of the object to count.

Recursive (Optional)

true: Recursively count subordinate objects.

false: Omit subordinate objects from the total.

Pattern

An expression for filtering DN matches.

  • To count DNs that include an asterisk (*) or question mark (?), prepend two backslashes (\\). For example, \\*.MyCompany.net treats the asterisk as a literal character and returns only certificates with DNs that match *.MyCompany.net.
  • To count DNs with a wild card character, append a question mark (?). For example, "test_?.mycompany.net" counts test_1.MyCompany.net and test_2.MyCompany.net but not test12.MyCompany.net.
  • To count DNs with similar names, prepend an asterisk. For example, *est.MyCompany.net, counts Test.MyCompany.net and West.MyCompany.net.
  • You can use both literals and wild cards in a pattern.

Returns

Response description

Name

Description

HTTP 200

For valid requests, this call returns a HTTP 200 message and the following data in the message body:

  • Count: The number of subordinate objects.
  • Error: Appears only when the operation cannot supply the necessary data. Provides only a description and Result. No other data.
  • Result: The result code that indicates the reason for success or failure. For more information, see Config result codes.

HTTP 400

For invalid requests, this call returns HTTP 400 Bad Request and the following data in the message body:

  • error: The reason for the error.
  • error_description: If available, additional information about how to retry the request.

     

Example: Count subordinate objects, use a pattern to filter results

Request

POST https://tpp.venafi.example/vedsdk/Config/CountObjects
Authorization:Bearer 4MyGeneratedBearerTknz==
{
   "ObjectDN":"\\VED\\Policy\\TopLevel\\",
   "Type":"Policy",
   "Recursive":"true",
   "Pattern":"*est.MyCompany.net"
}

Response

HTTP/1.1 200 OK
{
   "Count":2,
   "Result":1
}