Creates a Simple Log Service project by using the SLS CLI.
Prerequisites
Before you run this command, make sure that the following requirements are met:
-
Log Service is activated. For more information, see How do I get started with Simple Log Service?
-
Log Service CLI is installed and configured. For more information, see Install the CLI and Configure SLS CLI.
Command syntax
aliyun sls create-project --project-name=<value> --description=<value> [--access-key-id=<value>] [--access-key-secret=<value>] [--sts-token=<value>] [--region=<value>]
Command parameters
The following table describes the parameters specific to the create_project command.
|
Parameter |
Type |
Required |
Example |
Description |
|
--project-name |
String |
Yes |
project-a |
The project name. Naming rules:
|
|
--description |
String |
Yes |
project created from cli |
The project description. |
For information about global parameters, see Global parameters.
Examples
-
Create a project named project-a with the default account.
-
Sample command
aliyun sls create-project --project-name="project-a" --description="project created from cli" -
Sample response
No response is returned. To verify, run
aliyun sls get-project --project="project-a".
-
-
Create a project named project-b with a specified AccessKey pair.
-
Sample command
aliyun sls create-project --project-name="project-b" --description="project created from cli" --access-key-id="your_accesskey_id" --access-key-secret="your_accesskey_secret" --region=<your-region> -
Sample response
No response is returned. To verify, run aliyun sls get-project --project="project-b" --access-key-id="your_accesskey_id" --access-key-secret="your_accesskey_secret" --region=<your-region>.
-
-
Create a project named project-c in the China (Shanghai) region with a specified AccessKey pair.
-
Sample command
aliyun sls create-project --project-name="project-c" --description="project created from cli" --access-key-id="your_accesskey_id" --access-key-secret="your_accesskey_secret" --region="cn-shanghai" -
Sample response
No response is returned. To verify, run
aliyun sls get-project --project="project-c" --access-key-id="your_accesskey_id" --access-key-secret="your_accesskey_secret" --region="cn-shanghai".
-
References
In addition to its native SDK, SLS also supports the common Alibaba Cloud SDKs. For more information, see Simple Log Service_SDK Center_Alibaba Cloud OpenAPI Explorer.
-
For the corresponding API operation, see CreateProject.