diff --git a/cm/client.go b/cm/client.go index b05de78..bb358c5 100644 --- a/cm/client.go +++ b/cm/client.go @@ -48,7 +48,7 @@ func (c CMServer) CreatePutRequest(body bytes.Buffer, urlSuffix string) *http.Re // GetCMUri creates the CM uri with /api/vx/ suffix (+ /api/vx/clusters/ suffix is useCluster is enabled) func (c CMServer) GetCMUri(uriSuffix string) string { - return fmt.Sprintf("%s://%s:%v/api/v%v/%s", c.Protocol, c.Hostname, c.Port, c.ApiVersion, uriSuffix) + return fmt.Sprintf("%s://%s:%v/api/v%v/%s", c.Protocol, c.Hostname, c.Port, c.APIVersion, uriSuffix) } // GetHttpClient create HTTP client instance for CM Server @@ -157,5 +157,5 @@ func createGatewayCurlCommand(c CMServer, uri string, method string, body string if len(body) > 0 { bodyCommand = fmt.Sprintf(" -H \"Content-Type: application/json\" --data '%v'", body) } - return fmt.Sprintf("curl -s -X %v -k -u %v:%v%v 'http://localhost:7180/api/v%v/%v'", method, c.Username, c.Password, bodyCommand, c.ApiVersion, uri) + return fmt.Sprintf("curl -s -X %v -k -u %v:%v%v 'http://localhost:7180/api/v%v/%v'", method, c.Username, c.Password, bodyCommand, c.APIVersion, uri) } diff --git a/cm/registry.go b/cm/registry.go index e8d5ff8..c2ca0a7 100644 --- a/cm/registry.go +++ b/cm/registry.go @@ -103,7 +103,7 @@ func RegisterNewCMEntry(id string, hostname string, port int, protocol string, u } cmServerEntries := ListCMRegistryEntries() newCmServerEntry := CMServer{Name: id, Hostname: hostname, Port: port, Protocol: protocol, Username: username, - Password: password, Active: true, UseGateway: useGateway, ApiVersion: apiVersion} + Password: password, Active: true, UseGateway: useGateway, APIVersion: apiVersion} cmServerEntries = append(cmServerEntries, newCmServerEntry) WriteCMServerEntries(cmServerEntries) } @@ -117,7 +117,7 @@ func UpdateCMEntry(id string, hostname string, port int, protocol string, userna os.Exit(1) } updatedCmServerEntry := CMServer{Name: id, Hostname: hostname, Port: port, Protocol: protocol, Username: username, Password: password, - Active: true, UseGateway: useGateway, ApiVersion: apiVersion, ConnectionProfile: connectionProfile} + Active: true, UseGateway: useGateway, APIVersion: apiVersion, ConnectionProfile: connectionProfile} cmServers := ListCMRegistryEntries() newCmServers := make([]CMServer, 0) diff --git a/cm/types.go b/cm/types.go index 8cb681f..58efcca 100644 --- a/cm/types.go +++ b/cm/types.go @@ -11,7 +11,7 @@ type CMServer struct { Active bool `json:"active"` ConnectionProfile string `json:"profile"` UseGateway bool `json:"gateway"` - ApiVersion int `json:"version"` + APIVersion int `json:"version"` } // ConnectionProfile represents ssh/connection descriptions which is used to communicate with CM server and agents