pub struct AuditEvent {Show 17 fields
pub schema_version: u32,
pub event_id: String,
pub timestamp: String,
pub kind: EventKind,
pub action: String,
pub summary: String,
pub actor: Actor,
pub client: Client,
pub site: Option<String>,
pub request: Request,
pub outcome: Outcome,
pub dry_run: Option<bool>,
pub targets: BTreeMap<String, Vec<String>>,
pub nodes: Vec<String>,
pub produced: BTreeMap<String, String>,
pub details: Map<String, Value>,
pub emitter: Emitter,
}Expand description
One audit record. See the module docs for the stability contract.
Fields§
§schema_version: u32Always SCHEMA_VERSION.
event_id: StringRandom v4 UUID; also the Kafka message key.
timestamp: StringRFC 3339 UTC timestamp (millisecond precision) of emission.
kind: EventKindWhat kind of activity this is.
action: StringStable operation name chosen by the handler, e.g.
group.delete; "<METHOD> <route>" when the handler did not
name it (e.g. the request was rejected before the handler ran).
summary: StringOne human-readable line saying who did what, where, and how it
ended — see AuditEvent::describe. Derived from the other
fields when the event is emitted; for reading, not for parsing.
actor: ActorWho did it.
client: ClientFrom where.
site: Option<String>Target site (X-Manta-Site), when supplied.
request: RequestThe request as received.
outcome: OutcomeHow it ended.
dry_run: Option<bool>true when the caller asked for a dry run (nothing changed),
false for a real run of an operation that has a dry-run mode;
absent when the operation has none or the handler never ran.
targets: BTreeMap<String, Vec<String>>Objects the operation acts on, keyed by object kind (group,
node, hosts, image, …). Values are as the caller supplied
them (a hosts expression is not expanded; see Self::nodes),
except where the caller selected by pattern: configuration.delete
records the configurations, sessions, templates and images it
matched.
nodes: Vec<String>Concrete node xnames the server resolved the request to, when it expanded a hosts expression or a group itself (power, boot, kernel parameters, runtime configuration, migrate). Power, boot and kernel parameters record it before the operation runs, so it is present on dry runs and failures too; runtime configuration and migrate resolve and apply in one service call, so there it is recorded only once that call succeeds.
produced: BTreeMap<String, String>What the operation created or started, by kind (transition,
session, configuration, image, hostname) — the ids to
look the operation up by in the backend. Only on success, never
on a dry run.
details: Map<String, Value>Further operation parameters a handler chose to record (e.g.
force, the power action, the kernel parameters).
emitter: EmitterWhich server emitted it.
Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn describe(&self) -> String
pub fn describe(&self) -> String
One line for humans, built from the structured fields:
rjanalik @ alps: power off nid001288 (1 node, force) → success, transition 4c1e…
alice @ alps: image delete a b (dry run) → success
anonymous: DELETE /v2/groups/zinal → denied (401)Control characters are escaped (\n → \\n): the line is
logged as plain text and its values are caller-controlled.
Every route gets one with no per-handler code: the verb is the
handler’s action with its separators turned into spaces, or
method and path when no handler named it.
Trait Implementations§
Source§impl Clone for AuditEvent
impl Clone for AuditEvent
Source§fn clone(&self) -> AuditEvent
fn clone(&self) -> AuditEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AuditEvent
impl Debug for AuditEvent
Source§impl PartialEq for AuditEvent
impl PartialEq for AuditEvent
Source§impl Serialize for AuditEvent
impl Serialize for AuditEvent
impl StructuralPartialEq for AuditEvent
Auto Trait Implementations§
impl Freeze for AuditEvent
impl RefUnwindSafe for AuditEvent
impl Send for AuditEvent
impl Sync for AuditEvent
impl Unpin for AuditEvent
impl UnsafeUnpin for AuditEvent
impl UnwindSafe for AuditEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more