swagger: '2.0'
info:
  description: Configuration for Mapping NetScaler IPs to configured WAF Profile names resource.
  version: 'v2'
  title: waf_profile_devices
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: waf_profile_devices
    description: Mapping NetScaler IPs to configured WAF Profile names
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: id
   in: path
   type: string
   description: Id is system generated key for WAF Profile - ADC map
   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/waf_profile_devices:
    get:
      tags:
        - waf_profile_devices
      summary: GET all waf_profile_devices
      operationId: getall_waf_profile_devices
      description: Use this operation to display NetScaler IP - WAF Profile names
      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 waf_profile_devices 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 waf_profile_devices 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 waf_profile_devices resources.
          enum:
            - yes
      responses:
        200:
          description:  for waf_profile_devices
          schema: 
              $ref: '#/definitions/getwaf_profile_devicessResponse'
        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/waf_profile_devices/{id}:
    get:
      tags:
        - waf_profile_devices
      summary: GET by key for waf_profile_devices
      operationId: getbykey_waf_profile_devices
      description: Use this operation to display NetScaler IP - WAF Profile names
      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:  for waf_profile_devices
          schema: 
              $ref: '#/definitions/getwaf_profile_devicesResponse'
        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:
        - waf_profile_devices
      summary: PUT for waf_profile_devices
      operationId: putbykey_waf_profile_devices
      description: Use this operation to modify NetScaler IP - WAF Profile names
      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: waf_profile_devices
          description: waf_profile_devices object
          schema:
              $ref: '#/definitions/modifywaf_profile_devicesRequest'
      responses:
        200:
          description:  for waf_profile_devices
          schema: 
              $ref: '#/definitions/modifywaf_profile_devicesResponse'
        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:
  getwaf_profile_devicesResponse:
    type: object
    required:
      - waf_profile_devices
    properties:
      waf_profile_devices:
        $ref: '#/definitions/waf_profile_devices'
    title: getwaf_profile_devicesResponse
    example:
      waf_profile_devices:
        parent_profname: "banking_learn_group_1"
        waf_profile_name: "waf_profile_banking_1"
        si_device_ip_address: "1.1.1.1"
        parent_name: "adm_learn_profile"
        ctnsappname: "NA"
        id: "87f6d285-7261-4d61-a081-f0ea0c70bf33"
        parent_id: "87f6d285-7261-4d61-a081-f0ea0c70bf33"

  getwaf_profile_devicessResponse:
    type: object
    required:
      - waf_profile_devices
    properties:
      waf_profile_devices:
        type: array
        items:
          $ref: '#/definitions/waf_profile_devices'
    title: getwaf_profile_devicessResponse
    example:
      waf_profile_devices:
        parent_profname: "banking_learn_group_1"
        waf_profile_name: "waf_profile_banking_1"
        si_device_ip_address: "1.1.1.1"
        parent_name: "adm_learn_profile"
        ctnsappname: "NA"
        id: "87f6d285-7261-4d61-a081-f0ea0c70bf33"
        parent_id: "87f6d285-7261-4d61-a081-f0ea0c70bf33"

  modifywaf_profile_devicesRequest:
    type: object
    required:
      - waf_profile_devices
    properties:
      waf_profile_devices:
        $ref: '#/definitions/waf_profile_devices_readwrite'
    title: modifywaf_profile_devicesRequest
    example:
      waf_profile_devices:
        parent_profname: "banking_learn_group_1"
        waf_profile_name: "waf_profile_banking_1"
        si_device_ip_address: "1.1.1.1"
        parent_name: "adm_learn_profile"
        ctnsappname: "NA"
        parent_id: "87f6d285-7261-4d61-a081-f0ea0c70bf33"

  modifywaf_profile_devicesResponse:
    type: object
    required:
      - waf_profile_devices
    properties:
      waf_profile_devices:
        $ref: '#/definitions/waf_profile_devices'
    title: modifywaf_profile_devicesResponse
    example:
      waf_profile_devices:
        parent_profname: "banking_learn_group_1"
        waf_profile_name: "waf_profile_banking_1"
        si_device_ip_address: "1.1.1.1"
        parent_name: "adm_learn_profile"
        ctnsappname: "NA"
        id: "87f6d285-7261-4d61-a081-f0ea0c70bf33"
        parent_id: "87f6d285-7261-4d61-a081-f0ea0c70bf33"

  waf_profile_devices_readwrite:
    type: object
    properties:
      parent_profname:
        description: "Profile Name used for naming a learning group"
        type: string
        format: string
        maxLength: 32
      waf_profile_name:
        description: "NetScaler WAF Profile name"
        type: string
        format: string
        maxLength: 32
      si_device_ip_address:
        description: "NetScaler IP Address"
        type: string
        format: string
        maxLength: 512
      parent_name:
        description: "Resource name of parent resource"
        type: string
        format: string
      ctnsappname:
        description: "AppName"
        type: string
        format: string
        maxLength: 255
      parent_id:
        description: "Id of the parent resource"
        type: string
        format: uuid

  waf_profile_devices:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for WAF Profile - ADC map
            type: string
            format: uuid
      - $ref: '#/definitions/waf_profile_devices_readwrite'

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