tree: 95b5e6547313dc8a703030a90724718c95b8c09e [path history] [tgz]
  1. .github/
  2. .openapi-generator/
  3. cli/
  4. docs/
  5. polaris/
  6. test/
  7. .gitignore
  8. .gitlab-ci.yml
  9. .openapi-generator-ignore
  10. .travis.yml
  11. git_push.sh
  12. pyproject.toml
  13. README.md
  14. setup.cfg
  15. setup.py
client/python/README.md

polaris.catalog

Defines the specification for the first version of the REST Catalog API. Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.0.1
  • Package version: 1.0.0
  • Generator version: 7.8.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import polaris.catalog

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import polaris.catalog

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:


import polaris.catalog from polaris.catalog.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://localhost # See configuration.py for a list of all supported configuration parameters. configuration = polaris.catalog.Configuration( host = "https://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. configuration.access_token = os.environ["ACCESS_TOKEN"] # Configure Bearer authorization: BearerAuth configuration = polaris.catalog.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with polaris.catalog.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = polaris.catalog.IcebergCatalogAPI(api_client) prefix = 'prefix_example' # str | An optional prefix in the path commit_transaction_request = polaris.catalog.CommitTransactionRequest() # CommitTransactionRequest | Commit updates to multiple tables in an atomic operation A commit for a single table consists of a table identifier with requirements and updates. Requirements are assertions that will be validated before attempting to make and commit changes. For example, `assert-ref-snapshot-id` will check that a named ref's snapshot ID has a certain value. Updates are changes to make to table metadata. For example, after asserting that the current main ref is at the expected snapshot, a commit may add a new child snapshot and set the ref to the new snapshot id. try: # Commit updates to multiple tables in an atomic operation api_instance.commit_transaction(prefix, commit_transaction_request) except ApiException as e: print("Exception when calling IcebergCatalogAPI->commit_transaction: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://localhost

ClassMethodHTTP requestDescription
IcebergCatalogAPIcommit_transactionPOST /v1/{prefix}/transactions/commitCommit updates to multiple tables in an atomic operation
IcebergCatalogAPIcreate_namespacePOST /v1/{prefix}/namespacesCreate a namespace
IcebergCatalogAPIcreate_tablePOST /v1/{prefix}/namespaces/{namespace}/tablesCreate a table in the given namespace
IcebergCatalogAPIcreate_viewPOST /v1/{prefix}/namespaces/{namespace}/viewsCreate a view in the given namespace
IcebergCatalogAPIdrop_namespaceDELETE /v1/{prefix}/namespaces/{namespace}Drop a namespace from the catalog. Namespace must be empty.
IcebergCatalogAPIdrop_tableDELETE /v1/{prefix}/namespaces/{namespace}/tables/{table}Drop a table from the catalog
IcebergCatalogAPIdrop_viewDELETE /v1/{prefix}/namespaces/{namespace}/views/{view}Drop a view from the catalog
IcebergCatalogAPIlist_namespacesGET /v1/{prefix}/namespacesList namespaces, optionally providing a parent namespace to list underneath
IcebergCatalogAPIlist_tablesGET /v1/{prefix}/namespaces/{namespace}/tablesList all table identifiers underneath a given namespace
IcebergCatalogAPIlist_viewsGET /v1/{prefix}/namespaces/{namespace}/viewsList all view identifiers underneath a given namespace
IcebergCatalogAPIload_namespace_metadataGET /v1/{prefix}/namespaces/{namespace}Load the metadata properties for a namespace
IcebergCatalogAPIload_tableGET /v1/{prefix}/namespaces/{namespace}/tables/{table}Load a table from the catalog
IcebergCatalogAPIload_viewGET /v1/{prefix}/namespaces/{namespace}/views/{view}Load a view from the catalog
IcebergCatalogAPInamespace_existsHEAD /v1/{prefix}/namespaces/{namespace}Check if a namespace exists
IcebergCatalogAPIregister_tablePOST /v1/{prefix}/namespaces/{namespace}/registerRegister a table in the given namespace using given metadata file location
IcebergCatalogAPIrename_tablePOST /v1/{prefix}/tables/renameRename a table from its current name to a new name
IcebergCatalogAPIrename_viewPOST /v1/{prefix}/views/renameRename a view from its current name to a new name
IcebergCatalogAPIreplace_viewPOST /v1/{prefix}/namespaces/{namespace}/views/{view}Replace a view
IcebergCatalogAPIreport_metricsPOST /v1/{prefix}/namespaces/{namespace}/tables/{table}/metricsSend a metrics report to this endpoint to be processed by the backend
IcebergCatalogAPIsend_notificationPOST /v1/{prefix}/namespaces/{namespace}/tables/{table}/notificationsSends a notification to the table
IcebergCatalogAPItable_existsHEAD /v1/{prefix}/namespaces/{namespace}/tables/{table}Check if a table exists
IcebergCatalogAPIupdate_propertiesPOST /v1/{prefix}/namespaces/{namespace}/propertiesSet or remove properties on a namespace
IcebergCatalogAPIupdate_tablePOST /v1/{prefix}/namespaces/{namespace}/tables/{table}Commit updates to a table
IcebergCatalogAPIview_existsHEAD /v1/{prefix}/namespaces/{namespace}/views/{view}Check if a view exists
IcebergConfigurationAPIget_configGET /v1/configList all catalog configuration settings
IcebergOAuth2APIget_tokenPOST /v1/oauth/tokensGet a token using an OAuth2 flow

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

OAuth2

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
  • catalog: Allows interacting with the Config and Catalog APIs

BearerAuth

  • Type: Bearer authentication

Author