{ "swagger": "2.0", "info": { "description": "SberCloud Managed OpenShift API", "version": "1.0" }, "tags": [ { "name": "ClusterService" }, { "name": "NodePoolService" }, { "name": "StatsService" }, { "name": "TaskService" }, { "name": "VersionService" } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/openshift/v1/versions": { "get": { "operationId": "VersionService_List", "responses": { "200": { "description": "A successful response", "schema": { "$ref": "#/definitions/v1ListOpenShiftVersionsResponse" } } }, "tags": [ "VersionService" ] } }, "/openshift/v1/{serviceInstanceId}/clusters": { "get": { "summary": "Возвращает информацию о кластерах", "operationId": "ClusterService_List", "responses": { "200": { "description": "A successful response", "schema": { "$ref": "#/definitions/v1ListClustersResponse" } } }, "parameters": [ { "name": "serviceInstanceId", "description": "идентификатор услуги (vDC)", "in": "path", "required": true, "type": "string" } ], "tags": [ "ClusterService" ] }, "post": { "summary": "Создаёт кластер OpenShift", "operationId": "ClusterService_Create", "responses": { "200": { "description": "A successful response", "schema": { "$ref": "#/definitions/v1CreateClusterResponse" } } }, "parameters": [ { "name": "serviceInstanceId", "description": "идентификатор услуги (vDC)", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "type": "object", "properties": { "clusterName": { "type": "string", "description": "имя кластера. Должно быть уникальным. Может содержать строчные буквы латинского алфавита, цифры и дефисы.\nДопустимое количество символов от 3 до 20." }, "openshiftVersion": { "type": "string", "description": "версия OpenShift" }, "ipv4Policy": { "$ref": "#/definitions/v1IPv4Policy" } } } } ], "tags": [ "ClusterService" ] } }, "/openshift/v1/{serviceInstanceId}/clusters/{clusterId}": { "get": { "summary": "Возвращает информацию о кластере", "operationId": "ClusterService_Get", "responses": { "200": { "description": "A successful response", "schema": { "$ref": "#/definitions/v1GetClusterResponse" } } }, "parameters": [ { "name": "serviceInstanceId", "description": "идентификатор услуги (vDC)", "in": "path", "required": true, "type": "string" }, { "name": "clusterId", "description": "идентификатор кластера", "in": "path", "required": true, "type": "string" } ], "tags": [ "ClusterService" ] }, "delete": { "summary": "Удаляет кластер OpenShift", "operationId": "ClusterService_Delete", "responses": { "200": { "description": "A successful response", "schema": { "$ref": "#/definitions/v1DeleteClusterResponse" } } }, "parameters": [ { "name": "serviceInstanceId", "description": "идентификатор услуги (vDC)", "in": "path", "required": true, "type": "string" }, { "name": "clusterId", "description": "идентификатор кластера", "in": "path", "required": true, "type": "string" } ], "tags": [ "ClusterService" ] } }, "/openshift/v1/{serviceInstanceId}/node-pools": { "get": { "summary": "Возвращает информацию о группах узлов", "operationId": "NodePoolService_List", "responses": { "200": { "description": "A successful response", "schema": { "$ref": "#/definitions/v1ListNodePoolResponse" } } }, "parameters": [ { "name": "serviceInstanceId", "description": "идентификатор услуги (vDC)", "in": "path", "required": true, "type": "string" }, { "name": "clusterId", "description": "идентификатор кластера", "in": "query", "required": false, "type": "string" } ], "tags": [ "NodePoolService" ] }, "post": { "summary": "Создаёт группу узлов для кластера OpenShift", "operationId": "NodePoolService_Create", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1CreateNodePoolResponse" } } }, "parameters": [ { "name": "serviceInstanceId", "description": "идентификатор услуги (vDC)", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "type": "object", "properties": { "clusterId": { "type": "string", "description": "ID кластера, которому будет принадлежать группа узлов" }, "nodePoolName": { "type": "string", "description": "обязательное поле. Имя группы узлов" }, "nodeConfig": { "$ref": "#/definitions/v1NodeConfig", "description": "обязательное поле. Конфигурация ноды в группе узлов" }, "scalePolicy": { "$ref": "#/definitions/v1ScalePolicy", "description": "обязательное поле. Политика масштабирования группы узлов" } } } } ], "tags": [ "NodePoolService" ] } }, "/openshift/v1/{serviceInstanceId}/node-pools/{nodePoolId}": { "get": { "summary": "Возвращает информацию о группе узлов", "operationId": "NodePoolService_Get", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1GetNodePoolResponse" } } }, "parameters": [ { "name": "serviceInstanceId", "description": "идентификатор услуги (vDC)", "in": "path", "required": true, "type": "string" }, { "name": "nodePoolId", "description": "идентификатор группы узлов", "in": "path", "required": true, "type": "string" } ], "tags": [ "NodePoolService" ] }, "delete": { "summary": "Удаляет группу узлов из кластера OpenShift", "operationId": "NodePoolService_Delete", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1DeleteNodePoolResponse" } } }, "parameters": [ { "name": "serviceInstanceId", "description": "идентификатор услуги (vDC)", "in": "path", "required": true, "type": "string" }, { "name": "nodePoolId", "description": "идентификатор группы узлов", "in": "path", "required": true, "type": "string" } ], "tags": [ "NodePoolService" ] }, "patch": { "summary": "Обновляет существующую группу излов", "operationId": "NodePoolService_Update", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1UpdateNodePoolResponse" } } }, "parameters": [ { "name": "serviceInstanceId", "description": "идентификатор услуги (vDC)", "in": "path", "required": true, "type": "string" }, { "name": "nodePoolId", "description": "идентификатор группы узлов", "in": "path", "required": true, "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { "type": "object", "properties": { "nodePoolName": { "type": "string", "description": "новое имя группы узлов" }, "scalePolicy": { "$ref": "#/definitions/v1ScalePolicy", "description": "новая политика масштабирования группы узлов" } } } } ], "tags": [ "NodePoolService" ] } }, "/openshift/v1/{serviceInstanceId}/statistics": { "get": { "summary": "Возвращает статистику по идендификатору услуги", "operationId": "StatsService_Get", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1GetStatsResponse" } } }, "parameters": [ { "name": "serviceInstanceId", "description": "идентификатор услуги (vDC)", "in": "path", "required": true, "type": "string" } ], "tags": [ "StatsService" ] } }, "/openshift/v1/{serviceInstanceId}/tasks": { "get": { "summary": "Возвращает список задач", "operationId": "TaskService_List", "responses": { "200": { "description": "A successful response.", "schema": { "$ref": "#/definitions/v1ListTasksResponse" } } }, "parameters": [ { "name": "serviceInstanceId", "description": "идентификатор услуги (vDC)", "in": "path", "required": true, "type": "string" } ], "tags": [ "TaskService" ] } }, "/openshift/v1/{serviceInstanceId}/tasks/{taskId}": { "get": { "summary": "Возвращает задачу", "operationId": "TaskService_Get", "responses": { "200": { "description": "A successful response", "schema": { "$ref": "#/definitions/v1GetTaskResponse" } } }, "parameters": [ { "name": "serviceInstanceId", "description": "идентификатор услуги (vDC)", "in": "path", "required": true, "type": "string" }, { "name": "taskId", "description": "идентификатор задачи", "in": "path", "required": true, "type": "string" } ], "tags": [ "TaskService" ] } } }, "definitions": { "ScalePolicyFixedScale": { "type": "object", "properties": { "count": { "type": "integer", "format": "int32", "description": "количество узлов в группе узлов" } }, "description": "необходимо в параметре nodePools[].scalePolicy установить fixedScale или autoScale" }, "googlerpcStatus": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32", "description": "код ошибки. Доступные коды ошибок определены в `google.rpc.Code `__" }, "message": { "type": "string", "description": "описание ошибки" }, "details": { "type": "array", "items": { "$ref": "#/definitions/protobufAny" }, "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." } }, "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." }, "protobufAny": { "type": "object", "properties": { "typeUrl": { "type": "string", "description":"дополнительные сведения об ошибке о типе протокола передачи данных. Соответствия gRPC-статусов с HTTP-кодами описаны в `google.rpc.Code `__" }, "value": { "type": "string", "format": "byte", "description": "значение ошибки" } }, "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" }, "v1Cluster": { "type": "object", "properties": { "id": { "type": "string", "description": "идентификатор кластера" }, "name": { "type": "string", "description": "имя кластера" }, "createdAt": { "type": "string", "format": "date-time", "description": "время создания кластера" }, "version": { "type": "string", "description": "версия OpenShift" }, "workersCount": { "type": "integer", "format": "int64", "description": "количество воркеров в кластере" }, "coresUsed": { "type": "integer", "format": "int64", "description": "используемые кластером vCPU (ядра)" }, "ramUsed": { "type": "integer", "format": "int64", "description": "используемая кластером оперативная память (ГБ)" }, "storageUsed": { "type": "integer", "format": "int64", "description": "используемое кластером дисковое пространство (ГБ)" }, "consoleUrl": { "type": "string", "description": "URL консоли управления OpenShift" }, "healthy": { "type": "boolean", "description": "состояние кластера" } } }, "v1ComputeFlavor": { "type": "string", "description": "обязательное поле. Характеристики типа ресурса,\nопределяющего размеры оперативной памяти, дискового пространства, количества ядер и тому подобного,\nкоторые будет использоваться при создании узлов", "enum": [ "SMALL", "MEDIUM", "LARGE", "XLARGE" ], "default": "SMALL" }, "v1CreateClusterResponse": { "type": "object", "properties": { "task": { "$ref": "#/definitions/v1Task" } } }, "v1CreateNodePoolResponse": { "type": "object", "properties": { "task": { "$ref": "#/definitions/v1Task" } } }, "v1DeleteClusterResponse": { "type": "object", "properties": { "task": { "$ref": "#/definitions/v1Task" } } }, "v1DeleteNodePoolResponse": { "type": "object", "properties": { "task": { "$ref": "#/definitions/v1Task" } } }, "v1GetClusterResponse": { "type": "object", "properties": { "cluster": { "$ref": "#/definitions/v1Cluster" } } }, "v1GetNodePoolResponse": { "type": "object", "properties": { "nodePool": { "$ref": "#/definitions/v1NodePool" } } }, "v1GetStatsResponse": { "type": "object", "properties": { "vdcCoresQuota": { "type": "integer", "format": "int64", "description": "действующая квота vCPU (ядер)" }, "vdcCoresUsed": { "type": "integer", "format": "int64", "description": "используемые vCPU (ядра)" }, "vdcCpuQuota": { "type": "integer", "format": "int64", "description": "действующая квота CPU ресурсов (частота ядра в MHz * кол-во vCPU)" }, "vdcCpuUsed": { "type": "integer", "format": "int64", "description": "используемые CPU ресурсы (частота ядра в MHz * кол-во vCPU)" }, "vdcRamQuota": { "type": "integer", "format": "int64", "description": "действующая квота оперативной памяти (ГБ)" }, "vdcRamUsed": { "type": "integer", "format": "int64", "description": "используемая оперативная память (ГБ)" }, "vdcStorageQuota": { "type": "integer", "format": "int64", "description": "действующая квота дискового пространства (ГБ)" }, "vdcStorageUsed": { "type": "integer", "format": "int64", "description": "используемое дисковое пространство (ГБ)" }, "clustersCount": { "type": "integer", "format": "int64", "description": "количество кластеров" }, "mastersCount": { "type": "integer", "format": "int64", "description": "суммарное количество мастер-нод в vDC" }, "workersCount": { "type": "integer", "format": "int64", "description": "суммарное количество воркеров в vDC" } } }, "v1GetTaskResponse": { "type": "object", "properties": { "task": { "$ref": "#/definitions/v1Task" } } }, "v1IPv4Policy": { "type": "object", "properties": { "serviceCidrBlock": { "type": "string", "description": "подсеть IP-адресов для сервисов.\nПример: 172.30.0.0/16\nМинимальный размер подсети: /16.\nДолжна принадлежать приватным диапазонам (RFC 1918): 10.0.0.0/8, 172.16.0.0/12.\nНедопустимо пересечение с подсетью/подсетями в облачной сети, в которой находится кластер OpenShift.\nНедопустимо пересечение с clusterNetwork.\nНедопустимо пересечение с зарезервированными служебными подсетями: 172.17.0.0/16, 10.0.0.0/16, 192.168.0.0/24" }, "clusterNetworkCidrBlock": { "type": "string", "description": "подсеть IP-адресов, из которой для каждой ноды будет выделяться подсеть (/23) IP-адресов подов.\nПример: 10.128.0.0/14\nМинимальный размер подсети: /16. Рекомендуемый: /14.\nДолжна принадлежать приватным диапазонам (RFC 1918): 10.0.0.0/8, 172.16.0.0/12.\nНедопустимо пересечение с подсетью/подсетями в вашей облачной инфраструктуре.\nНедопустимо пересечение с serviceNetwork.\nНедопустимо пересечение с зарезервированными служебными подсетями: 172.17.0.0/16, 10.0.0.0/16, 192.168.0.0/24" } } }, "v1ListClustersResponse": { "type": "object", "properties": { "clusters": { "type": "array", "items": { "$ref": "#/definitions/v1Cluster" } } } }, "v1ListNodePoolResponse": { "type": "object", "properties": { "nodePools": { "type": "array", "items": { "$ref": "#/definitions/v1NodePool" } } } }, "v1ListOpenShiftVersionsResponse": { "type": "object", "properties": { "versions": { "type": "array", "items": { "$ref": "#/definitions/v1OpenShiftVersion" } } } }, "v1ListTasksResponse": { "type": "object", "properties": { "tasks": { "type": "array", "items": { "$ref": "#/definitions/v1Task" } } } }, "v1NodeConfig": { "type": "object", "properties": { "computeFlavor": { "$ref": "#/definitions/v1ComputeFlavor", "description": "обязательное поле. Характеристики типа ресурса,\nопределяющего размеры оперативной памяти, дискового пространства, количества ядер и тому подобного,\nкоторые будет использоваться при создании узлов." } } }, "v1NodePool": { "type": "object", "properties": { "clusterId": { "type": "string", "description": "обязательное поле. Идентификатор кластера OpenShift, в котором будет создана группа узлов." }, "name": { "type": "string", "description": "обязательное поле. Имя группы узлов. Имя должно быть уникальным.\nМожет содержать строчные буквы латинского алфавита, цифры и\nдефисы. Допустимое количество символов от 3 до 20." }, "nodeConfig": { "$ref": "#/definitions/v1NodeConfig", "description": "обязательное поле. Конфигурация ноды в группе узлов" }, "scalePolicy": { "$ref": "#/definitions/v1ScalePolicy", "description": "обязательное поле. Политика масштабирования группы узлов" }, "nodePoolId": { "type": "string", "description": "обязательное поле. Идентификатор группы узлов OpenShift" } } }, "v1OpenShiftVersion": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32", "description": "обязательное поле. Идентификатор группы узлов OpenShift" }, "version": { "type": "string", "description": "версия OpenShift" }, "channel": { "type": "string", "description": "релизный канал" } } }, "v1ScalePolicy": { "type": "object", "properties": { "fixedScale": { "$ref": "#/definitions/ScalePolicyFixedScale" } } }, "v1Task": { "type": "object", "properties": { "id": { "type": "string", "description": "идентификатор задачи" }, "serviceInstanceId": { "type": "string", "description": "идентификатор vDC (услуги)" }, "command": { "$ref": "#/definitions/v1TaskCommand", "description": "тип задачи (создать кластер, удалить кластер и т.д)" }, "createdBy": { "type": "string", "description": "идентификатор пользователя или сервисного аккаунта, инициировавшего задачу" }, "createdAt": { "type": "string", "format": "date-time", "description": "время создания задачи" }, "modifiedAt": { "type": "string", "format": "date-time", "description": "время последнего изменения ресурса" }, "status": { "$ref": "#/definitions/v1TaskStatus", "description": "статус выполнения задачи" }, "response": { "$ref": "#/definitions/protobufAny", "description": "необязательное поле. Результат выполнения задачи" }, "error": { "$ref": "#/definitions/googlerpcStatus", "description": "необязательное поле. Описание ошибки (если имеется)" }, "metadata": { "$ref": "#/definitions/protobufAny", "description": "метаданные задачи. Обычно в поле содержится идентификатор ресурса, над которым выполняется задача" } } }, "v1TaskCommand": { "type": "string", "description": "тип задачи", "enum": [ "CREATE_CLUSTER", "DELETE_CLUSTER", "CREATE_SERVICE_INSTANCE", "DELETE_SERVICE_INSTANCE", "CREATE_NODE_POOL", "UPDATE_NODE_POOL", "DELETE_NODE_POOL" ], "default": "CREATE_CLUSTER" }, "v1TaskStatus": { "type": "string", "description": "статус выполнения задачи", "enum": [ "PENDING", "IN_PROGRESS", "DONE", "FAILED" ], "default": "PENDING" }, "v1UpdateNodePoolResponse": { "type": "object", "properties": { "task": { "$ref": "#/definitions/v1Task" } } } } }