Replicates resources from a source project to a destination project.
You can run the copy_project command to replicate the following Log Service resources
from a project to another project:
- Logstores
- Indexes
- Logtail configurations
- Machine groups
- Mappings between machine groups and Logtail configurations
Request syntax
aliyunlog log copy_project --from_project=<value> --to_project=<value> [--to_client=<value>] [--copy_machine_group=<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>]
Request parameters
The following table describes the required and specific parameters of the copy_project
command.
For information about the global parameters of the Log Service command-line interface
(CLI), see Global parameters.
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
--from_project | String | Yes | project-a | The name of the source project. |
--to_project | String | Yes | project-b | The name of the destination project. |
--to_client | String | No | test | The account to which the destination project belongs. For information about how to configure an account, see Configure Log Service CLI. |
--copy_machine_group | Boolean | No | false | Specifies whether to replicate the resources that are related to machine groups. Valid
values:
|
Examples
- Sample requests
- Use the default account to replicate resources from project-a to project-b. The two
projects reside in the same region.
aliyunlog log copy_project --from_project="project-a" --to_project="project-b"
- Replicate resources from project-a to project-b. project-a belongs to the default
account and project-b belongs to an account named test. The two projects reside in
different regions.
aliyunlog log copy_project --from_project="project-a" --to_project="project-b" --client-name="test"
- Replicate resources from project-a to project-b. project-a belongs to the default
account and project-b belongs to an account named test. The Logtail configurations
and machine groups in project-a are also replicated to project-b. The two projects
reside in different regions.
aliyunlog log copy_project --from_project="project-a" --to_project="project-b" --copy_machine_group=true --client-name="test"
- Use the default account to replicate resources from project-a to project-b. The two
projects reside in the same region.
- Sample responses
After you run the command, no responses are returned.