This topic describes service-related commands in the FC-API component.
Prerequisites
Before you begin, make sure that the following operations are complete:
Create a service
Command syntax:
s cli fc-api createService --region <regionid> --access <accessname> --props <props> --serviceName <serviceName> --description <description> --internetAccess <true or false> --role <ram role> --logConfig <logconfig> --nasConfig <nasconfig> --vpcConfig <vpcconfig> --tracingConfig <tracingconfig>
Parameters:
- --region string: the ID of the region where the resource is deployed.
- --access string: the alias of the key used.
- --props string: the properties of the component. For more information about the props parameter, see YAML syntax.
- --serviceName string: the name of the service.
- --description string: the description of the service.
- --internetAccess string: specifies whether to allow functions in the specified service to access the Internet.
Valid values:
true
andfalse
. - --role string: the RAM role.
- --logConfig string: the log configuration. Function Compute writes function execution logs to the specified Logstore.
- --nasConfig string: The configuration of the Apsara File Storage NAS file system, which allows functions in the specified service to access the NAS file system.
- --vpcConfig string: The Virtual Private Cloud (VPC) configuration, which allows functions in the specified service to access the specified VPC.
- --tracingConfig string: specifies whether to enable Tracing Analysis. Valid values:
Enable
andDisable
.
Example:
s cli fc-api createService --region cn-hangzhou --serviceName mytest --description my description --logConfig my-log-store --tracingConfig Enable
For information about the API operation for creating a service, see CreateService.
Delete a service
Command syntax:
s cli fc-api deleteService --region <regionid> --access <accessname> --props <props> --serviceName <serviceName>
Parameters:
- --region string: the ID of the region where the resource is deployed.
- --access string: the alias of the key used.
- --props string: the properties of the component. For more information about the props parameter, see YAML syntax.
- --serviceName string: the name of the service.
Example:
s cli fc-api deleteService --region cn-hangzhou --access default --serviceName mytest
For information about the API operation for deleting a service, see DeleteService.
Modify a service
Command syntax:
s cli fc-api updateService --region <regionid> --access <accessname> --props <props> --serviceName <serviceName> --description <description> --internetAccess <true or false> --role <ram role> --logConfig <logconfig> --nasConfig <nasconfig> --vpcConfig <vpcconfig> --tracingConfig <tracingconfig>
Parameters:
- --region string: the ID of the region where the resource is deployed.
- --access string: the alias of the key used.
- --props string: the properties of the component. For more information about the props parameter, see YAML syntax.
- --serviceName string: the name of the service.
- --description string: the description of the service.
- --internetAccess string: specifies whether to allow functions in the specified service to access the Internet.
Valid values:
true
andfalse
. - --role string: the RAM role.
- --logConfig string: the log configuration. Function Compute writes function execution logs to the specified Logstore.
- --nasConfig string: The configuration of the Apsara File Storage NAS file system, which allows functions in the specified service to access the NAS file system.
- --vpcConfig string: The Virtual Private Cloud (VPC) configuration, which allows functions in the specified service to access the specified VPC.
- --tracingConfig string: specifies whether to enable Tracing Analysis. Valid values:
Enable
andDisable
.
Example:
s cli fc-api updateService --region cn-hangzhou --serviceName mytest --description my description --logConfig my-log-store --tracingConfig Disable
For information about the API operation for modifying a service, see UpdateService.
Query the information about a service
Command syntax:
s cli fc-api getService --region <regionid> --access <accessname> --props <props> --serviceName <serviceName> --qualifier <version or alias>
Parameters:
- --region string: the ID of the region where the resource is deployed.
- --access string: the alias of the key used.
- --props string: the properties of the component. For more information about the props parameter, see YAML syntax.
- --serviceName string: the name of the service.
- --qualifier string: the alias or version of the service.
Example:
s cli fc-api getService --region cn-hangzhou --access default --serviceName mytest --qualifier LATEST
For information about the API operation for querying the information about a service, see GetService.
Query services
Command syntax:
s cli fc-api listServices --region <regionid> --access <accessname>
Parameters:
- --region string: the ID of the region where the resource is deployed.
- --access string: the alias of the key used.
Example:
s cli fc-api listServices --region cn-hangzhou --access default
For information about the API operation for querying services, see ListServices.