List projects
Run a CLI command to list all projects in a specified region.
Prerequisites
Before you run the CLI command, make sure that the following requirements are met:
SLS is activated. For more information, see Getting started with Simple Log Service.
The SLS CLI is installed and configured. For more information, see Install the CLI and Configure the CLI.
Command syntax
aliyun sls list-project [--project-name=<value>] [--offset=<value>] [--size=<value>]
Parameters
The following table describes the required and command-specific parameters.
Parameter |
Type |
Required |
Example |
Description |
|
String |
No |
my-project |
The project name used for fuzzy filtering. |
|
Integer |
No |
0 |
The pagination offset. Default value: 0. |
|
Integer |
No |
100 |
The number of entries per page. Default value: 100. Maximum value: 500. |
For information about global parameters, see Global parameters.
Examples
List all projects
Example command
List all projects in the default region.
aliyun sls list-projectSample response
{ "count": 2, "projects": [ { "createTime": "1614075057", "dataRedundancyType": "LRS", "description": "", "lastModifyTime": "1614075057", "owner": "", "projectName": "datalab-174649******745-cn-hangzhou", "region": "cn-hangzhou", "resourceGroupId": "", "status": "Disable" }, { "createTime": "1621930740", "dataRedundancyType": "LRS", "description": "create project from cli", "lastModifyTime": "1621930740", "owner": "", "projectName": "project-ba", "region": "cn-hangzhou", "resourceGroupId": "", "status": "Disable" } ], "total": 2 }
Fuzzy filter by project name
Example command
List projects whose names contain "aliyun".
aliyun sls list-project --project-name="aliyun"Sample response
{ "count": 1, "projects": [ { "createTime": "1621930740", "dataRedundancyType": "LRS", "description": "Test project", "lastModifyTime": "1621930740", "owner": "", "projectName": "aliyun-test-project", "region": "cn-hangzhou", "resourceGroupId": "", "status": "Normal" } ], "total": 1 }