Listing details for all the policies

The list API uses the POST method to list information about all the policies.You must provide authentication credentials by using the login API before accessing the data. For information about the authentication process, see  TSWS authentication .

URL to access the list API

The generic format of a URL for the list API is as follows:

https://<TSPShostname>:<port>/tsws/10.0/api/unifiedadmin/Policy/list?&responseType=basic&withCount=<totalCount>&forSearch=<SearchCondition>

Example

https://tsps105:443/tsws/10.0/api/unifiedadmin/Policy/list?&responseType=basic

Entry

Description

https|http

Type of protocol to send the request. BMC TrueSight Presentation Server supports HTTPS protocol by default. You can use HTTP protocol as well.

TSPShostname

Host name of the Presentation Server.

port

Port number through which communication is established. By default, the HTTPS protocol is supported and the default port number is 443. If you use HTTP protocol, use the port number 80.

responseType=basic

Specifies to retrieve the basic information of the policies

withCount

Determines whether you want to get aggregate details of the policies listed.

The aggregate details include:

  • Total number of policies
  • Total number of policies enabled
  • Total number of policies disabled
  • Total number of policies shared with user groups
  • Total number of policies not shared with user groups
  • Policies display limit (the default maximum number of policies displayed is 1000)

Valid values:

  • true: Indicates that you want to get aggregate counts of the policies listed.
  • false: Indicates that you do not want to get aggregate counts of the policies listed.
forSearch

Determines whether you want to list policy details based on the monitoring solution details.

Valid values:

  • true: Indicates that you want to list policies based on the monitoring solution criteria.
  • false: Indicates that you want to list policies based on filter criteria other than the monitoring solution criteria.

Request body

While running this request, you can specify conditions or filter criteria based on which a list of policies is returned. These conditions can be specified in the request body parameters.

Specifying the conditions is optional. If you run the request with a blank body, the API returns a list of all the policies configured.

The following sample can help you understand the structure of the request body. For more information about the parameters included in the request body, see Parameter definitions.

Sample request body
{
	"filterCriteria": {
		"policyEnabledStatus": "ENABLED",
		"policySharedStatus": "ANY",
		"monitoringSolutionName": "",
		"monitoringSolutionVersion": "",
		"monitoringProfile": "",
		"monitoringType": "",
		"tenantId": ""
	},
	"stringToSearch": "",
	"fieldToSearch": "",
	"type": "monitoringpolicy"
}


Response information for the list API

A sample JSON response is as follows:

Sample response
{
    "response": [
        {
            "blackoutPolicy": {
                "name": "policy123_blackout", 
                "id": "90c6ea33-ee91-4740-9dda-6f28c8496122", 
                "type": "blackout", 
                "enabled": true, 
                "tenant": {
                    "name": "GLOBAL", 
                    "id": "GLOBAL"
                }, 
                "description": "description", 
                "precedence": 900, 
                "agentSelectionCriteria": {
                    "criteria": {
                        "value": "10.10.10.100- 10.10.10.200", 
                        "identifier": "agentIP", 
                        "operator": "IN_RANGE", 
                        "groupingOperator": null, 
                        "leftExpression": null, 
                        "rightExpression": null
                    }
                }
            }, 
            "statusMsg": "OK", 
            "statusCode": "200", 
            "resourceName": "policy123_blackout", 
            "resourceId": "90c6ea33-ee91-4740-9dda-6f28c8496122"
        }
    ], 
    "statusMsg": "OK", 
    "statusCode": "200", 
    "responseTimeStamp": "2013-01-22T09:20:34", 
}

Parameter definitions

The following parameters can be used in the request body.

Parameter name Definition

Basic filter criteria

policyEnabledStatus

Lists all the policies based on the policy status.

Can be one of the following:

  • ENABLED: Lists all the policies that are enabled.
  • DISABLED: Lists all the policies that are disabled.
  • ANY: Lists all the policies irrespective of whether they are enabled or disabled.
policySharedStatus

Lists all the policies based on whether those policies are shared with a user group.

Can be one of the following:

  • SHARED: Lists all the policies that are shared with a user group.
  • NON_SHARED: Lists all the policies that are not shared with a user group.
  • ANY: Lists all the policies irrespective of whether they are shared with a user group or not.
type

Lists policies based on the policy type.

Can be one of the following:

  • BLACKOUTPOLICY: Refers to blackout policies.
  • MONITORINGPOLICY: Refers to monitoring policies.
  • STAGINGPOLICY: Refers to staging policies.

This value is not case-sensitive.

tenantId
Lists all the policies based on the tenant name included in the policy.
Monitoring solution criteria
monitoringSolutionName

Lists all the policies based on the monitoring solution name specified.

To understand the valid values for the monitoring solution name, you need to run the API that lists all the solution names. For more information, see Listing monitoring solution details for policies.

monitoringSolutionVersion

Lists all the policies based on the monitoring solution version.

Note: If you specify the monitoring solution name, then this value must correspond to the monitoring solution name specified.

To understand the valid values for the monitoring solution name, you need to run the API that lists all the solution names. For more information, see Listing monitoring solution details for policies.

monitoringProfile

Lists all the policies based on the monitor profile.

Note: If you specify the monitoring solution name, then this value must correspond to the monitoring solution name specified.

To understand the valid values for the monitoring solution name, you need to run the API that lists all the solution names. For more information, see Listing monitoring solution details for policies.

monitoringType

Lists all the policies based on the monitor type.

Note: If you specify the monitoring solution name, then this value must correspond to the monitoring solution name specified.

To understand the valid values for the monitoring solution name, you need to run the API that lists all the solution names. For more information, see Listing monitoring solution details for policies.

Other criteria
stringToSearch 

Lists policies based on a string of characters included in a list of selected fields in the policies.

The fieldToSearch parameter determines the fields in which the string is searched.

fieldToSearch

Applicable only when you specify the stringToSearch parameter

Lists policies based on whether the string specified in the stringToSearch parameter is present in the field names specified.

This value can be a comma-separated list of field names.

Valid values:

  • name: Refers to the Name field.

  • description: Refers to the Description field.
  • agentSelectionCriteria: Refers to the Agent Selection Criteria field.
  • tenant: Refers to the Tenant field.
  • owner: Refers to the Owner field (column name on the Infrastructure Policies page).
  • userGroups: Refers to the User Group field (column name on the Infrastructure Policies page).

Note: These values are case-sensitive.

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

Comments