Creates a project.
Usage notes
- Log Service is activated. For more information, see How do I get started with Log Service?
- Log Service CLI is installed and configured. For more information, see Install Log Service CLI and Configure Log Service 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
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
--project_name | String | Yes | project-a | The name of the project. The name must meet the following requirements:
|
--project_des | String | Yes | project created from cli | The description of the project. |
Examples
- Use the default account to create a project named project-a.
- Sample command
aliyunlog log create_project --project_name="project-a" --project_des="project created from cli"
- Sample response
After you run the command, no responses are returned. You can run the
aliyunlog log get_project --project_name="project-a" --format-output=json
command to query the details of the project.
- Sample command
- Use the AccessKey pair of a specified account to create a project named project-b.
- 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"
- Sample response
After you run the command, no responses are returned. You can run the
aliyunlog log get_project --project_name="project-b" --access-id="your_accesskey_id" --access-key="your_accesskey_secret" --format-output=json
command to query the details of the project.
- Sample command
- Use the AccessKey pair of a specified account to create a project named project-c in the China (Shanghai) region.
- 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
After you run the command, no responses are returned. You can run the
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
command to query the details of the project.
- Sample command
References
- If the response that is returned by Log Service contains error information after you call an API operation, the call fails. You can handle errors based on the error codes that are returned when API calls fail. For more information, see Error codes.
- Alibaba Cloud OpenAPI Explorer provides debugging capabilities, SDKs, examples, and related documents. You can use OpenAPI Explorer to debug Log Service API operations without the need to manually encapsulate and sign requests. For more information, visit OpenAPI Explorer.
- For more information about the API operation, see CreateProject.