swagger: '2.0'
info:
  description: Configuration for Save configuration on NetScaler resource.
  version: 'v2'
  title: ns_save_config
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: ns_save_config
    description: Save configuration 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_save_config:
    post:
      tags:
        - ns_save_config
      summary: POST operation for ns_save_config
      operationId: post_ns_save_config
      description: POST operation for ns_save_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_save_config
          description: ns_save_config object
          schema:
              $ref: '#/definitions/addns_save_configRequest'
      responses:
        200:
          description: add for ns_save_config
          schema: 
              $ref: '#/definitions/addns_save_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_save_configRequest:
    type: object
    required:
      - ns_save_config
    properties:
      ns_save_config:
        $ref: '#/definitions/ns_save_config_readwrite'
    title: addns_save_configRequest
    example:
      ns_save_config:
        ns_ip_address_arr: "[1.1.1.1, 1.1.1.2]"

  addns_save_configResponse:
    type: object
    required:
      - ns_save_config
    properties:
      ns_save_config:
        $ref: '#/definitions/ns_save_config'
    title: addns_save_configResponse
    example:
      ns_save_config:
        act_id: "fce5b825-9217-4e58-b80c-48cfe8f0c6b3"
        ns_ip_address_arr: "[1.1.1.1, 1.1.1.2]"

  ns_save_config_readwrite:
    type: object
    properties:
      ns_ip_address_arr:
        description: "List of NetScaler IP Address"
        type: array
        items:
          type: string
          format: IP Address
        minLength: 1
        maxLength: 1024

  ns_save_config:
    allOf:
      -
        properties:
          act_id:
             description: "Activity Id"
             type: string
             format: uuid
      - $ref: '#/definitions/ns_save_config_readwrite'

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