本文介绍FC-API组件中自定义域名相关的命令。
前提条件
您已完成以下操作:
创建自定义域名
命令格式:
s cli fc-api createCustomDomain --region <regionid> --access <accessname> --props <props> --domainName <domainName> --protocol <protocoltype> --certConfig <certconfig> --routeConfig <routeconfig>
参数说明:
- --region string:指定部署资源的地域。
- --access string:指定使用的密钥别名。
- --props string:配置组件参数。关于props的参数信息,请参见YAML规范。
- --domainName string:指定自定义域名名称。
- --protocol string:指定自定义域名的协议类型,支持
HTTP
和HTTP,HTTPS
协议。 - --certConfig string:配置HTTPS证书的信息。
- --routeConfig string:配置路由表。自定义域名访问时的PATH到Function的映射。
执行示例:
s cli fc-api createCustomDomain --region cn-hangzhou --access default --domainName 41055826-188077086902****.example.com
关于创建自定义域名的API接口的详细信息,请参见CreateCustomDomain。
删除自定义域名
命令格式:
s cli fc-api deleteCustomDomain --region <regionid> --access <accessname> --props <props> --domainName <domainName>
参数说明:
- --region string:指定部署资源的地域。
- --access string:指定使用的密钥别名。
- --props string:配置组件参数。关于props的参数信息,请参见YAML规范。
- --domainName string:指定自定义域名名称。
执行示例:
s cli fc-api deleteCustomDomain --region cn-hangzhou --domainName 41055826-188077086902****.example.com
关于删除自定义域名的API接口的详细信息,请参见DeleteCustomDomain。
更新自定义域名
命令格式:
s cli fc-api updateCustomDomain --region <regionid> --access <accessname> --props <props> --domainName <domainName> --protocol <protocol> --certConfig <certconfig> --routeConfig <routeconfig>
参数说明:
- --region string:指定部署资源的地域。
- --access string:指定使用的密钥别名。
- --props string:配置组件参数。关于props的参数信息,请参见YAML规范。
- --domainName string:指定自定义域名名称。
- --protocol string:指定自定义域名的协议类型,支持
HTTP
和HTTP,HTTPS
协议。 - --certConfig string:配置HTTPS证书的信息。
- --routeConfig string:配置路由表。自定义域名访问时的PATH到Function的映射。
执行示例:
s cli fc-api updateCustomDomain --domainName 41055826-188077086902****.example.com --routeConfig {"routes": [{"path": "/login/*","serviceName": "mytest","functionName": mytest","qualifier":test,"methods":GET } ]}
关于更新自定义域名的API接口的详细信息,请参见UpdateCustomDomain。
获取自定义域名配置信息
命令格式:
s cli fc-api getCustomDomain --region <regionid> --access <accessname> --props <props> --domainName <domainName>
参数说明:
- --region string:指定部署资源的地域。
- --access string:指定使用的密钥别名。
- --props string:配置组件参数。关于props的参数信息,请参见YAML规范。
- --domainName string:指定自定义域名名称。
执行示例:
s cli fc-api getCustomDomain --region cn-hangzhou --domainName 41055826-188077086902****.example.com
关于获取自定义域名配置信息的API接口的详细信息,请参见GetCustomDomain。
查询自定义域名列表
命令格式:
s cli fc-api listCustomDomains --region <regionid> --access <accessname> --props <props> --limit <limit number> --prefix <return prefix> --nextToken <nextresult> --startkey <startkey>
参数说明:
- --region string:指定部署资源的地域。
- --access string:指定使用的密钥别名。
- --props string:配置组件参数。关于props的参数信息,请参见YAML规范。
- --limit string:设置限定此次返回资源的数量。
- --nextToken string:设置用来返回更多结果的令牌。第一次查询时不需要提供这个参数,后续查询的Token从返回结果中获取。
- --prefix string:设置返回资源的名称前缀。
- --startKey string:设定结果从startKey之后(包括startKey)按字母排序的第一个开始返回。
执行示例:
s cli fc-api listCustomDomains --region cn-hangzhou --limit 20
关于查询自定义域名列表的API接口的详细信息,请参见ListCustomDomains。