OLD | NEW |
1 package apiserver | 1 package apiserver |
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/charm" | 6 "launchpad.net/juju-core/charm" |
7 "launchpad.net/juju-core/juju" | 7 "launchpad.net/juju-core/juju" |
8 "launchpad.net/juju-core/log" | 8 "launchpad.net/juju-core/log" |
9 "launchpad.net/juju-core/state" | 9 "launchpad.net/juju-core/state" |
10 "launchpad.net/juju-core/state/api" | 10 "launchpad.net/juju-core/state/api" |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 Charm: charm, | 346 Charm: charm, |
347 ServiceName: serviceName, | 347 ServiceName: serviceName, |
348 NumUnits: args.NumUnits, | 348 NumUnits: args.NumUnits, |
349 Config: args.Config, | 349 Config: args.Config, |
350 ConfigYAML: args.ConfigYAML, | 350 ConfigYAML: args.ConfigYAML, |
351 } | 351 } |
352 _, err = conn.DeployService(deployArgs) | 352 _, err = conn.DeployService(deployArgs) |
353 return err | 353 return err |
354 } | 354 } |
355 | 355 |
356 // ServiceAddUnits adds a given number of units to a service. | 356 // AddServiceUnits adds a given number of units to a service. |
357 func (c *srvClient) ServiceAddUnits(args params.ServiceAddUnits) error { | 357 func (c *srvClient) AddServiceUnits(args params.AddServiceUnits) error { |
358 » return statecmd.ServiceAddUnits(c.root.srv.state, args) | 358 » return statecmd.AddServiceUnits(c.root.srv.state, args) |
| 359 } |
| 360 |
| 361 // DestroyServiceUnits removes a given set of service units. |
| 362 func (c *srvClient) DestroyServiceUnits(args params.DestroyServiceUnits) error { |
| 363 » return statecmd.DestroyServiceUnits(c.root.srv.state, args) |
359 } | 364 } |
360 | 365 |
361 // ServiceDestroy destroys a given service. | 366 // ServiceDestroy destroys a given service. |
362 func (c *srvClient) ServiceDestroy(args params.ServiceDestroy) error { | 367 func (c *srvClient) ServiceDestroy(args params.ServiceDestroy) error { |
363 return statecmd.ServiceDestroy(c.root.srv.state, args) | 368 return statecmd.ServiceDestroy(c.root.srv.state, args) |
364 } | 369 } |
365 | 370 |
366 // CharmInfo returns information about the requested charm. | 371 // CharmInfo returns information about the requested charm. |
367 func (c *srvClient) CharmInfo(args params.CharmInfo) (api.CharmInfo, error) { | 372 func (c *srvClient) CharmInfo(args params.CharmInfo) (api.CharmInfo, error) { |
368 curl, err := charm.ParseURL(args.CharmURL) | 373 curl, err := charm.ParseURL(args.CharmURL) |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 func (ws *watchers) stopAll() { | 628 func (ws *watchers) stopAll() { |
624 ws.mu.Lock() | 629 ws.mu.Lock() |
625 defer ws.mu.Unlock() | 630 defer ws.mu.Unlock() |
626 for _, w := range ws.ws { | 631 for _, w := range ws.ws { |
627 if err := w.w.Stop(); err != nil { | 632 if err := w.w.Stop(); err != nil { |
628 log.Printf("state/api: error stopping %T watcher: %v", w
, err) | 633 log.Printf("state/api: error stopping %T watcher: %v", w
, err) |
629 } | 634 } |
630 } | 635 } |
631 ws.ws = make(map[string]*srvWatcher) | 636 ws.ws = make(map[string]*srvWatcher) |
632 } | 637 } |
OLD | NEW |