Unsupported content

   

This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

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.

Command-line syntax
clm service-create [-h] [--waitfor TIME_OUT_SECONDS] [--onbehalfuser USERNAME] 
[--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.)

API syntax
obj = service_create(gcac, offeringName=None, serviceName=None, quantity=1, userName=None, password=None, 
hostNamePrefix=None, tenantName=None, options=None, params=None, decommissiondate=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--offeringnameofferingNameName of the offering to use for the new service.Yes
--servicenameserviceNameName of the new service.Yes
--serverusernameuserNameUser name with administrator access on the servers to configure.Yes
--serverpasswordpassword

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.

  • For AWS, VMware, and Azure providers: If the password is in plain text, add the prefix "plaintext:" to your password. For example, "plaintext:myclmpassword"
  • For vCloud Director (vCD) and BMC Database Automation providers: Specify an encrypted password
  • For Public Platform as a Service (PaaS) providers: Specify only the password; do not add a prefix. For example, "myclmpassword"
Yes
--serverhostprefixhostNamePrefix

Hostname prefix to use for all servers created for this service.

Note

Although this parameter is required, for the OpenStack provider, you can skip specifying it because the server name is used as is from the servicename for this parameter.

Yes
--tenantnametenantNameName of the tenant for the new service.Yes
--optionoptionKey and value of an option and choice. 
--paramparamKey and value of a parameter name and value. 
--decommissiondatedecommissiondateDate in YYYY-MM-DD or Nd format, where Nd indicates how many days after the present day. 
--quantityquantityNumber 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.
 

 
 gcacGenericCloudAPIClient instance/user authentication. 

delete

Use service-delete from the command line to delete the specified service.

Command-line syntax
clm service-delete [-h] [--waitfor TIME_OUT_SECONDS] [--decommissiondate YYYY-MM-DD|Nd] (--servicename NAME | 
--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.

Note

For the OpenStack provider, this action returns a void object instead of a cloudClass object.

API syntax
obj = service_delete(gcac, serviceName=None, decommissiondate=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?

--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 sample file.Yes (for bulk update)
--decommissiondatedecommissiondateDate 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.

 
 gcacGenericCloudAPIClient instance/user authentication. 

list

Use service-list from the command line to list available services.

Command-line syntax
clm service-list [-h] [-l] [-u] [-n] [-s] [-k FIELD_NAME [FIELD_NAME ...]] [--filter FIELD_NAME=VALUE 
[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.

API syntax
obj = service_list(gcac, filters=None)

obj[n].guid returns the GUID
obj[n].name returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
-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. 
--filterfiltersList the output that matches the specified filters. 
 gcacGenericCloudAPIClient 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.

Note

This command detects only infrastructure that is designated to be migrated and updates internal data structure accordingly. Before calling this command, migrate the actual infrastructure using native tools specific to vendors (for example, VMWare).
Command-line syntax
clm service-migrate [-h] [--waitfor TIME_OUT_SECONDS] [--sourcepodname NAME] 
[--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.

Command-line syntax
obj=service_migrate(gcac, provider=None, dryrun=None,sourcepodname=None,sourcecluster=None, destinationpodname=None,destinationcluster= None,servicefilter=None, servicename=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentDescriptionRequired?

-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:GUIDName 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.)
  • --servicename NAME|id:GUID
Name or GUID of the service. 
  • --servicefilter ATTRIBUTENAME=ATTRIBUTEVALUE
Filter applicable for service to be migrated. 
  • --file CSV FORMAT FILE
Full path of CSV file. 

offboard

Use service-offboard from the command line to offboard the specified service.

Command-line syntax
clm service-offboard [-h] [--waitfor TIME_OUT_SECONDS] --servicename NAME --retainvm {True,False}

Use service_offboard in the API to offboard the specified service. This command returns a ServiceOfferingInstance API object with the same attributes and relationships.

API syntax
obj = service_offboard(gcac, serviceName=None, retainVM=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--servicenameserviceNameName of the service to offboard.Yes
--retainvmretainVM

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.

 
 gcacGenericCloudAPIClient instance/user authentication. 

onboard

Use service-onboard from the command line to onboard the specified server as a new service.

clm service-onboard [-h] [--waitfor TIME_OUT_SECONDS] --environmentname NAME --offeringname NAME 
--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.

API syntax
obj = service_onboard(gcac, tenantName=None, ownerName=None, providerName=None, environmentName=None, 
offeringName=None, virtualCenterName=None, virtualGuestName=None, server=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--environmentnameenvironmentNameName of the environment of the server. To discover the environment name use the environment-list command.Yes
--offeringnameofferingNameName of the offering to associate with the new service.Yes
--tenantnametenantNameName of the service owner's tenant.Yes
--ownernameownerNameName of the service owner.Yes
--virtualcenternamevirtualCenterNameName of the VMWare vCenter host to onboard. Use this argument if the server argument is not specified. 
--virtualguestnamevirtualGuestNameName of the virtual guest or virtual machine to onboard. Use this argument if the server argument is not specified. 
--providernameproviderNameName of the provider of the server. 
--serverserverDetails 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.

 
 gcacGenericCloudAPIClient 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.

Command-line syntax
clm service-refresh [-h] [--waitfor TIME_OUT_SECONDS] --servicename NAME

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.

API syntax
obj = service_refresh(gcac, service_name=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--servicenameservice_nameName of the service to refresh.Yes
--waitfor 

Time in seconds to wait for a response from the server, otherwise return running task details.

 
 gcacGenericCloudAPIClient 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.

Command-line syntax
clm service-restart [-h] [--waitfor TIME_OUT_SECONDS] 
--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.

API syntax
obj = service_restart(gcac, service_name=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--servicenameservice_nameName of the service to restart.Yes
--waitfor 

Time in seconds to wait for a response from the server, otherwise return running task details.

 
 gcacGenericCloudAPIClient instance/user authentication. 

share

Use service-share from the command line to share a service with multiple users.

Command-line syntax
clm service-share [-h] [--waitfor TIME_OUT_SECONDS] --service NAME|id:<GUID> 
--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.

API syntax
obj = service_share(gcac, service=None, user_list=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--serviceserviceName or GUID of the service to share.Yes
--useruserNames or GUIDs of the users to share the specified service.Yes
 gcacGenericCloudAPIClient instance/user authentication. 

start

Use service-start from the command line to start the specified service and all of its servers.

Command-line syntax
clm service-start [-h] [--waitfor TIME_OUT_SECONDS] --servicename NAME

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.

API syntax
obj = service_start(gcac, serviceName=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--servicenameserviceNameName of the service to start.Yes
--waitfor 

Time in seconds to wait for a response from the server, otherwise return running task details.

 
 gcacGenericCloudAPIClient instance/user authentication. 

stop

Use service-stop from the command line to stop the specified service and all of its servers.

Command-line syntax
clm service-stop [-h] [--waitfor TIME_OUT_SECONDS] --servicename NAME
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.

API syntax
obj = service_stop(gcac, serviceName=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--servicenameserviceNameName of the service to stop.Yes
--waitfor 

Time in seconds to wait for a response from the server, otherwise return running task details.

 

 

 
 gcacGenericCloudAPIClient instance/user authentication.

transfer

Use service-transfer from the command line to transfer ownership of a service to another user.

Command-line syntax
clm service-transfer [-h] [--waitfor TIME_OUT_SECONDS] --servicename NAME 
--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.

API syntax
obj = service_transfer(gcac, service_name=None, to_user=None, to_tenant=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--servicenameservice_nameName of the service to transfer.Yes
--touserto_userUser name of the new owner.Yes
--totenantto_tenantName of the new owner's tenant.Yes
--waitfor 

Time in seconds to wait for a response from the server, otherwise return running task details.

 
 gcacGenericCloudAPIClient instance/user authentication. 

unshare

Use service-unshare from the command line to remove service sharing of a service for the specified users.

Command-line syntax
clm service-unshare [-h] [--waitfor TIME_OUT_SECONDS] --service NAME|id:<GUID> 
--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.

API syntax
obj = service_unshare(gcac, service=None, user_list=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--serviceserviceName or GUID of the service.Yes
--useruserNames or GUIDs of the users to remove from sharing the specified serviceYes
 gcacGenericCloudAPIClient instance/user authentication. 

update-option

Use service-update-option from the command line to update a service with the specified option.

Command-line syntax
clm service-update-option [-h] [--waitfor TIME_OUT_SECONDS] 
[--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:

Command-line example
clm service-update-option --verbose --servicename 
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.)

Note

For the OpenStack provider, this action returns a void object instead of a cloudClass object.

API syntax
obj = service_update(gcac, service_name=None, server_name=None, 
action_name=None options=None, params=None)

obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argumentAPI parameterDescriptionRequired?
--servicenameservice_nameName of the service to update.Yes
--actionnameaction_nameName of an action to update.Yes
--servernameserver_nameName of the server to update.Yes
--optionoptionKey and value of an option and choice.Yes
--paramparamKey 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.

 
 gcacGenericCloudAPIClient instance/user authentication. 
 

This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

Comments