> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create or delete a datasource.



## OpenAPI

````yaml /api-specs/cloud/dmm.yaml put /model-monitor/v2/api/datasource
openapi: 3.0.3
info:
  title: Domino Model Monitor API
  description: The API for programmatic access to Domino Model Monitor.
  version: 1.0.1
servers: []
security: []
tags:
  - name: DatasetJob
    description: All Dataset Job related operations.
  - name: DataSource
    description: All data source related operations.
  - name: Model
    description: All Model related operations.
  - name: ModelTag
    description: Operations related to the management of model tags.
  - name: ModelDrift
    description: All Model drift related operations.
  - name: ModelQuality
    description: All Model quality related operations.
  - name: Workbench
    description: All Workbench related operations.
  - name: DefaultSettings
    description: Operations related to drift and model quality defaults setting in DMM.
  - name: UserSettings
    description: Operations related to configuring user related settings for DMM.
  - name: Notification
    description: >-
      Operations related to configuring notification channel config and alert
      recipients for the model.
  - name: Other
    description: Other miscellaneous operations.
  - name: Scheduler
    description: All scheduler related operations
paths:
  /model-monitor/v2/api/datasource:
    summary: Create or delete a datasource.
    put:
      tags:
        - DataSource
      summary: Create or delete a datasource.
      operationId: createDataSource
      requestBody:
        required: true
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/dataSourceRequest'
      responses:
        '200':
          description: Data source added/updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dataSourceResponse'
        '400':
          description: Bad request input data.
        '403':
          description: Forbidden. The endpoint enforces permissions.
        '405':
          description: Method not allowed.
        '500':
          description: Internal server error, check server logs.
      security:
        - DominoApiKeyAuth: []
        - DmmApiKeyAuth: []
        - cookieAuth: []
components:
  schemas:
    dataSourceRequest:
      oneOf:
        - $ref: '#/components/schemas/s3Request'
        - $ref: '#/components/schemas/genericS3Request'
        - $ref: '#/components/schemas/azureBlobRequest'
        - $ref: '#/components/schemas/azureDataLakeGen2Request'
        - $ref: '#/components/schemas/googleCloudStorageRequest'
        - $ref: '#/components/schemas/azureDataLakeGen1Request'
        - $ref: '#/components/schemas/hdfsRequest'
        - $ref: '#/components/schemas/snowflakeRequest'
      discriminator:
        propertyName: type
        mapping:
          s3:
            $ref: '#/components/schemas/s3Request'
          generic_s3:
            $ref: '#/components/schemas/genericS3Request'
          azure_blob:
            $ref: '#/components/schemas/azureBlobRequest'
          azure_data_lake_gen_2:
            $ref: '#/components/schemas/azureDataLakeGen2Request'
          google_cloud_storage:
            $ref: '#/components/schemas/googleCloudStorageRequest'
          azure_data_lake_gen_1:
            $ref: '#/components/schemas/azureDataLakeGen1Request'
          hdfs:
            $ref: '#/components/schemas/hdfsRequest'
          snowflake:
            $ref: '#/components/schemas/snowflakeRequest'
    dataSourceResponse:
      oneOf:
        - $ref: '#/components/schemas/s3Response'
        - $ref: '#/components/schemas/genericS3Response'
        - $ref: '#/components/schemas/azureBlobResponse'
        - $ref: '#/components/schemas/azureDataLakeGen2Response'
        - $ref: '#/components/schemas/googleCloudStorageResponse'
        - $ref: '#/components/schemas/azureDataLakeGen1Response'
        - $ref: '#/components/schemas/hdfsResponse'
        - $ref: '#/components/schemas/nfsResponse'
        - $ref: '#/components/schemas/snowflakeResponse'
      discriminator:
        propertyName: type
        mapping:
          s3:
            $ref: '#/components/schemas/s3Response'
          generic_s3:
            $ref: '#/components/schemas/genericS3Response'
          azure_blob:
            $ref: '#/components/schemas/azureBlobResponse'
          azure_data_lake_gen_2:
            $ref: '#/components/schemas/azureDataLakeGen2Response'
          google_cloud_storage:
            $ref: '#/components/schemas/googleCloudStorageResponse'
          azure_data_lake_gen_1:
            $ref: '#/components/schemas/azureDataLakeGen1Response'
          hdfs:
            $ref: '#/components/schemas/hdfsResponse'
          nfs:
            $ref: '#/components/schemas/nfsResponse'
          snowflake:
            $ref: '#/components/schemas/snowflakeResponse'
    s3Request:
      title: S3 Request
      description: S3 request object.
      allOf:
        - $ref: '#/components/schemas/dataSourceRequestCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              description: S3 Configuration options.
              required:
                - bucket
                - region
                - instance_role
              properties:
                bucket:
                  description: Name of the S3 bucket.
                  type: string
                region:
                  description: Region for the S3 bucket.
                  type: string
                instance_role:
                  description: Whether to use the attached instance Role to fetch secrets.
                  type: boolean
                access_key:
                  description: Access key used to access the bucket.
                  type: string
                secret_key:
                  description: Secret key used to access the bucket.
                  type: string
    genericS3Request:
      title: Generic S3 Request
      description: Generic S3 request object.
      allOf:
        - $ref: '#/components/schemas/dataSourceRequestCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              description: Generic S3 Configuration options.
              required:
                - bucket
                - endpoint
                - access_key
                - secret_key
              properties:
                bucket:
                  description: Generic S3 bucket name.
                  type: string
                endpoint:
                  description: Generic S3 endpoint.
                  type: string
                access_key:
                  description: Access key used to access the bucket.
                  type: string
                secret_key:
                  description: Secret key used to access the bucket.
                  type: string
    azureBlobRequest:
      title: Azure Blob Request
      description: Azure Blob Request object.
      allOf:
        - $ref: '#/components/schemas/dataSourceRequestCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              description: >-
                Azure Blob Configuration options. (Either Access Key or SAS
                Token must be specified.)
              required:
                - account
                - container
              properties:
                account:
                  description: Name of the Storage Account.
                  type: string
                container:
                  description: Name of the Container.
                  type: string
                access_key:
                  description: Access Key used to access Azure Blob.
                  type: string
                sas_token:
                  description: SAS Token used to access Azure Blob.
                  type: string
    azureDataLakeGen2Request:
      title: Azure Data Lake Gen 2 Request
      description: Azure Data Lake Gen 2 Request object.
      allOf:
        - $ref: '#/components/schemas/dataSourceRequestCommon'
        - type: object
          required:
            - config
          properties:
            config:
              $ref: '#/components/schemas/adls2ConfigRequest'
    googleCloudStorageRequest:
      title: Google Cloud Storage Request
      description: Google Cloud Storage Request object.
      allOf:
        - $ref: '#/components/schemas/dataSourceRequestCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              description: Google Cloud Storage Configuration options.
              required:
                - bucket
                - json_key
              properties:
                bucket:
                  description: Name of the Bucket.
                  type: string
                json_key:
                  description: JSON Key for authentication.
                  type: string
    azureDataLakeGen1Request:
      title: Azure Data Lake Gen 1 Request
      description: Azure Data Lake Gen 1 Request object.
      allOf:
        - $ref: '#/components/schemas/dataSourceRequestCommon'
        - type: object
          required:
            - config
          properties:
            config:
              $ref: '#/components/schemas/adls1ConfigRequest'
    hdfsRequest:
      title: HDFS Data source Request
      description: HDFS Data source Request object.
      allOf:
        - $ref: '#/components/schemas/dataSourceRequestCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              required:
                - host
              properties:
                host:
                  type: string
                  description: Host for the HDFS cluster
                port:
                  type: integer
                  description: Port for the HDFS cluster
                  nullable: true
    snowflakeRequest:
      title: Snowflake Request
      description: Snowflake request object.
      allOf:
        - $ref: '#/components/schemas/dataSourceRequestCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              description: Snowflake Configuration options.
              required:
                - url
                - database
                - schema
                - warehouse
                - role
              properties:
                url:
                  description: Snowflake url
                  type: string
                user:
                  description: Username to use
                  type: string
                password:
                  description: Password for given username
                  type: string
                database:
                  description: Snowflake database to use
                  type: string
                schema:
                  description: Snowflake schema
                  type: string
                warehouse:
                  description: Snowflake warehouse
                  type: string
                role:
                  description: Snowflake role
                  type: string
    s3Response:
      title: S3 Response
      description: S3 response object.
      allOf:
        - $ref: '#/components/schemas/dataSourceResponseCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              description: S3 Configuration options.
              required:
                - bucket
                - region
                - instance_role
              properties:
                bucket:
                  description: Name of the S3 bucket.
                  type: string
                region:
                  description: Region for the S3 bucket.
                  type: string
                instance_role:
                  description: Whether to use the attached instance Role to fetch secrets.
                  type: boolean
    genericS3Response:
      title: Generic S3 Response
      description: Generic S3 response object.
      allOf:
        - $ref: '#/components/schemas/dataSourceResponseCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              description: Generic S3 Configuration options.
              required:
                - bucket
                - endpoint
              properties:
                bucket:
                  description: Generic S3 bucket name.
                  type: string
                endpoint:
                  description: Generic S3 endpoint.
                  type: string
    azureBlobResponse:
      title: Azure Blob Response
      description: Azure Blob response object.
      allOf:
        - $ref: '#/components/schemas/dataSourceResponseCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              description: Azure Blob Configuration options.
              required:
                - account
                - container
              properties:
                account:
                  description: Name of the Storage Account.
                  type: string
                container:
                  description: Name of the Container.
                  type: string
    azureDataLakeGen2Response:
      title: Azure Data Lake Gen 2 Response
      description: Azure Data Lake Gen 2 response object.
      allOf:
        - $ref: '#/components/schemas/dataSourceResponseCommon'
        - type: object
          required:
            - config
          properties:
            config:
              $ref: '#/components/schemas/adls2ConfigResponse'
    googleCloudStorageResponse:
      title: Google Cloud Storage Response
      description: Google Cloud Storage response object.
      allOf:
        - $ref: '#/components/schemas/dataSourceResponseCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              description: Google Cloud Storage Configuration options.
              required:
                - bucket
              properties:
                bucket:
                  description: Name of the Bucket.
                  type: string
    azureDataLakeGen1Response:
      title: Azure Data Lake Gen 1 Response
      description: Azure Data Lake Gen 1 response object.
      allOf:
        - $ref: '#/components/schemas/dataSourceResponseCommon'
        - type: object
          required:
            - config
          properties:
            config:
              $ref: '#/components/schemas/adls1ConfigResponse'
    hdfsResponse:
      title: HDFS Data source Response
      description: HDFS Data source response object.
      allOf:
        - $ref: '#/components/schemas/dataSourceResponseCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              required:
                - host
              properties:
                host:
                  type: string
                  description: Host for the HDFS cluster
                port:
                  type: integer
                  description: Port for the HDFS cluster
                  nullable: true
    nfsResponse:
      title: NFS Data source Response
      description: NFS Data source response object.
      allOf:
        - $ref: '#/components/schemas/dataSourceResponseCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              required:
                - path
              properties:
                path:
                  type: string
                  description: Path to access the NFS
    snowflakeResponse:
      title: Snowflake Response
      description: Snowflake response object.
      allOf:
        - $ref: '#/components/schemas/dataSourceResponseCommon'
        - type: object
          required:
            - config
          properties:
            config:
              type: object
              description: Snowflake Configuration options.
              required:
                - url
                - database
                - schema
                - warehouse
                - role
              properties:
                url:
                  description: Snowflake url
                  type: string
                database:
                  description: Snowflake database to use
                  type: string
                schema:
                  description: Snowflake schema
                  type: string
                warehouse:
                  description: Snowflake warehouse
                  type: string
                role:
                  description: Snowflake role
                  type: string
    dataSourceRequestCommon:
      title: Data Source
      description: Data source object payload.
      type: object
      required:
        - name
        - type
      properties:
        name:
          description: Name of the data source.
          type: string
        type:
          description: Type of data source.
          type: string
    adls2ConfigRequest:
      oneOf:
        - $ref: '#/components/schemas/adls2SharedKeyConfigRequest'
        - $ref: '#/components/schemas/adls2ClientCredentialsConfigRequest'
        - $ref: '#/components/schemas/adls2UsernamePasswordConfigRequest'
        - $ref: '#/components/schemas/adls2RefreshTokenConfigRequest'
        - $ref: '#/components/schemas/adls2ManagedIdentityConfigRequest'
      discriminator:
        propertyName: auth
        mapping:
          shared_key:
            $ref: '#/components/schemas/adls2SharedKeyConfigRequest'
          client_credentials:
            $ref: '#/components/schemas/adls2ClientCredentialsConfigRequest'
          username_password:
            $ref: '#/components/schemas/adls2UsernamePasswordConfigRequest'
          refresh_token:
            $ref: '#/components/schemas/adls2RefreshTokenConfigRequest'
          managed_identity:
            $ref: '#/components/schemas/adls2ManagedIdentityConfigRequest'
    adls1ConfigRequest:
      oneOf:
        - $ref: '#/components/schemas/adls1ClientCredentialsConfigRequest'
        - $ref: '#/components/schemas/adls1ManagedIdentityConfigRequest'
      discriminator:
        propertyName: auth
        mapping:
          client_credentials:
            $ref: '#/components/schemas/adls1ClientCredentialsConfigRequest'
          managed_identity:
            $ref: '#/components/schemas/adls1ManagedIdentityConfigRequest'
    dataSourceResponseCommon:
      title: Data Source
      description: Datasource response object.
      type: object
      required:
        - id
        - name
        - type
        - user_id
        - created_at
        - updated_at
      properties:
        id:
          description: ID of the data source object.
          type: string
        name:
          description: Name of the data source.
          type: string
        type:
          description: Type of data source.
          type: string
        user_id:
          description: ID of the user who created the data source.
          type: string
        username:
          type: string
          description: User who has created the data source.
        created_at:
          description: Created time of the data source.
          type: number
        updated_at:
          description: Last updated time of the data source.
          type: number
    adls2ConfigResponse:
      oneOf:
        - $ref: '#/components/schemas/adls2SharedKeyConfigResponse'
        - $ref: '#/components/schemas/adls2OAuth2ConfigResponse'
      discriminator:
        propertyName: auth
        mapping:
          shared_key:
            $ref: '#/components/schemas/adls2SharedKeyConfigResponse'
          client_credentials:
            $ref: '#/components/schemas/adls2OAuth2ConfigResponse'
          username_password:
            $ref: '#/components/schemas/adls2OAuth2ConfigResponse'
          refresh_token:
            $ref: '#/components/schemas/adls2OAuth2ConfigResponse'
          managed_identity:
            $ref: '#/components/schemas/adls2OAuth2ConfigResponse'
    adls1ConfigResponse:
      oneOf:
        - $ref: '#/components/schemas/adls1ClientCredentialsConfigResponse'
        - $ref: '#/components/schemas/adls1ManagedIdentityConfigResponse'
      discriminator:
        propertyName: auth
        mapping:
          client_credentials:
            $ref: '#/components/schemas/adls1ClientCredentialsConfigResponse'
          managed_identity:
            $ref: '#/components/schemas/adls1ManagedIdentityConfigResponse'
    adls2SharedKeyConfigRequest:
      title: Azure Data Lake Gen 2 Shared Key Config Request
      description: Azure Data Lake Gen 2 Shared Key Config Request Object.
      allOf:
        - $ref: '#/components/schemas/adls2CommonConfigRequest'
        - type: object
          required:
            - shared_key
          properties:
            shared_key:
              type: string
              description: Shared Key to be used for authentication.
    adls2ClientCredentialsConfigRequest:
      title: Azure Data Lake Gen 2 Client Credentials Config Request
      description: Azure Data Lake Gen 2 Client Credentials Config Request Object.
      allOf:
        - $ref: '#/components/schemas/adls2CommonConfigRequest'
        - type: object
          required:
            - o_auth2_config
          properties:
            o_auth2_config:
              type: object
              description: OAuth 2 config object.
              required:
                - endpoint
                - client_id
                - client_secret
              properties:
                endpoint:
                  type: string
                  description: Endpoint to be used for authentication.
                client_id:
                  type: string
                  description: Client ID to be used for authentication.
                client_secret:
                  type: string
                  description: Client Secret to be used for authentication.
    adls2UsernamePasswordConfigRequest:
      title: Azure Data Lake Gen 2 Username Password Config Request
      description: Azure Data Lake Gen 2 Username Password Config Request Object.
      allOf:
        - $ref: '#/components/schemas/adls2CommonConfigRequest'
        - type: object
          required:
            - o_auth2_config
          properties:
            o_auth2_config:
              type: object
              description: OAuth 2 config object.
              required:
                - endpoint
                - username
                - password
              properties:
                endpoint:
                  type: string
                  description: Endpoint to be used for authentication.
                username:
                  type: string
                  description: Username to be used for authentication.
                password:
                  type: string
                  description: Password to be used for authentication.
    adls2RefreshTokenConfigRequest:
      title: Azure Data Lake Gen 2 Refresh Token Config Request
      description: Azure Data Lake Gen 2 Refresh Token Config Request Object.
      allOf:
        - $ref: '#/components/schemas/adls2CommonConfigRequest'
        - type: object
          required:
            - o_auth2_config
          properties:
            o_auth2_config:
              type: object
              description: OAuth 2 config object.
              required:
                - refresh_token
              properties:
                refresh_token:
                  type: string
                  description: Refresh Token to be used for authentication.
                client_id:
                  type: string
                  description: Optional Client ID to be used for authentication.
    adls2ManagedIdentityConfigRequest:
      title: Azure Data Lake Gen 2 Managed Identity Config Request
      description: Azure Data Lake Gen 2 Managed Identity Config Request Object.
      allOf:
        - $ref: '#/components/schemas/adls2CommonConfigRequest'
        - type: object
          properties:
            o_auth2_config:
              type: object
              description: OAuth 2 config object.
              properties:
                tenant_id:
                  type: string
                  description: Optional Tenant ID to be used for authentication.
                client_id:
                  type: string
                  description: Optional Client ID to be used for authentication.
    adls1ClientCredentialsConfigRequest:
      title: Azure Data Lake Gen 1 Client Credentials Config Request
      description: Azure Data Lake Gen 1 Client Credentials Config Request Object.
      allOf:
        - $ref: '#/components/schemas/adls1CommonConfigRequest'
        - type: object
          required:
            - token_endpoint
            - application_id
            - secret_key
          properties:
            token_endpoint:
              type: string
              description: Endpoint to be used for authentication.
            application_id:
              type: string
              description: Application ID to be used for authentication.
            secret_key:
              type: string
              description: Secret Key to be used for authentication.
    adls1ManagedIdentityConfigRequest:
      title: Azure Data Lake Gen 1 Managed Identity Config Request
      description: Azure Data Lake Gen 1 Managed Identity Config Request Object.
      allOf:
        - $ref: '#/components/schemas/adls1CommonConfigRequest'
        - type: object
          required:
            - port
          properties:
            port:
              type: integer
              description: Optional Port to be used for authentication.
              nullable: true
    adls2SharedKeyConfigResponse:
      title: Azure Data Lake Gen 2 Shared Key Config Response
      description: Azure Data Lake Gen 2 Shared Key Config Response Object.
      allOf:
        - $ref: '#/components/schemas/adls2CommonConfigResponse'
        - type: object
    adls2OAuth2ConfigResponse:
      title: Azure Data Lake Gen 2 OAuth2 Config Response
      description: Azure Data Lake Gen 2 OAuth2 Config Response Object.
      allOf:
        - $ref: '#/components/schemas/adls2CommonConfigResponse'
        - type: object
          properties:
            o_auth2_config:
              type: object
              description: OAuth 2 config object.
    adls1ClientCredentialsConfigResponse:
      title: Azure Data Lake Gen 1 Client Credentials Config Response
      description: Azure Data Lake Gen 1 Client Credentials Config Response Object.
      allOf:
        - $ref: '#/components/schemas/adls1CommonConfigResponse'
        - type: object
          properties:
            token_endpoint:
              type: string
              description: Endpoint to be used for authentication.
              nullable: true
            application_id:
              type: string
              description: Application ID to be used for authentication.
              nullable: true
            secret_key:
              type: string
              description: Secret Key to be used for authentication.
              nullable: true
    adls1ManagedIdentityConfigResponse:
      title: Azure Data Lake Gen 1 Managed Identity Config Response
      description: Azure Data Lake Gen 1 Managed Identity Config Response Object.
      allOf:
        - $ref: '#/components/schemas/adls1CommonConfigResponse'
        - type: object
          properties:
            port:
              type: integer
              description: Port to be used for authentication.
              nullable: true
    adls2CommonConfigRequest:
      title: Azure Data Lake Gen 2 Common Config Request
      description: Azure Data Lake Gen 2 Common Config Request Object.
      type: object
      required:
        - container
        - account
        - auth
      properties:
        container:
          type: string
          description: Azure Storage container.
        account:
          type: string
          description: Azure Storage Account.
        auth:
          type: string
          description: Azure Storage Auth Type.
    adls1CommonConfigRequest:
      title: Azure Data Lake Gen 1 Common Config Request
      description: Azure Data Lake Gen 1 Common Config Request Object.
      type: object
      required:
        - container
        - auth
      properties:
        container:
          type: string
          description: Azure Storage container.
        auth:
          type: string
          description: Azure Storage Auth Type.
    adls2CommonConfigResponse:
      title: Azure Data Lake Gen 2 Common Config Response
      description: Azure Data Lake Gen 2 Common Config Response Object.
      type: object
      required:
        - container
        - account
        - auth
      properties:
        container:
          type: string
          description: Azure Storage container.
        account:
          type: string
          description: Azure Storage Account.
        auth:
          type: string
          description: Azure Storage Auth Type.
    adls1CommonConfigResponse:
      title: Azure Data Lake Gen 1 Common Config Response
      description: Azure Data Lake Gen 1 Common Config Response Object.
      type: object
      required:
        - container
        - auth
      properties:
        container:
          type: string
          description: Azure Storage container.
        auth:
          type: string
          description: Azure Storage Auth Type.
  securitySchemes:
    DominoApiKeyAuth:
      type: apiKey
      in: header
      name: X-Domino-Api-Key
    DmmApiKeyAuth:
      type: apiKey
      in: header
      name: X-DMM-API-KEY
    cookieAuth:
      type: apiKey
      in: cookie
      name: PLAY_SESSION

````