pub(super) async fn send_event(log: Logger, config: crate::Config, opts: Opts) -> Result<()> {
    let sink = default_sink(&config);
    let event_sender = EventSender::new(
        match opts.source_args.into() {
            Some(source) => source,
            None => Source::Mac(get_mac().context("Failed to find mac address")?),
        },
        opts.sender,
        sink,
    );

    let event_id = event_sender
        .send(Event {
            name: opts.event_name,
            payload: opts.payload,
        })
        .await
        .context("failed to send event")?;

    info!(log, "Event unique identifier: {:?}", event_id);
    Ok(())
}
/// Send an event to the https endpoint configured in the metalctl.toml config file.
/// This subcommand can be used in scripts, systemd unit files and so on.
Send an event to the https endpoint configured in the metalctl.toml config file.
This subcommand can be used in scripts, systemd unit files and so on.
Send an event to the https endpoint configured in the metalctl . toml config file . This subcommand can be used in scripts systemd unit files and so on .
pub(super) async fn send_event(log: Logger, config: crate::Config, opts: Opts) -> Result<()> {
    let sink = default_sink(&config);
    let event_sender = EventSender::new(
        match opts.source_args.into() {
            Some(source) => source,
            None => Source::Mac(get_mac().context("Failed to find mac address")?),
        },
        opts.sender,
        sink,
    );
    let event_id = event_sender
        .send(Event {
            name: opts.event_name,
            payload: opts.payload,
        })
        .await
        .context("failed to send event")?;
    info!(log, "Event unique identifier: {:?}", event_id);
    Ok(())
}
pub ( super ) async fn send_event ( log : Logger , config : crate :: Config , opts : Opts ) -> Result < ( ) > { let sink = default_sink ( & config ) ; let event_sender = EventSender :: new ( match opts . source_args . into ( ) { Some ( source ) => source , None => Source :: Mac ( get_mac ( ) . context ( " " ) ? ) , } , opts . sender , sink , ) ; let event_id = event_sender . send ( Event { name : opts . event_name , payload : opts . payload , } ) . await . context ( " " ) ? ; info ! ( log " " event_id ) ; Ok ( ( ) ) }
Send an event to the https endpoint configured in the metalctl.toml config file.
Send an event to the https endpoint configured in the metalctl . toml config file .
log
Logger
config
crate::Config
opts
Opts
log
Logger
config
crate::Config
opts
Opts