ruby-paloalto-client 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/palo_alto/client/version.rb +1 -1
- data/lib/palo_alto/v6/api.rb +32 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21d96fb59dffcf68776c9219faf338bb9455c2b7
|
4
|
+
data.tar.gz: 6bcf6faa772b0d8423948a758211ac752aa8a6c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e82323f35cac8155fba4c5dd5e0908a425e9a9f81dbb4d31b3d9c2811987cdb62d71843801e30e3057aab764751f9d4f89d721ea5308c167948058417bdf1373
|
7
|
+
data.tar.gz: faec242f95e59e6de10dd3fb06740d1fe00e2be22d440887137944e144a14bc0dd0bb19c169c8b8316fe975b889d6dead502730f4262f1b66a333a0603913970
|
data/lib/palo_alto/v6/api.rb
CHANGED
@@ -21,6 +21,38 @@ module PaloAlto
|
|
21
21
|
include PaloAlto::V6::CommitApi
|
22
22
|
include PaloAlto::V6::ZoneApi
|
23
23
|
include PaloAlto::V6::JobApi
|
24
|
+
|
25
|
+
|
26
|
+
# Request a configuration based on the starting XML path.
|
27
|
+
#
|
28
|
+
# == Returns
|
29
|
+
#
|
30
|
+
# * +Nokogiri::XML::Document+ - Nokogiri XML document to parse information about
|
31
|
+
#
|
32
|
+
# == Raises
|
33
|
+
#
|
34
|
+
# * +Exception+ - Raises an exception if the request is unsuccessful
|
35
|
+
def xml_config_for(path:)
|
36
|
+
virtual_systems_list = []
|
37
|
+
|
38
|
+
# configure options for the request
|
39
|
+
options = {}
|
40
|
+
options[:url] = self.endpoint
|
41
|
+
options[:method] = :post
|
42
|
+
options[:payload] = { type: "config",
|
43
|
+
action: "show",
|
44
|
+
key: self.auth_key,
|
45
|
+
xpath: path }
|
46
|
+
|
47
|
+
html_result = Helpers::Rest.make_request(options)
|
48
|
+
|
49
|
+
raise "Error obtaining virtual system XML" if html_result.nil?
|
50
|
+
|
51
|
+
# parse the XML data
|
52
|
+
data = Nokogiri::XML(html_result)
|
53
|
+
raise "Error in response XML: #{data.inspect}" if data.xpath('//response/@status').to_s != "success"
|
54
|
+
data
|
55
|
+
end
|
24
56
|
end
|
25
57
|
end
|
26
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-paloalto-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Karimi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: crack
|