Page tree

This section lists a few use case scenarios for the web service to create a staging policy. It can help you effectively use the create API. Each scenario is explained using an example URL and its subsequent response details.

Creating a staging policy to communicate with specified integration service in the policy

You can create a staging policy to configure patrol agent from a staging integration service to communicate with Infrastructure Management Server using specified integration service.

URL to create a staging policy

http://bppmwsserver:80/bppmws/api/unifiedadmin/StagingPolicy/create

Input parameters to create a staging policy

{
    "stagingPolicy": {
        "integrationService": {
            "name": "bmc-29.labs.bmc.com#12124",
            "type": "IS"
        },
        "tag": "os:windows",
        "name": "Prod_Staging",
        "type": "staging",
        "enabled": true,
        "description": "Prod_Staging",
        "precedence": 999,
        "tenant": {
            "name": "GLOBAL"
        },
        "agentSelectionCriteria": "agentTag EQUALS \"Windows_VM\" "
    }
}

The following table lists the parameters that you must provide with the URL.

List of required parameters that must be provided to access the create API

AttributesDescription
agentSelectionCriteria

Set of conditions based on which the agents are identified to apply the policy

The syntax is  "agentIdentifier operator \"value\""
where,

  • agentIdentifier refers to the agent attributes, based on which the agent is identified. The supported identifiers are as follows:
    • agentName—Host name of the computer on which the BMC PATROL Agent is installed
    • agentPort—Port number through which the Integration Service connects with the agent
    • agentVersion—Version of the BMC PATROL Agent
    • agentOS—Operating system of the computer on which the BMC PATROL Agent is installed
    • agentIP—IP address of the computer on which the BMC PATROL Agent is installed
    • agentTag—Tag name of the BMC PATROL Agent
    • integrationService—Display name of the Integration Service
    • childServer—Host name of the Child Server that is registered with Central Monitoring Administration
precedencePriority for the policy. The supported values are numbers between 0 and 999 with 999 being the lowest priority and 0 being the top priority. 

The default value is 999.
tenantDetails of the tenant who owns the policy. You can either provide name or the id of the tenant.
name

Name of the tenant who owns the policy. The supported values are as follows:

  • <nameOfTenant>—Indicates that the policy is applicable to the specified tenant
  • GLOBAL—Indicates that the policy is applicable to all agents
  • PROVIDER—Indicates that the policy is applicable to the cloud service provider and also to the agents that do not have any tenants
enabledIndicates whether the policy is enabled. The default value is true.
nameName of the policy
type

Type of the policy. The supported types are as follows:

  • blackout
  • monitoring
  • staging
descriptionBrief description about the policy
integrationServiceDisplay name of the Integration Service(IS) that assists the Agent to communicate to the Infrastructure Management Server. This should be an existing IS/cluster. Ensure that the IS is created before calling the API.
integrationService: typeThe type of the integration service. The values can be IS or cluster.
integrationService: nameName of the IS or IS cluster.

JSON response

A staging policy is created, and a sample response is as follows:

{
    "response": [
        {
            "statusCode": "200",
            "statusMsg": "OK",
            "resourceId": "a4315c0c-cbf2-4b72-a06b-ba8d4e93f69d",
            "resourceURI": null,
            "resourceName": "Prod_Staging"
        }
    ],
    "statusCode": "200",
    "statusMsg": "OK",
    "responseTimeStamp": "2014-08-08T09:07:27"
}