cattle_grid.account.server
cattle_grid.account.server
signin
async
signin(data: SignInData) -> TokenResponse
Allows one to sign in to an account on cattle_grid. The response a token to be included using bearer authentication.
Source code in cattle_grid/account/server/__init__.py
account
create_actor_method
async
create_actor_method(
body: CreateActorRequest, account: CurrentAccount
)
Allows one to create a new actor. The allowed values for base_url can be retrieved using the info endpoint.
Source code in cattle_grid/account/server/account.py
return_account_information
async
return_account_information(
account: CurrentAccount,
method_information: MethodInformation,
) -> InformationResponse
Returns information about the server and the account.
Source code in cattle_grid/account/server/account.py
stream
async
stream(
event_type: EventType,
account: CurrentAccount,
request: Request,
stream_messages=Depends(get_message_streamer),
)
EventSource corresponding to all messages received by the account.
This method returns an EventSource providing server sent events.
Source code in cattle_grid/account/server/account.py
actor
lookup
async
lookup(
body: LookupRequest,
account: CurrentAccount,
broker: Broker,
exchange: InternalExchange,
transformer: Transformer,
) -> dict
Looks up the resource given by uri
as the actor with
actor id actor_id
. Here looking up the actor means that
the request is signed using a private key belonging to that actor.
Source code in cattle_grid/account/server/actor.py
trigger_action
async
trigger_action(
method: str,
body: PerformRequest,
account: CurrentAccount,
broker: Broker,
exchange: ActivityExchange,
)
This method allows one to trigger asynchronous activities through a synchronous request. The basic result is that the data is posted to the ActivityExchange with the routing_key specified.
Source code in cattle_grid/account/server/actor.py
app
Helper class to create documentation for the API
dependencies
responses
CreateActorRequest
Bases: BaseModel
Used to create an actor for the account
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_url
|
str
|
Base url of the actor. The actor URI will be
of the form |
required |
handle
|
str | None
|
If present, an acct-uri of the form |
None
|
name
|
str | None
|
Internal name of the actor. Used to simplify display of the actor. |
None
|