Configure an ROA-style API with a custom OOS template

更新时间:
复制 MD 格式

Create an Object Storage Service (OSS) bucket and enable transfer acceleration by calling an ROA-style API through a custom OOS template.

Background information

Calling ROA-style APIs for some Alibaba Cloud services requires complex parameters such as Body, Headers, Method, and URI. OOS simplifies this by auto-populating parameters and guiding you through the configuration in the console.

This tutorial uses OSS bucket creation and transfer acceleration as an example. Follow the same procedure for other supported services.

OOS supports ROA-style API calls for the following cloud services:

Note

All supported services are listed in Supported cloud services. To request support for an unlisted service, join DingTalk group 23330931.

Procedure

Note

If you use a RAM user, ensure that your Alibaba Cloud account has granted the AliyunOOSFullAccess and AliyunOSSFullAccess policies to the RAM user.

  1. Go to the CloudOps Orchestration Service > Custom Templates page and click Create Template.

  2. Under Create from Sample Template, set Template to Basic Sample Template, and then click Next.

    Basic sample template

  3. Use OOS to call an ROA-style API to configure an OSS bucket and its transfer acceleration feature.

    This example uses the process configuration editor. If you already have the YAML commands, use the YAML editor instead.

    Example YAML template

    FormatVersion: OOS-2019-06-01
    Description: Execute a single API.
    Tasks:
      - Name: PutBucket
        Action: ACS::ExecuteApi
        Description: ''
        Properties:
          Service: oss
          API: PutBucket
          Parameters:
            bucket: '{{ bucket }}'
          Headers:
            x-oss-acl: private
          Body:
            CreateBucketConfiguration:
              StorageClass: Standard
              DataRedundancyType: LRS
      - Action: ACS::ExecuteApi
        Name: ExecuteApi1
        Description: ''
        Properties:
          Service: oss
          API: PutBucketTransferAcceleration
          Parameters:
            bucket: '{{ bucket }}'
          Headers: {}
          Body:
            TransferAccelerationConfiguration:
              Enabled: 'true'
    Parameters:
      bucket:
        Type: String
    1. On the Process Configuration tab, click Add Template Parameter on the right.

    2. In the Parameters panel, set Parameter Description to a value, such as Bucket-example. For Parameter Type, select String. Click screenshot_2025-03-06_13-50-28 to close the panel.

    3. On the Process Configuration tab, configure the ExecuteApi task parameters.

      1. In the Task Input area, select the service name and API name.

        Service name

      2. Set the ROA-style API parameters.

        • Required Parameters: For the bucket parameter, select Reference Parameter/Task Output, and then select the Bucket-example template parameter.

          API parameters

        • Other Parameters: Configure other parameters, such as Headers or Body, as needed.

          Note

          Hover over the screenshot_2025-03-06_15-59-08 icon for parameter descriptions.

    4. Click Add New Task at the bottom of the page, then select Execute Cloud Service API on the Quick Select page.

      Add new task

    5. In the ExecuteApi1 step, configure the task parameters.

      1. In the Task Input area, select the service name and API name.

        Service name

      2. Set the ROA-style API parameters.

        API parameters

        • Required Parameters: For the bucket parameter, select Reference Parameter/Task Output, and then select the Bucket-example template parameter.

        • Body Parameters: Select true to enable the transfer acceleration feature for the target bucket.

          Note

          Hover over the screenshot_2025-03-06_15-59-08 icon for parameter descriptions.

  4. Click Create Template, enter a template name in the dialog box, and click Finish Creation.

  5. Find your custom template. In the Actions column, click Create an execution, then click Next: Set Parameters.

  6. Set the Bucket-example parameter to a bucket name such as test-by-oos. Click Next: Confirm, then click Create.

Verify the results

  1. Go to the OSS > Buckets page and click your bucket, such as test-by-oos.

  2. In the left-side navigation pane, choose Bucket Settings > Transfer Acceleration. Confirm that transfer acceleration is enabled.

    Transfer acceleration

    The custom OOS template successfully created the bucket and enabled transfer acceleration.