[−][src]Struct fluvio::FluvioAdmin
An interface for managing a Fluvio cluster
Most applications will not require administrator functionality. The
FluvioAdmin
interface is used to create, edit, and manage Topics
and other operational items. Think of the difference between regular
clients of a Database and its administrators. Regular clients may be
applications which are reading and writing data to and from tables
that exist in the database. Database administrators would be the
ones actually creating, editing, or deleting tables. The same thing
goes for Fluvio administrators.
If you are writing an application whose purpose is to manage a
Fluvio cluster for you, you can gain access to the FluvioAdmin
client via the regular Fluvio
client, or through the connect
or connect_with_config
functions.
Example
Note that this may fail if you are not authorized as a Fluvio administrator for the cluster you are connected to.
let admin = fluvio.admin().await;
Implementations
impl FluvioAdmin
[src]
pub async fn connect() -> Result<Self, FluvioError>
[src]
Creates a new admin connection using the current profile from ~/.fluvio/config
This will attempt to read a Fluvio cluster configuration from
your ~/.fluvio/config
file, or create one with default settings
if you don't have one. If you want to specify a configuration,
see connect_with_config
instead.
The admin interface requires you to have administrator privileges on the cluster which you are connecting to. If you don't have the appropriate privileges, this connection will fail.
Example
let admin = FluvioAdmin::connect().await?;
pub async fn connect_with_config<'_>(
config: &'_ FluvioConfig
) -> Result<Self, FluvioError>
[src]
config: &'_ FluvioConfig
) -> Result<Self, FluvioError>
Creates a new admin connection using custom configurations
The admin interface requires you to have administrator privileges on the cluster which you are connecting to. If you don't have the appropriate privileges, this connection will fail.
Example
use fluvio::config::ConfigFile; let config_file = ConfigFile::load_default_or_new()?; let fluvio_config = config_file.config().current_cluster().unwrap(); let admin = FluvioAdmin::connect_with_config(fluvio_config).await?;
pub async fn create<S, '_>(
&'_ mut self,
name: String,
dry_run: bool,
spec: S
) -> Result<(), FluvioError> where
S: Into<AllCreatableSpec>,
[src]
&'_ mut self,
name: String,
dry_run: bool,
spec: S
) -> Result<(), FluvioError> where
S: Into<AllCreatableSpec>,
create new object
pub async fn delete<S, K, '_>(&'_ mut self, key: K) -> Result<(), FluvioError> where
S: DeleteSpec,
K: Into<S::DeleteKey>,
[src]
S: DeleteSpec,
K: Into<S::DeleteKey>,
delete object by key key is depend on spec, most are string but some allow multiple types
pub async fn list<S, F, '_>(
&'_ mut self,
filters: F
) -> Result<Vec<Metadata<S>>, FluvioError> where
S: ListSpec + Encoder + Decoder,
S::Status: Encoder + Decoder,
F: Into<Vec<S::Filter>>,
ListResponse: TryInto<Vec<Metadata<S>>>,
<ListResponse as TryInto<Vec<Metadata<S>>>>::Error: Display,
[src]
&'_ mut self,
filters: F
) -> Result<Vec<Metadata<S>>, FluvioError> where
S: ListSpec + Encoder + Decoder,
S::Status: Encoder + Decoder,
F: Into<Vec<S::Filter>>,
ListResponse: TryInto<Vec<Metadata<S>>>,
<ListResponse as TryInto<Vec<Metadata<S>>>>::Error: Display,
Auto Trait Implementations
impl !RefUnwindSafe for FluvioAdmin
impl Send for FluvioAdmin
impl Sync for FluvioAdmin
impl Unpin for FluvioAdmin
impl !UnwindSafe for FluvioAdmin
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,