Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /khulnasoft_DockNet /backend /src /docknet /clients /extension.py
| from typing import Dict, List, Optional | |
| import requests | |
| from pydantic.tools import parse_raw_as | |
| from docknet.clients.shared import handle_errors | |
| from docknet.operations import ExtensionOperations | |
| from docknet.schema.extension import Extension, ExtensionInput | |
| class ExtensionClient(ExtensionOperations): | |
| def __init__(self, client: requests.Session): | |
| self._client = client | |
| def client(self) -> requests.Session: | |
| return self._client | |
| def list_extensions( | |
| self, project_id: str, request_kwargs: Dict = {} | |
| ) -> List[Extension]: | |
| response = self.client.get( | |
| f"/projects/{project_id}/extensions", **request_kwargs | |
| ) | |
| handle_errors(response) | |
| return parse_raw_as(List[Extension], response.text) | |
| def install_extension( | |
| self, extension: ExtensionInput, project_id: str, request_kwargs: Dict = {} | |
| ) -> Extension: | |
| response = self.client.post( | |
| f"/projects/{project_id}/extensions", | |
| data=extension.json(exclude_unset=True), | |
| **request_kwargs, | |
| ) | |
| handle_errors(response) | |
| return parse_raw_as(Extension, response.text) | |
| def delete_extension( | |
| self, project_id: str, extension_id: Optional[str] = None | |
| ) -> None: | |
| raise NotImplementedError | |
| def suggest_extension_config( | |
| self, | |
| container_image: str, | |
| project_id: str, | |
| ) -> ExtensionInput: | |
| raise NotImplementedError | |
| def get_extension_metadata( | |
| self, | |
| project_id: str, | |
| extension_id: str, | |
| ) -> Extension: | |
| raise NotImplementedError | |
Xet Storage Details
- Size:
- 1.64 kB
- Xet hash:
- ca390993d61403217915bf86391f5f0cff042244b8be8d230ef9188d3fb12bb0
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.