クラスタの Bastion API

クラスタの Bastion API 解説書

クラスタ

GET /clusters

クラスタのリストを取得する

応答 JSON オブジェクト
  • [] (object) --

  • [].id (string) -- クラスタ ID。

  • [].instanceID (string) -- terraform インスタンス ID。

  • [].source (string) -- terraform ソースロケーション。

  • [].static.isStatic (boolean) -- クラスタが静的かどうか

  • [].static.output[key] (undefined) --

  • [].category (string) -- クラスタカテゴリ。

応答例 :

[
  {
    "id": "myCluster",
    "instanceID": "myCluster",
    "category": "cluster",
    "static": {
      "isStatic": true,
      "output": {
        "server_public_ips": {
          "type": "list",
          "value": [
            "127.0.0.1"
          ]
        }
      }
    }
  }
]
GET /cluster/{clusterID}

クラスタを取得する

パラメータ
  • clusterID -- クラスタ ID

応答 JSON オブジェクト
  • id (string) -- クラスタ ID。

  • instanceID (string) -- terraform インスタンス ID。

  • source (string) -- terraform ソースロケーション。

  • static.isStatic (boolean) -- クラスタが静的かどうか

  • static.output[key] (undefined) --

  • category (string) -- クラスタカテゴリ。

応答例 :

{
  "id": "myCluster",
  "instanceID": "myCluster",
  "category": "cluster",
  "static": {
    "isStatic": true,
    "output": {
      "server_public_ips": {
        "type": "list",
        "value": [
          "127.0.0.1"
        ]
      }
    }
  }
}
POST /cluster/{clusterID}

クラスタを作成します。この操作により、terraform インスタンスが作成されます。

バージョン 1.35.0 で変更: テラフォームの init コマンドに -reconfigure を追加しました。

パラメータ
  • clusterID -- クラスタ ID

クエリパラメータ
  • fromCluster -- この新しいクラスタのクローン元のクラスタ ID。

リクエスト JSON オブジェクト
  • id (string) -- バックエンド ID

  • variables[key] (string) --

  • category (string) -- クラスタカテゴリ。

  • static.isStatic (boolean) -- クラスタが静的かどうか

  • static.output[key] (undefined) --

クエリ例 :

{
  "id": "",
  "variables": {},
  "category": "",
  "static": {
    "isStatic": true,
    "output": {
      "server_public_ips": {
        "type": "list",
        "value": [
          "127.0.0.1"
        ]
      }
    }
  }
}
DELETE /cluster/{clusterID}

クラスタを削除します。terraform インスタンスが破棄されていない場合、この操作は拒否されます。

パラメータ
  • clusterID -- クラスタ ID

クエリパラメータ
  • force -- 削除の操作を強制的に行う

PUT /cluster/{clusterID}/static/output

静的なクラスタ出力を更新します。

パラメータ
  • clusterID -- クラスタ ID

リクエスト JSON オブジェクト
  • isStatic (boolean) -- クラスタが静的かどうか

  • output[key].sensitive (boolean) --

  • output[key].type (string) --

  • output[key].value (undefined) --

クエリ例 :

{
  "isStatic": true,
  "output": {
    "server_public_ips": {
      "type": "list",
      "value": [
        "127.0.0.1"
      ]
    }
  }
}

画像

GET /cluster/{clusterID}/images

画像を取得する

パラメータ
  • clusterID -- クラスタ ID

応答 JSON オブジェクト
  • [key].id (string) --

  • [key].tag (string) --

  • [key].archfmt (string) --

  • [key].url (string) --

  • [key].dirty (boolean) --

応答例 :

{
  "itemA": {
    "id": "",
    "tag": "",
    "archfmt": "",
    "url": "",
    "dirty": false
  }
}
POST /cluster/{clusterID}/images

画像を設定する

パラメータ
  • clusterID -- クラスタ ID

リクエスト JSON オブジェクト
  • [key].id (string) --

  • [key].tag (string) --

  • [key].archfmt (string) --

  • [key].url (string) --

  • [key].dirty (boolean) --

クエリ例 :

{
  "itemA": {
    "id": "",
    "tag": "",
    "archfmt": "",
    "url": "",
    "dirty": false
  }
}
DELETE /cluster/{clusterID}/images

すべての画像を削除する

パラメータ
  • clusterID -- クラスタ ID

DELETE /cluster/{clusterID}/image/{imageID}

画像を削除する

パラメータ
  • clusterID -- クラスタ ID

  • imageID -- 画像 ID

セットアップジョブ

POST /bastion/cluster/{clusterID}/setup を実行する際に、クラスタでセットアップジョブが開始されます。これは、Hashi-UI ジョブの場合です。

GET /cluster/{clusterID}/setup_jobs

セットアップジョブを取得する。

パラメータ
  • clusterID -- クラスタ ID

応答 JSON オブジェクト
  • [key].id (string) -- セットアップジョブの一意の ID。

  • [key].template (string) -- ジョブを作成するテンプレート。

  • [key].hclv1 (boolean) -- ジョブテンプレートがHCLv1を使用している場合。

応答例 :

{
  "itemA": {
    "id": "",
    "template": "",
    "hclv1": false
  }
}
POST /cluster/{clusterID}/setup_jobs

セットアップジョブを設定する

パラメータ
  • clusterID -- クラスタ ID

リクエスト JSON オブジェクト
  • [key].id (string) -- セットアップジョブの一意の ID。

  • [key].template (string) -- ジョブを作成するテンプレート。

  • [key].hclv1 (boolean) -- ジョブテンプレートがHCLv1を使用している場合。

クエリ例 :

{
  "itemA": {
    "id": "",
    "template": "",
    "hclv1": false
  }
}
DELETE /cluster/{clusterID}/setup_jobs

すべてのセットアップジョブを削除する

パラメータ
  • clusterID -- クラスタ ID

セットアップ

POST /cluster/{clusterID}/setup

セットアップジョブを開始する

パラメータ
  • clusterID -- クラスタ ID

POST /cluster/{clusterID}/clean

セットアップジョブを停止し、consul 設定を消去する

パラメータ
  • clusterID -- クラスタ ID

サービス

GET /cluster/{clusterID}/services/{service}

サービスアドレスを取得する

パラメータ
  • clusterID -- クラスタ ID

  • service -- サービス ID

応答 JSON オブジェクト
  • [] (string) --

応答例 :

[
  "[::1]:20222"
]