# Generated with protoc-gen-openapi
# https://github.com/google/gnostic/tree/master/cmd/protoc-gen-openapi

openapi: 3.0.3
info:
    title: Node API
    version: 0.0.1
paths:
    /v1/node:
        get:
            tags:
                - Node
            operationId: Node_GetNode
            parameters:
                - name: uid
                  in: query
                  schema:
                    type: string
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/NodeReply'
                default:
                    description: Default error response
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Status'
    /v1/node/discovered:
        post:
            tags:
                - Node
            operationId: Node_DiscoveredNode
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/DiscoveredNodeRequest'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/DiscoveredNodeResponse'
                default:
                    description: Default error response
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Status'
    /v1/node/join:
        post:
            tags:
                - Node
            operationId: Node_JoinNode
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/JoinNodeRequest'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/JoinNodeResponse'
                default:
                    description: Default error response
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Status'
    /v1/node/status/update:
        post:
            tags:
                - Node
            operationId: Node_UpdateNodeStatus
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/UpdateNodeStatusRequest'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/UpdateNodeStatusResponse'
                default:
                    description: Default error response
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Status'
    /v1/nodes:
        post:
            tags:
                - Node
            operationId: Node_GetAllNodes
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/GetAllNodesReq'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/NodesReply'
                default:
                    description: Default error response
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Status'
    /v1/summary:
        post:
            tags:
                - Node
            operationId: Node_GetSummary
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/GetSummaryReq'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/DeviceSummaryReply'
                default:
                    description: Default error response
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Status'
components:
    schemas:
        DeviceSummaryReply:
            type: object
            properties:
                vgpuUsed:
                    type: integer
                    format: int32
                vgpuTotal:
                    type: integer
                    format: int32
                coreUsed:
                    type: integer
                    format: int32
                coreTotal:
                    type: integer
                    format: int32
                memoryUsed:
                    type: integer
                    format: int32
                memoryTotal:
                    type: integer
                    format: int32
                gpuCount:
                    type: integer
                    format: int32
                nodeCount:
                    type: integer
                    format: int32
        DiscoveredNodeInfo:
            type: object
            properties:
                nodeIp:
                    type: string
                nodeName:
                    type: string
        DiscoveredNodeRequest:
            type: object
            properties: {}
        DiscoveredNodeResponse:
            type: object
            properties:
                list:
                    type: array
                    items:
                        $ref: '#/components/schemas/DiscoveredNodeInfo'
        GetAllNodesReq:
            type: object
            properties:
                filters:
                    $ref: '#/components/schemas/GetAllNodesReq_Filters'
        GetAllNodesReq_Filters:
            type: object
            properties:
                ip:
                    type: string
                type:
                    type: string
                isSchedulable:
                    type: string
        GetSummaryReq:
            type: object
            properties:
                filters:
                    $ref: '#/components/schemas/GetSummaryReq_Filters'
        GetSummaryReq_Filters:
            type: object
            properties:
                type:
                    type: string
                nodeUid:
                    type: string
                deviceId:
                    type: string
        GoogleProtobufAny:
            type: object
            properties:
                '@type':
                    type: string
                    description: The type of the serialized message.
            additionalProperties: true
            description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
        JoinNodeRequest:
            type: object
            properties:
                nodeNames:
                    type: array
                    items:
                        type: string
        JoinNodeResponse:
            type: object
            properties:
                code:
                    type: integer
                    format: int32
                message:
                    type: string
        NodeReply:
            type: object
            properties:
                ip:
                    type: string
                isSchedulable:
                    type: boolean
                isReady:
                    type: boolean
                type:
                    type: array
                    items:
                        type: string
                vgpuUsed:
                    type: integer
                    format: int32
                vgpuTotal:
                    type: integer
                    format: int32
                coreUsed:
                    type: integer
                    format: int32
                coreTotal:
                    type: string
                memoryUsed:
                    type: integer
                    format: int32
                memoryTotal:
                    type: string
                uid:
                    type: string
                name:
                    type: string
                cardCnt:
                    type: integer
                    format: int32
                osImage:
                    type: string
                operatingSystem:
                    type: string
                kernelVersion:
                    type: string
                containerRuntimeVersion:
                    type: string
                kubeletVersion:
                    type: string
                kubeProxyVersion:
                    type: string
                architecture:
                    type: string
                creationTimestamp:
                    type: string
                diskSize:
                    type: string
                resourcePools:
                    type: array
                    items:
                        type: string
        NodesReply:
            type: object
            properties:
                list:
                    type: array
                    items:
                        $ref: '#/components/schemas/NodeReply'
        Status:
            type: object
            properties:
                code:
                    type: integer
                    description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
                    format: int32
                message:
                    type: string
                    description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
                details:
                    type: array
                    items:
                        $ref: '#/components/schemas/GoogleProtobufAny'
                    description: A list of messages that carry the error details.  There is a common set of message types for APIs to use.
            description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).'
        UpdateNodeStatusRequest:
            type: object
            properties:
                nodeName:
                    type: string
                status:
                    type: string
        UpdateNodeStatusResponse:
            type: object
            properties:
                code:
                    type: integer
                    format: int32
                message:
                    type: string
tags:
    - name: Node
