OLD | NEW |
1 package api | 1 package api |
2 | 2 |
3 import ( | 3 import ( |
4 "code.google.com/p/go.net/websocket" | 4 "code.google.com/p/go.net/websocket" |
5 "fmt" | 5 "fmt" |
6 "launchpad.net/juju-core/state" | 6 "launchpad.net/juju-core/state" |
7 "launchpad.net/juju-core/state/statecmd" | 7 "launchpad.net/juju-core/state/statecmd" |
8 "sync" | 8 "sync" |
9 ) | 9 ) |
10 | 10 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } | 175 } |
176 for _, m := range ms { | 176 for _, m := range ms { |
177 instId, _ := m.InstanceId() | 177 instId, _ := m.InstanceId() |
178 status.Machines[m.Id()] = MachineInfo{ | 178 status.Machines[m.Id()] = MachineInfo{ |
179 InstanceId: string(instId), | 179 InstanceId: string(instId), |
180 } | 180 } |
181 } | 181 } |
182 return status, nil | 182 return status, nil |
183 } | 183 } |
184 | 184 |
| 185 // ServiceSet implements the server side of Client.ServerSet. |
| 186 func (c *srvClient) ServiceSet(p statecmd.ServiceSetParams) error { |
| 187 return statecmd.ServiceSet(c.root.srv.state, p) |
| 188 } |
| 189 |
| 190 // ServiceSetYAML implements the server side of Client.ServerSetYAML. |
| 191 func (c *srvClient) ServiceSetYAML(p statecmd.ServiceSetYAMLParams) error { |
| 192 return statecmd.ServiceSetYAML(c.root.srv.state, p) |
| 193 } |
| 194 |
185 func (c *srvClient) ServiceGet(args statecmd.ServiceGetParams) (statecmd.Service
GetResults, error) { | 195 func (c *srvClient) ServiceGet(args statecmd.ServiceGetParams) (statecmd.Service
GetResults, error) { |
186 return statecmd.ServiceGet(c.root.srv.state, args) | 196 return statecmd.ServiceGet(c.root.srv.state, args) |
187 } | 197 } |
188 | 198 |
189 // EnvironmentInfo returns information about the current environment (default | 199 // EnvironmentInfo returns information about the current environment (default |
190 // series and type). | 200 // series and type). |
191 func (c *srvClient) EnvironmentInfo() (EnvironmentInfo, error) { | 201 func (c *srvClient) EnvironmentInfo() (EnvironmentInfo, error) { |
192 conf, err := c.root.srv.state.EnvironConfig() | 202 conf, err := c.root.srv.state.EnvironConfig() |
193 if err != nil { | 203 if err != nil { |
194 return EnvironmentInfo{}, err | 204 return EnvironmentInfo{}, err |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 } | 360 } |
351 } | 361 } |
352 return false | 362 return false |
353 } | 363 } |
354 | 364 |
355 // isAgent returns whether the given entity is an agent. | 365 // isAgent returns whether the given entity is an agent. |
356 func isAgent(e state.AuthEntity) bool { | 366 func isAgent(e state.AuthEntity) bool { |
357 _, isUser := e.(*state.User) | 367 _, isUser := e.(*state.User) |
358 return !isUser | 368 return !isUser |
359 } | 369 } |
OLD | NEW |