swagger: '2.0'
info:
  description: Configuration for Jazz License Information resource.
  version: 'v2'
  title: jazz_license
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: jazz_license
    description: Jazz License Information
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/jazz_license:
    get:
      tags:
        - jazz_license
      summary: GET all jazz_license
      operationId: getall_jazz_license
      description: Use this operation to get license 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 jazz_license 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 jazz_license 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 jazz_license resources.
          enum:
            - yes
      responses:
        200:
          description:  for jazz_license
          schema: 
              $ref: '#/definitions/getjazz_licensesResponse'
        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:
  addjazz_licenseRequest:
    type: object
    required:
      - jazz_license
    properties:
      jazz_license:
        $ref: '#/definitions/jazz_license_readwrite'
    title: addjazz_licenseRequest
    example:
      jazz_license:
        session_id: "##session_id"
        name: "cpuUsageHigh"
        serial_no: "Serial Number"
        is_saas: "true"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        bind_type: "string_value"
        use_proxy: "true"

  addjazz_licenseResponse:
    type: object
    required:
      - jazz_license
    properties:
      jazz_license:
        $ref: '#/definitions/jazz_license'
    title: addjazz_licenseResponse
    example:
      jazz_license:
        date_purchased: "1-dec-2019"
        session_id: "##session_id"
        features: "CNS_License_Feature_Name"
        relevance: "integer_value"
        name: "cpuUsageHigh"
        serial_no: "Serial Number"
        count_total: "integer_value"
        count_available: "integer_value"
        is_saas: "true"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        date_exp: "2-feb-2020"
        bind_type: "string_value"
        use_proxy: "true"

  getjazz_licenseResponse:
    type: object
    required:
      - jazz_license
    properties:
      jazz_license:
        $ref: '#/definitions/jazz_license'
    title: getjazz_licenseResponse
    example:
      jazz_license:
        date_purchased: "1-dec-2019"
        session_id: "##session_id"
        features: "CNS_License_Feature_Name"
        relevance: "integer_value"
        name: "cpuUsageHigh"
        serial_no: "Serial Number"
        count_total: "integer_value"
        count_available: "integer_value"
        is_saas: "true"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        date_exp: "2-feb-2020"
        bind_type: "string_value"
        use_proxy: "true"

  getjazz_licensesResponse:
    type: object
    required:
      - jazz_license
    properties:
      jazz_license:
        type: array
        items:
          $ref: '#/definitions/jazz_license'
    title: getjazz_licensesResponse
    example:
      jazz_license:
        date_purchased: "1-dec-2019"
        session_id: "##session_id"
        features: "CNS_License_Feature_Name"
        relevance: "integer_value"
        name: "cpuUsageHigh"
        serial_no: "Serial Number"
        count_total: "integer_value"
        count_available: "integer_value"
        is_saas: "true"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        date_exp: "2-feb-2020"
        bind_type: "string_value"
        use_proxy: "true"

  jazz_license_readwrite:
    type: object
    properties:
      session_id:
        description: "Session id for license"
        type: string
        format: string
      name:
        description: "Name of license"
        type: string
        format: string
      serial_no:
        description: "Serial Number for license"
        type: string
        format: string
      is_saas:
        description: "Use pooled saas license flag"
        type: boolean
        format: boolean
      id:
        description: "ID for license"
        type: string
        format: uuid
      bind_type:
        description: "Bind Type for license"
        type: string
        format: string
      use_proxy:
        description: "Use license proxy configured to connect to citrix backoffice"
        type: boolean
        format: boolean

  jazz_license:
    allOf:
      -
        properties:
          date_purchased:
             description: "Purchase Date for license"
             type: string
             format: date
          features:
             description: "Features for license"
             type: string
             format: string
          relevance:
             description: "Relevance of license"
             type: integer
             format: int32
          count_total:
             description: "Count Total of license"
             type: integer
             format: int32
          count_available:
             description: "Count Available of license"
             type: integer
             format: int32
          date_exp:
             description: "Expiry Date for license"
             type: string
             format: date
      - $ref: '#/definitions/jazz_license_readwrite'

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