|
|
@ -80,10 +80,12 @@ func httpClient(c config.CloudConfig) (*httptransport.Runtime, error) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (c *hcpClient) FetchBootstrap(ctx context.Context) (*BootstrapConfig, error) {
|
|
|
|
func (c *hcpClient) FetchBootstrap(ctx context.Context) (*BootstrapConfig, error) {
|
|
|
|
|
|
|
|
version := version.GetHumanVersion()
|
|
|
|
params := hcpgnm.NewAgentBootstrapConfigParamsWithContext(ctx).
|
|
|
|
params := hcpgnm.NewAgentBootstrapConfigParamsWithContext(ctx).
|
|
|
|
WithID(c.resource.ID).
|
|
|
|
WithID(c.resource.ID).
|
|
|
|
WithLocationOrganizationID(c.resource.Organization).
|
|
|
|
WithLocationOrganizationID(c.resource.Organization).
|
|
|
|
WithLocationProjectID(c.resource.Project)
|
|
|
|
WithLocationProjectID(c.resource.Project).
|
|
|
|
|
|
|
|
WithConsulVersion(&version)
|
|
|
|
|
|
|
|
|
|
|
|
resp, err := c.gnm.AgentBootstrapConfig(params, nil)
|
|
|
|
resp, err := c.gnm.AgentBootstrapConfig(params, nil)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
@ -132,10 +134,12 @@ type ServerStatus struct {
|
|
|
|
LanAddress string
|
|
|
|
LanAddress string
|
|
|
|
GossipPort int
|
|
|
|
GossipPort int
|
|
|
|
RPCPort int
|
|
|
|
RPCPort int
|
|
|
|
|
|
|
|
Datacenter string
|
|
|
|
|
|
|
|
|
|
|
|
Autopilot ServerAutopilot
|
|
|
|
Autopilot ServerAutopilot
|
|
|
|
Raft ServerRaft
|
|
|
|
Raft ServerRaft
|
|
|
|
TLS ServerTLSInfo
|
|
|
|
TLS ServerTLSInfo
|
|
|
|
|
|
|
|
ACL ServerACLInfo
|
|
|
|
|
|
|
|
|
|
|
|
ScadaStatus string
|
|
|
|
ScadaStatus string
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -155,6 +159,10 @@ type ServerRaft struct {
|
|
|
|
TimeSinceLastContact time.Duration
|
|
|
|
TimeSinceLastContact time.Duration
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type ServerACLInfo struct {
|
|
|
|
|
|
|
|
Enabled bool
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ServerTLSInfo struct {
|
|
|
|
type ServerTLSInfo struct {
|
|
|
|
Enabled bool
|
|
|
|
Enabled bool
|
|
|
|
CertExpiry time.Time
|
|
|
|
CertExpiry time.Time
|
|
|
@ -199,6 +207,10 @@ func serverStatusToHCP(s *ServerStatus) *gnmmod.HashicorpCloudGlobalNetworkManag
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Version: s.Version,
|
|
|
|
Version: s.Version,
|
|
|
|
ScadaStatus: s.ScadaStatus,
|
|
|
|
ScadaStatus: s.ScadaStatus,
|
|
|
|
|
|
|
|
ACL: &gnmmod.HashicorpCloudGlobalNetworkManager20220215ACLInfo{
|
|
|
|
|
|
|
|
Enabled: s.ACL.Enabled,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Datacenter: s.Datacenter,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|