This topic describes custom domain name-related commands in the FC-API component.

Prerequisites

Before you begin, make sure that the following operations are complete:

Create a custom domain name

Command syntax:
s cli fc-api createCustomDomain --region <regionid> --access <accessname> --props <props> --domainName <domainName> --protocol <protocoltype> --certConfig <certconfig> --routeConfig <routeconfig>
Parameters:
  • --region string: 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.
  • --domainName string: the custom domain name.
  • --protocol string: the protocol types supported by the custom domain name. Valid values: HTTP and HTTP,HTTPS.
  • --certConfig string: the configuration of the certificate that is used for HTTPS.
  • --routeConfig string: the configuration of the route table. The routing table maps paths to the function when the function is called by using the custom domain name.
Example:
s cli fc-api createCustomDomain --region cn-hangzhou --access default --domainName 41055826-188077086902****.example.com

For information about the API operation for creating a custom domain name, see CreateCustomDomain.

Delete a custom domain name

Command syntax:
s cli fc-api deleteCustomDomain --region <regionid> --access <accessname> --props <props> --domainName <domainName>
Parameters:
  • --region string: 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.
  • --domainName string: the custom domain name.
Example:
s cli fc-api deleteCustomDomain --region cn-hangzhou --domainName 41055826-188077086902****.example.com

For information about the API operation for deleting a custom domain name, see DeleteCustomDomain.

Modify a custom domain name

Command syntax:
s cli fc-api updateCustomDomain --region <regionid> --access <accessname> --props <props> --domainName <domainName> --protocol <protocol> --certConfig <certconfig> --routeConfig <routeconfig>
Parameters:
  • --region string: 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.
  • --domainName string: the custom domain name.
  • --protocol string: the protocol types supported by the custom domain name. Valid values: HTTP and HTTP,HTTPS.
  • --certConfig string: the configuration of the certificate that is used for HTTPS.
  • --routeConfig string: the configuration of the route table. The routing table maps paths to the function when the function is called by using the custom domain name.
Example:
s cli fc-api updateCustomDomain --domainName 41055826-188077086902****.example.com --routeConfig {"routes": [{"path": "/login/*","serviceName": "mytest","functionName": mytest","qualifier":test,"methods":GET } ]}

For information about the API operation for modifying a custom domain name, see UpdateCustomDomain.

Query the information about a custom domain name

Command syntax:
s cli fc-api getCustomDomain --region <regionid> --access <accessname> --props <props> --domainName <domainName>
Parameters:
  • --region string: 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.
  • --domainName string: the custom domain name.
Example:
s cli fc-api getCustomDomain --region cn-hangzhou --domainName 41055826-188077086902****.example.com

For information about the API operation for querying the information about a custom domain name, see GetCustomDomain.

Query custom domain names

Command syntax:
s cli fc-api listCustomDomains --region <regionid> --access <accessname> --props <props> --limit <limit number> --prefix <return prefix> --nextToken <nextresult> --startkey <startkey>
Parameters:
  • --region string: 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.
  • --limit string: the maximum number of resources to be returned.
  • --nextToken string: the token used to return more results. Include this parameter in subsequent calls to obtain more results. You do not need to provide this parameter in the first call.
  • --prefix string: the prefix that the names of returned resources must contain.
  • --startKey string: the start position of the result list. Results are in alphabetical order, and the results that follow startKey (inclusive) are listed.
Example:
s cli fc-api listCustomDomains --region cn-hangzhou --limit 20

For information about the API operation for querying custom domain names, see ListCustomDomains.