すべてのプロダクト
Search
ドキュメントセンター

Resource Orchestration Service:ALIYUN::APIG::Operation

最終更新日:Jan 23, 2025

ALIYUN::APIG::Operation は、HTTP API のオペレーションを作成するために使用されます。

構文

{
  "Type": "ALIYUN::APIG::Operation",
  "Properties": {
    "HttpApiId": String,
    "Method": String,
    "OperationName": String,
    "Path": String,
    "Description": String,
    "Mock": Map
  }
}

プロパティ

プロパティ

タイプ

必須

編集可能

説明

制約

HttpApiId

String

はい

いいえ

オペレーションを作成する HTTP API の ID。

なし。

Method

String

はい

はい

メソッド。

有効な値:

  • TRACE

  • HEAD

  • DELETE

  • POST

  • GET

  • CONNECT

  • OPTIONS

  • PUT

  • PATCH

OperationName

String

はい

はい

オペレーション名。

なし。

Path

String

はい

はい

オペレーションのパス。

なし。

Description

String

いいえ

はい

オペレーションの説明。

なし。

Mock

Map

いいえ

はい

オペレーションの Mock 構成。

このプロパティは、API が Mock シナリオに公開されている場合にのみ有効になります。 詳細については、「Mock プロパティ」をご参照ください。

Mock 構文

"Mock": {
  "ResponseContent": String,
  "ResponseCode": Integer,
  "Enable": Boolean
}

Mock プロパティ

プロパティ

タイプ

必須

編集可能

説明

制約

ResponseCode

Integer

はい

はい

レスポンスコード。

なし。

Enable

Boolean

いいえ

はい

Mock 機能を有効にするかどうかを指定します。

なし。

ResponseContent

String

いいえ

はい

レスポンスコンテンツ。

なし。

戻り値

Fn::GetAtt

  • Path: オペレーションのパス。

  • Description: オペレーションの説明。

  • OperationName: オペレーション名。

  • OperationId: オペレーション ID。

  • CreateTime: オペレーションが作成された時刻。

  • Method: オペレーションのメソッド。

  • Mock: オペレーションの Mock 構成。

ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
  ExtensionResource:
    Type: ALIYUN::APIG::Operation
    Properties:
      HttpApiId: api-csxxxxxxxxx
      OperationName: GetUserInfo2
      Path: /user
      Method: GET
Outputs:
  Path:
    Description: The interface path of the operation.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Path
  Description:
    Description: The description of the operation.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Description
  OperationName:
    Description: The name of the resource.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - OperationName
  OperationId:
    Description: The ID of the operation.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - OperationId
  CreateTime:
    Description: The creation timestamp of the operation.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
  Method:
    Description: The method of http protocol.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Method
  Mock:
    Description: Mock configuration.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Mock
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::APIG::Operation",
      "Properties": {
        "HttpApiId": "api-csxxxxxxxxx",
        "OperationName": "GetUserInfo2",
        "Path": "/user",
        "Method": "GET"
      }
    }
  },
  "Outputs": {
    "Path": {
      "Description": "オペレーションのインターフェースパス。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Path"
        ]
      }
    },
    "Description": {
      "Description": "オペレーションの説明。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Description"
        ]
      }
    },
    "OperationName": {
      "Description": "リソースの名前。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "OperationName"
        ]
      }
    },
    "OperationId": {
      "Description": "オペレーションの ID。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "OperationId"
        ]
      }
    },
    "CreateTime": {
      "Description": "オペレーションの作成タイムスタンプ。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      }
    },
    "Method": {
      "Description": "HTTP プロトコルのメソッド。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Method"
        ]
      }
    },
    "Mock": {
      "Description": "Mock 構成。",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Mock"
        ]
      }
    }
  }
}