次の方法で共有


Microsoft Fabric データ パイプラインパブリック REST API (プレビュー)

重要

Data Factory の Microsoft Fabric API は現在パブリック プレビュー段階です。 この情報は、リリース前に大幅に変更される可能性があるプレリリース製品に関連します。 ここに記載された情報について、Microsoft は明示か黙示かを問わずいかなる保証をするものでもありません。

Microsoft Fabric では、Data Factory API はパイプラインとデータフローに対する CRUD 操作のみで構成されます。 現在、パイプラインのみがサポートされています。 データフロー API はまだ使用できません。 データ統合プロジェクトのその他の共通領域は個別の API (スケジュール、監視、接続) にあり、ファブリック内に独自の API があります。 Microsoft Fabric REST API の主要なオンライン リファレンス ドキュメントについては、Microsoft Fabric REST API リファレンスを参照してください。 また、 コア項目 APIジョブ スケジューラも参照してください。

ペイロード base64 でエンコードされた項目定義

  • Base64 エンコードとデコードを使用してJSON をエンコードします。
  • [URL セーフ エンコードの実行] ボックスがチェックされていないことを確認します。
  • パイプライン定義は、ファブリック ユーザー インターフェイスの [表示] -- >[JSON コードの表示] タブから取得できます。
{ 
    "name": "Pipeline_1_updated", 
    "objectId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
    "properties": { 
        "description": "this is the description", 
        "activities": [ 
            { 
                "name": "Wait1", 
                "type": "Wait", 
                "dependsOn": [], 
                "typeProperties": { 
                    "waitTimeInSeconds": 240 
                } 
            } 
        ], 
        "annotations": [], 
        "lastModifiedByObjectId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
        "lastPublishTime": "2024-02-01T17:28:02Z" 
    } 
}

properties オブジェクトを取り、中かっこ- { } -で囲むので、REST 項目定義ペイロードは次のようになります。

{
    "properties": { 
        "description": "this is the description", 
        "activities": [ 
            { 
                "name": "Wait1", 
                "type": "Wait", 
                "dependsOn": [], 
                "typeProperties": { 
                    "waitTimeInSeconds": 240 
                } 
            } 
        ], 
        "annotations": [], 
        "lastModifiedByObjectId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
        "lastPublishTime": "2024-02-01T17:28:02Z" 
    } 
} 

アイテムの作成

REST API - 項目 - アイテムの作成

例 - CreateDataPipeline:

POST https://api.fabric.microsoft.com/v1/workspaces/<your WS Id>/items

本文は次のようになります。

{ 
  "displayName": "pipeline_1", 
  "type": "DataPipeline" 
} 

Note

ドキュメントには、displayNametype という 2 つの必須プロパティしかないことが示されています。 現在、Workload-DI では、定義 なしでの作成もサポートされていません。 この誤った要件に対する修正プログラムは、現在デプロイ中です。 現時点では、ファブリック ユーザー インターフェイス ‘{"properties":{"activities":[]}}’ で使用されるのと同じデフォルト定義を送信できます。

定義を含む変更された JSON:

{ 
  "displayName": "pipeline_1", 
  "type": "DataPipeline", 
  "definition": { 
    "parts": [ 
      { 
        "path": "pipeline-content.json", 
        "payload": "eyJwcm9wZXJ0aWVzIjp7ImFjdGl2aXRpZXMiOltdfX0=", 
        "payloadType": "InlineBase64" 
      } 
    ] 
  } 
} 

応答 201:

{ 
    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
    "type": "DataPipeline", 
    "displayName": "Pipeline_1", 
    "description": "", 
    "workspaceId": "<Your WS Id>" 
} 

アイテムの削除

REST API - 項目 - アイテムの削除

例:

DELETE https://api.fabric.microsoft.com/v1/workspaces/<your WS Id>/items/<pipeline id>

応答 200: (本文なし)

項目を取得する

REST API - 項目 - アイテムの取得

例:

GET https://api.fabric.microsoft.com/v1/workspaces/<your WS Id>/items/<pipeline id>

応答 200:

{ 
    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
    "type": "DataPipeline", 
    "displayName": "Pipeline_1", 
    "workspaceId": "<your WS Id>" 
} 

項目定義を取得する

REST API - 項目 - 項目定義の取得

例:

POST https://api.fabric.microsoft.com/v1/workspaces/<your WS Id>/items/<pipeline id>/getDefinition

応答 200:

{ 
    "definition": { 
        "parts":[ 
            { 
                "path": "pipeline-content.json", 
                "payload": "ewogICJwcm9wZXJ0aWVzIjogewogICAgImFjdGl2aXRpZXMiOiBbXQogIH0KfQ==", 
                "payloadType": "InlineBase64" 
            } 
        ] 
    } 
} 

項目を一覧表示する

REST API - 項目 - リスト 項目

例:

GET https://api.fabric.microsoft.com/v1/workspaces/<your WS Id>/items

応答 200:

{ 
    "value": [ 
        { 
            "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
            "type": "SemanticModel", 
            "displayName": "deata_lh", 
            "description": "", 
            "workspaceId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 
        }, 
        { 
            "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
            "type": "SQLEndpoint", 
            "displayName": "deata_lh", 
            "description": "", 
            "workspaceId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 
        }, 
        { 
            "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
            "type": "Lakehouse", 
            "displayName": "deata_lh", 
            "description": "", 
            "workspaceId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 
        }, 
        { 
            "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
            "type": "DataPipeline", 
            "displayName": "Pipeline_1", 
            "description": "", 
            "workspaceId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 
        } 
    ] 
} 

項目を更新する

REST API - アイテム - アイテムの更新

例:

PATCH https://api.fabric.microsoft.com/v1/workspaces/<your WS Id>/items/<pipeline id>

本文は次のようになります。

{ 
  "displayName": "Pipeline_1_updated", 
  "description": "This is the description." 
}

応答 200:

{ 
    "id": "<pipeline id>", 
    "type": "DataPipeline", 
    "displayName": "Pipeline_1_updated", 
    "description": "This is the description.", 
    "workspaceId": "<Your WS id>" 
}

項目定義を更新する

REST API - 項目 - アイテム定義の更新

例:

POST https://api.fabric.microsoft.com/v1/workspaces/<your WS Id>/items/<pipeline id>/updateDefinition

本文は次のようになります。

{ 
  "definition": { 
    "parts": [ 
      { 
        "path": "pipeline-content.json", 
        "payload": "eyJwcm9wZXJ0aWVzIjp7ImFjdGl2aXRpZXMiOltdfX0=", 
        "payloadType": "InlineBase64" 
      } 
    ] 
  } 
}

応答 200: (本文なし)

オンデマンドの項目ジョブの実行

REST API - 項目 - オンデマンド項目ジョブの実行

例:

POST https://api.fabric.microsoft.com/v1/workspaces/<your WS Id>/items/<pipeline id>/jobs/instances?jobType=Pipeline

応答 202: (本文なし)

2 つのパラメーター値を持つ例:

以下は、待機する秒数を指定する param_waitsec という名前のパラメーターを持つ Wait アクティビティの例です。

POST https://api.fabric.microsoft.com/v1/workspaces/<your WS Id>/items/<pipeline id>/jobs/instances?jobType=Pipeline

本文は次のようになります。

{ 
  "executionData": { 
    "parameters": {
      "param_waitsec": "10" 
    } 
  } 
}

応答 202: (本文なし)

Note

現在、本文は返されていませんが、ジョブ ID は返されているはずです。 プレビュー中には、返されたヘッダー内の Location プロパティで見つけることができます。

項目ジョブのインスタンスの取得

REST API - アイテム - 項目ジョブのインスタンスの取得

例:

GET https://api.fabric.microsoft.com/v1/workspaces/<your WS Id>/items/<pipeline id>/jobs/instances/<job ID>

応答 200:

{ 
    "id": "4511ffcd-a9f6-4f75-91a9-9ceab08d7539", 
    "itemId": "2bb9fe4a-0a84-4725-a01f-7ac4e6850259", 
    "jobType": "Pipeline", 
    "invokeType": "Manual", 
    "status": "Completed", 
    "failureReason": null, 
    "rootActivityId": "f14bdd95-2cff-4451-b839-bea81509126d", 
    "startTimeUtc": "2024-02-01T03:03:19.8361605", 
    "endTimeUtc": "2024-02-01T03:05:00.3433333" 
} 

項目ジョブのインスタンスの取り消し

REST API - 項目 - アイテム ジョブ インスタンスの取り消し

例:

POST https://api.fabric.microsoft.com/v1/workspaces/<your WS Id>/items/<pipeline id>/jobs/instances/<job ID>/cancel

応答 202: (本文なし)

Note

ジョブを取り消した後、Get item job instance を呼び出すか、Fabric ユーザー インターフェイスで View 実行履歴 を確認することで、状態を確認できます。

アクティビティ実行のクエリ

例:

POST https://api.fabric.microsoft.com/v1/workspaces/<your WS Id>/datapipelines/pipelineruns/<Job ID>/queryactivityruns

本文は次のようになります。

{
  "filters":[],
  "orderBy":[{"orderBy":"ActivityRunStart","order":"DESC"}],
  "lastUpdatedAfter":"2024-05-22T14:02:04.1423888Z",
  "lastUpdatedBefore":"2024-05-24T13:21:27.738Z"
}

Note

"job id" は、Job Scheduler パブリック API で作成および使用される ID と同じです

応答 200:

[
    {
        "pipelineName": "ca91f97e-5bdd-4fe1-b39a-1f134f26a701",
        "pipelineRunId": "bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f",
        "activityName": "Wait1",
        "activityType": "Wait",
        "activityRunId": "cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a",
        "linkedServiceName": "",
        "status": "Succeeded",
        "activityRunStart": "2024-05-23T13:43:03.6397566Z",
        "activityRunEnd": "2024-05-23T13:43:31.3906179Z",
        "durationInMs": 27750,
        "input": {
            "waitTimeInSeconds": 27
        },
        "output": {},
        "error": {
            "errorCode": "",
            "message": "",
            "failureType": "",
            "target": "Wait1",
            "details": ""
        },
        "retryAttempt": null,
        "iterationHash": "",
        "userProperties": {},
        "recoveryStatus": "None",
        "integrationRuntimeNames": null,
        "executionDetails": null,
        "id": "/SUBSCRIPTIONS/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/RESOURCEGROUPS/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/PROVIDERS/MICROSOFT.TRIDENT/WORKSPACES/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/pipelineruns/bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f/activityruns/cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a"
    }
]

既知の制限事項

  • サービス プリンシパル認証 (SPN) は現在サポートされていません。