XSKY os-gateways API

ObjectStorageGatewayController provides API for s3 gateway

OpenAPI Specification

xsky-os-gateways-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  description: XMS is the controller of distributed storage system
  version: SDS_4.2.000.0.200302
  title: XMS access-paths os-gateways API
  contact: {}
  license:
    name: Commercial
basePath: /v1
tags:
- name: os-gateways
  description: 'ObjectStorageGatewayController provides API for s3 gateway

    '
paths:
  /os-gateways/:
    get:
      tags:
      - os-gateways
      description: List s3 gateways
      operationId: ListGateways
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - name: limit
        in: query
        description: paging param
        required: false
        type: integer
        format: int64
        x-exportParamName: Limit
      - name: offset
        in: query
        description: paging param
        required: false
        type: integer
        format: int64
        x-exportParamName: Offset
      - name: q
        in: query
        description: query param of search
        required: false
        type: string
        x-exportParamName: Q
      - name: sort
        in: query
        description: sort param of search
        required: false
        type: string
        x-exportParamName: Sort
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/ObjectStorageGatewaysResp'
        500:
          description: InternalServerError
      security:
      - tokenInQuery: []
      - tokenInHeader: []
    post:
      tags:
      - os-gateways
      description: Create s3 gateway
      operationId: CreateGateway
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - in: body
        name: body
        description: gateway info
        required: true
        schema:
          $ref: '#/definitions/ObjectStorageGatewayCreateReq'
        x-exportParamName: Body
      responses:
        202:
          description: Accepted
          schema:
            $ref: '#/definitions/ObjectStorageGatewayResp'
        400:
          description: BadRequest
        409:
          description: Conflict
        500:
          description: InternalServerError
      security:
      - tokenInQuery: []
      - tokenInHeader: []
  /os-gateways/{gateway_id}:
    get:
      tags:
      - os-gateways
      description: Get s3 gateway
      operationId: GetGateway
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - name: gateway_id
        in: path
        description: gateway id
        required: true
        type: integer
        format: int64
        x-exportParamName: GatewayId
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/ObjectStorageGatewayResp'
        404:
          description: NotFound
        500:
          description: InternalServerError
      security:
      - tokenInQuery: []
      - tokenInHeader: []
    put:
      tags:
      - os-gateways
      description: Update s3 gateway
      operationId: UpdateGateway
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - name: gateway_id
        in: path
        description: gateway id
        required: true
        type: integer
        format: int64
        x-exportParamName: GatewayId
      - in: body
        name: body
        description: gateway info
        required: true
        schema:
          $ref: '#/definitions/ObjectStorageGatewayUpdateReq'
        x-exportParamName: Body
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/ObjectStorageGatewayResp'
        202:
          description: Accepted
          schema:
            $ref: '#/definitions/ObjectStorageGatewayResp'
        400:
          description: BadRequest
        404:
          description: NotFound
        409:
          description: Conflict
        500:
          description: InternalServerError
      security:
      - tokenInQuery: []
      - tokenInHeader: []
    delete:
      tags:
      - os-gateways
      description: Delete s3 gateway
      operationId: DeleteGateway
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - name: gateway_id
        in: path
        description: gateway id
        required: true
        type: integer
        format: int64
        x-exportParamName: GatewayId
      responses:
        202:
          description: Accepted
          schema:
            $ref: '#/definitions/ObjectStorageGatewayResp'
        400:
          description: BadRequest
        409:
          description: Conflict
        500:
          description: InternalServerError
      security:
      - tokenInQuery: []
      - tokenInHeader: []
  /os-gateways/{gateway_id}/samples:
    get:
      tags:
      - os-gateways
      description: Get s3 gateway's samples
      operationId: GetGatewaySamples
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - name: gateway_id
        in: path
        description: gateway id
        required: true
        type: integer
        format: int64
        x-exportParamName: GatewayId
      - name: duration_begin
        in: query
        description: duration begin timestamp
        required: false
        type: string
        x-exportParamName: DurationBegin
      - name: duration_end
        in: query
        description: duration end timestamp
        required: false
        type: string
        x-exportParamName: DurationEnd
      - name: period
        in: query
        description: samples period
        required: false
        type: string
        x-exportParamName: Period
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/ObjectStorageGatewaySamplesResp'
        404:
          description: NotFound
        500:
          description: InternalServerError
      security:
      - tokenInQuery: []
      - tokenInHeader: []
definitions:
  ObjectStorageGatewayStat:
    type: object
    properties:
      cpu_util:
        type: number
        format: double
      create:
        type: string
        format: date-time
      down_bandwidth_kbyte:
        type: number
        format: double
      down_ops:
        type: number
        format: double
      mem_usage_percent:
        type: number
        format: double
      merge_speed:
        type: integer
        format: int64
      requests:
        type: integer
        format: int64
      sync_down_bandwidth_kbyte:
        type: number
        format: double
      sync_down_ops:
        type: number
        format: double
      up_bandwidth_kbyte:
        type: number
        format: double
      up_ops:
        type: number
        format: double
    title: ObjectStorageGatewayStat
    description: ObjectStorageGatewayStat is the model of object_storage_gateway_stat
    example:
      up_bandwidth_kbyte: 3.616076749251911
      up_ops: 2.027123023002322
      down_bandwidth_kbyte: 6.027456183070403
      down_ops: 1.4658129805029452
      sync_down_ops: 9.301444243932576
      merge_speed: 5
      mem_usage_percent: 5.962133916683182
      create: '2000-01-23T04:56:07.000+00:00'
      requests: 2
      sync_down_bandwidth_kbyte: 7.061401241503109
      cpu_util: 0.8008281904610115
  ObjectStorageGateway:
    type: object
    properties:
      create:
        type: string
        format: date-time
      description:
        type: string
      gateway_ip:
        type: string
      gateway_name:
        type: string
      host:
        $ref: '#/definitions/Host_Nestview'
      id:
        type: integer
        format: int64
      name:
        type: string
      os_zone:
        $ref: '#/definitions/ObjectStorageZone_Nestview'
      port:
        type: integer
        format: int64
      role:
        type: string
      status:
        type: string
      update:
        type: string
        format: date-time
    title: ObjectStorageGateway
    description: ObjectStorageGateway is the model of object_storage_gateway @grpc-models-proto
  ObjectStorageGatewayUpdateReq_Gateway:
    type: object
    properties:
      action:
        type: string
    title: ObjectStorageGatewayUpdateReq_Gateway
    example:
      action: action
  ObjectStorageGatewayResp:
    type: object
    required:
    - os_gateway
    properties:
      os_gateway:
        description: object storage gateway
        $ref: '#/definitions/ObjectStorageGatewayRecord'
    title: ObjectStorageGatewayResp
    example:
      os_gateway: ''
  ObjectStorageGatewaysResp:
    type: object
    required:
    - os_gateways
    properties:
      os_gateways:
        type: array
        description: object storage gateways
        items:
          $ref: '#/definitions/ObjectStorageGatewayRecord'
    title: ObjectStorageGatewaysResp
    example:
      os_gateways:
      - ''
      - ''
  ObjectStorageGatewayCreateReq_Gateway:
    type: object
    required:
    - host_id
    - name
    - port
    properties:
      description:
        type: string
      gateway_ip:
        type: string
      host_id:
        type: integer
        format: int64
      name:
        type: string
      port:
        type: integer
        format: int64
      role:
        type: string
    title: ObjectStorageGatewayCreateReq_Gateway
    example:
      role: role
      port: 6
      name: name
      description: description
      gateway_ip: gateway_ip
      host_id: 0
  ObjectStorageGatewayRecord:
    title: ObjectStorageGatewayRecord
    allOf:
    - $ref: '#/definitions/ObjectStorageGateway'
    - properties:
        samples:
          type: array
          items:
            $ref: '#/definitions/ObjectStorageGatewayStat'
    description: 'ObjectStorageGatewayRecord combine ObjectStorageGateway and

      ObjectStorageGatewayStat as API response'
  Host_Nestview:
    type: object
    required:
    - admin_ip
    properties:
      admin_ip:
        type: string
      id:
        type: integer
        format: int64
      name:
        type: string
    title: Host_Nestview
    example:
      name: name
      admin_ip: admin_ip
      id: 0
  ObjectStorageGatewayCreateReq:
    type: object
    properties:
      os_gateway:
        $ref: '#/definitions/ObjectStorageGatewayCreateReq_Gateway'
    title: ObjectStorageGatewayCreateReq
    example:
      os_gateway:
        role: role
        port: 6
        name: name
        description: description
        gateway_ip: gateway_ip
        host_id: 0
  ObjectStorageZone_Nestview:
    type: object
    properties:
      id:
        type: integer
        format: int64
      uuid:
        type: string
    title: ObjectStorageZone_Nestview
    example:
      id: 7
      uuid: uuid
  ObjectStorageGatewayUpdateReq:
    type: object
    properties:
      os_gateway:
        $ref: '#/definitions/ObjectStorageGatewayUpdateReq_Gateway'
    title: ObjectStorageGatewayUpdateReq
    example:
      os_gateway:
        action: action
  ObjectStorageGatewaySamplesResp:
    type: object
    required:
    - os_gateway_samples
    properties:
      os_gateway_samples:
        type: array
        description: object storage gateway samples
        items:
          $ref: '#/definitions/ObjectStorageGatewayStat'
    title: ObjectStorageGatewaySamplesResp
    example:
      os_gateway_samples:
      - up_bandwidth_kbyte: 3.616076749251911
        up_ops: 2.027123023002322
        down_bandwidth_kbyte: 6.027456183070403
        down_ops: 1.4658129805029452
        sync_down_ops: 9.301444243932576
        merge_speed: 5
        mem_usage_percent: 5.962133916683182
        create: '2000-01-23T04:56:07.000+00:00'
        requests: 2
        sync_down_bandwidth_kbyte: 7.061401241503109
        cpu_util: 0.8008281904610115
      - up_bandwidth_kbyte: 3.616076749251911
        up_ops: 2.027123023002322
        down_bandwidth_kbyte: 6.027456183070403
        down_ops: 1.4658129805029452
        sync_down_ops: 9.301444243932576
        merge_speed: 5
        mem_usage_percent: 5.962133916683182
        create: '2000-01-23T04:56:07.000+00:00'
        requests: 2
        sync_down_bandwidth_kbyte: 7.061401241503109
        cpu_util: 0.8008281904610115
securityDefinitions:
  tokenInHeader:
    description: auth by token
    type: apiKey
    name: Xms-Auth-Token
    in: header
  tokenInQuery:
    description: auth by token
    type: apiKey
    name: token
    in: query