class Marathon::Deployment

This class represents a Marathon Deployment. See mesosphere.github.io/marathon/docs/rest-api.html#deployments for full list of API's methods.

Constants

ACCESSORS

Attributes

currentActions[R]
steps[R]

Public Class Methods

cancel(id, force = false)
Alias for: delete
delete(id, force = false) click to toggle source

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.
# File lib/marathon/deployment.rb, line 45
def delete(id, force = false)
  Marathon.singleton.deployments.delete(id, force)
end
Also aliased as: cancel, remove
list() click to toggle source

List running deployments.

# File lib/marathon/deployment.rb, line 36
def list
  Marathon.singleton.deployments.list
end
new(hash, marathon_instance) click to toggle source

Create a new deployment object. hash: Hash including all attributes.

See https://mesosphere.github.io/marathon/docs/rest-api.html#get-/v2/deployments for full details.
Calls superclass method Marathon::Base::new
# File lib/marathon/deployment.rb, line 11
def initialize(hash, marathon_instance)
  super(hash, ACCESSORS)
  @marathon_instance = marathon_instance
  @currentActions = (info[:currentActions] || []).map { |e| Marathon::DeploymentAction.new(e) }
  @steps = (info[:steps] || []).map { |e| Marathon::DeploymentStep.new(e) }
end
remove(id, force = false)
Alias for: delete

Public Instance Methods

cancel(force = false)
Alias for: delete
delete(force = false) click to toggle source

Cancel the deployment. 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.
# File lib/marathon/deployment.rb, line 22
def delete(force = false)
  @marathon_instance.deployments.delete(id, force)
end
Also aliased as: cancel
to_s() click to toggle source
# File lib/marathon/deployment.rb, line 28
def to_s
  "Marathon::Deployment { " \
    + ":id => #{id} :affectedApps => #{affectedApps} :currentStep => #{currentStep} :totalSteps => #{totalSteps} }"
end