SHOW SERVICE VOLUMES IN SERVICE¶
Lists the storage volumes for all instances of a service. For each mounted volume, the output includes a line for every container mounting that volume. The output shows only volumes that are mounted to at least one container in the service; volumes specified but unused by any container aren’t included.
语法
参数
name指定要显示已挂载卷列表的服务名称。
不支持带引号的特殊字符名称或区分大小写的名称。
输出
该命令输出以以下列形式提供服务卷的属性:
| Column | Description |
|---|---|
volume_name | Name of the volume |
instance_id | ID of the service instance, which is the index of the service instance starting from 0. |
container_name | Name of the container to which a volume is mounted. |
volume_type | 卷的类型。这可以是以下类型之一:
For a detailed description of volume types, see service specification. |
size | Size of the volume in the format of numberGi. |
iops | Only applicable to block volumes. Shows the configured input/output operations per second for each block volume. |
throughput | Only applicable to block volumes. Shows the configured throughput for each block volume. |
encryption | Only applicable to stage and block volumes. In the case of block volumes, it shows the configured volume encryption type. For a detailed description of block volumes encryption types, see Encryption Support for block storage volumes. In the case of stage volumes, it shows the encryption type of the underlying stage. USAGE or OWNERSHIP privilege on a stage for the caller is required to get the stage encryption information. |
snapshot_used | 仅适用于块卷。显示用于创建卷的快照。仅当您使用的角色已被授予快照的 USAGE 或 OWNERSHIP 权限时,此列才会列出快照。 |
stage_source | Only applicable to stage volumes. Shows the fully qualified name for a stage that is used for the stage volume. |
volume_mounts | Comma-separated list of paths where the volume is mounted in the given container. |
如果字段适用于特定卷类型,对于所有其他卷类型而言,该字段将填充为 NULL。
访问控制要求
A role used to execute this operation must have the following privileges at a minimum:
| 权限 | 对象 | 备注 |
|---|---|---|
| OWNERSHIP 或 MONITOR | 服务 | 无 |
| OWNERSHIP 或 USAGE | 快照 | Without access to a block storage snapshot, Snowflake populates the snapshot_used field with an authorization error, but the command doesn’t fail. |
| OWNERSHIP 或 USAGE | 暂存区 | Without access to a stage, Snowflake populates the encryption field with an authorization error for stage volumes, but the command doesn’t fail. |
Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema.
For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
使用说明
- The command doesn’t require a running warehouse to execute.
- The command only returns objects for which the current user’s current role has been granted at least one access privilege.
- The MANAGE GRANTS access privilege implicitly allows its holder to see every object in the account. By default, only the account administrator (users with the ACCOUNTADMIN role) and security administrator (users with the SECURITYADMIN role) have the MANAGE GRANTS privilege.
-
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.For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows.
When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column
type, specifySELECT "type".You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.
-
The command returns a maximum of ten thousand records for the specified object type, as dictated by the access privileges for the role used to execute the command. Any records above the ten thousand records limit aren’t returned, even with a filter applied.
To view results for which more than ten thousand records exist, query the corresponding view (if one exists) in the Snowflake Information Schema.
示例
The following example lists the volumes for the echo_service service:
示例输出: