Skip to content

Commit

Permalink
Additional client fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oleewere committed May 4, 2019
1 parent 4fd58a2 commit 2dc55a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cm/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ 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/%s/%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 Ambari
// GetHttpClient create HTTP client instance for CM Server
func GetHttpClient() *http.Client {
httpClient := &http.Client{
Transport: &http.Transport{
Expand Down Expand Up @@ -137,5 +137,5 @@ func (c CMServer) CreateGatewayCurlPostCommand(uri string) string {
}

func createGatewayCurlCommand(c CMServer, uri string, method string) string {
return fmt.Sprintf("curl -s -X %v -k -u %v:%v 'http://localhost:7180/api/%v/%v'", method, c.Username, c.Password, c.ApiVersion, uri)
return fmt.Sprintf("curl -s -X %v -k -u %v:%v 'http://localhost:7180/api/v%v/%v'", method, c.Username, c.Password, c.ApiVersion, uri)
}

0 comments on commit 2dc55a2

Please sign in to comment.