swagger: '2.0'
info:
  description: Configuration for NetScaler HA Pair Configure Template resource.
  version: 'v2'
  title: ns_hapair_template
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: ns_hapair_template
    description: NetScaler HA Pair Configure Template
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_hapair_template:
    get:
      tags:
        - ns_hapair_template
      summary: GET all ns_hapair_template
      operationId: getall_ns_hapair_template
      description: Use this operation to get ns ha pair
      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_hapair_template 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_hapair_template 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_hapair_template resources.
          enum:
            - yes
      responses:
        200:
          description:  for ns_hapair_template
          schema: 
              $ref: '#/definitions/getns_hapair_templatesResponse'
        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:
  getns_hapair_templateResponse:
    type: object
    required:
      - ns_hapair_template
    properties:
      ns_hapair_template:
        $ref: '#/definitions/ns_hapair_template'
    title: getns_hapair_templateResponse
    example:
      ns_hapair_template:
        nssecondary_ip_address: "string_value"
        backplane: "10/2"
        clusterid: "-1"
        secondary_nodeid: "integer_value"
        slack_profile: "admin_slack_profile"
        execute_sequentially: "boolean_value"
        nsprimary_ip_address: "string_value"
        act_id: "fce5b825-9217-4e58-b80c-48cfe8f0c6b3"
        clip: "1.1.1.1"
        primary_ip_address: "string_value"
        primary_rpcnodepassword: "password"
        configCoordinator: "string_value"
        scheduleTimesEpoch: "1580774400"
        secondary_ip_address: "string_value"
        name: "www.citrix.com"
        primary_nodeid: "integer_value"
        on_error: "string_value"
        inc_enabled: "false"
        scheduleId: "b970e730-6bc5-44c2-a2bf-8dd1382ffb5a"
        mail_profiles: "test_mail_profile"
        sync_operation: "true"
        secondary_rpcnodepassword: "password"

  getns_hapair_templatesResponse:
    type: object
    required:
      - ns_hapair_template
    properties:
      ns_hapair_template:
        type: array
        items:
          $ref: '#/definitions/ns_hapair_template'
    title: getns_hapair_templatesResponse
    example:
      ns_hapair_template:
        nssecondary_ip_address: "string_value"
        backplane: "10/2"
        clusterid: "-1"
        secondary_nodeid: "integer_value"
        slack_profile: "admin_slack_profile"
        execute_sequentially: "boolean_value"
        nsprimary_ip_address: "string_value"
        act_id: "fce5b825-9217-4e58-b80c-48cfe8f0c6b3"
        clip: "1.1.1.1"
        primary_ip_address: "string_value"
        primary_rpcnodepassword: "password"
        configCoordinator: "string_value"
        scheduleTimesEpoch: "1580774400"
        secondary_ip_address: "string_value"
        name: "www.citrix.com"
        primary_nodeid: "integer_value"
        on_error: "string_value"
        inc_enabled: "false"
        scheduleId: "b970e730-6bc5-44c2-a2bf-8dd1382ffb5a"
        mail_profiles: "test_mail_profile"
        sync_operation: "true"
        secondary_rpcnodepassword: "password"

  ns_hapair_template_readwrite:
    type: object
    properties:
      nssecondary_ip_address:
        description: "Secondary HA Node NSIP Address"
        type: string
        format: IP Address
        minLength: 1
        maxLength: 64
      backplane:
        description: "Backplane Interface"
        type: string
        format: string
        minLength: 1
        maxLength: 32
      clusterid:
        description: "Cluster Id"
        type: integer
        format: int32
      secondary_nodeid:
        description: "Secondary Node ID"
        type: integer
        format: int32
      slack_profile:
        description: "Slack profile"
        type: string
        format: string
      execute_sequentially:
        description: "True if configuration template is to be applied to devices sequentially"
        type: boolean
        format: boolean
      nsprimary_ip_address:
        description: "Primary HA Node NSIP Address"
        type: string
        format: IP Address
        minLength: 1
        maxLength: 64
      clip:
        description: "Cluster IPAddress"
        type: string
        format: IP Address
        minLength: 1
        maxLength: 64
      primary_ip_address:
        description: "Primary HA Node IP Address"
        type: string
        format: IP Address
        minLength: 1
        maxLength: 64
      primary_rpcnodepassword:
        description: "RPC Node Password for primary node"
        type: string
        format: password
        minLength: 1
        maxLength: 127
      configCoordinator:
        description: "Node to be designated as Config Coordinator - primary or secondary"
        type: string
        format: string
      scheduleTimesEpoch:
        description: "Schedule time epoch (string representation of 11 digit numbers)."
        type: string
        format: string
      secondary_ip_address:
        description: "Secondary HA Node IP Address"
        type: string
        format: IP Address
        minLength: 1
        maxLength: 64
      name:
        description: "Name"
        type: string
        format: string
        maxLength: 128
      primary_nodeid:
        description: "Prmiary Node ID"
        type: integer
        format: int32
      on_error:
        description: "Behaviour on encountering error while applying configuration template on a device: CONTINUE|EXIT"
        type: string
        format: string
        minLength: 1
        maxLength: 16
      inc_enabled:
        description: "Turn on INC mode on self node"
        type: boolean
        format: boolean
      scheduleId:
        description: "scheduleId is used to refer maintenaince schedule task"
        type: string
        format: string
      mail_profiles:
        description: "Comma separated list of Mail profiles"
        type: string
        format: string
      secondary_rpcnodepassword:
        description: "RPC Node Password for secondary node"
        type: string
        format: password
        minLength: 1
        maxLength: 127

  ns_hapair_template:
    allOf:
      -
        properties:
          act_id:
             description: "Activity Id"
             type: string
             format: string
      - $ref: '#/definitions/ns_hapair_template_readwrite'

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