汎用RESTデータ・アセット

現在、RESTデータ・アセットの作成時にマニフェスト・ファイルをアップロードする必要があります。マニフェスト・ファイルには、パス、操作、パラメータ、リクエスト本文とレスポンス構造、オブジェクト・プロパティなど、ベースURLのAPI全体が記述されます。ファイルは3MBを超えないようにしてください。

RESTデータ・アセットを作成する前に、何がサポートされているか、および現在の制限事項を理解していることを確認してください。

開始する前に

データ統合では、OpenAPI 3.0.0 (以上)およびRESTデータ・ソースのJSONまたはYML/YAMLマニフェスト・ファイルのみがサポートされます。

RESTデータ・アセットを作成するには、APIエンドポイントのベースURLを指定し、マニフェスト・ファイルをアップロードする必要があります。

完全なAPIエンドポイントは、ベースURL、リソース・パス、およびマニフェスト・ファイルに定義されているサーバーURLで構成されます。パスが/users/findByStatusのエンドポイントを考えてみます。

https://myapi.example.com/v1/users/findByStatus

マニフェスト・ファイルのサーバーURLが/v1の場合、ベースURLは次のようになります。

https://myapi.example.com

マニフェスト・ファイルでサーバーURLが定義されていない場合、またはマニフェスト・ファイルのサーバーURLが/の場合、ベースURLは次のようになります。

https://myapi.example.com/v1

データ統合でRESTデータ・アセットをソースとして作成および使用する場合は、次のサポートされている機能および現在の制限を考慮してください:

  • アップロードするマニフェスト・ファイルは3MBを超えないようにする必要があります。
  • 3.0.0 未満のバージョンに基づくJSONおよびYML/YAMLマニフェスト・ファイルはサポートされていません。
  • Basic認証のみ、または認証はサポートされません。
  • GETコールのみがサポートされています。
  • リクエスト本文またはレスポンスのヘッダーおよびCookieはサポートされていません。
  • ページ区切りRESTレスポンスはサポートされていません。
  • FileとしてのJSONレスポンスはサポートされていません。
  • JSON content-typeのみがサポートされています。
  • キーワードOneOfAnyOfAllOfおよびAdditionalPropertiesは、マニフェスト・ファイルではサポートされていません。
  • パラメータの内容は、キーワードschemaを使用して記述する必要があります。コンテンツ・キーワードはサポートされていません。
  • パラメータのデフォルト値はサポートされていません。デフォルトのオプション・パラメータの場合は、デフォルト値を明示的に指定する必要があります。
  • Integer、Long、Float、Double、NumberおよびStringデータ型のみがサポートされています。
  • 日付、パスワード、電子メールおよびバイナリのデータ形式は無視され、文字列としてのみ処理されます。
  • パス・パラメータのプリミティブ型のみがサポートされています。
  • 問合せパラメータでは、プリミティブおよびプリミティブの配列がサポートされています。
  • JSONレスポンスの配列はサポートされていません。
  • スタイル属性および展開属性は無視され、問合せパラメータはstyle=form、explode=trueとして扱われますが、パス・パラメータはstyle=simple、explode=falseとして扱われます。
  • 参照(#ref)はローカルのみにする必要があります。一部のURLまたは別のファイルを指すことはできません。
  • schema#refがサポートされています。responsesheadersおよびparameters#refを使用しないでください。
  • 現在、RESTデータ・アセットのテスト接続オプションは実装されていません。常にtrue (成功)を返します。
  • データ・アセットの詳細を表示する場合、データ・プロファイリングまたは階層データのプレビューはサポートされていません。
  • レスポンスでは、ルート・レベルの属性のみが列名にマップされます。
  • エンドポイントがプリミティブの配列を返す場合、"<name>_index"などの列は1つのみです(index>= 0)。

RESTデータ・アセット・プロパティ

RESTデータ・アセットを作成する前に、ベースURLおよびマニフェスト・ファイルがあることを確認してください。

Basic認証でパスワードのシークレットを使用するには、OCI VaultのシークレットおよびOracleウォレットを参照してください。

RESTソースに接続するデータ・アセットを作成するには、次のプロパティおよび接続の詳細を入力します。Sample Manifest Fileを参照してください。

フィールド 説明
プロパティ
名前 データ・アセットの名前を入力します。
識別子 「識別子」は、名前に基づいてシステムによって生成される値です。識別子の値は変更できませんが、作成および保存後に識別子を更新することはできません。
説明 (オプション)説明を追加します。
タイプ このフィールドには、「データ・アセット・タイプの選択」パネルで選択したデータ・ソース・タイプが表示されます(「データ・アセットの作成」を参照)。データ統合には、このタイプに基づくデータ・アセット・プロパティ・フィールドおよびデフォルトの接続フィールドが表示されます。
ベースURL

APIエンドポイントのベースURLを入力します。

たとえば: https://myapi.example.com/v1

または

https://myapi.example.com

マニフェスト・ファイルのアップロード

YML/YAMLまたはJSONファイルをドロップして、ベースURLを通過できるマニフェスト・ファイルをアップロードします。または、「ファイルの選択」リンクをクリックして、ファイルがある場所を参照できます。

マニフェスト・ファイルを指定せず、Manifest file or manifest URL should be providedというメッセージが表示された場合は、マニフェストURLに関する部分を無視します。現在、マニフェスト・ファイルのアップロードのみがサポートされています。

デフォルトの接続情報
名前 デフォルト接続の名前を入力します。
識別子 「識別子」は、名前に基づいてシステムによって生成される値です。識別子の値は変更できませんが、作成および保存後に識別子を更新することはできません。
説明 (オプション)説明を追加します。
認証

次のいずれかの認証方式を選択します。

  • 基本認証: この方式を選択すると、次のフィールドが表示されます:
    • ユーザー名: ユーザー名を入力します。
    • ボールト・シークレットOCIDの使用: Oracle Cloud Infrastructure Vaultでシークレットを使用してパスワードを保存する場合は、このオプションを選択します。OCI Vaultのパスワード(ユーザーに関連付けられている)のシークレットのOCIDを入力します。
    • パスワードの使用: このオプションを選択した場合は、パスワードを入力します。
  • OAuth 2.0認証: このメソッドを選択すると、次のフィールドが表示されます:
    • アクセス・トークンURL: アクセス・トークンの認証資格証明の交換に使用するURLを入力します。
    • クライアントID: 特定のアプリケーションのクライアントIDキーを入力します。
    • クライアント・シークレットのVaultシークレットOCID: OCIボールトからのクライアント・シークレットのシークレットのOCIDを入力します。
    • スコープ: アクセス・トークンによって付与される権限の範囲を入力します。
  • なし: 認証方式を使用しない場合は、このオプションを選択します。

接続の認証タイプは、作成後に変更できません。

(オプション)接続のテスト
テスト接続 すべての必須フィールドに入力した後、「接続のテスト」をクリックして、データ・アセットの詳細が正しく入力され、接続を確立できることを確認します。テストに成功すると、成功メッセージが表示されます。テストがエラー・メッセージで失敗した場合は、接続設定を確認して再試行してください。

マニフェスト・ファイルのサンプル

{
    "openapi": "3.0.1",
    "servers": [
        {
            "url": "/v1",
            "description": "Generated server url"
        }
    ],
    "paths": {
        "/orders": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getOrders",
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/orderSuccess"
                    }
                }
            }
        },
        "/paginatedOrders": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getPaginatedOrdersRowOffset",
                "parameters": [
                    {
                        "name": "maximumPageSize",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "firstRowNumber",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "rowOffsetParameter",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "pageSizeParameter",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PaginatedOrders"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/paginatedOrdersPageNum": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getPaginatedOrdersPageNumberBased",
                "parameters": [
                    {
                        "name": "maximumPageSize",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "firstPageNumber",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "pageSizeParameter",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "pageNumberParameter",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PaginatedOrders"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/{orderNo}": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getOrdersByOrderID",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/orderNum"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Order"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "deleteOrder",
                "parameters": [
                    {
                        "name": "orderNo",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/orders/noAuth/{orderNo}": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getOrdersByOrderIDNoAuth",
                "parameters": [
                    {
                        "name": "orderNo",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Order"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/headers/validation": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getOrdersAfterHeadersValidation",
                "parameters": [
                    {
                        "name": "UserId",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Password",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Email",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SalesOrders"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/filterbystore": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getOrdersByStore",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/storeId"
                    },
                    {
                        "name": "customerName",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Order"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/byName": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getOrdersByCustomerName",
                "parameters": [
                    {
                        "name": "customerName",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Order"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/byEmail": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getOrdersByCustomerEmail",
                "parameters": [
                    {
                        "name": "customerEmail",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Order"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/customers/getCustomersName": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getCustomersName",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/customers/getCustomer": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getCustomer",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Customer"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/customers/getCustomerList": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getCustomersList",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Customer"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/customers/getCustomerEmail": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getCustomerInfoSingleField",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "customerEmail": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/headOffice": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getHeadOffice",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HeadOffice"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/namedPrimitiveArray": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getNamedPrimitiveArray",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/primitive": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getSinglePrimitive",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/reservedColumns": {
            "get": {
                "tags": [
                    "rest-connector-controller"
                ],
                "operationId": "getReservedColumns",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Positions"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Address": {
                "type": "object",
                "properties": {
                    "street": {
                        "type": "string"
                    },
                    "city": {
                        "type": "string"
                    },
                    "country": {
                        "type": "string"
                    },
                    "zipcode": {
                        "type": "string"
                    }
                }
            },
            "Fullfilment": {
                "type": "object",
                "properties": {
                    "storeNo": {
                        "type": "string"
                    },
                    "lineItems": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/LineItems"
                        }
                    }
                }
            },
            "LineItems": {
                "type": "object",
                "properties": {
                    "itemName": {
                        "type": "string"
                    },
                    "itemId": {
                        "type": "string"
                    },
                    "qty": {
                        "type": "string"
                    }
                }
            },
            "Order": {
                "type": "object",
                "properties": {
                    "customerName": {
                        "type": "string"
                    },
                    "orderNo": {
                        "type": "string"
                    },
                    "phoneNo": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    },
                    "address": {
                        "$ref": "#/components/schemas/Address"
                    },
                    "fullfilments": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Fullfilment"
                        }
                    }
                }
            },
            "PaginatedOrders": {
                "type": "object",
                "properties": {
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Order"
                        }
                    }
                }
            },
            "SalesOrders": {
                "type": "object",
                "properties": {
                    "orders": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Order"
                        }
                    }
                }
            },
            "Customer": {
                "type": "object",
                "properties": {
                    "customerEmail": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    },
                    "customerName": {
                        "type": "string"
                    },
                    "phoneno": {
                        "type": "string"
                    },
                    "address": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        }
                    }
                }
            },
            "HeadOffice": {
                "type": "object",
                "properties": {
                    "longitude": {
                        "type": "number"
                    },
                    "latitude": {
                        "type": "number",
                        "format": "double"
                    },
                    "turnover": {
                        "type": "number",
                        "format": "float"
                    },
                    "milliSeconds": {
                        "type": "integer",
                        "format": "int64"
                    },
                    "storeNo": {
                        "type": "integer",
                        "format": "int32"
                    },
                    "noOfEmployees": {
                        "type": "integer"
                    }
                }
            },
            "Positions": {
                "type": "object",
                "properties": {
                    "position": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "Position_1": {
                                    "type": "integer"
                                },
                                "Position": {
                                    "type": "string"
                                },
                                "Position_3": {
                                    "type": "number",
                                    "format": "float"
                                },
                                "Position_4": {
                                    "type": "number",
                                    "format": "double"
                                },
                                "Position_2": {
                                    "type": "integer",
                                    "format": "int64"
                                },
                                "Position_11": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "parameters": {
            "orderNum": {
                "name": "orderNo",
                "in": "path",
                "required": true,
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            },
            "storeId": {
                "name": "storeId",
                "in": "query",
                "required": true,
                "schema": {
                    "type": "string"
                }
            }
        },
        "responses": {
            "orderSuccess": {
                "description": "OK",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/SalesOrders"
                        }
                    }
                }
            }
        }
    }
}