From 19e08b2bcc6bcf769595ac910fb8b899b7d9e479 Mon Sep 17 00:00:00 2001 From: Josh Rotenberg Date: Tue, 19 May 2026 11:22:01 -0700 Subject: [PATCH] docs(connectivity): expand thin module headers (psc, transit_gateway, vpc_peering) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The headers on psc.rs, transit_gateway.rs, and vpc_peering.rs were three lines each despite each module hosting 9-19 public methods. Now each header carries: - A one-paragraph summary of what the module is for - A 'When to use this module' section that distinguishes it from the three sibling connectivity modules (vpc_peering vs psc vs transit_gateway vs private_link) - The full REST endpoint surface (standard + Active-Active) - A blanket 'Errors' note pointing at CloudError - A runnable example on vpc_peering using the for_aws constructor private_link.rs already has a multi-paragraph Overview section and is left as-is. 71 doctests pass (was 70 — the new vpc_peering example). Refs #80 (rustdoc umbrella — P2 thin-module-headers slice) --- src/connectivity/psc.rs | 40 +++++++++++++++++-- src/connectivity/transit_gateway.rs | 35 +++++++++++++++-- src/connectivity/vpc_peering.rs | 60 +++++++++++++++++++++++++++-- 3 files changed, 126 insertions(+), 9 deletions(-) diff --git a/src/connectivity/psc.rs b/src/connectivity/psc.rs index b08f7b5..2d63210 100644 --- a/src/connectivity/psc.rs +++ b/src/connectivity/psc.rs @@ -1,7 +1,41 @@ -//! Private Service Connect (PSC) operations +//! Google Cloud Private Service Connect (PSC) operations. //! -//! Manages Google Cloud Private Service Connect endpoints for secure connectivity -//! to Redis Cloud databases without traversing the public internet. +//! Manages Private Service Connect services and endpoints so Redis Cloud +//! databases can be reached from a GCP VPC without traversing the public +//! internet. +//! +//! # When to use this module +//! +//! - The subscription is on GCP and you want connectivity that does not +//! require a VPC peering connection or a public endpoint. +//! - You manage multiple client projects and want each to attach via its +//! own consumer endpoint. +//! +//! For AWS connectivity see [`crate::connectivity::vpc_peering`] (general +//! VPC peering) or [`crate::connectivity::private_link`] (AWS PrivateLink). +//! For AWS hub-and-spoke topologies see +//! [`crate::connectivity::transit_gateway`]. +//! +//! # Endpoint surface +//! +//! Service-level (one per subscription / region): +//! +//! - `GET /subscriptions/{subscriptionId}/private-service-connect` +//! - `POST /subscriptions/{subscriptionId}/private-service-connect` +//! - `DELETE /subscriptions/{subscriptionId}/private-service-connect` +//! +//! Endpoint-level (consumer endpoints under the service): +//! +//! - `POST /subscriptions/{subscriptionId}/private-service-connect/.../endpoints` +//! - `PUT /subscriptions/{subscriptionId}/private-service-connect/.../endpoints/{endpointId}` +//! +//! Active-Active subscriptions expose the same surface scoped to a region +//! id via `/subscriptions/{subscriptionId}/regions/{regionId}/...`. +//! +//! # Errors +//! +//! All operations return [`crate::Result`]; transport, auth, and 4xx/5xx +//! responses surface as the corresponding [`crate::CloudError`] variant. use crate::{CloudClient, Result}; use serde::{Deserialize, Serialize}; diff --git a/src/connectivity/transit_gateway.rs b/src/connectivity/transit_gateway.rs index 358b1af..642dc5c 100644 --- a/src/connectivity/transit_gateway.rs +++ b/src/connectivity/transit_gateway.rs @@ -1,7 +1,36 @@ -//! AWS Transit Gateway operations +//! AWS Transit Gateway (TGW) attachment operations. //! -//! Manages AWS Transit Gateway attachments for hub-and-spoke network topologies, -//! enabling centralized connectivity management for Redis Cloud subscriptions. +//! Manages AWS Transit Gateway attachments and CIDR allow-lists so a Redis +//! Cloud subscription can ride a hub-and-spoke topology you already +//! operate, rather than terminating its own VPC peering connection. +//! +//! # When to use this module +//! +//! - You already run a Transit Gateway and want Redis Cloud subscriptions +//! to attach to it for centralized routing and segmentation. +//! - You need to extend or update the CIDRs a subscription is allowed to +//! reach through its TGW attachment. +//! +//! For direct point-to-point AWS peering see +//! [`crate::connectivity::vpc_peering`]; for endpoint-style PrivateLink +//! connectivity see [`crate::connectivity::private_link`]. +//! +//! # Endpoint surface +//! +//! Standard subscriptions: +//! +//! - `GET /subscriptions/{subscriptionId}/transitGateways` +//! - `POST /subscriptions/{subscriptionId}/transitGateways/{tgwId}` +//! - `DELETE /subscriptions/{subscriptionId}/transitGateways/{tgwId}` +//! - `PUT /subscriptions/{subscriptionId}/transitGateways/{tgwId}/attachment` +//! +//! Active-Active subscriptions expose the same surface under +//! `/subscriptions/{subscriptionId}/regions/{regionId}/...`. +//! +//! # Errors +//! +//! All operations return [`crate::Result`]; transport, auth, and 4xx/5xx +//! responses surface as the corresponding [`crate::CloudError`] variant. use crate::{CloudClient, Result}; use serde::{Deserialize, Serialize}; diff --git a/src/connectivity/vpc_peering.rs b/src/connectivity/vpc_peering.rs index b1e6134..dc7da5a 100644 --- a/src/connectivity/vpc_peering.rs +++ b/src/connectivity/vpc_peering.rs @@ -1,7 +1,61 @@ -//! VPC Peering connectivity operations +//! VPC peering operations for AWS and GCP Pro subscriptions. //! -//! Manages VPC peering connections between Redis Cloud VPCs and customer VPCs -//! for both standard and Active-Active subscriptions. +//! Manages VPC peering connections between a Redis Cloud subscription's +//! VPC and a customer-owned VPC, covering both standard subscriptions and +//! Active-Active (CRDB) subscriptions where each region is peered +//! independently. +//! +//! # When to use this module +//! +//! - You want direct VPC-to-VPC private connectivity (no public +//! endpoint, no shared TGW). +//! - The subscription is on **AWS** or **GCP**. Azure connectivity is +//! handled separately by the Redis Cloud console; the SDK does not +//! yet expose Azure-specific endpoints here. +//! +//! For AWS hub-and-spoke topologies see +//! [`crate::connectivity::transit_gateway`]; for AWS endpoint-style +//! private connectivity see [`crate::connectivity::private_link`]; for +//! GCP endpoint-style private connectivity see +//! [`crate::connectivity::psc`]. +//! +//! # Endpoint surface +//! +//! - `GET /subscriptions/{subscriptionId}/peerings` +//! - `POST /subscriptions/{subscriptionId}/peerings` +//! - `PUT /subscriptions/{subscriptionId}/peerings/{peeringId}` +//! - `DELETE /subscriptions/{subscriptionId}/peerings/{peeringId}` +//! +//! Active-Active subscriptions expose the same surface scoped to a +//! region under `/subscriptions/{subscriptionId}/regions/{regionId}/...`. +//! +//! # Example +//! +//! Construct a provider-targeted body and create a peering: +//! +//! ```rust,no_run +//! use redis_cloud::{CloudClient, VpcPeeringHandler}; +//! use redis_cloud::connectivity::VpcPeeringCreateRequest; +//! +//! # async fn example() -> Result<(), Box> { +//! let client = CloudClient::builder() +//! .api_key("k").api_secret("s").build()?; +//! let handler = VpcPeeringHandler::new(client); +//! +//! let mut request = VpcPeeringCreateRequest::for_aws( +//! "us-east-1", "123456789012", "vpc-12345678", +//! ); +//! request.vpc_cidr = Some("10.0.0.0/16".to_string()); +//! let task = handler.create(123, &request).await?; +//! # let _ = task; +//! # Ok(()) +//! # } +//! ``` +//! +//! # Errors +//! +//! All operations return [`crate::Result`]; transport, auth, and 4xx/5xx +//! responses surface as the corresponding [`crate::CloudError`] variant. use crate::{CloudClient, Result}; use serde::{Deserialize, Serialize};