Skip to main content

LocalAsyncConnectionService

Trait LocalAsyncConnectionService 

Source
pub trait LocalAsyncConnectionService {
    // Required methods
    fn create_connection(
        &self,
        auth_: BearerToken,
        create_connection: CreateConnection,
    ) -> impl Future<Output = Result<Connection, Error>>;
    fn update_connection(
        &self,
        auth_: BearerToken,
        rid: ConnectionRid,
        request: UpdateConnectionRequest,
    ) -> impl Future<Output = Result<Connection, Error>>;
    fn update_connection_status(
        &self,
        auth_: BearerToken,
        rid: ConnectionRid,
        request: ConnectionStatus,
    ) -> impl Future<Output = Result<(), Error>>;
    fn add_available_tags(
        &self,
        auth_: BearerToken,
        rid: ConnectionRid,
        tags: BTreeMap<TagName, BTreeSet<TagValue>>,
    ) -> impl Future<Output = Result<Connection, Error>>;
    fn get_connection(
        &self,
        auth_: BearerToken,
        rid: ConnectionRid,
    ) -> impl Future<Output = Result<Connection, Error>>;
    fn get_connections(
        &self,
        auth_: BearerToken,
        rids: BTreeSet<ConnectionRid>,
    ) -> impl Future<Output = Result<BTreeSet<Connection>, Error>>;
    fn list_connections(
        &self,
        auth_: BearerToken,
        include_archived: Option<bool>,
        workspaces: BTreeSet<WorkspaceRid>,
    ) -> impl Future<Output = Result<BTreeSet<Connection>, Error>>;
    fn list_connections_v2(
        &self,
        auth_: BearerToken,
        include_archived: Option<bool>,
        workspaces: BTreeSet<WorkspaceRid>,
        page_size: Option<i32>,
        next_page_token: Option<Token>,
    ) -> impl Future<Output = Result<ListConnectionsResponse, Error>>;
    fn list_connections_by_nominal_data_source(
        &self,
        auth_: BearerToken,
        nominal_data_source_rids: BTreeSet<NominalDataSourceRid>,
        workspaces: BTreeSet<WorkspaceRid>,
        page_size: Option<i32>,
        next_page_token: Option<Token>,
    ) -> impl Future<Output = Result<ListConnectionsResponse, Error>>;
    fn archive_connection(
        &self,
        auth_: BearerToken,
        rid: ConnectionRid,
    ) -> impl Future<Output = Result<(), Error>>;
    fn unarchive_connection(
        &self,
        auth_: BearerToken,
        rid: ConnectionRid,
    ) -> impl Future<Output = Result<(), Error>>;
}
Expand description

A Connection contains the relevant metadata and information to be used as a data source for runs. The Connection Service is responsible for creating, updating, and retrieving database connections.

Required Methods§

Source

fn create_connection( &self, auth_: BearerToken, create_connection: CreateConnection, ) -> impl Future<Output = Result<Connection, Error>>

Creates a new connection.

Source

fn update_connection( &self, auth_: BearerToken, rid: ConnectionRid, request: UpdateConnectionRequest, ) -> impl Future<Output = Result<Connection, Error>>

Updates an existing connection.

Source

fn update_connection_status( &self, auth_: BearerToken, rid: ConnectionRid, request: ConnectionStatus, ) -> impl Future<Output = Result<(), Error>>

Updates an existing connection status.

Source

fn add_available_tags( &self, auth_: BearerToken, rid: ConnectionRid, tags: BTreeMap<TagName, BTreeSet<TagValue>>, ) -> impl Future<Output = Result<Connection, Error>>

Adds available tag key/value pairs to the connection. If a tag name already exists, the values will be merged. This is primarily an internal endpoint to update tags for external connections as they are periodically scraped. This endpoint should only be called by clients for Visual crossing connections. Throws if called for Nominal connections which have their tags automatically indexed in the underlying Database.

Source

fn get_connection( &self, auth_: BearerToken, rid: ConnectionRid, ) -> impl Future<Output = Result<Connection, Error>>

Gets a connection by its RID.

Source

fn get_connections( &self, auth_: BearerToken, rids: BTreeSet<ConnectionRid>, ) -> impl Future<Output = Result<BTreeSet<Connection>, Error>>

Gets a set of connections by their RIDs.

Source

fn list_connections( &self, auth_: BearerToken, include_archived: Option<bool>, workspaces: BTreeSet<WorkspaceRid>, ) -> impl Future<Output = Result<BTreeSet<Connection>, Error>>

Lists all connections.

Source

fn list_connections_v2( &self, auth_: BearerToken, include_archived: Option<bool>, workspaces: BTreeSet<WorkspaceRid>, page_size: Option<i32>, next_page_token: Option<Token>, ) -> impl Future<Output = Result<ListConnectionsResponse, Error>>

Lists connections with pagination. Returns connections ordered by creation time descending.

Source

fn list_connections_by_nominal_data_source( &self, auth_: BearerToken, nominal_data_source_rids: BTreeSet<NominalDataSourceRid>, workspaces: BTreeSet<WorkspaceRid>, page_size: Option<i32>, next_page_token: Option<Token>, ) -> impl Future<Output = Result<ListConnectionsResponse, Error>>

Lists connections that reference the specified Nominal data sources, with pagination. Only returns connections within the caller’s organization.

Source

fn archive_connection( &self, auth_: BearerToken, rid: ConnectionRid, ) -> impl Future<Output = Result<(), Error>>

Archives a connection, which simply tags the connection for a client to filter.

Source

fn unarchive_connection( &self, auth_: BearerToken, rid: ConnectionRid, ) -> impl Future<Output = Result<(), Error>>

Undoes the archiving of a connection.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§