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
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
GetDnaDefinition(Box<DnaHash>)
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
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
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
Fields
installed_app_id: InstalledAppId
The app ID to uninstall
ListDnas
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
ListCellIds
List the IDs of all live cells currently running in the conductor.
§Returns
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
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
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
Fields
installed_app_id: InstalledAppId
The app ID to disable
AttachAppInterface
Open up a new websocket for processing AppRequest
s. 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
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 AppRequest
s.
DumpState
Dump the state of the cell specified by argument cell_id
,
including its chain, as a string containing JSON.
§Returns
DumpConductorState
Dump the state of the conductor, including the in-memory representation and the persisted ConductorState, as JSON.
§Returns
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
Fields
DumpNetworkMetrics
Fields
DumpNetworkStats
Dump network statistics from the Kitsune2 networking transport module.
§Returns
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
AgentInfo
Request the kitsune2_api::AgentInfoSigned
stored in this conductor’s
peer store.
You can:
- Get all agent info by leaving
cell_id
toNone
. - 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
GraftRecords
“Graft” Record
s 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
Fields
GrantZomeCallCapability(Box<GrantZomeCallCapabilityPayload>)
ListCapabilityGrants
Request capability grant info for all cells in the app.
§Returns
DeleteCloneCell(Box<DeleteCloneCellPayload>)
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
RevokeAppAuthenticationToken(AppAuthenticationToken)
Trait Implementations§
Source§impl Debug for AdminRequest
impl Debug for AdminRequest
Source§impl<'de> Deserialize<'de> for AdminRequest
impl<'de> Deserialize<'de> for AdminRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for AdminRequest
impl Serialize for AdminRequest
Source§impl TryFrom<&AdminRequest> for SerializedBytes
impl TryFrom<&AdminRequest> for SerializedBytes
Source§type Error = SerializedBytesError
type Error = SerializedBytesError
Source§fn try_from(t: &AdminRequest) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &AdminRequest) -> Result<SerializedBytes, SerializedBytesError>
Source§impl TryFrom<AdminRequest> for SerializedBytes
impl TryFrom<AdminRequest> for SerializedBytes
Source§type Error = SerializedBytesError
type Error = SerializedBytesError
Source§fn try_from(t: AdminRequest) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: AdminRequest) -> Result<SerializedBytes, SerializedBytesError>
Source§impl TryFrom<SerializedBytes> for AdminRequest
impl TryFrom<SerializedBytes> for AdminRequest
Source§type Error = SerializedBytesError
type Error = SerializedBytesError
Source§fn try_from(sb: SerializedBytes) -> Result<AdminRequest, SerializedBytesError>
fn try_from(sb: SerializedBytes) -> Result<AdminRequest, SerializedBytesError>
Auto Trait Implementations§
impl Freeze for AdminRequest
impl RefUnwindSafe for AdminRequest
impl Send for AdminRequest
impl Sync for AdminRequest
impl Unpin for AdminRequest
impl UnwindSafe for AdminRequest
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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