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



7
8
9
# File 'lib/stax/aws/ssm.rb', line 7

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

.commandsObject



19
20
21
# File 'lib/stax/aws/ssm.rb', line 19

def commands
  client.list_commands.commands
end

.delete(opt) ⇒ Object



41
42
43
# File 'lib/stax/aws/ssm.rb', line 41

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

.get(opt) ⇒ Object



33
34
35
# File 'lib/stax/aws/ssm.rb', line 33

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

.instances(stack) ⇒ Object



11
12
13
# File 'lib/stax/aws/ssm.rb', line 11

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

.invocation(id) ⇒ Object



23
24
25
# File 'lib/stax/aws/ssm.rb', line 23

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

.parameters(opt) ⇒ Object



27
28
29
30
31
# File 'lib/stax/aws/ssm.rb', line 27

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

.put(opt) ⇒ Object



37
38
39
# File 'lib/stax/aws/ssm.rb', line 37

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

.run(opt) ⇒ Object



15
16
17
# File 'lib/stax/aws/ssm.rb', line 15

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