openapi: 3.1.0
info:
  title: HPE GreenLake for Workspace Management API
  description: >-
    With the HPE GreenLake for Workspace Management APIs you can view workspace
    information and create, update, or delete managed service provider tenants.
  version: 1.0.0
  license:
    name: HPE License
    url: https://www.hpe.com/us/en/software/licensing.html
servers:
  - url: https://global.api.greenlake.hpe.com
security:
  - BearerAuth: []
tags:
  - name: NB-Api-Workspaces
    description: 'Workspace management operations for HPE GreenLake. '
    x-displayName: Workspace Management
paths:
  /workspaces/v1/workspaces/{workspaceId}:
    get:
      tags:
        - NB-Api-Workspaces
      summary: Get workspace information
      description: >-
        Retrieve basic workspace information for a provided workspace
        identifier.
      operationId: get_workspace_workspaces_v1_workspaces__workspaceId__get
      parameters:
        - description: The unique identifier of the workspace.
          required: true
          schema:
            title: Workspace ID
            type: string
            description: The unique identifier of the workspace.
            format: uuid
          example: 7600415a-8876-5722-9f3c-b0fd11112283
          name: workspaceId
          in: path
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NBBasicWorkspace'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
      security:
        - BearerAuth: []
  /workspaces/v1/workspaces/{workspaceId}/contact:
    get:
      tags:
        - NB-Api-Workspaces
      summary: Get detailed workspace information
      description: Retrieve detailed workspace information.
      operationId: >-
        get_workspace_detailed_info_workspaces_v1_workspaces__workspaceId__contact_get
      parameters:
        - description: The unique identifier of the workspace.
          required: true
          schema:
            title: Workspace ID
            type: string
            description: The unique identifier of the workspace.
            format: uuid
          example: 7600415a-8876-5722-9f3c-b0fd11112283
          name: workspaceId
          in: path
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NBContactWorkspace'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
      security:
        - BearerAuth: []
  /workspaces/v1/msp-tenants:
    get:
      tags:
        - NB-Api-Workspaces
      summary: Get list of MSP Tenants
      description: Retrieve a list of managed service provider (MSP) tenants.
      operationId: get_tenants_workspaces_v1_msp_tenants_get
      parameters:
        - description: >-
            Filter data using a subset of OData 4.0 and return only the subset
            of resources that match the filter.


            Get list of MSP Tenants API can be filtered by:

            - id

            - createdAt

            - updatedAt

            - workspaceName

            - createdBy

            - inventoryOwnership
          required: false
          schema:
            title: Filter
            type: string
            description: >-
              Filter data using a subset of OData 4.0 and return only the subset
              of resources that match the filter.


              Get list of MSP Tenants API can be filtered by:

              - id

              - createdAt

              - updatedAt

              - workspaceName

              - createdBy

              - inventoryOwnership
            default: ''
          examples:
            FilterWithId:
              summary: Filter with id
              description: Returns a tenant with a specific ID.
              value: id eq '7600415a-8876-5722-9f3c-b0fd11112283'
            FilterWithCreatedAt:
              summary: Filter with createdAt
              description: Returns tenants created after 2020-09-21T14:19:09.769747
              value: createdAt gt '2020-09-21T14:19:09.769747'
            FilterWithUpdatedAt:
              summary: Filter with updatedAt
              description: Returns tenants updated after 2020-09-21T14:19:09.769747
              value: updatedAt gt '2020-09-21T14:19:09.769747'
            FilterWithWorkspaceName:
              summary: Filter with workspaceName
              description: Returns the tenant with the specified workspace name.
              value: workspaceName eq 'workspace example'
            FilterWithCreatedBy:
              summary: Filter with createdBy
              description: Returns the tenants created by the specified user
              value: createdBy eq 'user@example.com'
            FilterWithInventoryOwnership:
              summary: Filter with inventoryOwnership
              description: Returns the tenants with the specified inventoryOwnership
              value: inventoryOwnership eq 'MSP_OWNED_INVENTORY'
          name: filter
          in: query
        - description: >-
            Specify pagination offset. An offset argument defines how many pages
            to skip before returning results.
          required: false
          schema:
            title: Pagination offset
            minimum: 0
            type: integer
            description: >-
              Specify pagination offset. An offset argument defines how many
              pages to skip before returning results.
            default: 0
          name: offset
          in: query
        - description: >-
            Specify the maximum number of entries per page. NOTE: The maximum
            value accepted is 300.
          required: false
          schema:
            title: Pagination limit
            maximum: 300
            minimum: 1
            type: integer
            description: >-
              Specify the maximum number of entries per page. NOTE: The maximum
              value accepted is 300.
            default: 300
          name: limit
          in: query
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NBTenantWorkspacePaginate'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
      security:
        - BearerAuth: []
    post:
      tags:
        - NB-Api-Workspaces
      summary: Create MSP customer workspace
      description: Create an MSP customer workspace.
      operationId: create_tenant_workspaces_v1_msp_tenants_post
      requestBody:
        content:
          application/json:
            schema:
              title: Tenant details
              allOf:
                - $ref: '#/components/schemas/NBContactTenant'
              description: Details of the tenant to be created
        required: true
      responses:
        '201':
          description: Successful Response
          headers:
            Location:
              schema:
                title: Location
                type: string
                description: Endpoint to get the invited user resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '451':
          description: Unavailable For Legal Reasons
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
      security:
        - BearerAuth: []
  /workspaces/v1/msp-tenants/{tenantId}:
    put:
      tags:
        - NB-Api-Workspaces
      summary: Update managed service tenant
      description: >-
        Update an existing tenant in the currently logged in managed service
        provider (MSP) workspace.
      operationId: update_tenant_api_workspaces_v1_msp_tenants__tenantId__put
      parameters:
        - description: The unique ID of the tenant.
          required: true
          schema:
            title: Tenant ID
            type: string
            description: The unique ID of the tenant.
            format: uuid
          name: tenantId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              title: Tenant details
              allOf:
                - $ref: '#/components/schemas/NBContactTenant'
              description: Details of the tenant to be updated
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '451':
          description: Unavailable For Legal Reasons
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
      security:
        - BearerAuth: []
    delete:
      tags:
        - NB-Api-Workspaces
      summary: Delete a managed service tenant
      description: >-
        Delete a tenant in the currently logged in managed service provider's
        (MSP) workspace.
      operationId: remove_tenant_workspaces_v1_msp_tenants__tenantId__delete
      parameters:
        - description: The workspace ID for the tenant you want to delete.
          required: true
          schema:
            title: Tenant ID
            type: string
            description: The workspace ID for the tenant you want to delete.
            format: uuid
          name: tenantId
          in: path
      responses:
        '204':
          description: Successful Response
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    CountryCode:
      title: CountryCode
      enum:
        - AW
        - AF
        - AO
        - AI
        - AX
        - AL
        - AD
        - AE
        - AR
        - AM
        - AS
        - AQ
        - TF
        - AG
        - AU
        - AT
        - AZ
        - BI
        - BE
        - BJ
        - BQ
        - BF
        - BD
        - BG
        - BH
        - BS
        - BA
        - BL
        - BY
        - BZ
        - BM
        - BO
        - BR
        - BB
        - BN
        - BT
        - BV
        - BW
        - CF
        - CA
        - CC
        - CH
        - CL
        - CN
        - CI
        - CM
        - CD
        - CG
        - CK
        - CO
        - KM
        - CV
        - CR
        - CU
        - CW
        - CX
        - KY
        - CY
        - CZ
        - DE
        - DJ
        - DM
        - DK
        - DO
        - DZ
        - EC
        - EG
        - ER
        - EH
        - ES
        - EE
        - ET
        - FI
        - FJ
        - FK
        - FR
        - FO
        - FM
        - GA
        - GB
        - GE
        - GG
        - GH
        - GI
        - GN
        - GP
        - GM
        - GW
        - GQ
        - GR
        - GD
        - GL
        - GT
        - GF
        - GU
        - GY
        - HK
        - HM
        - HN
        - HR
        - HT
        - HU
        - ID
        - IM
        - IN
        - IO
        - IE
        - IR
        - IQ
        - IS
        - IL
        - IT
        - JM
        - JE
        - JO
        - JP
        - KZ
        - KE
        - KG
        - KH
        - KI
        - KN
        - KR
        - KW
        - LA
        - LB
        - LR
        - LY
        - LC
        - LI
        - LK
        - LS
        - LT
        - LU
        - LV
        - MO
        - MF
        - MA
        - MC
        - MD
        - MG
        - MV
        - MX
        - MH
        - MK
        - ML
        - MT
        - MM
        - ME
        - MN
        - MP
        - MZ
        - MR
        - MS
        - MQ
        - MU
        - MW
        - MY
        - YT
        - NA
        - NC
        - NE
        - NF
        - NG
        - NI
        - NU
        - NL
        - 'NO'
        - NP
        - NR
        - NZ
        - OM
        - PK
        - PA
        - PN
        - PE
        - PH
        - PW
        - PG
        - PL
        - PR
        - KP
        - PT
        - PY
        - PS
        - PF
        - QA
        - RE
        - RO
        - RU
        - RW
        - SA
        - SD
        - SN
        - SG
        - GS
        - SH
        - SJ
        - SB
        - SL
        - SV
        - SM
        - SO
        - PM
        - RS
        - SS
        - ST
        - SR
        - SK
        - SI
        - SE
        - SZ
        - SX
        - SC
        - SY
        - TC
        - TD
        - TG
        - TH
        - TJ
        - TK
        - TM
        - TL
        - TO
        - TT
        - TN
        - TR
        - TV
        - TW
        - TZ
        - UG
        - UA
        - UM
        - UY
        - US
        - UZ
        - VA
        - VC
        - VE
        - VG
        - VI
        - VN
        - VU
        - WF
        - WS
        - YE
        - ZA
        - ZM
        - ZW
      description: An enumeration.
    Message:
      title: Message
      required:
        - message
      type: object
      properties:
        message:
          title: Message
          type: string
          description: Message
    NBBasicTenant:
      title: NBBasicTenant
      required:
        - id
        - type
        - workspaceName
      type: object
      properties:
        id:
          title: Resource unique ID
          type: string
          description: Resource unique identification
          format: uuid
        type:
          title: Type of data
          type: string
          description: Type of data
        generation:
          title: Generation
          type: integer
          description: Resource history of updates
          default: 0
        createdAt:
          title: Resource created time
          type: string
          description: The time the resource was created.
          format: date-time
        updatedAt:
          title: Resource update time
          type: string
          description: The time the resource was last updated.
          format: date-time
        workspaceName:
          title: Company name
          type: string
          description: Company name of the workspace.
        createdBy:
          title: User email
          type: string
          description: Email address of the user that created the account.
          format: email
        resourceUri:
          title: Resource Uri
          type: string
          description: Full path of the resource
        inventoryOwnership:
          title: Devices and Subscriptions Ownership
          allOf:
            - $ref: '#/components/schemas/NBTenantInventoryOwnership'
          description: Devices and Subscriptions Ownership for this tenant.
    NBBasicWorkspace:
      title: NBBasicWorkspace
      required:
        - id
        - type
        - workspaceName
      type: object
      properties:
        id:
          title: Resource unique ID
          type: string
          description: Resource unique identification
          format: uuid
        type:
          title: Type of data
          type: string
          description: Type of data
        generation:
          title: Generation
          type: integer
          description: Resource history of updates
          default: 0
        createdAt:
          title: Resource created time
          type: string
          description: The time the resource was created.
          format: date-time
        updatedAt:
          title: Resource update time
          type: string
          description: The time the resource was last updated.
          format: date-time
        workspaceName:
          title: Company name
          type: string
          description: Company name of the workspace.
        createdBy:
          title: User email
          type: string
          description: Email address of the user that created the account.
          format: email
        resourceUri:
          title: Resource Uri
          type: string
          description: Full path of the resource
    NBCcsAddress:
      title: NBCcsAddress
      type: object
      properties:
        streetAddress:
          title: Street Address
          type: string
          description: Street address
        streetAddressComplement:
          title: Apt or suite or building
          maxLength: 60
          type: string
          description: Apt or suite or building
        city:
          title: City
          maxLength: 40
          type: string
        stateOrRegion:
          title: State or Region
          maxLength: 220
          type: string
          description: State or region
        zip:
          title: Zip code
          maxLength: 10
          type: string
        countryCode:
          title: Country code
          type: string
          description: Country code
    NBCcsAddressV2:
      title: NBCcsAddressV2
      required:
        - countryCode
      type: object
      properties:
        streetAddress:
          title: Street Address
          type: string
          description: Street address
        streetAddressComplement:
          title: Apt or suite or building
          maxLength: 60
          type: string
          description: Apt or suite or building
        city:
          title: City
          maxLength: 40
          type: string
        stateOrRegion:
          title: State or Region
          maxLength: 220
          type: string
          description: State or region
        zip:
          title: Zip code
          maxLength: 10
          type: string
        countryCode:
          title: Country code
          allOf:
            - $ref: '#/components/schemas/CountryCode'
          description: Only country is mandatory.
    NBContactTenant:
      title: NBContactTenant
      required:
        - workspaceName
      type: object
      properties:
        address:
          title: Address
          allOf:
            - $ref: '#/components/schemas/NBCcsAddressV2'
          description: Company Address.
        phoneNumber:
          title: Phone number
          type: string
          description: The phone number associated with this workspace.
        email:
          title: Workspace Email
          type: string
          description: The primary email address associated with the workspace.
          format: email
        resourceUri:
          title: Resource Uri
          type: string
          description: Full path of the resource
        workspaceName:
          title: Tenant workspace Name
          type: string
          description: Name of the tenant.
        description:
          title: Tenant Description
          type: string
          description: A description of the tenant.
        inventoryOwnership:
          title: Devices and Subscriptions Ownership
          allOf:
            - $ref: '#/components/schemas/NBTenantInventoryOwnership'
          description: >-
            Devices and Subscriptions Ownership for this tenant. If not
            specified, the tenant is created with the default value of
            "MSP_OWNED_INVENTORY".
    NBContactWorkspace:
      title: NBContactWorkspace
      type: object
      properties:
        address:
          title: Address
          allOf:
            - $ref: '#/components/schemas/NBCcsAddress'
          description: Company address.
        phoneNumber:
          title: Phone number
          type: string
          description: The phone number associated with this workspace.
        email:
          title: Workspace Email
          type: string
          description: The primary email address associated with the workspace.
          format: email
        resourceUri:
          title: Resource Uri
          type: string
          description: Full path of the resource
    NBTenantInventoryOwnership:
      title: NBTenantInventoryOwnership
      enum:
        - MSP_OWNED_INVENTORY
        - CUSTOMER_OWNED_INVENTORY
      type: string
      description: An enumeration.
    NBTenantWorkspacePaginate:
      title: NBTenantWorkspacePaginate
      required:
        - offset
        - count
        - total
        - items
      type: object
      properties:
        offset:
          title: Offset
          type: integer
          description: Specifies the offset of the returned page
        count:
          title: Count
          type: integer
          description: The number of returned items
        total:
          title: Total
          type: integer
          description: The total number of items in the result set
        items:
          title: List of Workspaces
          type: array
          items:
            $ref: '#/components/schemas/NBBasicTenant'
          description: List of Workspaces
    StandardErrorResponse:
      title: StandardErrorResponse
      required:
        - debugId
        - httpStatusCode
        - errorCode
        - message
      type: object
      properties:
        debugId:
          title: Debugid
          type: string
          description: >-
            A unique identifier for this error used to help with
            troubleshooting.
        httpStatusCode:
          title: Httpstatuscode
          type: integer
          description: HTTP status code
        errorCode:
          title: Errorcode
          type: string
          description: HPE GreenLake standard error code
        message:
          title: Message
          type: string
          description: A user-friendly error message.
      description: Standard GreenLake error response model
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
