sfctl containersfctl container

在群集节点上运行与容器相关的命令。Run container related commands on a cluster node.

命令Commands

CommandCommand 说明Description
invoke-apiinvoke-api 在 Service Fabric 节点上部署的容器上调用给定代码包的容器 API。Invoke container API on a container deployed on a Service Fabric node for the given code package.
日志logs 获取 Service Fabric 节点上部署的容器的容器日志。Gets the container logs for container deployed on a Service Fabric node.

sfctl container invoke-apisfctl container invoke-api

在 Service Fabric 节点上部署的容器上调用给定代码包的容器 API。Invoke container API on a container deployed on a Service Fabric node for the given code package.

参数Arguments

参数Argument 说明Description
--application-id [必需]--application-id [Required] 应用程序的标识。The identity of the application.

这通常是不带“fabric:”URI 方案的应用程序全名。This is typically the full name of the application without the 'fabric:' URI scheme. 从版本 6.0 开始,分层名称以“~”字符隔开。Starting from version 6.0, hierarchical names are delimited with the "~" character. 例如,如果应用程序名称为“fabric:/myapp/app1”,则 6.0 及更高版本中的应用程序标识为“myapp~app1”,在以前的版本中为“myapp/app1”。For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions.
--code-package-instance-id [必需]--code-package-instance-id [Required] 唯一标识 Service Fabric 节点上部署的代码包实例的 ID。ID that uniquely identifies a code package instance deployed on a service fabric node.

可以使用“service code-package-list”检索。Can be retrieved by 'service code-package-list'.
--code-package-name [必需]--code-package-name [Required] 在 Service Fabric 群集中注册为应用程序类型一部分的服务清单中指定的代码包的名称。The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster.
--container-api-uri-path [必需]--container-api-uri-path [Required] 容器 REST API URI 路径,使用“{ID}”代替容器名称/ID。Container REST API URI path, use '{ID}' in place of container name/id.
--node-name [必需]--node-name [Required] 节点的名称。The name of the node.
--service-manifest-name [必需]--service-manifest-name [Required] 在 Service Fabric 群集中注册为应用程序类型一部分的服务清单的名称。The name of a service manifest registered as part of an application type in a Service Fabric cluster.
--container-api-body--container-api-body 容器 REST API 的 HTTP 请求正文。HTTP request body for container REST API.
--container-api-content-type--container-api-content-type 容器 REST API 的内容类型,默认为“application/json”。Content type for container REST API, defaults to 'application/json'.
--container-api-http-verb--container-api-http-verb 容器 REST API 的 HTTP 谓词,默认为 GET。HTTP verb for container REST API, defaults to GET.
--timeout -t--timeout -t 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

sfctl container logssfctl container logs

获取 Service Fabric 节点上部署的容器的容器日志。Gets the container logs for container deployed on a Service Fabric node.

参数Arguments

参数Argument 说明Description
--application-id [必需]--application-id [Required] 应用程序的标识。The identity of the application.

这通常是不带“fabric:”URI 方案的应用程序全名。This is typically the full name of the application without the 'fabric:' URI scheme. 从版本 6.0 开始,分层名称以“~”字符隔开。Starting from version 6.0, hierarchical names are delimited with the "~" character. 例如,如果应用程序名称为“fabric:/myapp/app1”,则 6.0 及更高版本中的应用程序标识为“myapp~app1”,在以前的版本中为“myapp/app1”。For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions.
--code-package-instance-id [必需]--code-package-instance-id [Required] 代码包实例 ID,可以通过“service code-package-list”来检索。Code package instance ID, which can be retrieved by 'service code-package-list'.
--code-package-name [必需]--code-package-name [Required] 在 Service Fabric 群集中注册为应用程序类型一部分的服务清单中指定的代码包的名称。The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster.
--node-name [必需]--node-name [Required] 节点的名称。The name of the node.
--service-manifest-name [必需]--service-manifest-name [Required] 在 Service Fabric 群集中注册为应用程序类型一部分的服务清单的名称。The name of a service manifest registered as part of an application type in a Service Fabric cluster.
--tail--tail 要从日志末尾显示的行数。Number of lines to show from the end of the logs. 默认值为 100。Default is 100. “all”表示显示完整日志。'all' to show the complete logs.
--timeout -t--timeout -t 默认值: 60。Default: 60.

全局参数Global Arguments

参数Argument 说明Description
--debug--debug 提高日志记录详细程度以显示所有调试日志。Increase logging verbosity to show all debug logs.
--help -h--help -h 显示此帮助消息并退出。Show this help message and exit.
--output -o--output -o 输出格式。Output format. 允许的值: json、jsonc、table、tsv。Allowed values: json, jsonc, table, tsv. 默认值: json。Default: json.
--query--query JMESPath 查询字符串。JMESPath query string. 有关详细信息和示例,请参阅 http://jmespath.org/。See http://jmespath.org/ for more information and examples.
--verbose--verbose 提高日志记录详细程度。Increase logging verbosity. 使用 --debug 获取完整的调试日志。Use --debug for full debug logs.

后续步骤Next steps