SHOW SERVICE INSTANCES IN SERVICE¶

Lists instances of a service.

The command output offers visibility into auto-scaling and rolling upgrades by displaying the status of each individual service instance.

See also:

Snowpark Container Services overview, CREATE SERVICE, SHOW SERVICES, SHOW SERVICE CONTAINERS IN SERVICE

Syntax¶

SHOW SERVICE INSTANCES IN SERVICE <name>
Copy

Parameters¶

name

Specifies the identifier for the service whose instances to list.

Quoted names for special characters or case-sensitive names are not supported.

Output¶

The command output provides properties and metadata of the service instances in the following columns:

Column

Description

database_name

Database in which the service is created.

schema_name

Schema in which the service is created.

service_name

Name of the service.

instance_id

ID of the service instance (this is the index of the service instance starting from 0).

status

One of the following values, which indicates the current status of the service instance:

  • PENDING: The service instance is currently being deployed and is not yet ready to serve requests.

  • READY: All containers in the service instance are ready; the service instance is ready to serve requests.

  • FAILED: At least one container in the service instance has exited with a failure.

  • TERMINATING: The service instance is in the process of termination and will be removed after the process is complete.

  • SUCCEEDED: The service is a job service and all containers in the service instance have terminated successfully.

spec_digest

The unique and immutable identifier that represents the service specification content.

creation_time

The time when Snowflake started creating the service instance.

start_time

The time when Snowflake acknowledged the service instance is running on a node.

Access control requirements¶

A role used to execute this SQL command must have the following privileges at a minimum:

Privilege

Object

Notes

Any one of these privileges: OWNERSHIP or MONITOR

Service

Note that operating on any object in a schema also requires the USAGE privilege on the parent database and 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.

Usage notes¶

  • To post-process the output of this command, you can use the RESULT_SCAN function, which treats the output as a table that can be queried.

Examples¶

The following example lists instances of the echo_service service in the current database and schema for the session:

SHOW SERVICE INSTANCES IN SERVICE echo_service;
Copy

Sample output:

+---------------+-------------+--------------+-------------+--------+------------------------------------------------------------------+----------------------+----------------------+
| database_name | schema_name | service_name | instance_id | status | spec_digest                                                      | creation_time        | start_time           |
|---------------+-------------+--------------+-------------+--------+------------------------------------------------------------------+----------------------+----------------------|
| TUTORIAL_DB   | DATA_SCHEMA | ECHO_SERVICE | 0           | READY  | cb0cbefa3376e75e5926d56535198ce27b3790780beb2c924085eef41dad9adf | 2024-08-08T18:31:38Z | 2024-08-08T18:34:01Z |
+---------------+-------------+--------------+-------------+--------+------------------------------------------------------------------+----------------------+----------------------+