How to use the scs.client.Path function in scs

To help you get started, we’ve selected a few scs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github celery / cyme / scs / client.py View on Github external
def root(self, method, path=None, params=None, data=None):
        return self._request(method,
                             self.url + str(Path(path) if path else ""),
                             params, data)
github celery / cyme / scs / client.py View on Github external
def __init__(self, client):
        self.client = client
        if self.name is None:
            self.name = self.__class__.__name__.lower()
        if self.path is None:
            self.path = Path(self.name)
github celery / cyme / scs / client.py View on Github external
def __div__(self, other):
        return Path(other, self.stack)
github celery / cyme / scs / client.py View on Github external
"routing_key": routing_key,
                              "options": options})

    def stats(self, name):
        return self.GET(self.path / name / "stats")

    def autoscale(self, name, max=None, min=None):
        return self.POST(self.path / name / "autoscale",
                         params={"max": max, "min": min})

    def __repr__(self):
        return repr(self.all())


class Consumers(Section):
    path = Path("instances")

    def add(self, instance, queue):
        return self.PUT(self.path / instance / "queues" / queue)

    def remove(self, instance, queue):
        return self.PUT(self.path / instance / "queues" / queue)


class Client(Base):
    Consumers = Consumers
    Instances = Instances
    Queues = Queues

    app = "scs"

    def __init__(self, url=None, app=None, info=None):
github celery / cyme / scs / client.py View on Github external
def __init__(self, s=None, stack=None):
        self.stack = (stack or []) + (s.stack if isinstance(s, Path) else [s])