forked from cloudfoundry/bosh-bootloader
/
commands_usage.go
174 lines (125 loc) · 7.5 KB
/
commands_usage.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
package commands
import "fmt"
const (
Credentials = `
--aws-access-key-id AWS Access Key ID env: $BBL_AWS_ACCESS_KEY_ID
--aws-secret-access-key AWS Secret Access Key env: $BBL_AWS_SECRET_ACCESS_KEY
--aws-region AWS Region env: $BBL_AWS_REGION
--gcp-service-account-key GCP Service Access Key to use env: $BBL_GCP_SERVICE_ACCOUNT_KEY
--gcp-region GCP Region to use env: $BBL_GCP_REGION
--azure-subscription-id Azure Subscription ID env: $BBL_AZURE_SUBSCRIPTION_ID
--azure-tenant-id Azure Tenant ID env: $BBL_AZURE_TENANT_ID
--azure-client-id Azure Client ID env: $BBL_AZURE_CLIENT_ID
--azure-client-secret Azure Client Secret env: $BBL_AZURE_CLIENT_SECRET
--azure-region Azure Region env: $BBL_AZURE_REGION
--vsphere-vcenter-user vSphere vCenter User env: $BBL_VSPHERE_VCENTER_USER
--vsphere-vcenter-password vSphere vCenter Password env: $BBL_VSPHERE_VCENTER_PASSWORD
--vsphere-vcenter-ip vSphere vCenter IP env: $BBL_VSPHERE_VCENTER_IP
--vsphere-vcenter-dc vSphere vCenter Datacenter env: $BBL_VSPHERE_VCENTER_DC
--vsphere-vcenter-cluster vSphere vCenter Cluster env: $BBL_VSPHERE_VCENTER_CLUSTER
--vsphere-vcenter-rp vSphere vCenter Resource Pool env: $BBL_VSPHERE_VCENTER_RP
--vsphere-network vSphere Network env: $BBL_VSPHERE_NETWORK
--vsphere-vcenter-ds vSphere vCenter Datastore env: $BBL_VSPHERE_VCENTER_DS
--vsphere-subnet vSphere Subnet env: $BBL_VSPHERE_SUBNET
--vsphere-vcenter-disks vSphere vCenter Disks env: $BBL_VSPHERE_VCENTER_DISKS
--vsphere-vcenter-templates vSphere vCenter Templates env: $BBL_VSPHERE_VCENTER_TEMPLATES
--vsphere-vcenter-vms vSphere vCenter VMs env: $BBL_VSPHERE_VCENTER_VMS
--openstack-internal-cidr OpenStack Internal CIDR env: $BBL_OPENSTACK_INTERNAL_CIDR
--openstack-external-ip OpenStack External IP env: $BBL_OPENSTACK_EXTERNAL_IP
--openstack-auth-url OpenStack Auth URL env: $BBL_OPENSTACK_AUTH_URL
--openstack-az OpenStack Availability Zone env: $BBL_OPENSTACK_AZ
--openstack-default-key-name OpenStack Default Key Name env: $BBL_OPENSTACK_DEFAULT_KEY_NAME
--openstack-default-security-group OpenStack Default Security Group env: $BBL_OPENSTACK_DEFAULT_SECURITY_GROUP
--openstack-network-id OpenStack Network ID env: $BBL_OPENSTACK_NETWORK_ID
--openstack-password OpenStack Password env: $BBL_OPENSTACK_PASSWORD
--openstack-username OpenStack Username env: $BBL_OPENSTACK_USERNAME
--openstack-project OpenStack Project env: $BBL_OPENSTACK_PROJECT
--openstack-domain OpenStack Domain env: $BBL_OPENSTACK_DOMAIN
--openstack-region OpenStack Region env: $BBL_OPENSTACK_REGION
--openstack-private-key OpenStack Private Key env: $BBL_OPENSTACK_PRIVATE_KEY`
requiresCredentials = `
Credentials for your IaaS are required:`
LBUsage = `
Load Balancer options:
--lb-type Load balancer(s) type: "concourse" or "cf"
--lb-cert Path to SSL certificate (supported when type="cf")
--lb-key Path to SSL certificate key (supported when type="cf")
--lb-chain Path to SSL certificate chain (supported when iaas="aws")
--lb-domain Creates a DNS zone and records for the given domain (supported when type="cf")`
PlanCommandUsage = `Populates a state directory with the latest config without applying it
--iaas IAAS to deploy your BOSH director onto: "aws", "azure", "gcp", "vsphere" env: $BBL_IAAS
--name Name to assign to your BOSH director (optional) env: $BBL_ENV_NAME
`
UpCommandUsage = `Deploys BOSH director on an IAAS
--iaas IAAS to deploy your BOSH director onto: "aws", "azure", "gcp", "vsphere" env: $BBL_IAAS
--name Name to assign to your BOSH director (optional) env: $BBL_ENV_NAME
`
DestroyCommandUsage = `Tears down BOSH director infrastructure
[--no-confirm] Do not ask for confirmation (optional)`
CleanupLeftoversCommandUsage = `Cleans up orphaned IAAS resources
--filter Only delete resources with this string in their name`
LBsCommandUsage = "Prints attached load balancer(s)"
OutputsCommandUsage = "Prints the outputs from terraform."
VersionCommandUsage = "Prints version"
UsageCommandUsage = "Prints helpful message for the given command"
EnvIdCommandUsage = "Prints environment ID"
SSHKeyCommandUsage = "Prints SSH private key for the jumpbox."
DirectorSSHKeyCommandUsage = "Prints SSH private key for the director."
SSHCommandUsage = `Opens an SSH connection to the director or the jumpbox.
--jumpbox Open a connection to the jumpbox
--director Open a connection to the director
`
RotateCommandUsage = "Rotates SSH key for the jumpbox user."
JumpboxAddressCommandUsage = "Prints BOSH jumpbox address"
DirectorUsernameCommandUsage = "Prints BOSH director username"
DirectorPasswordCommandUsage = "Prints BOSH director password"
DirectorAddressCommandUsage = "Prints BOSH director address"
DirectorCACertCommandUsage = "Prints BOSH director CA certificate"
PrintEnvCommandUsage = "Prints required BOSH environment variables"
LatestErrorCommandUsage = "Prints the output from the latest call to terraform"
)
func (Up) Usage() string {
return fmt.Sprintf("%s%s%s", UpCommandUsage, Credentials, LBUsage)
}
func (Plan) Usage() string {
return fmt.Sprintf("%s%s%s", PlanCommandUsage, Credentials, LBUsage)
}
func (Destroy) Usage() string {
return fmt.Sprintf("%s%s%s", DestroyCommandUsage, requiresCredentials, Credentials)
}
func (Rotate) Usage() string {
return fmt.Sprintf("%s%s%s", RotateCommandUsage, requiresCredentials, Credentials)
}
func (LBs) Usage() string { return LBsCommandUsage }
func (Outputs) Usage() string { return OutputsCommandUsage }
func (Version) Usage() string { return VersionCommandUsage }
func (Usage) Usage() string { return UsageCommandUsage }
func (PrintEnv) Usage() string { return PrintEnvCommandUsage }
func (LatestError) Usage() string { return LatestErrorCommandUsage }
func (Validate) Usage() string { return "" }
func (s SSHKey) Usage() string {
if s.Director {
return DirectorSSHKeyCommandUsage
}
return SSHKeyCommandUsage
}
func (s SSH) Usage() string {
return SSHCommandUsage
}
func (s StateQuery) Usage() string {
switch s.propertyName {
case EnvIDPropertyName:
return EnvIdCommandUsage
case JumpboxAddressPropertyName:
return JumpboxAddressCommandUsage
case DirectorUsernamePropertyName:
return DirectorUsernameCommandUsage
case DirectorPasswordPropertyName:
return DirectorPasswordCommandUsage
case DirectorAddressPropertyName:
return DirectorAddressCommandUsage
case DirectorCACertPropertyName:
return DirectorCACertCommandUsage
}
return ""
}