swagger: '2.0'
info:
  description: Configuration for NetScaler CSvserver Information resource.
  version: 'v2'
  title: ns_csvserver
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: ns_csvserver
    description: NetScaler CSvserver Information
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
   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/ns_csvserver:
    get:
      tags:
        - ns_csvserver
      summary: GET all ns_csvserver
      operationId: getall_ns_csvserver
      description: Use this operation to get Vserver Information
      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_csvserver 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_csvserver 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_csvserver resources.
          enum:
            - yes
      responses:
        200:
          description:  for ns_csvserver
          schema: 
              $ref: '#/definitions/getns_csvserversResponse'
        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/ns_csvserver/{id}:
    get:
      tags:
        - ns_csvserver
      summary: GET by key for ns_csvserver
      operationId: getbykey_ns_csvserver
      description: Use this operation to get Vserver Information
      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 ns_csvserver
          schema: 
              $ref: '#/definitions/getns_csvserverResponse'
        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_csvserver
      summary: POST operation with actions for ns_csvserver
      operationId: post_ns_csvserver_actions
      description: POST operation with actions for ns_csvserver
      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: query
          name: action
          type: string
          required: true
          enum: [enable,poll,disable]
          description: >
            actions:
              * `enable` - Use this operation to enable the Vserver
              * `poll` - Use this operation to poll the Vserver
              * `disable` - Use this operation to disable the Vserver

        - in: body
          name: ns_csvserver
          description: ns_csvserver object
          schema:
              $ref: '#/definitions/addns_csvserverRequest'
      responses:
        200:
          description: disable for ns_csvserver
          schema: 
              $ref: '#/definitions/addns_csvserverResponse'
        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_csvserverRequest:
    type: object
    required:
      - ns_csvserver
    properties:
      ns_csvserver:
        $ref: '#/definitions/ns_csvserver_readwrite'
    title: addns_csvserverRequest
    example:
      ns_csvserver:
        user_managed: "false"
        ns_ip_address: "1.1.1.1"
        analytics_managed: "string_value"
        name: "vserver_name"
        export_list: "WebInsight, SecurityInsight"
        unified_appsec_protection_count: "0"
        vsvr_ip_address: "1.1.1.1"
        throughput: "0.34"
        icalog: "ENABLED"
        instance_id: "string_value"
        appflow_policy_rule: "true"
        es4nslog: "ENABLED"
        transport_mode: "logstream"
        configpack_id: "string_value"
        hostname: "Hostname"
        secure_vsvr_state: "0"
        unified_appsec_profile_name: "string_value"
        instance_license: "Enterprise"
        monitor_mode_toggle: "true"
        agent_list: "1.1.1.1,1.1.1.2"
        export_option: "TCP"
        appflowlog_effective: "string_value"
        appflowlog: "ENABLED"
        appsec_profile_name: "string_value"
        is_throughput_req: "false"
        svc_grp_name: "string_value"
        is_bot_policy_bound: "false"
        csvip_id: "string_value"
        app_security: "string_value"
        csvip_name: "string_value"
        is_appfw_policy_bound: "false"
        save_config: "true"
        svc_grp_id: "string_value"
        svc_name: "service_name"
        svc_id: "string_value"

  addns_csvserverResponse:
    type: object
    required:
      - ns_csvserver
    properties:
      ns_csvserver:
        $ref: '#/definitions/ns_csvserver'
    title: addns_csvserverResponse
    example:
      ns_csvserver:
        user_managed: "false"
        curclntconnections: "0"
        ns_ip_address: "1.1.1.1"
        analytics_managed: "string_value"
        name: "vserver_name"
        export_list: "WebInsight, SecurityInsight"
        targetlbvserver: "string_value"
        gslb_sync_name: "string_value"
        hits: "string_value"
        license_type: "0"
        unified_appsec_protection_count: "0"
        persistencetype: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        vsvr_ip_address: "1.1.1.1"
        throughput: "0.34"
        type_vserver: "string_value"
        icalog: "ENABLED"
        instance_id: "string_value"
        appflow_policy_rule: "true"
        vsvr_max_users: "string_value"
        es4nslog: "ENABLED"
        cursrvrconnections: "0"
        parent_app_id: "string_value"
        parent_app_name: "string_value"
        transport_mode: "logstream"
        configpack_id: "string_value"
        hostname: "Hostname"
        vsvr_type: "string_value"
        vsvr_cur_users: "string_value"
        secure_vsvr_state: "0"
        vsvr_state_timestamp: "number_value"
        unified_appsec_profile_name: "string_value"
        totalservices: "string_value"
        vsvr_port: "integer_value"
        vsvr_health: "integer_value"
        managed: "false"
        instance_license: "Enterprise"
        monitor_mode_toggle: "true"
        vsvr_state: "string_value"
        state: "UP"
        cachetype: "string_value"
        agent_list: "1.1.1.1,1.1.1.2"
        device_type: "string_value"
        export_option: "TCP"
        poll_time: "1580714461"
        customer_name: "admTenant"
        lbmethod: "string_value"
        appflowlog_effective: "string_value"
        activeservices: "string_value"
        appflowlog: "ENABLED"
        display_name: "Server1"
        comment: "string_value"
        partition_name: "p1"
        appsec_profile_name: "string_value"
        is_throughput_req: "false"
        svc_grp_name: "string_value"
        is_bot_policy_bound: "false"
        csvip_id: "string_value"
        app_security: "string_value"
        csvip_name: "string_value"
        is_appfw_policy_bound: "false"
        save_config: "true"
        svc_grp_id: "string_value"
        svc_name: "service_name"
        svc_id: "string_value"

  getns_csvserverResponse:
    type: object
    required:
      - ns_csvserver
    properties:
      ns_csvserver:
        $ref: '#/definitions/ns_csvserver'
    title: getns_csvserverResponse
    example:
      ns_csvserver:
        user_managed: "false"
        curclntconnections: "0"
        ns_ip_address: "1.1.1.1"
        analytics_managed: "string_value"
        name: "vserver_name"
        export_list: "WebInsight, SecurityInsight"
        targetlbvserver: "string_value"
        gslb_sync_name: "string_value"
        hits: "string_value"
        license_type: "0"
        unified_appsec_protection_count: "0"
        persistencetype: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        vsvr_ip_address: "1.1.1.1"
        throughput: "0.34"
        type_vserver: "string_value"
        icalog: "ENABLED"
        instance_id: "string_value"
        appflow_policy_rule: "true"
        vsvr_max_users: "string_value"
        es4nslog: "ENABLED"
        cursrvrconnections: "0"
        parent_app_id: "string_value"
        parent_app_name: "string_value"
        transport_mode: "logstream"
        configpack_id: "string_value"
        hostname: "Hostname"
        vsvr_type: "string_value"
        vsvr_cur_users: "string_value"
        secure_vsvr_state: "0"
        vsvr_state_timestamp: "number_value"
        unified_appsec_profile_name: "string_value"
        totalservices: "string_value"
        vsvr_port: "integer_value"
        vsvr_health: "integer_value"
        managed: "false"
        instance_license: "Enterprise"
        monitor_mode_toggle: "true"
        vsvr_state: "string_value"
        state: "UP"
        cachetype: "string_value"
        agent_list: "1.1.1.1,1.1.1.2"
        device_type: "string_value"
        export_option: "TCP"
        poll_time: "1580714461"
        customer_name: "admTenant"
        lbmethod: "string_value"
        appflowlog_effective: "string_value"
        activeservices: "string_value"
        appflowlog: "ENABLED"
        display_name: "Server1"
        comment: "string_value"
        partition_name: "p1"
        appsec_profile_name: "string_value"
        is_throughput_req: "false"
        svc_grp_name: "string_value"
        is_bot_policy_bound: "false"
        csvip_id: "string_value"
        app_security: "string_value"
        csvip_name: "string_value"
        is_appfw_policy_bound: "false"
        save_config: "true"
        svc_grp_id: "string_value"
        svc_name: "service_name"
        svc_id: "string_value"

  getns_csvserversResponse:
    type: object
    required:
      - ns_csvserver
    properties:
      ns_csvserver:
        type: array
        items:
          $ref: '#/definitions/ns_csvserver'
    title: getns_csvserversResponse
    example:
      ns_csvserver:
        user_managed: "false"
        curclntconnections: "0"
        ns_ip_address: "1.1.1.1"
        analytics_managed: "string_value"
        name: "vserver_name"
        export_list: "WebInsight, SecurityInsight"
        targetlbvserver: "string_value"
        gslb_sync_name: "string_value"
        hits: "string_value"
        license_type: "0"
        unified_appsec_protection_count: "0"
        persistencetype: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        vsvr_ip_address: "1.1.1.1"
        throughput: "0.34"
        type_vserver: "string_value"
        icalog: "ENABLED"
        instance_id: "string_value"
        appflow_policy_rule: "true"
        vsvr_max_users: "string_value"
        es4nslog: "ENABLED"
        cursrvrconnections: "0"
        parent_app_id: "string_value"
        parent_app_name: "string_value"
        transport_mode: "logstream"
        configpack_id: "string_value"
        hostname: "Hostname"
        vsvr_type: "string_value"
        vsvr_cur_users: "string_value"
        secure_vsvr_state: "0"
        vsvr_state_timestamp: "number_value"
        unified_appsec_profile_name: "string_value"
        totalservices: "string_value"
        vsvr_port: "integer_value"
        vsvr_health: "integer_value"
        managed: "false"
        instance_license: "Enterprise"
        monitor_mode_toggle: "true"
        vsvr_state: "string_value"
        state: "UP"
        cachetype: "string_value"
        agent_list: "1.1.1.1,1.1.1.2"
        device_type: "string_value"
        export_option: "TCP"
        poll_time: "1580714461"
        customer_name: "admTenant"
        lbmethod: "string_value"
        appflowlog_effective: "string_value"
        activeservices: "string_value"
        appflowlog: "ENABLED"
        display_name: "Server1"
        comment: "string_value"
        partition_name: "p1"
        appsec_profile_name: "string_value"
        is_throughput_req: "false"
        svc_grp_name: "string_value"
        is_bot_policy_bound: "false"
        csvip_id: "string_value"
        app_security: "string_value"
        csvip_name: "string_value"
        is_appfw_policy_bound: "false"
        save_config: "true"
        svc_grp_id: "string_value"
        svc_name: "service_name"
        svc_id: "string_value"

  ns_csvserver_readwrite:
    type: object
    properties:
      user_managed:
        description: "User Managed Idenfication"
        type: boolean
        format: boolean
      ns_ip_address:
        description: "NetScaler IP Address"
        type: string
        format: ipaddress
        minLength: 1
        maxLength: 64
      analytics_managed:
        description: "whether the analytics is auto_enabled/manual_enabled/manual_disabled..."
        type: string
        format: string
      name:
        description: "Vserver Name"
        type: string
        format: string
        minLength: 1
        maxLength: 100
      export_list:
        description: "Export List present for the given LB VServer"
        type: string
        format: string
      unified_appsec_protection_count:
        description: "unified appsec protection count to this vserver"
        type: integer
        format: int32
      vsvr_ip_address:
        description: "Vserver IP Address"
        type: string
        format: ipaddress
        minLength: 1
        maxLength: 64
      throughput:
        description: "throughput value"
        type: number
        format: double
      icalog:
        description: "ICA log"
        type: string
        format: string
      instance_id:
        description: "Netscaler ID"
        type: string
        format: string
      appflow_policy_rule:
        description: "AppFlow policy rule present"
        type: string
        format: string
      es4nslog:
        description: "ESNS enable"
        type: string
        format: string
      transport_mode:
        description: "Transport type - IPFix or LogStream"
        type: string
        format: string
      configpack_id:
        description: "Stylebooks config pack ID"
        type: string
        format: string
      hostname:
        description: "Hostname of the managed device"
        type: string
        format: string
        minLength: 1
        maxLength: 256
      secure_vsvr_state:
        description: "VServer state wheather it is secured or not"
        type: integer
        format: int32
      unified_appsec_profile_name:
        description: "unified appsec profile bound to this vserver"
        type: string
        format: string
      instance_license:
        description: "Feature License for NetScaler Instance, needs to be set while provisioning (standard, enterprise, platinum)"
        type: string
        format: string
        minLength: 1
        maxLength: 64
      monitor_mode_toggle:
        description: "Unified Appsec Monitor mode toggle"
        type: boolean
        format: boolean
      agent_list:
        description: "Agent List, on which traffic will flow"
        type: string
        format: string
      export_option:
        description: "Export Options present for the given LB VServer"
        type: string
        format: string
      appflowlog_effective:
        description: "Appflowlog effective (validating AppFlow config) enabled or disabled"
        type: string
        format: string
      appflowlog:
        description: "Appflowlog enabled or disabled"
        type: string
        format: string
      appsec_profile_name:
        description: "appsec profile bound to this vserver"
        type: string
        format: string
      is_throughput_req:
        description: "Throghput required"
        type: boolean
        format: boolean
      svc_grp_name:
        description: "Service Group Name"
        type: string
        format: string
      is_bot_policy_bound:
        description: "Is Bot Policy bound to vserver."
        type: boolean
        format: boolean
      csvip_id:
        description: "CSVIP ID"
        type: string
        format: string
      app_security:
        description: "App Security to know whether bot and appfw policies are bound."
        type: string
        format: string
      csvip_name:
        description: "CSVIP Name"
        type: string
        format: string
      is_appfw_policy_bound:
        description: "Is Appfw Policy bound to vserver."
        type: boolean
        format: boolean
      save_config:
        description: "Save configuration after enable/disable"
        type: boolean
        format: boolean
      svc_grp_id:
        description: "Service Group ID"
        type: string
        format: string
      svc_name:
        description: "Service Name"
        type: string
        format: string
      svc_id:
        description: "Service ID"
        type: string
        format: string

  ns_csvserver:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key
            type: string
            format: uuid
          targetlbvserver:
             description: "Default Target LBVserver"
             type: string
             format: string
          hits:
             description: "Traffic Domain"
             type: string
             format: string
          license_type:
             description: "License Type : 0 - not licensed, 1 - manual, 2 - vpx, 3 - cpx, 4 - auto, 5 - cpx-sidecar/free"
             type: integer
             format: int32
          state:
             description: "State of VServer"
             type: string
             format: string
          cachetype:
             description: "Cache Type"
             type: string
             format: string
          device_type:
             description: "Device Type : vpx, cpx, sdwan, blx, cpx-sidecar"
             type: string
             format: string
          display_name:
             description: "Display Name of Vserver"
             type: string
             format: string
          comment:
             description: "Vserver comment"
             type: string
             format: string
      - $ref: '#/definitions/ns_csvserver_readwrite'

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