class CumulogicClient::Nosql
Constants
- NoSQLSpec
Public Class Methods
new(api_url, username, password, use_ssl=nil, debug=false)
click to toggle source
# File lib/cumulogic_client/nosql.rb, line 17 def initialize(api_url, username, password, use_ssl=nil, debug=false) @client = CumulogicClient::BaseClient.new(api_url, username, password, use_ssl, debug) end
Public Instance Methods
create(spec, wait=true)
click to toggle source
# File lib/cumulogic_client/nosql.rb, line 51 def create(spec, wait=true) response = @client.call('nosql/instance/createNoSqlInstance', spec.to_hash) @newInstanceId = response[0]['noSqlInstanceId'] @client.provisioning_completed(self, 30) if wait return @newInstanceId end
delete(instanceId)
click to toggle source
# File lib/cumulogic_client/nosql.rb, line 47 def delete(instanceId) return @client.call('nosql/instance/deleteNoSqlInstance', wrapParam(instanceId)) end
engine_list()
click to toggle source
# File lib/cumulogic_client/nosql.rb, line 21 def engine_list() return @client.call('nosql/nosqlengine/list') end
events(instanceId)
click to toggle source
# File lib/cumulogic_client/nosql.rb, line 33 def events(instanceId) return @client.call('nosql/instance/showEvents', wrapParams(instanceId)) end
get(instanceId)
click to toggle source
# File lib/cumulogic_client/nosql.rb, line 29 def get(instanceId) return @client.call('nosql/instance/getAllHostByNoSqlInstanceID', wrapParam(instanceId)) end
get_serviceplans(createdBy, serviceType)
click to toggle source
# File lib/cumulogic_client/nosql.rb, line 58 def get_serviceplans(createdBy, serviceType) @client.get_serviceplans(createdBy, serviceType) end
isComplete()
click to toggle source
# File lib/cumulogic_client/nosql.rb, line 62 def isComplete() instances = self.list() puts instances target = instances.select { |id| id["noSqlInstanceId"] = @newInstanceId } return false if (target[0]["status"] == 2) raise RuntimeError, "Error provisioning instance: #{target[0]["errorMessage"]}" if (target[0]["status"] == 3) return true end
list()
click to toggle source
# File lib/cumulogic_client/nosql.rb, line 25 def list() return @client.call('nosql/instance/list') end
terminate(instanceId)
click to toggle source
# File lib/cumulogic_client/nosql.rb, line 43 def terminate(instanceId) return @client.call('nosql/instance/terminateNoSqlInstance', wrapParam(instanceId)) end
wrapParam(instanceId)
click to toggle source
# File lib/cumulogic_client/nosql.rb, line 37 def wrapParam(instanceId) { 'noSqlInstanceId' => instanceId } end