FSAdminManager#
- class controller.services.fsadmin.FSAdminManager(*, config, fsadmin_builder, fsadmin_storage, slack_client, logger)#
Bases:
object
Manage filesystem admin environment.
This class is a process-wide singleton that manages the fsadmin environment.
- Parameters:
config (
FSAdminConfig
) – Configuration for fsadmin environment.fsadmin_builder (
FSAdminBuilder
) – Builder that constructs fsadmin Kubernetes objects.fileserver_storage – Kubernetes storage layer for fsadmin.
slack_client (
SlackWebhookClient
|None
) – Optional Slack webhook client for alerts.logger (
BoundLogger
) – Logger to use.fsadmin_storage (
FSAdminStorage
)
Methods Summary
create
()Ensure the fsadmin environment exists.
delete
()Delete the fsadmin environment.
Return the status for the fsadmin container, if it exists and is healthy.
Methods Documentation
- async create()#
Ensure the fsadmin environment exists.
If we don’t have a filesystem admin environment, create it. If we do, just return. This gets called by the handler when someone POSTs to the
/fsadmin/v1/service
ingress.- Returns:
Status for the created pod.
- Return type:
- Raises:
controller.exceptions.ControllerTimeoutError – Raised if the fsadmin environment could not be created within its creation timeout.
InvalidPodPhaseError – Pod is not in
Running
phase.KubernetesError – Raised if there is some failure in a Kubernetes API call.
PodNotFoundError – Pod does not exist.
- async delete()#
Delete the fsadmin environment. This gets called by the handler when someone sends a DELETE to the
/fsadmin/v1/service
ingress.- Raises:
controller.exceptions.ControllerTimeoutError – Raised if the fsadmin environment could not be created within its creation timeout.
KubernetesError – Raised if there is some failure in a Kubernetes API call.
- Return type:
- async get_status()#
Return the status for the fsadmin container, if it exists and is healthy. If it does not exist, or is not ready to accept work, raise an exception.
This gets called by the handler when someone issues a GET against the
/fsadmin/v1/service
ingress.- Raises:
controller.exceptions.ControllerTimeoutError – Raised if the fsadmin environment could not be queried within its query timeout.
InvalidPodPhaseError – Pod is not in
Running
phase.KubernetesError – Raised if there is some failure in a Kubernetes API call.
PodNotFoundError – Pod does not exist.
- Return type: