openapi: 3.0.1
info:
  title: CCM User Association Service
  description: |
    Cloud Core Management Services: User Association Service  

    APIs that support Access Token:
      - /v1/dataPartitions

    {% admonition type="info" name="" %}
      No whitelisting required.
    {% /admonition %}

    ```plain {% title="ClientID" %}
    45557176c015439999cd245461354e96
    ```    
  version: 1.0.0.0
  x-product-id: CCM-User-Association-Service
security:
  - bearer: []
    appkey: []
tags:
  - name: user-association-service
    description: Query user association information.
paths:
  /v1/dataPartitions:
    get:
      tags:
        - user-association-service
      summary: Retrieve all the data partitions to which the user has access.
      description: >
        - Retrieve all data partitions that the user has access to.

        - The user is identified through their user-principal, as indicated by
        the email claim in the JWT token within the authorization header.

        - The API caller is authenticated via the service principal, as
        indicated by the azp (Authorized Party) claim in the JWT token within
        the authorization header.

        - If your application must be scoped to specific billing accounts, the
        client ID needs the `ccm.user.read` (e.g., the controlPlaneAdmin role)
        permission. Please raise the request with the CSI team.

        - The API enforces a request rate limit of 10 requests per minute per
        caller.
      operationId: GetUserDataPartitions
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DataPartition'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleResponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleResponse'
      security:
        - bearer: []
          appkey: []
components:
  schemas:
    DataPartition:
      type: object
      properties:
        partitionId:
          type: string
          description: dataPartitionId is the CCM Auto-Generated ID for the Data Partition.
        slbPartitionId:
          type: string
          description: unique id representing the data partition registration in Delfi.
        partitionName:
          type: string
          description: name of the Data Partition.
        groupId:
          type: string
          x-omitempty: true
          description: >-
            user group id from which a user has been granted access to the Data
            Partition.
        departmentId:
          type: string
          x-omitempty: true
          description: >-
            departmentId from which a user has been granted access to the Data
            Partition.
        billingAccountId:
          type: string
          description: >-
            billing account Id in which user was granted access to the data
            partition via department/user group association.
        billingAccountName:
          type: string
          description: >-
            billing account name in which user was granted access to the data
            partition via department/user group association.
        isRegistered:
          type: boolean
          x-omitempty: false
          description: >-
            Whether a data partition has been registered in Delfi. Only
            registered data partitions are available for users to select while
            setting up user context.
        partitionAccountId:
          type: string
          description: >-
            billing account Id in which data partition was registered to Delfi.
            associated to.
        partitionAccountName:
          type: string
          description: >-
            billing account name in which data partition was registered to
            Delfi.
        endpointID:
          type: string
          description: >-
            A unique id issued for the endpoint(e.g. OSDU instance) registered
            in Delfi, where the data partition is hosted.
        endpointName:
          type: string
        instance:
          type: string
          description: >-
            URL of the endpoint (e.g. OSDU instance) registered in Delfi, where
            the data partition is hosted.
        repositoryKind:
          type: string
          description: >-
            Kind of the data endpoint(e.g. DES(Delfi Data Ecosystem), OSDU(OSDU
            Data Layer)) hosting the given data partition.
    SimpleResponse:
      type: object
      properties:
        message:
          type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: User Token from SLB Authenticator Service
    appkey:
      type: apiKey
      description: AppKey/ConsumerKey from your App on Developer Portal
      name: appkey
      in: header
x-google-endpoints:
  - name: user-association-service
servers:
  - url: https://api.delfi.slb.com/ccm/userAssociation
    description: US
  - url: https://eu-api.delfi.slb.com/ccm/userAssociation
    description: EU
