Skip to content

Commit

Permalink
server quick load
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed Nov 22, 2024
1 parent d6cd6f4 commit e9de58c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions src-admintool/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ <h2>Merritt Internals</h2>
<li class="graph"><a class="json" href="{{ADMINTOOL_HOME}}?path=obsolete">Obsolete Container and Owner Objects</a></li>
<li class="graph"><a class="json" href="{{ADMINTOOL_HOME}}?path=admin_obj_agg">Merritt Admin Objects Count</a></li>
<li class="coll"><a class="json" href="{{ADMINTOOL_HOME}}?path=admin_coll">Collections Table Special Cases</a></li>
<li class="config"><a href="{{COLLADMIN_HOME}}?path=instances&timeout=1">Merritt Servers (quick load)</a></li>
<li class="config"><a href="{{COLLADMIN_HOME}}?path=instances">Merritt Servers</a></li>
<li class="config"><a href="{{COLLADMIN_HOME}}?path=ssm-describe">SSM Parameter Registry</a></li>
<li class="config"><a href="{{COLLADMIN_HOME}}?path=opensearch-describe">OpenSearch Field Registry</a></li>
Expand Down
15 changes: 7 additions & 8 deletions src-colladmin/actions/tag_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Ec2Info
@@service_tag = {}

# See https://docs.aws.amazon.com/sdk-for-ruby/v2/api/Aws/EC2/Client.html#describe_instances-instance_method
def initialize(config, inst)
def initialize(config, inst, httpclient)
@config = config
@state = inst.state.name
@type = inst.instance_type
Expand All @@ -37,10 +37,7 @@ def initialize(config, inst)
@name = tag.value if tag.key == 'Name'
@subservice = tag.value if tag.key == 'Subservice'
end
@httpclient = HTTPClient.new
@httpclient.receive_timeout = 10
@httpclient.connect_timeout = 5
@httpclient.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE
@httpclient = httpclient
@buildtag = ''
@starttime = ''
@servicestate = ''
Expand Down Expand Up @@ -255,11 +252,13 @@ def initialize(config, action, path, myparams)
@instances = {}
@name = myparams.fetch('name', '')
@label = myparams.fetch('label', '')
@timeout = myparams.fetch('timeout', '20')
@list_servers = @name.empty?

# allow longer timeout when retrieving a single host
@httpclient = HTTPClient.new
@httpclient.receive_timeout = 20
@httpclient.connect_timeout = 5
@httpclient.receive_timeout = @timeout.to_i
@httpclient.connect_timeout = 2
@httpclient.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE

data = @ec2.describe_instances({
Expand All @@ -281,7 +280,7 @@ def initialize(config, action, path, myparams)

data.reservations.each do |res|
res.instances.each do |inst|
ec2 = Ec2Info.new(config, inst)
ec2 = Ec2Info.new(config, inst, @httpclient)
@instances[ec2.name] = ec2
end
end
Expand Down
1 change: 1 addition & 0 deletions src-common/template/navmenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
<div class="dropdown-content">
<a class="reveal" href="{{ADMINTOOL_HOME}}#.nav_merritt_internals;.bp_internals">Merritt Admin Objects</a>
<a class="reveal" href="{{ADMINTOOL_HOME}}#.nav_merritt_users;.bp_users">Merritt User Accounts</a>
<a class="config" href="{{COLLADMIN_HOME}}?path=instances&timeout=1">Merritt Servers (quick load)</a>
<a class="config" href="{{COLLADMIN_HOME}}?path=instances">Merritt Servers</a>
<a class="config" href="{{COLLADMIN_HOME}}?path=uc3-instances">UC3 Servers</a>
<a class="config" href="{{COLLADMIN_HOME}}?path=ssm-describe">SSM Parameter Registry</a>
Expand Down

0 comments on commit e9de58c

Please sign in to comment.