Skip to content

Instantly share code, notes, and snippets.

@ssigwart
Forked from mago0/redline_executor.rb
Last active May 20, 2017 15:31
Show Gist options
  • Save ssigwart/386b0f696ad4c4cc447c0612a60c2fc0 to your computer and use it in GitHub Desktop.
Save ssigwart/386b0f696ad4c4cc447c0612a60c2fc0 to your computer and use it in GitHub Desktop.
Segment of Redline13 Executor Script
require 'rest-client'
require 'json'
opts = {}
api_url = 'https://www.redline13.com/Api'
redline_key = 'REDACTED'
redline = RestClient::Resource.new(
"#{api_url}",
'headers' => {
'Accept' => 'application/json',
'Content-Type' => 'application/x-www-form-urlencoded',
'X-Redline-Auth' => "#{redline_key}"
}
)
pp JSON.parse(redline['/LoadTest'].post({
'testType' => 'jmeter-test',
'name' => 'API Test 1',
'file' => File.new('./Live-Stream-Test.jmx', 'rb'),
# 'extras', Removed
'numServers' => 1,
'storeOutput' => 'T',
'version' => '3.1',
'opts' => "#{opts.map {|k,v| "-G#{k}=#{v} "}.join(' ').to_s.strip}",
'plugin[]' => 'standard', # Changed
'plugin[]' => 'extras', # Changed
'plugin[]' => 'extraswithlibs', # Changed
'plugin[]' => 'ubikstream', # Changed
'jmeter-ubikstream-license' => File.new('./ubik-streaming-plugin.license', 'rb'), # Changed
'servers[0][location]' => 'us-east-1',
'servers[0][size]' => 'm3.medium',
'servers[0][num]' => 1,
'servers[0][onDemand]' => 'T',
'servers[0][usersPerServer]' => 1,
'keyPairId' => 'REDACTED'
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment