swagger: '2.0'
info:
  description: Configuration for Cloud Profile resource.
  version: 'v2'
  title: cc_profile
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: cc_profile
    description: Cloud Profile
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 for all the cloud profiles
   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/cc_profile:
    get:
      tags:
        - cc_profile
      summary: GET all cc_profile
      operationId: getall_cc_profile
      description: Use this operation to get cloud profile details
      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 cc_profile 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 cc_profile 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 cc_profile resources.
          enum:
            - yes
      responses:
        200:
          description:  for cc_profile
          schema: 
              $ref: '#/definitions/getcc_profilesResponse'
        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:
        - cc_profile
      summary: POST operation for cc_profile
      operationId: post_cc_profile
      description: POST operation for cc_profile
      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: cc_profile
          description: cc_profile object
          schema:
              $ref: '#/definitions/addcc_profileRequest'
      responses:
        200:
          description: add for cc_profile
          schema: 
              $ref: '#/definitions/addcc_profileResponse'
        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/cc_profile/{id}:
    get:
      tags:
        - cc_profile
      summary: GET by key for cc_profile
      operationId: getbykey_cc_profile
      description: Use this operation to get cloud profile details
      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: add for cc_profile
          schema: 
              $ref: '#/definitions/getcc_profileResponse'
        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'

    put:
      tags:
        - cc_profile
      summary: PUT for cc_profile
      operationId: putbykey_cc_profile
      description: Use this operation to modify cloud profile settings.
      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: body
          name: cc_profile
          description: cc_profile object
          schema:
              $ref: '#/definitions/modifycc_profileRequest'
      responses:
        200:
          description: add for cc_profile
          schema: 
              $ref: '#/definitions/modifycc_profileResponse'
        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:
  addcc_profileRequest:
    type: object
    required:
      - cc_profile
    properties:
      cc_profile:
        $ref: '#/definitions/cc_profile_readwrite'
    title: addcc_profileRequest
    example:
      cc_profile:
        cc_id: "string_value"
        enable_feature_telemetry: "boolean_value"
        enable_security_advisory: "boolean_value"
        tenant_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"

  addcc_profileResponse:
    type: object
    required:
      - cc_profile
    properties:
      cc_profile:
        $ref: '#/definitions/cc_profile'
    title: addcc_profileResponse
    example:
      cc_profile:
        cc_id: "string_value"
        enable_feature_telemetry: "boolean_value"
        enable_security_advisory: "boolean_value"
        pub_key: "string_value"
        new_with_cloudconnect: "boolean_value"
        tenant_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        skip_setting: "boolean_value"
        customer_id: "string_value"
        svc_end_point: "string_value"
        id: "2b38ae44-a824-4f51-a155-23abc28d81fc"
        enable_mastlmy: "boolean_value"
        instance_id: "string_value"
        pop_name: "string_value"
        svc_name: "string_value"
        is_set: "boolean_value"
        customer_name: "string_value"
        pvt_key: "string_value"
        verify_url: "string_value"
        act_id: "string_value"

  getcc_profileResponse:
    type: object
    required:
      - cc_profile
    properties:
      cc_profile:
        $ref: '#/definitions/cc_profile'
    title: getcc_profileResponse
    example:
      cc_profile:
        cc_id: "string_value"
        enable_feature_telemetry: "boolean_value"
        enable_security_advisory: "boolean_value"
        pub_key: "string_value"
        new_with_cloudconnect: "boolean_value"
        tenant_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        skip_setting: "boolean_value"
        customer_id: "string_value"
        svc_end_point: "string_value"
        id: "2b38ae44-a824-4f51-a155-23abc28d81fc"
        enable_mastlmy: "boolean_value"
        instance_id: "string_value"
        pop_name: "string_value"
        svc_name: "string_value"
        is_set: "boolean_value"
        customer_name: "string_value"
        pvt_key: "string_value"
        verify_url: "string_value"
        act_id: "string_value"

  getcc_profilesResponse:
    type: object
    required:
      - cc_profile
    properties:
      cc_profile:
        type: array
        items:
          $ref: '#/definitions/cc_profile'
    title: getcc_profilesResponse
    example:
      cc_profile:
        cc_id: "string_value"
        enable_feature_telemetry: "boolean_value"
        enable_security_advisory: "boolean_value"
        pub_key: "string_value"
        new_with_cloudconnect: "boolean_value"
        tenant_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        skip_setting: "boolean_value"
        customer_id: "string_value"
        svc_end_point: "string_value"
        id: "2b38ae44-a824-4f51-a155-23abc28d81fc"
        enable_mastlmy: "boolean_value"
        instance_id: "string_value"
        pop_name: "string_value"
        svc_name: "string_value"
        is_set: "boolean_value"
        customer_name: "string_value"
        pvt_key: "string_value"
        verify_url: "string_value"
        act_id: "string_value"

  modifycc_profileRequest:
    type: object
    required:
      - cc_profile
    properties:
      cc_profile:
        $ref: '#/definitions/cc_profile_readwrite'
    title: modifycc_profileRequest
    example:
      cc_profile:
        cc_id: "string_value"
        enable_feature_telemetry: "boolean_value"
        enable_security_advisory: "boolean_value"
        tenant_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"

  modifycc_profileResponse:
    type: object
    required:
      - cc_profile
    properties:
      cc_profile:
        $ref: '#/definitions/cc_profile'
    title: modifycc_profileResponse
    example:
      cc_profile:
        cc_id: "string_value"
        enable_feature_telemetry: "boolean_value"
        enable_security_advisory: "boolean_value"
        pub_key: "string_value"
        new_with_cloudconnect: "boolean_value"
        tenant_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        skip_setting: "boolean_value"
        customer_id: "string_value"
        svc_end_point: "string_value"
        id: "2b38ae44-a824-4f51-a155-23abc28d81fc"
        enable_mastlmy: "boolean_value"
        instance_id: "string_value"
        pop_name: "string_value"
        svc_name: "string_value"
        is_set: "boolean_value"
        customer_name: "string_value"
        pvt_key: "string_value"
        verify_url: "string_value"
        act_id: "string_value"

  cc_profile_readwrite:
    type: object
    properties:
      cc_id:
        description: "Cloud Connect ID stored at server side"
        type: string
        format: string
      enable_feature_telemetry:
        description: "Enable Feature Telemetry"
        type: boolean
        format: boolean
      enable_security_advisory:
        description: "Enable Security Advisory feature"
        type: boolean
        format: boolean
      tenant_id:
        description: "Tenant Id of cloud profile"
        type: string
        format: string
        minLength: 1
        maxLength: 128

  cc_profile:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the cloud profiles
            type: string
            format: string
          new_with_cloudconnect:
             description: "True, if this profile is updated by user with cloudconnect"
             type: boolean
             format: boolean
          skip_setting:
             description: "True, if this setting is skipped by user"
             type: boolean
             format: boolean
          customer_id:
             description: "Customer ID of the cloud profile holder"
             type: string
             format: string
          svc_end_point:
             description: "Service end point of the service"
             type: string
             format: string
          enable_mastlmy:
             description: "Enable NetScaler Console telemetry feature"
             type: boolean
             format: boolean
          instance_id:
             description: "Instance ID of the system"
             type: string
             format: string
          pop_name:
             description: "Cloud service POP Name"
             type: string
             format: string
          svc_name:
             description: "Cloud service Name"
             type: string
             format: string
             minLength: 1
             maxLength: 128
          is_set:
             description: "True, if this profile is updated by user"
             type: boolean
             format: boolean
          customer_name:
             description: "Customer Name"
             type: string
             format: string
          verify_url:
             description: "Verify URL"
             type: string
             format: string
          act_id:
             description: "Activity Id"
             type: string
             format: string
      - $ref: '#/definitions/cc_profile_readwrite'

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