All Products
Search
Document Center

Cloud Config:GetResourceConfigurationSample

Last Updated:Oct 16, 2025

This operation obtains configuration samples for a specified resource type.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

config:GetResourceConfigurationSample

none

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ResourceType

string

Yes

The resource type.

For more information about how to obtain the resource type, see ListDiscoveredResources.

ACS::ECS::Instance

MockOnly

string

No

Specifies whether to obtain only mock data, which is not real resource data. Valid values:

  • true

  • false

false

Response elements

Parameter

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

DC300244-FCE3-5061-8214-C27ECB66****

Sample

object

The sample.

ResourceType

string

The resource type.

ACS::ECS::Instance

Configuration

string

The complete configuration information of the resource.

{\"Status\":\"Running\",\"HibernationOptions\":{\"Configured\":\"false\"},\"ResourceGroupId\":\"rg-bp67acfmxazb4p****\",\"MetadataOptions\":{\"HttpPutResponseHopLimit\":\"0\",\"HttpTokens\":\"optional\",\"HttpEndpoint\":\"enabled\"},\"InstanceId\":\"i-bp67acfmxazb4p****\",\"InstanceChargeType\":\"PostPaid\",\"Memory\":\"16384\",\"StoppedMode\":\"KeepCharging\",\"CpuOptions\":{\"ThreadsPerCore\":\"4\",\"Numa\":\"2\",\"CoreCount\":\"2\"},\"StartTime\":\"2017-12-10T04:04Z\",\"Cpu\":\"8\",\"OSName\":\"CentOS 7.4 64 bit\",\"DeletionProtection\":\"false\",\"SecurityGroupIds\":{\"SecurityGroupId\":[null]},\"InstanceNetworkType\":\"vpc\",\"InnerIpAddress\":{\"IpAddress\":[\"42.112.**.**\"]},\"ExpiredTime\":\"2017-12-10T04:04Z\",\"EipAddress\":{\"AllocationId\":\"eip-2ze88m67qx5z****\",\"Bandwidth\":\"5\",\"IpAddress\":\"42.112.**.**\",\"IsSupportUnassociate\":\"true\",\"InternetChargeType\":\"PayByTraffic\"},\"ImageId\":\"m-bp67acfmxazb4p****\",\"ImageOptions\":{\"LoginAsNonRoot\":\"false\"},\"HostName\":\"testHostName\",\"Tags\":{\"Tag\":[null]},\"VlanId\":\"10\"}

ResourceId

string

The resource ID.

i-bp1aaegapahkh880****

ResourceName

string

The resource name.

my-ecs

ResourceStatus

string

The resource status.

Running

ResourceDeleted

string

The deletion status of the resource. Valid values:

  • 1: The resource is retained.

  • 0: The resource is deleted.

1

ResourceCreationTime

string

The time when the resource was created.

1646362560000

Region

string

The region ID.

cn-shanghai

Version

string

The version information.

5

AvailabilityZone

string

The zone.

cn-shanghai-g

AccountId

string

The user ID.

101339776561****

Tags

string

The tag.

{\"key\":\"value\"}

Examples

Success response

JSON format

{
  "RequestId": "DC300244-FCE3-5061-8214-C27ECB66****",
  "Sample": {
    "ResourceType": "ACS::ECS::Instance",
    "Configuration": "{\\\"Status\\\":\\\"Running\\\",\\\"HibernationOptions\\\":{\\\"Configured\\\":\\\"false\\\"},\\\"ResourceGroupId\\\":\\\"rg-bp67acfmxazb4p****\\\",\\\"MetadataOptions\\\":{\\\"HttpPutResponseHopLimit\\\":\\\"0\\\",\\\"HttpTokens\\\":\\\"optional\\\",\\\"HttpEndpoint\\\":\\\"enabled\\\"},\\\"InstanceId\\\":\\\"i-bp67acfmxazb4p****\\\",\\\"InstanceChargeType\\\":\\\"PostPaid\\\",\\\"Memory\\\":\\\"16384\\\",\\\"StoppedMode\\\":\\\"KeepCharging\\\",\\\"CpuOptions\\\":{\\\"ThreadsPerCore\\\":\\\"4\\\",\\\"Numa\\\":\\\"2\\\",\\\"CoreCount\\\":\\\"2\\\"},\\\"StartTime\\\":\\\"2017-12-10T04:04Z\\\",\\\"Cpu\\\":\\\"8\\\",\\\"OSName\\\":\\\"CentOS 7.4 64 bit\\\",\\\"DeletionProtection\\\":\\\"false\\\",\\\"SecurityGroupIds\\\":{\\\"SecurityGroupId\\\":[null]},\\\"InstanceNetworkType\\\":\\\"vpc\\\",\\\"InnerIpAddress\\\":{\\\"IpAddress\\\":[\\\"42.112.**.**\\\"]},\\\"ExpiredTime\\\":\\\"2017-12-10T04:04Z\\\",\\\"EipAddress\\\":{\\\"AllocationId\\\":\\\"eip-2ze88m67qx5z****\\\",\\\"Bandwidth\\\":\\\"5\\\",\\\"IpAddress\\\":\\\"42.112.**.**\\\",\\\"IsSupportUnassociate\\\":\\\"true\\\",\\\"InternetChargeType\\\":\\\"PayByTraffic\\\"},\\\"ImageId\\\":\\\"m-bp67acfmxazb4p****\\\",\\\"ImageOptions\\\":{\\\"LoginAsNonRoot\\\":\\\"false\\\"},\\\"HostName\\\":\\\"testHostName\\\",\\\"Tags\\\":{\\\"Tag\\\":[null]},\\\"VlanId\\\":\\\"10\\\"}",
    "ResourceId": "i-bp1aaegapahkh880****",
    "ResourceName": "my-ecs",
    "ResourceStatus": "Running",
    "ResourceDeleted": "1",
    "ResourceCreationTime": "1646362560000",
    "Region": "cn-shanghai",
    "Version": "5",
    "AvailabilityZone": "cn-shanghai-g",
    "AccountId": "101339776561****",
    "Tags": "{\\\"key\\\":\\\"value\\\"}"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.