ref(client): remove action param
This commit is contained in:
1 parent
ee2346e82a
commit
d91df39cba
2 files changed
+7
-7
No files matched your search
@@ -101,13 +101,13 @@ func (c *Client) agent() string {
|
||||
// CallService is a low-level function for making an API call.
|
||||
//
|
||||
// This calls the service and then unmarshals the returned data into dest.
|
||||
func (c *Client) CallService(path, method, action string, dest interface{}, reader io.Reader) error {
|
||||
func (c *Client) CallService(path, method string, dest interface{}, reader io.Reader) error {
|
||||
u, err := c.url(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
resp, err := c.callHTTP(u, method, action, reader)
|
||||
resp, err := c.callHTTP(u, method, reader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -118,7 +118,7 @@ func (c *Client) CallService(path, method, action string, dest interface{}, read
|
||||
}
|
||||
|
||||
// callHTTP is a low-level primitive for executing HTTP operations.
|
||||
func (c *Client) callHTTP(path, method, action string, reader io.Reader) (string, error) {
|
||||
func (c *Client) callHTTP(path, method string, reader io.Reader) (string, error) {
|
||||
request, err := http.NewRequest(method, path, reader)
|
||||
|
||||
// TODO: dynamically set version
|
||||
|
||||
@@ -32,7 +32,7 @@ import (
|
||||
// ListDeployments lists the deployments in DM.
|
||||
func (c *Client) ListDeployments() ([]string, error) {
|
||||
var l []string
|
||||
if err := c.CallService("deployments", "GET", "list deployments", &l, nil); err != nil {
|
||||
if err := c.CallService("deployments", "GET", &l, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ func (c *Client) PostChart(filename, deployname string) (string, error) {
|
||||
// GetDeployment retrieves the supplied deployment
|
||||
func (c *Client) GetDeployment(name string) (*common.Deployment, error) {
|
||||
var deployment *common.Deployment
|
||||
if err := c.CallService(fancypath.Join("deployments", name), "GET", "get deployment", &deployment, nil); err != nil {
|
||||
if err := c.CallService(fancypath.Join("deployments", name), "GET", &deployment, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return deployment, nil
|
||||
@@ -103,7 +103,7 @@ func (c *Client) GetDeployment(name string) (*common.Deployment, error) {
|
||||
// DeleteDeployment deletes the supplied deployment
|
||||
func (c *Client) DeleteDeployment(name string) (*common.Deployment, error) {
|
||||
var deployment *common.Deployment
|
||||
if err := c.CallService(filepath.Join("deployments", name), "DELETE", "delete deployment", &deployment, nil); err != nil {
|
||||
if err := c.CallService(filepath.Join("deployments", name), "DELETE", &deployment, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return deployment, nil
|
||||
@@ -129,5 +129,5 @@ func (c *Client) PostDeployment(name string, cfg *common.Configuration) error {
|
||||
var out struct{}
|
||||
|
||||
b := bytes.NewBuffer(data)
|
||||
return c.CallService("/deployments", "POST", "post deployment", &out, b)
|
||||
return c.CallService("/deployments", "POST", &out, b)
|
||||
}
|
||||
Reference in new issue
Block a user