pub struct GcloudClient<E: GcloudExecutor = RealExecutor> { /* private fields */ }Expand description
GCP operations client, parameterized over the executor for testability.
Implementations§
Source§impl<E: GcloudExecutor> GcloudClient<E>
impl<E: GcloudExecutor> GcloudClient<E>
pub fn with_executor(executor: E) -> Self
pub async fn check_prerequisites( &self, project_id: &str, ) -> Result<PreflightReport, PreflightError>
Sourcepub async fn doctor(&self, project_id: Option<&str>) -> DoctorReport
pub async fn doctor(&self, project_id: Option<&str>) -> DoctorReport
Run all diagnostic checks without early return. Returns a report with pass/fail for each check item.
Sourcepub async fn ensure_artifact_repo(
&self,
project_id: &str,
region: &str,
repo_name: &str,
) -> Result<(), DeployError>
pub async fn ensure_artifact_repo( &self, project_id: &str, region: &str, repo_name: &str, ) -> Result<(), DeployError>
Ensure the Artifact Registry Docker repository exists, creating it if needed.
Sourcepub async fn delete_image(
&self,
image_tag: &str,
project_id: &str,
) -> Result<(), DeployError>
pub async fn delete_image( &self, image_tag: &str, project_id: &str, ) -> Result<(), DeployError>
Delete a container image from Artifact Registry.
pub async fn submit_build( &self, bundle_dir: &Path, project_id: &str, image_tag: &str, ) -> Result<(), CloudBuildError>
pub async fn deploy_to_cloud_run( &self, service_name: &str, image_tag: &str, project_id: &str, region: &str, config: &CloudRunConfig, secrets: &[String], ) -> Result<String, DeployError>
pub async fn describe_service( &self, service_name: &str, project_id: &str, region: &str, ) -> Result<String, DeployError>
pub async fn delete_service( &self, service_name: &str, project_id: &str, region: &str, ) -> Result<(), DeployError>
pub async fn read_logs( &self, service_name: &str, project_id: &str, region: &str, limit: u32, ) -> Result<(), DeployError>
pub async fn tail_logs( &self, service_name: &str, project_id: &str, region: &str, ) -> Result<(), DeployError>
pub async fn set_secret( &self, project_id: &str, secret_name: &str, secret_value: &str, ) -> Result<(), SecretError>
pub async fn get_project_number( &self, project_id: &str, ) -> Result<String, DeployError>
pub async fn grant_secret_access( &self, project_id: &str, secret_name: &str, service_account: &str, ) -> Result<(), SecretError>
pub async fn revoke_secret_access( &self, project_id: &str, secret_name: &str, service_account: &str, ) -> Result<(), SecretError>
pub async fn list_secrets( &self, project_id: &str, ) -> Result<Vec<String>, SecretError>
pub async fn delete_secret( &self, project_id: &str, secret_name: &str, ) -> Result<(), SecretError>
Sourcepub async fn ensure_wif_pool(
&self,
project_id: &str,
pool_id: &str,
) -> Result<bool, WifError>
pub async fn ensure_wif_pool( &self, project_id: &str, pool_id: &str, ) -> Result<bool, WifError>
Create a Workload Identity Pool (idempotent).
Returns true if created, false if already existed.
Sourcepub async fn ensure_oidc_provider(
&self,
project_id: &str,
pool_id: &str,
provider_id: &str,
github_repo: &str,
) -> Result<bool, WifError>
pub async fn ensure_oidc_provider( &self, project_id: &str, pool_id: &str, provider_id: &str, github_repo: &str, ) -> Result<bool, WifError>
Create an OIDC provider in a WIF pool (idempotent).
Returns true if created, false if already existed.
Sourcepub async fn ensure_service_account(
&self,
project_id: &str,
sa_id: &str,
display_name: &str,
) -> Result<bool, WifError>
pub async fn ensure_service_account( &self, project_id: &str, sa_id: &str, display_name: &str, ) -> Result<bool, WifError>
Create a service account (idempotent).
Returns true if created, false if already existed.
Sourcepub async fn bind_iam_roles(
&self,
project_id: &str,
sa_email: &str,
roles: &[&str],
) -> Result<(), WifError>
pub async fn bind_iam_roles( &self, project_id: &str, sa_email: &str, roles: &[&str], ) -> Result<(), WifError>
Bind IAM roles to a service account.
Sourcepub async fn bind_wif_to_sa(
&self,
project_id: &str,
project_number: &str,
pool_id: &str,
sa_email: &str,
github_repo: &str,
) -> Result<(), WifError>
pub async fn bind_wif_to_sa( &self, project_id: &str, project_number: &str, pool_id: &str, sa_email: &str, github_repo: &str, ) -> Result<(), WifError>
Bind a WIF pool to a service account, scoped to a GitHub repository.
Trait Implementations§
Source§impl Default for GcloudClient<RealExecutor>
impl Default for GcloudClient<RealExecutor>
Auto Trait Implementations§
impl<E> Freeze for GcloudClient<E>where
E: Freeze,
impl<E> RefUnwindSafe for GcloudClient<E>where
E: RefUnwindSafe,
impl<E> Send for GcloudClient<E>
impl<E> Sync for GcloudClient<E>
impl<E> Unpin for GcloudClient<E>where
E: Unpin,
impl<E> UnsafeUnpin for GcloudClient<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for GcloudClient<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more