Class: Marathon::Deployments

Inherits:
Object
  • Object
show all
Defined in:
lib/marathon/deployment.rb

Overview

This class represents a set of Deployments

Instance Method Summary collapse

Constructor Details

#initialize(marathon_instance) ⇒ Deployments

Returns a new instance of Deployments.



56
57
58
59
# File 'lib/marathon/deployment.rb', line 56

def initialize(marathon_instance)
  @marathon_instance = marathon_instance
  @connection = @marathon_instance.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.


72
73
74
75
76
77
# File 'lib/marathon/deployment.rb', line 72

def delete(id, force = false)
  query = {}
  query[:force] = true if force
  json = @connection.delete("/v2/deployments/#{id}")
  Marathon::DeploymentInfo.new(json, @marathon_instance)
end

#listObject

List running deployments.



62
63
64
65
# File 'lib/marathon/deployment.rb', line 62

def list
  json = @connection.get('/v2/deployments')
  json.map { |j| Marathon::Deployment.new(j, @marathon_instance) }
end