Skip to content

Cluster Client access #263

@fubuloubu

Description

@fubuloubu

Overview

Would be cool if Silverback bots could be given access to their respective Clusters (if running on one)

Specification

  1. Add CLUSTER_API_KEY to .settings.Settings model (Optional, defaulted to None)
  2. Add .cluster -> .cluster.client.ClusterClient | None computed property to .main.SilverbackBot
  3. If CLUSTER_API_KEY is present, return properly-configured from .cluster computed property
  4. Add cluster_access: bool model parameter to .cluster.types.ClusterInfo (defaults False)

Example:

@bot.on_(...)
async def deploy_bot(log):
    if ...:
        bot = bot.cluster.new_bot(...)
        ...

Dependencies

Support needs to be added to the Silverback Cluster code to inject the CLUSTER_API_KEY if .cluster_access is True for a particular bot in the cluster

h/t @johnnyonline

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions