swagger: '2.0'
info:
  description: Configuration for System User resource.
  version: 'v2'
  title: mpsuser
host: 'adm.cloud.com'
schemes:
 - https
# tags are used for organizing operations
tags:
  - name: mpsuser
    description: System User
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 system users
   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/mpsuser:
    get:
      tags:
        - mpsuser
      summary: GET all mpsuser
      operationId: getall_mpsuser
      description: Use this operation to get system users
      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 mpsuser 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 mpsuser 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 mpsuser resources.
          enum:
            - yes
      responses:
        200:
          description:  for mpsuser
          schema: 
              $ref: '#/definitions/getmpsusersResponse'
        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:
        - mpsuser
      summary: POST operation for mpsuser
      operationId: post_mpsuser
      description: POST operation for mpsuser
      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: mpsuser
          description: mpsuser object
          schema:
              $ref: '#/definitions/addmpsuserRequest'
      responses:
        200:
          description: add for mpsuser
          schema: 
              $ref: '#/definitions/addmpsuserResponse'
        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/mpsuser/{id}:
    get:
      tags:
        - mpsuser
      summary: GET by key for mpsuser
      operationId: getbykey_mpsuser
      description: Use this operation to get system users
      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 mpsuser
          schema: 
              $ref: '#/definitions/getmpsuserResponse'
        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:
        - mpsuser
      summary: PUT for mpsuser
      operationId: putbykey_mpsuser
      description: Use this operation to modify system user
      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: mpsuser
          description: mpsuser object
          schema:
              $ref: '#/definitions/modifympsuserRequest'
      responses:
        200:
          description: add for mpsuser
          schema: 
              $ref: '#/definitions/modifympsuserResponse'
        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:
        - mpsuser
      summary: Delete for mpsuser
      operationId: deletebykey_mpsuser
      description: Use this operation to delete system user(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 mpsuser
        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:
  addmpsuserRequest:
    type: object
    required:
      - mpsuser
    properties:
      mpsuser:
        $ref: '#/definitions/mpsuser_readwrite'
    title: addmpsuserRequest
    example:
      mpsuser:
        session_timeout: "15"
        name: "nsroot"
        session_timeout_unit: "Minutes"
        external_group_mapping_oid: "OID:/azuread/c05daa0a-99b9-4b41-8c5a-b8a4733462a9"
        external_authentication: "false"
        enable_session_timeout: "false"
        tenant_id: "7ed7946f-4af7-11e9-99d2-b6fe81a85d18"
        password: "password"
        unlock: "false"
        groups: "ARRAY(0x299106c)"

  addmpsuserResponse:
    type: object
    required:
      - mpsuser
    properties:
      mpsuser:
        $ref: '#/definitions/mpsuser'
    title: addmpsuserResponse
    example:
      mpsuser:
        is_default: "false"
        session_timeout: "15"
        permission: "string_value"
        name: "nsroot"
        session_timeout_unit: "Minutes"
        external_group_mapping_oid: "OID:/azuread/c05daa0a-99b9-4b41-8c5a-b8a4733462a9"
        external_authentication: "false"
        enable_session_timeout: "false"
        tenant_id: "7ed7946f-4af7-11e9-99d2-b6fe81a85d18"
        password: "password"
        one_way_password: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        one_way_pbkdf2_password: "string_value"
        tenant_name: "string_value"
        encrypted: "false"
        unlock: "false"
        issuperuser: "false"
        force_change_password: "false"
        groups: "ARRAY(0x299106c)"
        nsroot_user: "string_value"

  getmpsuserResponse:
    type: object
    required:
      - mpsuser
    properties:
      mpsuser:
        $ref: '#/definitions/mpsuser'
    title: getmpsuserResponse
    example:
      mpsuser:
        is_default: "false"
        session_timeout: "15"
        permission: "string_value"
        name: "nsroot"
        session_timeout_unit: "Minutes"
        external_group_mapping_oid: "OID:/azuread/c05daa0a-99b9-4b41-8c5a-b8a4733462a9"
        external_authentication: "false"
        enable_session_timeout: "false"
        tenant_id: "7ed7946f-4af7-11e9-99d2-b6fe81a85d18"
        password: "password"
        one_way_password: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        one_way_pbkdf2_password: "string_value"
        tenant_name: "string_value"
        encrypted: "false"
        unlock: "false"
        issuperuser: "false"
        force_change_password: "false"
        groups: "ARRAY(0x299106c)"
        nsroot_user: "string_value"

  getmpsusersResponse:
    type: object
    required:
      - mpsuser
    properties:
      mpsuser:
        type: array
        items:
          $ref: '#/definitions/mpsuser'
    title: getmpsusersResponse
    example:
      mpsuser:
        is_default: "false"
        session_timeout: "15"
        permission: "string_value"
        name: "nsroot"
        session_timeout_unit: "Minutes"
        external_group_mapping_oid: "OID:/azuread/c05daa0a-99b9-4b41-8c5a-b8a4733462a9"
        external_authentication: "false"
        enable_session_timeout: "false"
        tenant_id: "7ed7946f-4af7-11e9-99d2-b6fe81a85d18"
        password: "password"
        one_way_password: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        one_way_pbkdf2_password: "string_value"
        tenant_name: "string_value"
        encrypted: "false"
        unlock: "false"
        issuperuser: "false"
        force_change_password: "false"
        groups: "ARRAY(0x299106c)"
        nsroot_user: "string_value"

  modifympsuserRequest:
    type: object
    required:
      - mpsuser
    properties:
      mpsuser:
        $ref: '#/definitions/mpsuser_readwrite'
    title: modifympsuserRequest
    example:
      mpsuser:
        session_timeout: "15"
        name: "nsroot"
        session_timeout_unit: "Minutes"
        external_group_mapping_oid: "OID:/azuread/c05daa0a-99b9-4b41-8c5a-b8a4733462a9"
        external_authentication: "false"
        enable_session_timeout: "false"
        tenant_id: "7ed7946f-4af7-11e9-99d2-b6fe81a85d18"
        password: "password"
        unlock: "false"
        groups: "ARRAY(0x299106c)"

  modifympsuserResponse:
    type: object
    required:
      - mpsuser
    properties:
      mpsuser:
        $ref: '#/definitions/mpsuser'
    title: modifympsuserResponse
    example:
      mpsuser:
        is_default: "false"
        session_timeout: "15"
        permission: "string_value"
        name: "nsroot"
        session_timeout_unit: "Minutes"
        external_group_mapping_oid: "OID:/azuread/c05daa0a-99b9-4b41-8c5a-b8a4733462a9"
        external_authentication: "false"
        enable_session_timeout: "false"
        tenant_id: "7ed7946f-4af7-11e9-99d2-b6fe81a85d18"
        password: "password"
        one_way_password: "string_value"
        id: "c970e730-6bc5-44c2-a2bf-8dd1382ffb5f"
        one_way_pbkdf2_password: "string_value"
        tenant_name: "string_value"
        encrypted: "false"
        unlock: "false"
        issuperuser: "false"
        force_change_password: "false"
        groups: "ARRAY(0x299106c)"
        nsroot_user: "string_value"

  mpsuser_readwrite:
    type: object
    properties:
      session_timeout:
        description: "Session timeout for the user"
        type: integer
        format: int32
      name:
        description: "User Name"
        type: string
        format: string
        minLength: 1
        maxLength: 128
      session_timeout_unit:
        description: "Session timeout unit for the user"
        type: string
        format: string
      external_group_mapping_oid:
        description: "Mapping of user associated with External Group Id"
        type: string
        format: string
      external_authentication:
        description: "Enable external authentication"
        type: boolean
        format: boolean
      enable_session_timeout:
        description: "Enables session timeout for user"
        type: boolean
        format: boolean
      tenant_id:
        description: "Tenant Id of the system users"
        type: string
        format: uuid
        minLength: 1
        maxLength: 128
      password:
        description: "Password"
        type: string
        format: password
        minLength: 1
        maxLength: 128
      unlock:
        description: "A flag to unlock the user"
        type: boolean
        format: boolean
      groups:
        description: "Groups to which user belongs"
        type: array
        items:
          type: string
          format: string

  mpsuser:
    allOf:
      -
        properties:
          id:
            description: Id is system generated key for all the system users
            type: string
            format: uuid
      - $ref: '#/definitions/mpsuser_readwrite'

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