3.11. 创建服务
使用 3scale toolbox 在 Developer Portal 中创建、应用、列出、显示或删除服务。
3.11.1. 创建新服务 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
以下命令创建新服务:
3scale service create [options] <remote> <service-name>
在创建服务时使用以下选项:
Options
-a --authentication-mode=<value> Specify authentication mode of
the service:
- '1' for API key
- '2' for App Id/App Key
- 'oauth' for OAuth mode
- 'oidc' for OpenID Connect
-d --deployment-mode=<value> Specify the deployment mode of
the service
--description=<value> Specify the description of the
service
-o --output=<value> Output format on stdout:
one of json|yaml
-s --system-name=<value> Specify the system-name of the
service
--support-email=<value> Specify the support email of the
service
Options for service
-c --config-file=<value> 3scale toolbox configuration file:
defaults to $HOME/.3scalerc.yaml
-h --help Print help for this command
-k --insecure Proceed and operate even for
server connections otherwise
considered insecure
-v --version Print the version of this command
--verbose Verbose mode
3.11.2. 创建或更新服务 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
如果新服务不存在,请使用以下内容创建新服务,或更新现有服务:
注意
service-id_or_system-name位置参数是服务引用。-
它可以是服务
ID,也可以是 servicesystem_name。 - toolbox 将自动找出这一点。
-
它可以是服务
-
此命令是
幂等的。
以下命令更新服务:
3scale service apply <remote> <service-id_or_system-name>
在更新服务时使用以下选项:
Options
-a --authentication-mode=<value> Specify authentication mode of
the service:
- '1' for API key
- '2' for App Id/App Key
- 'oauth' for OAuth mode
- 'oidc' for OpenID Connect
-d --deployment-mode=<value> Specify the deployment mode of
the service
--description=<value> Specify the description of the
service
-n --name=<value> Specify the name of the metric
--support-email=<value> Specify the support email of the
service
-o --output=<value> Output format on stdout:
one of json|yaml
Options for services
-c --config-file=<value> 3scale toolbox configuration file:
defaults to $HOME/.3scalerc.yaml
-h --help Print help for this command
-k --insecure Proceed and operate even for
server connections otherwise
considered insecure
-v --version Print the version of this command
--verbose Verbose mode
3.11.3. 列出服务 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
以下命令列出服务:
3scale service list <remote>
在列出服务时使用以下选项:
Options
-o --output=<value> Output format on stdout:
one of json|yaml
Options for services
-c --config-file=<value> 3scale toolbox configuration file:
defaults to $HOME/.3scalerc.yaml
-h --help Print help for this command
-k --insecure Proceed and operate even for server
connections otherwise considered insecure
-v --version Print the version of this command
--verbose Verbose mode
3.11.4. 显示服务 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
以下命令显示服务:
3scale service show <remote> <service-id_or_system-name>
在显示服务时使用以下选项:
Options
-o --output=<value> Output format on stdout:
one of json|yaml
Options for services
-c --config-file=<value> 3scale toolbox configuration file:
defaults to $HOME/.3scalerc.yaml
-h --help Print help for this command
-k --insecure Proceed and operate even for server
connections otherwise considered insecure
-v --version Print the version of this command
--verbose Verbose mode
3.11.5. 删除服务 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
以下命令删除服务:
3scale service delete <remote> <service-id_or_system-name>
在删除服务时使用以下选项:
Options for services
-c --config-file=<value> 3scale toolbox configuration file:
defaults to $HOME/.3scalerc.yaml
-h --help Print help for this command
-k --insecure Proceed and operate even for server
connections otherwise considered insecure
-v --version Print the version of this command
--verbose Verbose mode