Help Center/ Log Tank Service/ More Documents/ API Reference (Ally Region)/ APIs/ Log Ingestion/ Creating a Cross-Account Log Ingestion Configuration
Updated on 2026-01-05 GMT+08:00

Creating a Cross-Account Log Ingestion Configuration

Function

This API is used to create a cross-account log ingestion configuration.

URI

POST /v2.0/{project_id}/lts/createAgencyAccess

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain a project ID, see Obtaining the Project ID, Account ID, Log Group ID, and Log Stream ID.

Minimum: 1

Maximum: 64

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM. For details about how to obtain a user token, see Obtaining a User Token.

Minimum: 1

Maximum: 10000

Content-Type

Yes

String

Set this parameter to application/json;charset=utf8.

Minimum: 30

Maximum: 30

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

preview_agency_list

Yes

Array of PreviewAgencyLogAccessReqBody objects

Preview of the proxy list.

Table 4 PreviewAgencyLogAccessReqBody

Parameter

Mandatory

Type

Description

agency_access_type

Yes

String

Ingestion configuration type. For cross-account log ingestion, the value is AGENCYACCESS.

agency_log_access

Yes

String

Cross-account log ingestion configuration name, which must be unique.

  • Use only letters, digits, hyphens (-), underscores (_), and periods (.). Do not start with a period or underscore or end with a period.

  • Enter up to 64 characters.

log_agencyStream_name

No

String

Delegator log stream name.

log_agencyStream_id

Yes

String

Delegator log stream ID.

log_agencyGroup_name

No

String

Delegator log group name.

log_agencyGroup_id

Yes

String

Delegator log group ID.

log_beAgencystream_name

No

String

Delegatee log stream name.

log_beAgencystream_id

Yes

String

Delegatee log stream ID.

log_beAgencygroup_name

No

String

Delegatee log group name.

log_beAgencygroup_id

Yes

String

Delegatee log group ID.

be_agency_project_id

Yes

String

Delegatee project ID.

agency_project_id

Yes

String

Delegator project ID.

agency_domain_name

Yes

String

Delegator account name.

agency_name

Yes

String

Agency name.

Response Parameters

Status code: 201

Table 5 Response body parameters

Parameter

Type

Description

LTSAgencyAccessConfigInfoList

Array of LTSAccessConfigInfoRespon200 objects

Response list for creating a log ingestion configuration across accounts.

Table 6 LTSAccessConfigInfoRespon200

Parameter

Type

Description

access_config_id

String

Cross-account log ingestion ID.

project_id

String

Project ID.

access_config_name

String

Cross-account log ingestion name.

access_config_type

Object

Cross-account log ingestion type.

group_id

String

Log group ID.

log_group_name

String

Log group name.

log_stream_id

String

Log stream ID.

log_stream_name

String

Log stream name.

create_time

Long

Creation time.

agency_log_access

PreviewAgencyLogAccessReqBody object

Information of the delegated ingestion.

Table 7 PreviewAgencyLogAccessReqBody

Parameter

Type

Description

agency_access_type

String

Ingestion configuration type. For cross-account log ingestion, the value is AGENCYACCESS.

agency_log_access

String

Cross-account log ingestion configuration name, which must be unique.

  • Use only letters, digits, hyphens (-), underscores (_), and periods (.). Do not start with a period or underscore or end with a period.

  • Enter up to 64 characters.

log_agencyStream_name

String

Delegator log stream name.

log_agencyStream_id

String

Delegator log stream ID.

log_agencyGroup_name

String

Delegator log group name.

log_agencyGroup_id

String

Delegator log group ID.

log_beAgencystream_name

String

Delegatee log stream name.

log_beAgencystream_id

String

Delegatee log stream ID.

log_beAgencygroup_name

String

Delegatee log group name.

log_beAgencygroup_id

String

Delegatee log group ID.

be_agency_project_id

String

Delegatee project ID.

agency_project_id

String

Delegator project ID.

agency_domain_name

String

Delegator account name.

agency_name

String

Agency name.

Status code: 400

Table 8 Response body parameters

Parameter

Type

Description

-

String

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

message

ErrorMessagebody object

Error message body.

Table 10 ErrorMessagebody

Parameter

Type

Description

code

String

Error code.

details

String

Error message.

Example Requests

Creating a cross-account log ingestion configuration

POST https://{endpoint}/v2.0/{project_id}/lts/createAgencyAccess

{
  "preview_agency_list" : [ {
    "agency_log_access" : "rule_lb30",
    "agency_access_type" : "AGENCYACCESS",
    "agency_name" : "wenshufeng",
    "agency_domain_name" : "paas_aom_z00418070_01",
    "agency_project_id" : "a0a12b069ab4491185d7cf26c3e86ada",
    "be_agency_project_id" : "2a473356cca5487f8373be891bffc1cf",
    "log_agencyStream_name" : "lts-topic-bug",
    "log_agencyStream_id" : "beb169ff-e6e9-4bea-8e77-50afdec74071",
    "log_agencyGroup_name" : "lts-group-sgq",
    "log_agencyGroup_id" : "f06cbfa0-7243-4031-9380-ae0465bd3997",
    "log_beAgencystream_name" : "lts-topic-ECS",
    "log_beAgencystream_id" : "36ce06b0-c6bf-436d-9abe-39de86da28bb",
    "log_beAgencygroup_name" : "lts-group-sgqECS",
    "log_beAgencygroup_id" : "1e749063-d9f5-474f-a537-00cad4e9a108"
  } ]
}

Example Responses

Status code: 201

The cross-account log ingestion configuration is created.

[ {
  "access_config_id" : "dc5dceef-b0f0-4601-bc70-31fded87277c",
  "access_config_name" : "rule_x881",
  "access_config_type" : "AGENCYACCESS",
  "agency_log_access" : {
    "agency_accessConfig_id" : "dc5dceef-b0f0-4601-bc70-31fded87277c",
    "agency_access_type" : "AGENCYACCESS",
    "agency_domain_name" : "hyy-c30030940",
    "agency_log_access" : "rule_x881",
    "agency_name" : "lts-qff",
    "agency_project_id" : "f9786af2c4824786b6875dc68b238959",
    "be_agency_project_id" : "4a4eb741b4fe4409b3cb67a7095a6614",
    "log_agencyGroup_id" : "47d08f95-8cf5-4584-9ad2-ed71f6f10dbf",
    "log_agencyGroup_name" : "lts-group-qff-m",
    "log_agencyStream_id" : "e74317cb-e4c4-43e6-9fd3-aacadc05b1f5",
    "log_agencyStream_name" : "lts-topic-8",
    "log_beAgencygroup_id" : "18c45b02-d493-4f74-b0d3-778d05ef3c7f",
    "log_beAgencygroup_name" : "lts-group-qff-530",
    "log_beAgencystream_id" : "cc0bd880-2167-45a3-97ec-1bcd466ded7d",
    "log_beAgencystream_name" : "lts-topic-raojie"
  },
  "binary_collect" : false,
  "create_time" : 1749797479366,
  "encoding_format" : "UTF-8",
  "group_id" : "18c45b02-d493-4f74-b0d3-778d05ef3c7f",
  "hostGroupNum" : 0,
  "hostNum" : 0,
  "host_group_info_list" : [ ],
  "host_rule_info" : {
    "black_paths" : [ ],
    "combine_stdout" : false,
    "excludeEnvsLogical" : "or",
    "excludeK8sLabelsLogical" : "or",
    "excludeLabelsLogical" : "or",
    "includeEnvsLogical" : "or",
    "includeK8sLabelsLogical" : "or",
    "includeLabelsLogical" : "or",
    "pathType" : "host_file",
    "paths" : [ ],
    "repeat_collect" : true,
    "stderr" : false,
    "stdout" : false
  },
  "id" : "",
  "incremental_collect" : true,
  "indexId" : "",
  "key" : "",
  "log_group_name" : "lts-group-qff-530",
  "log_split" : false,
  "log_split_size" : 500,
  "log_stream_id" : "cc0bd880-2167-45a3-97ec-1bcd466ded7d",
  "log_stream_name" : "lts-topic-raojie",
  "pathNum" : 0,
  "project_id" : "4a4eb741b4fe4409b3cb67a7095a6614",
  "recursive_depth" : 5,
  "state" : true,
  "tag_list" : [ ]
} ]

Status code: 400

Failed to create cross-account log ingestion configuration.

Failed to validate the log_agencyStream_id
or
Failed to validate the log_agencyGroup_id
or
Failed to validate the AgencyProjectId
or
Failed to validate the agency_access_type
or
agency_log_access format error

Status code: 500

Internal service error

{
  "message" : {
    "code" : "LTS.0010",
    "details" : "The system encountered an internal error"
  }
}

Status Codes

Status Code

Description

201

The cross-account log ingestion configuration is created.

400

Failed to create cross-account log ingestion configuration.

500

Internal service error

Error Codes

See Error Codes.