クラスタの Bastion API

クラスタの Bastion API 解説書

クラスタ

GET /bastion/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 /bastion/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 /bastion/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 /bastion/cluster/{clusterID}

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

パラメータ:
  • clusterID – クラスタ ID
クエリパラメータ:
  • force – 削除の操作を強制的に行う

画像

GET /bastion/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 /bastion/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 /bastion/cluster/{clusterID}/images

すべての画像を削除する

パラメータ:
  • clusterID – クラスタ ID
DELETE /bastion/cluster/{clusterID}/image/{imageID}

画像を削除する

パラメータ:
  • clusterID – クラスタ ID
  • imageID – 画像 ID

セットアップジョブ

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

GET /bastion/cluster/{clusterID}/setup_jobs

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

パラメータ:
  • clusterID – クラスタ ID
応答 JSON オブジェクト:
  • [key].id (string) – セットアップジョブの一意の ID。
  • [key].template (string) – ジョブを作成するテンプレート。
  • [key].hclv1 (boolean) – ジョブテンプレートがHCLv1を使用している場合。

応答例 :

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

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

パラメータ:
  • clusterID – クラスタ ID
リクエスト JSON オブジェクト:
 
  • [key].id (string) – セットアップジョブの一意の ID。
  • [key].template (string) – ジョブを作成するテンプレート。
  • [key].hclv1 (boolean) – ジョブテンプレートがHCLv1を使用している場合。

クエリ例 :

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

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

パラメータ:
  • clusterID – クラスタ ID

セットアップ

POST /bastion/cluster/{clusterID}/setup

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

パラメータ:
  • clusterID – クラスタ ID
POST /bastion/cluster/{clusterID}/clean

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

パラメータ:
  • clusterID – クラスタ ID

サービス

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

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

パラメータ:
  • clusterID – クラスタ ID
  • service – サービス ID
応答 JSON オブジェクト:
  • [] (string) –

応答例 :

[
  "[::1]:20222"
]