[][src]Enum holochain_conductor_api::AdminRequest

pub enum AdminRequest {
    AddAdminInterfaces(Vec<AdminInterfaceConfig>),
    RegisterDna(Box<RegisterDnaPayload>),
    InstallApp(Box<InstallAppPayload>),
    ListDnas,
    GenerateAgentPubKey,
    ListCellIds,
    ListActiveApps,
    ActivateApp {
        installed_app_id: InstalledAppId,
    },
    DeactivateApp {
        installed_app_id: InstalledAppId,
    },
    AttachAppInterface {
        port: Option<u16>,
    },
    DumpState {
        cell_id: Box<CellId>,
    },
    AddAgentInfo {
        agent_infos: Vec<AgentInfoSigned>,
    },
    RequestAgentInfo {
        cell_id: Option<CellId>,
    },
}

Represents the available conductor functions to call over an Admin interface and will result in a corresponding AdminResponse message being sent back over the interface connection. Enum variants follow a general convention of verb_noun as opposed to the noun_verb of AdminResponse.

Expects a serialized object with any contents of the enum on a key data and the enum variant on a key type, e.g. { type: 'activate_app', data: { installed_app_id: 'test_app' } }

Variants

AddAdminInterfaces(Vec<AdminInterfaceConfig>)

Set up and register one or more new Admin interfaces as specified by a list of configurations. See AdminInterfaceConfig for details on the configuration.

Will be responded to with an AdminResponse::AdminInterfacesAdded or an AdminResponse::Error

RegisterDna(Box<RegisterDnaPayload>)

Register a DNA for later use in InstallApp Stores the given DNA into the holochain dnas database and returns the hash of the DNA Will be responded to with an AdminResponse::DnaRegistered or an AdminResponse::Error

InstallApp(Box<InstallAppPayload>)

Install an app from a list of Dna paths. Triggers genesis to be run on all Cells and to be stored. An App is intended for use by one and only one Agent and for that reason it takes an AgentPubKey and installs all the Dnas with that AgentPubKey forming new Cells. See InstallAppPayload for full details on the configuration.

Note that the new App will not be "activated" automatically after installation and can be activated by calling AdminRequest::ActivateApp.

Will be responded to with an AdminResponse::AppInstalled or an AdminResponse::Error

ListDnas

List the hashes of all installed Dnas. Takes no arguments.

Will be responded to with an AdminResponse::DnasListed or an AdminResponse::Error

GenerateAgentPubKey

Generate a new AgentPubKey. Takes no arguments.

Will be responded to with an AdminResponse::AgentPubKeyGenerated or an AdminResponse::Error

ListCellIds

List all the cell ids in the conductor. Takes no arguments.

Will be responded to with an AdminResponse::CellIdsListed or an AdminResponse::Error

ListActiveApps

List the ids of all the active (activated) Apps in the conductor. Takes no arguments.

Will be responded to with an AdminResponse::ActiveAppsListed or an AdminResponse::Error

ActivateApp

Changes the App specified by argument installed_app_id from an inactive state to an active state in the conductor, meaning that Zome calls can now be made and the App will be loaded on a reboot of the conductor. It is likely to want to call this after calling AdminRequest::InstallApp, since a freshly installed App is not activated automatically.

Will be responded to with an AdminResponse::AppActivated or an AdminResponse::Error

Fields of ActivateApp

installed_app_id: InstalledAppId

The InstalledAppId to activate

DeactivateApp

Changes the App specified by argument installed_app_id from an active state to an inactive state in the conductor, meaning that Zome calls can no longer be made, and the App will not be loaded on a reboot of the conductor.

Will be responded to with an AdminResponse::AppDeactivated or an AdminResponse::Error

Fields of DeactivateApp

installed_app_id: InstalledAppId

The InstalledAppId to deactivate

AttachAppInterface

Open up a new websocket interface at the networking port (optionally) specified by argument port (or using any free port if argument port is None) over which you can then use the [AppRequest] API. Any active App will be callable via this interface. The successful AdminResponse::AppInterfaceAttached message will contain the port chosen by the conductor if None was passed.

Will be responded to with an AdminResponse::AppInterfaceAttached or an AdminResponse::Error

Fields of AttachAppInterface

port: Option<u16>

Optional port, use None to let the OS choose a free port

DumpState

Dump the full state of the Cell specified by argument cell_id, including its chain, as a string containing JSON.

Will be responded to with an AdminResponse::StateDumped or an AdminResponse::Error

Fields of DumpState

cell_id: Box<CellId>

The CellId for which to dump state

AddAgentInfo

Add a list AgentInfoSigned to this conductor's peer store. This is another way of finding peers on a dht.

This can be useful for testing.

It is also helpful if you know other agents on the network and they can send you their agent info.

Fields of AddAgentInfo

agent_infos: Vec<AgentInfoSigned>

Vec of signed agent info to add to peer store

RequestAgentInfo

Request the AgentInfoSigned stored in this conductor's peer store.

You can:

This is how you can send your agent info to another agent. It is also useful for testing across networks.

Fields of RequestAgentInfo

cell_id: Option<CellId>

Optionally choose a specific agent info

Trait Implementations

impl Debug for AdminRequest[src]

impl<'de> Deserialize<'de> for AdminRequest[src]

impl Serialize for AdminRequest[src]

impl<'_> TryFrom<&'_ AdminRequest> for SerializedBytes[src]

type Error = SerializedBytesError

The type returned in the event of a conversion error.

impl TryFrom<AdminRequest> for SerializedBytes[src]

type Error = SerializedBytesError

The type returned in the event of a conversion error.

impl TryFrom<SerializedBytes> for AdminRequest[src]

type Error = SerializedBytesError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl !RefUnwindSafe for AdminRequest

impl Send for AdminRequest

impl Sync for AdminRequest

impl Unpin for AdminRequest

impl !UnwindSafe for AdminRequest

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> FutureExt for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> WithSubscriber for T[src]