> ## 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.
# dbt Gitリポジトリ作成
> dbt Gitリポジトリを作成します。
作成時にTROCCOが自動でSSH鍵ペアを生成します。レスポンスに含まれる`public_deploy_key`をGitホストにデプロイキーとして登録してください。
## OpenAPI
````json POST /api/dbt_git_repositories
{
"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/dbt_git_repositories": {
"post": {
"summary": "dbt Gitリポジトリ作成",
"description": "dbt Gitリポジトリを作成します。
\n作成時にTROCCOが自動でSSH鍵ペアを生成します。レスポンスに含まれる`public_deploy_key`をGitホストにデプロイキーとして登録してください。\n",
"operationId": "createDbtGitRepository",
"tags": [
"dbt_git_repositories"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"description": "dbt Gitリポジトリ名",
"type": "string",
"example": "sample_repository"
},
"description": {
"description": "説明",
"type": "string",
"example": "サンプルリポジトリ"
},
"adapter_type": {
"type": "string",
"enum": [
"bigquery",
"snowflake",
"redshift"
],
"example": "bigquery"
},
"dbt_version": {
"type": "string",
"enum": [
"1.8",
"1.9",
"1.10",
"1.11",
"1.12"
],
"example": "1.12"
},
"url": {
"description": "GitリポジトリのURL",
"type": "string",
"example": "git@github.com:trocco-io/dbt-sample.git"
},
"ref_type": {
"description": "参照タイプ。省略時は `branch`。
\n`branch` の場合は `branch`、`tag` の場合は `tag`、`commit_hash` の場合は `commit_hash` を必ず指定してください。\n",
"type": "string",
"enum": [
"branch",
"tag",
"commit_hash"
],
"default": "branch",
"example": "branch"
},
"branch": {
"description": "同期対象のブランチ名(`ref_type` が `branch` の場合に必須)",
"type": "string",
"example": "main"
},
"tag": {
"description": "同期対象のタグ名(`ref_type` が `tag` の場合に必須)",
"type": "string",
"example": "v1.0.0"
},
"commit_hash": {
"description": "同期対象のコミットハッシュ(`ref_type` が `commit_hash` の場合に必須、40桁の16進数)",
"type": "string",
"example": "0123456789abcdef0123456789abcdef01234567"
},
"subdirectory": {
"description": "Gitリポジトリ内でdbtプロジェクトが配置されているサブディレクトリ",
"type": "string",
"example": "dbt/"
},
"resource_group_id": {
"description": "リソースグループID",
"type": "integer",
"format": "int64",
"example": 1
}
},
"required": [
"name",
"adapter_type",
"dbt_version",
"url"
]
}
}
}
},
"responses": {
"201": {
"description": "作成したdbt Gitリポジトリの詳細を返します。",
"content": {
"application/json": {
"schema": {
"title": "DbtGitRepository",
"type": "object",
"properties": {
"id": {
"description": "dbt Gitリポジトリ ID",
"type": "integer",
"format": "int64",
"example": 1
},
"name": {
"description": "dbt Gitリポジトリ名",
"type": "string",
"example": "sample_repository"
},
"description": {
"description": "説明",
"type": "string",
"nullable": true,
"example": "サンプルリポジトリ"
},
"adapter_type": {
"description": "アダプタータイプ。作成時にのみ指定可能で、後から変更できません。\n",
"type": "string",
"enum": [
"bigquery",
"snowflake",
"redshift"
],
"example": "bigquery"
},
"dbt_version": {
"description": "dbtバージョン",
"type": "string",
"enum": [
"1.8",
"1.9",
"1.10",
"1.11",
"1.12"
],
"example": "1.12"
},
"url": {
"description": "GitリポジトリのURL",
"type": "string",
"example": "git@github.com:trocco-io/dbt-sample.git"
},
"ref_type": {
"description": "参照タイプ。`branch` の場合は `branch`、`tag` の場合は `tag`、`commit_hash` の場合は `commit_hash` の値を使用します。\n",
"type": "string",
"enum": [
"branch",
"tag",
"commit_hash"
],
"example": "branch"
},
"branch": {
"description": "同期対象のブランチ名(`ref_type` が `branch` の場合に使用)",
"type": "string",
"nullable": true,
"example": "main"
},
"tag": {
"description": "同期対象のタグ名(`ref_type` が `tag` の場合に使用)",
"type": "string",
"nullable": true,
"example": "v1.0.0"
},
"commit_hash": {
"description": "同期対象のコミットハッシュ(`ref_type` が `commit_hash` の場合に使用、40桁の16進数)",
"type": "string",
"nullable": true,
"example": "0123456789abcdef0123456789abcdef01234567"
},
"subdirectory": {
"description": "Gitリポジトリ内でdbtプロジェクトが配置されているサブディレクトリ",
"type": "string",
"nullable": true,
"example": "dbt/"
},
"resource_group_id": {
"description": "リソースグループID",
"type": "integer",
"format": "int64",
"nullable": true,
"example": 1
},
"public_deploy_key": {
"description": "TROCCOが生成した公開デプロイキー(SSH公開鍵)。
\nGitホスト側にデプロイキーとして登録することで、TROCCOがリポジトリにアクセスできるようになります。\n",
"type": "string",
"nullable": true,
"example": "ssh-rsa AAAAB3NzaC1yc2E... trocco_dbt_git_repository"
},
"deploy_key_fingerprint": {
"description": "公開デプロイキーのSHA256フィンガープリント。",
"type": "string",
"nullable": true,
"example": "SHA256:abc123..."
},
"created_at": {
"description": "作成日時",
"type": "string",
"example": "2023-08-22T18:00:00+00:00"
},
"updated_at": {
"description": "更新日時",
"type": "string",
"example": "2023-08-22T18:00:00+00:00"
}
},
"required": [
"id",
"name",
"adapter_type",
"dbt_version",
"url",
"ref_type",
"created_at",
"updated_at"
]
}
}
}
},
"400": {
"description": "不正なリクエストです。\n"
},
"401": {
"description": "API KEYが不正です。\n"
},
"403": {
"description": "dbt Gitリポジトリ作成権限がありません。\n"
},
"404": {
"description": "指定した`resource_group_id`が存在しません。\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"
}
}
}
}
````