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
aliyunlog log create_project --project_name=<value> --project_des=<value> [--access-id=<value>] [--access-key=<value>] [--sts-token=<value>] [--region-endpoint=<value>] [--client-name=<value>] [--jmes-filter=<value>] [--format-output=<value>] [--decode-output=<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:
|
|
--project_des |
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
aliyunlog log create_project --project_name="project-a" --project_des="project created from cli" -
Sample response
No response is returned. To verify, run
aliyunlog log get_project --project_name="project-a" --format-output=json.
-
-
Create a project named project-b with a specified AccessKey pair.
-
Sample command
aliyunlog log create_project --project_name="project-b" --project_des="project created from cli" --access-id="your_accesskey_id" --access-key="your_accesskey_secret" --region-endpoint=your-endpoint -
Sample response
No response is returned. To verify, run aliyunlog log get_project --project_name="project-b" --access-id="your_accesskey_id" --access-key="your_accesskey_secret" --region-endpoint=your-endpoint --format-output=json.
-
-
Create a project named project-c in the China (Shanghai) region with a specified AccessKey pair.
-
Sample command
aliyunlog log create_project --project_name="project-c" --project_des="project created from cli" --access-id="your_accesskey_id" --access-key="your_accesskey_secret" --region-endpoint="cn-shanghai.log.aliyuncs.com" -
Sample response
No response is returned. To verify, run
aliyunlog log get_project --project_name="project-c" --access-id="your_accesskey_id" --access-key="your_accesskey_secret" --region-endpoint="cn-shanghai.log.aliyuncs.com" --format-output=json.
-
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.