11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/pvdgm-svc-client/service_mgr_options.rb', line 11
def initialize
@options = {}
@optparse = OptionParser.new do | opts |
opts.banner = "Usage: service_mgr [ options ] [ resource [command] ]"
opts.on '-h', '--help', 'Display the help message' do
puts opts
puts
print_valid_resources
puts
exit
end
@options[:server] = DEFAULT_SERVER
opts.on '-s', '--server SERVER', "Specify the abaqis server to hit (default #{DEFAULT_SERVER})" do | server |
@options[:server] = server
end
@options[:use_ssl] = DEFAULT_USE_SSL
opts.on '-n', '--no-ssl', "If specified, SSL will NOT be used for the call to the server" do
@options[:use_ssl] = false
end
opts.on '-u', '--unsafe', "If specified, will turn of SSL CA verification" do
OpenSSL::SSL.const_set(:VERIFY_PEER, OpenSSL::SSL::VERIFY_NONE)
end
opts.on '-l', '--list', 'List the valid commands' do
print_valid_resources
exit
end
@options[:api_token] = DEFAULT_TOKEN
opts.on '-t', '--token TOKEN', 'The API security token to use (defaults to ENV["API_TOKEN"])' do | token |
@options[:api_token] = token
end
opts.on '--local', 'Set the host to the localhost and non-ssl as a testing convenience' do
@options[:server] = LOCAL_SERVER
@options[:use_ssl] = false
end
opts.on '--uat', 'Set the host to the uat machine and ssl as a testing convenience' do
@options[:server] = UAT_SERVER
@options[:use_ssl] = true
end
@options[:trace] = false
opts.on '--trace', 'Set the output to verbose logging (including stack trace)' do
@options[:trace] = true
end
opts.on '--account-mapping-id ID', 'The ID of the account mapping object' do | id |
@options[:account_mapping_id] = id
end
opts.on '--configured-account-id ID', 'The ID of the configured account' do | id |
@options[:configured_account_id] = id
end
opts.on '--facility-mapping-id ID', 'The ID of the facility mapping' do | id |
@options[:facility_mapping_id] = id
end
opts.on '--service-definition-id ID', 'The ID of the service definition' do | id |
@options[:service_definition_id] = id
end
opts.on '--service-id ID', 'The ID of the service' do | id |
@options[:service_id] = id
end
opts.on '--third-party-id ID', 'The ID of the third party' do | id |
@options[:third_party_id] = id
end
end
end
|