All Products
Search
Document Center

Resource Orchestration Service:custom resource

Last Updated:Jun 22, 2026

The ALIYUN::Resource::Data::API association property queries data from Alibaba Cloud API operations to populate parameter options in ROS templates.

AssociationProperty Values

Description

Corresponding AssociationPropertyMetadata

ALIYUN::Resource::Data::API

Queries data from an Alibaba Cloud API based on specified parameters.

  • APIAction: The cloud product and API operation to call.

  • OptionsGetter: The data hierarchy parsing pattern.

  • ValueGetter: The property name to use as the option value.

  • LabelGetter: The property to display as the option label in query results.

  • PageFilterKeys: Pagination properties.

    • PageSize: Page size.

    • PageNumber: Page number.

    • TotalCount: Total count.

Example:

  • Example code

    JSON example:

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "PolicyClasses": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::Resource::Data::API",
          "AssociationPropertyMetadata": {
            "APIAction": "APIG/ListPolicyClasses",
            "OptionsGetter": "data.items",
            "ValueGetter": "classId",
            "LabelGetter": "name",
            "PageFilterKeys": {
              "PageSize": "pageSize",
              "PageNumber": "pageNumber",
              "TotalCount": "totalSize",
            }
          }
        }
      }
    }

    YAML example:

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      PolicyClasses:
        Type: String
        AssociationProperty: ALIYUN::Resource::Data::API
        AssociationPropertyMetadata:
          APIAction: APIG/ListPolicyClasses
          OptionsGetter: data.items
          ValueGetter: classId
          LabelGetter: name
          PageFilterKeys:
            PageSize: pageSize
            PageNumber: pageNumber
            TotalCount: totalSize
    
    
  • Example description

    This example calls the ListPolicyClasses - Get policy templates API of cloud-native API Gateway (APIG) to query policy template IDs (classId) and display their names. The PolicyClasses parameter sets AssociationProperty to ALIYUN::Resource::Data::API and configures AssociationPropertyMetadata with APIAction, OptionsGetter, ValueGetter, LabelGetter, and PageFilterKeys.