Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(374)

Side by Side Diff: state/apiserver/units.go

Issue 9847044: state/api: Introducing bulk operations on units (Closed)
Patch Set: Created 11 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « state/apiserver/root.go ('k') | state/apiserver/utils.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details.
3
4 package apiserver
5
6 import "launchpad.net/juju-core/state/api/params"
7
8 // srvUnits serves API methods on set of units.
9 type srvUnits struct {
10 root *srvRoot
11 }
12
13 // Get retrieves all the details of list of unit ids.
14 func (u *srvUnits) Get(args params.Units) (params.UnitsResults, error) {
15 result := params.UnitsResults{
16 Units: make(map[string]*params.Unit),
17 }
18 for _, name := range args.Names {
19 unit, err := u.root.srv.state.Unit(name)
20 if err != nil {
21 return params.UnitsResults{}, err
22 }
23 result.Units[name] = stateUnitToParams(unit)
jameinel 2013/05/29 10:27:46 I'm fine with William's comment that we probably w
24 }
25 return result, nil
26 }
OLDNEW
« no previous file with comments | « state/apiserver/root.go ('k') | state/apiserver/utils.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b