Skip to main content

Servers

Struct Servers 

Source
pub struct Servers {
    pub runs: Runs,
    /* private fields */
}
Expand description

The control plane’s servers: their records, placement, CA, health, and the threads that watch them.

Fields§

§runs: Runs

Servers being added, and recently added or failed.

Implementations§

Source§

impl Servers

Source

pub fn upgrade( &self, client: &Client, name: &str, source: &Source, ) -> Result<Value>

Upgrade one server’s agent to source’s build and wait until it answers with it; the helper on the box rolls back otherwise.

Source§

impl Servers

Source

pub fn open(state_dir: &Path) -> Result<Arc<Servers>>

<state>/servers/: the CA under pki/, the records, the placement.

Source

pub fn record(&self, name: &str) -> Result<ServerRecord>

Source

pub fn records(&self) -> Vec<ServerRecord>

Source

pub fn client(&self, name: &str) -> Result<AgentClient>

Source

pub fn placement(&self, org: &OrgId) -> Option<String>

The server org is placed on; None is this daemon.

Source

pub fn placements(&self) -> BTreeMap<OrgId, String>

Source

pub fn orgs_on(&self, server: &str) -> Vec<OrgId>

Source

pub fn health(&self, name: &str) -> Health

Source

pub fn view(&self, r: &ServerRecord) -> Value

A server as server_list and server_show answer it.

Source

pub fn check_protocol(&self, server: &str, need: u64) -> Result<()>

Refuse to forward to server when its agent speaks a protocol this control plane cannot (need: the oldest that will do).

Source

pub fn place(&self, org: &OrgId, server: Option<&str>) -> Result<()>

Place org on server (the agent is told first, so it accepts calls for it), or take it off (None).

Source

pub fn call( &self, server: &str, tool: &str, args: &Value, caller: &Caller, org: Option<&OrgId>, request_id: Option<&str>, ) -> Result<Value>

Forward a tool call for org (or an unscoped cross-org read) to server as caller.

Source

pub fn check_add(&self, o: &AddOptions) -> Result<String>

What add would refuse before it starts: a bad name, target or address, or a server of that name already.

Source

pub fn add( self: &Arc<Self>, o: &AddOptions, ctl: Option<&Controller>, p: &Provision, ) -> Result<ServerRecord>

Bootstrap a new server over SSH and record it, reporting to p.

Source

pub fn add_vm( self: &Arc<Self>, client: &Client, org: &OrgId, size: &VmSize, ctl: Option<&Controller>, p: &Provision, ) -> Result<ServerRecord>

Make a dedicated VM for org on this host and record it as server vm-<org> (docs/guides/servers.md#dedicated-vms). Idempotent: a VM or a record left by an earlier attempt is reused.

Source

pub fn remove(&self, name: &str) -> Result<ServerRecord>

Forget a server. Refused while orgs are placed on it; the agent itself keeps running until it is stopped on the box.

Source

pub fn rotate_cert(&self, name: &str) -> Result<ServerRecord>

Issue the agent a new certificate over the current mTLS connection and check it answers with it.

Source

pub fn start(self: &Arc<Self>, ctl: Controller)

Heartbeats for every server, and a mirror of each one’s events into ctl’s feed.

Source

pub fn shutdown(&self)

Trait Implementations§

Source§

impl Debug for Servers

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V