/
deployment.go
55 lines (44 loc) · 984 Bytes
/
deployment.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package cmd
import (
cmdconf "github.com/cloudfoundry/bosh-cli/cmd/config"
biui "github.com/cloudfoundry/bosh-cli/ui"
)
type DeploymentCmd struct {
session Session
config cmdconf.Config
ui biui.UI
}
func NewDeploymentCmd(
session Session,
config cmdconf.Config,
ui biui.UI,
) DeploymentCmd {
return DeploymentCmd{session: session, config: config, ui: ui}
}
func (c DeploymentCmd) Run() error {
deployment, err := c.session.Deployment()
if err != nil {
return err
}
teams, err := deployment.Teams()
if err != nil {
return err
}
releases, err := deployment.Releases()
if err != nil {
return err
}
stemcells, err := deployment.Stemcells()
if err != nil {
return err
}
director, err := c.session.Director()
if err != nil {
return err
}
configs, err := director.ListDeploymentConfigs(deployment.Name())
if err != nil {
return err
}
return DeploymentTablePrinter{deployment.Name(), releases, stemcells, teams, configs, c.ui}.Print()
}