XSKY block-snapshots API

BlockSnapshotController Operations about Block Snapshot

OpenAPI Specification

xsky-block-snapshots-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 block-snapshots API
  contact: {}
  license:
    name: Commercial
basePath: /v1
tags:
- name: block-snapshots
  description: 'BlockSnapshotController Operations about Block Snapshot

    '
paths:
  /block-snapshots/:
    get:
      tags:
      - block-snapshots
      description: List block snapshots
      operationId: ListBlockSnapshots
      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: pool_id
        in: query
        description: pool id
        required: false
        type: integer
        format: int64
        x-exportParamName: PoolId
      - name: block_volume_id
        in: query
        description: volume id
        required: false
        type: integer
        format: int64
        x-exportParamName: BlockVolumeId
      - name: reserved
        in: query
        description: show reserved snapshot or not, default not
        required: false
        type: boolean
        x-exportParamName: Reserved
      - 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
      - name: all
        in: query
        description: show all snapshots
        required: false
        type: boolean
        x-exportParamName: All
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/SnapshotsResp'
        400:
          description: BadRequest
        500:
          description: InternalServerError
      security:
      - tokenInQuery: []
      - tokenInHeader: []
    post:
      tags:
      - block-snapshots
      description: Create block snapshot
      operationId: CreateBlockSnapshot
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - in: body
        name: body
        description: snapshot info
        required: true
        schema:
          $ref: '#/definitions/SnapshotCreateReq'
        x-exportParamName: Body
      responses:
        202:
          description: Accepted
          schema:
            $ref: '#/definitions/SnapshotResp'
        400:
          description: BadRequest
        500:
          description: InternalServerError
      security:
      - tokenInQuery: []
      - tokenInHeader: []
  /block-snapshots/{block_snapshot_id}:
    get:
      tags:
      - block-snapshots
      description: get block snapshot
      operationId: GetBlockSnapshot
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - name: block_snapshot_id
        in: path
        description: the block snapshot id
        required: true
        type: integer
        format: int64
        x-exportParamName: BlockSnapshotId
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/SnapshotResp'
        404:
          description: NotFound
        500:
          description: InternalServerError
      security:
      - tokenInQuery: []
      - tokenInHeader: []
  /block-snapshots/{snapshot_id}:
    delete:
      tags:
      - block-snapshots
      description: Delete block snapshot
      operationId: DeleteBlockSnapshot
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - name: snapshot_id
        in: path
        description: snapshot id
        required: true
        type: integer
        format: int64
        x-exportParamName: SnapshotId
      responses:
        202:
          description: Accepted
          schema:
            $ref: '#/definitions/SnapshotResp'
        404:
          description: NotFound
        500:
          description: InternalServerError
      security:
      - tokenInQuery: []
      - tokenInHeader: []
    patch:
      tags:
      - block-snapshots
      description: Update block snapshot info
      operationId: UpdateSnapshot
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - name: snapshot_id
        in: path
        description: snapshot id
        required: true
        type: integer
        format: int64
        x-exportParamName: SnapshotId
      - in: body
        name: body
        description: snapshot info
        required: true
        schema:
          $ref: '#/definitions/SnapshotUpdateReq'
        x-exportParamName: Body
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/SnapshotResp'
        400:
          description: BadRequest
        404:
          description: NotFound
        500:
          description: InternalServerError
      security:
      - tokenInHeader: []
      - tokenInQuery: []
definitions:
  SnapshotUpdateReq_Snapshot:
    type: object
    properties:
      description:
        type: string
      name:
        type: string
    title: SnapshotUpdateReq_Snapshot
    example:
      name: name
      description: description
  RemoteCluster_Nestview:
    type: object
    properties:
      fs_id:
        type: string
      id:
        type: integer
        format: int64
      name:
        type: string
      url:
        type: string
    title: RemoteCluster_Nestview
    example:
      name: name
      id: 2
      fs_id: fs_id
      url: url
  SnapshotUpdateReq:
    type: object
    required:
    - block_snapshot
    properties:
      block_snapshot:
        $ref: '#/definitions/SnapshotUpdateReq_Snapshot'
    title: SnapshotUpdateReq
    example:
      block_snapshot:
        name: name
        description: description
  SnapshotsResp:
    type: object
    required:
    - block_snapshots
    properties:
      block_snapshots:
        type: array
        description: snapshots
        items:
          $ref: '#/definitions/Snapshot'
    title: SnapshotsResp
    example:
      block_snapshots:
      - cloned_block_volume_num: 1
        creator: creator
        hidden: true
        pool:
          name: name
          id: 5
        snap_name: snap_name
        description: description
        update: '2000-01-23T04:56:07.000+00:00'
        allocated_size: 0
        passive: true
        volume:
          original_name: original_name
          name: name
          id: 9
        protected: true
        size: 7
        remote_cluster:
          name: name
          id: 2
          fs_id: fs_id
          url: url
        reserved: true
        name: name
        create: '2000-01-23T04:56:07.000+00:00'
        id: 5
        action_status: action_status
        block_volume_group_snapshot:
          name: name
          id: 6
        status: status
      - cloned_block_volume_num: 1
        creator: creator
        hidden: true
        pool:
          name: name
          id: 5
        snap_name: snap_name
        description: description
        update: '2000-01-23T04:56:07.000+00:00'
        allocated_size: 0
        passive: true
        volume:
          original_name: original_name
          name: name
          id: 9
        protected: true
        size: 7
        remote_cluster:
          name: name
          id: 2
          fs_id: fs_id
          url: url
        reserved: true
        name: name
        create: '2000-01-23T04:56:07.000+00:00'
        id: 5
        action_status: action_status
        block_volume_group_snapshot:
          name: name
          id: 6
        status: status
  Pool_Nestview:
    type: object
    properties:
      id:
        type: integer
        format: int64
      name:
        type: string
    title: Pool_Nestview
    example:
      name: name
      id: 5
  VolumeGroupSnapshot_Nestview:
    type: object
    properties:
      id:
        type: integer
        format: int64
      name:
        type: string
    title: VolumeGroupSnapshot_Nestview
    example:
      name: name
      id: 6
  Snapshot:
    type: object
    properties:
      action_status:
        type: string
      allocated_size:
        type: integer
        format: int64
      block_volume_group_snapshot:
        $ref: '#/definitions/VolumeGroupSnapshot_Nestview'
      cloned_block_volume_num:
        type: integer
        format: int64
      create:
        type: string
        format: date-time
      creator:
        type: string
      description:
        type: string
      hidden:
        type: boolean
      id:
        type: integer
        format: int64
      name:
        type: string
      passive:
        type: boolean
      pool:
        $ref: '#/definitions/Pool_Nestview'
      protected:
        type: boolean
      remote_cluster:
        description: the snapshot is replicated from a remote cluster
        $ref: '#/definitions/RemoteCluster_Nestview'
      reserved:
        type: boolean
      size:
        type: integer
        format: int64
      snap_name:
        type: string
      status:
        type: string
      update:
        type: string
        format: date-time
      volume:
        $ref: '#/definitions/Volume_Nestview'
    title: Snapshot
    description: Snapshot is the corresponding rbd snapshot
    example:
      cloned_block_volume_num: 1
      creator: creator
      hidden: true
      pool:
        name: name
        id: 5
      snap_name: snap_name
      description: description
      update: '2000-01-23T04:56:07.000+00:00'
      allocated_size: 0
      passive: true
      volume:
        original_name: original_name
        name: name
        id: 9
      protected: true
      size: 7
      remote_cluster:
        name: name
        id: 2
        fs_id: fs_id
        url: url
      reserved: true
      name: name
      create: '2000-01-23T04:56:07.000+00:00'
      id: 5
      action_status: action_status
      block_volume_group_snapshot:
        name: name
        id: 6
      status: status
  SnapshotCreateReq_Snapshot:
    type: object
    required:
    - block_volume_id
    - description
    - name
    properties:
      block_volume_id:
        type: integer
        format: int64
      description:
        type: string
      name:
        type: string
    title: SnapshotCreateReq_Snapshot
    example:
      block_volume_id: 0
      name: name
      description: description
  SnapshotResp:
    type: object
    required:
    - block_snapshot
    properties:
      block_snapshot:
        description: snapshot
        $ref: '#/definitions/Snapshot'
    title: SnapshotResp
    example:
      block_snapshot:
        cloned_block_volume_num: 1
        creator: creator
        hidden: true
        pool:
          name: name
          id: 5
        snap_name: snap_name
        description: description
        update: '2000-01-23T04:56:07.000+00:00'
        allocated_size: 0
        passive: true
        volume:
          original_name: original_name
          name: name
          id: 9
        protected: true
        size: 7
        remote_cluster:
          name: name
          id: 2
          fs_id: fs_id
          url: url
        reserved: true
        name: name
        create: '2000-01-23T04:56:07.000+00:00'
        id: 5
        action_status: action_status
        block_volume_group_snapshot:
          name: name
          id: 6
        status: status
  Volume_Nestview:
    type: object
    properties:
      id:
        type: integer
        format: int64
      name:
        type: string
      original_name:
        type: string
    title: Volume_Nestview
    example:
      original_name: original_name
      name: name
      id: 9
  SnapshotCreateReq:
    type: object
    required:
    - block_snapshot
    properties:
      block_snapshot:
        $ref: '#/definitions/SnapshotCreateReq_Snapshot'
    title: SnapshotCreateReq
    example:
      block_snapshot:
        block_volume_id: 0
        name: name
        description: description
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