Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def root(self, method, path=None, params=None, data=None):
return self._request(method,
self.url + str(Path(path) if path else ""),
params, data)
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)
def __div__(self, other):
return Path(other, self.stack)
"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):
def __init__(self, s=None, stack=None):
self.stack = (stack or []) + (s.stack if isinstance(s, Path) else [s])