deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jprov...@redhat.com
Subject [PATCH] Initial RHEV network implementation
Date Tue, 19 Feb 2013 13:56:56 GMT
From: Jan Provaznik <jprovazn@redhat.com>

There is not much in this patch, it adds only network listing.
RHEV networking is quite different from cloud providers like EC2.
A user is allowed to create a VNIC(s) for a VM, then by associating
these VNICs with networks she specifies to which network the VM
belongs to.
---
 .../lib/deltacloud/drivers/rhevm/rhevm_driver.rb   |  47 ++
 .../test_0002_must_return_list_of_networks.yml     | 313 +++++++++
 .../test_0003_must_allow_to_filter_networks.yml    | 778 +++++++++++++++++++++
 ..._0004_must_allow_to_retrieve_single_network.yml | 468 +++++++++++++
 server/tests/drivers/rhevm/networks_test.rb        |  42 ++
 5 files changed, 1648 insertions(+)
 create mode 100644 server/tests/drivers/rhevm/fixtures/test_0002_must_return_list_of_networks.yml
 create mode 100644 server/tests/drivers/rhevm/fixtures/test_0003_must_allow_to_filter_networks.yml
 create mode 100644 server/tests/drivers/rhevm/fixtures/test_0004_must_allow_to_retrieve_single_network.yml
 create mode 100644 server/tests/drivers/rhevm/networks_test.rb

diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
index 65ba26d..d425ac4 100644
--- a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
+++ b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
@@ -201,6 +201,42 @@ class RhevmDriver < Deltacloud::BaseDriver
     end
   end
 
+  def networks(credentials, opts={})
+    client = new_client(credentials)
+    networks = []
+    safely do
+      client.networks(opts).each do |n|
+        networks << convert_network(n)
+      end
+    end
+    filter_on(networks, :id, opts)
+  end
+
+  #def create_network(credentials, opts={})
+  #  RHEV API supports creation of networks, but network creation is
+  #  admin task, it's not expected to create networks on demand.
+  #  If we want to have this action, it must also be implemented in
+  #  rbovirt at first
+  #end
+
+  #def destroy_network(credentials, opts={})
+  #  RHEV API supports deletion of networks, but network creation is
+  #  admin task, it's not expected to delete networks on demand.
+  #  If we want to have this action, it must also be implemented in
+  #  rbovirt at first
+  #end
+
+  #def subnets(credentials, opts={})
+  #  there is not any suitable entity in RHEV networking model
+  #end
+
+  #def ports(credentials, opts={})
+  #  there is not any suitable entity in RHEV networking model,
+  #  instead of it a user creates one or more virtual NIC for a
+  #  virtual machine, this VNIC is then associated with a logical
+  #  network
+  #end
+
   private
 
   def new_client(credentials)
@@ -337,6 +373,17 @@ class RhevmDriver < Deltacloud::BaseDriver
     )
   end
 
+  def convert_network(n)
+    Network.new(
+      :id     => n.id,
+      :name   => n.name,
+      # TODO: unify states across all providers (once we know values returned by
+      # other providers).
+      # possible values returned by RHEV: operational, non_operational
+      :state  => n.status
+    )
+  end
+
   exceptions do
 
     on /Unauthorized/ do
diff --git a/server/tests/drivers/rhevm/fixtures/test_0002_must_return_list_of_networks.yml b/server/tests/drivers/rhevm/fixtures/test_0002_must_return_list_of_networks.yml
new file mode 100644
index 0000000..03034a0
--- /dev/null
+++ b/server/tests/drivers/rhevm/fixtures/test_0002_must_return_list_of_networks.yml
@@ -0,0 +1,313 @@
+---
+http_interactions:
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 09:51:51 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=tk2i3fw5vecsT9E+VYMkvEjA; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '828'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\">\n
+        \   <name>Default</name>\n    <description>The default Data Center</description>\n
+        \   <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/storagedomains\"
+        rel=\"storagedomains\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/permissions\"
+        rel=\"permissions\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/quotas\"
+        rel=\"quotas\"/>\n    <storage_type>nfs</storage_type>\n    <storage_format>v3</storage_format>\n
+        \   <version major=\"3\" minor=\"1\"/>\n    <supported_versions>\n        <version
+        major=\"3\" minor=\"1\"/>\n    </supported_versions>\n    <status>\n        <state>up</state>\n
+        \   </status>\n</data_center>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 09:51:50 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters?search=datacenter=Default
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 09:51:51 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=dy+6iWWqnACWfPwzNFnybsBR; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '1232'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<clusters>\n
+        \   <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\" id=\"99408929-82cf-4dc7-a532-9d998063fa95\">\n
+        \       <name>Default</name>\n        <description>The default server cluster</description>\n
+        \       <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks\"
+        rel=\"networks\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/permissions\"
+        rel=\"permissions\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes\"
+        rel=\"glustervolumes\"/>\n        <cpu id=\"Intel Westmere Family\"/>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <memory_policy>\n            <overcommit percent=\"150\"/>\n            <transparent_hugepages>\n
+        \               <enabled>true</enabled>\n            </transparent_hugepages>\n
+        \       </memory_policy>\n        <scheduling_policy/>\n        <version major=\"3\"
+        minor=\"1\"/>\n        <error_handling>\n            <on_error>migrate</on_error>\n
+        \       </error_handling>\n        <virt_service>true</virt_service>\n        <gluster_service>false</gluster_service>\n
+        \   </cluster>\n</clusters>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 09:51:50 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 09:51:51 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=RY7kHc7XSx14jmY1rEUMRliU; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '866'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<networks>\n
+        \   <network href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks/00000000-0000-0000-0000-000000000009\"
+        id=\"00000000-0000-0000-0000-000000000009\">\n        <name>rhevm</name>\n
+        \       <description>Management Network</description>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\"
+        id=\"99408929-82cf-4dc7-a532-9d998063fa95\"/>\n        <stp>false</stp>\n
+        \       <status>\n            <state>operational</state>\n        </status>\n
+        \       <display>true</display>\n        <mtu>0</mtu>\n        <usages>\n
+        \           <usage>vm</usage>\n            <usage>display</usage>\n        </usages>\n
+        \       <required>true</required>\n    </network>\n</networks>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 09:51:51 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 09:51:52 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=4gkxQteZOgi3Rtdq9bbrG9e9; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '828'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\">\n
+        \   <name>Default</name>\n    <description>The default Data Center</description>\n
+        \   <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/storagedomains\"
+        rel=\"storagedomains\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/permissions\"
+        rel=\"permissions\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/quotas\"
+        rel=\"quotas\"/>\n    <storage_type>nfs</storage_type>\n    <storage_format>v3</storage_format>\n
+        \   <version major=\"3\" minor=\"1\"/>\n    <supported_versions>\n        <version
+        major=\"3\" minor=\"1\"/>\n    </supported_versions>\n    <status>\n        <state>up</state>\n
+        \   </status>\n</data_center>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 09:51:51 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters?search=datacenter=Default
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 09:51:52 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=rxIWEvT7CHhurOi0gFfSB66V; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '1232'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<clusters>\n
+        \   <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\" id=\"99408929-82cf-4dc7-a532-9d998063fa95\">\n
+        \       <name>Default</name>\n        <description>The default server cluster</description>\n
+        \       <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks\"
+        rel=\"networks\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/permissions\"
+        rel=\"permissions\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes\"
+        rel=\"glustervolumes\"/>\n        <cpu id=\"Intel Westmere Family\"/>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <memory_policy>\n            <overcommit percent=\"150\"/>\n            <transparent_hugepages>\n
+        \               <enabled>true</enabled>\n            </transparent_hugepages>\n
+        \       </memory_policy>\n        <scheduling_policy/>\n        <version major=\"3\"
+        minor=\"1\"/>\n        <error_handling>\n            <on_error>migrate</on_error>\n
+        \       </error_handling>\n        <virt_service>true</virt_service>\n        <gluster_service>false</gluster_service>\n
+        \   </cluster>\n</clusters>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 09:51:51 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 09:51:52 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=jHBsG5fHO+aOB9QxjFU9V6ob; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '866'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<networks>\n
+        \   <network href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks/00000000-0000-0000-0000-000000000009\"
+        id=\"00000000-0000-0000-0000-000000000009\">\n        <name>rhevm</name>\n
+        \       <description>Management Network</description>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\"
+        id=\"99408929-82cf-4dc7-a532-9d998063fa95\"/>\n        <stp>false</stp>\n
+        \       <status>\n            <state>operational</state>\n        </status>\n
+        \       <display>true</display>\n        <mtu>0</mtu>\n        <usages>\n
+        \           <usage>vm</usage>\n            <usage>display</usage>\n        </usages>\n
+        \       <required>true</required>\n    </network>\n</networks>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 09:51:51 GMT
+recorded_with: VCR 2.4.0
diff --git a/server/tests/drivers/rhevm/fixtures/test_0003_must_allow_to_filter_networks.yml b/server/tests/drivers/rhevm/fixtures/test_0003_must_allow_to_filter_networks.yml
new file mode 100644
index 0000000..b0ee48a
--- /dev/null
+++ b/server/tests/drivers/rhevm/fixtures/test_0003_must_allow_to_filter_networks.yml
@@ -0,0 +1,778 @@
+---
+http_interactions:
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=xJmBuD3AI-ynJMxFvFu50Kel; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '828'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\">\n
+        \   <name>Default</name>\n    <description>The default Data Center</description>\n
+        \   <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/storagedomains\"
+        rel=\"storagedomains\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/permissions\"
+        rel=\"permissions\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/quotas\"
+        rel=\"quotas\"/>\n    <storage_type>nfs</storage_type>\n    <storage_format>v3</storage_format>\n
+        \   <version major=\"3\" minor=\"1\"/>\n    <supported_versions>\n        <version
+        major=\"3\" minor=\"1\"/>\n    </supported_versions>\n    <status>\n        <state>up</state>\n
+        \   </status>\n</data_center>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters?search=datacenter=Default
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=G5Gs-52aXqE+y23xd3+M6hyg; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '1232'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<clusters>\n
+        \   <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\" id=\"99408929-82cf-4dc7-a532-9d998063fa95\">\n
+        \       <name>Default</name>\n        <description>The default server cluster</description>\n
+        \       <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks\"
+        rel=\"networks\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/permissions\"
+        rel=\"permissions\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes\"
+        rel=\"glustervolumes\"/>\n        <cpu id=\"Intel Westmere Family\"/>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <memory_policy>\n            <overcommit percent=\"150\"/>\n            <transparent_hugepages>\n
+        \               <enabled>true</enabled>\n            </transparent_hugepages>\n
+        \       </memory_policy>\n        <scheduling_policy/>\n        <version major=\"3\"
+        minor=\"1\"/>\n        <error_handling>\n            <on_error>migrate</on_error>\n
+        \       </error_handling>\n        <virt_service>true</virt_service>\n        <gluster_service>false</gluster_service>\n
+        \   </cluster>\n</clusters>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=pXTsCeEi1qr7ciQJj6Ba2SyJ; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '866'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<networks>\n
+        \   <network href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks/00000000-0000-0000-0000-000000000009\"
+        id=\"00000000-0000-0000-0000-000000000009\">\n        <name>rhevm</name>\n
+        \       <description>Management Network</description>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\"
+        id=\"99408929-82cf-4dc7-a532-9d998063fa95\"/>\n        <stp>false</stp>\n
+        \       <status>\n            <state>operational</state>\n        </status>\n
+        \       <display>true</display>\n        <mtu>0</mtu>\n        <usages>\n
+        \           <usage>vm</usage>\n            <usage>display</usage>\n        </usages>\n
+        \       <required>true</required>\n    </network>\n</networks>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=uRBCUz3dNc7p13z+CmlBnXLR; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '828'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\">\n
+        \   <name>Default</name>\n    <description>The default Data Center</description>\n
+        \   <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/storagedomains\"
+        rel=\"storagedomains\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/permissions\"
+        rel=\"permissions\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/quotas\"
+        rel=\"quotas\"/>\n    <storage_type>nfs</storage_type>\n    <storage_format>v3</storage_format>\n
+        \   <version major=\"3\" minor=\"1\"/>\n    <supported_versions>\n        <version
+        major=\"3\" minor=\"1\"/>\n    </supported_versions>\n    <status>\n        <state>up</state>\n
+        \   </status>\n</data_center>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters?search=datacenter=Default
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=z7zwGvw66Q8FbuJD7Avv6j26; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '1232'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<clusters>\n
+        \   <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\" id=\"99408929-82cf-4dc7-a532-9d998063fa95\">\n
+        \       <name>Default</name>\n        <description>The default server cluster</description>\n
+        \       <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks\"
+        rel=\"networks\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/permissions\"
+        rel=\"permissions\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes\"
+        rel=\"glustervolumes\"/>\n        <cpu id=\"Intel Westmere Family\"/>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <memory_policy>\n            <overcommit percent=\"150\"/>\n            <transparent_hugepages>\n
+        \               <enabled>true</enabled>\n            </transparent_hugepages>\n
+        \       </memory_policy>\n        <scheduling_policy/>\n        <version major=\"3\"
+        minor=\"1\"/>\n        <error_handling>\n            <on_error>migrate</on_error>\n
+        \       </error_handling>\n        <virt_service>true</virt_service>\n        <gluster_service>false</gluster_service>\n
+        \   </cluster>\n</clusters>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=mp3wGIv9csqf+AmHKBXg7dCa; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '866'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<networks>\n
+        \   <network href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks/00000000-0000-0000-0000-000000000009\"
+        id=\"00000000-0000-0000-0000-000000000009\">\n        <name>rhevm</name>\n
+        \       <description>Management Network</description>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\"
+        id=\"99408929-82cf-4dc7-a532-9d998063fa95\"/>\n        <stp>false</stp>\n
+        \       <status>\n            <state>operational</state>\n        </status>\n
+        \       <display>true</display>\n        <mtu>0</mtu>\n        <usages>\n
+        \           <usage>vm</usage>\n            <usage>display</usage>\n        </usages>\n
+        \       <required>true</required>\n    </network>\n</networks>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=ctkB+vd4F5kvyQVAKaaYfcKw; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '828'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\">\n
+        \   <name>Default</name>\n    <description>The default Data Center</description>\n
+        \   <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/storagedomains\"
+        rel=\"storagedomains\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/permissions\"
+        rel=\"permissions\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/quotas\"
+        rel=\"quotas\"/>\n    <storage_type>nfs</storage_type>\n    <storage_format>v3</storage_format>\n
+        \   <version major=\"3\" minor=\"1\"/>\n    <supported_versions>\n        <version
+        major=\"3\" minor=\"1\"/>\n    </supported_versions>\n    <status>\n        <state>up</state>\n
+        \   </status>\n</data_center>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters?search=datacenter=Default
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=y7Vqz9mlTFgrpMktW8rQs0UC; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '1232'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<clusters>\n
+        \   <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\" id=\"99408929-82cf-4dc7-a532-9d998063fa95\">\n
+        \       <name>Default</name>\n        <description>The default server cluster</description>\n
+        \       <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks\"
+        rel=\"networks\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/permissions\"
+        rel=\"permissions\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes\"
+        rel=\"glustervolumes\"/>\n        <cpu id=\"Intel Westmere Family\"/>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <memory_policy>\n            <overcommit percent=\"150\"/>\n            <transparent_hugepages>\n
+        \               <enabled>true</enabled>\n            </transparent_hugepages>\n
+        \       </memory_policy>\n        <scheduling_policy/>\n        <version major=\"3\"
+        minor=\"1\"/>\n        <error_handling>\n            <on_error>migrate</on_error>\n
+        \       </error_handling>\n        <virt_service>true</virt_service>\n        <gluster_service>false</gluster_service>\n
+        \   </cluster>\n</clusters>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=v+l5CiAiULHfgyxcE+3gOG2m; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '866'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<networks>\n
+        \   <network href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks/00000000-0000-0000-0000-000000000009\"
+        id=\"00000000-0000-0000-0000-000000000009\">\n        <name>rhevm</name>\n
+        \       <description>Management Network</description>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\"
+        id=\"99408929-82cf-4dc7-a532-9d998063fa95\"/>\n        <stp>false</stp>\n
+        \       <status>\n            <state>operational</state>\n        </status>\n
+        \       <display>true</display>\n        <mtu>0</mtu>\n        <usages>\n
+        \           <usage>vm</usage>\n            <usage>display</usage>\n        </usages>\n
+        \       <required>true</required>\n    </network>\n</networks>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=7fYVGkEPNQ3D-3WyXgz+1GxP; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '828'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\">\n
+        \   <name>Default</name>\n    <description>The default Data Center</description>\n
+        \   <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/storagedomains\"
+        rel=\"storagedomains\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/permissions\"
+        rel=\"permissions\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/quotas\"
+        rel=\"quotas\"/>\n    <storage_type>nfs</storage_type>\n    <storage_format>v3</storage_format>\n
+        \   <version major=\"3\" minor=\"1\"/>\n    <supported_versions>\n        <version
+        major=\"3\" minor=\"1\"/>\n    </supported_versions>\n    <status>\n        <state>up</state>\n
+        \   </status>\n</data_center>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters?search=datacenter=Default
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=xFt2r2Ux5FuVh2tnAvBTyKf-; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '1232'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<clusters>\n
+        \   <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\" id=\"99408929-82cf-4dc7-a532-9d998063fa95\">\n
+        \       <name>Default</name>\n        <description>The default server cluster</description>\n
+        \       <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks\"
+        rel=\"networks\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/permissions\"
+        rel=\"permissions\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes\"
+        rel=\"glustervolumes\"/>\n        <cpu id=\"Intel Westmere Family\"/>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <memory_policy>\n            <overcommit percent=\"150\"/>\n            <transparent_hugepages>\n
+        \               <enabled>true</enabled>\n            </transparent_hugepages>\n
+        \       </memory_policy>\n        <scheduling_policy/>\n        <version major=\"3\"
+        minor=\"1\"/>\n        <error_handling>\n            <on_error>migrate</on_error>\n
+        \       </error_handling>\n        <virt_service>true</virt_service>\n        <gluster_service>false</gluster_service>\n
+        \   </cluster>\n</clusters>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:21 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=KxDvyFhmAUmjwATnrJChvW94; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '866'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<networks>\n
+        \   <network href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks/00000000-0000-0000-0000-000000000009\"
+        id=\"00000000-0000-0000-0000-000000000009\">\n        <name>rhevm</name>\n
+        \       <description>Management Network</description>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\"
+        id=\"99408929-82cf-4dc7-a532-9d998063fa95\"/>\n        <stp>false</stp>\n
+        \       <status>\n            <state>operational</state>\n        </status>\n
+        \       <display>true</display>\n        <mtu>0</mtu>\n        <usages>\n
+        \           <usage>vm</usage>\n            <usage>display</usage>\n        </usages>\n
+        \       <required>true</required>\n    </network>\n</networks>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:21 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:22 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=nBpipdZnrqbIYdOeC0HkV7+e; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '828'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\">\n
+        \   <name>Default</name>\n    <description>The default Data Center</description>\n
+        \   <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/storagedomains\"
+        rel=\"storagedomains\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/permissions\"
+        rel=\"permissions\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/quotas\"
+        rel=\"quotas\"/>\n    <storage_type>nfs</storage_type>\n    <storage_format>v3</storage_format>\n
+        \   <version major=\"3\" minor=\"1\"/>\n    <supported_versions>\n        <version
+        major=\"3\" minor=\"1\"/>\n    </supported_versions>\n    <status>\n        <state>up</state>\n
+        \   </status>\n</data_center>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:21 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters?search=datacenter=Default
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:22 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=JoNaAJDMY6ensKaWbqR4qMez; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '1232'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<clusters>\n
+        \   <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\" id=\"99408929-82cf-4dc7-a532-9d998063fa95\">\n
+        \       <name>Default</name>\n        <description>The default server cluster</description>\n
+        \       <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks\"
+        rel=\"networks\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/permissions\"
+        rel=\"permissions\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes\"
+        rel=\"glustervolumes\"/>\n        <cpu id=\"Intel Westmere Family\"/>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <memory_policy>\n            <overcommit percent=\"150\"/>\n            <transparent_hugepages>\n
+        \               <enabled>true</enabled>\n            </transparent_hugepages>\n
+        \       </memory_policy>\n        <scheduling_policy/>\n        <version major=\"3\"
+        minor=\"1\"/>\n        <error_handling>\n            <on_error>migrate</on_error>\n
+        \       </error_handling>\n        <virt_service>true</virt_service>\n        <gluster_service>false</gluster_service>\n
+        \   </cluster>\n</clusters>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:21 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:22 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=pgdHPob+OE1ehbMUKDnl-1bY; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '866'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<networks>\n
+        \   <network href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks/00000000-0000-0000-0000-000000000009\"
+        id=\"00000000-0000-0000-0000-000000000009\">\n        <name>rhevm</name>\n
+        \       <description>Management Network</description>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\"
+        id=\"99408929-82cf-4dc7-a532-9d998063fa95\"/>\n        <stp>false</stp>\n
+        \       <status>\n            <state>operational</state>\n        </status>\n
+        \       <display>true</display>\n        <mtu>0</mtu>\n        <usages>\n
+        \           <usage>vm</usage>\n            <usage>display</usage>\n        </usages>\n
+        \       <required>true</required>\n    </network>\n</networks>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:21 GMT
+recorded_with: VCR 2.4.0
diff --git a/server/tests/drivers/rhevm/fixtures/test_0004_must_allow_to_retrieve_single_network.yml b/server/tests/drivers/rhevm/fixtures/test_0004_must_allow_to_retrieve_single_network.yml
new file mode 100644
index 0000000..b5e0d9b
--- /dev/null
+++ b/server/tests/drivers/rhevm/fixtures/test_0004_must_allow_to_retrieve_single_network.yml
@@ -0,0 +1,468 @@
+---
+http_interactions:
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=4ZzaBGyCfpehSuXQO3yPwJXR; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '828'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\">\n
+        \   <name>Default</name>\n    <description>The default Data Center</description>\n
+        \   <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/storagedomains\"
+        rel=\"storagedomains\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/permissions\"
+        rel=\"permissions\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/quotas\"
+        rel=\"quotas\"/>\n    <storage_type>nfs</storage_type>\n    <storage_format>v3</storage_format>\n
+        \   <version major=\"3\" minor=\"1\"/>\n    <supported_versions>\n        <version
+        major=\"3\" minor=\"1\"/>\n    </supported_versions>\n    <status>\n        <state>up</state>\n
+        \   </status>\n</data_center>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters?search=datacenter=Default
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=S6AOCLLpMspp-NKURpSpXvD-; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '1232'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<clusters>\n
+        \   <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\" id=\"99408929-82cf-4dc7-a532-9d998063fa95\">\n
+        \       <name>Default</name>\n        <description>The default server cluster</description>\n
+        \       <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks\"
+        rel=\"networks\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/permissions\"
+        rel=\"permissions\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes\"
+        rel=\"glustervolumes\"/>\n        <cpu id=\"Intel Westmere Family\"/>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <memory_policy>\n            <overcommit percent=\"150\"/>\n            <transparent_hugepages>\n
+        \               <enabled>true</enabled>\n            </transparent_hugepages>\n
+        \       </memory_policy>\n        <scheduling_policy/>\n        <version major=\"3\"
+        minor=\"1\"/>\n        <error_handling>\n            <on_error>migrate</on_error>\n
+        \       </error_handling>\n        <virt_service>true</virt_service>\n        <gluster_service>false</gluster_service>\n
+        \   </cluster>\n</clusters>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=N1gHQZhYsdnXCG6+oW2YJ6mH; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '866'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<networks>\n
+        \   <network href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks/00000000-0000-0000-0000-000000000009\"
+        id=\"00000000-0000-0000-0000-000000000009\">\n        <name>rhevm</name>\n
+        \       <description>Management Network</description>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\"
+        id=\"99408929-82cf-4dc7-a532-9d998063fa95\"/>\n        <stp>false</stp>\n
+        \       <status>\n            <state>operational</state>\n        </status>\n
+        \       <display>true</display>\n        <mtu>0</mtu>\n        <usages>\n
+        \           <usage>vm</usage>\n            <usage>display</usage>\n        </usages>\n
+        \       <required>true</required>\n    </network>\n</networks>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=SfwLJoaZHKmKTJi0dUK3nJ9l; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '828'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\">\n
+        \   <name>Default</name>\n    <description>The default Data Center</description>\n
+        \   <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/storagedomains\"
+        rel=\"storagedomains\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/permissions\"
+        rel=\"permissions\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/quotas\"
+        rel=\"quotas\"/>\n    <storage_type>nfs</storage_type>\n    <storage_format>v3</storage_format>\n
+        \   <version major=\"3\" minor=\"1\"/>\n    <supported_versions>\n        <version
+        major=\"3\" minor=\"1\"/>\n    </supported_versions>\n    <status>\n        <state>up</state>\n
+        \   </status>\n</data_center>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters?search=datacenter=Default
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=EbkKmViVnZnM9vZLZbzkjjvR; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '1232'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<clusters>\n
+        \   <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\" id=\"99408929-82cf-4dc7-a532-9d998063fa95\">\n
+        \       <name>Default</name>\n        <description>The default server cluster</description>\n
+        \       <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks\"
+        rel=\"networks\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/permissions\"
+        rel=\"permissions\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes\"
+        rel=\"glustervolumes\"/>\n        <cpu id=\"Intel Westmere Family\"/>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <memory_policy>\n            <overcommit percent=\"150\"/>\n            <transparent_hugepages>\n
+        \               <enabled>true</enabled>\n            </transparent_hugepages>\n
+        \       </memory_policy>\n        <scheduling_policy/>\n        <version major=\"3\"
+        minor=\"1\"/>\n        <error_handling>\n            <on_error>migrate</on_error>\n
+        \       </error_handling>\n        <virt_service>true</virt_service>\n        <gluster_service>false</gluster_service>\n
+        \   </cluster>\n</clusters>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=u0m1F9AR4PV9NgybBuNWPr6X; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '866'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<networks>\n
+        \   <network href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks/00000000-0000-0000-0000-000000000009\"
+        id=\"00000000-0000-0000-0000-000000000009\">\n        <name>rhevm</name>\n
+        \       <description>Management Network</description>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\"
+        id=\"99408929-82cf-4dc7-a532-9d998063fa95\"/>\n        <stp>false</stp>\n
+        \       <status>\n            <state>operational</state>\n        </status>\n
+        \       <display>true</display>\n        <mtu>0</mtu>\n        <usages>\n
+        \           <usage>vm</usage>\n            <usage>display</usage>\n        </usages>\n
+        \       <required>true</required>\n    </network>\n</networks>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=PThbBopD2GKk2fl+49X7W7k-; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '828'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\">\n
+        \   <name>Default</name>\n    <description>The default Data Center</description>\n
+        \   <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/storagedomains\"
+        rel=\"storagedomains\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/permissions\"
+        rel=\"permissions\"/>\n    <link href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a/quotas\"
+        rel=\"quotas\"/>\n    <storage_type>nfs</storage_type>\n    <storage_format>v3</storage_format>\n
+        \   <version major=\"3\" minor=\"1\"/>\n    <supported_versions>\n        <version
+        major=\"3\" minor=\"1\"/>\n    </supported_versions>\n    <status>\n        <state>up</state>\n
+        \   </status>\n</data_center>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters?search=datacenter=Default
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=9g0bpj0xL8B+efPe2lefDDjd; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '1232'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<clusters>\n
+        \   <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\" id=\"99408929-82cf-4dc7-a532-9d998063fa95\">\n
+        \       <name>Default</name>\n        <description>The default server cluster</description>\n
+        \       <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks\"
+        rel=\"networks\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/permissions\"
+        rel=\"permissions\"/>\n        <link href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes\"
+        rel=\"glustervolumes\"/>\n        <cpu id=\"Intel Westmere Family\"/>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <memory_policy>\n            <overcommit percent=\"150\"/>\n            <transparent_hugepages>\n
+        \               <enabled>true</enabled>\n            </transparent_hugepages>\n
+        \       </memory_policy>\n        <scheduling_policy/>\n        <version major=\"3\"
+        minor=\"1\"/>\n        <error_handling>\n            <on_error>migrate</on_error>\n
+        \       </error_handling>\n        <virt_service>true</virt_service>\n        <gluster_service>false</gluster_service>\n
+        \   </cluster>\n</clusters>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+- request:
+    method: get
+    uri: https://admin%40internal:redhat@dell-per610-02.lab.eng.brq.redhat.com/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks
+    body:
+      encoding: US-ASCII
+      string: ''
+    headers:
+      Accept:
+      - application/xml
+      Accept-Encoding:
+      - gzip, deflate
+      Content-Type:
+      - application/xml
+      User-Agent:
+      - Ruby
+  response:
+    status:
+      code: 200
+      message: OK
+    headers:
+      Date:
+      - Tue, 19 Feb 2013 10:39:21 GMT
+      Pragma:
+      - No-cache
+      Cache-Control:
+      - no-cache
+      Expires:
+      - Thu, 01 Jan 1970 01:00:00 CET
+      Set-Cookie:
+      - JSESSIONID=+5k4EP7mt8eIgJRfAkmP1lS9; Path=/api; Secure
+      Content-Type:
+      - application/xml
+      Content-Length:
+      - '866'
+      Connection:
+      - close
+    body:
+      encoding: US-ASCII
+      string: ! "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<networks>\n
+        \   <network href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks/00000000-0000-0000-0000-000000000009\"
+        id=\"00000000-0000-0000-0000-000000000009\">\n        <name>rhevm</name>\n
+        \       <description>Management Network</description>\n        <data_center
+        href=\"/api/datacenters/9df72b84-0234-11e2-9b87-9386d9b09d4a\" id=\"9df72b84-0234-11e2-9b87-9386d9b09d4a\"/>\n
+        \       <cluster href=\"/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95\"
+        id=\"99408929-82cf-4dc7-a532-9d998063fa95\"/>\n        <stp>false</stp>\n
+        \       <status>\n            <state>operational</state>\n        </status>\n
+        \       <display>true</display>\n        <mtu>0</mtu>\n        <usages>\n
+        \           <usage>vm</usage>\n            <usage>display</usage>\n        </usages>\n
+        \       <required>true</required>\n    </network>\n</networks>\n"
+    http_version: 
+  recorded_at: Tue, 19 Feb 2013 10:39:20 GMT
+recorded_with: VCR 2.4.0
diff --git a/server/tests/drivers/rhevm/networks_test.rb b/server/tests/drivers/rhevm/networks_test.rb
new file mode 100644
index 0000000..756e506
--- /dev/null
+++ b/server/tests/drivers/rhevm/networks_test.rb
@@ -0,0 +1,42 @@
+require 'rubygems'
+require 'require_relative' if RUBY_VERSION < '1.9'
+
+require_relative 'common.rb'
+
+describe 'RhevmDriver Networks' do
+
+  before do
+    @driver = Deltacloud::new(:rhevm, credentials)
+    VCR.insert_cassette __name__
+  end
+
+  after do
+    VCR.eject_cassette
+  end
+
+  it 'must throw error when wrong credentials' do
+    Proc.new do
+      @driver.backend.networks(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
+  end
+
+  it 'must return list of networks' do
+    @driver.networks.wont_be_empty
+    @driver.networks.first.must_be_kind_of Network
+  end
+
+  it 'must allow to filter networks' do
+    @driver.networks(:id => '00000000-0000-0000-0000-000000000009').wont_be_empty
+    @driver.networks(:id => '00000000-0000-0000-0000-000000000009').must_be_kind_of Array
+    @driver.networks(:id => '00000000-0000-0000-0000-000000000009').size.must_equal 1
+    @driver.networks(:id => '00000000-0000-0000-0000-000000000009').first.id.must_equal '00000000-0000-0000-0000-000000000009'
+    @driver.networks(:id => 'unknown').must_be_empty
+  end
+
+  it 'must allow to retrieve single network' do
+    @driver.network(:id => '00000000-0000-0000-0000-000000000009').wont_be_nil
+    @driver.network(:id => '00000000-0000-0000-0000-000000000009').must_be_kind_of Network
+    @driver.network(:id => 'unknown').must_be_nil
+  end
+
+end
-- 
1.7.11.7


Mime
View raw message