> ## Documentation Index
> Fetch the complete documentation index at: https://documents.trocco.io/llms.txt
> Use this file to discover all available pages before exploring further.
# データマートジョブ実行結果取得
> データマートジョブを指定して、データマートジョブの実行結果を取得します。
データマートジョブの実行ログは本APIでは返却しません。
## OpenAPI
````json GET /api/datamart_jobs/{datamart_job_id}
{
"openapi": "3.0.3",
"info": {
"title": "trocco APIリファレンス",
"description": "trocco APIリファレンス",
"version": "0.0.1"
},
"servers": [
{
"url": "https://trocco.io"
}
],
"security": [
{
"ApiKeyAuth": []
}
],
"tags": [
{
"name": "users",
"description": "ユーザー",
"externalDocs": {
"url": "https://documents.trocco.io/docs/about-account-user"
}
},
{
"name": "teams",
"description": "チーム",
"externalDocs": {
"url": "https://documents.trocco.io/docs/team"
}
},
{
"name": "connections",
"description": "接続情報",
"externalDocs": {
"url": "https://documents.trocco.io/docs/connection-configurations"
}
},
{
"name": "custom_connectors",
"description": "カスタムコネクタ定義"
},
{
"name": "datamart_definitions",
"description": "データマート定義",
"externalDocs": {
"url": "https://documents.trocco.io/docs/data-mart"
}
},
{
"name": "environment_groups",
"description": "環境グループ"
},
{
"name": "environments",
"description": "環境"
},
{
"name": "jobs",
"description": "転送ジョブ",
"externalDocs": {
"url": "https://documents.trocco.io/docs/etl-configuration"
}
},
{
"name": "pipeline_jobs",
"description": "ワークフロージョブ",
"externalDocs": {
"url": "https://documents.trocco.io/docs/about-workflow"
}
},
{
"name": "resource_groups",
"description": "リソースグループ",
"externalDocs": {
"url": "https://documents.trocco.io/docs/resource-group"
}
},
{
"name": "dbt_git_repositories",
"description": "dbt Gitリポジトリ"
},
{
"name": "dbt_job_definitions",
"description": "dbtジョブ設定",
"externalDocs": {
"url": "https://documents.trocco.io/docs/dbt-job-configuration"
}
},
{
"name": "dbt_jobs",
"description": "dbtジョブ",
"externalDocs": {
"url": "https://documents.trocco.io/docs/dbt-job-configuration"
}
},
{
"name": "notification_destinations",
"description": "通知先",
"externalDocs": {
"url": "https://documents.trocco.io/docs/trocco-tutorial-additional-settings"
}
}
],
"externalDocs": {
"description": "trocco APIについて",
"url": "https://documents.trocco.io/docs/trocco-api"
},
"paths": {
"/api/datamart_jobs/{datamart_job_id}": {
"get": {
"summary": "データマートジョブ実行結果取得",
"description": "データマートジョブを指定して、データマートジョブの実行結果を取得します。
\nデータマートジョブの実行ログは本APIでは返却しません。\n",
"operationId": "getDatamartJob",
"tags": [
"datamart_jobs"
],
"parameters": [
{
"name": "datamart_job_id",
"description": "データマートジョブIDを指定します。
\nTROCCO画面からIDを確認する場合は、[API実行時に指定する各種パラメーターの確認方法](https://documents.trocco.io/trocco-api/apidocs/overview#api%E5%AE%9F%E8%A1%8C%E6%99%82%E3%81%AB%E6%8C%87%E5%AE%9A%E3%81%99%E3%82%8B%E5%90%84%E7%A8%AE%E3%83%91%E3%83%A9%E3%83%A1%E3%83%BC%E3%82%BF%E3%83%BC%E3%81%AE%E7%A2%BA%E8%AA%8D%E6%96%B9%E6%B3%95)を参照ください。\n",
"required": true,
"in": "path",
"schema": {
"type": "integer",
"format": "int64"
},
"example": 123
}
],
"responses": {
"200": {
"description": "データマートジョブの実行結果を返します。",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"description": "データマートジョブIDです。",
"type": "integer",
"format": "int64",
"example": 123
},
"datamart_definition_id": {
"description": "データマート定義IDです。",
"type": "integer",
"format": "int64",
"example": 45
},
"datamart_definition_name": {
"description": "データマート定義名です。",
"type": "string",
"example": "sample-datamart-definition-name"
},
"status": {
"title": "DatamartJobStatus",
"type": "string",
"description": "データマートジョブのステータスです。転送ジョブと異なり`timeout`を持ちません。\n- `queued` - 実行待機\n- `setting_up` - 実行準備\n- `executing` - 実行中\n- `interrupting` - 実行中断\n- `succeeded` - 実行完了(成功)\n- `error` - 実行完了(エラー)\n- `canceled` - 実行完了(キャンセル)\n- `skipped` - 実行完了(スキップ)\n",
"enum": [
"queued",
"setting_up",
"executing",
"interrupting",
"succeeded",
"error",
"canceled",
"skipped"
],
"example": "succeeded"
},
"executor_type": {
"description": "データマートジョブの実行タイプです。\n- `api` - API実行\n- `manual` - 手動実行\n- `scheduler` - スケジュール実行\n- `job_dependency` - ジョブ依存実行\n- `workflow` - ワークフロー実行\n",
"type": "string",
"enum": [
"api",
"manual",
"scheduler",
"job_dependency",
"workflow"
],
"example": "scheduler"
},
"pipeline_job_id": {
"description": "ワークフロー経由で実行された場合の、親となるワークフロージョブIDです。
\nワークフロー経由の実行でない場合は`null`です。\n",
"type": "integer",
"format": "int64",
"nullable": true,
"example": 987
},
"context_time": {
"description": "カスタム変数 時刻・日付(キューイング時) の展開基準日時です。タイムゾーンはJST 日本時間(GMT+9)です。\n",
"type": "string",
"nullable": true,
"example": "2023-05-19T10:00:00+00:00"
},
"memo": {
"description": "データマートジョブ実行時に指定されたメモです。",
"type": "string",
"nullable": true,
"example": "定期実行の補足メモ"
},
"transfer_record": {
"description": "出力されたレコード数です。",
"type": "integer",
"format": "int64",
"nullable": true,
"example": 1200
},
"executed_query": {
"description": "実際に実行された、カスタム変数展開後のクエリです。
\nクエリが64KBを超える場合は64KBで切り詰められ、末尾に`[Query truncated]`が付与されます。\n",
"type": "string",
"nullable": true,
"example": "INSERT INTO `project.dataset.table` SELECT ... WHERE date = '2023-05-19'"
},
"overwrite_lookback_period": {
"description": "データマートジョブ実行時に上書き指定された振り返り期間です。
\n上書き指定がない場合は`null`です。\n",
"type": "object",
"nullable": true,
"properties": {
"mode": {
"description": "振り返り期間の上書き方法です。\n- `all` - 全期間で上書きする。`from` / `to` / `unit` は`null`です\n- `range` - 範囲を指定して上書きする\n",
"type": "string",
"enum": [
"all",
"range"
],
"example": "range"
},
"from": {
"description": "振り返り期間の開始(現在からさかのぼる単位数)です。
\n`mode`が`all`の場合、または開始を指定しなかった場合は`null`です。\n",
"type": "integer",
"nullable": true,
"example": 3
},
"to": {
"description": "振り返り期間の終了(現在からさかのぼる単位数)です。
\n`mode`が`all`の場合、または終了を指定しなかった場合は`null`です。\n",
"type": "integer",
"nullable": true,
"example": 1
},
"unit": {
"description": "振り返り期間の単位です。`mode`が`all`の場合は`null`です。\n- `days` - 日\n- `hours` - 時間\n",
"type": "string",
"enum": [
"days",
"hours"
],
"nullable": true,
"example": "days"
}
},
"required": [
"mode",
"from",
"to",
"unit"
]
},
"queued_up_at": {
"description": "データマートジョブのステータスが**実行待機**になった日時です。タイムゾーンはJST 日本時間(GMT+9)です。",
"type": "string",
"nullable": true,
"example": "2023-05-19T10:14:10+00:00"
},
"setting_up_at": {
"description": "データマートジョブのステータスが**実行準備**になった日時です。タイムゾーンはJST 日本時間(GMT+9)です。",
"type": "string",
"nullable": true,
"example": "2023-05-19T10:14:30+00:00"
},
"started_at": {
"description": "データマートジョブのステータスが**実行中**になった日時です。タイムゾーンはJST 日本時間(GMT+9)です。",
"type": "string",
"nullable": true,
"example": "2023-05-19T10:15:00+00:00"
},
"finished_at": {
"description": "データマートジョブのステータスが**実行完了**になった日時です。タイムゾーンはJST 日本時間(GMT+9)です。",
"type": "string",
"nullable": true,
"example": "2023-05-19T10:20:00+00:00"
},
"created_at": {
"description": "データマートジョブの作成日時です。タイムゾーンはJST 日本時間(GMT+9)です。",
"type": "string",
"example": "2023-05-19T10:14:00+00:00"
}
},
"required": [
"id",
"datamart_definition_id",
"datamart_definition_name",
"status",
"executor_type",
"pipeline_job_id",
"context_time",
"memo",
"transfer_record",
"executed_query",
"overwrite_lookback_period",
"queued_up_at",
"setting_up_at",
"started_at",
"finished_at",
"created_at"
]
}
}
}
},
"400": {
"description": "Bad request.
\n不正なリクエストです。\n"
},
"401": {
"description": "Not authenticated.
\n認証エラーです。API KEYをご確認ください。\n"
},
"403": {
"description": "Forbidden.
\nAPI KEYが不正か、基本機能の利用が許可されていないユーザーです。\n"
},
"404": {
"description": "Not found.
\n要求したリソースが見つかりません。\n"
}
}
}
}
},
"components": {
"securitySchemes": {
"ApiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "Authorization",
"description": "認証キーとなるAPI KEYをAuthorization: Token {{API KEY}}の形式でヘッダーにセットします。
\nAPI KEYがabc123の場合は、Authorization: Token abc123とします。
\nAPI KEYの作成方法は、TROCCO API KEYの作成を参照ください。\n"
}
}
}
}
````