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.
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.)
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 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. 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 | 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.
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.
obj = service_delete(gcac, serviceName=None, decommissiondate=None)
obj.guid # returns the GUID
obj.name # returns the name
...
Command-line argument | API parameter | Description | Required? |
---|---|---|---|
|
| 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) |
--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.
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.
obj = service_list(gcac, filters=None)
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.
Note
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.
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 argument | Description | Required? |
---|---|---|
| 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 | |
| Name of the pod containing the source cluster. This argument is required only if you specify | |
| Used for report generation. By default, it is true. | |
| Name or GUID of the provider. Note: Currently, only BMC BladeLogic Server Automation (BBSA) is supported as a provider. | |
| Name or GUID of the destination cluster. This argument is used to extract destination vCenter details.
| |
| Name of the pod containing the destination cluster. This argument is required only if you specify NAME as a value for the | |
--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.
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.
obj = service_offboard(gcac, serviceName=None, retainVM=None)
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 | 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.
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.
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 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.
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.
obj = service_refresh(gcac, service_name=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 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.
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.
obj = service_restart(gcac, service_name=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 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.
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.
obj = service_share(gcac, service=None, user_list=None)
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.
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.
obj = service_start(gcac, serviceName=None)
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.
clm service-stop [-h] [--waitfor TIME_OUT_SECONDS] --servicename NAME
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 = service_stop(gcac, serviceName=None)
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.
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.
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 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.
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.
obj = service_unshare(gcac, service=None, user_list=None)
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.
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:
clm service-update-option --verbose --servicename
SP_Requestable_Offering-8 --actionname "Resize Disk"
--servername UPG-SP-1
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.
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 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. |
Comments
Log in or register to comment.