lib/rezept/client.rb in rezept-0.1.0 vs lib/rezept/client.rb in rezept-0.2.0
- old
+ new
@@ -60,11 +60,11 @@
account_ids_to_add: add_ids,
account_ids_to_remove: rm_ids
)
end
- def get_target_instances(instance_ids, filters, next_token=nil)
+ def get_target_instances(instance_ids=nil, filters=nil, next_token=nil)
instances = []
ret = @ec2.describe_instances(
instance_ids: instance_ids,
filters: filters,
@@ -90,9 +90,31 @@
def list_command_invocations(command_id, next_token=nil)
ret = @ssm.list_command_invocations(command_id: command_id)
invocations = ret.command_invocations
invocations.concat(list_command_invocations(command_id, ret.next_token)) unless ret.next_token.nil?
invocations
+ end
+
+ def put_inventory(instance_id, type_name, schema_version, content)
+ @ssm.put_inventory(
+ instance_id: instance_id,
+ items: [
+ {
+ type_name: type_name,
+ schema_version: schema_version,
+ capture_time: Time.now.strftime('%Y-%m-%dT%H:%M:%SZ'),
+ content: [content],
+ },
+ ],
+ )
+ end
+
+ def list_inventory_entries(instance_id, type_name, filters)
+ @ssm.list_inventory_entries(
+ instance_id: instance_id,
+ type_name: type_name,
+ filters: filters,
+ )
end
end
end