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