Class: Marathon::Deployments
- Inherits:
-
Object
- Object
- Marathon::Deployments
- Defined in:
- lib/marathon/deployment.rb
Overview
This class represents a set of Deployments
Instance Method Summary collapse
-
#delete(id, force = false) ⇒ Object
Cancel the deployment with id.
-
#initialize(connection) ⇒ Deployments
constructor
A new instance of Deployments.
-
#list ⇒ Object
List running deployments.
Constructor Details
#initialize(connection) ⇒ Deployments
Returns a new instance of Deployments.
53 54 55 |
# File 'lib/marathon/deployment.rb', line 53 def initialize(connection) @connection = connection end |
Instance Method Details
#delete(id, force = false) ⇒ Object
Cancel the deployment with id. id: Deployment’s id force: If set to false (the default) then the deployment is canceled and a new deployment
is created to restore the previous configuration. If set to true, then the deployment
is still canceled but no rollback deployment is created.
67 68 69 70 71 72 |
# File 'lib/marathon/deployment.rb', line 67 def delete(id, force = false) query = {} query[:force] = true if force json = @connection.delete("/v2/deployments/#{id}") Marathon::DeploymentInfo.new(json) end |
#list ⇒ Object
List running deployments.
57 58 59 60 |
# File 'lib/marathon/deployment.rb', line 57 def list json = @connection.get('/v2/deployments') json.map { |j| Marathon::Deployment.new(j) } end |