All Products
Search
Document Center

Simple Log Service:copy_project

Last Updated:Oct 26, 2023

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
For more information, see Examples.

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.
ParameterTypeRequiredExampleDescription
--from_projectStringYesproject-aThe name of the source project.
--to_projectStringYesproject-bThe name of the destination project.
--to_clientStringNotestThe account to which the destination project belongs. For information about how to configure an account, see Configure Log Service CLI.
--copy_machine_groupBooleanNofalseSpecifies whether to replicate the resources that are related to machine groups. Valid values:
  • true: The resources that are related to machine groups in the source project are replicated to the destination project.
  • false: The resources that are related to machine groups in the source project are not replicated to the destination project.
For information about the global parameters of the Log Service command-line interface (CLI), see Global parameters.

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"
  • Sample responses

    After you run the command, no responses are returned.