Skip to main content

vantage_sdk.base.crud

Base CRUD SDK classes with common patterns extracted from profile and deployment commands.

Classes

BaseCRUDSDK()

Abstract base class for CRUD SDK operations.

Methods

  • create(self, ctx: typer.models.Context, resource_data: Dict[str, Any], **kwargs: Any) -> Dict[str, Any]: Create a new resource.
  • delete(self, ctx: typer.models.Context, resource_id: str, **kwargs: Any) -> bool: Delete a resource.
  • get(self, ctx: typer.models.Context, resource_id: str, **kwargs: Any) -> Dict[str, Any] | None: Get a specific resource by ID/name.
  • list(self, ctx: typer.models.Context, **kwargs: Any) -> List[Dict[str, Any]]: List all resources of this type.
  • update(self, ctx: typer.models.Context, resource_id: str, resource_data: Dict[str, Any], **kwargs: Any) -> Dict[str, Any]: Update an existing resource.

BaseGraphQLResourceSDK(resource_name: str)

Base class for resources that interact with GraphQL APIs.

Methods

  • create(self, ctx: typer.models.Context, resource_data: Dict[str, Any], **kwargs: Any) -> Dict[str, Any]: Create a new resource.
  • delete(self, ctx: typer.models.Context, resource_id: str, **kwargs: Any) -> bool: Delete a resource.
  • get(self, ctx: typer.models.Context, resource_id: str, **kwargs: Any) -> Dict[str, Any] | None: Get resource by ID using list-and-filter approach.
  • list(self, ctx: typer.models.Context, **kwargs: Any) -> List[Dict[str, Any]]: List resources using GraphQL query.
  • update(self, ctx: typer.models.Context, resource_id: str, resource_data: Dict[str, Any], **kwargs: Any) -> Dict[str, Any]: Update an existing resource.

BaseLocalResourceSDK(resource_name: str, config_file_path: str | None = None)

Base class for resources that are stored locally (config files, etc.).

Methods

  • create(self, ctx: typer.models.Context, resource_data: Dict[str, Any], **kwargs: Any) -> Dict[str, Any]: Create a new resource.
  • delete(self, ctx: typer.models.Context, resource_id: str, **kwargs: Any) -> bool: Delete a resource.
  • get(self, ctx: typer.models.Context, resource_id: str, **kwargs: Any) -> Dict[str, Any] | None: Get a specific local resource.
  • list(self, ctx: typer.models.Context, **kwargs: Any) -> List[Dict[str, Any]]: List all local resources.
  • update(self, ctx: typer.models.Context, resource_id: str, resource_data: Dict[str, Any], **kwargs: Any) -> Dict[str, Any]: Update an existing resource.

BaseRestApiResourceSDK(resource_name: str, base_path: str, endpoint_path: str)

Base class for resources that interact with REST APIs.

Methods

  • create(self, ctx: typer.models.Context, resource_data: Dict[str, Any], **kwargs: Any) -> Dict[str, Any]: Create a new resource via REST API.
  • delete(self, ctx: typer.models.Context, resource_id: str, **kwargs: Any) -> bool: Delete a resource via REST API.
  • get(self, ctx: typer.models.Context, resource_id: str, **kwargs: Any) -> Dict[str, Any] | None: Get a specific resource by ID via REST API.
  • list(self, ctx: typer.models.Context, **kwargs: Any) -> List[Dict[str, Any]]: List all resources via REST API.
  • update(self, ctx: typer.models.Context, resource_id: str, resource_data: Dict[str, Any], **kwargs: Any) -> Dict[str, Any]: Update an existing resource via REST API.