Terraform の Bastion API

Terraform の Bastion API 解説書

モジュール

GET /terraform/repositories

terraform レポジトリのリストを取得する。

応答 JSON オブジェクト:

応答例 :

{
  "repositories": {
    "cluster": {
      "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/cluster"
    },
    "game": {
      "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/game"
    },
    "genvid": {
      "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/genvid"
    }
  }
}
PUT /terraform/repositories

すべての terraform レポジトリを更新する。

GET /terraform/repository/{repositoryID}

terraform レポジトリの本体を取得する。

パラメータ:
  • repositoryID – terraform レポジトリの名前。有効なフォルダ名で、すべて小文字である必要があります。
リクエスト JSON オブジェクト:
 
応答 JSON オブジェクト:

クエリ例 :

{
  "url": ""
}

応答例 :

{
  "repository": {
    "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/cluster"
  }
}
POST /terraform/repository/{repositoryID}

Terraform レポジトリの URL を設定し、更新します。

パラメータ:
  • repositoryID – terraform レポジトリの名前。有効なフォルダ名で、すべて小文字である必要があります。
リクエスト JSON オブジェクト:
 
応答 JSON オブジェクト:

クエリ例 :

{
  "url": ""
}

応答例 :

{
  "repository": {
    "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/cluster"
  }
}
PUT /terraform/repository/{repositoryID}

本体を指定した場合、レポジトリの定義を更新します。いずれの場合も、レポジトリを更新します。

パラメータ:
  • repositoryID – terraform レポジトリの名前。有効なフォルダ名で、すべて小文字である必要があります。
リクエスト JSON オブジェクト:
 
応答 JSON オブジェクト:

クエリ例 :

{
  "url": ""
}

応答例 :

{
  "repository": {
    "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/cluster"
  }
}
DELETE /terraform/repository/{repositoryID}

Terraform レポジトリを削除する。

パラメータ:
  • repositoryID – terraform レポジトリの名前。有効なフォルダ名で、すべて小文字である必要があります。
応答 JSON オブジェクト:

応答例 :

{
  "repository": {
    "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/cluster"
  }
}
GET /terraform/modules

利用可能なモジュールのリストを取得します。有効なモジュールだけが返されます。

応答 JSON オブジェクト:
  • modules[] (object) – Terraform モジュールのリスト。
  • modules[].repository (string) – このモジュールを含む Terraform レポジトリ。
  • modules[].path (string) – このモジュールの bastion ルートモジュールからの相対パス。
  • modules[].capabilities[] (string) – 機能の配列。

応答例 :

{
  "modules": [
    {
      "repository": "cluster",
      "path": "cluster/default",
      "capabilities": [
        "cluster-api"
      ]
    }
  ]
}
GET /terraform/modules/{prefix}

利用可能なモジュールのリストを、プレフィックス付きで取得します。有効なモジュールだけが返されます。

パラメータ:
  • prefix – フィルタリングするプレフィックス。このプレフィックスのモジュールだけが返されます。部分一致のフォルダは含まれません。
応答 JSON オブジェクト:
  • modules[] (object) – Terraform モジュールのリスト。
  • modules[].repository (string) – このモジュールを含む Terraform レポジトリ。
  • modules[].path (string) – このモジュールの bastion ルートモジュールからの相対パス。
  • modules[].capabilities[] (string) – 機能の配列。

応答例 :

{
  "modules": [
    {
      "repository": "cluster",
      "path": "cluster/default",
      "capabilities": [
        "cluster-api"
      ]
    }
  ]
}
GET /terraform/module/{module}

Terraform モジュールの説明を取得します。

パラメータ:
  • module – モジュールの相対パス。
応答 JSON オブジェクト:
  • module.path (string) – このモジュールの bastion ルートモジュールからの相対パス。
  • module.variable[key].type (string) – 変数の型。
  • module.variable[key].description (string) – 変数の説明。
  • module.variable[key].default – 変数のデフォルト値。使用できる型は、文字列、配列、オブジェクト、null です。
  • module.output[key].value – 出力値。使用できる型は、文字列、配列、オブジェクト、null です。
  • module.output[key].description (string) – 出力値の説明。
  • module.output[key].sensitive (boolean) – 出力値がセンシティブ値かどうか
  • module.output[key].depends_on[] (string) – 出力値の明示的な依存性。

応答例 :

{
  "module": {
    "path": "cluster/default",
    "variable": {
      "game_az": {
        "description": "AWS Availability Zone where the game instance is to be created.\n",
        "default": "a"
      },
      "game_count": {
        "description": "Number of game instance to spawn",
        "default": 1
      }
    },
    "output": {
      "game_private_ips": {
        "value": "${module.game.private_ips}"
      },
      "game_public_ips": {
        "value": "${module.game.public_ips}"
      }
    }
  }
}

Terraform

GET /terraform/instances

Terraform インスタンスをすべて取得する。

応答 JSON オブジェクト:
  • [] (object) –
  • [].instanceID (string) –
  • [].modulePath (string) –
  • [].destination (string) –
  • [].bastionID (string) –
  • [].clusterID (string) –
  • [].serverIPs (string) –
  • [].static.isStatic (boolean) – クラスタが静的かどうか
  • [].static.output[key] (undefined) –
  • [].backendName (string) –
  • [].tfvars[key] – 使用できる型は、ブール、整数、数値、オブジェクト、文字列、null です。
  • [].backendConfig.id (string) – バックエンド ID
  • [].backendConfig.type (string) – バックエンドタイプ。
  • [].backendConfig.config[key].id (string) – 変数 ID。
  • [].backendConfig.config[key].editable (boolean) – 変数が編集可能かどうか。
  • [].backendConfig.config[key].asArgument (boolean) – 変数を引数として terraform に渡すか、設定ファイルに渡すか。
  • [].backendConfig.config[key].protected (boolean) – 変数を GUI のパスワードとして表示するかどうか。
  • [].backendConfig.config[key].value (string) – 変数の値。
  • [].rootModule (string) –
  • [].bastionVersion (string) –
  • [].terraformContextVersion (string) –

応答例 :

[
  {
    "instanceID": "my-cluster",
    "modulePath": "SDK-1.16.0/basic/basic_cluster",
    "destination": "C:\\Users\\myuser\\.genvid\\terraform\\workdir\\my-cluster\\tf",
    "clusterID": "my-cluster",
    "clusterUUID": "7dd1c33b-ca12-42eb-9b1c-fe95c21c66aa",
    "static": {
      "isStatic": false,
      "output": null
    },
    "backendName": "default",
    "tfvars": {
      "azs": [
        "1"
      ],
      "shared_gallery_image_version": "1.25.203",
      "shared_gallery_name": "genvid",
      "shared_gallery_resource_group_name": "genvidtech",
      "trusted_cidrs": [],
      "trusted_security_groups": [],
      "wingame_image_prefix": "genvidtech"
    },
    "providers": {
      "providers": [
        {
          "provider": "azurerm",
          "alias": null,
          "arguments": {
            "features": {}
          }
        }
      ]
    },
    "backendConfig": {
      "id": "default",
      "type": "consul",
      "config": {
        "address": {
          "id": "address",
          "editable": false,
          "asArgument": false,
          "protected": false,
          "value": "127.0.0.1:8500"
        },
        "path": {
          "id": "path",
          "editable": false,
          "asArgument": false,
          "protected": false,
          "value": "bastion/terraform/states/my-cluster/tfstate"
        }
      }
    },
    "rootModule": "{\n  \"module\": {\n    \"cluster\": {\n      \"admin_password\": \"${var.admin_password}\",\n      \"azs\": \"${var.azs}\",\n      \"cluster\": \"${var.cluster}\",\n      \"datacenter\": \"${var.datacenter}\",\n      \"instance_encoding_count\": \"${var.instance_encoding_count}\",\n      \"instance_encoding_type\": \"${var.instance_encoding_type}\",\n      \"instance_game_count\": \"${var.instance_game_count}\",\n      \"instance_game_type\": \"${var.instance_game_type}\",\n      \"instance_internal_count\": \"${var.instance_internal_count}\",\n      \"instance_internal_type\": \"${var.instance_internal_type}\",\n      \"instance_public_count\": \"${var.instance_public_count}\",\n      \"instance_public_type\": \"${var.instance_public_type}\",\n      \"instance_server_count\": \"${var.instance_server_count}\",\n      \"instance_server_type\": \"${var.instance_server_type}\",\n      \"location\": \"${var.location}\",\n      \"namespace\": \"${var.namespace}\",\n      \"shared_gallery_image_version\": \"${var.shared_gallery_image_version}\",\n      \"shared_gallery_name\": \"${var.shared_gallery_name}\",\n      \"shared_gallery_resource_group_name\": \"${var.shared_gallery_resource_group_name}\",\n      \"source\": \"..\\\\..\\\\..\\\\modules\\\\SDK-1.24.0\\\\basic\\\\azurerm_basic_cluster\",\n      \"stage\": \"${var.stage}\",\n      \"toolbox_location\": \"${var.toolbox_location}\",\n      \"trusted_cidr\": \"${var.trusted_cidr}\",\n      \"trusted_cidrs\": \"${var.trusted_cidrs}\",\n      \"trusted_security_groups\": \"${var.trusted_security_groups}\",\n      \"wingame_image_prefix\": \"${var.wingame_image_prefix}\"\n    }\n  },\n  \"output\": {\n    \"admin_username\": {\n      \"value\": \"${module.cluster.admin_username}\"\n    },\n    \"cloud_provider\": {\n      \"value\": \"${module.cluster.cloud_provider}\"\n    },\n    \"encoding_worker_public_ips\": {\n      \"value\": \"${module.cluster.encoding_worker_public_ips}\"\n    },\n    \"game_admin_password\": {\n      \"value\": \"${module.cluster.game_admin_password}\"\n    },\n    \"game_instance_ids\": {\n      \"value\": \"${module.cluster.game_instance_ids}\"\n    },\n    \"game_machine_locations\": {\n      \"value\": \"${module.cluster.game_machine_locations}\"\n    },\n    \"game_machine_names\": {\n      \"value\": \"${module.cluster.game_machine_names}\"\n    },\n    \"game_public_ips\": {\n      \"value\": \"${module.cluster.game_public_ips}\"\n    },\n    \"internal_worker_public_ips\": {\n      \"value\": \"${module.cluster.internal_worker_public_ips}\"\n    },\n    \"private_key_pem\": {\n      \"value\": \"${module.cluster.private_key_pem}\"\n    },\n    \"public_worker_public_ips\": {\n      \"value\": \"${module.cluster.public_worker_public_ips}\"\n    },\n    \"resource_group_name\": {\n      \"value\": \"${module.cluster.resource_group_name}\"\n    },\n    \"server_public_ips\": {\n      \"value\": \"${module.cluster.server_public_ips}\"\n    }\n  },\n  \"variable\": {\n    \"admin_password\": {\n      \"type\": \"string\",\n      \"description\": \"Administrative password for the game machine.\\nThat password must respect default windows password complexity.\\n\",\n      \"default\": \"1Genvid6!\"\n    },\n    \"azs\": {\n      \"type\": \"list(number)\",\n      \"description\": \"Enables multi-AZ, which automatically spans VMs across given availability zones. \\nEnabling this forces VMs to be rebuilt, due to their locations changing. An empty\\nlist disables multi-AZ. Options are 1, 2, 3\\n\",\n      \"default\": []\n    },\n    \"cluster\": {\n      \"type\": \"string\",\n      \"description\": \"Name of your cluster\"\n    },\n    \"datacenter\": {\n      \"description\": \"Consul/Nomad datacenter\",\n      \"default\": \"default\"\n    },\n    \"instance_encoding_count\": {\n      \"type\": \"number\",\n      \"description\": \"Number of internal workers to spawn\",\n      \"default\": 1\n    },\n    \"instance_encoding_type\": {\n      \"type\": \"string\",\n      \"description\": \"Type of Virtual Network to use for encoding servers\",\n      \"default\": \"Standard_F8s_v2\"\n    },\n    \"instance_game_count\": {\n      \"type\": \"number\",\n      \"description\": \"Number of game instances to spawn\",\n      \"default\": 1\n    },\n    \"instance_game_type\": {\n      \"type\": \"string\",\n      \"description\": \"Type of Virtual Network to use for game servers\",\n      \"default\": \"Standard_NV6\"\n    },\n    \"instance_internal_count\": {\n      \"type\": \"number\",\n      \"description\": \"Number of internal workers to spawn\",\n      \"default\": 1\n    },\n    \"instance_internal_type\": {\n      \"type\": \"string\",\n      \"description\": \"Type of Virtual Network to use for internal servers\",\n      \"default\": \"Standard_B2s\"\n    },\n    \"instance_public_count\": {\n      \"type\": \"number\",\n      \"description\": \"Number of public workers to spawn\",\n      \"default\": 1\n    },\n    \"instance_public_type\": {\n      \"type\": \"string\",\n      \"description\": \"Type of Virtual Network to use for public servers\",\n      \"default\": \"Standard_B2s\"\n    },\n    \"instance_server_count\": {\n      \"type\": \"number\",\n      \"description\": \"the number of supervisor servers.  Must be an odd number.\\n#It is usually 3 for production deployment.\\n\",\n      \"default\": 1\n    },\n    \"instance_server_type\": {\n      \"type\": \"string\",\n      \"description\": \"Type of Virtual Network instance to use for admin servers\",\n      \"default\": \"Standard_B2s\"\n    },\n    \"location\": {\n      \"type\": \"string\",\n      \"description\": \"Azure deployment location\",\n      \"default\": \"East US\"\n    },\n    \"namespace\": {\n      \"type\": \"string\",\n      \"description\": \"Deployment namespace that will regroup the clusters\",\n      \"default\": \"deployment\"\n    },\n    \"shared_gallery_image_version\": {\n      \"type\": \"string\",\n      \"description\": \"SDK Shared Image version, should be only one per Genvid SDK\",\n      \"default\": \"1.25.0000\"\n    },\n    \"shared_gallery_name\": {\n      \"type\": \"string\",\n      \"description\": \"Shared Gallery Name\",\n      \"default\": \"SDKgallery\"\n    },\n    \"shared_gallery_resource_group_name\": {\n      \"type\": \"string\",\n      \"description\": \"Shared Gallery Resource Group Name\",\n      \"default\": \"Genvid\"\n    },\n    \"stage\": {\n      \"type\": \"string\",\n      \"description\": \"Deployment stage\",\n      \"default\": \"dev\"\n    },\n    \"toolbox_location\": {\n      \"type\": \"string\",\n      \"description\": \"Genvid Toolbox Wheel file.\\nOnly required if you need to update the one from the .\\nAn empty value indicates to not install the toolbox.\\n\",\n      \"default\": \"\"\n    },\n    \"trusted_cidr\": {\n      \"type\": \"string\",\n      \"description\": \"CIDR to be trusted.  This should at least contains the external IP for\\nthe local machine.  Elsewhere, the provision and access to\\nconsul/nomad will fail.\\n\"\n    },\n    \"trusted_cidrs\": {\n      \"type\": \"list(string)\",\n      \"default\": []\n    },\n    \"trusted_security_groups\": {\n      \"type\": \"list(string)\",\n      \"description\": \"A list of security groups to be trusted.\",\n      \"default\": []\n    },\n    \"wingame_image_prefix\": {\n      \"type\": \"string\",\n      \"description\": \"Prefix of the wingame image\",\n      \"default\": \"default\"\n    }\n  }\n}",
    "bastionVersion": "",
    "terraformContextVersion": "1.27"
  }
]
GET /terraform/instances/status

Terraform インスタンスのステータスをすべて取得する。

応答 JSON オブジェクト:
  • [] (object) –
  • [].clusterID (string) – インスタンスの クラスタ ID。
  • [].instanceID (string) – インスタンスの クラスタ ID。
  • [].resourceCount (number) – Terraform が現在クラスタに割り当てているリソースの数。
  • [].status (string) – クラスタインスタンスのステータス

応答例 :

[
  {
    "clusterID": "MyCluster1",
    "instanceID": "MyCluster1",
    "status": "VOID",
    "resourceCount": 0
  }
]
GET /terraform/instance/{instanceID}

指定したTerraform インスタンスを取得する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • instanceID (string) –
  • modulePath (string) –
  • destination (string) –
  • bastionID (string) –
  • clusterID (string) –
  • serverIPs (string) –
  • static.isStatic (boolean) – クラスタが静的かどうか
  • static.output[key] (undefined) –
  • backendName (string) –
  • tfvars[key] – 使用できる型は、ブール、整数、数値、オブジェクト、文字列、null です。
  • backendConfig.id (string) – バックエンド ID
  • backendConfig.type (string) – バックエンドタイプ。
  • backendConfig.config[key].id (string) – 変数 ID。
  • backendConfig.config[key].editable (boolean) – 変数が編集可能かどうか。
  • backendConfig.config[key].asArgument (boolean) – 変数を引数として terraform に渡すか、設定ファイルに渡すか。
  • backendConfig.config[key].protected (boolean) – 変数を GUI のパスワードとして表示するかどうか。
  • backendConfig.config[key].value (string) – 変数の値。
  • rootModule (string) –
  • bastionVersion (string) –
  • terraformContextVersion (string) –

応答例 :

{
  "instanceID": "my-cluster",
  "modulePath": "SDK-1.16.0/basic/basic_cluster",
  "destination": "C:\\Users\\myuser\\.genvid\\terraform\\workdir\\my-cluster\\tf",
  "clusterID": "my-cluster",
  "clusterUUID": "7dd1c33b-ca12-42eb-9b1c-fe95c21c66aa",
  "static": {
    "isStatic": false,
    "output": null
  },
  "backendName": "default",
  "tfvars": {
    "azs": [
      "1"
    ],
    "shared_gallery_image_version": "1.25.203",
    "shared_gallery_name": "genvid",
    "shared_gallery_resource_group_name": "genvidtech",
    "trusted_cidrs": [],
    "trusted_security_groups": [],
    "wingame_image_prefix": "genvidtech"
  },
  "providers": {
    "providers": [
      {
        "provider": "azurerm",
        "alias": null,
        "arguments": {
          "features": {}
        }
      }
    ]
  },
  "backendConfig": {
    "id": "default",
    "type": "consul",
    "config": {
      "address": {
        "id": "address",
        "editable": false,
        "asArgument": false,
        "protected": false,
        "value": "127.0.0.1:8500"
      },
      "path": {
        "id": "path",
        "editable": false,
        "asArgument": false,
        "protected": false,
        "value": "bastion/terraform/states/my-cluster/tfstate"
      }
    }
  },
  "rootModule": "{\n  \"module\": {\n    \"cluster\": {\n      \"admin_password\": \"${var.admin_password}\",\n      \"azs\": \"${var.azs}\",\n      \"cluster\": \"${var.cluster}\",\n      \"datacenter\": \"${var.datacenter}\",\n      \"instance_encoding_count\": \"${var.instance_encoding_count}\",\n      \"instance_encoding_type\": \"${var.instance_encoding_type}\",\n      \"instance_game_count\": \"${var.instance_game_count}\",\n      \"instance_game_type\": \"${var.instance_game_type}\",\n      \"instance_internal_count\": \"${var.instance_internal_count}\",\n      \"instance_internal_type\": \"${var.instance_internal_type}\",\n      \"instance_public_count\": \"${var.instance_public_count}\",\n      \"instance_public_type\": \"${var.instance_public_type}\",\n      \"instance_server_count\": \"${var.instance_server_count}\",\n      \"instance_server_type\": \"${var.instance_server_type}\",\n      \"location\": \"${var.location}\",\n      \"namespace\": \"${var.namespace}\",\n      \"shared_gallery_image_version\": \"${var.shared_gallery_image_version}\",\n      \"shared_gallery_name\": \"${var.shared_gallery_name}\",\n      \"shared_gallery_resource_group_name\": \"${var.shared_gallery_resource_group_name}\",\n      \"source\": \"..\\\\..\\\\..\\\\modules\\\\SDK-1.24.0\\\\basic\\\\azurerm_basic_cluster\",\n      \"stage\": \"${var.stage}\",\n      \"toolbox_location\": \"${var.toolbox_location}\",\n      \"trusted_cidr\": \"${var.trusted_cidr}\",\n      \"trusted_cidrs\": \"${var.trusted_cidrs}\",\n      \"trusted_security_groups\": \"${var.trusted_security_groups}\",\n      \"wingame_image_prefix\": \"${var.wingame_image_prefix}\"\n    }\n  },\n  \"output\": {\n    \"admin_username\": {\n      \"value\": \"${module.cluster.admin_username}\"\n    },\n    \"cloud_provider\": {\n      \"value\": \"${module.cluster.cloud_provider}\"\n    },\n    \"encoding_worker_public_ips\": {\n      \"value\": \"${module.cluster.encoding_worker_public_ips}\"\n    },\n    \"game_admin_password\": {\n      \"value\": \"${module.cluster.game_admin_password}\"\n    },\n    \"game_instance_ids\": {\n      \"value\": \"${module.cluster.game_instance_ids}\"\n    },\n    \"game_machine_locations\": {\n      \"value\": \"${module.cluster.game_machine_locations}\"\n    },\n    \"game_machine_names\": {\n      \"value\": \"${module.cluster.game_machine_names}\"\n    },\n    \"game_public_ips\": {\n      \"value\": \"${module.cluster.game_public_ips}\"\n    },\n    \"internal_worker_public_ips\": {\n      \"value\": \"${module.cluster.internal_worker_public_ips}\"\n    },\n    \"private_key_pem\": {\n      \"value\": \"${module.cluster.private_key_pem}\"\n    },\n    \"public_worker_public_ips\": {\n      \"value\": \"${module.cluster.public_worker_public_ips}\"\n    },\n    \"resource_group_name\": {\n      \"value\": \"${module.cluster.resource_group_name}\"\n    },\n    \"server_public_ips\": {\n      \"value\": \"${module.cluster.server_public_ips}\"\n    }\n  },\n  \"variable\": {\n    \"admin_password\": {\n      \"type\": \"string\",\n      \"description\": \"Administrative password for the game machine.\\nThat password must respect default windows password complexity.\\n\",\n      \"default\": \"1Genvid6!\"\n    },\n    \"azs\": {\n      \"type\": \"list(number)\",\n      \"description\": \"Enables multi-AZ, which automatically spans VMs across given availability zones. \\nEnabling this forces VMs to be rebuilt, due to their locations changing. An empty\\nlist disables multi-AZ. Options are 1, 2, 3\\n\",\n      \"default\": []\n    },\n    \"cluster\": {\n      \"type\": \"string\",\n      \"description\": \"Name of your cluster\"\n    },\n    \"datacenter\": {\n      \"description\": \"Consul/Nomad datacenter\",\n      \"default\": \"default\"\n    },\n    \"instance_encoding_count\": {\n      \"type\": \"number\",\n      \"description\": \"Number of internal workers to spawn\",\n      \"default\": 1\n    },\n    \"instance_encoding_type\": {\n      \"type\": \"string\",\n      \"description\": \"Type of Virtual Network to use for encoding servers\",\n      \"default\": \"Standard_F8s_v2\"\n    },\n    \"instance_game_count\": {\n      \"type\": \"number\",\n      \"description\": \"Number of game instances to spawn\",\n      \"default\": 1\n    },\n    \"instance_game_type\": {\n      \"type\": \"string\",\n      \"description\": \"Type of Virtual Network to use for game servers\",\n      \"default\": \"Standard_NV6\"\n    },\n    \"instance_internal_count\": {\n      \"type\": \"number\",\n      \"description\": \"Number of internal workers to spawn\",\n      \"default\": 1\n    },\n    \"instance_internal_type\": {\n      \"type\": \"string\",\n      \"description\": \"Type of Virtual Network to use for internal servers\",\n      \"default\": \"Standard_B2s\"\n    },\n    \"instance_public_count\": {\n      \"type\": \"number\",\n      \"description\": \"Number of public workers to spawn\",\n      \"default\": 1\n    },\n    \"instance_public_type\": {\n      \"type\": \"string\",\n      \"description\": \"Type of Virtual Network to use for public servers\",\n      \"default\": \"Standard_B2s\"\n    },\n    \"instance_server_count\": {\n      \"type\": \"number\",\n      \"description\": \"the number of supervisor servers.  Must be an odd number.\\n#It is usually 3 for production deployment.\\n\",\n      \"default\": 1\n    },\n    \"instance_server_type\": {\n      \"type\": \"string\",\n      \"description\": \"Type of Virtual Network instance to use for admin servers\",\n      \"default\": \"Standard_B2s\"\n    },\n    \"location\": {\n      \"type\": \"string\",\n      \"description\": \"Azure deployment location\",\n      \"default\": \"East US\"\n    },\n    \"namespace\": {\n      \"type\": \"string\",\n      \"description\": \"Deployment namespace that will regroup the clusters\",\n      \"default\": \"deployment\"\n    },\n    \"shared_gallery_image_version\": {\n      \"type\": \"string\",\n      \"description\": \"SDK Shared Image version, should be only one per Genvid SDK\",\n      \"default\": \"1.25.0000\"\n    },\n    \"shared_gallery_name\": {\n      \"type\": \"string\",\n      \"description\": \"Shared Gallery Name\",\n      \"default\": \"SDKgallery\"\n    },\n    \"shared_gallery_resource_group_name\": {\n      \"type\": \"string\",\n      \"description\": \"Shared Gallery Resource Group Name\",\n      \"default\": \"Genvid\"\n    },\n    \"stage\": {\n      \"type\": \"string\",\n      \"description\": \"Deployment stage\",\n      \"default\": \"dev\"\n    },\n    \"toolbox_location\": {\n      \"type\": \"string\",\n      \"description\": \"Genvid Toolbox Wheel file.\\nOnly required if you need to update the one from the .\\nAn empty value indicates to not install the toolbox.\\n\",\n      \"default\": \"\"\n    },\n    \"trusted_cidr\": {\n      \"type\": \"string\",\n      \"description\": \"CIDR to be trusted.  This should at least contains the external IP for\\nthe local machine.  Elsewhere, the provision and access to\\nconsul/nomad will fail.\\n\"\n    },\n    \"trusted_cidrs\": {\n      \"type\": \"list(string)\",\n      \"default\": []\n    },\n    \"trusted_security_groups\": {\n      \"type\": \"list(string)\",\n      \"description\": \"A list of security groups to be trusted.\",\n      \"default\": []\n    },\n    \"wingame_image_prefix\": {\n      \"type\": \"string\",\n      \"description\": \"Prefix of the wingame image\",\n      \"default\": \"default\"\n    }\n  }\n}",
  "bastionVersion": "",
  "terraformContextVersion": "1.27"
}
GET /terraform/instance/{instanceID}/status

インスタンスのステータスを取得します。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • status (string) – クラスタのステータス。 * VOID: クラスタが存在しません。 * EMPTY: クラスタが初期化されていません。 * DOWN: クラスタに、インスタンス化されたリソースがありません。 * UP: クラスタにインスタンス化されたリソースが存在します。 * BUSY: クラスタがコマンドを実行中です。 * ERROR: ステータスの取得中にエラーが発生しました。 * INVALID: 現在のステータスが不明、または無効です。
  • resourceCount (number) – Terraform を通じて割り当てられたクラスタのリソース数。

応答例 :

{
  "status": "VOID",
  "resourceCount": 0
}
POST /terraform/instance/{instanceID}/regenerate

Consul に格納されたデータで Terraform workdir を再生成します。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
GET /terraform/instance/{instanceID}/tfvars/default

デフォルトの Terraform 変数は、モジュールのデフォルト値を使用しますが、同名の グローバル変数 で上書きされます。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • [key] – 使用できる型は、ブール、整数、数値、オブジェクト、文字列、null です。

応答例 :

{
  "ami_prefix": "internal",
  "ami_version": "1.20.0",
  "trusted_cidrs": [],
  "trusted_security_groups": []
}
GET /terraform/instance/{instanceID}/tfvars

Terraform 変数を取得する。これは、terraform.tfvars ファイルの中身です。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • [key] – 使用できる型は、ブール、整数、数値、オブジェクト、文字列、null です。

応答例 :

{
  "ami_prefix": "internal",
  "ami_version": "1.20.0",
  "trusted_cidrs": [],
  "trusted_security_groups": []
}
POST /terraform/instance/{instanceID}/tfvars

Terraform 変数を設定します。これは、terraform.tfvars ファイルの中身です。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
リクエスト JSON オブジェクト:
 
  • [key] – 使用できる型は、ブール、整数、数値、オブジェクト、文字列、null です。

クエリ例 :

{
  "ami_prefix": "internal",
  "ami_version": "1.20.0",
  "trusted_cidrs": [],
  "trusted_security_groups": []
}
GET /terraform/instance/{instanceID}/providers

既知の terraform プロバイダとその構成をすべて取得します。この情報は Consul から取得します。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • [] (object) –
  • [].name (string) – プロバイダ名。
  • [].alias (string) – オプションのプロバイダエイリアス。
  • [].meta.alias (string) – オプションのプロバイダエイリアス。このプロパティは非推奨であり、トップレベルに移動しました。
  • [].meta.version (string) – Terraform の構文に従うバージョン制約。このプロパティは非推奨であり、削除される予定です。
  • [].arguments[key] – 使用できる型は、ブール、整数、数値、オブジェクト、文字列、null です。

応答例 :

[
  {
    "name": "aws",
    "alias": "east",
    "meta": {
      "alias": null,
      "version": "~> 2.2.0"
    },
    "arguments": {
      "region": "us-east-1"
    }
  }
]
PUT /terraform/instance/{instanceID}/providers

プロバイダ構成をオーバーライドします。この情報は Consul に格納されます。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
リクエスト JSON オブジェクト:
 
  • [] (object) –
  • [].name (string) – プロバイダ名。
  • [].alias (string) – オプションのプロバイダエイリアス。
  • [].meta.alias (string) – オプションのプロバイダエイリアス。このプロパティは非推奨であり、トップレベルに移動しました。
  • [].meta.version (string) – Terraform の構文に従うバージョン制約。このプロパティは非推奨であり、削除される予定です。
  • [].arguments[key] – 使用できる型は、ブール、整数、数値、オブジェクト、文字列、null です。

クエリ例 :

[
  {
    "name": "aws",
    "alias": "east",
    "meta": {
      "alias": null,
      "version": "~> 2.2.0"
    },
    "arguments": {
      "region": "us-east-1"
    }
  }
]
DELETE /terraform/instance/{instanceID}/providers

既知の terraform プロバイダとその構成をすべて削除します。この情報は Consul から消去されます。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
PUT /terraform/instance/{instanceID}/provider

プロバイダを追加、またはオーバーライドします。この情報は Consul に格納されます。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
リクエスト JSON オブジェクト:
 
  • name (string) – プロバイダ名。
  • alias (string) – オプションのプロバイダエイリアス。
  • meta.alias (string) – オプションのプロバイダエイリアス。このプロパティは非推奨であり、トップレベルに移動しました。
  • meta.version (string) – Terraform の構文に従うバージョン制約。このプロパティは非推奨であり、削除される予定です。
  • arguments[key] – 使用できる型は、ブール、整数、数値、オブジェクト、文字列、null です。

クエリ例 :

{
  "name": "aws",
  "alias": "east",
  "meta": {
    "alias": null,
    "version": "~> 2.2.0"
  },
  "arguments": {
    "region": "us-east-1"
  }
}
GET /terraform/instance/{instanceID}/provider/{providerName}

Terraform の引数 (エイリアスされていないプロバイダ) を取得します。この情報は Consul から取得します。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
  • providerName – Terraform プロバイダ名。
応答 JSON オブジェクト:
  • name (string) – プロバイダ名。
  • alias (string) – オプションのプロバイダエイリアス。
  • meta.alias (string) – オプションのプロバイダエイリアス。このプロパティは非推奨であり、トップレベルに移動しました。
  • meta.version (string) – Terraform の構文に従うバージョン制約。このプロパティは非推奨であり、削除される予定です。
  • arguments[key] – 使用できる型は、ブール、整数、数値、オブジェクト、文字列、null です。

応答例 :

{
  "name": "aws",
  "alias": "east",
  "meta": {
    "alias": null,
    "version": "~> 2.2.0"
  },
  "arguments": {
    "region": "us-east-1"
  }
}
DELETE /terraform/instance/{instanceID}/provider/{providerName}

Terraform のプロバイダとすべての引数 (エイリアスされていないプロバイダ) を削除します。この情報は Consul から削除されます。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
  • providerName – Terraform プロバイダ名。
GET /terraform/instance/{instanceID}/provider/{providerName}/{providerAlias}

Terraform の引数を取得します。この情報は Consul から取得します。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
  • providerName – Terraform プロバイダ名。
  • providerAlias – Terraform プロバイダエイリアス。
応答 JSON オブジェクト:
  • name (string) – プロバイダ名。
  • alias (string) – オプションのプロバイダエイリアス。
  • meta.alias (string) – オプションのプロバイダエイリアス。このプロパティは非推奨であり、トップレベルに移動しました。
  • meta.version (string) – Terraform の構文に従うバージョン制約。このプロパティは非推奨であり、削除される予定です。
  • arguments[key] – 使用できる型は、ブール、整数、数値、オブジェクト、文字列、null です。

応答例 :

{
  "name": "aws",
  "alias": "east",
  "meta": {
    "alias": null,
    "version": "~> 2.2.0"
  },
  "arguments": {
    "region": "us-east-1"
  }
}
DELETE /terraform/instance/{instanceID}/provider/{providerName}/{providerAlias}

Terraform のプロバイダとすべての引数を削除します。この情報は Consul から削除されます。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
  • providerName – Terraform プロバイダ名。
  • providerAlias – Terraform プロバイダエイリアス。
POST /terraform/instance/{instanceID}/get

terraform get コマンドを実行する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • data (string) –

応答例 :

{
  "data": "- module.cluster\n- module.cluster.cluster\n- module.cluster.cluster.server\n- module.cluster.cluster.internal\n- module.cluster.cluster.encoding\n- module.cluster.cluster.public\n- module.cluster.cluster.game\n"
}
POST /terraform/instance/{instanceID}/importmodule

terraform にモジュールをインポートする。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
クエリパラメータ:
  • force – クラスタがエラー状態であっても、強制的に操作を行う。
リクエスト JSON オブジェクト:
 
  • modulePath (string) – モジュールパス。
応答 JSON オブジェクト:
  • id (string) –
  • displayText (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • start (string) –

クエリ例 :

{
  "modulePath": ""
}

応答例 :

{
  "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85",
  "displayText": "terraform command",
  "instanceID": "mycluster",
  "category": "terraform",
  "command": "D:\\genvidtech\\main\\bin\\terraform",
  "start": "2019-02-11T12:58:15-05:00"
}
POST /terraform/instance/{instanceID}/init

terraform init コマンドを実行する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
クエリパラメータ:
  • force – クラスタがエラー状態であっても、強制的に操作を行う。
応答 JSON オブジェクト:
  • id (string) –
  • displayText (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • start (string) –

応答例 :

{
  "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85",
  "displayText": "terraform command",
  "instanceID": "mycluster",
  "category": "terraform",
  "command": "D:\\genvidtech\\main\\bin\\terraform",
  "start": "2019-02-11T12:58:15-05:00"
}
POST /terraform/instance/{instanceID}/plan

terraform plan コマンドを実行する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • id (string) –
  • displayText (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • start (string) –

応答例 :

{
  "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85",
  "displayText": "terraform command",
  "instanceID": "mycluster",
  "category": "terraform",
  "command": "D:\\genvidtech\\main\\bin\\terraform",
  "start": "2019-02-11T12:58:15-05:00"
}
POST /terraform/instance/{instanceID}/refresh

terraform refresh コマンドを実行する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • id (string) –
  • displayText (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • start (string) –

応答例 :

{
  "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85",
  "displayText": "terraform command",
  "instanceID": "mycluster",
  "category": "terraform",
  "command": "D:\\genvidtech\\main\\bin\\terraform",
  "start": "2019-02-11T12:58:15-05:00"
}
POST /terraform/instance/{instanceID}/apply

terraform apply コマンドを実行する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • id (string) –
  • displayText (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • start (string) –

応答例 :

{
  "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85",
  "displayText": "terraform command",
  "instanceID": "mycluster",
  "category": "terraform",
  "command": "D:\\genvidtech\\main\\bin\\terraform",
  "start": "2019-02-11T12:58:15-05:00"
}
POST /terraform/instance/{instanceID}/apply/{planFileName}

指定プランで terraform apply コマンドを実行する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
  • planFileName – プランファイル名。
応答 JSON オブジェクト:
  • id (string) –
  • displayText (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • start (string) –

応答例 :

{
  "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85",
  "displayText": "terraform command",
  "instanceID": "mycluster",
  "category": "terraform",
  "command": "D:\\genvidtech\\main\\bin\\terraform",
  "start": "2019-02-11T12:58:15-05:00"
}
POST /terraform/instance/{instanceID}/destroy

terraform destroy コマンドを実行する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • id (string) –
  • displayText (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • start (string) –

応答例 :

{
  "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85",
  "displayText": "terraform command",
  "instanceID": "mycluster",
  "category": "terraform",
  "command": "D:\\genvidtech\\main\\bin\\terraform",
  "start": "2019-02-11T12:58:15-05:00"
}
GET /terraform/instance/{instanceID}/output

terraform output コマンドを実行する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • sensitive (boolean) –
  • type (string) –
  • value (undefined) –

応答例 :

{
  "sensitive": false,
  "type": ""
}

コマンド

GET /terraform/instance/{instanceID}/commands

コマンドを取得する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
クエリパラメータ:
  • current – True の場合、実行中のコマンドのみを返す。
応答 JSON オブジェクト:
  • [] (object) –
  • [].id (string) –
  • [].displayText (string) –
  • [].instanceID (string) –
  • [].category (string) –
  • [].command (string) –
  • [].start (string) –

応答例 :

[
  {
    "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85",
    "displayText": "terraform command",
    "instanceID": "mycluster",
    "category": "terraform",
    "command": "D:\\genvidtech\\main\\bin\\terraform",
    "start": "2019-02-11T12:58:15-05:00"
  }
]
GET /terraform/instance/{instanceID}/command/{commandID}

コマンドデータを取得する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
  • commandID – コマンド ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • id (string) –
  • displayText (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • start (string) –

応答例 :

{
  "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85",
  "displayText": "terraform command",
  "instanceID": "mycluster",
  "category": "terraform",
  "command": "D:\\genvidtech\\main\\bin\\terraform",
  "start": "2019-02-11T12:58:15-05:00"
}
GET /terraform/instance/{instanceID}/log/{commandID}

コマンドログを取得する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
  • commandID – コマンド ID。不透明な (opaque) 文字列。
クエリパラメータ:
  • origin – 開始または終了。
  • offset – 原点へのオフセット。
  • size – 戻り値の最大サイズ。
応答 JSON オブジェクト:
  • offset (integer) –
  • data (string) –
  • isDone (boolean) –

応答例 :

{
  "data": "",
  "isDone": false
}
GET /terraform/instance/{instanceID}/wait/{commandID}

コマンドが終了するまで待ち、コマンドランナーを返す。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
  • commandID – コマンド ID。不透明な (opaque) 文字列。
応答 JSON オブジェクト:
  • id (string) –
  • displayText (string) –
  • instanceID (string) –
  • category (string) –
  • command (string) –
  • start (string) –

応答例 :

{
  "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85",
  "displayText": "terraform command",
  "instanceID": "mycluster",
  "category": "terraform",
  "command": "D:\\genvidtech\\main\\bin\\terraform",
  "start": "2019-02-11T12:58:15-05:00"
}
GET /terraform/instance/{instanceID}/terminate/{commandID}

コマンドを終了する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
  • commandID – コマンド ID。不透明な (opaque) 文字列。
GET /terraform/instance/{instanceID}/kill/{commandID}

コマンドを破棄する。

パラメータ:
  • instanceID – インスタンス ID。不透明な (opaque) 文字列。
  • commandID – コマンド ID。不透明な (opaque) 文字列。

BastionIpInCidr

GET /terraform/bastionIpInCidr

Bastion IP が Trusted Cidr または Trusted Cidrs に存在するかを確認します。

BastionHealth

GET /terraform/bastionHealth

Bastion の正常な実行に必要なエンティティをチェックし、健全性を示す json オブジェクトを返します。

応答 JSON オブジェクト:
  • healthOK (boolean) – Bastion ヘルスステータス

応答例 :

{
  "healthOK": "true"
}