Async model updates
[osm/N2VC.git] / juju / application.py
1 from . import model
2
3
4 class Application(model.ModelEntity):
5 def add_relation(self, local_relation, remote_relation):
6 """Add a relation to another service.
7
8 :param str local_relation: Name of relation on this service
9 :param str remote_relation: Name of relation on the other service in
10 the form '<service>[:<relation_name>]'
11
12 """
13 pass
14
15 def add_unit(self, count=1, to=None):
16 """Add one or more units to this service.
17
18 :param int count: Number of units to add
19 :param str to: Placement directive, e.g.::
20 '23' - machine 23
21 'lxc:7' - new lxc container on machine 7
22 '24/lxc/3' - lxc container 3 or machine 24
23
24 If None, a new machine is provisioned.
25
26 """
27 pass
28 add_units = add_unit
29
30 def allocate(self, budget, value):
31 """Allocate budget to this service.
32
33 :param str budget: Name of budget
34 :param int value: Budget limit
35
36 """
37 pass
38
39 def attach(self, resource_name, file_path):
40 """Upload a file as a resource for this service.
41
42 :param str resource: Name of the resource
43 :param str file_path: Path to the file to upload
44
45 """
46 pass
47
48 def collect_metrics(self):
49 """Collect metrics on this service.
50
51 """
52 pass
53
54 def destroy_relation(self, local_relation, remote_relation):
55 """Remove a relation to another service.
56
57 :param str local_relation: Name of relation on this service
58 :param str remote_relation: Name of relation on the other service in
59 the form '<service>[:<relation_name>]'
60
61 """
62 pass
63 remove_relation = destroy_relation
64
65 def destroy(self):
66 """Remove this service from the model.
67
68 """
69 pass
70 remove = destroy
71
72 def expose(self):
73 """Make this service publicly available over the network.
74
75 """
76 pass
77
78 def get_config(self):
79 """Return the configuration settings for this service.
80
81 """
82 pass
83
84 def get_constraints(self):
85 """Return the machine constraints for this service.
86
87 """
88 pass
89
90 def get_actions(self, schema=False):
91 """Get actions defined for this service.
92
93 :param bool schema: Return the full action schema
94
95 """
96 pass
97
98 def get_resources(self, details=False):
99 """Return resources for this service.
100
101 :param bool details: Include detailed info about resources used by each
102 unit
103
104 """
105 pass
106
107 def run(self, command, timeout=None):
108 """Run command on all units for this service.
109
110 :param str command: The command to run
111 :param int timeout: Time to wait before command is considered failed
112
113 """
114 pass
115
116 def set_config(self, to_default=False, **config):
117 """Set configuration options for this service.
118
119 :param bool to_default: Set service options to default values
120 :param \*\*config: Config key/values
121
122 """
123 pass
124
125 def set_constraints(self, constraints):
126 """Set machine constraints for this service.
127
128 :param :class:`juju.Constraints` constraints: Machine constraints
129
130 """
131 pass
132
133 def set_meter_status(self, status, info=None):
134 """Set the meter status on this status.
135
136 :param str status: Meter status, e.g. 'RED', 'AMBER'
137 :param str info: Extra info message
138
139 """
140 pass
141
142 def set_plan(self, plan_name):
143 """Set the plan for this service, effective immediately.
144
145 :param str plan_name: Name of plan
146
147 """
148 pass
149
150 def unexpose(self):
151 """Remove public availability over the network for this service.
152
153 """
154 pass
155
156 def update_allocation(self, allocation):
157 """Update existing allocation for this service.
158
159 :param int allocation: The allocation to set
160
161 """
162 pass
163
164 def upgrade_charm(
165 self, channel=None, force_series=False, force_units=False,
166 path=None, resources=None, revision=-1, switch=None):
167 """Upgrade the charm for this service.
168
169 :param str channel: Channel to use when getting the charm from the
170 charm store, e.g. 'development'
171 :param bool force_series: Upgrade even if series of deployed service
172 is not supported by the new charm
173 :param bool force_units: Upgrade all units immediately, even if in
174 error state
175 :param str path: Uprade to a charm located at path
176 :param dict resources: Dictionary of resource name/filepath pairs
177 :param int revision: Explicit upgrade revision
178 :param str switch: Crossgrade charm url
179
180 """
181 pass