You can create a custom action for a rule to meet a need that the predefined actions and existing custom actions do not meet. For example, you create an action to run a command when a request from of a certain class changes the status from Pending Fulfillment to Fulfilled. For this scenario, for each custom rule that you created, you write a CA Process Automation process to call the web service named addResourceToRequestItem. The web service associates the fulfilled resource to reservation.
Note: For more information about creating custom actions, including parameter values, see the Administration Guide.
Follow these steps:
addResourceToRequestItem(String sessionId, int requestItemId, RequestResourceItem resourceItem)
Specifies the security handle for calling web services.
Specifies the request item ID or subscription detail Id.
Specifies the request resource item to associate.
The following parameters apply:
Id – Identifies the request resource ID. It is an automatically generated UUID.
parentId – Specifies the request resource ID of the parent resource.
(Required) resourceTypeId – Specifies the resource type id, for example, the UUID of a resource named Computer.
status – Specifies the status of the request resource. Valid values are as follows: CREATED(100), READY(200), CANCELLED(300), and COMPLETED(400)
(Required) requestItemId – Specifies the request item ID or subscription detail ID.
createdDate – Specifies the date when the requested resource was created.
resourceId – Specifies the resource Id, for example, vm1234 or memory1234.
resourceName – Specifies the description of the resource, for example, virtual machines 1234.
resourceUrl – Specifies the URL to the external reservation system, for example, http://www.ca.com:8080/xyz/.
Specifies the request resource item to associate.
This call returns the following with updated details: com.ca.usm.soap.axisInterfaces.RequestResourceItem.
Note: For more information about creating CA Process Automation processes and Start Request Forms, see the CA Process Automation documentation. For more information about web services, see the Administration Guide and the Web Services API Documentation.
The Rule Details page appears.
The Catalog system saves your changes.
You have created the custom actions for the custom rules.
Example for Reserving a Disk
The following example is a web service call for reserving a disk, so that you can add the disk to an existing reservation.
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.soap.usm.ca.com">
<soapenv:Header/>
<soapenv:Body>
<ser:addResourceToRequestItem soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<sessionId xsi:type="xsd:string">dev_session</sessionId>
<requestItemId xsi:type="xsd:int">10076</requestItemId>
<resourceItem xsi:type="urn:RequestResourceItem" xmlns:urn="urn:usmRequestService">
<parentId xsi:type="xsd:string">a42b178f5c68-1251880b131bfbcf114-7f511313189039046</parentId>
<resourceId xsi:type="xsd:string">vm10466-disk1</resourceId>
<resourceName xsi:type="xsd:string">vm10466-disk1</resourceName>
<resourceTypeId xsi:type="xsd:string">662d774349a0-54f958451317186e4a5-7ff51311871145702</resourceTypeId>
<resourceUrl xsi:type="xsd:string">https://cat-dev-en2k8-3:8443/ssrm/</resourceUrl>
<status xsi:type="xsd:string">100</status>
</resourceItem>
</ser:addResourceToRequestItem>
</soapenv:Body>
</soapenv:Envelope>
Example for Reserving Memory
The following example is a web service call for reserving memory, so that you can add the memory to an existing reservation.
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.soap.usm.ca.com">
<soapenv:Header/>
<soapenv:Body>
<ser:addResourceToRequestItem soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<sessionId xsi:type="xsd:string">dev_session</sessionId>
<requestItemId xsi:type="xsd:int">10469</requestItemId>
<resourceItem xsi:type="urn:RequestResourceItem" xmlns:urn="urn:usmRequestService">
<parentId xsi:type="xsd:string">a42b178f5c68-1251880b131bfbcf114-7f511313189039046</parentId>
<resourceId xsi:type="xsd:string">vm10466-memory1</resourceId>
<resourceName xsi:type="xsd:string">vm10466-memory1</resourceName>
<resourceTypeId xsi:type="xsd:string">662d774349a0-54f958451317186e4a5-7ff61311871100123</resourceTypeId>
<resourceUrl xsi:type="xsd:string">https://cat-dev-en2k8-3:8443/ssrm/</resourceUrl>
<status xsi:type="xsd:string">100</status>
</resourceItem>
</ser:addResourceToRequestItem>
</soapenv:Body>
</soapenv:Envelope>
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |