NSM service
designers delete NSM service
template instances
using either the timeToDelete
attribute or the <serviceOperation>
element type
attribute.
Use the timeToDelete
attribute in the <serviceTemplate>
element
and specify the number of minutes to deletion of the NSM service
template instance.
Use the type
attribute in the <serviceOperation>
element
and specify a type of DELETE
.
About this task
There are two ways to delete a NSM service
template instance from
the system. Both mechanisms have different constraints on their usage and both execute differently
within the system. Specify only one of the deletion options in a NSM service
template: either the
timeToDelete
attribute in the <serviceTemplate>
element or the
type
attribute with type DELETE
in the
<serviceOperation>
element. The time to delete of a service instance starts from
the point of service execution completing successfully. If service execution results in a failure,
the automatic purge will be cancelled.The timeToDelete
attribute is an optional
attribute of the <serviceTemplate>
element. The value specified for this
attribute should be a positive integer greater than zero. The value represents the number of minutes
to deletion of a NSM service
template instance. Using
the timeToDelete
attribute in the <serviceTemplate>
element
specifies when the NSM service
template instance record
can be purged from the system. This method removes the NSM service
template instance record
on NSM and no work will be submitted to Netcool Configuration
Manager.
In the Procedure, you should perform either step 1 or step
2.
Procedure
- As the NSM service
designer use
one of the following examples as a guide to deleting a NSM service
template instance
using the
timeToDelete
attribute in the <serviceTemplate>
element:
<serviceTemplate name="FirewallCreateZones" timeToDelete="5">
.
.
<implementations>
<implementation description="Implementation Rule for all Cisco Routers">
.
.
.
<serviceOperations>
<serviceOperation name="createOperation" type="CREATE">
<operations>
.
.
.
</operations>
</serviceOperation>
</serviceOperations>
- Specify the
timeToDelete
attribute
in the <serviceTemplate>
XML element.
- Assign a positive integer greater than zero that specifies
the number of minutes to deletion of the service instance. In the
example, an instance of the NSM service
template called
FirewallCreateZones
is
posted to NSM with a timeToDelete
attribute set to
five minutes. At some point after that, a service is submitted for
that NSM service
template.
Once the service instance executes successfully, its record exists
within NSM for the duration of the timeToDelete
value.
At that time the record of the service instance will be removed from
the system.
- As the NSM service
designer use
the following example as a guide to deleting a NSM service
template instance
using the
type
attribute in the <serviceOperation>
element:
<serviceTemplate name="FirewallCreateZones" >
.
.
.
<implementations>
<implementation description="Implementation Rule for all Cisco Routers">
.
.
.
<serviceOperations>
<serviceOperation name="createOperation" type="CREATE">
.
.
.
</serviceOperation>
<serviceOperation name="deleteOperation" type="DELETE">
<operations>
<operation name="ITNCM/FirewallDeleteZones-Cisco-Router" rollback="true" type="COMMANDSET"><parameters>
<parameter name="VIRTUALROUTERNAME"/>
<parameter name="NAME"/>
<parameter name="SOURCEROUTETABLE"/>
<parameter name="TARGETROUTETABLE"/>
</parameters>
</operation>
</operations>
</serviceOperation>
</serviceOperations>
</implementation>
<implementation description="Implementation Rule for all Juniper Routers">
<serviceOperations>
<serviceOperation name="createOperation" type="CREATE">
…...
</serviceOperation>
<serviceOperation name="deleteOperation" type="DELETE">
<operations>
<operation name="ITNCM/FirewallDeleteZones" rollback="true" type="COMMANDSET">
<parameters>
<parameter name="VIRTUALROUTERNAME"/>
<parameter name="NAME"/>
parameter name="SOURCEROUTETABLE"/>
<parameter name="TARGETROUTETABLE"/>
<parameter name="RIBGROUPNAME"/>
</parameters>
</operation>
</operations>
</serviceOperation>
</serviceOperations>
</implementation>
</implementations>
</serviceTemplate>
- Specify the
type
attribute with a value
of DELETE
in the <serviceOperation>
XML
element for each implementation of a NSM service
template.
In the example:
- The service operation encapsulated within the Implementation
Rule for all Cisco Routers implementation specifies the
type
attribute
with a value of DELETE
in the <serviceOperation>
element.
- The service operation encapsulated within the Implementation
Rule for all Juniper Routers implementation specifies the
type
attribute
with a value of DELETE
in the <serviceOperation>
element.
Note: Each service operation must have at least one operation
to perform the deletion.
- Use the
HttpMethod DELETE
on URI nsm/service/{service-id} to
initiate the delete of this service. This type of delete will result
in work on the Netcool Configuration
Manager server
to complete the delete operations and then remove the NSM record of
the service instance.
Observe the following points when deleting
NSM service
template instances:
- It is acceptable to specify both a service operation of type
CREATE
in
the type
attribute and the timeToDelete
attribute
in the <serviceTemplate>
element.
- It is acceptable to specify both a service operation of type
CREATE
and
type DELETE
in the type
attributes
in the <serviceOperation>
element within the <implementation>
element.
- When a NSM service
template is
posted, the system checks to ensure each NSM service
template has
indicated a way to handle deletion. If the
timeToDelete
value
is set, then each <implementation>
element must
contain just one <serviceOperation>
element with
a type CREATE
in the type
attribute.
If the timeToDelete
attribute is not set, then each <implementation>
element
must contain two <serviceOperation>
elements:
one with a type
attribute set to CREATE
and
the other type
attribute set to DELETE
.
- If a NSM service
template does
not conform to these rules, then the system provides an appropriate
error code and message.