Class: Stax::Aws::Ssm

Inherits:
Sdk
  • Object
show all
Defined in:
lib/stax/aws/ssm.rb

Constant Summary

Constants inherited from Sdk

Stax::Aws::Sdk::RETRY_LIMIT

Class Method Summary collapse

Methods inherited from Sdk

paginate

Class Method Details

.clientObject



9
10
11
# File 'lib/stax/aws/ssm.rb', line 9

def client
  @_client ||= ::Aws::SSM::Client.new
end

.commandsObject



21
22
23
# File 'lib/stax/aws/ssm.rb', line 21

def commands
  client.list_commands.commands
end

.delete(opt) ⇒ Object



43
44
45
# File 'lib/stax/aws/ssm.rb', line 43

def delete(opt)
  client.delete_parameters(opt).deleted_parameters
end

.get(opt) ⇒ Object



35
36
37
# File 'lib/stax/aws/ssm.rb', line 35

def get(opt)
  client.get_parameters(opt).parameters
end

.instances(stack) ⇒ Object



13
14
15
# File 'lib/stax/aws/ssm.rb', line 13

def instances(stack)
  client.describe_instance_information(filters: [{key: 'tag:aws:cloudformation:stack-name', values: [stack]}]).instance_information_list
end

.invocation(id) ⇒ Object



25
26
27
# File 'lib/stax/aws/ssm.rb', line 25

def invocation(id)
  client.list_command_invocations(command_id: id, details: true).command_invocations
end

.parameters(opt) ⇒ Object



29
30
31
32
33
# File 'lib/stax/aws/ssm.rb', line 29

def parameters(opt)
  paginate(:parameters) do |token|
    client.get_parameters_by_path(opt.merge(next_token: token))
  end
end

.put(opt) ⇒ Object



39
40
41
# File 'lib/stax/aws/ssm.rb', line 39

def put(opt)
  client.put_parameter(opt)
end

.run(opt) ⇒ Object



17
18
19
# File 'lib/stax/aws/ssm.rb', line 17

def run(opt)
  client.send_command(opt).command
end