2 def add_relation(self
, local_relation
, remote_relation
):
3 """Add a relation to another service.
5 :param str local_relation: Name of relation on this service
6 :param str remote_relation: Name of relation on the other service in
7 the form '<service>[:<relation_name>]'
12 def add_unit(self
, count
=1, to
=None):
13 """Add one or more units to this service.
15 :param int count: Number of units to add
16 :param str to: Placement directive, e.g.::
18 'lxc:7' - new lxc container on machine 7
19 '24/lxc/3' - lxc container 3 or machine 24
21 If None, a new machine is provisioned.
27 def allocate(self
, budget
, value
):
28 """Allocate budget to this service.
30 :param str budget: Name of budget
31 :param int value: Budget limit
36 def attach(self
, resource_name
, file_path
):
37 """Upload a file as a resource for this service.
39 :param str resource: Name of the resource
40 :param str file_path: Path to the file to upload
45 def collect_metrics(self
):
46 """Collect metrics on this service.
51 def destroy_relation(self
, local_relation
, remote_relation
):
52 """Remove a relation to another service.
54 :param str local_relation: Name of relation on this service
55 :param str remote_relation: Name of relation on the other service in
56 the form '<service>[:<relation_name>]'
60 remove_relation
= destroy_relation
63 """Remove this service from the model.
70 """Make this service publicly available over the network.
76 """Return the configuration settings for this service.
81 def get_constraints(self
):
82 """Return the machine constraints for this service.
87 def get_actions(self
, schema
=False):
88 """Get actions defined for this service.
90 :param bool schema: Return the full action schema
95 def get_resources(self
, details
=False):
96 """Return resources for this service.
98 :param bool details: Include detailed info about resources used by each
104 def run(self
, command
, timeout
=None):
105 """Run command on all units for this service.
107 :param str command: The command to run
108 :param int timeout: Time to wait before command is considered failed
113 def set_config(self
, to_default
=False, **config
):
114 """Set configuration options for this service.
116 :param bool to_default: Set service options to default values
117 :param \*\*config: Config key/values
122 def set_constraints(self
, constraints
):
123 """Set machine constraints for this service.
125 :param :class:`juju.Constraints` constraints: Machine constraints
130 def set_meter_status(self
, status
, info
=None):
131 """Set the meter status on this status.
133 :param str status: Meter status, e.g. 'RED', 'AMBER'
134 :param str info: Extra info message
139 def set_plan(self
, plan_name
):
140 """Set the plan for this service, effective immediately.
142 :param str plan_name: Name of plan
148 """Remove public availability over the network for this service.
153 def update_allocation(self
, allocation
):
154 """Update existing allocation for this service.
156 :param int allocation: The allocation to set
162 self
, channel
=None, force_series
=False, force_units
=False,
163 path
=None, resources
=None, revision
=-1, switch
=None):
164 """Upgrade the charm for this service.
166 :param str channel: Channel to use when getting the charm from the
167 charm store, e.g. 'development'
168 :param bool force_series: Upgrade even if series of deployed service
169 is not supported by the new charm
170 :param bool force_units: Upgrade all units immediately, even if in
172 :param str path: Uprade to a charm located at path
173 :param dict resources: Dictionary of resource name/filepath pairs
174 :param int revision: Explicit upgrade revision
175 :param str switch: Crossgrade charm url