lib.cuckoo.common.abstracts.Machinery

Package lib :: Package cuckoo :: Package common :: Module abstracts :: Class Machinery |
[hide private]
[frames] | no frames]

# Class Machinery

source code

    object --+
             |
            Machinery

Base abstract class for machinery modules.

Instance Methods | [hide private]
__init__(self) x.__init__(...) initializes x; see help(type(x)) for signature | source code
pcap_path(self, task_id) Returns the .pcap path for this task id. | source code
set_options(self, options) Set machine manager options. | source code
initialize(self, module_name) Read, load, and verify machines configuration. | source code
_get_resultserver_port(self) Returns the ResultServer port. | source code
_initialize(self, module_name) Read configuration. | source code
_initialize_check(self) Runs checks against virtualization software when a machine manager is initialized. | source code
machines(self) List virtual machines. | source code
availables(self) How many machines are free. | source code
acquire(self, machine_id=None, platform=None, tags=None) Acquire a machine to start analysis. | source code
release(self, label=None) Release a machine. | source code
running(self) Returns running virtual machines. | source code
shutdown(self) Shutdown the machine manager. | source code
set_status(self, label, status) Set status for a virtual machine. | source code
start(self, label, task) Start a machine. | source code
stop(self, label=None) Stop a machine. | source code
_list(self) Lists virtual machines configured. | source code
dump_memory(self, label, path) Takes a memory dump of a machine. | source code
_wait_status(self, label, state) Waits for a vm status. | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]
| LABEL = `"label"`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self) (Constructor) | source code
x.__init__(...) initializes x; see help(type(x)) for signature Overrides: object.__init__ (inherited documentation)

### set_options(self, options) | source code
Set machine manager options. Parameters: `options` - machine manager options dict.

### initialize(self, module_name) | source code
Read, load, and verify machines configuration. Parameters: `module_name` - module name.

### _initialize(self, module_name) | source code
Read configuration. Parameters: `module_name` - module name.

### _initialize_check(self) | source code
Runs checks against virtualization software when a machine manager is initialized. Raises: `CuckooMachineError` - if a misconfiguration or a unkown vm state is found. Note: in machine manager modules you may override or superclass his method.

### machines(self) | source code
List virtual machines. Returns: virtual machines list

### availables(self) | source code
How many machines are free. Returns: free machines count.

### acquire(self, machine_id=None, platform=None, tags=None) | source code
Acquire a machine to start analysis. Parameters: `machine_id` - machine ID. `platform` - machine platform. `tags` - machine tags Returns: machine or None.

### release(self, label=None) | source code
Release a machine. Parameters: `label` - machine name.

### running(self) | source code
Returns running virtual machines. Returns: running virtual machines list.

### shutdown(self) | source code
Shutdown the machine manager. Kills all alive machines. Raises: `CuckooMachineError` - if unable to stop machine.

### set_status(self, label, status) | source code
Set status for a virtual machine. Parameters: `label` - virtual machine label `status` - new virtual machine status

### start(self, label, task) | source code
Start a machine. Parameters: `label` - machine name. `task` - task object. Raises: `NotImplementedError` - this method is abstract.

### stop(self, label=None) | source code
Stop a machine. Parameters: `label` - machine name. Raises: `NotImplementedError` - this method is abstract.

### _list(self) | source code
Lists virtual machines configured. Raises: `NotImplementedError` - this method is abstract.

### dump_memory(self, label, path) | source code
Takes a memory dump of a machine. Parameters: `path` - path to where to store the memory dump.

### _wait_status(self, label, state) | source code
Waits for a vm status. Parameters: `label` - virtual machine name. `state` - virtual machine status, accepts multiple states as list. Raises: `CuckooMachineError` - if default waiting timeout expire.