SHOW SERVICE CONTAINERS IN SERVICE¶
列出 服务 的所有实例中的容器。
如果 Snowflake 在执行一个或多个服务容器时遇到问题,此命令可提供单个容器状态的可见性。同样,在滚动升级期间,它会显示在每个容器中运行的服务代码版本。
语法¶
SHOW SERVICE CONTAINERS IN SERVICE <name>
参数¶
name指定要列出其容器的服务的标识符。
不支持带引号的特殊字符名称或区分大小写的名称。
输出¶
命令输出将在以下列中提供服务容器的属性和元数据:
列 |
描述 |
|---|---|
|
在其中创建服务的数据库。 |
|
在其中创建服务的架构。 |
|
服务的名称。 |
|
以下各值之一,表示服务的当前状态:
此列中的值与 DESCRIBE SERVICE 输出中的 |
|
服务实例的 ID(这是从 0 开始的服务实例索引)。当没有正在运行的服务实例时(即服务为 SUSPENDED 或 PENDING),instance_id 和 instance_status 将返回为 NULL。此外,输出中与容器相关的字段也返回为 NULL。 |
|
以下各值表示服务实例的不同当前状态:
请注意,对于由 |
|
容器的名称。如果没有容器在运行(即服务处于 SUSPENDED 或 PENDING 状态),则容器名称将返回为 NULL,并且所有容器特定的字段值也将为 NULL。 |
|
服务容器状态。目前支持的状态值包括以下项:
|
|
关于状态的补充说明。例如,当状态为 FAILED 时,Snowflake 可能会提供其他信息。 |
|
用于创建服务的图像名称。 |
|
代表图像内容的唯一且不可更改的标识符。 |
|
Snowflake 重新启动服务的次数。 |
|
容器开始运行的日期和时间。 |
|
表示容器上次退出时的退出代码。如果服务容器过早退出,Snowflake 会重新启动该容器。退出代码采用整数值的形式表示:
|
|
提供 Snowflake 最近一次重新启动容器的时间戳。NULL 值表示容器从未重新启动过。 |
访问控制要求¶
权限 |
对象 |
备注 |
|---|---|---|
以下任何一项权限:OWNERSHIP 或 MONITOR |
服务 |
The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema. Note that a role granted any privilege on a schema allows that role to resolve the schema. For example, a role granted CREATE privilege on a schema can create objects on that schema without also having USAGE granted on that schema.
有关创建具有指定权限集的自定义角色的说明,请参阅 创建自定义角色。
使用说明¶
该命令不需要正在运行的仓库即可执行。
该命令仅返回当前用户的当前角色已获授至少一项访问权限的对象。
MANAGE GRANTS 访问权限隐式允许其持有者查看账户中的每个对象。默认情况下,只有账户管理员(具有 ACCOUNTADMIN 角色的用户)和安全管理员(具有 SECURITYADMIN 角色的用户)才具有 MANAGE GRANTS 权限。
To post-process the output of this command, you can use the pipe operator (
->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.The output column names for this command are generated in lowercase. If you consume a result set from this command with the pipe operator or the RESULT_SCAN function, use double-quoted identifiers for the column names in the query to ensure that they match the column names in the output that was scanned. For example, if the name of an output column is
type, then specify"type"for the identifier.
该命令 最多 返回指定对象类型的 1 万条记录,由用于执行命令的角色的访问权限决定。即使应用了筛选器,也不会返回任何超过 1 万条限制的记录。
要查看存在超过 1 万条记录的结果,请在 Snowflake Information Schema 中查询相应的视图(如果存在)。
示例¶
下面的示例列出了会话的当前数据库和架构中 echo_service 服务的容器:
SHOW SERVICE CONTAINERS IN SERVICE echo_service;
示例输出:
+---------------+-------------+--------------+----------------+-------------+-----------------+----------------+--------+---------+----------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+---------------+----------------------+----------------+-------------------+
| database_name | schema_name | service_name | service_status | instance_id | instance_status | container_name | status | message | image_name | image_digest | restart_count | start_time | last_exit_code | last_restart_time |
|---------------+-------------+--------------+----------------+-------------+-----------------+----------------+--------+---------+----------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+---------------+----------------------+----------------+-------------------|
| TUTORIAL_DB | DATA_SCHEMA | ECHO_SERVICE | RUNNING | 0 | READY | echo | READY | Running | orgname.acctname.registry-dev.snowflakecomputing.cn/tutorial_db/data_schema/tutorial_repository/my_echo_service_image:latest | sha256:d04a2d7b7d9bd607df994926e3cc672edcb541474e4888a01703e8bb0dd3f173 | 0 | 2025-04-25T06:01:38Z | NULL | NULL |
+---------------+-------------+--------------+----------------+-------------+-----------------+----------------+--------+---------+----------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+---------------+----------------------+----------------+-------------------+