Closed brianmcmichael closed 8 years ago
I generalized the #uri
method to use a template:
TEMPLATE = '{+scheme}{host}{/segments*}{?query*}'
I also allow from the config required query parameters and optional query parameters to be specified:
req_query:
c: 'Ruby'
opt_query:
h: '%{h}.ten.osc.edu'
Optional query parameters are only used if the developer specifies it in the url, and it overrides what the developer used through string interpolation using the query parameters as the context for the interpolation.
A quick and dirty solution to get just the host suffix:
ganglia_server.opt_query[:h] % {h: ""}
#=> ".ten.osc.edu"
To request ganglia information on a particular node, the url I currently build looks like:
To get this to work, the
.ten.osc.edu
host suffix that appears in&h=n0601.ten.osc.edu
at the end of the link is currently hard-coded at https://github.com/AweSim-OSC/osc-jobstatus/blob/master/app/views/pages/index.html.erb#L40This is because PBS only returns the node numbers and not the full hostnames of the running nodes.
For both
ruby
andoakley
, the suffix is.ten.osc.edu
, but obviously at other sites this would change.Not sure what the best name for this var would be, but it may be best to include it in
cluster.servers[:ganglia]