service
This topic describes the following verbs, command-line arguments, and API parameters available for the service noun in the BMC Cloud Lifecycle Management SDK:
create
Use service-create from the command line to create a service from the specified offering.
[--option OPTION_NAME=CHOICE_NAME [OPTION_NAME=CHOICE_NAME ...]]
[--param PARAM_NAME=PARAM_VALUE [PARAM_NAME=PARAM_VALUE ...]]
[--decommissiondate YYYY-MM-DD|Nd] --offeringname NAME --servicename NAME
[--quantity [NUMBER]] --serverusername USERNAME
--serverpassword PASSWORD --serverhostprefix SERVERHOSTPREFIX --tenantname NAME
Use service_create in the API to create a service from the specified offering. This command returns a ServiceOfferingInstance API object with the same attributes and relationships. (You can fetch options, option choices, and parameters with the option-list and param-list commands.)
hostNamePrefix=None, tenantName=None, options=None, params=None, decommissiondate=None)
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
--offeringname | offeringName | Name of the offering to use for the new service. | Yes |
--servicename | serviceName | Name of the new service. | Yes |
--serverusername | userName | User name with administrator access on the servers to configure. | Yes |
--serverpassword | password | Password for the administrator user. Note: Ensure that you specify the password in the correct format based on the provider type before running the SDK command.
| Yes |
--serverhostprefix | hostNamePrefix | Hostname prefix to use for all servers created for this service. | Yes |
--tenantname | tenantName | Name of the tenant for the new service. | Yes |
--option | option | Key and value of an option and choice. |
|
--param | param | Key and value of a parameter name and value. |
|
--decommissiondate | decommissiondate | Date in YYYY-MM-DD or Nd format, where Nd indicates how many days after the present day. |
|
--quantity | quantity | Number of services to create. |
|
--onbehalfuser |
| Perform the action as the specified user name. |
|
--waitfor |
| Time in seconds to wait for a response from the server, otherwise return running task details. |
|
--usetemplatecredentials |
| (4.6.03 and later) If it is set to true, default user credentials are used from the template. |
|
| gcac | GenericCloudAPIClient instance/user authentication. |
|
delete
Use service-delete from the command line to delete the specified service.
--servicefilter FILTERNAME=FILTERVALUE | --file CSV FORMAT FILE)
Use service_delete in the API to delete the specified service. This command returns a ServiceOfferingInstance API object with the same attributes and relationships.
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
--servicename | serviceName | Name of the service to delete. | Yes |
--servicefilter | serviceFilter | Name of filter. | Yes (for bulk update) |
--file | file | Full path to the CSV file. See this . | Yes (for bulk update) |
--decommissiondate | decommissiondate | Date in YYYY-MM-DD or Nd format, where Nd indicates how many days after the present day. |
|
--waitfor |
| Time in seconds to wait for a response from the server, otherwise return running task details. |
|
| gcac | GenericCloudAPIClient instance/user authentication. |
|
list
Use service-list from the command line to list available services.
[FIELD_NAME=VALUE ...]]
Use service_list in the API to list available services. This command returns a list of ServiceOfferingInstance API objects with the same attributes and relationships.
obj[n].guid returns the GUID
obj[n].name returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
-l |
| List all fields. This parameter does not need a value. |
|
-u |
| List only GUIDs. This parameter does not need a value. |
|
-n |
| List only names. This parameter does not need a value. |
|
-s |
| List GUIDs, names, and status (if applicable). This parameter does not need a value. |
|
-k |
| List the field names specified in the value for this parameter. |
|
--filter | filters | List the output that matches the specified filters. |
|
| gcac | GenericCloudAPIClient instance/user authentication. |
|
migrate
In BMC Cloud Lifecycle Management 4.6.05 and later, use service-migrate from the command line to migrate infrastructure resources of one or more services from a specified vCenter, cluster, or host to another. Because BMC Cloud Lifecycle Management retains only cluster information, specify the source and target clusters as input. For more information, see Synchronizing-migrated-server-infrastructure.
[--sourcecluster NAME|id:GUID] [--dryrun true/false] [--provider NAME|id:GUID]
[--destinationcluster NAME|id:<GUID>] [--destinationpodname NAME]
(--servicename NAME|id:GUID | --servicefilter ATTRIBUTENAME=ATTRIBUTEVALUE |
--file CSV FORMAT FILE)
Use service_migrate in the API to migrate infrastructure resources of one or more services from a specified vCenter, cluster, or host to another.
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | Description | Required? |
---|---|---|
-h, --help | Show help message and exit. |
|
--waitfor TIME_OUT_SECONDS | Time-out in seconds to wait for a response from the server; otherwise, return the running task’s details. If you enter -1 as the number of timeout seconds, the timeout will wait indefinitely. |
|
--sourcepodname NAME | Name of the pod containing the source cluster. This argument is required only if you specify NAME as a value for the --sourcecluster argument and the cluster name is not unique across vCenters. |
|
--dryrun true/false | Used for report generation. By default, it is true. |
|
--provider NAME|id:GUID | Name or GUID of the provider. Note: Currently, only BMC BladeLogic Server Automation (BBSA) is supported as a provider. |
|
--destinationcluster NAME|id:GUID | Name or GUID of the destination cluster. This argument is used to extract destination vCenter details. --destinationcluster and --destinationpodname are required only when you migrate infrastructure across different vCenters. |
|
--destinationpodname NAME | Name of the pod containing the destination cluster. This argument is required only if you specify NAME as a value for the --destinationcluster argument. |
|
--sourcecluster NAME|id:GUID | Name or GUID of the source cluster. This argument is used to extract source vCenter details. | Yes |
One of the following commands: |
| Yes (Only one of the commands below is required. Using more than one is optional.) |
| Name or GUID of the service. |
|
| Filter applicable for service to be migrated. |
|
| Full path of CSV file. |
|
offboard
Use service-offboard from the command line to offboard the specified service.
Use service_offboard in the API to offboard the specified service. This command returns a ServiceOfferingInstance API object with the same attributes and relationships.
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
--servicename | serviceName | Name of the service to offboard. | Yes |
--retainvm | retainVM | Indicate whether to keep the servers for this service enrolled in their provider after the service is offboarded. The value can be True or False. | Yes |
--waitfor |
| Time in seconds to wait for a response from the server, otherwise return running task details. |
|
| gcac | GenericCloudAPIClient instance/user authentication. |
|
onboard
Use service-onboard from the command line to onboard the specified server as a new service.
--tenantname NAME --ownername USERNAME [--virtualcentername NAME] [--virtualguestname NAME]
[--providername NAME] [--server VCENTER=NAME,VM=NAME,RESOURCESET=NAME [VCENTER=NAME,VM=NAME,RESOURCESET=NAME ...]]
Use service_onboard in the API to onboard the specified server as a new service. This command returns a ServiceOfferingInstance API object with the same attributes and relationships.
offeringName=None, virtualCenterName=None, virtualGuestName=None, server=None)
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
--environmentname | environmentName | Name of the environment of the server. To discover the environment name use the environment-list command. | Yes |
--offeringname | offeringName | Name of the offering to associate with the new service. | Yes |
--tenantname | tenantName | Name of the service owner's tenant. | Yes |
--ownername | ownerName | Name of the service owner. | Yes |
--virtualcentername | virtualCenterName | Name of the VMWare vCenter host to onboard. Use this argument if the server argument is not specified. |
|
--virtualguestname | virtualGuestName | Name of the virtual guest or virtual machine to onboard. Use this argument if the server argument is not specified. |
|
--providername | providerName | Name of the provider of the server. |
|
--server | server | Details of the server. Use this argument if the virtualcentername and virtualguestname arguments are not specified. |
|
--waitfor |
| Time in seconds to wait for a response from the server, otherwise return running task details. |
|
| gcac | GenericCloudAPIClient instance/user authentication. |
|
refresh
Use service-refresh from the command line to synchronize the states of all servers in the specified service to make them current with their actual configuration.
Use service_refresh in the API to synchronize the states of all servers in the specified service to make them current with their actual configuration. This command returns a ServiceOfferingInstance API object with the same attributes and relationships.
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
--servicename | service_name | Name of the service to refresh. | Yes |
--waitfor |
| Time in seconds to wait for a response from the server, otherwise return running task details. |
|
| gcac | GenericCloudAPIClient instance/user authentication. |
|
restart
Starting from 4.6.03 and later, use service-restart from the command line to restart all the servers in the specified service.
--servicename NAME
Use service_restart in the API to restart all servers in the specified service. This command returns a ServiceOfferingInstance API object with the same attributes and relationships.
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
--servicename | service_name | Name of the service to restart. | Yes |
--waitfor |
| Time in seconds to wait for a response from the server, otherwise return running task details. |
|
| gcac | GenericCloudAPIClient instance/user authentication. |
|
share
Use service-share from the command line to share a service with multiple users.
--user NAME|id:<GUID> [NAME|id:<GUID> ...]
Use service_share in the API to share a service with multiple users. This command returns a ServiceOfferingInstance API object with the same attributes and relationships.
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
--service | service | Name or GUID of the service to share. | Yes |
--user | user | Names or GUIDs of the users to share the specified service. | Yes |
| gcac | GenericCloudAPIClient instance/user authentication. |
|
start
Use service-start from the command line to start the specified service and all of its servers.
Use service_start in the API to start the specified service and all of its servers. This command returns a ServiceOfferingInstance API object with the same attributes and relationships.
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
--servicename | serviceName | Name of the service to start. | Yes |
--waitfor |
| Time in seconds to wait for a response from the server, otherwise return running task details. |
|
| gcac | GenericCloudAPIClient instance/user authentication. |
|
stop
Use service-stop from the command line to stop the specified service and all of its servers.
Use service_stop in the API to stop the specified service and all of its servers. This command returns a ServiceOfferingInstance API object with the same attributes and relationships.
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
--servicename | serviceName | Name of the service to stop. | Yes |
--waitfor |
| Time in seconds to wait for a response from the server, otherwise return running task details. |
|
|
| ||
| gcac | GenericCloudAPIClient instance/user authentication. |
transfer
Use service-transfer from the command line to transfer ownership of a service to another user.
--touser USERNAME --totenant NAME
Use service_transfer in the API to transfer ownership of a service to another user. This command returns a ServiceOfferingInstance API object with the same attributes and relationships.
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
--servicename | service_name | Name of the service to transfer. | Yes |
--touser | to_user | User name of the new owner. | Yes |
--totenant | to_tenant | Name of the new owner's tenant. | Yes |
--waitfor |
| Time in seconds to wait for a response from the server, otherwise return running task details. |
|
| gcac | GenericCloudAPIClient instance/user authentication. |
|
unshare
Use service-unshare from the command line to remove service sharing of a service for the specified users.
--user NAME|id:<GUID> [NAME|id:<GUID> ...]
Use service_unshare in the API to remove service sharing of a service for the specified users. This command returns a ServiceOfferingInstance API object with the same attributes and relationships.
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
--service | service | Name or GUID of the service. | Yes |
--user | user | Names or GUIDs of the users to remove from sharing the specified service | Yes |
| gcac | GenericCloudAPIClient instance/user authentication. |
|
update-option
Use service-update-option from the command line to update a service with the specified option.
[--param PARAM_NAME=PARAM_VALUE [PARAM_NAME=PARAM_VALUE ...]]
--servicename NAME --actionname NAME --servername NAME|id:<GUID>
--option OPTION_NAME=CHOICE_NAME [OPTION_NAME=CHOICE_NAME ...]
The following code snippet shows a sample service-update-option SDK call:
SP_Requestable_Offering-8 --actionname "Resize Disk"
--servername UPG-SP-1
Use service_update in the API to update a service with the specified option. This command returns a ServiceOfferingInstance API object with the same attributes and relationships. (You can fetch options, option choices, and parameters with the option-list and param-list commands.)
action_name=None options=None, params=None)
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
--servicename | service_name | Name of the service to update. | Yes |
--actionname | action_name | Name of an action to update. | Yes |
--servername | server_name | Name of the server to update. | Yes |
--option | option | Key and value of an option and choice. | Yes |
--param | param | Key and value of a parameter name and value. |
|
--waitfor |
| Time in seconds to wait for a response from the server, otherwise return running task details. |
|
| gcac | GenericCloudAPIClient instance/user authentication. |
|