terminateInstances
terminateInstances method allows you to terminate only the BMC Cloud Lifecycle Management services whose servers are mapped to AWS VMs.
Note
terminateInstances method of CLM AWS SDK allows you to terminate the services and not the individual servers. If you have used a server ID for terminating an instance, then it checks the corresponding service and if it contains only single server object then it terminates that service, if not a CloudException is thrown stating "Service Offering Instance contains more than one Compute Container. Hence, we can't decommission the individual Compute Container as requested."
This operation can be performed by specifying either of following:
- Service ID(s) from BMC Cloud Lifecycle Management.
- Service name(s) from BMC Cloud Lifecycle Management.
- Server instance ID(s) from BMC Cloud Lifecycle Management.
The following table depicts how terminateInstances method is used:
Usage | Description |
---|---|
To execute using server instance ID(s) |
|
To execute using service ID(s) |
|
To execute using service name(s) |
|
Before you begin
Prior to using this CLM AWS SDK method, ensure that the following prerequisites are met:
- You have supplied the configuration parameters to the CLMEC2Client constructor or have specified in the configuration file. See CLM AWS SDK syntax and usage for details.
- Supply either of the three:
- List of valid server ids from BMC Cloud Lifecycle Management. You can obtain the server ids using the getInstanceId() method of com.bmc.cloud.sdk.aws.model.ServerInstance
- List of valid service ids from BMC Cloud Lifecycle Management. You can obtain the service ids using the getServiceId() method of com.bmc.cloud.sdk.aws.model.ServerInstance
- List of valid service names from BMC Cloud Lifecycle Management. You can obtain the service names using the getServiceName() method of com.bmc.cloud.sdk.aws.model.ServerInstance
Request
Using com.amazonaws.services.ec2.model.TerminateInstancesRequest
Method | Usage as per AWS SDK | Usage as per CLM AWS SDK | Remarks |
---|---|---|---|
setInstanceIds(Collection<String> instanceIds) | One or more instance IDs | One or more server IDs from BMC Cloud Lifecycle Management. | This is obtained from the getInstanceId() method from com.bmc.cloud.sdk.aws.model.ServerInstance |
withInstanceIds(Collection<String> instanceIds) | One or more instance IDs | One or more server IDs from BMC Cloud Lifecycle Management. | This is obtained from the getInstanceId() method from com.bmc.cloud.sdk.aws.model.ServerInstance |
Using com.bmc.cloud.sdk.aws.model.TerminateServicesRequest
Extends: com.amazonaws.services.ec2.model.TerminateInstancesRequest
Method | Usage as per AWS SDK | Usage as per CLM AWS SDK | Remarks |
---|---|---|---|
setServiceIds(final List<String> serviceIds) | Not used | One or more service IDs from BMC Cloud Lifecycle Management. | This is obtained from the getServiceId() method from com.bmc.cloud.sdk.aws.model.ServerInstance |
setServiceNames(List<String> serviceNames) | Not used | One or more service names from BMC Cloud Lifecycle Management. | This is obtained from the getServiceName() method from com.bmc.cloud.sdk.aws.model.ServerInstance |
Response
com.amazonaws.services.ec2.model.TerminateInstancesResult
Extends: None
Method | Belongs To | Usage as per AWS SDK | Usage as per CLM AWS SDK | Remarks |
---|---|---|---|---|
getTerminatingInstances() | AWS |
|
| PENDING,RUNNING, SHUTTING_DOWN,TERMINATED, STOPPING,STOPPED Instance ID is mapped to server ID. |
Comments
Log in or register to comment.