swagger: '2.0'
info:
  description: Configuration for Authorized Scope resource.
  version: 'v2'
  title: authorized_scope
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: authorized_scope
    description: Authorized Scope
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  UserSecurity:
    type: basic
security:
  - UserSecurity: []
parameters:
  idParam:
   name: id
   in: path
   type: string
   description: Auto generated ID.
   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/authorized_scope:
    get:
      tags:
        - authorized_scope
      summary: GET all authorized_scope
      operationId: getall_authorized_scope
      description: Use this operation to get system groups
      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 authorized_scope 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 authorized_scope 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 authorized_scope resources.
          enum:
            - yes
      responses:
        200:
          description:  for authorized_scope
          schema: 
              $ref: '#/definitions/getauthorized_scopesResponse'
        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:
        - authorized_scope
      summary: POST operation for authorized_scope
      operationId: post_authorized_scope
      description: POST operation for authorized_scope
      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: authorized_scope
          description: authorized_scope object
          schema:
              $ref: '#/definitions/addauthorized_scopeRequest'
      responses:
        200:
          description: add for authorized_scope
          schema: 
              $ref: '#/definitions/addauthorized_scopeResponse'
        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/authorized_scope/{id}:
    get:
      tags:
        - authorized_scope
      summary: GET by key for authorized_scope
      operationId: getbykey_authorized_scope
      description: Use this operation to get system groups
      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 authorized_scope
          schema: 
              $ref: '#/definitions/getauthorized_scopeResponse'
        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:
        - authorized_scope
      summary: PUT for authorized_scope
      operationId: putbykey_authorized_scope
      description: Use this operation to modify system group
      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: authorized_scope
          description: authorized_scope object
          schema:
              $ref: '#/definitions/modifyauthorized_scopeRequest'
      responses:
        200:
          description: add for authorized_scope
          schema: 
              $ref: '#/definitions/modifyauthorized_scopeResponse'
        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'

    delete:
      tags:
        - authorized_scope
      summary: Delete for authorized_scope
      operationId: deletebykey_authorized_scope
      description: Use this operation to delete system group(s)
      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:
        204:
          description: add for authorized_scope
        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:
  addauthorized_scopeRequest:
    type: object
    required:
      - authorized_scope
    properties:
      authorized_scope:
        $ref: '#/definitions/authorized_scope_readwrite'
    title: addauthorized_scopeRequest
    example:
      authorized_scope:
        group_id: "string_value"
        managed_device_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        auth_application_list: [{        application_name: "string_value"
,        id: "string_value"
}]
        managed_device_id_array: ["string_value1","string_value2"]

  addauthorized_scopeResponse:
    type: object
    required:
      - authorized_scope
    properties:
      authorized_scope:
        $ref: '#/definitions/authorized_scope'
    title: addauthorized_scopeResponse
    example:
      authorized_scope:
        formation_device_id: "string_value"
        group_id: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        managed_device_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        auth_application_list: [{        application_name: "string_value"
,        authorized_scope_id: "string_value"
,        id: "string_value"
,        application_id: "string_value"
,        vserver_list: [{}]
}]
        managed_device_id_array: ["string_value1","string_value2"]

  getauthorized_scopeResponse:
    type: object
    required:
      - authorized_scope
    properties:
      authorized_scope:
        $ref: '#/definitions/authorized_scope'
    title: getauthorized_scopeResponse
    example:
      authorized_scope:
        formation_device_id: "string_value"
        group_id: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        managed_device_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        auth_application_list: [{        application_name: "string_value"
,        authorized_scope_id: "string_value"
,        id: "string_value"
,        application_id: "string_value"
,        vserver_list: [{}]
}]
        managed_device_id_array: ["string_value1","string_value2"]

  getauthorized_scopesResponse:
    type: object
    required:
      - authorized_scope
    properties:
      authorized_scope:
        type: array
        items:
          $ref: '#/definitions/authorized_scope'
    title: getauthorized_scopesResponse
    example:
      authorized_scope:
        formation_device_id: "string_value"
        group_id: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        managed_device_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        auth_application_list: [{        application_name: "string_value"
,        authorized_scope_id: "string_value"
,        id: "string_value"
,        application_id: "string_value"
,        vserver_list: [{}]
}]
        managed_device_id_array: ["string_value1","string_value2"]

  modifyauthorized_scopeRequest:
    type: object
    required:
      - authorized_scope
    properties:
      authorized_scope:
        $ref: '#/definitions/authorized_scope_readwrite'
    title: modifyauthorized_scopeRequest
    example:
      authorized_scope:
        group_id: "string_value"
        managed_device_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        auth_application_list: [{        application_name: "string_value"
,        id: "string_value"
}]
        managed_device_id_array: ["string_value1","string_value2"]

  modifyauthorized_scopeResponse:
    type: object
    required:
      - authorized_scope
    properties:
      authorized_scope:
        $ref: '#/definitions/authorized_scope'
    title: modifyauthorized_scopeResponse
    example:
      authorized_scope:
        formation_device_id: "string_value"
        group_id: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        managed_device_id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        auth_application_list: [{        application_name: "string_value"
,        authorized_scope_id: "string_value"
,        id: "string_value"
,        application_id: "string_value"
,        vserver_list: [{}]
}]
        managed_device_id_array: ["string_value1","string_value2"]

  authorized_scope_readwrite:
    type: object
    properties:
      group_id:
        description: "Id of the group"
        type: string
        format: string
      managed_device_id:
        description: "managed device id"
        type: string
        format: string
      auth_application_list:
        type: array
        items:
          $ref: '#/definitions/authorized_application_readwrite'
      managed_device_id_array:
        description: "Array for managed device"
        type: array
        items:
          type: string
          format: string

  authorized_scope:
    allOf:
      -
        properties:
          id:
            description: Auto generated ID.
            type: string
            format: string
      - $ref: '#/definitions/authorized_scope_readwrite'

  authorized_application_readwrite:
    type: object
    properties:
      application_name:
        description: "Application Name"
        type: string
        format: string

  authorized_application:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key.
            type: string
            format: uuid
          authorized_scope_id:
             description: "authorized_scope ID"
             type: string
             format: uuid
          application_id:
             description: "ID of the application"
             type: string
             format: uuid
      - $ref: '#/definitions/authorized_application_readwrite'

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