|
6 | 6 | use super::error::{PlatformApiError, Result}; |
7 | 7 | use super::types::{ |
8 | 8 | ApiErrorResponse, ArtifactRegistry, AvailableRepositoriesResponse, CloudCredentialStatus, |
9 | | - CloudProvider, ClusterEntity, ConnectRepositoryRequest, ConnectRepositoryResponse, |
10 | | - CreateDeploymentConfigRequest, CreateDeploymentConfigResponse, CreateRegistryRequest, |
11 | | - CreateRegistryResponse, DeploymentConfig, DeploymentSecretInput, DeploymentTaskStatus, |
12 | | - Environment, GenericResponse, GetLogsResponse, GitHubInstallationUrlResponse, |
13 | | - GitHubInstallationsResponse, InitializeGitOpsRequest, InitializeGitOpsResponse, Organization, |
14 | | - PaginatedDeployments, Project, ProjectRepositoriesResponse, RegistryTaskStatus, |
15 | | - TriggerDeploymentRequest, TriggerDeploymentResponse, UserProfile, |
| 9 | + CloudProvider, CloudRunnerNetwork, ClusterEntity, ConnectRepositoryRequest, |
| 10 | + ConnectRepositoryResponse, CreateDeploymentConfigRequest, CreateDeploymentConfigResponse, |
| 11 | + CreateRegistryRequest, CreateRegistryResponse, DeploymentConfig, DeploymentSecretInput, |
| 12 | + DeploymentTaskStatus, Environment, GenericResponse, GetLogsResponse, |
| 13 | + GitHubInstallationUrlResponse, GitHubInstallationsResponse, InitializeGitOpsRequest, |
| 14 | + InitializeGitOpsResponse, Organization, PaginatedDeployments, Project, |
| 15 | + ProjectRepositoriesResponse, RegistryTaskStatus, TriggerDeploymentRequest, |
| 16 | + TriggerDeploymentResponse, UserProfile, |
16 | 17 | }; |
17 | 18 | use crate::auth::credentials; |
18 | 19 | use reqwest::Client; |
@@ -1021,6 +1022,29 @@ impl PlatformApiClient { |
1021 | 1022 | .await |
1022 | 1023 | } |
1023 | 1024 |
|
| 1025 | + // ========================================================================= |
| 1026 | + // Cloud Runner Network API methods |
| 1027 | + // ========================================================================= |
| 1028 | + |
| 1029 | + /// List all cloud runner networks for a project |
| 1030 | + /// |
| 1031 | + /// Returns VPCs, subnets, Azure Container App Environments, GCP VPC Connectors, etc. |
| 1032 | + /// Use this to discover private networking infrastructure provisioned for the project. |
| 1033 | + /// |
| 1034 | + /// Endpoint: GET /api/v1/cloud-runner/projects/:projectId/networks |
| 1035 | + pub async fn list_project_networks( |
| 1036 | + &self, |
| 1037 | + project_id: &str, |
| 1038 | + ) -> Result<Vec<CloudRunnerNetwork>> { |
| 1039 | + let response: GenericResponse<Vec<CloudRunnerNetwork>> = self |
| 1040 | + .get(&format!( |
| 1041 | + "/api/v1/cloud-runner/projects/{}/networks", |
| 1042 | + project_id |
| 1043 | + )) |
| 1044 | + .await?; |
| 1045 | + Ok(response.data) |
| 1046 | + } |
| 1047 | + |
1024 | 1048 | // ========================================================================= |
1025 | 1049 | // Health Check API methods |
1026 | 1050 | // ========================================================================= |
|
0 commit comments