openapi: 3.0.0
servers:
  - url: '/cgi-bin/qpkg/CacheMount/cache_mount.cgi'
info:
  description: Cache Mount API List
  version: "1.0.1"
  title: Cache Mount API List
tags:
  - name: FS
    description: File Station CGI
  - name: CM
    description: Cache Mountt CGI
  - name: Not Ready CGI
    description: Not Ready Cache Mountt CGI
  - name: UI-Ready
    description: UI implement ready
  - name: Deprecated
    description: Deprecated
paths:
  /cache_mount.cgi?func=get_share:
    get:
      tags:
        - CM
      summary: list remote mount
      operationId: getRemoteConnectionList
      description: List all remote connection 
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - get_share
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: false
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: remote mount list
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/ConnectionList'
  /cache_mount.cgi?func=get_share_usage:
    get:
      tags:
        - CM
      summary: list cached mount with usage
      operationId: getRemoteConnectionUsage
      description: List all cached mount with usage
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: false
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    $ref: '#/components/schemas/CachedMountUsage'
  /cache_mount.cgi?func=create_share:
    post:
      tags:
        - CM
      summary: create remote mount
      operationId: createRemoteConnection
      description: create a remote connection 
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: no_wait
          description: do not block
          required: false
          schema:
            type: integer
      requestBody:
          description: remote connect config
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/NewConnection'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      uuid:
                        type: string
                        description: only for no_wait=1
  /cache_mount.cgi?func=create_share_status:
    get:
      tags:
        - CM
      summary: get create share status
      operationId: createShareStatus
      description: get create share status
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          description: 'status=11, rc=-2407 means BUSY'
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
  /cache_mount.cgi?func=modify_share:
    post:
      tags:
        - CM
      summary: modify remote mount
      operationId: modifyRemoteConnection
      description: modify a remote connection 
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      requestBody:
          description: remote connect config
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/NewConnection'
      responses:
        '200':
          description: create status
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=delete_share:
    get:
      tags:
        - CM
        - UI-Ready
      summary: delete remote mount
      operationId: deleteRemoteConnection
      description: delete remote connection 
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - delete_share
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: delete status
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=get_count:
    get:
      tags:
        - CM
        - UI-Ready
      summary: get numbers of all type of remote mount
      operationId: getCount
      description: get numbers of all type of remote mount
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: remote mount numbers
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/ConnectionCountsResp'
  /cache_mount.cgi?func=get_history:
    get:
      tags:
        - CM
        - UI-Ready
      summary: get history list
      operationId: getHistoryList
      description: List history
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - get_history
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: false
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: history list
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/HistoryList'
  /cache_mount.cgi?func=delete_history:
    get:
      tags:
        - CM
      summary: delete history
      operationId: deleteHistory
      description: delete history 
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - delete_history
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: delete status
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=get_history_user_list:
    get:
      tags:
        - CM
      summary: Get history user list
      operationId: getHistoryUserList
      description: get history user list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: prefix
          description: user name prefix
          required: false
          schema:
            type: string
            maxLength: 64
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                        type: string
  /cache_mount.cgi?func=get_permission:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Get permission list
      operationId: getPermission
      description: Get permission list
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - get_permission
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      responses:
        '200':
          description: delete status
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Response'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Permission'
  /cache_mount.cgi?func=set_permission:
    post:
      tags:
        - CM
        - UI-Ready
      summary: set permission
      operationId: setPermission
      description: Set permission mode and user list
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - set_permission
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      requestBody:
          description: permission mode and list
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/NewPermission'
      responses:
        '200':
          description: delete status
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=sys_info:
    get:
      tags:
        - CM
      summary: General information
      operationId: generalInformation
      description: Get general information
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - sys_info
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      responses:
        '200':
          description: general information
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    $ref: '#/components/schemas/SysInfo'
  /cache_mount.cgi?func=mount_share:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Mount a remote connection
      operationId: mountRemote
      description: Mount a remote connection
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - mount_share
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: connection uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          description: mount status
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=unmount_share:
    get:
      tags:
        - CM
      summary: Unmount a remote connection
      operationId: unmountRemote
      description: Unmount a remote connection
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - unmount_share
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: connection uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          description: unmount status
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=enable_share:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Enable/disable a connection
      operationId: enableConnection
      description: Enable/disable a connection
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - enable_share
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
        - in: query
          name: enable
          description: 'enable/disable connection: 0/1'
          required: true
          schema:
            type: integer
            enum:
                - 0
                - 1
      responses:
        '200':
          description: command response
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=enable_cache:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Enable/disable the cache of a connection
      operationId: enableCache
      description: Enable/disable the cache of a connection
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - enable_cache
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
        - in: query
          name: enable
          description: 'enable/disable connection: 0/1'
          required: true
          schema:
            type: integer
            enum:
                - 0
                - 1
      responses:
        '200':
          description: command response
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=update_cache:
    get:
      tags:
        - CM
      summary: Start updating the cache of a connection
      operationId: updateCache
      description: Start updating the cache of a connection
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: command response
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=set_sync_action:
    get:
      tags:
        - CM
      summary: Set action after sync
      operationId: setSyncAction
      description: Set action after sync
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
        - in: query
          name: action
          description: 'action after sync: disable/delete'
          required: true
          schema:
            type: string
            enum:
                - disable
                - delete
      responses:
        '200':
          description: command response
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=set_selective_paths:
    post:
      tags:
        - CM 
      summary: Set selective mount folder list
      operationId: setSelectiveMountPaths
      description: Set selective mount folder list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: connection uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      requestBody:
          description: Selective mount folder list
          content:
            application/json:
              schema:
                type: object
                properties:
                  selective_paths:
                    type: array
                    items:
                        type: string
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=get_selective_paths:
    get:
      tags:
        - CM
      summary: Get selective mount folder list
      operationId: getSelectiveMountPaths
      description: get selective mount folder list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: connection uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      selective_paths:
                        type: array
                        items:
                            type: string
  /cache_mount.cgi?func=get_cm_folder_list:
    get:
      tags:
        - CM
      summary: Get cachemount folder list
      operationId: getCacheMountFolderList
      description: get cache mount folder list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: connection uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
        - in: query
          name: path
          description: path
          required: true
          schema:
            type: string
            maxLength: 3840
        - in: query
          name: detail 
          description: 'list with detail info'
          required: false 
          schema:
            type: integer
            enum:
                - 0
                - 1
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    $ref: '#/components/schemas/DetailFolderInfo'
  /cache_mount.cgi?func=set_folder_priority:
    post:
      tags:
        - CM 
      summary: Setup folder priority
      operationId: setFolderPriority
      description: Set folder priority
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: connection uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      requestBody:
          description: folder list with priority
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  $ref: '#/components/schemas/PriorityDataInput'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    $ref: '#/components/schemas/PriorityDataResponse'
  /cache_mount.cgi?func=get_pin_status:
    post:
      tags:
        - CM 
      summary: Get pin folder status
      operationId: getPinFolderStatus
      description: Get pin folder status
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: connection uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      requestBody:
          description: path list
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                        type: object
                        $ref: '#/components/schemas/PinFolderStatus'
  /cache_mount.cgi?func=is_cache_synced:
    get:
      tags:
        - CM
      summary: check if cache synced
      operationId: isCacheSynced
      description: check if cache synced
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: connection uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    $ref: '#/components/schemas/CacheSynced'
  /cache_mount.cgi?func=get_cache_status:
    get:
      tags:
        - CM
      summary: Get cache status
      operationId: getCacheStatus
      description: get cache status
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: connection uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    $ref: '#/components/schemas/CacheStatus'
  /cache_mount.cgi?func=get_region:
    post:
      tags:
        - CM
      summary: Get region list of a cloud service
      operationId: getRegion
      description: get region list of a cloud service
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: provider 
          description: provider name
          required: true
          schema:
            type: string
      requestBody:
          description: cloud config
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/CloudConfig'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                        type: string
  /cache_mount.cgi?func=get_container:
    post:
      tags:
        - CM
      summary: Get container list of a cloud service
      operationId: getContainer
      description: get container list of a cloud service
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      requestBody:
          description: cloud config
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/CloudConfig'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                        type: string
  /cache_mount.cgi?func=get_sharepoint_site:
    post:
      tags:
        - CM
      summary: Get site list of sharepoint account
      operationId: getSharePointSite
      description: Get site list of sharepoint account
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      requestBody:
          description: cloud config
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/CloudConfig'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
  /cache_mount.cgi?func=get_sharepoint_library:
    post:
      tags:
        - CM
      summary: Get library list of sharepoint site
      operationId: getSharePointLibrary
      description: Get library list of sharepoint site
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      requestBody:
          description: cloud config
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/CloudConfig'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                        type: string
  /cache_mount.cgi?func=get_luckycloud_library:
    post:
      tags:
        - CM
      summary: Get library list of luckycloud
      operationId: getLuckyCloudLibrary
      description: Get library list of luckycloud
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      requestBody:
          description: cloud config
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/CloudConfig'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                        type: string
  /cache_mount.cgi?func=get_cloud_info:
    post:
      tags:
        - CM
      summary: Get cloud drive info
      operationId: getCloudInfo
      description: get cloud drive info
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      requestBody:
          description: cloud config
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/CloudConfig'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        description: in byte
                      used:
                        type: integer
                        description: in byte
  /cache_mount.cgi?func=get_container_acceleration:
    post:
      tags:
        - CM
      summary: Get container acceleration status
      operationId: getContainerAcceleration
      description: get container acceleration status
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: container
          description: container name
          required: true
          schema:
            type: string
        - in: query
          name: uuid
          description: uuid
          required: false
          schema:
            type: string
            maxLength: 64
            minLength: 32
      requestBody:
          description: cloud config
          required: false
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/CloudConfig'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      transfer_acceleration:
                        type: integer
                        description: 1=enable, 0=disable
  /cache_mount.cgi?func=is_container_existed:
    post:
      tags:
        - CM
      summary: check container existance
      operationId: isContainerExisted
      description: check container existance
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: container
          description: container name
          required: true
          schema:
            type: string
      requestBody:
          description: cloud config
          required: true
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/CloudConfig'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
  /cache_mount.cgi?func=get_global_thread:
    get:
      tags:
        - CM
      summary: Get global thread config
      operationId: getGlobalThreadConfig
      description: get global thread config 
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      current_max_upload:
                        type: integer
                      current_max_download:
                        type: integer
                      platform_max_upload:
                        type: integer
                      platform_max_download:
                        type: integer
  /cache_mount.cgi?func=set_global_thread:
    post:
      tags:
        - CM
      summary: Set global thread config
      operationId: setGlobalThreadConfig
      description: Set global thread config
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: upload 
          description: upload worker
          required: true
          schema:
            type: integer
        - in: query
          name: download
          description: download worker
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=enable_qap:
    get:
      tags:
        - CM
      summary: Enable/disable QAP
      operationId: enableQAP
      description: Enable/disable QAP
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: enable
          required: true
          schema:
            type: integer
            enum:
                - 0
                - 1
      responses:
        '200':
          description: command response
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=get_cache_utilization:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Get cache global utilization
      operationId: getCacheGlobalUtilization
      description: get cache global utilization
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: start
          description: start timestamp
          schema:
            type: integer
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    $ref: '#/components/schemas/CacheUtilization'
  /cache_mount.cgi?func=get_cache_usage:
    get:
      tags:
        - CM
      summary: Get current cache usage
      operationId: getCacheUsage
      description: get current cache usage
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: false
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    $ref: '#/components/schemas/CacheUsage'
  /cache_mount.cgi?func=get_license:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Get CacheMount license information 
      operationId: getLicense
      description: Response license list include enable/disable status
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - get_license
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      responses:
        '200':
          description: delete status
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                        type: object
                        $ref: '#/components/schemas/LicenseData'
  /cache_mount.cgi?func=get_speed_history:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Get Speed test hisotry
      operationId: getSpeedHistory
      description: Response connection speed test history data, support query by specify user (only for admin group)
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - get_speed_history
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
        - in: query
          name: uuid
          description: connection uuid
          required: false
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          description: speed history
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                      type: object
                      $ref: '#/components/schemas/SpeedTest'
  /cache_mount.cgi?func=speed_test:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Start connection speed test
      operationId: speedTest
      description: Start connection speed test
      parameters:
        - in: query
          name: func
          description: function
          required: true
          schema:
            type: string
            enum:
              - speed_test
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
        - in: query
          name: uuid
          description: connection uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          description: command response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      tid:
                        type: integer
  /cache_mount.cgi?func=speed_test_check:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Get speed test status
      operationId: getSpeedTestStatus
      description: Get speed test status
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
        - in: query
          name: uuid
          description: connection uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: tid
          description: test id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: speed test result (rc = -2487, if the last test is still on going)
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object 
                    $ref: '#/components/schemas/SpeedTest'
  /cache_mount.cgi?func=delete_speed_history:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Delete Speed test hisotry
      operationId: deleteSpeedHistory
      description: Delete speed test history
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: owner_name
          description: specify user (only for admin group)
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: uid 
          description: specify uid (only for admin group)
          required: false
          schema:
            type: integer
        - in: query
          name: uuid
          description: connection uuid
          required: false
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: tid
          description: test id
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: delete status
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=get_speedtest_user_list:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Get speedtest user list
      operationId: getSpeedtestUserList
      description: get speedtest user list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: prefix
          description: user name prefix
          required: false
          schema:
            type: string
            maxLength: 64
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                        type: string
  /cache_mount.cgi?func=get_cloud_list:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Get cloud list
      operationId: getCloudList
      description: Get cloud list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object 
                    $ref: '#/components/schemas/CloudList'
  /cache_mount.cgi?func=validate_sharename:
    get:
      tags:
        - CM
      summary: Validate sharename
      operationId: validateSharename
      description: Validate sharename
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: sharename
          description: share name
          required: true
          schema:
            type: string
            maxLength: 255
            minLength: 1
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=discover:
    get:
      tags:
        - CM
      summary: discover QTS NAS
      operationId: discoverQTSNAS
      description: discover QTS NAS
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: timeout
          description: "timeout (default: 10 sec)"
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: QTS NAS list
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/QTSNASInfo'
  /cache_mount.cgi?func=get_service_ex:
    get:
      tags:
        - CM
      summary: get service list
      operationId: getServiceList
      description: get service list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: remote
          description: "remote NAS ip"
          required: true
          schema:
            type: string
            example: '172.17.20.30'
        - in: query
          name: port
          description: "port"
          required: false
          schema:
            type: integer
            example: 8080
        - in: query
          name: user 
          description: "user"
          required: true
          schema:
            type: string
            example: 'admin'
        - in: query
          name: pwd
          description: "base64 password"
          required: true
          schema:
            type: string
            example: 'Nzg5'
        - in: query
          name: secured
          description: "http or https"
          required: false
          schema:
            type: integer
            example: 0
      responses:
        '200':
          description: QTS service list
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object 
                    $ref: '#/components/schemas/QTSNASService'
  /cache_mount.cgi?func=get_nas_share:
    get:
      tags:
        - CM
      summary: get NAS share list
      operationId: getNASShareList
      description: get NAS share list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: remote
          description: "remote NAS ip"
          required: true
          schema:
            type: string
            example: '172.17.20.30'
        - in: query
          name: port
          description: "port"
          required: false
          schema:
            type: integer
            example: 8080
        - in: query
          name: user 
          description: "user"
          required: true
          schema:
            type: string
            example: 'admin'
        - in: query
          name: pwd
          description: "base64 password"
          required: true
          schema:
            type: string
            example: 'Nzg5'
        - in: query
          name: secured
          description: "http or https"
          required: false
          schema:
            type: integer
            example: 0
      responses:
        '200':
          description: NAS share list
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/QTSNASShare'
  /cache_mount.cgi?func=get_remote_nas_info:
    get:
      tags:
        - CM
      summary: get remote NAS info
      operationId: getRemoteNASInfo
      description: get remote NAS info
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: ip
          description: "remote NAS ip"
          required: true
          schema:
            type: string
            example: '172.17.20.30'
        - in: query
          name: port
          description: "port"
          required: false
          schema:
            type: integer
            example: 8080
      responses:
        '200':
          description: Remote NAS info
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    $ref: '#/components/schemas/RemoteNASInfo'
  /cache_mount.cgi?func=get_nas_volume:
    get:
      tags:
        - CM
      summary: get NAS volume list
      operationId: getNASVolumeList
      description: get NAS volume list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: remote
          description: "remote NAS ip"
          required: true
          schema:
            type: string
            example: '172.17.20.30'
        - in: query
          name: port
          description: "port"
          required: false
          schema:
            type: integer
            example: 8080
        - in: query
          name: user 
          description: "user"
          required: true
          schema:
            type: string
            example: 'admin'
        - in: query
          name: pwd
          description: "base64 password"
          required: true
          schema:
            type: string
            example: 'Nzg5'
        - in: query
          name: secured
          description: "http or https"
          required: false
          schema:
            type: integer
            example: 0
      responses:
        '200':
          description: NAS share list
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/QTSNASVolume'
  /cache_mount.cgi?func=get_smb_list:
    post:
      tags:
        - CM
      summary: get SMB list
      operationId: getSMBList
      description: get SMB list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      requestBody:
          description: remote connect config
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/NewConnection'
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                        type: string
  /cache_mount.cgi?func=get_failed_files_count:
    get:
      tags:
        - CM
      summary: Get upload failed file count
      operationId: getFailedFileCount
      description: Get upload failed file count
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          description: command response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      count:
                        type: integer
                        example: 10
  /cache_mount.cgi?func=get_upload_failed_files:
    get:
      tags:
        - CM
      summary: Get upload failed file list
      operationId: getUploadFailedFileList
      description: Get upload failed file list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: limit
          description: default and max 100
          required: false
          schema:
            type: integer
        - in: query
          name: offset
          description: default 0
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: command response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                      files:
                        type: array
                        items:
                            type: object
                            $ref: '#/components/schemas/FailedFile'
  /cache_mount.cgi?func=retry_failed_files:
    get:
      tags:
        - CM
      summary: Retry failed files
      operationId: retryFailedFiles
      description: Retry failed files
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: file_id 
          description: if not specified, retry all
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: command response
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=get_uploading_files:
    get:
      tags:
        - CM
      summary: Get uploading file list
      operationId: getUploadingFileList
      description: Get uploading file list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: limit
          description: default and max 100
          required: false
          schema:
            type: integer
        - in: query
          name: offset
          description: default 0
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: command response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                      files:
                        type: array
                        items:
                            type: object
                            $ref: '#/components/schemas/UploadingFile'
  /cache_mount.cgi?func=get_uploaded_files:
    get:
      tags:
        - CM
      summary: Get uploaded file list
      operationId: getUploadedFileList
      description: Get uploaded file list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: limit
          description: default and max 100
          required: false
          schema:
            type: integer
        - in: query
          name: offset
          description: default 0
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: command response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                      files:
                        type: array
                        items:
                            type: object
                            $ref: '#/components/schemas/UploadedFile'
  /cache_mount.cgi?func=create_temp_mount:
    post:
      tags:
        - CM
      summary: create temp mount
      operationId: createTempMount
      description: create a temp mount
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: false
          schema:
            type: string
            maxLength: 64
            minLength: 32
      requestBody:
          description: remote connect config
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/NewConnection'
      responses:
        '200':
          content:
            application/json:
              schema:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      uuid:
                        type: string
                      q_nas:
                        type: integer
                        description: 'Is QNAP NAS(0/1)'
  /cache_mount.cgi?func=list_temp_mount:
    get:
      tags:
        - CM
      summary: Get temp mount folder list
      operationId: getTempMountFolderList
      description: get temp mount folder list
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: temp mount uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: path
          description: path
          required: false
          schema:
            type: string
      responses:
        '200':
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: array
                    items:
                        type: string
  /cache_mount.cgi?func=delete_temp_mount:
    get:
      tags:
        - CM
      summary: delete temp mount
      operationId: deleteTempMount
      description: delete temp mount
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          description: delete status
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=get_temp_mount_encrypted_folder_status:
    get:
      tags:
        - Encrypted Folder
      summary: Get Temp Mount Encrypted Folder Status
      operationId: getTempMountEncryptedFolderStatus
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      encrypt_name:
                        type: boolean
                      password_hint:
                        type: string
                        example: 'pet name'
                      encrypted_folder:
                        type: string
                        example: '/@HM Encrypt'
  /cache_mount.cgi?func=unlock_temp_mount_encrypted_folder:
    get:
      tags:
        - Encrypted Folder
      summary: Unlock Temp Mount Encrypted Folder
      operationId: unlockTempMountEncryptedFolder
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: password
          description: "base64 password"
          required: true 
          schema:
            type: string
            maxLength: 32
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      encrypt_name:
                        type: boolean
                      encrypted_password:
                        type: string
                      encrypted_folder:
                        type: string
                        example: '/@HM Encrypt'
  /cache_mount.cgi?func=delete_temp_mount_encrypted_folder:
    get:
      tags:
        - Encrypted Folder
      summary: Delete Temp Mount Encrypted Folder
      operationId: deleteTempMountEncryptedFolder
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=get_encrypted_folder_status:
    get:
      tags:
        - Encrypted Folder
      summary: Get Encrypted Folder Status
      operationId: getEncryptedFolderStatus
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      encrypt_name:
                        type: boolean
                      password_hint:
                        type: string
                        example: 'pet name'
                      encrypted_folder:
                        type: string
                        example: '/@HM Encrypt'
  /cache_mount.cgi?func=create_encrypted_folder:
    get:
      tags:
        - Encrypted Folder
      summary: Create Encrypted Folder
      operationId: createEncryptedFolder
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: password
          description: "base64 password"
          required: true 
          schema:
            type: string
            maxLength: 32
        - in: query
          name: password_hint
          required: false
          schema:
            type: string
            maxLength: 64
        - in: query
          name: encrypt_name
          required: false
          schema:
            type: boolean
        - in: query
          name: lang
          required: false
          schema:
            type: string
            maxLength: 8
      responses:
        '200':
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=unlock_encrypted_folder:
    get:
      tags:
        - Encrypted Folder
      summary: Unlock Encrypted Folder
      operationId: unlockEncryptedFolder
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
        - in: query
          name: password
          description: "base64 password"
          required: true 
          schema:
            type: string
            maxLength: 32
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=lock_encrypted_folder:
    get:
      tags:
        - Encrypted Folder
      summary: Lock Encrypted Folder
      operationId: lockEncryptedFolder
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=check_encrypted_folder:
    get:
      tags:
        - Encrypted Folder
      summary: CheckEncrypted Folder
      operationId: checkEncryptedFolder
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=delete_encrypted_folder:
    get:
      tags:
        - Encrypted Folder
      summary: Delete Encrypted Folder
      operationId: deleteEncryptedFolder
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=get_encrypted_folder_runtime_status:
    get:
      tags:
        - Encrypted Folder
      summary: Get Encrypted Folder Runtime Status
      operationId: getEncryptedFolderRuntimeStatus
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: uuid
          description: uuid
          required: true
          schema:
            type: string
            maxLength: 64
            minLength: 32
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      status:
                        type: integer
                        description: 'status : 1 = unlocked, 0 = locked, -1 = does not exist, -2 = missing'
                      encrypted_folder:
                        type: string
                        example: '/@HM Encrypt'
  /cache_mount.cgi?func=get_hualu:
    get:
      tags:
        - CM
      summary: Get Hualu config 
      operationId: getHualuConfig
      description: Get Hualu config
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      responses:
        '200':
          description: command response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/ResponseStatus'
                  rc:
                    $ref: '#/components/schemas/ReturnCode'
                  msg:
                    type: string
                    example: 'Success'
                  data:
                    type: object
                    properties:
                      ip:
                        type: string
                        example: '10.12.201.36'
                      port:
                        type: integer
                        example: 9000
  /cache_mount.cgi?func=set_hualu:
    get:
      tags:
        - CM
      summary: setup Hualu config
      operationId: setupHualuConfig
      description: setup Hualu conifg
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
        - in: query
          name: ip
          description: ip
          schema:
            type: string
            maxLength: 15
            minLength: 7
        - in: query
          name: port
          description: port, -1 to delete config
          schema:
            type: integer
      responses:
        '200':
          description: setup status
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Response'
  /cache_mount.cgi?func=get_debug_log:
    get:
      tags:
        - CM
        - UI-Ready
      summary: Get log files archive
      operationId: getDebugLog
      description: get log files archive
      parameters:
        - in: query
          name: sid
          description: session id
          required: true
          schema:
            type: string
            maxLength: 36
            minLength: 36
      responses:
        '200':
          description: debug files archive
          content:
            application/zip:
              schema:
                type: string
                format: binary
components:
  schemas:
    Account:
      type: object
      properties:
        user:
          type: string
        isAdmin:
          type: boolean
    Overview:
      type: object
      properties:
        connectionList:
          type: object
          items:
            $ref: '#/components/schemas/ConnectionList'
        license_info:
          $ref: '#/components/schemas/LicenseInfo'
    Response:
      type: object
      required:
        - status
      properties:
        status:
          $ref: '#/components/schemas/ResponseStatus'
        rc:
          $ref: '#/components/schemas/ReturnCode'
        msg:
          type: string
          example: 'Success'
        data:
          type: array
          description: According query data, response different data type
          items:
            type: object
    ConnectionList:
      type: object
      required:
        - status
        - data
      properties:
        status:
          $ref: '#/components/schemas/ResponseStatus'
        rc:
          $ref: '#/components/schemas/ReturnCode'
        msg:
          type: string
          example: 'Success'
        data:
          type: array
          items:
            $ref: '#/components/schemas/Connection'
    Connection:
      properties:
        uid:
          type: integer
          description: owner's UID
        owner_name:
          type: string
          description: owner's name
        uuid:
          type: string
          description: UUID
        type:
          type: integer
          description: Protocol type |
            - 0, network drive
            - 1, cloud drive
        protocol:
          type: string
          description: 'Protocol: ftpfs | cifs | webdav ....'
        display:
          type: string
          example: Public(user@172.17.20.11)
          description: connection display label
        enable:
          type: integer
          description: 0/1
        status: 
          type: integer
          description: connection status | 
            - 0, unmounted
            - 1, mounted
            - -1, disconnected
            - -2, auth failed
            - -3, connecting
        global_error:
          type: integer
          description: global error of cmfs
        wperm:
          type: integer
          description: 'write permission of mount point'
          example: 1
        q_nas:
          type: integer
          description: 'Is QNAP NAS(0/1)'
        thumbnail:
          type: integer
          description: 'Show thumbnail(default 0: donnot show thumbnail)'
        cache:
          type: integer
          description: 0/1
        shared:
          type: integer
          description: '0/1 - enable shared folder'
        cache_pool_id:
          type: integer
          description: cache volume pool id
        cache_capacity:
          type: integer
          description: cache volume capacity in MB
        cache_volume_id:
          type: integer
          description: cache volume id
        cache_volume_path:
          type: string
          example: '/share/CACHEDEV2_DATA'
          description: cache volume path
        cache_volume_name:
          type: string
          example: 'HybridMount'
          description: cache volume name
        cache_volume_total:
          type: integer
          description: cache volume total in bytes
        cache_volume_used:
          type: integer
          description: cache volume used in bytes
        is_object:
          type: integer
          description: 'Is object storage'
          example: 0
        tid:
          type: integer
          description: 'test id, 0: not in testing'
        upload_failed_count:
          type: integer
        processing_count:
          type: integer
        no_dir_rename:
          type: integer
        no_file_rename:
          type: integer
        uri:
          type: string
          description: '/remote:{uid}@{uuid}'
        action_after_sync:
          type: string
          example: 'disable'
          description: 'action after sync: disable/delete'
        selective_mode: 
          type: integer
          example: 0
          description: '0 = full, 1 = chroot, 2 = seletive'
        selective_paths: 
          type: array
          description: 'chroot paht or seletcive paths'
          items:
            type: string
          example: [ '/Public' ]
        encryption_status: 
          type: integer
          description: 'client side encryption runtime status : 1 = unlocked, 0 = locked, -1 = does not exist, -2 = missing'
        config:
          $ref: '#/components/schemas/Config'
    NewConnection:
      properties:
        protocol:
          type: string
          description: 'Protocol: ftpfs | cifs | webdav ....'
        display:
          type: string
          example: Public(user@172.17.20.11)
          description: connection display label
        enable:
          type: integer
          description: 0/1
        q_nas:
          type: integer
          description: 'Is QNAP NAS(0/1)'
        thumbnail:
          type: integer
          description: 'Show thumbnail(default 0: donnot show thumbnail)'
        cache:
          type: integer
          description: 0/1
        shared:
          type: integer
          description: '0/1 - for SMB/NFS to enable shared folder'
        info:
          type: object
          description: Remote ethernet info
        config:
          $ref: '#/components/schemas/Config'
    CachedMountUsage:
      properties:
        uid:
          type: integer
          description: owner's UID
        uuid:
          type: string
        enable:
          type: integer
          description: 0/1
        status: 
          type: integer
          description: connection status | 
            - 0, unmounted
            - 1, mounted
            - -1, disconnected
            - -2, auth failed
            - -3, connecting
        provider:
          type: string
        account:
          type: string
          description: account or container
        display:
          type: string
          example: 'AmazonS3 (sam1029)'
        total:
          type: integer
          description: total size in bytes, -1 = not supported
        used:
          type: integer
          description: used size in bytes, -1 = not supported
    ConnectionCountsResp:
      type: object
      required:
        - status
        - data
      properties:
        status:
          $ref: '#/components/schemas/ResponseStatus'
        rc:
          $ref: '#/components/schemas/ReturnCode'
        msg:
          type: string
          example: 'Success'
        data:
          type: array
          items:
            $ref: '#/components/schemas/ConnectionCounts'
    ConnectionCounts:
      properties:
        netdrive:
          $ref: '#/components/schemas/ConnectionCount'
        clouddrive:
          $ref: '#/components/schemas/ConnectionCount'
    ConnectionCount:
      properties:
        mounted:
          type: integer
        exception:
          type: integer
        disabled:
          type: integer
        invalid:
          type: integer
        cached:
          type: integer 
    HistoryList:
      type: object
      required:
        - status
        - data
      properties:
        status:
          $ref: '#/components/schemas/ResponseStatus'
        rc:
          $ref: '#/components/schemas/ReturnCode'
        msg:
          type: string
          example: 'Success'
        data:
          type: array
          items:
            $ref: '#/components/schemas/History'
    History:
      properties:
        uuid:
          type: string
          description: UUID
        type:
          type: integer
          description: Protocol type |
            - 0, network drive
            - 1, cloud file storage
            - 2, cloud object storage
        protocol:
          type: string
          description: 'Protocol: ftpfs | cifs | webdav ....'
        display:
          type: string
          example: Public(user@172.17.20.11)
          description: connection display label
        q_nas:
          type: integer
          description: 'Is QNAP NAS(0/1)'
        thumbnail:
          type: integer
          description: 'Show thumbnail(default 0: donnot show thumbnail)'
        cache:
          type: integer
          description: 0/1
        create_date:
          type: integer
          description: Connection create timestamp
        info:
          type: object
          description: Remote ethernet info
        config:
          $ref: '#/components/schemas/Config'
    Config:
      properties:
        remote:
          type: string
          description: Remote host.
          example: '172.17.20.20'
        user:
          type: string
          description: Remote host account.
          example: 'admin'
        pwd:
          type: string
          description: Remote host base 64 encription password.
          example: 'dfasdfasd'
        port:
          type: integer
          description: Port number.
          example: 21
        folder:
          type: string
          description: Remote host folder name.
          example: '/Public'
        secured:
          type: integer
          description: FTP / WebDAV protocol ssl enable or not(1 / 0).
          example: 0
        anonymous:
          type: integer
          description: anonymous login or not(1 / 0)
          example: 0
        codepage:
          type: string
          description: Code page for network drive.
          example: '850'
        auto_reconnect:
          type: integer
          description: auto reconnect (0/1)
          example: 0
        account:
          type: string
          description: Cloud drive account. (for cloude drive)
          example: 'abc@google.com'
        email:
          type: string
          description: E-mail. (for cloude drive)
          example: 'abc@google.com'
        token:
          type: string
          description: token. (for cloude drive)
        schedule:
          $ref: '#/components/schemas/Schedule'
    CloudConfig:
      properties:
        remote.provider_type:
          type: string
          description: cloud service provider type
          example: 'amazons3'
        remote.url:
          type: string
        remote.host:
          type: string
        remove.use_ssl:
          type: boolean
        remote.verify_ssl:
          type: boolean
        remote.project_id:
          type: string
        remote.credential_type:
          type: string
        remote.credential_auth:
          type: string
        remote.scan_schedule:
          type: object
    QTSNASInfo:
      properties:
        service_name:
          type: string
          description: QTS NAS Name
          example: 'SW1-X53'
        model:
          type: string
          description: Model Name
          example: 'TS-X53'
        display_model:
          type: string
          description: Display Model Name
          example: 'TS-453'
        fwver:
          type: string
          description: Firmware version
          example: '4.3.5'
        fwbuildnum:
          type: string
          description: Firmware build number
          example: '20180808'
        sn:
          type: string
          description: Serial number
          example: 'Q13BT00806'
        cuid:
          type: string
          description: QTS NAS CUID
          example: '87b019d8e5cc6505034208010120976d'
        ip:
          type: string
          description: IP address
          example: '172.17.20.20'
        mac_address:
          type: string
          description: MAC address
          example: '00:08:9b:f2:40:7c'
        port:
          type: integer
          description: port number
          example: 8080
        access_type:
          type: string
          description: http or https
          example: 'https'
        access_port:
          type: integer
          description: http or https port number
          example: 443
        mycloudnas_name:
          type: string
          description: mycloudnas name
        mycloudnas_domain:
          type: string
          description: mycooudnas domain
        if_speed:
          type: integer
          description: "interface speed (10^N Kbps)"
          example: 3
        if_vendor:
          type: string
          description: Interface vendor name
          example: 'Intel Corporation'
        if_model:
          type: string
          description: Interface model name
          example: 'I210 Gigabit Network Connection'
    QTSNASService:
      properties:
        ftp_enable:
          type: integer
          example: 1
        ftp_reqular:
          type: integer
          description: regular mode
          example: 1
        ftps_enable:
          type: integer
          example: 1
        ftp_port:
          type: integer
          example: 21
        ftp_unicode:
          type: integer
          example: 1
        ftp_max_conn:
          type: integer
          example: 30
        ftp_max_conn_per_account:
          type: integer
          example: 10
        samba_enable:
          type: integer
          example: 1
        nfs_enable:
          type: integer
          example: 0
        afp_enable:
          type: integer
          example: 1
        webdav_enable:
          type: integer
          example: 1
        webdav_port:
          type: integer
          example: 80
        webdav_ssl:
          type: integer
          example: 1
        webdav_ssl_port:
          type: integer
          example: 8081
        qtoken:
          type: string
          example: 'MjU2Nzk0MTU2ZTc5MGJkODBhODNiNjE2YjRhZTNhYTU='
    QTSNASShare:
      properties:
        id:
          type: string
          example: '/Public'
        cls:
          type: string
          example: 'w'
        text:
          type: string
          example: 'Public'
        no_setup:
          type: integer
          example: 0
        draggable:
          type: integer
          example: 0
        iconCls:
          type: string
          example: 'folder'
        noSupportACL:
          type: integer
          example: 0
        recycle_bin:
          type: string
          example: 'enable'
        recycle_folder:
          type: string
          example: 'yes'
        max_item_limit:
          type: integer
          example: 2000
        real_total:
          type: integer
          example: 20
        volume_name:
          type: string
          example: 'DataVol1'
        volume_id:
          type: integer
          example: 1
    RemoteNASInfo:
      properties:
        hostname:
          type: string
          example: 'TS-X53'
        displayModelName:
          type: string
          example: 'TS-853 Pro'
        version:
          type: string
          example: '4.5.0'
        build:
          type: string
          example: '20180909'
        wfmPort:
          type: integer
          example: 8080
        wfmSSLPort:
          type: integer
          example: 443
        forceSSL:
          type: integer
          example: 0
    QTSNASVolume:
      properties:
        volume_name:
          type: string
          example: 'DataVol1'
        volume_id:
          type: integer
          example: 1
        volume_status:
          type: integer
          example: 0
        volume_unit:
          type: string
          example: 'GB'
        capacity:
          type: integer
          example: 123
        free_size:
          type: integer
          example: 23
        used_size:
          type: integer
          example: 100
    SysInfo:
      properties:
        build_date:
          type: string
          example: '20181111'
        license_count:
          type: integer
          example: 0
        license_connection:
          type: integer
          example: 1
        license_free_connection:
          type: integer
          example: 2
        global_thread_pool_download:
          type: integer
          example: 10
        global_thread_pool_upload:
          type: integer
          example: 10
        folder_priority:
          type: integer
          description: 'support folder priority'
          example: 1
        qap_enabled:
          type: integer
          description: '0=disable, 1=enable, -1=not set'
          example: 0
        hualu_installed:
          type: integer
          description: 'Hualu QPKG installed'
          example: 0
        hualu_setup:
          type: integer
          description: 'Hualu setup'
          example: 0
        ignored_folder_list:
          type: array
          items:
            type: string
        supported_properties:
          type: array
          items:
            type: string
    CacheStatus:
      properties:
        updating:
          type: integer
          description: 'data updating 0/1'
          example: 0
    CacheSynced:
      properties:
        synced:
          type: integer
          description: 'cache synced 0/1'
          example: 1
    CacheGlobalConfig:
      properties:
        dirty_data_ratio:
          type: integer
          description: 'write buffer ratio in % (0-75)'
          example: 35
        pin_data_ratio:
          type: integer
          description: 'pin cache ratio in % (0-75)'
          example: 10
        multimedia_thumbnail:
          type: integer
          description: 'enable user to set thumbnail (0/1)'
          example: 0
        auto_download_changed_content:
          type: integer
          description: 'enable auto download updated files (0/1)'
          example: 1
    CacheUtilization:
      properties:
        cache_location:
          type: integer
          description: '> 0 = pool id, 0 = static, -1 = not exist'
          example: 1
        timestamp:
          type: array
          items:
            type: integer
            example: 1536344400
        total_size:
          type: array
          items:
            type: integer
            description: 'total size in MB'
            example: 64000
        meta_size:
          type: array
          items:
            type: integer
            description: 'meta data size in MB'
            example: 8000
        read_size:
          type: array
          items:
            type: integer
            description: 'reading data size in MB'
            example: 18000
        write_size:
          type: array
          items:
            type: integer
            description: 'dirty data size in MB'
            example: 18000
        available_size:
          type: array
          items:
            type: integer
            description: 'available cache size in MB'
            example: 21000
        write_limit:
          type: array
          items:
            type: integer
            description: 'write buffer limit size in MB'
            example: 21000
        pin_size:
          type: array
          items:
            type: integer
            description: 'pin data size in MB'
            example: 18000
        pin_limit:
          type: array
          items:
            type: integer
            description: 'pin data limit size in MB'
            example: 21000
    CacheUsage:
      properties:
        dirty_data_ratio:
          type: integer
          description: 'dirty data ratio'
          example: 45
        pin_data_ratio:
          type: integer
          description: 'pin data ratio'
          example: 10
        total_size:
          type: integer
          description: 'total size in byte'
          example: 375747567616
        write_cache_size:
          type: integer
          description: 'write cache size in byte'
          example: 169086405427
        pin_cache_size:
          type: integer
          description: 'pin cache size in byte'
          example: 37574756761
        free_size:
          type: integer
          description: 'available cache size in byte'
          example: 375368646656
        metadata_size:
          type: integer
          description: 'meta data size in byte'
          example: 14143412
        dirty_size:
          type: integer
          description: 'writing data size in byte'
          example: 0
        reading_size:
          type: integer
          description: 'reading data size in byte'
          example: 364777548
        pinned_size:
          type: integer
          description: 'pinned data size in byte'
          example: 0
    CloudList:
      properties:
        onedrive:
          type: object
          $ref: '#/components/schemas/CloudEntry'
        googledrive:
          type: object
          $ref: '#/components/schemas/CloudEntry'
        dropbox:
          type: object
          $ref: '#/components/schemas/CloudEntry'
        amazonclouddrive:
          type: object
          $ref: '#/components/schemas/CloudEntry'
    CloudEntry:
      properties:
        name:
          type: string 
          description: cloud drive name
          example: 'GoogleDrive'
        icon_16:
          type: string
          description: 'path to icon_16'
        icon_50:
          type: string
          description: 'path to icon_50'
        auth_url:
          type: string
          description: 'auth url'
        refresh_token_uri:
          type: string
          description: 'refresh token uri'
    MountLog:
      $ref: '#/components/schemas/Connection'
    SpeedLog:
      type: object
      properties:
        datetime:
          type: string
          example: '2018/06/06 12:12:12'
        connection:
          type: string
          description: connection name
          example: 'Public(user@172.17.20.11)'
        upload:
          type: integer
        download:
          type: integer
    CacheSpaceHistory:
      type: object
      properties:
        time: 
          type: integer
    CacheSpace:
      type: object
      properties:
        pool_name:
          type: string
          example: pool 1
        capacity:
          type: integer
          description: |
            TODO: unit ?
          example: 12345
        metadata:
          type: integer
          description: |
            metadata usage
          example: 12345
        metadata_limit:
          type: integer
          description: |
            metadata usage
          example: 12345
        write_buffer:
          type: integer
          description: |
            write buffer usage
          example: 12345
        read_cache:
          type: integer
          description: |
            read cache usage
          example: 12345
        write_limit:
          type: integer
          description: |
            write spece max size 
          example: 12345
        update_time:
          type: integer
          description: |
            Date update time
        read_percent:
          type: integer
        sync_cloud_file:
          type: integer
        support_media:
          type: integer
          description: |
            Support playback media file and generate thumbnail
    SpeedTest:
      type: object
      properties:
        uuid:
          type: string
        ts:
          type: integer
          description: 'time stamp'
        up:
          type: integer
          description: 'upload speed in KBps'
        down:
          type: integer
          description: 'download speed in KBps'
    FailedFile:
      type: object
      properties:
        path:
          type: string
        file_id:
          type: integer
        size:
          type: integer
        timestamp:
          type: integer
        retryable:
          type: boolean
        error:
          type: object
          properties:
            status:
              type: integer
            msg:
              type: string
    UploadingFile:
      type: object
      properties:
        path:
          type: string
        size:
          type: integer
        start_time:
          type: integer
        progress:
          type: number 
    UploadedFile:
      type: object
      properties:
        path:
          type: string
        size:
          type: integer
        start_time:
          type: integer
        end_time:
          type: integer
    LicenseInfo:
      type: object
      properties:
        available:
          type: integer
        occupied:
          type: integer
    LicenseData:
      type: object
      properties:
        license_id:
          type: string
        status:
          type: string
        apply_date:
          type: date
          example: "2018/08/31"
        created_at:
          type: integer
          description: timestamp
        vaild_until:
          type: string
          example: "2022-08-31 08:26:56.996159"
        valid_from:
          type: string
          example: "2018-08-31 08:26:56.996159"
    PriorityDataInput:
      type: object
      properties:
        path:
          type: string
        priority:
          type: string
          descrition: "low, normal, pin"
    PriorityDataResponse:
      type: object
      properties:
        count:
          type: integer
          descrition: "success count"
    PinFolderStatus:
      type: object
      properties:
        path:
          type: string
        downloaded:
          type: integer
        total:
          type: integer
    DetailFolderInfo:
      type: object
      properties:
        path:
          type: string
        priority:
          type: string
          descrition: "low, normal, pin"
        downloaded:
          type: integer
          descrition: pin status, only available when priority = pin
        total:
          type: integer
          descrition: pin status, only available when priority = pin
    Permission:
      type: object
      properties:
        mode:
          type: integer
          description: >
            permission mode: 
              * `0` - admin only
              * `1` - administrators group only
              * `2` - Specific users
          enum:
            - 0
            - 1
            - 2
        list:
          type: array
          items:
            type: object
            properties:
              uid:
                type: integer
              owner_name:
                type: string
    NewPermission:
      type: object
      properties:
        mode:
          type: integer
          description: >
            permission mode: 
              * `0` - admin only
              * `1` - administrators group only
              * `2` - Specific users
          enum:
            - 0
            - 1
            - 2
        list:
          type: array
          items:
            type: string
    Schedule:
      type: object
      properties:
        schedule_unit:
          type: string
          description: |
            - m: minutes
            - h: hours
            - d: days
          enum:
            - m
            - h
            - d
        schedule_interval:
          type: integer
          example: 7
          description: |
            Every x schedule unit update metadata again
            minutes support value 
              - 1
              - 2
              - 3
              - 4
              - 5
              - 6
              - 10
              - 12
              - 15
              - 20
              - 30
              
            hours support value 
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 10
            - 12
            
            days support value 
            - 1
            - 2
            - 3
            - 4
            - 5 
            - 6 
            - 7
        weekly:
          type: integer
          description: |
            bitmask
            - 1: Sunday
            - 2: Monday
            - 4: Tuesday
            - 8: Wednesday
            - 16: Thursday
            - 32: Friday
            - 64: Saturday
          example: 5 (1+4 Sunday and Tuesday)
        start_time_h:
          $ref: '#/components/schemas/ScheduleHour'
        start_time_m:
          $ref: '#/components/schemas/ScheduleMinute'
        end_time_h:
          $ref: '#/components/schemas/ScheduleHour'
        end_time_m:
          $ref: '#/components/schemas/ScheduleMinute'
        schedule_time_h:
          $ref: '#/components/schemas/ScheduleHour'
        schedule_time_m:
          $ref: '#/components/schemas/ScheduleMinute'
    ScheduleHour:
      type: integer
      description: 00-23
      example: 12
    ScheduleMinute:
      type: integer
      description: 00-59
      example: 30
    ResponseStatus:
      type: integer
      example: 0
      enum:
        - 0
        - 1
    ReturnCode:
      type: integer
      description: '< -2400 remote mount error, > 2000 cloud error'
      example: 0
      enum:
        - 0
        - -2400 'General Error'
        - 4000 'Invalid Request'
