{
  "openapi": "3.0.3",
  "info": {
    "title": "Deckhouse Kubernetes as a Service API",
    "version": "v1.0",
    "description": "Managing Deckhouse Kubernetes as a Service clusters: create and delete clusters, get cluster information, change the Deckhouse Platform password, and more.\n"
  },
  "security": [
    {
      "iam_token_project_scoped": []
    }
  ],
  "tags": [
    {
      "name": "Clusters",
      "description": "Cluster management: create, get, and delete clusters, and change login credentials."
    },
    {
      "name": "Kubernetes versions",
      "description": "Kubernetes versions available for creating clusters."
    }
  ],
  "components": {
    "securitySchemes": {
      "iam_token_project_scoped": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Auth-Token",
        "description": "Project-scoped IAM (Keystone) token passed in the `X-Auth-Token` header."
      }
    },
    "schemas": {
      "Cluster": {
        "type": "object",
        "description": "Deckhouse Kubernetes as a Service cluster.",
        "required": [
          "id",
          "name",
          "status",
          "kubernetes_version",
          "release_channel",
          "segment",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "x-order": 1,
            "type": "string",
            "format": "uuid",
            "description": "Unique cluster identifier."
          },
          "name": {
            "x-order": 2,
            "type": "string",
            "description": "Cluster name. The name must be unique within the project."
          },
          "kubernetes_version": {
            "x-order": 8,
            "type": "string",
            "description": "Kubernetes version.",
            "example": "1.29"
          },
          "release_channel": {
            "x-order": 9,
            "type": "string",
            "enum": [
              "EarlyAccess",
              "Stable"
            ],
            "description": "Release channel for cluster updates."
          },
          "segment": {
            "x-order": 7,
            "type": "string",
            "description": "Pool segment where the cluster is deployed.",
            "example": "ru-6a"
          },
          "status": {
            "x-order": 3,
            "type": "string",
            "enum": [
              "CREATING",
              "ACTIVE",
              "ERROR",
              "DELETING",
              "DESTRUCTIVE_CHANGES",
              "SYNCHRONIZING"
            ],
            "description": "Cluster lifecycle status:\n- `CREATING` means that the create request has been accepted and the cluster is being created.\n- `ACTIVE` means that the cluster is ready to use.\n- `ERROR` means that the lifecycle operation has failed. Details are available in the `error` field.\n- `DELETING` means that the cluster is being deleted.\n- `DESTRUCTIVE_CHANGES` means that a change requiring resource recreation was detected and is\n  awaiting approval. Use the `Get pending destructive change` method to review the affected resources and\n  the `Approve pending destructive change` method to approve and apply it.\n- `SYNCHRONIZING` means that the cluster infrastructure is being synchronized, for example, while an\n  approved destructive change is being applied. The cluster returns to `ACTIVE` once the synchronization\n  completes, or moves to `ERROR` if it fails.\n"
          },
          "console_url": {
            "x-order": 10,
            "type": "string",
            "description": "Link to the Deckhouse Kubernetes web interface. It is available once the cluster reaches the `ACTIVE` status."
          },
          "admin_fqdn": {
            "x-order": 11,
            "type": "string",
            "description": "Public fully qualified domain name of the cluster. Deckhouse Kubernetes web interfaces are available on its subdomains."
          },
          "error": {
            "x-order": 12,
            "type": "string",
            "description": "Error details if the cluster reaches the `ERROR` status."
          },
          "created_at": {
            "x-order": 4,
            "type": "string",
            "format": "date-time",
            "description": "Cluster creation time in UTC and RFC 3339 format."
          },
          "updated_at": {
            "x-order": 5,
            "type": "string",
            "format": "date-time",
            "description": "Time of the last cluster update in UTC and RFC 3339 format."
          }
        }
      },
      "CreateClusterRequest": {
        "type": "object",
        "description": "Parameters for creating a cluster.",
        "required": [
          "name",
          "kubernetes_version",
          "release_channel",
          "segment",
          "deckhouse_admin_login",
          "deckhouse_admin_password",
          "master_nodes_configuration",
          "worker_nodes_configuration"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Cluster name. The name must be unique within the project."
          },
          "kubernetes_version": {
            "type": "string",
            "description": "Kubernetes version.",
            "example": "1.29"
          },
          "release_channel": {
            "type": "string",
            "enum": [
              "EarlyAccess",
              "Stable"
            ],
            "description": "Release channel for cluster updates."
          },
          "segment": {
            "type": "string",
            "description": "Pool segment where the cluster will be deployed.",
            "example": "ru-6a"
          },
          "deckhouse_admin_login": {
            "type": "string",
            "format": "email",
            "description": "Email address used to log in to the Deckhouse Kubernetes web interface.",
            "example": "admin@example.com"
          },
          "deckhouse_admin_password": {
            "type": "string",
            "format": "password",
            "minLength": 8,
            "pattern": "^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[!@#$%^&*])[A-Za-z0-9!@#$%^&*]+$",
            "description": "Password used to log in to the Deckhouse Kubernetes web interface. Must contain at least 8 characters, including an uppercase Latin letter, a lowercase Latin letter, a digit, and one of the following special characters: `!@#$%^&*`.",
            "example": "Qwe12345!"
          },
          "master_nodes_configuration": {
            "type": "object",
            "description": "Master node configuration.",
            "required": [
              "count",
              "flavor_id"
            ],
            "properties": {
              "count": {
                "type": "integer",
                "enum": [
                  1,
                  3
                ],
                "description": "Number of master nodes. Use `1` for a non-highly available cluster or `3` for a highly available cluster."
              },
              "flavor_id": {
                "type": "string",
                "description": "OpenStack flavor ID for master nodes. Retrieve the available flavors and their IDs from the\nCompute (Nova) flavor list of the same project and region where the cluster is created. Both\npublic flavors and the project's own private ones are accepted.\n\nMaster nodes must use a flavor without local disks (network storage).\nThe following flavors are rejected with `400`:\n- a flavor with local disks;\n- a flavor ID that does not exist in the project and region.\n",
                "example": "1014"
              },
              "root_disk_size": {
                "type": "integer",
                "description": "Root disk size for master nodes, in GiB. If this value is omitted, the flavor default is used.",
                "example": 50
              }
            }
          },
          "worker_nodes_configuration": {
            "type": "object",
            "description": "Worker node autoscaling configuration.",
            "required": [
              "flavor_id",
              "min",
              "max"
            ],
            "properties": {
              "flavor_id": {
                "type": "string",
                "description": "OpenStack flavor ID for worker nodes. Retrieve the available flavors and their IDs from the\nCompute (Nova) flavor list of the same project and region where the cluster is created. Both\npublic flavors and the project's own private ones are accepted.\n\nWorker nodes must use a flavor with local disks.\nThe following flavors are rejected with `400`:\n- a flavor without local disks (network storage);\n- a flavor ID that does not exist in the project and region.\n",
                "example": "1022"
              },
              "min": {
                "type": "integer",
                "minimum": 0,
                "description": "Minimum number of worker nodes."
              },
              "max": {
                "type": "integer",
                "minimum": 1,
                "description": "Maximum number of worker nodes."
              }
            }
          }
        }
      },
      "UpdateDeckhouseAdminRequest": {
        "type": "object",
        "description": "Parameters for updating the Deckhouse Kubernetes web interface login credentials of an existing cluster.",
        "required": [
          "deckhouse_admin_password"
        ],
        "properties": {
          "deckhouse_admin_password": {
            "type": "string",
            "format": "password",
            "minLength": 8,
            "pattern": "^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[!@#$%^&*])[A-Za-z0-9!@#$%^&*]+$",
            "description": "New password used to log in to the Deckhouse Kubernetes web interface. Must contain at least 8 characters, including an uppercase Latin letter, a lowercase Latin letter, a digit, and one of the following special characters: `!@#$%^&*`.",
            "example": "Qwe12345!"
          },
          "deckhouse_admin_email": {
            "type": "string",
            "format": "email",
            "description": "New email address used to log in to the Deckhouse Kubernetes web interface. If this value is omitted, the current email address is not changed.",
            "example": "admin@example.com"
          }
        }
      },
      "ReplaceDeckhouseAdminRequest": {
        "type": "object",
        "description": "Full replacement of the Deckhouse Kubernetes web interface login credentials for an existing cluster.",
        "required": [
          "deckhouse_admin_password",
          "deckhouse_admin_email"
        ],
        "properties": {
          "deckhouse_admin_password": {
            "type": "string",
            "format": "password",
            "minLength": 8,
            "pattern": "^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[!@#$%^&*])[A-Za-z0-9!@#$%^&*]+$",
            "description": "New password used to log in to the Deckhouse Kubernetes web interface. Must contain at least 8 characters, including an uppercase Latin letter, a lowercase Latin letter, a digit, and one of the following special characters: `!@#$%^&*`.",
            "example": "Qwe12345!"
          },
          "deckhouse_admin_email": {
            "type": "string",
            "format": "email",
            "description": "New email address used to log in to the Deckhouse Kubernetes web interface.",
            "example": "admin@example.com"
          }
        }
      },
      "ClusterList": {
        "type": "object",
        "description": "List of clusters in the project.",
        "properties": {
          "items": {
            "x-order": 1,
            "type": "array",
            "description": "List of clusters. The array is empty if no clusters have been created.",
            "items": {
              "$ref": "#/components/schemas/Cluster"
            }
          }
        }
      },
      "KubeVersion": {
        "type": "object",
        "description": "A single supported Kubernetes version.",
        "required": [
          "version",
          "is_default"
        ],
        "properties": {
          "version": {
            "x-order": 1,
            "type": "string",
            "description": "Kubernetes version available for cluster creation.",
            "example": "1.31"
          },
          "is_default": {
            "x-order": 2,
            "type": "boolean",
            "description": "Whether the version is used by default.",
            "example": true
          }
        }
      },
      "KubeVersionList": {
        "type": "object",
        "description": "List of Kubernetes versions available for cluster creation.",
        "required": [
          "kube_versions"
        ],
        "properties": {
          "kube_versions": {
            "x-order": 1,
            "type": "array",
            "description": "Kubernetes versions available for cluster creation, ordered newest-first. At most one entry has `is_default` set to true.",
            "items": {
              "$ref": "#/components/schemas/KubeVersion"
            }
          }
        }
      },
      "ClusterChangeRequest": {
        "type": "object",
        "description": "A destructive change to a cluster's underlying resources that is awaiting approval or being approved.",
        "required": [
          "id",
          "status",
          "change_type",
          "plan",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "x-order": 1,
            "type": "string",
            "format": "uuid",
            "description": "Unique change request identifier."
          },
          "status": {
            "x-order": 2,
            "type": "string",
            "enum": [
              "PENDING",
              "APPROVED",
              "APPLYING",
              "APPLIED",
              "FAILED"
            ],
            "description": "Change request status:\n- `PENDING` means the change is awaiting approval.\n- `APPROVED` means the change has been approved and is queued to be applied.\n- `APPLYING` means the change is currently being applied.\n- `APPLIED` means the change has been applied successfully and the cluster returns to `ACTIVE`.\n- `FAILED` means applying the change has failed and the cluster moves to `ERROR`.\n"
          },
          "change_type": {
            "x-order": 3,
            "type": "string",
            "description": "Type of the underlying change."
          },
          "plan": {
            "x-order": 4,
            "$ref": "#/components/schemas/ClusterChangePlan"
          },
          "approved_at": {
            "x-order": 5,
            "type": "string",
            "format": "date-time",
            "description": "Time when the change was approved, if applicable."
          },
          "created_at": {
            "x-order": 6,
            "type": "string",
            "format": "date-time",
            "description": "Time the change request was first observed, in UTC and RFC 3339 format."
          },
          "updated_at": {
            "x-order": 7,
            "type": "string",
            "format": "date-time",
            "description": "Time of the last update to the change request, in UTC and RFC 3339 format."
          }
        }
      },
      "ClusterChangePlan": {
        "type": "object",
        "description": "Summary of the destructive change plan. It includes only the resources that will be recreated, with an\nexplanation for each.\n",
        "required": [
          "cluster_status",
          "configuration_status",
          "opentofu_migration_status",
          "node_templates",
          "nodes"
        ],
        "properties": {
          "cluster_status": {
            "x-order": 1,
            "type": "string",
            "description": "Overall cluster status.",
            "example": "ok"
          },
          "configuration_status": {
            "x-order": 2,
            "type": "string",
            "description": "Status of configuration drift between the desired and actual cluster state.",
            "example": "InSync"
          },
          "opentofu_migration_status": {
            "x-order": 3,
            "type": "string",
            "description": "Infrastructure state migration status.",
            "example": "InSync"
          },
          "node_templates": {
            "x-order": 4,
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name",
                "status"
              ],
              "properties": {
                "name": {
                  "x-order": 1,
                  "type": "string",
                  "example": "master"
                },
                "status": {
                  "x-order": 2,
                  "type": "string",
                  "example": "ok"
                }
              }
            }
          },
          "nodes": {
            "x-order": 5,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClusterChangePlanNode"
            }
          }
        }
      },
      "ClusterChangePlanNode": {
        "type": "object",
        "description": "A single cluster node within a plan, along with any resources on it being destructively recreated.",
        "required": [
          "name",
          "group",
          "status",
          "destructive_changes"
        ],
        "properties": {
          "name": {
            "x-order": 1,
            "type": "string",
            "example": "node-1"
          },
          "group": {
            "x-order": 2,
            "type": "string",
            "description": "Node group the node belongs to.",
            "example": "master"
          },
          "status": {
            "x-order": 3,
            "type": "string",
            "example": "destructively_changed"
          },
          "destructive_changes": {
            "x-order": 4,
            "type": "object",
            "required": [
              "resourced_recreated"
            ],
            "properties": {
              "resourced_recreated": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/DestructiveResourceChange"
                }
              }
            }
          }
        }
      },
      "DestructiveResourceChange": {
        "type": "object",
        "description": "Cloud resource that will be deleted and recreated, with an explanation.",
        "required": [
          "resource_type",
          "reason",
          "current_value",
          "next_value"
        ],
        "properties": {
          "resource_type": {
            "x-order": 1,
            "type": "string",
            "description": "e.g. `openstack_compute_instance_v2`.",
            "example": "openstack_compute_instance_v2"
          },
          "reason": {
            "x-order": 2,
            "type": "string",
            "description": "Explanation computed by comparing the top-level fields of `current_value` and `next_value`. Falls back\nto a generic explanation when no notable field differs, which means that the resource is recreated\nonly as a side effect of replacing a related resource.\n",
            "example": "image_id, image_name changed"
          },
          "current_value": {
            "x-order": 3,
            "type": "object",
            "description": "The resource's current attributes. Shape varies by `resource_type`.",
            "example": {
              "id": "a",
              "image_id": "old-image",
              "image_name": "Ubuntu 22.04"
            }
          },
          "next_value": {
            "x-order": 4,
            "type": "object",
            "description": "The resource's planned attributes after recreation. Shape varies by `resource_type`.",
            "example": {
              "image_id": "new-image",
              "image_name": "Ubuntu 24.04"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Error details.",
        "properties": {
          "code": {
            "x-order": 1,
            "type": "string",
            "description": "Machine-readable error code."
          },
          "message": {
            "x-order": 2,
            "type": "string",
            "description": "Human-readable error description."
          }
        }
      }
    }
  },
  "paths": {
    "/v1/kubeversions": {
      "get": {
        "tags": [
          "Kubernetes versions"
        ],
        "summary": "List Kubernetes versions",
        "description": "Returns a list of Kubernetes versions available for creating clusters.",
        "operationId": "listKubernetesVersions",
        "responses": {
          "200": {
            "description": "List of Kubernetes versions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KubeVersionList"
                }
              }
            }
          },
          "401": {
            "description": "Bad or expired token. You can reissue the token and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access is forbidden. Make sure you have the required rights.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clusters": {
      "get": {
        "tags": [
          "Clusters"
        ],
        "summary": "List clusters",
        "description": "Returns a list of active clusters in the current project.",
        "operationId": "listClusters",
        "responses": {
          "200": {
            "description": "List of clusters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClusterList"
                }
              }
            }
          },
          "401": {
            "description": "Bad or expired token. You can reissue the token and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access is forbidden. Make sure you have the required rights.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Clusters"
        ],
        "summary": "Create cluster",
        "description": "Starts creating a cluster. Creation may take up to an hour. The progress can be checked with the\n`Get cluster information` method.\n",
        "operationId": "createCluster",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClusterRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Cluster creation has started successfully. The response contains the cluster in the `CREATING`\nstatus. The progress can be checked with the `Get cluster information` method.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cluster"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Fix the request and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Bad or expired token. You can reissue the token and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access is forbidden. Make sure you have the required rights.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Cluster with this name already exists, or cluster quota has been exceeded.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server is not responding. Please try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clusters/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Cluster identifier.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Clusters"
        ],
        "summary": "Get cluster information",
        "description": "Returns information about a cluster by its identifier.",
        "operationId": "getCluster",
        "responses": {
          "200": {
            "description": "Information about the cluster has been returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cluster"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Fix the cluster identifier and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Bad or expired token. You can reissue the token and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access is forbidden. Make sure you have the required rights.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Cluster has not been found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Clusters"
        ],
        "summary": "Delete cluster",
        "description": "Deletes a cluster: changes its status to `DELETING` and queues asynchronous deletion. Repeated\nrequests for a cluster in the `DELETING` status do not return an error.\n",
        "operationId": "deleteCluster",
        "responses": {
          "202": {
            "description": "Cluster deletion has been queued."
          },
          "400": {
            "description": "Bad request. Fix the cluster identifier and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Bad or expired token. You can reissue the token and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access is forbidden. Make sure you have the required rights.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Cluster has not been found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server is not responding. Please try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clusters/{id}/deckhouse-admin": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Cluster identifier.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "patch": {
        "tags": [
          "Clusters"
        ],
        "summary": "Update Deckhouse Kubernetes login credentials",
        "description": "Updates the password and, optionally, the email address used to log in to the Deckhouse Kubernetes\nweb interface. If `deckhouse_admin_email` is omitted, the current email address is not changed.\n",
        "operationId": "updateDeckhouseAdministrator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDeckhouseAdminRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Deckhouse Kubernetes login credentials have been updated."
          },
          "400": {
            "description": "Bad request. Fix the request and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Bad or expired token. You can reissue the token and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access is forbidden. Make sure you have the required rights.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Cluster has not been found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Cluster cannot be updated in its current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server is not responding. Please try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Clusters"
        ],
        "summary": "Replace Deckhouse Kubernetes login credentials",
        "description": "Replaces both email and password required to log in to the Deckhouse Kubernetes web interface.\n",
        "operationId": "replaceDeckhouseAdministrator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceDeckhouseAdminRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Deckhouse Kubernetes login credentials have been replaced."
          },
          "400": {
            "description": "Bad request. Fix the request and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Bad or expired token. You can reissue the token and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access is forbidden. Make sure you have the required rights.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Cluster has not been found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Cluster cannot be updated in its current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server is not responding. Please try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clusters/{id}/pending-change": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Cluster identifier.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Clusters"
        ],
        "summary": "Get pending destructive change",
        "description": "Returns the destructive change request for a cluster in the `DESTRUCTIVE_CHANGES` status (awaiting\napproval) or the `SYNCHRONIZING` status (approved and being applied), including the resources that\nwill be recreated. Returns `404` if the cluster has no pending destructive change.\n",
        "operationId": "getPendingClusterChange",
        "responses": {
          "200": {
            "description": "Pending change request has been returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClusterChangeRequest"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Fix the cluster identifier and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Bad or expired token. You can reissue the token and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access is forbidden. Make sure you have the required rights.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Cluster has not been found, or it has no pending destructive change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clusters/{id}/pending-change/approve": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Cluster identifier.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "tags": [
          "Clusters"
        ],
        "summary": "Approve pending destructive change",
        "description": "Approves the destructive change request currently awaiting approval for a cluster in the\n`DESTRUCTIVE_CHANGES` status and queues its application. Before approving, review the pending change\nwith the `Get pending destructive change` method.\n",
        "operationId": "approveClusterChange",
        "responses": {
          "202": {
            "description": "The change has been approved and its application has been queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClusterChangeRequest"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Fix the cluster identifier and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Bad or expired token. You can reissue the token and try again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Access is forbidden. Make sure you have the required rights.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Cluster has not been found, or it has no pending destructive change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The pending change has already been approved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server is not responding. Please try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}
