Module: MgmtConsole::Client::EngageInstances
- Included in:
- MgmtConsole::Client
- Defined in:
- lib/mgmt_console/client/engage_instances.rb
Overview
Methods for the EngageInstances API
Instance Method Summary collapse
-
#create_engage_instance(options = {}) ⇒ Sawyer::Resource
Create Engage Instance.
-
#engage_instances(options = {}) ⇒ Array<Sawyer::Resource>
Get Engage Instances list.
-
#update_engage_instance(id = nil, options = {}) ⇒ Sawyer::Resource
Update Engage Instance.
Instance Method Details
#create_engage_instance(options = {}) ⇒ Sawyer::Resource
Create Engage Instance
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/mgmt_console/client/engage_instances.rb', line 21 def create_engage_instance( = {}) # Required dbname = .delete(:dbname) engage_server_id = .delete(:engage_server_id) raise MgmtConsole::BadRequest.new('You must provide the Engage Instance Database name as :dbname') unless dbname raise MgmtConsole::BadRequest.new('You must provide the Engage Server ID as :engage_server_id') unless engage_server_id # Optional salesforce_uid = .delete(:salesforce_uid) branch = .delete(:branch) commit = .delete(:commit) engage_environment_id = .delete(:engage_environment_id) params = { dbname: dbname, engage_server_id: engage_server_id, salesforce_uid: salesforce_uid, branch: branch, commit: commit, engage_environment_id: engage_environment_id, }.reject { |k,v| v.nil? } data = post("#{api_endpoint}/engage_instances", .merge(params)) end |
#engage_instances(options = {}) ⇒ Array<Sawyer::Resource>
Get Engage Instances list
12 13 14 |
# File 'lib/mgmt_console/client/engage_instances.rb', line 12 def engage_instances( = {}) paginate("#{api_endpoint}/engage_instances", ) end |
#update_engage_instance(id = nil, options = {}) ⇒ Sawyer::Resource
Update Engage Instance
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/mgmt_console/client/engage_instances.rb', line 52 def update_engage_instance(id=nil, = {}) # Required raise MgmtConsole::BadRequest.new('You must provide the Engage Instance ID as :id') unless id # Optional dbname = .delete(:dbname) engage_server_id = .delete(:engage_server_id) salesforce_uid = .delete(:salesforce_uid) branch = .delete(:branch) commit = .delete(:commit) engage_environment_id = .delete(:engage_environment_id) params = { dbname: dbname, engage_server_id: engage_server_id, salesforce_uid: salesforce_uid, branch: branch, commit: commit, engage_environment_id: engage_environment_id, }.reject { |k,v| v.nil? } data = patch("#{api_endpoint}/engage_instances/#{id}", .merge(params)) end |