wcraas_control package

Submodules

wcraas_control.cli module

Console script for wcraas_control.

wcraas_control.config module

class wcraas_control.config.Config[source]

Bases: wcraas_control.config.Config

classmethod fromenv()[source]

Create a wcraas_control.Config from Environment Variables.

>>> conf = Config.fromenv()
>>> type(conf)
<class 'config.Config'>
>>> conf._fields
('amqp', 'redis', 'interval', 'loglevel')
>>> conf.amqp
AMQPConfig(host='localhost', port=5672, user='guest', password='guest')
>>> conf.redis
RedisConfig(host='localhost', port=6379)
>>> conf.interval
10
>>> conf.loglevel
20
class wcraas_control.config.RedisConfig[source]

Bases: wcraas_control.config.RedisConfig

classmethod fromenv()[source]

Create a wcraas_control.RedisConfig from Environment Variables.

>>> conf = RedisConfig.fromenv()
>>> type(conf)
<class 'config.RedisConfig'>
>>> conf._fields
('host', 'port')
>>> conf.host
'localhost'
>>> conf.port
6379

wcraas_control.wcraas_control module

The WCraaS Control module is responsible for the orchestration of tasks in the platform.

class wcraas_control.wcraas_control.RedisLockState[source]

Bases: enum.IntEnum

An enumeration.

DONE = 2
FAIL = 3
FREE = 0
LOCK = 1
class wcraas_control.wcraas_control.ControlWorker(amqp: wcraas_common.config.AMQPConfig, redis: wcraas_control.config.RedisConfig, interval: int, loglevel: int, *args, **kwargs)[source]

Bases: wcraas_common.wcraas_common.WcraasWorker

Control Worker for the WCraaS platfrom, responsible for the orchestration of tasks.

>>> from wcraas_control.config import Config
>>> cn = ControlWorker(*Config.fromenv())
crawl(url: str)[source]

Given URL orchestrate crawling of the target.

Parameters:url (string) – Entrypoint URL for crawling the target.
list_collections()[source]

List the collections available at the storage node.

start()[source]

Asynchronous runtime for the worker, responsible of managing and maintaining async context open.

Module contents

Top-level package for wcraas_control.