swagger: '2.0'
info:
  description: Configuration for Virtual server appflow config on NetScaler resource.
  version: 'v2'
  title: ns_vserver_appflow_config
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: ns_vserver_appflow_config
    description: Virtual server appflow config on NetScaler
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  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/ns_vserver_appflow_config:
    get:
      tags:
        - ns_vserver_appflow_config
      summary: GET all ns_vserver_appflow_config
      operationId: getall_ns_vserver_appflow_config
      description: get virtual server
      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 ns_vserver_appflow_config 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 ns_vserver_appflow_config 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 ns_vserver_appflow_config resources.
          enum:
            - yes
      responses:
        200:
          description:  for ns_vserver_appflow_config
          schema: 
              $ref: '#/definitions/getns_vserver_appflow_configsResponse'
        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:
        - ns_vserver_appflow_config
      summary: POST operation for ns_vserver_appflow_config
      operationId: post_ns_vserver_appflow_config
      description: POST operation for ns_vserver_appflow_config
      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: ns_vserver_appflow_config
          description: ns_vserver_appflow_config object
          schema:
              $ref: '#/definitions/addns_vserver_appflow_configRequest'
      responses:
        200:
          description: add for ns_vserver_appflow_config
          schema: 
              $ref: '#/definitions/addns_vserver_appflow_configResponse'
        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:
  addns_vserver_appflow_configRequest:
    type: object
    required:
      - ns_vserver_appflow_config
    properties:
      ns_vserver_appflow_config:
        $ref: '#/definitions/ns_vserver_appflow_config_readwrite'
    title: addns_vserver_appflow_configRequest
    example:
      ns_vserver_appflow_config:
        ns_ip_address: "1.1.1.1"
        tenant_id: "00000000-0000-375c-0000-000400000004"
        agent_list: "1.1.1.1,1.1.1.2"
        ip_address: "1.1.1.1"
        icalog: "ENABLED"
        servicetype: "http"
        export_option: "TCP"
        appflowlog: "ENABLED"
        appflow_policy_rule: "true"
        name: "test_vserver"
        es4nslog: "ENABLED"
        export_list: "WebInsight, SecurityInsight"
        transport_mode: "logstream"
        type: "lb"

  addns_vserver_appflow_configResponse:
    type: object
    required:
      - ns_vserver_appflow_config
    properties:
      ns_vserver_appflow_config:
        $ref: '#/definitions/ns_vserver_appflow_config'
    title: addns_vserver_appflow_configResponse
    example:
      ns_vserver_appflow_config:
        state: "UP"
        ns_ip_address: "1.1.1.1"
        tenant_id: "00000000-0000-375c-0000-000400000004"
        agent_list: "1.1.1.1,1.1.1.2"
        ip_address: "1.1.1.1"
        icalog: "ENABLED"
        servicetype: "http"
        export_option: "TCP"
        primary_appflowlog: "ENABLED"
        appflowlog: "ENABLED"
        appflow_policy_rule: "true"
        name: "test_vserver"
        es4nslog: "ENABLED"
        export_list: "WebInsight, SecurityInsight"
        is_vsever_to_query: "true"
        transport_mode: "logstream"
        type: "lb"

  getns_vserver_appflow_configResponse:
    type: object
    required:
      - ns_vserver_appflow_config
    properties:
      ns_vserver_appflow_config:
        $ref: '#/definitions/ns_vserver_appflow_config'
    title: getns_vserver_appflow_configResponse
    example:
      ns_vserver_appflow_config:
        state: "UP"
        ns_ip_address: "1.1.1.1"
        tenant_id: "00000000-0000-375c-0000-000400000004"
        agent_list: "1.1.1.1,1.1.1.2"
        ip_address: "1.1.1.1"
        icalog: "ENABLED"
        servicetype: "http"
        export_option: "TCP"
        primary_appflowlog: "ENABLED"
        appflowlog: "ENABLED"
        appflow_policy_rule: "true"
        name: "test_vserver"
        es4nslog: "ENABLED"
        export_list: "WebInsight, SecurityInsight"
        is_vsever_to_query: "true"
        transport_mode: "logstream"
        type: "lb"

  getns_vserver_appflow_configsResponse:
    type: object
    required:
      - ns_vserver_appflow_config
    properties:
      ns_vserver_appflow_config:
        type: array
        items:
          $ref: '#/definitions/ns_vserver_appflow_config'
    title: getns_vserver_appflow_configsResponse
    example:
      ns_vserver_appflow_config:
        state: "UP"
        ns_ip_address: "1.1.1.1"
        tenant_id: "00000000-0000-375c-0000-000400000004"
        agent_list: "1.1.1.1,1.1.1.2"
        ip_address: "1.1.1.1"
        icalog: "ENABLED"
        servicetype: "http"
        export_option: "TCP"
        primary_appflowlog: "ENABLED"
        appflowlog: "ENABLED"
        appflow_policy_rule: "true"
        name: "test_vserver"
        es4nslog: "ENABLED"
        export_list: "WebInsight, SecurityInsight"
        is_vsever_to_query: "true"
        transport_mode: "logstream"
        type: "lb"

  modifyns_vserver_appflow_configRequest:
    type: object
    required:
      - ns_vserver_appflow_config
    properties:
      ns_vserver_appflow_config:
        $ref: '#/definitions/ns_vserver_appflow_config_readwrite'
    title: modifyns_vserver_appflow_configRequest
    example:
      ns_vserver_appflow_config:
        ns_ip_address: "1.1.1.1"
        tenant_id: "00000000-0000-375c-0000-000400000004"
        agent_list: "1.1.1.1,1.1.1.2"
        ip_address: "1.1.1.1"
        icalog: "ENABLED"
        servicetype: "http"
        export_option: "TCP"
        appflowlog: "ENABLED"
        appflow_policy_rule: "true"
        name: "test_vserver"
        es4nslog: "ENABLED"
        export_list: "WebInsight, SecurityInsight"
        transport_mode: "logstream"
        type: "lb"

  modifyns_vserver_appflow_configResponse:
    type: object
    required:
      - ns_vserver_appflow_config
    properties:
      ns_vserver_appflow_config:
        $ref: '#/definitions/ns_vserver_appflow_config'
    title: modifyns_vserver_appflow_configResponse
    example:
      ns_vserver_appflow_config:
        state: "UP"
        ns_ip_address: "1.1.1.1"
        tenant_id: "00000000-0000-375c-0000-000400000004"
        agent_list: "1.1.1.1,1.1.1.2"
        ip_address: "1.1.1.1"
        icalog: "ENABLED"
        servicetype: "http"
        export_option: "TCP"
        primary_appflowlog: "ENABLED"
        appflowlog: "ENABLED"
        appflow_policy_rule: "true"
        name: "test_vserver"
        es4nslog: "ENABLED"
        export_list: "WebInsight, SecurityInsight"
        is_vsever_to_query: "true"
        transport_mode: "logstream"
        type: "lb"

  ns_vserver_appflow_config_readwrite:
    type: object
    properties:
      ns_ip_address:
        description: "NetScaler IP Address"
        type: string
        format: ipaddress
        minLength: 1
        maxLength: 64
      tenant_id:
        description: "TenantID"
        type: string
        format: uuid
      agent_list:
        description: "Agent List, on which traffic will flow"
        type: array
        items:
          type: string
          format: string
      ip_address:
        description: "Virtual server IP Address"
        type: string
        format: ipaddress
        minLength: 1
        maxLength: 64
      icalog:
        description: "ICA log"
        type: string
        format: string
      servicetype:
        description: "servicetype"
        type: string
        format: string
      export_option:
        description: "Export Options: TCP, ICA"
        type: array
        items:
          type: string
          format: string
      appflowlog:
        description: "Appflow log"
        type: string
        format: string
      appflow_policy_rule:
        description: "Appflow policy rule"
        type: string
        format: string
      name:
        description: "Virtual server name"
        type: string
        format: string
        maxLength: 255
      es4nslog:
        description: "ESNS enable"
        type: string
        format: string
      export_list:
        description: "Export List: WebInsight, SecurityInsight"
        type: array
        items:
          type: string
          format: string
      transport_mode:
        description: "Transport Mode [ Logstream/Appflow ]"
        type: string
        format: string
      type:
        description: "Tells whether virtual server type"
        type: string
        format: string
        minLength: 2
        maxLength: 64

  ns_vserver_appflow_config:
    allOf:
      -
        properties:
          state:
             description: "Tells whether virtual server up/down"
             type: string
             format: string
      - $ref: '#/definitions/ns_vserver_appflow_config_readwrite'

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