Skip to content

REST Catalog

IcebergRESTCatalog

Bases: IcebergCatalog, FrozenModel

Iceberg REST Catalog.

.. versionadded:: 0.15.0

Parameters:

  • url (str) –

    REST catalog server URL

  • headers (dict[str, str]) –

    Additional HTTP headers to include in requests

  • extra (dict[str, str]) –

    Additional configuration parameters

  • auth (IcebergRESTCatalogAuth) –

    Authentication configuration

Examples:

.. tabs::

.. code-tab:: python REST catalog with basic authentication

    from onetl.connection import Iceberg

    catalog = Iceberg.RESTCatalog(
        url="https://rest.domain.com:8080",
        auth=Iceberg.RESTCatalog.BasicAuth(
            user="my_user",
            password="my_password",
        ),
    )

.. code-tab:: python REST catalog with bearer token

    from onetl.connection import Iceberg

    catalog = Iceberg.RESTCatalog(
        url="https://rest.domain.com:8080",
        auth=Iceberg.RESTCatalog.BearerAuth(
            access_token="my_bearer_token",
        ),
    )

.. code-tab:: python REST catalog with OAuth2 Client Credentials Flow

    from onetl.connection import Iceberg

    catalog = Iceberg.RESTCatalog(
        url="https://rest.domain.com:8080",
        auth=Iceberg.RESTCatalog.OAuth2ClientCredentials(
            client_id="my_client_id",
            client_secret="my_client_secret",
        ),
    )

.. code-tab:: python REST catalog with custom auth

    from onetl.connection import Iceberg

    catalog = Iceberg.RESTCatalog(
        url="https://rest.domain.com:8080",
        headers={
            "X-Custom-Auth": "my_custom_token",
            "X-Request-ID": "request-123",
        },
        extra={
            "timeout": "30s",
            "retry": "3",
        },
    )

    """
    These options will be passed to Spark config:
    spark.sql.my_catalog.uri = "https://rest.domain.com:8080"
    spark.sql.my_catalog.header.X-Custom-Auth = "my_custom_token"
    spark.sql.my_catalog.header.X-Request-ID = "request-123"
    spark.sql.my_catalog.timeout = "30s"
    spark.sql.my_catalog.retry = "3"
    """

get_config()

Return flat dict with catalog configuration.

Authentication