juju.machine¶
Summary
Machine |
Methods: |
Reference
-
class
juju.machine.
Machine
(*args, **kwargs)[source]¶ Bases:
juju.model.ModelEntity
-
agent_status
¶ Returns the current Juju agent status string.
-
agent_status_since
¶ Get the time when the agent_status was last updated.
-
agent_version
¶ Get the version of the Juju machine agent.
May return None if the agent is not yet available.
-
coroutine
destroy
(force=False)[source]¶ Remove this machine from the model.
Blocks until the machine is actually removed.
-
coroutine
remove
(force=False)¶ Remove this machine from the model.
Blocks until the machine is actually removed.
-
run
(command, timeout=None)[source]¶ Run command on this machine.
Parameters: - command (str) – The command to run
- timeout (int) – Time to wait before command is considered failed
-
scp
(source_path, user=None, destination_path=None, proxy=False, scp_opts=None)[source]¶ Transfer files to this machine.
Parameters: - source_path (str) – Path of file(s) to transfer
- user (str) – Remote username
- destination_path (str) – Destination of transferred files on remote machine
- proxy (bool) – Proxy through the Juju API server
- scp_opts (str) – Additional options to the scp command
-
coroutine
set_annotations
(annotations)[source]¶ Set annotations on this machine.
Parameters: map[string]string (annotations) – the annotations as key/value pairs.
-
ssh
(command, user=None, proxy=False, ssh_opts=None)[source]¶ Execute a command over SSH on this machine.
Parameters: - command (str) – Command to execute
- user (str) – Remote username
- proxy (bool) – Proxy through the Juju API server
- ssh_opts (str) – Additional options to the ssh command
-
status
¶ Returns the current machine provisioning status string.
-
status_history
(num=20, utc=False)[source]¶ Get status history for this machine.
Parameters: - num (int) – Size of history backlog
- utc (bool) – Display time as UTC in RFC3339 format
-
status_message
¶ Returns the current machine provisioning status message.
-
status_since
¶ Get the time when the status was last updated.
-