|
|
|
@ -32,11 +32,8 @@ import (
|
|
|
|
|
// ListDeployments lists the deployments in DM.
|
|
|
|
|
func (c *Client) ListDeployments() ([]string, error) {
|
|
|
|
|
var l []string
|
|
|
|
|
if err := c.CallService("deployments", "GET", &l, nil); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return l, nil
|
|
|
|
|
err := c.Get("deployments", &l)
|
|
|
|
|
return l, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PostChart sends a chart to DM for deploying.
|
|
|
|
@ -94,19 +91,15 @@ 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", &deployment, nil); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return deployment, nil
|
|
|
|
|
err := c.Get(fancypath.Join("deployments", name), &deployment)
|
|
|
|
|
return deployment, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 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", &deployment, nil); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return deployment, nil
|
|
|
|
|
err := c.Delete(filepath.Join("deployments", name), &deployment)
|
|
|
|
|
return deployment, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PostDeployment posts a deployment object to the manager service.
|
|
|
|
|