swagger: '2.0'
info:
  description: Configuration for Feature Toggle Status resource.
  version: 'v2'
  title: mps_feature
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: mps_feature
    description: Feature Toggle Status
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: id
   in: path
   type: string
   description: Feature ID
   required: true
  authParam:
      in: header
      name: Authorization
      type: string
      required: true
      description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
  cloudParam:
      in: header
      name: isCloud
      type: string
      required: true
      description: set the value to true in case of Cloud services, false for on-prem deployment
paths:
  /massvc/{customerid}/nitro/v2/config/mps_feature:
    get:
      tags:
        - mps_feature
      summary: GET all mps_feature
      operationId: getall_mps_feature
      description: Use this operation to get feature toggles status.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
        - in: query
          name: filter
          type: string
          required: false
          description: "Use this query-parameter to get the filtered set of vm_device resources configured on the system. You can set a filter on any property of the resource.Example:  property-name1:property-value1 "
        - in: query
          name: pagesize
          type: integer
          required: false
          description: Use this query-parameter to get the mps_feature resources in chunks.To be used along with pageno query parameter.
        - in: query
          name: pageno
          type: integer
          required: false
          description: Use this query-parameter to get the mps_feature resources in chunks.To be used along with pagesize query parameter.
        - in: query
          name: count
          type: string
          required: false
          description: Use this query-parameter to get the count of mps_feature resources.
          enum:
            - yes
      responses:
        200:
          description:  for mps_feature
          schema: 
              $ref: '#/definitions/getmps_featuresResponse'
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

    post:
      tags:
        - mps_feature
      summary: POST operation for mps_feature
      operationId: post_mps_feature
      description: POST operation for mps_feature
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
        - in: query
          name: onerror
          description: Use this parameter to set the onerror status for nitro request. Applicable only for bulk requests.
          required: false
          type: string
          default: CONTINUE
          enum:
            - EXIT
            - CONTINUE
        - in: body
          name: mps_feature
          description: mps_feature object
          schema:
              $ref: '#/definitions/addmps_featureRequest'
      responses:
        200:
          description: add for mps_feature
          schema: 
              $ref: '#/definitions/addmps_featureResponse'
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

  /massvc/{customerid}/nitro/v2/config/mps_feature/{id}:
    get:
      tags:
        - mps_feature
      summary: GET by key for mps_feature
      operationId: getbykey_mps_feature
      description: Use this operation to get feature toggles status.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/idParam'
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
      responses:
        200:
          description: add for mps_feature
          schema: 
              $ref: '#/definitions/getmps_featureResponse'
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

    put:
      tags:
        - mps_feature
      summary: PUT for mps_feature
      operationId: putbykey_mps_feature
      description: Use this operation to modify a feature toggle.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/idParam'
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
        - in: body
          name: mps_feature
          description: mps_feature object
          schema:
              $ref: '#/definitions/modifymps_featureRequest'
      responses:
        200:
          description: add for mps_feature
          schema: 
              $ref: '#/definitions/modifymps_featureResponse'
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

    delete:
      tags:
        - mps_feature
      summary: Delete for mps_feature
      operationId: deletebykey_mps_feature
      description: Use this operation to delete a feature toggle.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/idParam'
        - in: path
          name: customerid
          type: string
          required: true
          description: Customer Id of the user
        - in: header
          name: Authorization
          type: string
          required: true
          description: Session Id for authentication.Should be mentioned in the format CwsAuth bearer=sessionIdValue
        - in: header
          name: isCloud
          type: string
          required: true
          description: set the value to true in case of Cloud services, false for on-prem deployment
      responses:
        204:
          description: add for mps_feature
        400:
          description: Bad input parameter
          schema: 
              $ref: '#/definitions/Error'
        401:
          description: Failed Authentication
          schema: 
              $ref: '#/definitions/Error'
        403:
          description: Unauthorized
          schema: 
              $ref: '#/definitions/Error'
        404:
          description: Item not found
          schema: 
              $ref: '#/definitions/Error'
        409:
          description: Resource Conflict
          schema: 
              $ref: '#/definitions/Error'
        500:
          description: Server Error
          schema: 
              $ref: '#/definitions/Error'
        504:
          description: Gateway Timeout
          schema: 
              $ref: '#/definitions/Error'

definitions:
  addmps_featureRequest:
    type: object
    required:
      - mps_feature
    properties:
      mps_feature:
        $ref: '#/definitions/mps_feature_readwrite'
    title: addmps_featureRequest
    example:
      mps_feature:
        admin_toggle: "1"
        ops_toggle: "1"
        built_in: "false"
        feature_name: "Device_Syslog"
        description: "This is to enable or disable Instance Syslog Reporting feature"

  addmps_featureResponse:
    type: object
    required:
      - mps_feature
    properties:
      mps_feature:
        $ref: '#/definitions/mps_feature'
    title: addmps_featureResponse
    example:
      mps_feature:
        admin_toggle: "1"
        ops_toggle: "1"
        built_in: "false"
        feature_name: "Device_Syslog"
        id: "eaa3140e-0fd0-4ffb-a503-79ec05ff56cc"
        description: "This is to enable or disable Instance Syslog Reporting feature"
        info_from_cloud: "false"

  getmps_featureResponse:
    type: object
    required:
      - mps_feature
    properties:
      mps_feature:
        $ref: '#/definitions/mps_feature'
    title: getmps_featureResponse
    example:
      mps_feature:
        admin_toggle: "1"
        ops_toggle: "1"
        built_in: "false"
        feature_name: "Device_Syslog"
        id: "eaa3140e-0fd0-4ffb-a503-79ec05ff56cc"
        description: "This is to enable or disable Instance Syslog Reporting feature"
        info_from_cloud: "false"

  getmps_featuresResponse:
    type: object
    required:
      - mps_feature
    properties:
      mps_feature:
        type: array
        items:
          $ref: '#/definitions/mps_feature'
    title: getmps_featuresResponse
    example:
      mps_feature:
        admin_toggle: "1"
        ops_toggle: "1"
        built_in: "false"
        feature_name: "Device_Syslog"
        id: "eaa3140e-0fd0-4ffb-a503-79ec05ff56cc"
        description: "This is to enable or disable Instance Syslog Reporting feature"
        info_from_cloud: "false"

  modifymps_featureRequest:
    type: object
    required:
      - mps_feature
    properties:
      mps_feature:
        $ref: '#/definitions/mps_feature_readwrite'
    title: modifymps_featureRequest
    example:
      mps_feature:
        admin_toggle: "1"
        ops_toggle: "1"
        built_in: "false"
        feature_name: "Device_Syslog"
        description: "This is to enable or disable Instance Syslog Reporting feature"

  modifymps_featureResponse:
    type: object
    required:
      - mps_feature
    properties:
      mps_feature:
        $ref: '#/definitions/mps_feature'
    title: modifymps_featureResponse
    example:
      mps_feature:
        admin_toggle: "1"
        ops_toggle: "1"
        built_in: "false"
        feature_name: "Device_Syslog"
        id: "eaa3140e-0fd0-4ffb-a503-79ec05ff56cc"
        description: "This is to enable or disable Instance Syslog Reporting feature"
        info_from_cloud: "false"

  mps_feature_readwrite:
    type: object
    properties:
      admin_toggle:
        description: "This is Admin controllable. 0: Disable UI and Backend, 1: Disable UI and enable Backend, 2: Enable UI and disable Backend, 3: Enable UI and Backend."
        type: integer
        format: int32
      ops_toggle:
        description: "This is Ops controllable. 0: Disable UI and Backend, 1: Disable UI and enable Backend, 2: Enable UI and disable Backend, 3: Enable UI and Backend. Ops controlled takes higher precedence than Admin Controlled."
        type: integer
        format: int32
      built_in:
        description: "This is Ops controllable and will not be visible to the Admin to control. If true: Ops controllable feature, false: Admin controllable feature."
        type: boolean
        format: boolean
      feature_name:
        description: "Feature Name"
        type: string
        format: string
      description:
        description: "Feature Description."
        type: string
        format: string

  mps_feature:
    allOf:
      -
        properties:
          id:
            description: Feature ID
            type: string
            format: uuid
      - $ref: '#/definitions/mps_feature_readwrite'

  Error:
    properties:
      errorcode:
        type: number
        format: int32
        example: 1001
      errormessage:
        type: string
        format: string
        example: "id cannot be found"
