Examples of using the REST API to retrieve data and search CIs
This section lists a few use case scenarios for the REST API that retrieve data and search CIs. It can help you effectively use these REST API. Each scenario is explained using a sample URL and its subsequent response details.
Retrieving metadata from a CI
URL
http://bppmwsserver:80/bppmws/api/CI/bppmci.calbro.com/configdata?idType=Name
Response
Metadata information of the specified CI.
Retrieving configuration information of multiple CIs
URL
http://bppmwsserver:80/bppmws/api/CI/bppmci_1,bppmci_2/configdata?idType=RECON_ID
Response
Configuration information of the specified CIs.
Retrieving performance statistics data from CIs using their TokenID
URL
http://bppmwsserver:80/bppmws/api/CI/bppm_1,bppm_2/stats?starttime=2010-06-23T17:00:00&endtime=2010-07-07T17:00:00&idType=Name
Response
Performance statistics data within the specified time period for the specified CIs.
Retrieving complete details of a CI
URL
http://bppmwsserver:80/bppmws/api/CI/bppm_1/details?idType=RECON_ID
Response
Complete details of the specified CI.
Retrieving specific details of a CI
URL
http://bppmwsserver:80/bppmws/api/CI/bppm_1/details?idType=RECON_ID&filter=domain,status
Response
Domain and status slot values of the specified CI.
Searching CIs based on a partial identifier and filters
URL
http://bppmwsserver:80/bppmws/api/CI/ngp/search?idType=NAME&slot=CLASS:BMC_ComputerSystem&resultSize=full
Response
Complete details of the CIs that contain ngp in their name with the CLASS slot value as BMC_ComputerSystem.
Searching CIs based on input parameters
URL
http://bppmwsserver:80/bppmws/api/CI/search?
Input parameters
"sortCriteria": [
{
"sortOrder": 1,
"attributeName": "Name"
}
],
"criteria": {
"groupingOperator": "OR",
"leftExpression": {
"groupingOperator": "AND",
"leftExpression": {
"value": "BMC",
"identifier": "Name",
"operator": "contains"
},
"rightExpression": {
"value": "CRITICAL",
"identifier": "status",
"operator": "equals"
}
},
"rightExpression": {
"value": "PRIORITY_1",
"identifier": "Priority",
"operator": "equals"
}
}
}
Response
Retrieves details of CIs that match either of the following conditions:
- Contain BMC in their name with the status slot value of critical
- Have the priority slot value as Priority_1
Creating a CI on the local computer's cell
URL
http://bppmwsserver:80/bppmws/api/CI/create
Input parameters
"cilist": [
{
"className": "BMC_ComputerSystem",
"attributeMap": {
"HomeCell": "pncell_bppmwsserver",
"Name": "ci112",
"mc_udid": "bppm2"
}
}
]
}
Response
The ci112 CI is created.
Creating a CI on a Child Server's cell
URL
Input parameters
"cilist": [
{
"className": "BMC_ComputerSystem",
"attributeMap": {
"Name": "ci100",
"mc_udid": "bppm2"
}
}
]
}
Response
The ci100 CI is created on the specified Child Server's cell.
Creating a relationship
URL
http://bppmwsserver:80/bppmws/api/CI/create
Input parameters
"cilist": [
{
"attributeMap": {
"provider_id": "bppm1",
"consumer_home_cell": "pncell_bppmwsserver",
"provider_home_cell": "pncell_bppmwsserver",
"consumer_id": "bppm2",
"mc_udid": " bppm3",
"PropagationModel": "DIRECT"
},
"className": "BMC_Impact"
}
]
}
Response
The bppm3 relationship is created between bppm1 CI and bppm2 CI.
Deleting a CI
URL
http://bppmwsserver:80/bppmws/api/CI/delete?Name=ci1
mc_udid
Response
The ci1 CI is deleted.
Deleting a relationship
URL
http://bppmwsserver:80/bppmws/api/CI/delete?mc_udid=bppm3
Response
The bppm3 relationship is deleted.