class UC3Resources::FunctionsClient
Query for repository images by tag
Public Class Methods
Source
# File app/lib/client/resources/functions.rb, line 10 def self.client UC3::UC3Client.clients.fetch(self.class.to_s, FunctionsClient.new) end
Source
# File app/lib/client/resources/functions.rb, line 14 def initialize @client = Aws::Lambda::Client.new( region: UC3::UC3Client.region ) @functions = {} @client.list_functions.functions.each do |function| @functions[function.function_name] = { name: function.function_name, runtime: function.runtime, timeout: function.timeout, memory: function.memory_size, last_modified: date_format(function.last_modified, convert_timezone: true), package_type: function.package_type, arn: function.function_arn } end super(enabled: enabled) rescue StandardError => e super(enabled: false, message: e.to_s) end
              Calls superclass method
              
        UC3::UC3Client::new
            Public Instance Methods
Source
# File app/lib/client/resources/functions.rb, line 35 def enabled !@client.nil? end
Source
# File app/lib/client/resources/functions.rb, line 39 def list_functions table = AdminUI::FilterTable.new( columns: [ AdminUI::Column.new(:name, header: 'Name'), AdminUI::Column.new(:runtime, header: 'Runtime', filterable: true), AdminUI::Column.new(:timeout, header: 'Timeout'), AdminUI::Column.new(:memory, header: 'Memory'), AdminUI::Column.new(:last_modified, header: 'Last Modified'), AdminUI::Column.new(:package_type, header: 'Package Type'), AdminUI::Column.new(:program, header: 'Program', filterable: true), AdminUI::Column.new(:service, header: 'Service', filterable: true) ] ) return table unless enabled @functions.sort.each do |_key, value| tags = @client.list_tags(resource: value[:arn]).tags.to_h value[:program] = tags.fetch('Program', '') value[:service] = tags.fetch('Service', '') table.add_row(AdminUI::Row.make_row(table.columns, value)) end table end