~thumper/juju-core/move-environs-tools

« back to all changes in this revision

Viewing changes to state/api/params/params.go

  • Committer: Tarmac
  • Author(s): William Reade
  • Date: 2013-07-08 14:33:20 UTC
  • mfrom: (1397.2.4 juju-core)
  • Revision ID: tarmac-20130708143320-stmc2mgjzntusiy0
[r=fwereade] params: put like things near each other

...approximately. progress not perfection; main point is that it puts all the
stuff I'm going to be kicking hard into internal.go

https://codereview.appspot.com/10886047/

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
        Errors []*Error
21
21
}
22
22
 
23
 
// Machines holds the arguments for making an API call working on
24
 
// multiple machine entities.
25
 
type Machines struct {
26
 
        Ids []string
27
 
}
28
 
 
29
 
// MachineSetStatus holds a machine id, status and extra info.
30
 
type MachineSetStatus struct {
31
 
        Id     string
32
 
        Status Status
33
 
        Info   string
34
 
}
35
 
 
36
 
// MachinesSetStatus holds the parameters for making a Machiner.SetStatus call.
37
 
type MachinesSetStatus struct {
38
 
        Machines []MachineSetStatus
39
 
}
40
 
 
41
 
// NotifyWatchResult holds an NotifyWatcher id and an error (if any).
42
 
type NotifyWatchResult struct {
43
 
        NotifyWatcherId string
44
 
        Error           *Error
45
 
}
46
 
 
47
 
// NotifyWatchResults holds the results for any API call which ends up
48
 
// returning a list of NotifyWatchers
49
 
type NotifyWatchResults struct {
50
 
        Results []NotifyWatchResult
51
 
}
52
 
 
53
 
// A NotifyWatcher will send events when something changes.
54
 
// It does not send content for those changes.
55
 
type NotifyWatcher interface {
56
 
        Changes() <-chan struct{}
57
 
        Stop() error
58
 
        Err() error
59
 
}
60
 
 
61
 
// Agent identifies a single agent
62
 
type Agent struct {
63
 
        Tag string
64
 
}
65
 
 
66
 
// Agents holds a list of Tags for Unit- and Machine-Agents.
67
 
type Agents struct {
68
 
        Agents []Agent
69
 
}
70
 
 
71
23
// AddRelation holds the parameters for making the AddRelation call.
72
24
// The endpoints specified are unordered.
73
25
type AddRelation struct {
86
38
        Endpoints []string
87
39
}
88
40
 
89
 
// Life describes the lifecycle state of an entity ("alive", "dying"
90
 
// or "dead").
91
 
type Life string
92
 
 
93
 
const (
94
 
        Alive Life = "alive"
95
 
        Dying Life = "dying"
96
 
        Dead  Life = "dead"
97
 
)
98
 
 
99
 
// MachineLifeResult holds the result of Machiner.Life for a single machine.
100
 
type MachineLifeResult struct {
101
 
        Life  Life
102
 
        Error *Error
103
 
}
104
 
 
105
 
// MachinesLifeResults holds the results of a Machiner.Life call.
106
 
type MachinesLifeResults struct {
107
 
        Machines []MachineLifeResult
108
 
}
109
 
 
110
 
// MachineAgentGetMachinesResults holds the results of a
111
 
// machineagent.API.GetMachines call.
112
 
type MachineAgentGetMachinesResults struct {
113
 
        Machines []MachineAgentGetMachinesResult
114
 
}
115
 
 
116
 
// MachineJob values define responsibilities that machines may be
117
 
// expected to fulfil.
118
 
type MachineJob string
119
 
 
120
 
const (
121
 
        JobHostUnits     MachineJob = "JobHostUnits"
122
 
        JobManageEnviron MachineJob = "JobManageEnviron"
123
 
        JobManageState   MachineJob = "JobManageState"
124
 
)
125
 
 
126
 
// MachineAgentGetMachinesResult holds the results of a
127
 
// machineagent.API.GetMachines call for a single machine.
128
 
type MachineAgentGetMachinesResult struct {
129
 
        Life  Life
130
 
        Jobs  []MachineJob
131
 
        Error *Error
132
 
}
133
 
 
134
41
// ServiceDeploy holds the parameters for making the ServiceDeploy call.
135
42
type ServiceDeploy struct {
136
43
        ServiceName    string
222
129
        ServiceName string
223
130
}
224
131
 
225
 
// AgentTools describes the tools for a given Agent. This is mostly a flattened
226
 
// state.Tools description, plus an agent Tag field.
227
 
type AgentTools struct {
228
 
        Tag    string
229
 
        Major  int
230
 
        Minor  int
231
 
        Patch  int
232
 
        Build  int
233
 
        Arch   string
234
 
        Series string
235
 
        URL    string
236
 
}
237
 
 
238
 
// AgentToolsResult holds the tools and possibly error for a given Agent request
239
 
type AgentToolsResult struct {
240
 
        AgentTools AgentTools
241
 
        Error      *Error
242
 
}
243
 
 
244
 
// AgentToolsResults is a list of tools for various requested agents.
245
 
type AgentToolsResults struct {
246
 
        Tools []AgentToolsResult
247
 
}
248
 
 
249
 
// Set what tools are being run for multiple agents
250
 
type SetAgentTools struct {
251
 
        AgentTools []AgentTools
252
 
}
253
 
 
254
 
// The result of setting the tools for one agent
255
 
type SetAgentToolsResult struct {
256
 
        Tag   string
257
 
        Error *Error
258
 
}
259
 
 
260
 
// The result of setting the tools for many agents
261
 
type SetAgentToolsResults struct {
262
 
        Results []SetAgentToolsResult
263
 
}
264
 
 
265
 
// PasswordChanges holds the parameters for making a SetPasswords call.
266
 
type PasswordChanges struct {
267
 
        Changes []PasswordChange
268
 
}
269
 
 
270
 
// PasswordChange specifies a password change for the entity
271
 
// with the given tag.
272
 
type PasswordChange struct {
273
 
        Tag      string
274
 
        Password string
275
 
}
276
 
 
277
132
// Creds holds credentials for identifying an entity.
278
133
type Creds struct {
279
134
        AuthTag  string
280
135
        Password string
281
136
}
282
137
 
283
 
// NotifyWatcherId holds the id of an NotifyWatcher.
284
 
type NotifyWatcherId struct {
285
 
        NotifyWatcherId string
286
 
}
287
 
 
288
 
// LifecycleWatchResults holds the results of API calls
289
 
// that watch the lifecycle of a set of objects.
290
 
// It is used both for the initial Watch request
291
 
// and for subsequent Next requests.
292
 
type LifecycleWatchResults struct {
293
 
        // LifeCycleWatcherId holds the id of the newly
294
 
        // created watcher. It will be empty for a Next
295
 
        // request.
296
 
        LifecycleWatcherId string
297
 
 
298
 
        // Ids holds the list of entity ids.
299
 
        // For a Watch request, it holds all entity ids being
300
 
        // watched; for a Next request, it holds the ids of those
301
 
        // that have changed.
302
 
        Ids []string
303
 
}
304
 
 
305
 
// EnvironConfigWatchResults holds the result of
306
 
// State.WatchEnvironConfig(): id of the created EnvironConfigWatcher,
307
 
// along with the current environment configuration. It is also used
308
 
// for the result of EnvironConfigWatcher.Next(), when it contains the
309
 
// changed config (EnvironConfigWatcherId will be empty in this case).
310
 
type EnvironConfigWatchResults struct {
311
 
        EnvironConfigWatcherId string
312
 
        Config                 map[string]interface{}
313
 
}
314
 
 
315
 
// AllWatcherId holds the id of an AllWatcher.
316
 
type AllWatcherId struct {
317
 
        AllWatcherId string
318
 
}
319
 
 
320
 
// AllWatcherNextResults holds deltas returned from calling AllWatcher.Next().
321
 
type AllWatcherNextResults struct {
322
 
        Deltas []Delta
323
 
}
324
 
 
325
 
// Password holds a password.
326
 
type Password struct {
327
 
        Password string
328
 
}
329
 
 
330
 
// Unit holds details of a unit.
331
 
type Unit struct {
332
 
        DeployerTag string
333
 
        // TODO(rog) other unit attributes.
334
 
}
335
 
 
336
 
// User holds details of a user.
337
 
type User struct {
338
 
        // This is a placeholder for any information
339
 
        // that may be associated with a user in the
340
 
        // future.
341
 
}
342
 
 
343
138
// GetAnnotationsResults holds annotations associated with an entity.
344
139
type GetAnnotationsResults struct {
345
140
        Annotations map[string]string
377
172
        CharmURL string
378
173
}
379
174
 
 
175
// AllWatcherId holds the id of an AllWatcher.
 
176
type AllWatcherId struct {
 
177
        AllWatcherId string
 
178
}
 
179
 
 
180
// AllWatcherNextResults holds deltas returned from calling AllWatcher.Next().
 
181
type AllWatcherNextResults struct {
 
182
        Deltas []Delta
 
183
}
 
184
 
380
185
// Delta holds details of a change to the environment.
381
186
type Delta struct {
382
187
        // If Removed is true, the entity has been removed;