|
|
|
@ -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)
|
|
|
|
|
}
|
|
|
|
|