Async model updates
[osm/N2VC.git] / juju / unit.py
1 from . import model
2
3
4 class Unit(model.ModelEntity):
5 def add_storage(self, name, constraints=None):
6 """Add unit storage dynamically.
7
8 :param str name: Storage name, as specified by the charm
9 :param str constraints: Comma-separated list of constraints in the
10 form 'POOL,COUNT,SIZE'
11
12 """
13 pass
14
15 def collect_metrics(self):
16 """Collect metrics on this unit.
17
18 """
19 pass
20
21 def destroy(self):
22 """Destroy this unit.
23
24 """
25 pass
26 remove = destroy
27
28 def get_resources(self, details=False):
29 """Return resources for this unit.
30
31 :param bool details: Include detailed info about resources used by each
32 unit
33
34 """
35 pass
36
37 def resolved(self, retry=False):
38 """Mark unit errors resolved.
39
40 :param bool retry: Re-execute failed hooks
41
42 """
43 pass
44
45 def run(self, command, timeout=None):
46 """Run command on this unit.
47
48 :param str command: The command to run
49 :param int timeout: Time to wait before command is considered failed
50
51 """
52 pass
53
54 def run_action(self, action_name, **params):
55 """Run action on this unit.
56
57 :param str action_name: Name of action to run
58 :param \*\*params: Action parameters
59
60 """
61 pass
62
63 def scp(
64 self, source_path, user=None, destination_path=None, proxy=False,
65 scp_opts=None):
66 """Transfer files to this unit.
67
68 :param str source_path: Path of file(s) to transfer
69 :param str user: Remote username
70 :param str destination_path: Destination of transferred files on
71 remote machine
72 :param bool proxy: Proxy through the Juju API server
73 :param str scp_opts: Additional options to the `scp` command
74
75 """
76 pass
77
78 def set_meter_status(self):
79 """Set the meter status on this unit.
80
81 """
82 pass
83
84 def ssh(
85 self, command, user=None, proxy=False, ssh_opts=None):
86 """Execute a command over SSH on this unit.
87
88 :param str command: Command to execute
89 :param str user: Remote username
90 :param bool proxy: Proxy through the Juju API server
91 :param str ssh_opts: Additional options to the `ssh` command
92
93 """
94 pass
95
96 def status_history(self, num=20, utc=False):
97 """Get status history for this unit.
98
99 :param int num: Size of history backlog
100 :param bool utc: Display time as UTC in RFC3339 format
101
102 """
103 pass