pub trait ConnectionService {
// Required methods
fn create_connection(
&self,
auth_: BearerToken,
create_connection: CreateConnection,
) -> Result<Connection, Error>;
fn update_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
request: UpdateConnectionRequest,
) -> Result<Connection, Error>;
fn update_connection_status(
&self,
auth_: BearerToken,
rid: ConnectionRid,
request: ConnectionStatus,
) -> Result<(), Error>;
fn add_available_tags(
&self,
auth_: BearerToken,
rid: ConnectionRid,
tags: BTreeMap<TagName, BTreeSet<TagValue>>,
) -> Result<Connection, Error>;
fn get_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
) -> Result<Connection, Error>;
fn get_connections(
&self,
auth_: BearerToken,
rids: BTreeSet<ConnectionRid>,
) -> Result<BTreeSet<Connection>, Error>;
fn list_connections(
&self,
auth_: BearerToken,
include_archived: Option<bool>,
workspaces: BTreeSet<WorkspaceRid>,
) -> Result<BTreeSet<Connection>, Error>;
fn archive_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
) -> Result<(), Error>;
fn unarchive_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
) -> 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§
Sourcefn create_connection(
&self,
auth_: BearerToken,
create_connection: CreateConnection,
) -> Result<Connection, Error>
fn create_connection( &self, auth_: BearerToken, create_connection: CreateConnection, ) -> Result<Connection, Error>
Creates a new connection.
Sourcefn update_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
request: UpdateConnectionRequest,
) -> Result<Connection, Error>
fn update_connection( &self, auth_: BearerToken, rid: ConnectionRid, request: UpdateConnectionRequest, ) -> Result<Connection, Error>
Updates an existing connection.
Sourcefn update_connection_status(
&self,
auth_: BearerToken,
rid: ConnectionRid,
request: ConnectionStatus,
) -> Result<(), Error>
fn update_connection_status( &self, auth_: BearerToken, rid: ConnectionRid, request: ConnectionStatus, ) -> Result<(), Error>
Updates an existing connection status.
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.
Sourcefn get_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
) -> Result<Connection, Error>
fn get_connection( &self, auth_: BearerToken, rid: ConnectionRid, ) -> Result<Connection, Error>
Gets a connection by its RID.
Sourcefn get_connections(
&self,
auth_: BearerToken,
rids: BTreeSet<ConnectionRid>,
) -> Result<BTreeSet<Connection>, Error>
fn get_connections( &self, auth_: BearerToken, rids: BTreeSet<ConnectionRid>, ) -> Result<BTreeSet<Connection>, Error>
Gets a set of connections by their RIDs.
Sourcefn list_connections(
&self,
auth_: BearerToken,
include_archived: Option<bool>,
workspaces: BTreeSet<WorkspaceRid>,
) -> Result<BTreeSet<Connection>, Error>
fn list_connections( &self, auth_: BearerToken, include_archived: Option<bool>, workspaces: BTreeSet<WorkspaceRid>, ) -> Result<BTreeSet<Connection>, Error>
Lists all connections.
Sourcefn archive_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
) -> Result<(), Error>
fn archive_connection( &self, auth_: BearerToken, rid: ConnectionRid, ) -> Result<(), Error>
Archives a connection, which simply tags the connection for a client to filter.
Sourcefn unarchive_connection(
&self,
auth_: BearerToken,
rid: ConnectionRid,
) -> Result<(), Error>
fn unarchive_connection( &self, auth_: BearerToken, rid: ConnectionRid, ) -> Result<(), Error>
Undoes the archiving of a connection.