From 49cd73c8328c62a4104b83adeebd5247625cc42f Mon Sep 17 00:00:00 2001 From: archeoss Date: Wed, 15 Nov 2023 13:51:25 +0000 Subject: [PATCH] Autogenerate API --- api/openapi.yaml | 612 +++++++++++++++++++++++------------------------ 1 file changed, 306 insertions(+), 306 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 71d51a8c..5343ca66 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -5,32 +5,32 @@ info: contact: name: Romanov Simeon ArchArcheoss@proton.me license: - name: "" + name: '' version: 0.0.0 paths: /api/v1/disks/count: get: tags: - - services::api + - services::api summary: Returns count of Physical Disks per status description: | Returns count of Physical Disks per status operationId: get_disks_count responses: - "200": + '200': description: Returns a list with count of physical disks per status content: application/json: schema: - $ref: "#/components/schemas/DiskCount" - "401": + $ref: '#/components/schemas/DiskCount' + '401': description: Unauthorized security: - - api_key: [] + - api_key: [] /api/v1/login: post: tags: - - services::auth + - services::auth summary: Login to a BOB cluster description: | Login to a BOB cluster @@ -48,48 +48,48 @@ paths: The client couldn't authorize on the host operationId: login parameters: - - name: hostname - in: path - description: Address to connect to - required: true - schema: - $ref: "#/components/schemas/Hostname" - - name: credentials - in: path - description: "[Optional] Credentials used for BOB authentication" - required: true - schema: - allOf: - - $ref: "#/components/schemas/Credentials" - nullable: true + - name: hostname + in: path + description: Address to connect to + required: true + schema: + $ref: '#/components/schemas/Hostname' + - name: credentials + in: path + description: '[Optional] Credentials used for BOB authentication' + required: true + schema: + allOf: + - $ref: '#/components/schemas/Credentials' + nullable: true requestBody: - description: "" + description: '' content: application/json: schema: - $ref: "#/components/schemas/BobConnectionData" + $ref: '#/components/schemas/BobConnectionData' required: true responses: - "200": + '200': description: Successful authorization - "400": + '400': description: Bad Hostname - "401": + '401': description: Bad Credentials - "404": + '404': description: Can't reach specified hostname /api/v1/logout: post: tags: - - services::auth + - services::auth operationId: logout responses: - "200": + '200': description: Logged out /api/v1/nodes: get: tags: - - services::api + - services::api summary: Returns list of all known nodes description: |- Returns list of all known nodes @@ -99,87 +99,87 @@ paths: This function will return an error if one of the requests to get list of virtual disks or nodes fails operationId: get_nodes responses: - "200": + '200': description: Node List content: application/json: schema: type: array items: - $ref: "#/components/schemas/Node" - "401": + $ref: '#/components/schemas/Node' + '401': description: Unauthorized security: - - api_key: [] + - api_key: [] /api/v1/nodes/count: get: tags: - - services::api + - services::api summary: Get Nodes count per Status description: | Get Nodes count per Status operationId: get_nodes_count responses: - "200": + '200': description: Node count list per status content: application/json: schema: - $ref: "#/components/schemas/NodeCount" - "401": + $ref: '#/components/schemas/NodeCount' + '401': description: Unauthorized security: - - api_key: [] + - api_key: [] /api/v1/nodes/rps: get: tags: - - services::api + - services::api summary: Returns Total RPS on cluster description: | Returns Total RPS on cluster operationId: get_rps responses: - "200": + '200': description: RPS list per operation on all nodes content: application/json: schema: - $ref: "#/components/schemas/RPS" - "401": + $ref: '#/components/schemas/RPS' + '401': description: Unauthorized security: - - api_key: [] + - api_key: [] /api/v1/nodes/space: get: tags: - - services::api + - services::api summary: Return inforamtion about space on cluster description: | Return inforamtion about space on cluster operationId: get_space responses: - "200": + '200': description: Cluster Space Information content: application/json: schema: - $ref: "#/components/schemas/SpaceInfo" - "401": + $ref: '#/components/schemas/SpaceInfo' + '401': description: Unauthorized security: - - api_key: [] + - api_key: [] /api/v1/root: get: tags: - - crate + - crate operationId: root responses: - "200": + '200': description: Hello Bob! /api/v1/vdisks: get: tags: - - services::api + - services::api summary: Get Virtual Disks description: |- Get Virtual Disks @@ -189,43 +189,43 @@ paths: This function will return an error if one of the requests to get list of vdisks or nodes fails operationId: get_vdisks responses: - "200": + '200': description: Virtual disks list content: application/json: schema: type: array items: - $ref: "#/components/schemas/VDisk" - "401": + $ref: '#/components/schemas/VDisk' + '401': description: Unauthorized security: - - api_key: [] + - api_key: [] components: schemas: BobConnectionData: type: object description: Data needed to connect to a BOB cluster required: - - hostname + - hostname properties: credentials: allOf: - - $ref: "#/components/schemas/Credentials" + - $ref: '#/components/schemas/Credentials' nullable: true hostname: - $ref: "#/components/schemas/Hostname" + $ref: '#/components/schemas/Hostname' example: credentials: login: archeoss - password: "12345" + password: '12345' hostname: 0.0.0.0:7000 Credentials: type: object description: Optional auth credentials for a BOB cluster required: - - login - - password + - login + - password properties: login: type: string @@ -235,36 +235,36 @@ components: description: Password used during auth example: login: archeoss - password: "12345" + password: '12345' Disk: allOf: - - $ref: "#/components/schemas/DiskStatus" - - type: object - required: - - name - - path - - totalSpace - - usedSpace - - iops - properties: - iops: - type: integer - format: int64 - minimum: 0 - name: - type: string - description: Disk name - path: - type: string - description: Disk path - totalSpace: - type: integer - format: int64 - minimum: 0 - usedSpace: - type: integer - format: int64 - minimum: 0 + - $ref: '#/components/schemas/DiskStatus' + - type: object + required: + - name + - path + - totalSpace + - usedSpace + - iops + properties: + iops: + type: integer + format: int64 + minimum: 0 + name: + type: string + description: Disk name + path: + type: string + description: Disk path + totalSpace: + type: integer + format: int64 + minimum: 0 + usedSpace: + type: integer + format: int64 + minimum: 0 description: Physical disk definition DiskCount: type: object @@ -276,38 +276,38 @@ components: type: string description: Defines kind of problem on disk enum: - - freeSpaceRunningOut + - freeSpaceRunningOut DiskStatus: oneOf: - - type: object - required: - - status - properties: - status: - type: string - enum: - - good - - type: object - required: - - status - - problems - properties: - problems: - type: array - items: - $ref: "#/components/schemas/DiskProblem" - status: - type: string - enum: - - bad - - type: object - required: - - status - properties: - status: - type: string - enum: - - offline + - type: object + required: + - status + properties: + status: + type: string + enum: + - good + - type: object + required: + - status + - problems + properties: + problems: + type: array + items: + $ref: '#/components/schemas/DiskProblem' + status: + type: string + enum: + - bad + - type: object + required: + - status + properties: + status: + type: string + enum: + - offline description: |- Defines disk status @@ -319,16 +319,16 @@ components: type: string description: Defines disk status names enum: - - good - - bad - - offline + - good + - bad + - offline Hostname: type: string MetricsEntryModel: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -341,48 +341,48 @@ components: MetricsSnapshotModel: type: object required: - - metrics + - metrics properties: metrics: type: object additionalProperties: - $ref: "#/components/schemas/MetricsEntryModel" + $ref: '#/components/schemas/MetricsEntryModel' Node: allOf: - - $ref: "#/components/schemas/NodeStatus" - - type: object - required: - - name - - hostname - - vdisks - properties: - alienCount: - type: integer - format: int64 - nullable: true - minimum: 0 - corruptedCount: - type: integer - format: int64 - nullable: true - minimum: 0 - hostname: - type: string - name: - type: string - rps: - type: integer - format: int64 - nullable: true - minimum: 0 - space: - allOf: - - $ref: "#/components/schemas/SpaceInfo" - nullable: true - vdisks: - type: array - items: - $ref: "#/components/schemas/VDisk" + - $ref: '#/components/schemas/NodeStatus' + - type: object + required: + - name + - hostname + - vdisks + properties: + alienCount: + type: integer + format: int64 + nullable: true + minimum: 0 + corruptedCount: + type: integer + format: int64 + nullable: true + minimum: 0 + hostname: + type: string + name: + type: string + rps: + type: integer + format: int64 + nullable: true + minimum: 0 + space: + allOf: + - $ref: '#/components/schemas/SpaceInfo' + nullable: true + vdisks: + type: array + items: + $ref: '#/components/schemas/VDisk' NodeConfiguration: type: object properties: @@ -402,42 +402,42 @@ components: type: string description: Defines kind of problem on Node enum: - - aliensExists - - corruptedExists - - freeSpaceRunningOut - - virtualMemLargerThanRAM - - highCPULoad + - aliensExists + - corruptedExists + - freeSpaceRunningOut + - virtualMemLargerThanRAM + - highCPULoad NodeStatus: oneOf: - - type: object - required: - - status - properties: - status: - type: string - enum: - - good - - type: object - required: - - status - - problems - properties: - problems: - type: array - items: - $ref: "#/components/schemas/NodeProblem" - status: - type: string - enum: - - bad - - type: object - required: - - status - properties: - status: - type: string - enum: - - offline + - type: object + required: + - status + properties: + status: + type: string + enum: + - good + - type: object + required: + - status + - problems + properties: + problems: + type: array + items: + $ref: '#/components/schemas/NodeProblem' + status: + type: string + enum: + - bad + - type: object + required: + - status + properties: + status: + type: string + enum: + - offline description: |- Defines status of node @@ -450,16 +450,16 @@ components: type: string description: Defines node status names enum: - - good - - bad - - offline + - good + - bad + - offline Operation: type: string enum: - - put - - get - - exist - - delete + - put + - get + - exist + - delete RPS: type: object additionalProperties: @@ -469,68 +469,68 @@ components: RawMetricEntry: type: string enum: - - cluster_grinder.get_count_rate - - cluster_grinder.put_count_rate - - cluster_grinder.exist_count_rate - - cluster_grinder.delete_count_rate - - pearl.exist_count_rate - - pearl.get_count_rate - - pearl.put_count_rate - - pearl.delete_count_rate - - backend.alien_count - - backend.corrupted_blob_count - - hardware.bob_virtual_ram - - hardware.total_ram - - hardware.used_ram - - hardware.bob_cpu_load - - hardware.free_space - - hardware.total_space - - hardware.descr_amount + - cluster_grinder.get_count_rate + - cluster_grinder.put_count_rate + - cluster_grinder.exist_count_rate + - cluster_grinder.delete_count_rate + - pearl.exist_count_rate + - pearl.get_count_rate + - pearl.put_count_rate + - pearl.delete_count_rate + - backend.alien_count + - backend.corrupted_blob_count + - hardware.bob_virtual_ram + - hardware.total_ram + - hardware.used_ram + - hardware.bob_cpu_load + - hardware.free_space + - hardware.total_space + - hardware.descr_amount Replica: allOf: - - $ref: "#/components/schemas/ReplicaStatus" - - type: object - required: - - node - - disk - - path - properties: - disk: - type: string - node: - type: string - path: - type: string - description: "[`VDisk`]'s replicas" + - $ref: '#/components/schemas/ReplicaStatus' + - type: object + required: + - node + - disk + - path + properties: + disk: + type: string + node: + type: string + path: + type: string + description: '[`VDisk`]''s replicas' ReplicaProblem: type: string description: Reasons why Replica is offline enum: - - nodeUnavailable - - diskUnavailable + - nodeUnavailable + - diskUnavailable ReplicaStatus: oneOf: - - type: object - required: - - status - properties: - status: - type: string - enum: - - good - - type: object - required: - - status - - problems - properties: - problems: - type: array - items: - $ref: "#/components/schemas/ReplicaProblem" - status: - type: string - enum: - - offline + - type: object + required: + - status + properties: + status: + type: string + enum: + - good + - type: object + required: + - status + - problems + properties: + problems: + type: array + items: + $ref: '#/components/schemas/ReplicaProblem' + status: + type: string + enum: + - offline description: |- Replica status. It's either good or offline with the reasons why it is offline @@ -543,10 +543,10 @@ components: type: object description: Disk space information in bytes required: - - total_disk - - free_disk - - used_disk - - occupied_disk + - total_disk + - free_disk + - used_disk + - occupied_disk properties: free_disk: type: integer @@ -571,55 +571,55 @@ components: TypedMetrics: type: object additionalProperties: - $ref: "#/components/schemas/dto.MetricsEntryModel" + $ref: '#/components/schemas/dto.MetricsEntryModel' VDisk: allOf: - - $ref: "#/components/schemas/VDiskStatus" - - type: object - required: - - id - - partitionCount - - replicas - properties: - id: - type: integer - format: int64 - minimum: 0 - partitionCount: - type: integer - format: int64 - minimum: 0 - replicas: - type: array - items: - $ref: "#/components/schemas/Replica" + - $ref: '#/components/schemas/VDiskStatus' + - type: object + required: + - id + - partitionCount + - replicas + properties: + id: + type: integer + format: int64 + minimum: 0 + partitionCount: + type: integer + format: int64 + minimum: 0 + replicas: + type: array + items: + $ref: '#/components/schemas/Replica' description: Virtual disk Component VDiskStatus: oneOf: - - type: object - required: - - status - properties: - status: - type: string - enum: - - good - - type: object - required: - - status - properties: - status: - type: string - enum: - - bad - - type: object - required: - - status - properties: - status: - type: string - enum: - - offline + - type: object + required: + - status + properties: + status: + type: string + enum: + - good + - type: object + required: + - status + properties: + status: + type: string + enum: + - bad + - type: object + required: + - status + properties: + status: + type: string + enum: + - offline description: |- Virtual disk status. @@ -631,5 +631,5 @@ components: in: header name: bob_apikey tags: - - name: bob - description: BOB management API +- name: bob + description: BOB management API