2 def add_storage(self
, name
, constraints
=None):
3 """Add unit storage dynamically.
5 :param str name: Storage name, as specified by the charm
6 :param str constraints: Comma-separated list of constraints in the
12 def collect_metrics(self
):
13 """Collect metrics on this unit.
25 def get_resources(self
, details
=False):
26 """Return resources for this unit.
28 :param bool details: Include detailed info about resources used by each
34 def resolved(self
, retry
=False):
35 """Mark unit errors resolved.
37 :param bool retry: Re-execute failed hooks
42 def run(self
, command
, timeout
=None):
43 """Run command on this unit.
45 :param str command: The command to run
46 :param int timeout: Time to wait before command is considered failed
51 def run_action(self
, action_name
, **params
):
52 """Run action on this unit.
54 :param str action_name: Name of action to run
55 :param \*\*params: Action parameters
61 self
, source_path
, user
=None, destination_path
=None, proxy
=False,
63 """Transfer files to this unit.
65 :param str source_path: Path of file(s) to transfer
66 :param str user: Remote username
67 :param str destination_path: Destination of transferred files on
69 :param bool proxy: Proxy through the Juju API server
70 :param str scp_opts: Additional options to the `scp` command
75 def set_meter_status(self
):
76 """Set the meter status on this unit.
82 self
, command
, user
=None, proxy
=False, ssh_opts
=None):
83 """Execute a command over SSH on this unit.
85 :param str command: Command to execute
86 :param str user: Remote username
87 :param bool proxy: Proxy through the Juju API server
88 :param str ssh_opts: Additional options to the `ssh` command
93 def status_history(self
, num
=20, utc
=False):
94 """Get status history for this unit.
96 :param int num: Size of history backlog
97 :param bool utc: Display time as UTC in RFC3339 format