diff --git a/api/openapi.yaml b/api/openapi.yaml index 60eabbcc..2e4a9134 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1,4 +1,3 @@ -<<<<<<< HEAD openapi: 3.0.3 info: title: bob-management @@ -6,31 +5,31 @@ 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,123 +47,283 @@ 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/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/v1/nodes/list: + get: + tags: + - services::api + summary: Returns simple list of all known nodes + description: |- + Returns simple list of all known nodes + + # Errors + + This function will return an error if a call to the primary node will fail + operationId: get_nodes_list + responses: + '200': + description: Simple Node List + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/dto.Node' + '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/v1/nodes/{node_name}: + get: + tags: + - services::api + summary: Returns node inforamtion by their node name + description: |- + Returns node inforamtion by their node name + + # Errors + + This function will return an error if a call to the specified node will fail or node with + specified name not found + operationId: get_node_info + responses: + '200': + description: Node Inforamtion + content: + application/json: + schema: + $ref: '#/components/schemas/Node' + '401': + description: Unauthorized + '404': + description: Node not found + security: + - api_key: [] + /api/v1/nodes/{node_name}/configuration: + get: + tags: + - services::api + summary: Get Configuration from Node + description: |- + Get Configuration from Node + + # Errors + + This function will return an error if the server was unable to get node'a client or the request to get configuration fails + operationId: raw_configuration_by_node + responses: + '200': + description: Node's configuration + content: + application/json: + schema: + $ref: '#/components/schemas/NodeConfiguration' + '401': + description: Unauthorized + '404': + description: Node Not Found + security: + - api_key: [] + /api/v1/nodes/{node_name}/metrics: + get: + tags: + - services::api + summary: Get Raw Metrics from Node + description: |- + Get Raw Metrics from Node + + # Errors + + This function will return an error if the server was unable to get node'a client or the request to get metrics fails + operationId: raw_metrics_by_node + responses: + '200': + description: Node's metrics + content: + application/json: + schema: + $ref: '#/components/schemas/TypedMetrics' + '401': + description: Unauthorized + '404': + description: Node Not Found + security: + - api_key: [] + /api/v1/vdisks/list: + get: + tags: + - services::api + summary: Returns simple list of all known vdisks + description: |- + Returns simple list of all known vdisks + + # Errors + + This function will return an error if a call to the primary node will fail + operationId: get_vdisks_list + responses: + '200': + description: Simple Node List + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/dto.VDisk' + '401': description: Unauthorized security: - - api_key: [] + - api_key: [] + /api/v1/vdisks/{vdisk_id}: + get: + tags: + - services::api + summary: Returns vdisk inforamtion by their id + description: |- + Returns vdisk inforamtion by their id + + # Errors + + This function will return an error if a call to the main node will fail or vdisk with + specified id not found + operationId: get_vdisk_info + parameters: + - name: vdisk_id + in: path + required: true + schema: + type: integer + format: int64 + minimum: 0 + responses: + '200': + description: VDisk Inforamtion + content: + application/json: + schema: + $ref: '#/components/schemas/VDisk' + '401': + description: Unauthorized + '404': + description: VDisk not found + security: + - 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 @@ -174,67 +333,103 @@ components: description: Password used during auth example: login: archeoss - password: "12345" + password: '12345' + Disk: + type: object + description: Physical disk definition + required: + - name + - path + - status + - totalSpace + - usedSpace + - iops + properties: + iops: + type: integer + format: int64 + minimum: 0 + name: + type: string + description: Disk name + path: + type: string + description: Disk path + status: + $ref: '#/components/schemas/DiskStatus' + totalSpace: + type: integer + format: int64 + minimum: 0 + usedSpace: + type: integer + format: int64 + minimum: 0 DiskCount: type: object description: Disk count by their status required: - - good - - bad - - offline + - Good + - Bad + - Offline properties: - bad: + Bad: type: integer format: int64 minimum: 0 - good: + Good: type: integer format: int64 minimum: 0 - offline: + Offline: type: integer format: int64 minimum: 0 example: - bad: 0 - good: 0 - offline: 0 + Bad: 0 + Good: 0 + Offline: 0 DiskProblem: 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 + - type: object + required: + - status + properties: + status: + type: string + enum: + - Good + - type: object + required: + - status + - problems + properties: + problems: + type: object + required: - 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 + 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 @@ -246,16 +441,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 @@ -268,12 +463,12 @@ components: MetricsSnapshotModel: type: object required: - - metrics + - metrics properties: metrics: type: object additionalProperties: - $ref: "#/components/schemas/MetricsEntryModel" + $ref: '#/components/schemas/MetricsEntryModel' NodeConfiguration: type: object properties: @@ -287,66 +482,107 @@ components: type: object description: Node count by their status required: - - good - - bad - - offline + - Good + - Bad + - Offline properties: - bad: + Bad: type: integer format: int64 minimum: 0 - good: + Good: type: integer format: int64 minimum: 0 - offline: + Offline: type: integer format: int64 minimum: 0 example: - bad: 0 - good: 0 - offline: 0 + Bad: 0 + Good: 0 + Offline: 0 + NodeInfo: + type: object + required: + - name + - hostname + - vdisks + - status + 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: + allOf: + - $ref: '#/components/schemas/RPS' + nullable: true + space: + allOf: + - $ref: '#/components/schemas/SpaceInfo' + nullable: true + status: + $ref: '#/components/schemas/NodeStatus' + vdisks: + type: array + items: + $ref: '#/components/schemas/VDisk' NodeProblem: 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 + - type: object + required: + - status + properties: + status: + type: string + enum: + - Good + - type: object + required: + - status + - problems + properties: + problems: + type: object + required: - 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 + 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 @@ -359,25 +595,25 @@ components: type: string description: Defines node status names enum: - - good - - bad - - offline + - Good + - Bad + - Offline Operation: type: string description: Types of operations on BOB cluster enum: - - put - - get - - exist - - delete + - put + - get + - exist + - delete RPS: type: object description: Requests per second by operation required: - - put - - get - - exist - - delete + - put + - get + - exist + - delete properties: delete: type: integer @@ -403,52 +639,74 @@ 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: + type: object + description: '[`VDisk`]''s replicas' + required: + - node + - disk + - path + - status + properties: + disk: + type: string + node: + type: string + path: + type: string + status: + $ref: '#/components/schemas/ReplicaStatus' 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 + - type: object + required: + - status + properties: + status: + type: string + enum: + - Good + - type: object + required: + - status + - problems + properties: + problems: + type: object + required: - problems - properties: - problems: - type: array - items: - $ref: "#/components/schemas/ReplicaProblem" - status: - type: string - enum: - - offline + 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 @@ -461,10 +719,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 @@ -490,29 +748,29 @@ components: type: object description: Raw metrics information required: - - 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 properties: backend.alien_count: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -525,8 +783,8 @@ components: backend.corrupted_blob_count: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -539,8 +797,8 @@ components: cluster_grinder.delete_count_rate: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -553,8 +811,8 @@ components: cluster_grinder.exist_count_rate: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -567,8 +825,8 @@ components: cluster_grinder.get_count_rate: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -581,8 +839,8 @@ components: cluster_grinder.put_count_rate: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -595,8 +853,8 @@ components: hardware.bob_cpu_load: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -609,8 +867,8 @@ components: hardware.bob_virtual_ram: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -623,8 +881,8 @@ components: hardware.descr_amount: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -637,8 +895,8 @@ components: hardware.free_space: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -651,8 +909,8 @@ components: hardware.total_ram: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -665,8 +923,8 @@ components: hardware.total_space: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -679,8 +937,8 @@ components: hardware.used_ram: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -693,8 +951,8 @@ components: pearl.delete_count_rate: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -707,8 +965,8 @@ components: pearl.exist_count_rate: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -721,8 +979,8 @@ components: pearl.get_count_rate: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -735,8 +993,8 @@ components: pearl.put_count_rate: type: object required: - - value - - timestamp + - value + - timestamp properties: timestamp: type: integer @@ -798,47 +1056,86 @@ components: pearl.put_count_rate: timestamp: 0 value: 0 + VDisk: + type: object + description: Virtual disk Component + required: + - id + - status + - 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' + status: + $ref: '#/components/schemas/VDiskStatus' 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: string description: |- Virtual disk status. Variants - Virtual Disk status status == 'bad' when at least one of its replicas has problems - example: - status: good + enum: + - Good + - Bad + - Offline + dto.Node: + type: object + required: + - name + - address + properties: + address: + type: string + name: + type: string + vdisks: + type: array + items: + $ref: '#/components/schemas/dto.VDisk' + nullable: true + dto.Replica: + type: object + required: + - node + - disk + - path + properties: + disk: + type: string + node: + type: string + path: + type: string + dto.VDisk: + type: object + required: + - id + properties: + id: + type: integer + format: int32 + replicas: + type: array + items: + $ref: '#/components/schemas/dto.Replica' + nullable: true securitySchemes: api_key: type: apiKey in: header name: bob_apikey tags: - - name: bob - description: BOB management API -======= - ->>>>>>> 3a6bfd4 (Add NodeList Page) +- name: bob + description: BOB management API