multiregion CLI: nomad deployment unblock

This commit is contained in:
Tim Gross
2020-06-15 15:01:54 -04:00
parent ce8f230cab
commit c0974fe9af
6 changed files with 265 additions and 0 deletions

View File

@@ -107,6 +107,19 @@ func (d *Deployments) PromoteGroups(deploymentID string, groups []string, q *Wri
return &resp, wm, nil
}
// Unblock is used to unblock the given deployment.
func (d *Deployments) Unblock(deploymentID string, q *WriteOptions) (*DeploymentUpdateResponse, *WriteMeta, error) {
var resp DeploymentUpdateResponse
req := &DeploymentUnblockRequest{
DeploymentID: deploymentID,
}
wm, err := d.client.write("/v1/deployment/unblock/"+deploymentID, req, &resp, q)
if err != nil {
return nil, nil, err
}
return &resp, wm, nil
}
// SetAllocHealth is used to set allocation health for allocs that are part of
// the given deployment
func (d *Deployments) SetAllocHealth(deploymentID string, healthy, unhealthy []string, q *WriteOptions) (*DeploymentUpdateResponse, *WriteMeta, error) {
@@ -260,6 +273,12 @@ type DeploymentFailRequest struct {
WriteRequest
}
// DeploymentUnblockRequest is used to unblock a particular deployment
type DeploymentUnblockRequest struct {
DeploymentID string
WriteRequest
}
// SingleDeploymentResponse is used to respond with a single deployment
type SingleDeploymentResponse struct {
Deployment *Deployment