Class: Scalarium::API

Inherits:
Object
  • Object
show all
Defined in:
lib/scalarium-api-wrapper/api.rb

Instance Method Summary collapse

Instance Method Details

#deploy_application(app_id, options = {:comment => nil, :migrate => false}) ⇒ Object

Method allows to deploy application in scalarium

Parameters:

  • app_id (Hash)

    a customizable set of options

  • options (Hash) (defaults to: {:comment => nil, :migrate => false})

    a customizable set of options

Options Hash (app_id):

  • - (String)

    The ID of application we want to deploy.

Options Hash (options):

  • - (Hash)

    Hash with options: :comment - comment to be displayed on the deployment :migrate - boolean indicating if we should run the migrations too (false by default)



43
44
45
46
47
48
# File 'lib/scalarium-api-wrapper/api.rb', line 43

def deploy_application(app_id, options = {:comment => nil, :migrate => false})
  json_command = JSON.dump(:command => 'deploy', 
                           :comment => options[:comment], 
                           :migrate => options[:migrate])
  http_post_request(Scalarium.applications_url+"/#{app_id}/deploy", json_command)                         
end

#fetch_deployment_details(app_id, deployment_id) ⇒ Object

Method pings scalarium to check the details of the deploy (i.e. progress)



29
30
31
# File 'lib/scalarium-api-wrapper/api.rb', line 29

def fetch_deployment_details(app_id, deployment_id)
  http_get_request(Scalarium.applications_url+"/#{app_id}/deployments/#{deployment_id}")
end

#get_applicationsObject

Method fetches all applications on the server



20
21
22
# File 'lib/scalarium-api-wrapper/api.rb', line 20

def get_applications
  http_get_request(Scalarium.applications_url)
end

#get_cloudsObject

Method fetches all clouds on the server



12
13
14
# File 'lib/scalarium-api-wrapper/api.rb', line 12

def get_clouds
  http_get_request(Scalarium.clouds_url)      
end