asgard.services package

Submodules

asgard.services.accounts module

class asgard.services.accounts.AccountsService[código fonte]

Base: object

static add_user_to_account(user: asgard.models.user.User, account: asgard.models.account.Account, backend: asgard.backends.accounts.AccountsBackend) → None[código fonte]
static get_account_by_id(account_id: int, backend: asgard.backends.accounts.AccountsBackend) → Optional[asgard.models.account.Account][código fonte]
static get_accounts(backend: asgard.backends.accounts.AccountsBackend) → List[asgard.models.account.Account][código fonte]
static get_users_from_account(account: asgard.models.account.Account, backend: asgard.backends.accounts.AccountsBackend) → List[asgard.models.user.User][código fonte]
static remove_user_from_account(user: asgard.models.user.User, account: asgard.models.account.Account, backend: asgard.backends.accounts.AccountsBackend) → None[código fonte]

asgard.services.agents module

class asgard.services.agents.AgentsService[código fonte]

Base: object

get_agent_by_id(agent_id: str, user: asgard.models.user.User, account: asgard.models.account.Account, backend: asgard.backends.base.Orchestrator) → Optional[asgard.models.agent.Agent][código fonte]
get_agents(user: asgard.models.user.User, account: asgard.models.account.Account, backend: asgard.backends.base.Orchestrator) → List[asgard.models.agent.Agent][código fonte]

Lista todos os agentes de cluster asgard. Essa litsa vem do orquestrador que é passado como parametro.

get_apps_running_for_agent(user: asgard.models.user.User, agent: asgard.models.agent.Agent, backend: asgard.backends.base.Orchestrator) → List[asgard.models.app.App][código fonte]

asgard.services.apps module

class asgard.services.apps.AppsService[código fonte]

Base: object

static get_app_stats(app_id: str, interval: asgard.backends.base.Interval, user: asgard.models.user.User, account: asgard.models.account.Account, orchestrator: asgard.backends.base.Orchestrator) → asgard.models.app.AppStats[código fonte]

Retorna estatísticas de uso de CPU/RAM/CPU thr de uma app. O Cálculo considera todas as instâncias dessa app. Retorna um objeto AppStats

asgard.services.users module

class asgard.services.users.UsersService[código fonte]

Base: object

static create_user(user: asgard.models.user.User, backend: asgard.backends.users.UsersBackend) → asgard.models.user.User[código fonte]
static delete_user(user: asgard.models.user.User, backend: asgard.backends.users.UsersBackend) → asgard.models.user.User[código fonte]
static get_accounts_from_user(user: asgard.models.user.User, backend: asgard.backends.users.UsersBackend) → List[asgard.models.account.Account][código fonte]
static get_alternate_accounts(user: asgard.models.user.User, current_account: asgard.models.account.Account, backend: asgard.backends.users.UsersBackend) → List[asgard.models.account.Account][código fonte]
static get_user_by_id(user_id: int, backend: asgard.backends.users.UsersBackend) → Optional[asgard.models.user.User][código fonte]
static get_users(backend: asgard.backends.users.UsersBackend) → List[asgard.models.user.User][código fonte]
static update_user(user: asgard.models.user.User, backend: asgard.backends.users.UsersBackend) → asgard.models.user.User[código fonte]

Module contents