Sha256: c24d379f31dd7720b3a568c0a6389c43e757555e5ca445015562252e12adc352
Contents?: true
Size: 869 Bytes
Versions: 56
Compression:
Stored size: 869 Bytes
Contents
# frozen_string_literal: true # # Collect Lightsail resources # class Lightsail < Mapper # # Returns an array of resources. # def collect resources = [] # # get_instances # @client.get_instances.each_with_index do |response, page| log(response.context.operation_name, page) response.instances.each do |instance| struct = OpenStruct.new(instance.to_h) struct.type = 'instance' resources.push(struct.to_h) end end # # get_load_balancers # @client.get_load_balancers.each_with_index do |response, page| log(response.context.operation_name, page) response.load_balancers.each do |load_balancer| struct = OpenStruct.new(load_balancer.to_h) struct.type = 'load_balancer' resources.push(struct.to_h) end end resources end end
Version data entries
56 entries across 56 versions & 1 rubygems