Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions librarian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ version: v0.19.0
repo: googleapis/google-cloud-python
sources:
googleapis:
commit: d8daa97972d091191898915589335cef66fcdc8a
sha256: 7dbdf2b1b667fe57128d41c77e530a2541767772cfe3487713f29b7b25d9f5ad
commit: f93e046328794785ad89869f00c0358dfcff2c35
sha256: 415249f584d57e5a2298c36ae9ff71563403112dee04ac961023a1b0098404d2
default:
output: packages
tag_format: '{name}-v{version}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,15 @@


class IcebergCatalogServiceAsyncClient:
"""Iceberg Catalog Service API: this implements the open-source Iceberg
REST Catalog API. See the API definition here:
https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml

The API is defined as OpenAPI 3.1.1 spec.

Currently we only support the following methods:

- GetConfig/GetIcebergCatalogConfig
- ListIcebergNamespaces
- CheckIcebergNamespaceExists
- GetIcebergNamespace
- CreateIcebergNamespace (only supports single level)
- DeleteIcebergNamespace
- UpdateIcebergNamespace properties
- ListTableIdentifiers
- CreateIcebergTable
- DeleteIcebergTable
- GetIcebergTable
- UpdateIcebergTable (CommitTable)
- LoadIcebergTableCredentials
- RegisterTable

Users are required to provided the ``X-Goog-User-Project`` header
with the project id or number which can be different from the bucket
project id. That project will be charged for the API calls and the
calling user must have access to that project. The caller must have
``serviceusage.services.use`` permission on the project.
"""Lakehouse runtime catalog supports the following catalog
management methods:

- GetIcebergCatalog
- ListIcebergCatalogs
- DeleteIcebergCatalog
- UpdateIcebergCatalog
- CreateIcebergCatalog
- FailoverIcebergCatalog
"""

_client: IcebergCatalogServiceClient
Expand All @@ -106,6 +87,10 @@ class IcebergCatalogServiceAsyncClient:

catalog_path = staticmethod(IcebergCatalogServiceClient.catalog_path)
parse_catalog_path = staticmethod(IcebergCatalogServiceClient.parse_catalog_path)
secret_path = staticmethod(IcebergCatalogServiceClient.secret_path)
parse_secret_path = staticmethod(IcebergCatalogServiceClient.parse_secret_path)
service_path = staticmethod(IcebergCatalogServiceClient.service_path)
parse_service_path = staticmethod(IcebergCatalogServiceClient.parse_service_path)
common_billing_account_path = staticmethod(
IcebergCatalogServiceClient.common_billing_account_path
)
Expand Down Expand Up @@ -599,7 +584,7 @@ async def sample_update_iceberg_catalog():

# Initialize request argument(s)
iceberg_catalog = biglake_v1.IcebergCatalog()
iceberg_catalog.catalog_type = "CATALOG_TYPE_GCS_BUCKET"
iceberg_catalog.catalog_type = "CATALOG_TYPE_FEDERATED"

request = biglake_v1.UpdateIcebergCatalogRequest(
iceberg_catalog=iceberg_catalog,
Expand Down Expand Up @@ -701,12 +686,12 @@ async def create_iceberg_catalog(
parent: Optional[str] = None,
iceberg_catalog: Optional[iceberg_rest_catalog.IcebergCatalog] = None,
iceberg_catalog_id: Optional[str] = None,
primary_location: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> iceberg_rest_catalog.IcebergCatalog:
r"""Creates the Iceberg REST Catalog. Currently only supports Google
Cloud Storage Bucket catalogs. Google Cloud Storage Bucket
r"""Creates the Iceberg REST Catalog. Google Cloud Storage Bucket
catalog id is the bucket for which the catalog is created (e.g.
``my-catalog`` for ``gs://my-catalog``).

Expand All @@ -730,7 +715,7 @@ async def sample_create_iceberg_catalog():

# Initialize request argument(s)
iceberg_catalog = biglake_v1.IcebergCatalog()
iceberg_catalog.catalog_type = "CATALOG_TYPE_GCS_BUCKET"
iceberg_catalog.catalog_type = "CATALOG_TYPE_FEDERATED"

request = biglake_v1.CreateIcebergCatalogRequest(
parent="parent_value",
Expand Down Expand Up @@ -770,6 +755,27 @@ async def sample_create_iceberg_catalog():
This corresponds to the ``iceberg_catalog_id`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
primary_location (:class:`str`):
Optional. The primary location where the catalog
metadata will be stored.

For Google Cloud Storage bucket catalogs and BigLake
catalogs, if this is not specified, then the region is
inferred from the bucket's region (``default_location``
bucket for BigLake catalogs). If specified, the region
must be in jurisdiction (near the ``default_location``
bucket's region and the ``restricted_locations``
buckets' regions for BigLake catalogs).

For federated catalogs, this must be specified and be a
Lakehouse-supported location
(https://docs.cloud.google.com/lakehouse/docs/locations).
It should be close to the remote catalog's location for
the best performance and cost.

This corresponds to the ``primary_location`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -785,7 +791,12 @@ async def sample_create_iceberg_catalog():
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
flattened_params = [parent, iceberg_catalog, iceberg_catalog_id]
flattened_params = [
parent,
iceberg_catalog,
iceberg_catalog_id,
primary_location,
]
has_flattened_params = (
len([param for param in flattened_params if param is not None]) > 0
)
Expand All @@ -808,6 +819,8 @@ async def sample_create_iceberg_catalog():
request.iceberg_catalog = iceberg_catalog
if iceberg_catalog_id is not None:
request.iceberg_catalog_id = iceberg_catalog_id
if primary_location is not None:
request.primary_location = primary_location

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,34 +109,15 @@ def get_transport_class(


class IcebergCatalogServiceClient(metaclass=IcebergCatalogServiceClientMeta):
"""Iceberg Catalog Service API: this implements the open-source Iceberg
REST Catalog API. See the API definition here:
https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml

The API is defined as OpenAPI 3.1.1 spec.

Currently we only support the following methods:

- GetConfig/GetIcebergCatalogConfig
- ListIcebergNamespaces
- CheckIcebergNamespaceExists
- GetIcebergNamespace
- CreateIcebergNamespace (only supports single level)
- DeleteIcebergNamespace
- UpdateIcebergNamespace properties
- ListTableIdentifiers
- CreateIcebergTable
- DeleteIcebergTable
- GetIcebergTable
- UpdateIcebergTable (CommitTable)
- LoadIcebergTableCredentials
- RegisterTable

Users are required to provided the ``X-Goog-User-Project`` header
with the project id or number which can be different from the bucket
project id. That project will be charged for the API calls and the
calling user must have access to that project. The caller must have
``serviceusage.services.use`` permission on the project.
"""Lakehouse runtime catalog supports the following catalog
management methods:

- GetIcebergCatalog
- ListIcebergCatalogs
- DeleteIcebergCatalog
- UpdateIcebergCatalog
- CreateIcebergCatalog
- FailoverIcebergCatalog
"""

@staticmethod
Expand Down Expand Up @@ -274,6 +255,47 @@ def parse_catalog_path(path: str) -> Dict[str, str]:
m = re.match(r"^projects/(?P<project>.+?)/catalogs/(?P<catalog>.+?)$", path)
return m.groupdict() if m else {}

@staticmethod
def secret_path(
project: str,
secret: str,
) -> str:
"""Returns a fully-qualified secret string."""
return "projects/{project}/secrets/{secret}".format(
project=project,
secret=secret,
)

@staticmethod
def parse_secret_path(path: str) -> Dict[str, str]:
"""Parses a secret path into its component segments."""
m = re.match(r"^projects/(?P<project>.+?)/secrets/(?P<secret>.+?)$", path)
return m.groupdict() if m else {}

@staticmethod
def service_path(
project: str,
location: str,
namespace: str,
service: str,
) -> str:
"""Returns a fully-qualified service string."""
return "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}".format(
project=project,
location=location,
namespace=namespace,
service=service,
)

@staticmethod
def parse_service_path(path: str) -> Dict[str, str]:
"""Parses a service path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/namespaces/(?P<namespace>.+?)/services/(?P<service>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
def common_billing_account_path(
billing_account: str,
Expand Down Expand Up @@ -1021,7 +1043,7 @@ def sample_update_iceberg_catalog():

# Initialize request argument(s)
iceberg_catalog = biglake_v1.IcebergCatalog()
iceberg_catalog.catalog_type = "CATALOG_TYPE_GCS_BUCKET"
iceberg_catalog.catalog_type = "CATALOG_TYPE_FEDERATED"

request = biglake_v1.UpdateIcebergCatalogRequest(
iceberg_catalog=iceberg_catalog,
Expand Down Expand Up @@ -1120,12 +1142,12 @@ def create_iceberg_catalog(
parent: Optional[str] = None,
iceberg_catalog: Optional[iceberg_rest_catalog.IcebergCatalog] = None,
iceberg_catalog_id: Optional[str] = None,
primary_location: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> iceberg_rest_catalog.IcebergCatalog:
r"""Creates the Iceberg REST Catalog. Currently only supports Google
Cloud Storage Bucket catalogs. Google Cloud Storage Bucket
r"""Creates the Iceberg REST Catalog. Google Cloud Storage Bucket
catalog id is the bucket for which the catalog is created (e.g.
``my-catalog`` for ``gs://my-catalog``).

Expand All @@ -1149,7 +1171,7 @@ def sample_create_iceberg_catalog():

# Initialize request argument(s)
iceberg_catalog = biglake_v1.IcebergCatalog()
iceberg_catalog.catalog_type = "CATALOG_TYPE_GCS_BUCKET"
iceberg_catalog.catalog_type = "CATALOG_TYPE_FEDERATED"

request = biglake_v1.CreateIcebergCatalogRequest(
parent="parent_value",
Expand Down Expand Up @@ -1189,6 +1211,27 @@ def sample_create_iceberg_catalog():
This corresponds to the ``iceberg_catalog_id`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
primary_location (str):
Optional. The primary location where the catalog
metadata will be stored.

For Google Cloud Storage bucket catalogs and BigLake
catalogs, if this is not specified, then the region is
inferred from the bucket's region (``default_location``
bucket for BigLake catalogs). If specified, the region
must be in jurisdiction (near the ``default_location``
bucket's region and the ``restricted_locations``
buckets' regions for BigLake catalogs).

For federated catalogs, this must be specified and be a
Lakehouse-supported location
(https://docs.cloud.google.com/lakehouse/docs/locations).
It should be close to the remote catalog's location for
the best performance and cost.

This corresponds to the ``primary_location`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -1204,7 +1247,12 @@ def sample_create_iceberg_catalog():
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
flattened_params = [parent, iceberg_catalog, iceberg_catalog_id]
flattened_params = [
parent,
iceberg_catalog,
iceberg_catalog_id,
primary_location,
]
has_flattened_params = (
len([param for param in flattened_params if param is not None]) > 0
)
Expand All @@ -1226,6 +1274,8 @@ def sample_create_iceberg_catalog():
request.iceberg_catalog = iceberg_catalog
if iceberg_catalog_id is not None:
request.iceberg_catalog_id = iceberg_catalog_id
if primary_location is not None:
request.primary_location = primary_location

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,34 +110,15 @@ def intercept_unary_unary(self, continuation, client_call_details, request):
class IcebergCatalogServiceGrpcTransport(IcebergCatalogServiceTransport):
"""gRPC backend transport for IcebergCatalogService.

Iceberg Catalog Service API: this implements the open-source Iceberg
REST Catalog API. See the API definition here:
https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml

The API is defined as OpenAPI 3.1.1 spec.

Currently we only support the following methods:

- GetConfig/GetIcebergCatalogConfig
- ListIcebergNamespaces
- CheckIcebergNamespaceExists
- GetIcebergNamespace
- CreateIcebergNamespace (only supports single level)
- DeleteIcebergNamespace
- UpdateIcebergNamespace properties
- ListTableIdentifiers
- CreateIcebergTable
- DeleteIcebergTable
- GetIcebergTable
- UpdateIcebergTable (CommitTable)
- LoadIcebergTableCredentials
- RegisterTable

Users are required to provided the ``X-Goog-User-Project`` header
with the project id or number which can be different from the bucket
project id. That project will be charged for the API calls and the
calling user must have access to that project. The caller must have
``serviceusage.services.use`` permission on the project.
Lakehouse runtime catalog supports the following catalog
management methods:

- GetIcebergCatalog
- ListIcebergCatalogs
- DeleteIcebergCatalog
- UpdateIcebergCatalog
- CreateIcebergCatalog
- FailoverIcebergCatalog

This class defines the same methods as the primary client, so the
primary client can load the underlying transport implementation
Expand Down Expand Up @@ -450,8 +431,7 @@ def create_iceberg_catalog(
]:
r"""Return a callable for the create iceberg catalog method over gRPC.

Creates the Iceberg REST Catalog. Currently only supports Google
Cloud Storage Bucket catalogs. Google Cloud Storage Bucket
Creates the Iceberg REST Catalog. Google Cloud Storage Bucket
catalog id is the bucket for which the catalog is created (e.g.
``my-catalog`` for ``gs://my-catalog``).

Expand Down
Loading
Loading