All Products
Search
Document Center

Cloud Config:CreateDeliveryChannel

Last Updated:Mar 01, 2024

Creates a delivery channel.

Operation description

In this example, a delivery channel is created. The type of the delivery channel is OSS, the Alibaba Cloud Resource Name (ARN) of the delivery destination is acs:oss:cn-shanghai:100931896542****:new-bucket, and the ARN of the role that is assigned to the delivery channel is acs:ram::100931896542****:role/aliyunserviceroleforconfig. The returned result shows that the delivery channel is created, and the ID of the delivery channel is cdc-8e45ff4e06a3a8****.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
DeliveryChannelNamestringNo

The name of the delivery channel.

Note If you do not configure this parameter, this parameter is left empty.
testoss
DeliveryChannelTypestringYes

The type of the delivery channel. Valid values:

  • OSS: Object Storage Service (OSS)
  • MNS: Message Service (MNS)
  • SLS: Log Service
OSS
DeliveryChannelTargetArnstringYes

The Alibaba Cloud Resource Name (ARN) of the delivery destination. Valid values:

  • acs:oss:{RegionId}:{accountId}:{bucketName} if your delivery destination is an OSS bucket. Example: acs:oss:cn-shanghai:100931896542****:new-bucket.
  • acs:mns:{RegionId}:{accountId}:/topics/{topicName} if your delivery destination is an MNS topic. Example: acs:mns:cn-shanghai:100931896542****:/topics/topic1.
  • acs:log:{RegionId}:{accountId}:project/{projectName}/logstore/{logstoreName} if your delivery destination is a Log Service Logstore. Example: acs:log:cn-shanghai:100931896542****:project/project1/logstore/logstore1.
acs:oss:cn-shanghai:100931896542****:new-bucket
DeliveryChannelAssumeRoleArnstringYes

The ARN of the role that you want to assign to the delivery channel. Specify the ARN in the following format: acs:ram::{accountId}:role/aliyunserviceroleforconfig.

acs:ram::100931896542****:role/aliyunserviceroleforconfig
DeliveryChannelConditionstringNo

The rule that you want to attach to the delivery channel. This parameter is available only for delivery channels of the MNS type.

This parameter specifies the lowest risk level and the resource types for the events to which you want to subscribe.

  • The setting of the lowest risk level for the events to which you want to subscribe is in the following format: {"filterType":"RuleRiskLevel","value":"1","multiple":false}.

    The value field indicates the lowest risk level of the events to which you want to subscribe. Valid values: 1, 2, and 3. The value 1 indicates the high risk level, the value 2 indicates the medium risk level, and the value 3 indicates the low risk level.

  • The setting of the resource types of the events to which you want to subscribe is in the following format: {"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}.

    The values field indicates the resource types of the events to which you want to subscribe. The value of the field is a JSON array. Examples:

[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]

[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]
DescriptionstringNo

The description of the delivery channel.

My OSS delivery.
ClientTokenstringNo

The client token that is used to ensure the idempotency of the request. You can use the client to generate the token, but you must ensure that the token is unique among different requests.

The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

1594295238-f9361358-5843-4294-8d30-b5183fac****
ConfigurationSnapshotbooleanNo

Specifies whether to deliver scheduled resource snapshots to the OSS bucket. If the value of this parameter is true, the scheduled resource snapshots are delivered to the specified OSS bucket at 00:00:00 and 12:00:00 on a daily basis. Valid values:

  • true
  • false (default)
Note This parameter is applicable only to delivery channels of the OSS type.
false
ConfigurationItemChangeNotificationbooleanNo

Specifies whether to deliver resource change logs to the specified destination. If you set this parameter to true, Cloud Config delivers resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:

  • true
  • false (default)
Note This parameter is available for delivery channels of the OSS, SLS, and MNS types.
false
NonCompliantNotificationbooleanNo

Specifies whether to deliver resource non-compliance events. If you set this parameter to true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are considered non-compliant. Valid values:

  • true
  • false (default)
Note This parameter is available only for delivery channels of the SLS or MNS type.
false
OversizedDataOSSTargetArnstringNo

The ARN of the OSS bucket to which you want to transfer the delivery data when the size of the data exceeds the specified upper limit of the delivery channel. Format: acs:oss:{RegionId}:{accountId}:{bucketName}.

If you do not configure this parameter, Cloud Config delivers only summary data.

Note This parameter is available only for delivery channels of the SLS or MNS type. The maximum storage size of delivery channels of the SLS type is 1 MB, and the maximum storage size of delivery channels of the MNS type is 64 KB.
acs:oss:cn-shanghai:100931896542****:new-bucket

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object

N/A.

RequestIdstring

The request ID.

A7A0FFF8-0B44-40C6-8BBF-3A185EFDERTHG
DeliveryChannelIdstring

The ID of the delivery channel.

cdc-8e45ff4e06a3a8****

Examples

Sample success responses

JSONformat

{
  "RequestId": "A7A0FFF8-0B44-40C6-8BBF-3A185EFDERTHG",
  "DeliveryChannelId": "cdc-8e45ff4e06a3a8****"
}

Error codes

HTTP status codeError codeError messageDescription
400DeliveryChannelNotExistsThe delivery channel does not exist.The delivery channel does not exist.
400Invalid.DeliveryChannelAssumeRoleArn.FormatThe specified format of DeliveryChannelAssumeRoleArn is invalid.The specified format of DeliveryChannelAssumeRoleArn is invalid.
400Invalid.DeliveryChannelTargetArn.FormatThe specified format of DeliveryChannelTargetArn is invalid.The specified format of DeliveryChannelTargetArn is invalid.
400Invalid.DeliveryChannelCondition.FormatThe specified format of DeliveryChannelCondition is invalid.The specified format of DeliveryChannelCondition is invalid.
400MemberNotBelongToMasterThe specified member does not belong to your organization.The specified member does not belong to your organization.
400DeliveryChannelAccountNotSupportCross-account delivery that is not in the RD is not supported.Cross-account delivery that is not in the RD is not supported.
400DeliveryChannelMnsUnreachableThe MNS topic is unreachable.The MNS topic is unreachable.
400DeliveryChannelOssUnreachableThe OSS bucket is unreachable.The OSS bucket is unreachable.
400DeliveryChannelSlsUnreachableSLS logstore is unreachable.The SLS Logstore is unreachable.
404AccountNotExistedYour account does not exist.The specified account does not exist.

For a list of error codes, visit the Service error codes.