X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=juju%2Fmodel.py;h=9d638cbb19a3eece5773cbb039b4d91bc391afbb;hb=17b45c65afac23a123e66834f93049a1c7e45201;hp=83f9511aec0ead53d9922c049c2e42103d1fda8b;hpb=31063e719029bcb9c6b65c210156cf920375c4da;p=osm%2FN2VC.git diff --git a/juju/model.py b/juju/model.py index 83f9511..9d638cb 100644 --- a/juju/model.py +++ b/juju/model.py @@ -7,13 +7,15 @@ class Model(object): :param str spec: Machine specification Examples:: + (None) - starts a new machine 'lxc' - starts a new machine with on lxc container 'lxc:4' - starts a new lxc container on machine 4 'ssh:user@10.10.0.3' - manually provisions a machine with ssh 'zone=us-east-1a' - starts a machine in zone us-east-1s on AWS 'maas2.name' - acquire machine maas2.name on MAAS - :param :class:`juju.Constraints` constraints: Machine constraints + :param constraints: Machine constraints + :type constraints: :class:`juju.Constraints` :param list disks: List of disk :class:`constraints ` :param str series: Series :param int count: Number of machines to deploy @@ -156,7 +158,8 @@ class Model(object): :param str channel: Charm store channel from which to retrieve the charm or bundle, e.g. 'development' :param dict config: Charm configuration dictionary - :param :class:`juju.Constraints` constraints: Service constraints + :param constraints: Service constraints + :type constraints: :class:`juju.Constraints` :param bool force: Allow charm to be deployed to a machine running an unsupported series :param int num_units: Number of units to deploy @@ -165,6 +168,7 @@ class Model(object): :param str series: Series on which to deploy :param dict storage: Storage constraints TODO how do these look? :param str to: Placement directive, e.g.:: + '23' - machine 23 'lxc:7' - new lxc container on machine 7 '24/lxc/3' - lxc container 3 or machine 24 @@ -194,10 +198,11 @@ class Model(object): """Ensure sufficient controllers exist to provide redundancy. :param int num_controllers: Number of controllers to make available - :param :class:`juju.Constraints` constraints: Constraints to apply - to the controller machines + :param constraints: Constraints to apply to the controller machines + :type constraints: :class:`juju.Constraints` :param str series: Series of the controller machines :param list to: Placement directives for controller machines, e.g.:: + '23' - machine 23 'lxc:7' - new lxc container on machine 7 '24/lxc/3' - lxc container 3 or machine 24 @@ -237,9 +242,10 @@ class Model(object): pass import_ssh_keys = import_ssh_key - def get_machines(self, utc=False): + def get_machines(self, machine, utc=False): """Return list of machines in this model. + :param str machine: Machine id, e.g. '0' :param bool utc: Display time as UTC in RFC3339 format """ @@ -333,9 +339,18 @@ class Model(object): pass remove_ssh_keys = remove_ssh_key - def restore_backup(self): + def restore_backup( + self, bootstrap=False, constraints=None, archive=None, + backup_id=None, upload_tools=False): """Restore a backup archive to a new controller. + :param bool bootstrap: Bootstrap a new state machine + :param constraints: Model constraints + :type constraints: :class:`juju.Constraints` + :param str archive: Path to backup archive to restore + :param str backup_id: Id of backup to restore + :param bool upload_tools: Upload tools if bootstrapping a new machine + """ pass @@ -345,70 +360,107 @@ class Model(object): """ pass - def revoke(self): + def revoke(self, username, acl='read'): """Revoke a user's access to this model. + :param str username: Username to revoke + :param str acl: Access control ('read' or 'write') + """ pass - def run(self): + def run(self, command, timeout=None): """Run command on all machines in this model. + :param str command: The command to run + :param int timeout: Time to wait before command is considered failed + """ pass - def set_config(self): + def set_config(self, **config): """Set configuration keys on this model. + :param \*\*config: Config key/values + """ pass - def set_constraints(self): + def set_constraints(self, constraints): """Set machine constraints on this model. + :param :class:`juju.Constraints` constraints: Machine constraints + """ pass - def get_action_output(self, action_uuid): + def get_action_output(self, action_uuid, wait=-1): """Get the results of an action by ID. + :param str action_uuid: Id of the action + :param int wait: Time in seconds to wait for action to complete + """ pass - def get_action_status(self, uuid_or_prefix): - """Get the status of all actions, filtered by ID or prefix. + def get_action_status(self, uuid_or_prefix=None, name=None): + """Get the status of all actions, filtered by ID, ID prefix, or action name. + + :param str uuid_or_prefix: Filter by action uuid or prefix + :param str name: Filter by action name """ pass def get_budget(self, budget_name): - """Get budget by name. + """Get budget usage info. + + :param str budget_name: Name of budget """ pass - def get_status(self): + def get_status(self, filter_=None, utc=False): """Return the status of the model. + :param str filter_: Service or unit name or wildcard ('*') + :param bool utc: Display time as UTC in RFC3339 format + """ pass status = get_status - def sync_tools(self): + def sync_tools( + self, all_=False, destination=None, dry_run=False, public=False, + source=None, stream=None, version=None): """Copy Juju tools into this model. + :param bool all_: Copy all versions, not just the latest + :param str destination: Path to local destination directory + :param bool dry_run: Don't do the actual copy + :param bool public: Tools are for a public cloud, so generate mirrors + information + :param str source: Path to local source directory + :param str stream: Simplestreams stream for which to sync metadata + :param str version: Copy a specific major.minor version + """ pass - def unblock(self, operation): + def unblock(self, *commands): """Unblock an operation that would alter this model. + :param str \*commands: The commands to unblock. Valid values are + 'all-changes', 'destroy-model', 'remove-object' + """ pass - def unset_config(self): + def unset_config(self, *keys): """Unset configuration on this model. + :param str \*keys: The keys to unset + """ pass @@ -418,8 +470,24 @@ class Model(object): """ pass - def upload_backup(self): + def upgrade_juju( + self, dry_run=False, reset_previous_upgrade=False, + upload_tools=False, version=None): + """Upgrade Juju on all machines in a model. + + :param bool dry_run: Don't do the actual upgrade + :param bool reset_previous_upgrade: Clear the previous (incomplete) + upgrade status + :param bool upload_tools: Upload local version of tools + :param str version: Upgrade to a specific version + + """ + pass + + def upload_backup(self, archive_path): """Store a backup archive remotely in Juju. + :param str archive_path: Path to local archive + """ pass