Skip to content

Commit

Permalink
Rename api version variable
Browse files Browse the repository at this point in the history
  • Loading branch information
oleewere committed May 12, 2019
1 parent 72cf2df commit 2d2feca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cm/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/<cluster> 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
Expand Down Expand Up @@ -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)
}
4 changes: 2 additions & 2 deletions cm/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cm/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d2feca

Please sign in to comment.