Enum AdminRequest

Source
pub enum AdminRequest {
Show 29 variants AddAdminInterfaces(Vec<AdminInterfaceConfig>), RegisterDna(Box<RegisterDnaPayload>), GetDnaDefinition(Box<DnaHash>), UpdateCoordinators(Box<UpdateCoordinatorsPayload>), InstallApp(Box<InstallAppPayload>), UninstallApp { installed_app_id: InstalledAppId, force: bool, }, ListDnas, GenerateAgentPubKey, RevokeAgentKey(Box<RevokeAgentKeyPayload>), ListCellIds, ListApps { status_filter: Option<AppStatusFilter>, }, EnableApp { installed_app_id: InstalledAppId, }, DisableApp { installed_app_id: InstalledAppId, }, AttachAppInterface { port: Option<u16>, allowed_origins: AllowedOrigins, installed_app_id: Option<InstalledAppId>, }, ListAppInterfaces, DumpState { cell_id: Box<CellId>, }, DumpConductorState, DumpFullState { cell_id: Box<CellId>, dht_ops_cursor: Option<u64>, }, DumpNetworkMetrics { dna_hash: Option<DnaHash>, include_dht_summary: bool, }, DumpNetworkStats, AddAgentInfo { agent_infos: Vec<String>, }, AgentInfo { cell_id: Option<CellId>, }, GraftRecords { cell_id: CellId, validate: bool, records: Vec<Record>, }, GrantZomeCallCapability(Box<GrantZomeCallCapabilityPayload>), ListCapabilityGrants { installed_app_id: String, include_revoked: bool, }, DeleteCloneCell(Box<DeleteCloneCellPayload>), StorageInfo, IssueAppAuthenticationToken(IssueAppAuthenticationTokenPayload), RevokeAppAuthenticationToken(AppAuthenticationToken),
}
Expand description

Represents the available conductor functions to call over an admin interface.

Enum variants follow a general convention of verb_noun as opposed to the noun_verb of responses.

§Errors

Returns an AdminResponse::Error with a reason why the request failed.

Variants§

§

AddAdminInterfaces(Vec<AdminInterfaceConfig>)

Set up and register one or more new admin interfaces as specified by a list of configurations.

§Returns

AdminResponse::AdminInterfacesAdded

§

RegisterDna(Box<RegisterDnaPayload>)

Register a DNA for later app installation.

Stores the given DNA into the Holochain DNA database and returns the hash of it.

§Returns

AdminResponse::DnaRegistered

§

GetDnaDefinition(Box<DnaHash>)

Get the definition of a DNA.

§Returns

AdminResponse::DnaDefinitionReturned

§

UpdateCoordinators(Box<UpdateCoordinatorsPayload>)

Update coordinator zomes for an already installed DNA.

Replaces any installed coordinator zomes with the same zome name. If the zome name doesn’t exist then the coordinator zome is appended to the current list of coordinator zomes.

§Returns

AdminResponse::CoordinatorsUpdated

§

InstallApp(Box<InstallAppPayload>)

Install an app using an AppBundle.

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 enabled automatically after installation and can be enabled by calling EnableApp.

§Returns

AdminResponse::AppInstalled

§

UninstallApp

Uninstalls the app specified by argument installed_app_id from the conductor.

The app will be removed from the list of installed apps, and any cells which were referenced only by this app will be disabled and removed, clearing up any persisted data. Cells which are still referenced by other installed apps will not be removed.

§Returns

AdminResponse::AppUninstalled

Fields

§installed_app_id: InstalledAppId

The app ID to uninstall

§force: bool

If anything would prevent this app from being uninstalled, such as the existence of protected dependency to one of its cells, this flag will force the uninstallation. This will generally lead to bad outcomes, and should not be used unless you’re aware of the consequences.

§

ListDnas

List the hashes of all installed DNAs.

§Returns

AdminResponse::DnasListed

§

GenerateAgentPubKey

§

RevokeAgentKey(Box<RevokeAgentKeyPayload>)

Revoke an agent key for an app.

When an agent key is revoked, it becomes invalid and can no longer be used to author actions for that app. The key is revoked in the Deepkey service if installed and deleted on the source chains of all cells of the app, making them read-only. Cloning a cell of this app will fail.

If the key could not be deleted from all cells, this call can be re-attempted to delete the key from the remaining cells.

§Returns

AdminResponse::AgentKeyRevoked

§

ListCellIds

List the IDs of all live cells currently running in the conductor.

§Returns

AdminResponse::CellIdsListed

§

ListApps

List the apps and their information that are installed in the conductor.

Results are sorted by the installed_at timestamp of the app, in descending order.

If status_filter is Some(_), it will return only the apps with the specified status.

§Returns

AdminResponse::AppsListed

Fields

§status_filter: Option<AppStatusFilter>

An optional status to filter the list of apps by

§

EnableApp

Changes the specified app from a disabled to an enabled state in the conductor.

It is likely to want to call this after calling AdminRequest::InstallApp, since a freshly installed app is not enabled automatically. Once the app is enabled, zomes can be immediately called and it will also be loaded and enabled automatically on any reboot of the conductor.

§Returns

AdminResponse::AppEnabled

Fields

§installed_app_id: InstalledAppId

The app ID to enable

§

DisableApp

Changes the specified app from an enabled to a disabled state in the conductor.

When an app is disabled, zome calls can no longer be made, and the app will not be loaded on a reboot of the conductor.

§Returns

AdminResponse::AppDisabled

Fields

§installed_app_id: InstalledAppId

The app ID to disable

§

AttachAppInterface

Open up a new websocket for processing AppRequests. Any active app will be callable via the attached app interface.

NB: App interfaces are persisted when shutting down the conductor and are restored when restarting the conductor. Unused app interfaces are not cleaned up. It is therefore recommended to reuse existing interfaces. They can be queried with the call AdminRequest::ListAppInterfaces.

§Returns

AdminResponse::AppInterfaceAttached

§Arguments

Optionally a port parameter can be passed to this request. If it is None, a free port is chosen by the conductor.

An allowed_origins parameter to control which origins are allowed to connect to the app interface.

Fields

§port: Option<u16>

Optional port number

§allowed_origins: AllowedOrigins

Allowed origins for this app interface.

This should be one of:

  • A comma separated list of origins - http://localhost:3000,http://localhost:3001,
  • A single origin - http://localhost:3000,
  • Any origin - *

Connections from any origin which is not permitted by this config will be rejected.

§installed_app_id: Option<InstalledAppId>

Optionally bind this app interface to a specific installed app.

If this is None then the interface can be used to establish a connection for any app.

If this is Some then the interface will only accept connections for the specified app. Those connections will only be able to make calls to and receive signals from that app.

§

ListAppInterfaces

List all the app interfaces currently attached with AttachAppInterface.

§Returns

AdminResponse::AppInterfacesListed, a list of websocket ports that can process AppRequests.

§

DumpState

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

§Returns

AdminResponse::StateDumped

Fields

§cell_id: Box<CellId>

The cell ID for which to dump state

§

DumpConductorState

Dump the state of the conductor, including the in-memory representation and the persisted ConductorState, as JSON.

§Returns

AdminResponse::ConductorStateDumped

§

DumpFullState

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

Warning: this API call is subject to change, and will not be available to hApps. This is meant to be used by introspection tooling.

Note that the response to this call can be very big, as it’s requesting for the full database of the cell.

Also note that while DHT ops about private entries will be returned (like StoreRecord), the entry in itself will be missing, as it’s not actually stored publicly in the DHT shard.

§Returns

AdminResponse::FullStateDumped

Fields

§cell_id: Box<CellId>

The cell ID for which to dump the state

§dht_ops_cursor: Option<u64>

The last seen DhtOp RowId, returned in the full dump state. Only DhtOps with RowId greater than the cursor will be returned.

§

DumpNetworkMetrics

Dump the network metrics tracked by kitsune.

§Returns

AdminResponse::NetworkMetricsDumped

Fields

§dna_hash: Option<DnaHash>

If set, limits the metrics dumped to a single DNA hash space.

§include_dht_summary: bool

Whether to include a DHT summary.

You need a dump from multiple nodes in order to make a comparison, so this is not requested by default.

§

DumpNetworkStats

Dump network statistics from the Kitsune2 networking transport module.

§Returns

AdminResponse::NetworkStatsDumped

§

AddAgentInfo

Add a list of agents to this conductor’s peer store.

This is a way of shortcutting peer discovery and is useful for testing.

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

§Returns

AdminResponse::AgentInfoAdded

Fields

§agent_infos: Vec<String>

list of signed agent info to add to peer store

§

AgentInfo

Request the kitsune2_api::AgentInfoSigned stored in this conductor’s peer store.

You can:

  • Get all agent info by leaving cell_id to None.
  • Get a specific agent info by setting the cell_id.

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

§Returns

AdminResponse::AgentInfo

Fields

§cell_id: Option<CellId>

Optionally choose the agent info of a specific cell.

§

GraftRecords

“Graft” Records onto the source chain of the specified CellId.

The records must form a valid chain segment (ascending sequence numbers, and valid prev_action references). If the first record contains a prev_action which matches the existing records, then the new records will be “grafted” onto the existing chain at that point, and any other records following that point which do not match the new records will be removed.

If this operation is called when there are no forks, the final state will also have no forks.

BEWARE that this may result in the deletion of data! Any existing records which form a fork with respect to the new records will be deleted.

All records must be authored and signed by the same agent. The DnaFile (but not necessarily the cell) must already be installed on this conductor.

Care is needed when using this command as it can result in an invalid chain. Additionally, if conflicting source chain records are inserted on different nodes, then the chain will be forked.

If an invalid or forked chain is inserted and then pushed to the DHT, it can’t be undone.

Note that the cell does not need to exist to run this command. It is possible to insert records into a source chain before the cell is created. This can be used to restore from backup.

If the cell is installed, it is best to call AdminRequest::DisableApp before running this command, as otherwise the chain head may move. If truncate is true, the chain head is not checked and any new records will be lost.

§Returns

AdminResponse::RecordsGrafted

Fields

§cell_id: CellId

The cell that the records are being inserted into.

§validate: bool

If this is true, then the records will be validated before insertion. This is much slower but is useful for verifying the chain is valid.

If this is false, then records will be inserted as is. This could lead to an invalid chain.

§records: Vec<Record>

The records to be inserted into the source chain.

§

GrantZomeCallCapability(Box<GrantZomeCallCapabilityPayload>)

Request capability grant for making zome calls.

§Returns

AdminResponse::ZomeCallCapabilityGranted

§

ListCapabilityGrants

Request capability grant info for all cells in the app.

§Returns

AdminResponse::CapabilityGrantsInfo

Fields

§installed_app_id: String
§include_revoked: bool
§

DeleteCloneCell(Box<DeleteCloneCellPayload>)

Delete a clone cell that was previously disabled.

§Returns

AdminResponse::CloneCellDeleted

§

StorageInfo

Info about storage used by apps

§Returns

AdminResponse::StorageInfo

§

IssueAppAuthenticationToken(IssueAppAuthenticationTokenPayload)

Connecting to an app over an app websocket requires an authentication token. This endpoint is used to issue those tokens for use by app clients.

§Returns

AdminResponse::AppAuthenticationTokenIssued

§

RevokeAppAuthenticationToken(AppAuthenticationToken)

Revoke an issued app authentication token.

§Returns

AdminResponse::AppAuthenticationTokenRevoked

Trait Implementations§

Source§

impl Debug for AdminRequest

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AdminRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for AdminRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<&AdminRequest> for SerializedBytes

Source§

type Error = SerializedBytesError

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

fn try_from(t: &AdminRequest) -> Result<SerializedBytes, SerializedBytesError>

Performs the conversion.
Source§

impl TryFrom<AdminRequest> for SerializedBytes

Source§

type Error = SerializedBytesError

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

fn try_from(t: AdminRequest) -> Result<SerializedBytes, SerializedBytesError>

Performs the conversion.
Source§

impl TryFrom<SerializedBytes> for AdminRequest

Source§

type Error = SerializedBytesError

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

fn try_from(sb: SerializedBytes) -> Result<AdminRequest, SerializedBytesError>

Performs the conversion.

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,