Class: Amazon::Coral::ElasticMapReduceClient

Inherits:
Object
  • Object
show all
Defined in:
lib/amazon/coral/elasticmapreduceclient.rb

Overview

Client interface for calling ElasticMapReduce.

The client supports two mechanisms to invoke each remote service call: a simple approach which directly calls the remote service, or a Call based mechanism that allows you to control aspects of the outgoing request such as request-id and identity attributes.

Each instance of a client interface is backed by an Orchestrator object which manages the processing of each request to the remote service. Clients can be instantiated with a custom orchestrator or with presets corresponding to particular protocols. Inputs and return values to the direct service-call methods and the Call.call methods are hashes.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(orchestrator) ⇒ ElasticMapReduceClient

Construct a new client. Takes an orchestrator through which to process requests. See additional constructors below to use pre-configured orchestrators for specific protocols.

orchestrator

The Orchestrator is responsible for actually making the remote service call. Clients construct requests, hand them off to the orchestrator, and receive responses in return.


29
30
31
32
33
34
35
36
37
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 29

def initialize(orchestrator)
  @addJobFlowStepsDispatcher = Dispatcher.new(orchestrator, 'ElasticMapReduce', 'AddJobFlowSteps')
  @addInstanceGroupsDispatcher = Dispatcher.new(orchestrator, 'ElasticMapReduce', 'AddInstanceGroups')
  @terminateJobFlowsDispatcher = Dispatcher.new(orchestrator, 'ElasticMapReduce', 'TerminateJobFlows')
  @setTerminationProtectionDispatcher = Dispatcher.new(orchestrator, 'ElasticMapReduce', 'SetTerminationProtection')
  @describeJobFlowsDispatcher = Dispatcher.new(orchestrator, 'ElasticMapReduce', 'DescribeJobFlows')
  @runJobFlowDispatcher = Dispatcher.new(orchestrator, 'ElasticMapReduce', 'RunJobFlow')
  @modifyInstanceGroupsDispatcher = Dispatcher.new(orchestrator, 'ElasticMapReduce', 'ModifyInstanceGroups')
end

Class Method Details

.new_aws_query(args) ⇒ Object

Instantiates the client with an orchestrator configured for use with AWS/QUERY. Use of this constructor is deprecated in favor of using the AwsQuery class:

client = ElasticMapReduceClient.new(AwsQuery.new_orchestrator(args))

179
180
181
182
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 179

def ElasticMapReduceClient.new_aws_query(args)
  require 'amazon/coral/awsquery'
  ElasticMapReduceClient.new(AwsQuery.new_orchestrator(args))
end

Instance Method Details

#AddInstanceGroups(input = {}) ⇒ Object

Shorthand method to invoke the AddInstanceGroups operation:

Example usage:

my_client.AddInstanceGroups(my_input)

137
138
139
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 137

def AddInstanceGroups(input = {})
  newAddInstanceGroupsCall.call(input)
end

#AddJobFlowSteps(input = {}) ⇒ Object

Shorthand method to invoke the AddJobFlowSteps operation:

Example usage:

my_client.AddJobFlowSteps(my_input)

129
130
131
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 129

def AddJobFlowSteps(input = {})
  newAddJobFlowStepsCall.call(input)
end

#DescribeJobFlows(input = {}) ⇒ Object

Shorthand method to invoke the DescribeJobFlows operation:

Example usage:

my_output = my_client.DescribeJobFlows(my_input)

158
159
160
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 158

def DescribeJobFlows(input = {})
  newDescribeJobFlowsCall.call(input)
end

#ModifyInstanceGroups(input = {}) ⇒ Object


171
172
173
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 171

def ModifyInstanceGroups(input = {})
  newModifyInstanceGroupsCall.call(input)
end

#newAddInstanceGroupsCallObject

Instantiates a call object to invoke the AddInstanceGroups operation:

Example usage:

my_call = my_client.newAddInstanceGroupsCall
# set identity information if needed
my_call.identity[:aws_access_key] = my_access_key
my_call.identity[:aws_secret_key] = my_secret_key
# make the remote call
my_call.call(my_input)
# retrieve the request-id returned by the server
my_request_id = my_call.request_id

66
67
68
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 66

def newAddInstanceGroupsCall
  Call.new(@addInstanceGroupsDispatcher)
end

#newAddJobFlowStepsCallObject

Instantiates a call object to invoke the AddJobFlowSteps operation:

Example usage:

my_call = my_client.newAddJobFlowStepsCall
# set identity information if needed
my_call.identity[:aws_access_key] = my_access_key
my_call.identity[:aws_secret_key] = my_secret_key
# make the remote call
my_call.call(my_input)
# retrieve the request-id returned by the server
my_request_id = my_call.request_id

51
52
53
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 51

def newAddJobFlowStepsCall
  Call.new(@addJobFlowStepsDispatcher)
end

#newDescribeJobFlowsCallObject

Instantiates a call object to invoke the DescribeJobFlows operation:

Example usage:

my_call = my_client.newDescribeJobFlowsCall
# set identity information if needed
my_call.identity[:aws_access_key] = my_access_key
my_call.identity[:aws_secret_key] = my_secret_key
# make the remote call
my_output = my_call.call(my_input)
# retrieve the request-id returned by the server
my_request_id = my_call.request_id

101
102
103
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 101

def newDescribeJobFlowsCall
  Call.new(@describeJobFlowsDispatcher)
end

#newModifyInstanceGroupsCallObject


120
121
122
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 120

def newModifyInstanceGroupsCall
  Call.new(@modifyInstanceGroupsDispatcher)
end

#newRunJobFlowCallObject

Instantiates a call object to invoke the RunJobFlow operation:

Example usage:

my_call = my_client.newRunJobFlowCall
# set identity information if needed
my_call.identity[:aws_access_key] = my_access_key
my_call.identity[:aws_secret_key] = my_secret_key
# make the remote call
my_output = my_call.call(my_input)
# retrieve the request-id returned by the server
my_request_id = my_call.request_id

116
117
118
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 116

def newRunJobFlowCall
  Call.new(@runJobFlowDispatcher)
end

#newSetTerminationProtectionCallObject

Instantiates a call object to invoke the SetTerminationProtection operation:


86
87
88
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 86

def newSetTerminationProtectionCall
  Call.new(@setTerminationProtectionDispatcher)
end

#newTerminateJobFlowsCallObject

Instantiates a call object to invoke the TerminateJobFlows operation:

Example usage:

my_call = my_client.newTerminateJobFlowsCall
# set identity information if needed
my_call.identity[:aws_access_key] = my_access_key
my_call.identity[:aws_secret_key] = my_secret_key
# make the remote call
my_call.call(my_input)
# retrieve the request-id returned by the server
my_request_id = my_call.request_id

81
82
83
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 81

def newTerminateJobFlowsCall
  Call.new(@terminateJobFlowsDispatcher)
end

#RunJobFlow(input = {}) ⇒ Object

Shorthand method to invoke the RunJobFlow operation:

Example usage:

my_output = my_client.RunJobFlow(my_input)

166
167
168
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 166

def RunJobFlow(input = {})
  newRunJobFlowCall.call(input)
end

#SetTerminationProtection(input = {}) ⇒ Object

Shorthand method to invoke the SetTerminationProtection operation:


150
151
152
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 150

def SetTerminationProtection(input = {})
  newSetTerminationProtectionCall.call(input)
end

#TerminateJobFlows(input = {}) ⇒ Object

Shorthand method to invoke the TerminateJobFlows operation:

Example usage:

my_client.TerminateJobFlows(my_input)

145
146
147
# File 'lib/amazon/coral/elasticmapreduceclient.rb', line 145

def TerminateJobFlows(input = {})
  newTerminateJobFlowsCall.call(input)
end