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.

dns_name

Get the DNS name for this machine. This is a best guess based on the addresses available in current data.

May return None if no suitable address is found.

coroutine get_annotations()[source]

Get annotations on this machine.

Return dict:The annotations for this application
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
coroutine scp_from(source, destination, user='ubuntu', proxy=False, scp_opts='')[source]

Transfer files from this machine.

Parameters:
  • source (str) – Remote path of file(s) to transfer
  • destination (str) – Local destination of transferred files
  • user (str) – Remote username
  • proxy (bool) – Proxy through the Juju API server
  • scp_opts (str or list) – Additional options to the scp command
coroutine scp_to(source, destination, user='ubuntu', proxy=False, scp_opts='')[source]

Transfer files to this machine.

Parameters:
  • source (str) – Local path of file(s) to transfer
  • destination (str) – Remote destination of transferred files
  • user (str) – Remote username
  • proxy (bool) – Proxy through the Juju API server
  • scp_opts (str or list) – Additional options to the scp command
series

Returns the series of the current machine

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.

tag