INNER CODE UNIT · Python

__init__

Altinity/clickhouse-operator · tools/restore_shared_to_replicated.py:171

    def __init__(self, args: argparse.Namespace) -> None:
        self.access_key = args.access_key
        self.secret_key = args.secret_key
        self.region = args.region
        self.bucket = args.bucket
        self.endpoint_url = ensure_url_scheme(args.endpoint_url) if args.endpoint_url else ""
        self.s3_restore_url = ensure_url_scheme(args.s3_restore_url) if args.s3_restore_url else ""

    def _target(self, key: str) -> tuple[str, str, str]:
        """Return (scheme, host, canonical_uri) for a bucket-relative key."""
        quoted_key = quote(key, safe="/")
        if self.endpoint_url:
            parsed = urllib.parse.urlparse(self.endpoint_url)
            host = parsed.netloc
            if not host:
                raise RuntimeError(
                    f"Invalid --endpoint-url {self.endpoint_url!r}: missing host. "
                    "Use e.g. http://minio:9000 or https://s3.amazonaws.com"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…