List shards

Updated at:

Run CLI commands to query shard information for a specified Logstore.

Prerequisites

Before you begin, make sure that:

  • Simple Log Service (SLS) is activated. For more information, see Get started with SLS.

  • The SLS CLI is installed and configured. For more information, see Install and configure the new SLS CLI.

  • An SLS project and Logstore are created. For more information, see Create a project and Create a Logstore.

Command syntax

aliyun sls list-shards --project=<value> --logstore=<value>

Parameters

The following table describes the required and command-specific parameters.

ParameterTypeRequiredExampleDescription
--projectStringYesaliyun-test-projectThe name of the project.
--logstoreStringYesaliyun-test-logstoreThe name of the Logstore.

For information about global parameters, see Global parameters.

Example

aliyun sls list-shards --project=aliyun-test-project --logstore=aliyun-test-logstore
  • Sample response

[
  {
    "shardID": 0,
    "status": "readwrite",
    "inclusiveBeginKey": "00000000000000000000000000000000",
    "exclusiveEndKey": "7fffffffffffffffffffffffffffffff",
    "createTime": 1709078400
  },
  {
    "shardID": 1,
    "status": "readwrite",
    "inclusiveBeginKey": "7fffffffffffffffffffffffffffffff",
    "exclusiveEndKey": "ffffffffffffffffffffffffffffffff",
    "createTime": 1709078400
  }
]