All Products
Search
Document Center

Resource Management:Data structure of resource change events

Last Updated:Aug 15, 2024

This topic describes the data structure of a resource change event and provides examples.

Data structure

Structure of a resource change event

Field

Type

Description

messageType

String

The message type. Valid values:

  • ResourceChange: resource configuration change

  • OversizedResourceChange: overlimit notification

resourceChangeType

String

The configuration change type. Valid values:

  • ResourceCreate

  • ResourceUpdate

  • ResourceDelete

changeId

String

The unique ID of the configuration change.

accountId

String

The ID of the account to which the resource belongs.

regionId

String

The region ID of the resource.

resourceType

String

The type of the resource.

resourceId

String

The ID of the resource.

resourceSnapshot

JSON

The snapshot of the resource. For more information, see Structure of the resourceSnapshot field.

resourceDiff

JSON

The comparison between the configurations before the change and the configurations after the change. For more information, see Structure of the resourceDiff field.

version

String

The version number.

Structure of the resourceSnapshot field

Category

Field

Type

Description

Common properties

accountId

String

The ID of the account to which the resource belongs.

regionId

String

The region ID of the resource.

resourceType

String

The type of the resource.

resourceId

String

The ID of the resource.

resourceGroupId

String

The ID of the resource group to which the replication pair belongs.

resourceName

String

The name of the resource.

resourceStatus

String

The status of the resource.

zoneId

String

The zone ID of the resource.

createTime

String

The time when the resource was created.

The time follows the ISO 8601 standard and is in the yyyy-MM-ddTHH:mm:ssZ or yyyy-MM-ddTHH:mm:ss.SSSZ format. The time is displayed in UTC.

expireTime

String

The time when the resource expires.

The time follows the ISO 8601 standard and is in the yyyy-MM-ddTHH:mm:ssZ or yyyy-MM-ddTHH:mm:ss.SSSZ format. The time is displayed in UTC.

tags

Array

The tags added to the resource.

ipAddresses

Array

The IP addresses.

ipAddressAttributes

Array

The properties of the IP addresses.

vpcId

String

The ID of the virtual private cloud (VPC).

vSwitchId

String

The ID of the vSwitch.

Resource properties

configuration

JSON

The properties of the resource.

Structure of the resourceDiff field

Field

Type

Description

changeType

String

The event type. Valid values:

  • UPDATE

  • DELETE

  • CREATE

Note

The changedProperties field is returned only if the event type is UPDATE.

changedProperties

Map

The details of the changed properties.

previousValue

String

The value before the change.

updatedValue

String

The value after the change.

Examples

Example 1: If the size of a resource change event is less than or equal to 1 MB, you can view the data of the event in Simple Log Service.

{
	"resourceChangeType": "ResourceUpdate",
	"accountId": "152435078218****",
	"resourceId": "eip-bp18kiogaerql42yy****",
	"messageType": "ResourceChange",
	"regionId": "cn-hangzhou",
	"resourceSnapshot": "{\"accountId\":\"152435078218****\",\"configuration\":{\"HDMonitorStatus\":\"OFF\",\"Description\":\"\",\"AvailableRegions\":{\"AvailableRegion\":[\"cn-hangzhou\"]},\"ServiceManaged\":0,\"ResourceGroupId\":\"rg-acfmzdlidtf****\",\"AllocationId\":\"eip-bp18kiogaerql42yy****\",\"SecondLimited\":false,\"BusinessStatus\":\"Normal\",\"Name\":\"zx\",\"SegmentInstanceId\":\"\",\"InstanceRegionId\":\"cn-hangzhou\",\"Bandwidth\":\"200\",\"ExpiredTime\":\"\",\"BandwidthPackageId\":\"\",\"InstanceType\":\"EcsInstance\",\"Tags\":{\"Tag\":[{\"Value\":\"v1\",\"Key\":\"k1\"},{\"Value\":\"v2\",\"Key\":\"k2\"}]},\"Status\":\"InUse\",\"InstanceId\":\"i-bp11x4htqo2akm97****\",\"ISP\":\"BGP\",\"HasReservationData\":false,\"BizType\":\"Default\",\"DeletionProtection\":false,\"BandwidthPackageType\":\"\",\"BandwidthPackageBandwidth\":\"\",\"InternetChargeType\":\"PayByTraffic\",\"AllocationTime\":\"2023-07-19T06:30:43Z\",\"VpcId\":\"\",\"Netmode\":\"public\",\"ChargeType\":\"PostPaid\",\"IpAddress\":\"47.111.XX.XX\",\"RegionId\":\"cn-hangzhou\"},\"createTime\":\"2023-07-19T06:30:43Z\",\"ipAddresses\":[\"47.111.XX.XX\"],\"regionId\":\"cn-hangzhou\",\"resourceGroupId\":\"rg-acfmzdlidtf****\",\"resourceId\":\"eip-bp18kiogaerql42yy****\",\"resourceName\":\"zx\",\"resourceType\":\"ACS::EIP::EipAddress\",\"tags\":[{\"key\":\"k1\",\"value\":\"v1\"},{\"key\":\"k2\",\"value\":\"v2\"}]}",
	"changeId": "sc-c23b2d3543218ba730fb208a74be****",
	"resourceDiff": "{\"changedProperties\":{\"Tags.Tag\":{\"previousValue\":[{\"Value\":\"v1\",\"Key\":\"k1\"}],\"updatedValue\":[{\"Value\":\"v1\",\"Key\":\"k1\"},{\"Value\":\"v2\",\"Key\":\"k2\"}]}}}",
	"version": "171108694741****",
	"resourceType": "ACS::EIP::EipAddress"
}

Example 2: If the size of a resource change event exceeds 1 MB and the large-file delivery feature is enabled, you can view the basic information about the event in Simple Log Service. Then, view the details of the event in OSS based on the value of ossObjectPath.

Data in Simple Log Service

{
	"accountId": "152435078218****",
	"resourceId": "eip-t4nj1xwqjdmkmz9gg****",
	"ossObjectPath": "oss://resourcecenter-test/152435078218****/ResourceCenter/dc-s104ld1k****_CHANGE_DELIVERY/2024/03/19/152435078218****_ACS::EIP::EipAddress_ap-southeast-1_eip-t4nj1xwqjdmkmz9gg****_171083883919****_rc_resource_oversize_change.json",
	"messageType": "OversizedResourceChange",
	"regionId": "ap-southeast-1",
	"changeId": "sc-4141c854-568d-473b-a944-08c5f4b5****",
	"version": "171083883919****",
	"resourceType": "ACS::EIP::EipAddress"
}

Data in OSS

{
	"accountId": "152435078218****",
	"changeId": "sc-4141c854-568d-473b-a944-08c5f4b5****",
	"messageType": "ResourceChange",
	"regionId": "ap-southeast-1",
	"resourceChangeType": "ResourceUpdate",
	"resourceDiff": {
		"changeType": "UPDATE",
		"changedProperties": {
			"BusinessStatus": {
				"previousValue": "Unactivated",
				"updatedValue": "Normal"
			}
		}
	},
	"resourceId": "eip-t4nj1xwqjdmkmz9gg****",
	"resourceSnapshot": {
		"accountId": "152435078218****",
		"configuration": {
			"HDMonitorStatus": "OFF",
			"Description": "CREATE_BY_ALB.alb-xj6tlyo36sipt9****",
			"AvailableRegions": {
				"AvailableRegion": ["ap-southeast-1"]
			},
			"ServiceManaged": 1,
			"ResourceGroupId": "rg-acfmzdlidtf****",
			"AllocationId": "eip-t4nj1xwqjdmkmz9gg****",
			"SecondLimited": false,
			"BusinessStatus": "Normal",
			"Name": "CREATE_BY_ALB.alb-xj6tlyo36sipt9****",
			"SegmentInstanceId": "",
			"InstanceRegionId": "ap-southeast-1",
			"Bandwidth": "200",
			"ExpiredTime": "",
			"BandwidthPackageId": "",
			"InstanceType": "NetworkInterface",
			"Status": "InUse",
			"InstanceId": "eni-t4n6664mrebxp15u****",
			"ISP": "BGP",
			"HasReservationData": false,
			"BizType": "Default",
			"DeletionProtection": false,
			"BandwidthPackageType": "",
			"BandwidthPackageBandwidth": "",
			"InternetChargeType": "PayByTraffic",
			"AllocationTime": "2024-03-19T09:00:14Z",
			"VpcId": "",
			"Netmode": "public",
			"ChargeType": "PostPaid",
			"IpAddress": "47.236.XX.XX",
			"RegionId": "ap-southeast-1"
		},
		"createTime": "2024-03-19T09:00:14Z",
		"ipAddresses": ["47.236.XX.XX"],
		"regionId": "ap-southeast-1",
		"resourceGroupId": "rg-acfmzdlidtf****",
		"resourceId": "eip-t4nj1xwqjdmkmz9gg****",
		"resourceName": "CREATE_BY_ALB.alb-xj6tlyo36sipt9****",
		"resourceType": "ACS::EIP::EipAddress"
	},
	"resourceType": "ACS::EIP::EipAddress",
	"version": "171083883919****"
}

References

View resource change events