swagger: '2.0'
info:
  description: Configuration for ns_cluster_nodegroup resource.
  version: 'v2'
  title: ns_cluster_nodegroup
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: ns_cluster_nodegroup
    description: ns_cluster_nodegroup
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_cluster_nodegroup:
    post:
      tags:
        - ns_cluster_nodegroup
      summary: POST operation for ns_cluster_nodegroup
      operationId: post_ns_cluster_nodegroup
      description: POST operation for ns_cluster_nodegroup
      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_cluster_nodegroup
          description: ns_cluster_nodegroup object
          schema:
              $ref: '#/definitions/addns_cluster_nodegroupRequest'
      responses:
        200:
          description: add for ns_cluster_nodegroup
          schema: 
              $ref: '#/definitions/addns_cluster_nodegroupResponse'
        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_cluster_nodegroupRequest:
    type: object
    required:
      - ns_cluster_nodegroup
    properties:
      ns_cluster_nodegroup:
        $ref: '#/definitions/ns_cluster_nodegroup_readwrite'
    title: addns_cluster_nodegroupRequest
    example:
      ns_cluster_nodegroup:
        password: "password"
        clip: "1.1.1.1"
        name: "www.citrix.com"

  addns_cluster_nodegroupResponse:
    type: object
    required:
      - ns_cluster_nodegroup
    properties:
      ns_cluster_nodegroup:
        $ref: '#/definitions/ns_cluster_nodegroup'
    title: addns_cluster_nodegroupResponse
    example:
      ns_cluster_nodegroup:
        password: "password"
        clip: "1.1.1.1"
        name: "www.citrix.com"

  ns_cluster_nodegroup_readwrite:
    type: object
    properties:
      password:
        description: "Password of the Configuration Coordinator node(Cluster IP)"
        type: string
        format: password
        minLength: 1
        maxLength: 128
      clip:
        description: "Cluster IPAddress where this nodegroup will be added"
        type: string
        format: ipaddress
        minLength: 1
        maxLength: 64
      name:
        description: "Cluster Node Group Name"
        type: string
        format: string

  ns_cluster_nodegroup:
    allOf:
      - $ref: '#/definitions/ns_cluster_nodegroup_readwrite'

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