Skip to main content

ConnectivityHandler

Struct ConnectivityHandler 

Source
pub struct ConnectivityHandler {
    pub vpc_peering: VpcPeeringHandler,
    pub psc: PscHandler,
    pub transit_gateway: TransitGatewayHandler,
}
Expand description

Unified connectivity handler combining VPC Peering, PSC, and Transit Gateway operations.

ConnectivityHandler is a backward-compatibility facade: each method delegates to the underlying specialized handler. New code should prefer the specialized handlers directly — they expose the full surface for their respective connectivity domains:

Errors returned from delegated calls propagate unchanged; see each backing handler’s documentation for the full error surface.

§Example

use redis_cloud::{CloudClient, ConnectivityHandler};

let client = CloudClient::builder()
    .api_key("key")
    .api_secret("secret")
    .build()?;

let connectivity = ConnectivityHandler::new(client);
let _vpc_task = connectivity.get_vpc_peering(123).await?;

Fields§

§vpc_peering: VpcPeeringHandler

VPC peering sub-handler. See VpcPeeringHandler.

§psc: PscHandler

Private Service Connect sub-handler. See PscHandler.

§transit_gateway: TransitGatewayHandler

Transit Gateway sub-handler. See TransitGatewayHandler.

Implementations§

Source§

impl ConnectivityHandler

Source

pub fn new(client: CloudClient) -> Self

Construct a ConnectivityHandler wired to the supplied CloudClient.

Internally clones the client into each of the three sub-handlers, so client can be dropped after construction if not needed elsewhere.

Source

pub async fn get_vpc_peering( &self, subscription_id: i32, ) -> Result<TaskStateUpdate>

Get the VPC peering configuration for a Pro subscription.

GET /subscriptions/{subscriptionId}/peerings. Delegates to VpcPeeringHandler::get.

§Errors

Propagates any crate::CloudError returned by the underlying call — typically NotFound if the subscription has no peering configured, AuthenticationFailed for bad credentials, or InternalServerError.

Source

pub async fn create_vpc_peering( &self, subscription_id: i32, request: &VpcPeeringCreateRequest, ) -> Result<TaskStateUpdate>

Create a VPC peering on a Pro subscription.

POST /subscriptions/{subscriptionId}/peerings. Delegates to VpcPeeringHandler::create. Use VpcPeeringCreateRequest::for_aws or VpcPeeringCreateRequest::for_gcp to build a provider-targeted body with the spec’s required fields.

§Errors

Returns crate::CloudError for transport, auth, or 4xx/5xx responses. BadRequest is common when the body is missing provider-required fields.

Source

pub async fn delete_vpc_peering( &self, subscription_id: i32, peering_id: i32, ) -> Result<TaskStateUpdate>

Delete a VPC peering by its peering ID.

DELETE /subscriptions/{subscriptionId}/peerings/{peeringId}. Delegates to VpcPeeringHandler::delete. The deletion is asynchronous; the returned TaskStateUpdate carries a task_id that can be polled to completion.

§Errors

Returns crate::CloudError for non-2xx responses; NotFound if the peering does not exist.

Source

pub async fn update_vpc_peering( &self, subscription_id: i32, peering_id: i32, request: &VpcPeeringUpdateAwsRequest, ) -> Result<TaskStateUpdate>

Update a VPC peering’s CIDR list.

PUT /subscriptions/{subscriptionId}/peerings/{peeringId}. Translates the AWS-only VpcPeeringUpdateAwsRequest into the underlying VpcPeeringCreateRequest shape and delegates to VpcPeeringHandler::update.

§Errors

Returns crate::CloudError for transport, auth, or 4xx/5xx responses.

Source

pub async fn get_psc_service( &self, subscription_id: i32, ) -> Result<TaskStateUpdate>

Get the Private Service Connect service for a Pro subscription.

GET /subscriptions/{subscriptionId}/private-service-connect. Delegates to PscHandler::get_service.

§Errors

Returns crate::CloudError for transport, auth, or 4xx/5xx responses. NotFound is returned when no PSC service is configured.

Source

pub async fn create_psc_service( &self, subscription_id: i32, ) -> Result<TaskStateUpdate>

Create a Private Service Connect service on a Pro subscription.

POST /subscriptions/{subscriptionId}/private-service-connect. Delegates to PscHandler::create_service.

§Errors

Returns crate::CloudError for transport, auth, or 4xx/5xx responses.

Source

pub async fn delete_psc_service( &self, subscription_id: i32, ) -> Result<TaskStateUpdate>

Delete the Private Service Connect service for a Pro subscription.

DELETE /subscriptions/{subscriptionId}/private-service-connect. Delegates to PscHandler::delete_service. The deletion is asynchronous; the returned TaskStateUpdate carries a task_id that can be polled to completion.

§Errors

Returns crate::CloudError for non-2xx responses.

Source

pub async fn create_psc_endpoint( &self, subscription_id: i32, psc_service_id: i32, request: &PscEndpointUpdateRequest, ) -> Result<TaskStateUpdate>

Create a PSC endpoint under the subscription’s PSC service.

POST /subscriptions/{subscriptionId}/private-service-connect/.../endpoints. Delegates to PscHandler::create_endpoint.

§Errors

Returns crate::CloudError for transport, auth, or 4xx/5xx responses; BadRequest if the endpoint payload is malformed.

Source

pub async fn get_tgws(&self, subscription_id: i32) -> Result<TaskStateUpdate>

List Transit Gateway attachments for a Pro subscription.

GET /subscriptions/{subscriptionId}/transitGateways. Delegates to TransitGatewayHandler::get_attachments.

§Errors

Returns crate::CloudError for transport, auth, or 4xx/5xx responses.

Source

pub async fn create_tgw_attachment( &self, subscription_id: i32, tgw_id: &str, ) -> Result<TaskStateUpdate>

Create a Transit Gateway attachment for the given TGW ID.

POST /subscriptions/{subscriptionId}/transitGateways/{tgwId}. Delegates to TransitGatewayHandler::create_attachment_with_id.

§Errors

Returns crate::CloudError for transport, auth, or 4xx/5xx responses; BadRequest if tgw_id is not in a valid AWS format.

Source

pub async fn delete_tgw_attachment( &self, subscription_id: i32, attachment_id: i32, ) -> Result<TaskStateUpdate>

Delete a Transit Gateway attachment by attachment ID.

DELETE /subscriptions/{subscriptionId}/transitGateways/{tgwId}. Delegates to TransitGatewayHandler::delete_attachment. The deletion is asynchronous; the returned TaskStateUpdate carries a task_id that can be polled to completion.

§Errors

Returns crate::CloudError for non-2xx responses; NotFound if the attachment does not exist.

Source

pub async fn update_tgw_cidrs( &self, subscription_id: i32, attachment_id: &str, request: &TgwUpdateCidrsRequest, ) -> Result<TaskStateUpdate>

Update the CIDR list on a Transit Gateway attachment.

PUT /subscriptions/{subscriptionId}/transitGateways/{tgwId}/attachment. Translates TgwUpdateCidrsRequest (which carries CIDR-with-status entries) into the TgwAttachmentRequest the underlying handler expects and delegates to TransitGatewayHandler::update_attachment_cidrs. Only the cidr_address portion of each CIDR entry is forwarded.

§Errors

Returns crate::CloudError for transport, auth, or 4xx/5xx responses; BadRequest if any CIDR string is not in valid form.

Source

pub async fn update_psc_service_endpoint( &self, subscription_id: i32, psc_service_id: i32, endpoint_id: i32, request: &PscEndpointUpdateRequest, ) -> Result<TaskStateUpdate>

Update a PSC endpoint by endpoint ID. Backward-compatibility wrapper over PscHandler::update_endpoint.

PUT /subscriptions/{subscriptionId}/private-service-connect/.../endpoints/{endpointId}.

§Errors

Returns crate::CloudError for transport, auth, or 4xx/5xx responses.

Source

pub async fn update_tgw_attachment_cidrs( &self, subscription_id: i32, attachment_id: &str, request: &TgwUpdateCidrsRequest, ) -> Result<TaskStateUpdate>

Alias for Self::update_tgw_cidrs retained for backward compatibility. New code should call update_tgw_cidrs directly.

§Errors

Forwards any crate::CloudError from the wrapped call.

Source

pub async fn list_tgw_attachments( &self, subscription_id: i32, ) -> Result<TaskStateUpdate>

List Transit Gateway attachments for a Pro subscription (simplified).

Preferred alias for get_tgws, whose name is ambiguous. get_tgws is retained as a backward-compatibility shim.

GET /subscriptions/{subscriptionId}/transitGateways.

§Errors

Returns crate::CloudError for transport, auth, or 4xx/5xx responses.

§Example
use redis_cloud::{CloudClient, ConnectivityHandler};

let client = CloudClient::builder()
    .api_key("your-api-key")
    .api_secret("your-api-secret")
    .build()?;

let connectivity = ConnectivityHandler::new(client);
let attachments = connectivity.list_tgw_attachments(123).await?;

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more