-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistucservice.rb
54 lines (40 loc) · 1016 Bytes
/
listucservice.rb
1
2
3
4
5
6
7
8
9
10
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
require 'savon'
require 'csv'
require 'json'
require_relative 'config'
path = 'routepatterns.csv'
uuid = Array.new
client = Savon.client(
wsdl: "lib/axl/#{VERSION}/AXLAPI.wsdl",
namespace: "http://www.cisco.com/AXL/API/#{VERSION}",
endpoint: "https://#{IP}:8443/axl/",
basic_auth: [USERNAME, PASSWORD],
headers: {'Content-Type' => 'text/xml; charset=utf-8'},
ssl_verify_mode: :none)
params = { returnedTags: {
name: ''
}, searchCriteria: {
name: '%'
}}
begin
response = client.call(:list_uc_service) do
message params
end
# puts response.body
response.body[:list_uc_service_response][:return][:uc_service].each do |r|
uuid << r[:@uuid]
# puts uuid
end
end
# puts uuid
uuid.each do |u|
paramlist = {
uuid: u
}
begin
responselist = client.call(:get_uc_service) do
message paramlist
end
end
puts responselist.body[:get_uc_service_response][:return].to_json
end