DESCRIBE SERVICE¶
描述 Snowpark Container Services 服务 (包括作业服务)。将此命令用于服务和像作业一样运行的服务。
DESCRIBE 可以缩写为 DESC。
语法¶
DESC[RIBE] SERVICE <name>
参数¶
name指定要描述的服务的标识符。
如果标识符包含空格或特殊字符,则整个字符串必须放在双引号内。放在双引号内的标识符也区分大小写。
有关更多信息,请参阅 标识符要求。
输出¶
命令输出在以下列中提供服务属性和元数据:
列 |
描述 |
|---|---|
|
Snowpark Container Services 服务名称。 |
|
以下各值之一,表示服务的当前状态:
|
|
在其中创建服务的数据库。 |
|
在其中创建服务的架构。 |
|
拥有服务的角色。 |
|
Snowflake 在其中运行服务的计算池的名称。 |
|
服务规范文件。仅当您在执行命令时使用服务的所有者角色时,输出才包含此列。 |
|
Snowflake 为服务分配的 DNS 名称,格式如下:
SELECT SYSTEM$GET_SERVICE_DNS_DOMAIN('mydb.myschema');
请注意以下事项:
DNS 名称支持服务到服务的通信(请参阅 教程 3)。 |
|
服务的当前实例数。 |
|
Snowflake 确定的应运行的服务实例的目标数量。 当 例如:
|
|
指示 Snowflake 必须至少准备好多少个服务实例,才能认为服务已准备好处理请求。 |
|
Snowflake 应该运行的最小服务实例数。 |
|
Snowflake 在需要时可以扩展的最大服务实例数。 |
|
如果为 true,则在调用服务函数或收到传入请求 (ingres) 时,Snowflake 会自动恢复已暂停的服务(请参阅 使用服务)。 |
|
与服务相关联的外部访问集成的列表。有关更多信息,请参阅 配置网络出口。 |
|
服务的创建时间戳。 |
|
服务的上次更新时间戳。 |
|
服务的上次恢复时间戳。 |
|
服务上次暂停的时间戳。 |
|
Snowflake 自动暂停服务之前处于非活动状态的秒数。如果 |
|
服务的相关注释。 |
|
拥有对象的角色类型是 ROLE 或 DATABASE_ROLE。 |
|
当服务容器连接到 Snowflake 以执行查询,但未显式指定要使用的仓库时,Snowflake 默认使用该仓库。 |
|
如果服务是作业服务,则为 |
|
如果作业服务正在异步运行,则为 |
|
代表服务规范内容的唯一且不可变的标识符。 为了观察 |
|
如果 Snowflake 正在升级服务,则为 TRUE。 |
|
管理对象的域(例如,管理服务的笔记本的域)。如果服务不受 Snowflake 实体管理,则为 NULL。 |
|
管理对象的名称(例如,管理服务的笔记本的名称)。如果服务不受 Snowflake 实体管理,则为 NULL。 |
访问控制要求¶
权限 |
对象 |
备注 |
|---|---|---|
Any one of these privileges: OWNERSHIP, USAGE, MONITOR or OPERATE |
服务 |
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.
有关创建具有指定权限集的自定义角色的说明,请参阅 创建自定义角色。
使用说明¶
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.
示例¶
以下示例描述名为 my_service_with_ebs_volume 的服务:
DESCRIBE SERVICE echo_service;
+--------------+---------+---------------+-------------+-----------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+-------------------+------------------+---------------------+---------------+---------------+-------------+------------------------------+-------------------------------+-------------------------------+------------+--------------+-------------------+---------+-----------------+-----------------+--------+--------------+------------------------------------------------------------------+--------------+------------------------+----------------------+
| name | status | database_name | schema_name | owner | compute_pool | spec | dns_name | current_instances | target_instances | min_ready_instances | min_instances | max_instances | auto_resume | external_access_integrations | created_on | updated_on | resumed_on | suspended_on | auto_suspend_secs | comment | owner_role_type | query_warehouse | is_job | is_async_job | spec_digest | is_upgrading | managing_object_domain | managing_object_name |
|--------------+---------+---------------+-------------+-----------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+-------------------+------------------+---------------------+---------------+---------------+-------------+------------------------------+-------------------------------+-------------------------------+------------+--------------+-------------------+---------+-----------------+-----------------+--------+--------------+------------------------------------------------------------------+--------------+------------------------+----------------------|
| ECHO_SERVICE | RUNNING | TUTORIAL_DB | DATA_SCHEMA | TEST_ROLE | TUTORIAL_COMPUTE_POOL | --- | echo-service.k3m6.svc.spcs.internal | 1 | 1 | 1 | 1 | 1 | true | NULL | 2024-11-29 12:12:47.310 -0800 | 2024-11-29 12:12:48.843 -0800 | NULL | NULL | 0 | NULL | ROLE | NULL | false | false | edaf548eb0c2744a87426529b53aac75756d0ea1c0ba5edb3cbb4295a381f2b4 | false | NULL | NULL |
| | | | | | | spec: | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | containers: | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | - name: "echo" | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | image: "sfengineering-prod1-snowservices-test2.registry.snowflakecomputing.cn/tutorial_db/data_schema/tutorial_repository/my_echo_service_image:latest" | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | sha256: "@sha256:d04a2d7b7d9bd607df994926e3cc672edcb541474e4888a01703e8bb0dd3f173" | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | env: | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | SERVER_PORT: "8000" | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | CHARACTER_NAME: "Bob" | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | readinessProbe: | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | port: 8000 | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | path: "/healthcheck" | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | resources: | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | limits: | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | memory: "6Gi" | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | cpu: "1" | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | requests: | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | memory: "0.5Gi" | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | cpu: "0.5" | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | endpoints: | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | - name: "echoendpoint" | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | port: 8000 | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | public: true | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+--------------+---------+---------------+-------------+-----------+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------+-------------------+------------------+---------------------+---------------+---------------+-------------+------------------------------+-------------------------------+-------------------------------+------------+--------------+-------------------+---------+-----------------+-----------------+--------+--------------+------------------------------------------------------------------+--------------+------------------------+----------------------+