diff --git a/.rubocop.yml b/.rubocop.yml index a6bc5fa64..3912571eb 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,9 @@ # See default at https://github.com/bbatsov/rubocop/blob/master/config/default.yml +AllCops: + Exclude: + - 'examples/_client.rb' + Metrics/ClassLength: Max: 200 Exclude: diff --git a/CHANGELOG.md b/CHANGELOG.md index e412855b5..fe006153d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,85 @@ +# v2.0.0 +### Notes + This is the second version of the Ruby SDK for HPE OneView. It was given support to the major features of OneView, refactor in some of the already existing code, and also a full set of exceptions to make some common exceptions more explicit in the debugging process. + This version of this SDK officially supports OneView appliances version 2.00.00 or higher, using the OneView Rest API version 200. + For now only C7000 enclosure types are being supported. + +### Major changes + 1. Added full support to the already existing features: + - Server Profile + - Server Profile Template + - Server Hardware + 2. New features added: + - Connection Templates + - Datacenter + - Fabrics + - Logical downlinks + - Logical switch groups + - Logical switches + - Switches + - SAN managers + - Managed SANs + - Network sets + - Power devices + - Racks + - Server hardware types + - Unmanaged devices + 3. New exceptions to address the most common issues (Check them in *lib/oneview-sdk/resource/exceptions.rb*) + +### Breaking changes + 1. Refactored some method names that may cause incompatibility with older SDK versions. Due to the nature of OneView, the `create` and `delete` methods did not fit the physical infrastructure elements like Enclosures, or Switches, so they now have `add` and `remove` methods that act the same as before, but now it leaves no margin to misunderstand that OneView could actually create these resources. They are: + - Datacenters + - Enclosure + - Power devices + - Racks + - Storage systems + - Storage pools + - Firmware drivers + - Firmware bundles (Only `add`) + - SAN managers + - Server hardwares + - Server hardware types + - Switches + - Unmanaged devices + +### Features supported +- Ethernet network +- FC network +- FCOE network +- Network set +- Connection template +- Fabric +- SAN manager +- Managed SAN +- Interconnect +- Logical interconnect +- Logical interconnect group +- Uplink set +- Logical downlink +- Enclosure +- Logical enclosure +- Enclosure group +- Firmware bundle +- Firmware driver +- Storage system +- Storage pool +- Volume +- Volume template +- Datacenter +- Racks +- Logical switch group +- Logical switch +- Switch +- Power devices +- Server profile +- Server profile template +- Server hardware +- Server hardware type +- Unmanaged devices + # v1.0.0 ### Notes - This is the first release of the OneView SDK in Ruby and it adds full support to some core features listed bellow, with some execptions that are explicit. + This is the first release of the OneView SDK in Ruby and it adds full support to some core features listed bellow, with some execeptions that are explicit. This version of this SDK supports OneView appliances version 2.00.00 or higher, using the OneView Rest API version 200. For now it only supports C7000 enclosure types. @@ -26,7 +105,7 @@ - Server Profile Template (CRUD supported) - Server Hardware (CRUD Supported) -### Know Issues +### Known issues The integration tests may warn about 3 issues: 1. OneviewSDK::LogicalInterconnect Firmware Updates perform the actions Stage diff --git a/README.md b/README.md index 8751686ff..12d5fd577 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Gem Version](https://badge.fury.io/rb/oneview-sdk.svg)](https://badge.fury.io/rb/oneview-sdk) -The OneView SDK provides a Ruby library to easily interact with HPE OneView API. The Ruby SDK enables developers to easily build integration and scalable solutions with HPE OneView. +The OneView SDK provides a Ruby library to easily interact with HPE OneView API. The Ruby SDK enables developers to easily build integrations and scalable solutions with HPE OneView. ## Installation - Require the gem in your Gemfile: @@ -38,7 +38,7 @@ client = OneviewSDK::Client.new( :lock: Tip: Check the file permissions because the password is stored in clear-text. -**Environment Variables** +##### Environment Variables You can also set the url and credentials or an authentication token using environment variables. For bash: @@ -64,7 +64,7 @@ client = OneviewSDK::Client.new ``` NOTE: Run `$ oneview-sdk-ruby env` to see a list of available environment variables and their current values. -**Configuration Files** +##### Configuration Files Configuration files can also be used to define client configuration (json or yaml formats). Here's an example json file: @@ -103,85 +103,85 @@ For example, once you instantiate a resource object, you can call intuitive meth Please see the [rubydoc.info](http://www.rubydoc.info/gems/oneview-sdk) documentation for the complete list and usage details, but here are a few examples to get you started: -- **Create a resource** +##### Create a resource - ```ruby - ethernet = OneviewSDK::EthernetNetwork.new( - client, { name: 'TestVlan', vlanId: 1001, purpose: 'General', smartLink: false, privateNetwork: false } - ) - ethernet.create # Tells OneView to create this resource - ``` +```ruby +ethernet = OneviewSDK::EthernetNetwork.new( + client, { name: 'TestVlan', vlanId: 1001, purpose: 'General', smartLink: false, privateNetwork: false } +) +ethernet.create # Tells OneView to create this resource +``` -- **Access resource attributes** +##### Access resource attributes - ```ruby - ethernet['name'] # Returns 'TestVlan' +```ruby +ethernet['name'] # Returns 'TestVlan' - ethernet.data # Returns hash of all data +ethernet.data # Returns hash of all data - ethernet.each do |key, value| - puts "Attribute #{key} = #{value}" - end - ``` +ethernet.each do |key, value| + puts "Attribute #{key} = #{value}" +end +``` - The resource's data is stored in its @data attribute. However, you can access the data directly using a hash-like syntax on the resource object (recommended). `resource['key']` functions a lot like `resource.data['key']`. The difference is that when using the data attribute, you must be cautious to use the correct key type (Hash vs Symbol). - The direct hash accessor on the resource converts all keys to strings, so `resource[:key]` and `resource['key']` access the same thing: `resource.data['key']`. +The resource's data is stored in its @data attribute. However, you can access the data directly using a hash-like syntax on the resource object (recommended). `resource['key']` functions a lot like `resource.data['key']`. The difference is that when using the data attribute, you must be cautious to use the correct key type (Hash vs Symbol). +The direct hash accessor on the resource converts all keys to strings, so `resource[:key]` and `resource['key']` access the same thing: `resource.data['key']`. -- **Update a resource** +##### Update a resource - Notice that there's a few different ways to do things, so pick your poison! - ```ruby - ethernet.set_all(name: 'newName', vlanId: 1002) - ethernet['purpose'] = 'General' - ethernet['ethernetNetworkType'] = 'Tagged' - ethernet.update # Saves current state to OneView +Notice that there are a few different ways to do things, so pick your poison! +```ruby +ethernet.set_all(name: 'newName', vlanId: 1002) +ethernet['purpose'] = 'General' +ethernet['ethernetNetworkType'] = 'Tagged' +ethernet.update # Saves current state to OneView - # Alternatively, you could do this in 1 step with: - ethernet.update(name: 'newName', vlanId: 1002, purpose: 'General', ethernetNetworkType: 'Tagged') - ``` +# Alternatively, you could do this in 1 step with: +ethernet.update(name: 'newName', vlanId: 1002, purpose: 'General', ethernetNetworkType: 'Tagged') +``` -- **Check resource equality** +##### Check resource equality - You can use the `==` or `.eql?` method to compare resource equality, or `.like` to compare just a subset of attributes. - ```ruby - ethernet2 = OneviewSDK::EthernetNetwork.new( - client, { name: 'OtherVlan', vlanId: 1000, purpose: 'General', smartLink: false, privateNetwork: false } - ) - ethernet == ethernet2 # Returns false - ethernet.eql?(ethernet2) # Returns false +You can use the `==` or `.eql?` method to compare resource equality, or `.like` to compare just a subset of attributes. +```ruby +ethernet2 = OneviewSDK::EthernetNetwork.new( + client, { name: 'OtherVlan', vlanId: 1000, purpose: 'General', smartLink: false, privateNetwork: false } +) +ethernet == ethernet2 # Returns false +ethernet.eql?(ethernet2) # Returns false - # To compare a subset of attributes: - ethernet3 = OneviewSDK::EthernetNetwork.new(client, { purpose: 'General' }) - ethernet.like?(ethernet3) # Returns true - ethernet.like?(name: TestVlan, purpose: 'General') # Returns true - ``` +# To compare a subset of attributes: +ethernet3 = OneviewSDK::EthernetNetwork.new(client, { purpose: 'General' }) +ethernet.like?(ethernet3) # Returns true +ethernet.like?(name: TestVlan, purpose: 'General') # Returns true +``` -- **Find resources** +##### Find resources - ```ruby - ethernet = OneviewSDK::EthernetNetwork.new(client, { name: 'OtherVlan' }) - ethernet.retrieve! # Uses the name attribute to search for the resource on the server and update the data in this object. +```ruby +ethernet = OneviewSDK::EthernetNetwork.new(client, { name: 'OtherVlan' }) +ethernet.retrieve! # Uses the name attribute to search for the resource on the server and update the data in this object. - # Each resource class also has a searching method (NOTE: class method, not instance method) - ethernet = OneviewSDK::EthernetNetwork.find_by(client, { name: 'OtherVlan' }).first +# Each resource class also has a searching method (NOTE: class method, not instance method) +ethernet = OneviewSDK::EthernetNetwork.find_by(client, { name: 'OtherVlan' }).first - OneviewSDK::EthernetNetwork.find_by(client, { purpose: 'General' }).each do |network| - puts " #{network['name']}" - end +OneviewSDK::EthernetNetwork.find_by(client, { purpose: 'General' }).each do |network| + puts " #{network['name']}" +end - # Get all resources: - networks = client.get_all(:EthernetNetwork) - ``` +# Get all resources: +networks = client.get_all(:EthernetNetwork) +``` -- **Delete a resource** +##### Delete a resource - ```ruby - ethernet = OneviewSDK::EthernetNetwork.find_by(client, { name: 'OtherVlan' }).first - ethernet.delete # Tells OneView to delete this resource - ``` +```ruby +ethernet = OneviewSDK::EthernetNetwork.find_by(client, { name: 'OtherVlan' }).first +ethernet.delete # Tells OneView to delete this resource +``` ### Save/Load resources with files Resources can be saved to files and loaded again very easily using the built-in `.to_file` & `.from_file` methods. @@ -191,7 +191,7 @@ Resources can be saved to files and loaded again very easily using the built-in ```ruby ethernet.to_file("full_file_path.json") ``` - - To load a Resource from a file: (note the class method, not instance method) + - To load a resource from a file: (note the class method, not instance method) ```ruby ethernet4 = OneviewSDK::Resource.from_file(client, "full_file_path.json") @@ -231,58 +231,63 @@ To communicate with an appliance, you will need to set up a few environment vari The CLI does not expose everything in the SDK, but it is great for doing simple tasks such as creating or deleting resources from files, listing resources, and searching. Here are a few examples: - - List ServerProfiles: - ```bash - $ oneview-sdk-ruby list ServerProfiles - # Or to show in yaml format (json is also supported): - $ oneview-sdk-ruby list ServerProfiles -f yaml - ``` - - - Show details for a specific resource: - ```bash - $ oneview-sdk-ruby show ServerProfile profile-1 - # Or to show specific attributes only: - $ oneview-sdk-ruby show ServerProfile profile-1 -a name,uri,enclosureBay - ``` - - - Search by an attribute: - ```bash - $ oneview-sdk-ruby search ServerProfiles --filter state:Normal affinity:Bay - # By default, it will just show a list of names of matching resources, - # but again, you can show only certain attributes by using the -a option - # You can also chain keys together to search in nested hashes: - $ oneview-sdk-ruby search ServerProfiles --filter state:Normal boot.manageBoot:true - ``` - - - Create or delete resource by file: - ```bash - $ oneview-sdk-ruby create_from_file /my-server-profile.json - $ oneview-sdk-ruby delete_from_file /my-server-profile.json - ``` - - - Start an interactive console session with a OneView connection: - ```bash - $ oneview-sdk-ruby console - Console Connected to https://oneview.example.com - HINT: The @client object is available to you - > - ``` - - - Import a self-signed SSL certificate from your OneView instance: - - Although you can disable ssl validation altogether for the client, this is strongly discouraged. - Instead, please import the certificate using the built-in cli cert command: - ```bash - # Check the certificate first: - $ oneview-sdk-ruby cert check https://oneview.example.com - Checking certificate for 'https://oneview.example.com' ... - ERROR: Certificate Validation Failed! - - # Import the certificate: - $ oneview-sdk-ruby cert import https://oneview.example.com - Importing certificate for 'https://oneview.example.com' into '/home/users/user1/.oneview-sdk-ruby/trusted_certs.cer'... - Cert added to '/home/users/user1/.oneview-sdk-ruby/trusted_certs.cer' - ``` +##### List ServerProfiles: + +```bash +$ oneview-sdk-ruby list ServerProfiles +# Or to show in yaml format (json is also supported): +$ oneview-sdk-ruby list ServerProfiles -f yaml +``` + +##### Show details for a specific resource: + +```bash +$ oneview-sdk-ruby show ServerProfile profile-1 +# Or to show specific attributes only: +$ oneview-sdk-ruby show ServerProfile profile-1 -a name,uri,enclosureBay +``` + +##### Search by an attribute: + +```bash +$ oneview-sdk-ruby search ServerProfiles --filter state:Normal affinity:Bay +# By default, it will just show a list of names of matching resources, +# but again, you can show only certain attributes by using the -a option +# You can also chain keys together to search in nested hashes: +$ oneview-sdk-ruby search ServerProfiles --filter state:Normal boot.manageBoot:true +``` + +##### Create or delete resource by file: + +```bash +$ oneview-sdk-ruby create_from_file /my-server-profile.json +$ oneview-sdk-ruby delete_from_file /my-server-profile.json +``` + +##### Start an interactive console session with a OneView connection: + +```bash +$ oneview-sdk-ruby console +Console Connected to https://oneview.example.com +HINT: The @client object is available to you +> +``` + +##### Import a self-signed SSL certificate from your OneView instance: + +Although you can disable SSL validation altogether for the client, this is strongly discouraged. +Instead, please import the certificate using the built-in CLI cert command: +```bash +# Check the certificate first: +$ oneview-sdk-ruby cert check https://oneview.example.com + Checking certificate for 'https://oneview.example.com' ... + ERROR: Certificate Validation Failed! + +# Import the certificate: +$ oneview-sdk-ruby cert import https://oneview.example.com + Importing certificate for 'https://oneview.example.com' into '/home/users/user1/.oneview-sdk-ruby/trusted_certs.cer'... + Cert added to '/home/users/user1/.oneview-sdk-ruby/trusted_certs.cer' +``` ## License This project is licensed under the Apache 2.0 license. Please see [LICENSE](LICENSE) for more info. diff --git a/Rakefile b/Rakefile index 21707b214..9bdc56b78 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + require 'bundler' require 'bundler/gem_tasks' require 'bundler/setup' diff --git a/examples/_client.rb.example b/examples/_client.rb.example index 2239e42b7..e13a892ad 100644 --- a/examples/_client.rb.example +++ b/examples/_client.rb.example @@ -23,3 +23,4 @@ puts "Connected to OneView appliance at #{@client.url}\n\n" # @storage_system_ip = '172.18.11.11' # @storage_system_username = 'Administrator' # @storage_system_password = 'password123' +# @firmware_bundle_path = 'hp-firmware-a1b08f8a6b-HPGH-1.1.i386.rpm' diff --git a/examples/connection_template.rb b/examples/connection_template.rb new file mode 100644 index 000000000..da1c293d5 --- /dev/null +++ b/examples/connection_template.rb @@ -0,0 +1,44 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +# Example: Manage connection templates +default = OneviewSDK::ConnectionTemplate.get_default(@client) +if default['uri'] + puts "\nRetrieved default connection template with name='#{default['name']}'" + puts "(- maximumBandwidth: #{default['bandwidth']['maximumBandwidth']})" + puts "(- typicalBandwidth: #{default['bandwidth']['typicalBandwidth']})\n" +end + +# Retrieve connection template and update its name +connection_template = OneviewSDK::ConnectionTemplate.find_by(@client, {}).first +puts "\nConnection template with name='#{connection_template['name']}' bandwidth specification is:" +puts "(- maximumBandwidth: #{connection_template['bandwidth']['maximumBandwidth']})" +puts "(- typicalBandwidth: #{connection_template['bandwidth']['typicalBandwidth']})\n" + +old_name = connection_template['name'] +connection_template['name'] = 'ConnectionTemplate_1' +connection_template.update +puts "\nConnection template name changed from #{old_name} to #{connection_template['name']}\n" + +# Update typical and maximum bandwidth for the previous connection template +connection_template['bandwidth']['maximumBandwidth'] += 1000 +connection_template['bandwidth']['typicalBandwidth'] += 1000 +connection_template.update +puts "\nConnection template with name='#{connection_template['name']}' bandwidth specification changed:" +puts "(- maximumBandwidth: #{connection_template['bandwidth']['maximumBandwidth']})" +puts "(- typicalBandwidth: #{connection_template['bandwidth']['typicalBandwidth']})\n" + +# Restore connection template old name +connection_template['name'] = old_name +connection_template.update +puts "\nConnection template name changed back to #{connection_template['name']}" diff --git a/examples/datacenter.rb b/examples/datacenter.rb new file mode 100644 index 000000000..4348692d0 --- /dev/null +++ b/examples/datacenter.rb @@ -0,0 +1,25 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +# Example for adding a Datacenter with default values +datacenter = OneviewSDK::Datacenter.new(@client, name: 'MyDatacenter', width: 5000, depth: 5000) +datacenter.add +puts "Datacenter #{datacenter['name']} was added with uri='#{datacenter['uri']}'" + + +# Updating datacenter name +datacenter.update(name: 'Datacenter') +puts "Datacenter MyDatacenter name changed to #{datacenter['name']}" + +# Deleting recently created datacenter +datacenter.remove diff --git a/examples/enclosure.rb b/examples/enclosure.rb index b6f85cc14..fa963ea3b 100644 --- a/examples/enclosure.rb +++ b/examples/enclosure.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Gives access to @client # Example: Add an enclosure @@ -19,8 +30,8 @@ } item = OneviewSDK::Enclosure.new(@client, options) -item.create -puts "\nCreated #{type} '#{item[:name]}' sucessfully.\n uri = '#{item[:uri]}'" +item.add +puts "\nAdded #{type} '#{item[:name]}' sucessfully.\n uri = '#{item[:uri]}'" item2 = OneviewSDK::Enclosure.new(@client, name: options[:name]) item2.retrieve! @@ -30,5 +41,5 @@ item.update(name: 'OneViewSDK_Test_Enclosure') puts "\nUpdated #{type} '#{item[:name]}' sucessfully.\n uri = '#{item[:uri]}'" -item.delete -puts "\nSucessfully deleted #{type} '#{item[:name]}'." +item.remove +puts "\nSucessfully removed #{type} '#{item[:name]}'." diff --git a/examples/enclosure_group.rb b/examples/enclosure_group.rb index da3b0cd93..62bec9265 100644 --- a/examples/enclosure_group.rb +++ b/examples/enclosure_group.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Gives access to @client # Example: Create an enclosure group diff --git a/examples/ethernet_network.rb b/examples/ethernet_network.rb index 2193ad8d5..62ea6fe88 100644 --- a/examples/ethernet_network.rb +++ b/examples/ethernet_network.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Gives access to @client # Example: Create an ethernet network diff --git a/examples/fabric.rb b/examples/fabric.rb new file mode 100644 index 000000000..73ce72f7a --- /dev/null +++ b/examples/fabric.rb @@ -0,0 +1,24 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +all_fabrics = OneviewSDK::Fabric.find_by(@client, {}) + +puts "\n\n### Here are all fabrics available:" +all_fabrics.each do |fabric| + puts fabric['name'] +end + +fabric2 = OneviewSDK::Fabric.new(@client, 'name' => 'DefaultFabric') +puts "\n\n### Retrieving the Fabric named: #{fabric2['name']}" +fabric2.retrieve! +puts JSON.pretty_generate(fabric2.data) diff --git a/examples/fc_network.rb b/examples/fc_network.rb index d4c3995ec..91dc004e5 100644 --- a/examples/fc_network.rb +++ b/examples/fc_network.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Gives access to @client # Example: Create an fc network diff --git a/examples/fcoe_network.rb b/examples/fcoe_network.rb index 83283c983..c81f3bc75 100644 --- a/examples/fcoe_network.rb +++ b/examples/fcoe_network.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Example: Create an fc network diff --git a/examples/firmware.rb b/examples/firmware.rb deleted file mode 100644 index e5bcc2322..000000000 --- a/examples/firmware.rb +++ /dev/null @@ -1,28 +0,0 @@ -require_relative '_client' # Gives access to @client - -# NOTE: This will add a firmware bundle, then delete it. - - -# Example: Add firmware bundle -type = 'firmware bundle' -file_path = 'spec/support/fixtures/integration/hp-firmware-powerpic-dl580-4.1-5.i386.rpm' - -begin - item = OneviewSDK::FirmwareBundle.upload(@client, file_path) - puts "\nUpload of #{type} '#{item[:name]}' sucessful.\n uri = '#{item[:uri]}'" -rescue StandardError => e - printf "\nUpload Error: " - puts JSON.parse(e.message.split('Response: ').last).first['message'] rescue e.message -end - - -# Example: Search firmware drivers by name -type = 'firmware bundle' - -item2 = OneviewSDK::FirmwareDriver.find_by(@client, name: item[:name]).first -puts "\nFound #{type} '#{item2[:name]}' by name.\n uri = '#{item2[:uri]}'" - - -# Example: Delete firmware driver -item2.delete -puts "\nSucessfully deleted #{type} '#{item2[:name]}'." diff --git a/examples/firmware_bundle.rb b/examples/firmware_bundle.rb new file mode 100644 index 000000000..da4c4e369 --- /dev/null +++ b/examples/firmware_bundle.rb @@ -0,0 +1,17 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +# NOTE: This will upload a firmware bundle + +item = OneviewSDK::FirmwareBundle.add(@client, @firmware_bundle_path) +puts "\nFirmware bundle #{item['name']} was successfully added." diff --git a/examples/firmware_driver.rb b/examples/firmware_driver.rb new file mode 100644 index 000000000..f79670ff4 --- /dev/null +++ b/examples/firmware_driver.rb @@ -0,0 +1,36 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +# NOTE: This will create a custom firmware driver, then delete it. +# The OneView appliance must have a valid spp and hotfix + +# List firmware drivers +puts "\nAvailable firmware drivers" +OneviewSDK::FirmwareDriver.find_by(@client, {}).each do |firmware| + puts firmware['name'] +end + +spp = OneviewSDK::FirmwareDriver.find_by(@client, state: 'Created', bundleType: 'SPP').first +hotfix = OneviewSDK::FirmwareDriver.find_by(@client, state: 'Created', bundleType: 'Hotfix').first + +custom_spp = OneviewSDK::FirmwareDriver.new(@client) +custom_spp['baselineUri'] = spp['uri'] +custom_spp['hotfixUris'] = [ + hotfix['uri'] +] +custom_spp['customBaselineName'] = 'FirmwareDriver1_Example' +custom_spp.create + +# Example: Delete firmware driver +custom_spp.remove +puts "\nSucessfully deleted '#{custom_spp['name']}'." diff --git a/examples/interconnect.rb b/examples/interconnect.rb index e0f39f7b2..eee9578c2 100644 --- a/examples/interconnect.rb +++ b/examples/interconnect.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # List of interconnects diff --git a/examples/logical_downlink.rb b/examples/logical_downlink.rb new file mode 100644 index 000000000..1ed497984 --- /dev/null +++ b/examples/logical_downlink.rb @@ -0,0 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +require_relative '_client' + +puts OneviewSDK::LogicalDownlink.find_by(@client, {}).first.get_without_ethernet diff --git a/examples/logical_enclosure.rb b/examples/logical_enclosure.rb index 97000f165..e524801c4 100644 --- a/examples/logical_enclosure.rb +++ b/examples/logical_enclosure.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Gives access to @client diff --git a/examples/logical_interconnect.rb b/examples/logical_interconnect.rb index 960b5c46e..dac4aaa24 100644 --- a/examples/logical_interconnect.rb +++ b/examples/logical_interconnect.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' require 'json' diff --git a/examples/logical_interconnect_group.rb b/examples/logical_interconnect_group.rb index 7fe03dd0f..0be9a90e5 100644 --- a/examples/logical_interconnect_group.rb +++ b/examples/logical_interconnect_group.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' type = 'Logical Interconnect Group' diff --git a/examples/logical_switch.rb b/examples/logical_switch.rb new file mode 100644 index 000000000..9bab7f53e --- /dev/null +++ b/examples/logical_switch.rb @@ -0,0 +1,34 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' + +# SSH Credential +ssh_credentials = OneviewSDK::LogicalSwitch::CredentialsSSH.new('dcs', 'dcs') + +# SNMP credentials +snmp_v1 = OneviewSDK::LogicalSwitch::CredentialsSNMPV1.new(161, 'public') +snmp_v1_2 = OneviewSDK::LogicalSwitch::CredentialsSNMPV1.new(161, 'public') + + +logical_switch = OneviewSDK::LogicalSwitch.new( + @client, + name: 'Teste_SDK', + logicalSwitchGroupUri: '/rest/logical-switch-groups/2c5de7f0-7cb6-4897-9423-181e625a614c' +) + +# Adding switches credentials +logical_switch.set_switch_credentials('172.16.11.11', ssh_credentials, snmp_v1) +logical_switch.set_switch_credentials('172.16.11.12', ssh_credentials, snmp_v1_2) + +# Creates logical switch for a switch group +logical_switch.create +puts "Logical switch created with uri=#{logical_switch['uri']}" diff --git a/examples/logical_switch_group.rb b/examples/logical_switch_group.rb new file mode 100644 index 000000000..e2c0f49cb --- /dev/null +++ b/examples/logical_switch_group.rb @@ -0,0 +1,42 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +# Example: Create an Logical Switch Group +options = { + name: 'OneViewSDK Test Logical Switch Group', + category: 'logical-switch-groups', + state: 'Active', + type: 'logical-switch-group' +} + +# Creating a LSG +lsg = OneviewSDK::LogicalSwitchGroup.new(@client, options) + +# Set the group parameters +lsg.set_grouping_parameters(2, 'Cisco Nexus 50xx') + +# Effectively create the LSG +lsg.create! +puts "\nCreated logical-switch-group '#{lsg[:name]}' sucessfully.\n uri = '#{lsg[:uri]}'" + +sleep(10) + +# Updating the LSG +lsg.set_grouping_parameters(1, 'Cisco Nexus 50xx') +lsg.update(name: 'OneViewSDK Test Logical Switch Group Updated') +puts "\nUpdate logical-switch-group '#{lsg[:name]}' sucessfully.\n uri = '#{lsg[:uri]}'" + +sleep(10) + +# Clean up +lsg.delete diff --git a/examples/managed_san.rb b/examples/managed_san.rb new file mode 100644 index 000000000..fa3461b22 --- /dev/null +++ b/examples/managed_san.rb @@ -0,0 +1,44 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +# List managed SANs for a specified SAN Manager +managed_sans = OneviewSDK::ManagedSAN.find_by(@client, deviceManagerName: @san_manager_ip).each do |san| + puts "- #{san['name']}" +end + +san_01 = managed_sans.last + +# Set public attributes +attributes = [ + { + name: 'MetaSan', + value: 'Neon SAN', + valueType: 'String', + valueFormat: 'None' + } +] + +san_01.set_public_attributes(attributes) +puts "\nPublic attributes updated." + +# Set SAN policy +policy = { + zoningPolicy: 'SingleInitiatorAllTargets', + zoneNameFormat: '{hostName}_{initiatorWwn}', + enableAliasing: true, + initiatorNameFormat: '{hostName}_{initiatorWwn}', + targetNameFormat: '{storageSystemName}_{targetName}', + targetGroupNameFormat: '{storageSystemName}_{targetGroupName}' +} +san_01.set_san_policy(policy) +puts "\nSAN policy updated." diff --git a/examples/network_set.rb b/examples/network_set.rb new file mode 100644 index 000000000..4827c2c78 --- /dev/null +++ b/examples/network_set.rb @@ -0,0 +1,38 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +# Example: Create a network set +# NOTE: This will create a network set named 'NetworkSet_1', then delete it. + +# Retrieve ethernet networks available in HPE OneView +ethernet_networks = OneviewSDK::EthernetNetwork.find_by(@client, {}) + +# Network set creation +network_set = OneviewSDK::NetworkSet.new(@client) +network_set['name'] = 'NetworkSet_1' + +# Adding until three ethernet networks to the network set +ethernet_networks.each_with_index { |ethernet, index| network_set.add_ethernet_network(ethernet) if index < 4 } + +# Set first ethernet network as native network for network set +network_set.set_native_network(ethernet_networks.first) if ethernet_networks.size > 0 + +# Network set creation +network_set.create +puts "\nThe network set with name='#{network_set['name']}' and uri='#{network_set['uri']}' was created!\n" +puts "- nativeNetworkUri='#{network_set['nativeNetworkUri']}'" +network_set['networkUris'].each { |network| puts "- networkUri='#{network}'" } + +# Deletes network set +network_set.delete +puts "\nThe network set with name='#{network_set['name']}' and uri='#{network_set['uri']}' was deleted!\n" diff --git a/examples/power_device.rb b/examples/power_device.rb new file mode 100644 index 000000000..2e04ac5b0 --- /dev/null +++ b/examples/power_device.rb @@ -0,0 +1,33 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +# iPDU information +options = { + username: @ipdu_username, + password: @ipdu_password, + hostname: @ipdu_hostname +} + +# iPDU Discover +ipdu = OneviewSDK::PowerDevice.discover(@client, options) +puts "IPDU #{ipdu['name']} was sucessfully discovered!" + +# List iPDU power connections +puts "\nPower connections for #{ipdu1['name']}:" +ipdu1['powerConnections'].each do |connection| + puts "- Power connection uri='#{connection['connectionUri']}'" +end + +# Deletes power device +ipdu1.remove +puts "\nPower Device was sucessfully removed." diff --git a/examples/rack.rb b/examples/rack.rb new file mode 100644 index 000000000..0217ad088 --- /dev/null +++ b/examples/rack.rb @@ -0,0 +1,23 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +options = { + name: 'myrack' +} + +item = OneviewSDK::Rack.new(@client, options) +item.add +puts "Rack #{item['name']} was added with uri='#{item['uri']}'" + +item.remove +puts "Rack #{item['name']} was successfully removed." diff --git a/examples/san_manager.rb b/examples/san_manager.rb new file mode 100644 index 000000000..1f528a005 --- /dev/null +++ b/examples/san_manager.rb @@ -0,0 +1,50 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +# Print default connection info for Brocade Network Advisor +default_info = OneviewSDK::SANManager.get_default_connection_info(@client, 'Brocade Network Advisor') +puts 'Brocade Network Advisor connection info:' +default_info.each { |property| puts "* #{property['name']} - #{property['value']}" } + +# Add a Brocade Network Advisor +san_manager = OneviewSDK::SANManager.new(@client) +san_manager['providerDisplayName'] = 'Brocade Network Advisor' +san_manager['connectionInfo'] = [ + { + 'name' => 'Host', + 'value' => '172.18.15.1' + }, + { + 'name' => 'Port', + 'value' => 5989 + }, + { + 'name' => 'Userame', + 'value' => '' + }, + { + 'name' => 'Password', + 'value' => '' + }, + { + 'name' => 'UseSl', + 'value' => true + } +] + +san_manager.add +puts "- SAN Manager #{san_manager['name']} sucessfully added with uri='#{san_manager['uri']}'" + +# Removes Brocade Network Advisor +san_manager.remove +puts "- SAN Manager #{san_manager['name']} was sucessfully removed" diff --git a/examples/server_hardware.rb b/examples/server_hardware.rb index 6e26bce85..e83c46e80 100644 --- a/examples/server_hardware.rb +++ b/examples/server_hardware.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Gives access to @client # Example: Add server hardware @@ -16,8 +27,8 @@ } item = OneviewSDK::ServerHardware.new(@client, options) -item.create -puts "\nCreated #{type} '#{item[:name]}' sucessfully.\n uri = '#{item[:uri]}'" +item.add +puts "\nAdded #{type} '#{item[:name]}' sucessfully.\n uri = '#{item[:uri]}'" # Find recently created item by name matches = OneviewSDK::ServerHardware.find_by(@client, name: item[:name]) @@ -37,5 +48,5 @@ end # Delete this item -item.delete -puts "\nSucessfully deleted #{type} '#{item[:name]}'." +item.remove +puts "\nSucessfully removed #{type} '#{item[:name]}'." diff --git a/examples/server_hardware_type.rb b/examples/server_hardware_type.rb index 3224b06ec..ed1a755dd 100644 --- a/examples/server_hardware_type.rb +++ b/examples/server_hardware_type.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Gives access to @client # Example: List server hardware types diff --git a/examples/server_profile.rb b/examples/server_profile.rb index e79b951fd..03dc0fd2b 100644 --- a/examples/server_profile.rb +++ b/examples/server_profile.rb @@ -1,33 +1,46 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + require_relative '_client' # Gives access to @client # Example: Create a server profile # NOTE: This will create a server profile named 'OneViewSDK Test ServerProfile', then delete it. -# NOTE: You'll need to add the following instance variables to the _client.rb file with valid URIs for your environment: -# @server_hardware_type_uri -# @enclosure_group_uri -fail 'Must set @server_hardware_type_uri in _client.rb' unless @server_hardware_type_uri -fail 'Must set @enclosure_group_uri in _client.rb' unless @enclosure_group_uri +profile = OneviewSDK::ServerProfile.new(@client, 'name' => 'OneViewSDK Test ServerProfile') + +target = OneviewSDK::ServerProfile.get_available_targets(@client)['targets'].first + +server_hardware = OneviewSDK::ServerHardware.new(@client, uri: target['serverHardwareUri']) +server_hardware_type = OneviewSDK::ServerHardwareType.new(@client, uri: target['serverHardwareTypeUri']) +enclosure_group = OneviewSDK::EnclosureGroup.new(@client, uri: target['enclosureGroupUri']) -options = { - name: 'OneViewSDK Test ServerProfile', - serverHardwareTypeUri: @server_hardware_type_uri, - enclosureGroupUri: @enclosure_group_uri -} +profile.set_server_hardware(server_hardware) +profile.set_server_hardware_type(server_hardware_type) +profile.set_enclosure_group(enclosure_group) -profile = OneviewSDK::ServerProfile.new(@client, options) profile.create puts "\nCreated server profile '#{profile[:name]}' sucessfully.\n uri = '#{profile[:uri]}'" # Show available server hardware that matches this profile's requirements puts "\nAvailable server hardware for profile '#{profile[:name]}':" -profile.available_hardware.each { |hw| puts " - #{hw[:name]}" } +profile.get_available_hardware.each { |hw| puts " - #{hw[:name]}" } # Find recently created server profile by name matches = OneviewSDK::ServerProfile.find_by(@client, name: profile[:name]) profile2 = matches.first puts "\nFound server profile by name: '#{profile[:name]}'.\n uri = '#{profile2[:uri]}'" +# Power-off attached server hardware +profile2.get_server_hardware.power_off + # Retrieve recently created server profile profile3 = OneviewSDK::ServerProfile.new(@client, name: profile[:name]) profile3.retrieve! @@ -37,7 +50,6 @@ profile.delete puts "\nSucessfully deleted profile '#{profile[:name]}'." - # Example: List all server profiles with certain attributes attributes = { affinity: 'Bay' } puts "\n\nprofile profiles with #{attributes}" diff --git a/examples/server_profile_template.rb b/examples/server_profile_template.rb index fe4bf1651..f337c5cfd 100644 --- a/examples/server_profile_template.rb +++ b/examples/server_profile_template.rb @@ -1,44 +1,59 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Gives access to @client # Example: Create a server profile template # NOTE: This will create a server profile named 'OneViewSDK Test ServerProfileTemplate', then delete it. -# NOTE: You'll need to add the following instance variables to the _client.rb file with valid URIs for your environment: -# @server_hardware_type_uri -# @enclosure_group_uri - -fail 'Must set @server_hardware_type_uri in _client.rb' unless @server_hardware_type_uri -fail 'Must set @enclosure_group_uri in _client.rb' unless @enclosure_group_uri - -type = 'server profile template' -options = { - name: 'OneViewSDK Test ServerProfileTemplate', - serverHardwareTypeUri: @server_hardware_type_uri, - enclosureGroupUri: @enclosure_group_uri -} - -item = OneviewSDK::ServerProfileTemplate.new(@client, options) +type = 'Server Profile Template' +puts "\n### Creating a new Server Profile Template based on a Server Hardware Type and Enclosure Group" +item = OneviewSDK::ServerProfileTemplate.new(@client, name: 'OneViewSDK Test ServerProfileTemplate') +server_hardware_type = OneviewSDK::ServerHardwareType.find_by(@client, {}).first +fail 'Failed to find Server Hardware Type' unless server_hardware_type || server_hardware_type['uri'] +item.set_server_hardware_type(server_hardware_type) +enclosure_group = OneviewSDK::EnclosureGroup.find_by(@client, {}).first +fail 'Failed to find Enclosure Group' unless enclosure_group || enclosure_group['uri'] +item.set_enclosure_group(enclosure_group) item.create -puts "\nCreated #{type} '#{item[:name]}' sucessfully.\n uri = '#{item[:uri]}'" +puts "\nCreated #{type} '#{item['name']}' sucessfully.\n uri = '#{item['uri']}'" +puts "\nServer Hardware Type '#{server_hardware_type['name']}'.\n uri = '#{item['serverHardwareTypeUri']}'" +puts "\nEnclosure Group '#{enclosure_group['name']}'.\n uri = '#{item['enclosureGroupUri']}'" # Find recently created item by name -matches = OneviewSDK::ServerProfileTemplate.find_by(@client, name: item[:name]) +puts "\n\n### Find recently created item by name" +matches = OneviewSDK::ServerProfileTemplate.find_by(@client, name: item['name']) item2 = matches.first -fail "Failed to find #{type} by name: '#{item[:name]}'" unless matches.first -puts "\nFound #{type} by name: '#{item[:name]}'.\n uri = '#{item2[:uri]}'" +fail "Failed to find #{type} by name: '#{item['name']}'" unless matches.first +puts "\nFound #{type} by name: '#{item['name']}'.\n uri = '#{item2['uri']}'" -# Retrieve recently created item -item3 = OneviewSDK::ServerProfileTemplate.new(@client, name: item[:name]) +puts "\n\n### Retrieve recently created item" +item3 = OneviewSDK::ServerProfileTemplate.new(@client, name: item['name']) item3.retrieve! -puts "\nRetrieved #{type} data by name: '#{item[:name]}'.\n uri = '#{item3[:uri]}'" +puts "Retrieved #{type} data by name: '#{item['name']}'.\n uri = '#{item3['uri']}'" + +puts "\n\n### Creating a Server Profile from the retrieved template" +server_profile = item.new_profile("ServerProfile1 from #{item['name']}") +server_profile.create +puts "\nCreated Server Profile '#{server_profile['name']}' sucessfully.\n uri = '#{item['uri']}'" +server_profile.delete +puts "\nSucessfully deleted '#{server_profile['name']}'" -# Delete this item +puts "\n\n### Deleting the Server Profile Template" item3.delete -puts "\nSucessfully deleted #{type} '#{item[:name]}'." +puts "\nSucessfully deleted #{type} '#{item['name']}'." # Example: List all server profile templates with certain attributes attributes = { affinity: 'Bay' } puts "\n\n#{type.capitalize}s with #{attributes}" OneviewSDK::ServerProfileTemplate.find_by(@client, attributes).each do |p| - puts " #{p[:name]}" + puts " #{p['name']}" end diff --git a/examples/storage_pool.rb b/examples/storage_pool.rb index 25f960e8d..0bce8c893 100644 --- a/examples/storage_pool.rb +++ b/examples/storage_pool.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Example: Create a storage pool @@ -16,14 +27,15 @@ puts "Storage System uri = #{storage_system[:uri]}" options[:storageSystemUri] = storage_system[:uri] fail 'ERROR: No unmanaged pools available!' unless storage_system[:unmanagedPools].size > 0 -puts "Unmanaged pool name = #{storage_system[:unmanagedPools].first['name']}" -options[:poolName] = storage_system[:unmanagedPools].first['name'] +pool = storage_system[:unmanagedPools].find { |storage_pool| storage_pool['domain'] == 'TestDomain' } +puts "Unmanaged pool name = #{pool['name']}" +options[:poolName] = pool['name'] # Create storage pool item = OneviewSDK::StoragePool.new(@client, options) item.set_storage_system(storage_system) -item.create -puts "\nCreated #{type} '#{item[:name]}' sucessfully.\n uri = '#{item[:uri]}'" +item.add +puts "\nAdded #{type} '#{item[:name]}' sucessfully.\n uri = '#{item[:uri]}'" # Retrieve created storage pool item_2 = OneviewSDK::StoragePool.new(@client, name: options[:poolName]) @@ -35,5 +47,5 @@ item_3 = matches.first puts "\nFound #{type} by name: '#{item_3[:name]}'.\n uri = '#{item_3[:uri]}'" -item.delete -puts "\nDeleted #{type} '#{item[:name]}' successfully.\n" +item.remove +puts "\nRemoved #{type} '#{item[:name]}' successfully.\n" diff --git a/examples/storage_system.rb b/examples/storage_system.rb index 886f4323f..c1c5d27b9 100644 --- a/examples/storage_system.rb +++ b/examples/storage_system.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Gives access to @client # Example: Create a storage system @@ -21,7 +32,7 @@ storage1 = OneviewSDK::StorageSystem.new(@client) storage1['credentials'] = options storage1['managedDomain'] = 'TestDomain' -storage1.create +storage1.add puts storage1['managedDomain'] OneviewSDK::StorageSystem.find_by(@client, credentials: { ip_hostname: options[:ip_hostname] }).each do |storage| @@ -30,4 +41,4 @@ storage = OneviewSDK::StorageSystem.new(@client, credentials: { ip_hostname: options[:ip_hostname] }) storage.retrieve! -storage.delete +storage.remove diff --git a/examples/switch.rb b/examples/switch.rb new file mode 100644 index 000000000..4459743d9 --- /dev/null +++ b/examples/switch.rb @@ -0,0 +1,35 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +def pretty(arg) + return puts arg if arg.instance_of?(String) + puts JSON.pretty_generate(arg) +end + +# Example: Retrieve information about a switch +# NOTE: This will retrieve a switch the use it's methods to list the options + +# Retrieve the Switch +switch = OneviewSDK::Switch.find_by(@client, {}).first +puts "\nRetrieved switch '#{switch[:name]}' sucessfully.\n uri = '#{switch[:uri]}'" + +sleep(10) + +# List all the available Switch Types +switch_type_list = OneviewSDK::Switch.get_types(@client) +puts "\nThe switch types available are: " +switch_type_list.each { |type| puts type['name'] } + +# List Switch environmental configuration +pretty "\nThe switch #{switch[:name]} environmental_configuration are:" +pretty switch.environmental_configuration diff --git a/examples/unmanaged_device.rb b/examples/unmanaged_device.rb new file mode 100644 index 000000000..98559b604 --- /dev/null +++ b/examples/unmanaged_device.rb @@ -0,0 +1,15 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +require_relative '_client' # Gives access to @client + +unmanaged_devices = OneviewSDK::UnmanagedDevice.get_devices(@client) +unmanaged_devices.each { |device| puts device['name'] } diff --git a/examples/uplink_set.rb b/examples/uplink_set.rb index b42814fc2..a5526278c 100644 --- a/examples/uplink_set.rb +++ b/examples/uplink_set.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' ethernet = OneviewSDK::EthernetNetwork.new(@client, name: 'lig_eth01') diff --git a/examples/volume.rb b/examples/volume.rb index 629492cf7..b20ce5567 100644 --- a/examples/volume.rb +++ b/examples/volume.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Example: Create Volumes from the creation mehtods diff --git a/examples/volume_attachment.rb b/examples/volume_attachment.rb new file mode 100644 index 000000000..c52c001aa --- /dev/null +++ b/examples/volume_attachment.rb @@ -0,0 +1,35 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require_relative '_client' + +# List volume attachments +puts "\nVolume attachments available: " +OneviewSDK::VolumeAttachment.find_by(@client, {}).each do |volume_attachment| + puts "- #{volume_attachment['hostName']}" +end + +# List extra unmanaged storage volumes +extra_managed_volumes = OneviewSDK::VolumeAttachment.get_extra_unmanaged_volumes(@client)['members'] +puts "\nUnmanaged volumes: " unless extra_managed_volumes.empty? +extra_managed_volumes.each do |unmanaged_volume| + puts "- #{unmanaged_volume['ownerUri']}" +end + +# List extra unmanaged storage volumes +volume_attachment = OneviewSDK::VolumeAttachment.find_by(@client, {}).first +if volume_attachment + volume_paths = volume_attachment.get_paths + puts "\nVolume #{volume_attachment['hostName']} paths: " unless volume_paths.empty? + volume_paths.each do |path| + puts "- #{path['initiatorName']}" + end +end diff --git a/examples/volume_template.rb b/examples/volume_template.rb index dcf69f9f7..a0990887b 100644 --- a/examples/volume_template.rb +++ b/examples/volume_template.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + require_relative '_client' # Example: Create a volume template diff --git a/lib/oneview-sdk.rb b/lib/oneview-sdk.rb index 40fc27cd1..904915622 100644 --- a/lib/oneview-sdk.rb +++ b/lib/oneview-sdk.rb @@ -1,4 +1,16 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + require_relative 'oneview-sdk/version' +require_relative 'oneview-sdk/exceptions' require_relative 'oneview-sdk/client' require_relative 'oneview-sdk/resource' require_relative 'oneview-sdk/cli' diff --git a/lib/oneview-sdk/cli.rb b/lib/oneview-sdk/cli.rb index 5416100fa..d2aa198af 100644 --- a/lib/oneview-sdk/cli.rb +++ b/lib/oneview-sdk/cli.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + require 'thor' require 'json' require 'yaml' @@ -180,9 +191,9 @@ def search(type) options['attribute'].split(',').each do |attr| temp[attr] = d[attr] end - data.push temp + data.push(d['name'] => temp) end - output data + output data, -2 # Shift left by 2 so things look right else # List names only by default names = [] matches.each { |m| names.push(m['name']) } @@ -366,34 +377,29 @@ def output(data = {}, indent = 0) when 'yaml' puts data.to_yaml else + # rubocop:disable Metrics/BlockNesting if data.class == Hash || data.class <= OneviewSDK::Resource data.each do |k, v| if v.class == Hash || v.class == Array - puts "#{' ' * indent}#{k}:" + puts "#{' ' * indent}#{k.nil? ? 'nil' : k}:" output(v, indent + 2) else - puts "#{' ' * indent}#{k}: #{v}" + puts "#{' ' * indent}#{k.nil? ? 'nil' : k}: #{v.nil? ? 'nil' : v}" end end elsif data.class == Array data.each do |d| if d.class == Hash || d.class == Array - # rubocop:disable Metrics/BlockNesting - if indent == 0 - puts '' - output(d, indent) - else - output(d, indent + 2) - end - # rubocop:enable Metrics/BlockNesting + output(d, indent + 2) else - puts "#{' ' * indent}#{d}" + puts "#{' ' * indent}#{d.nil? ? 'nil' : d}" end end - puts "\nTotal: #{data.size}" if indent == 0 + puts "\nTotal: #{data.size}" if indent < 1 else - puts "#{' ' * indent}#{data}" + puts "#{' ' * indent}#{data.nil? ? 'nil' : data}" end + # rubocop:enable Metrics/BlockNesting end end end diff --git a/lib/oneview-sdk/client.rb b/lib/oneview-sdk/client.rb index 4665473f5..d00a05f45 100644 --- a/lib/oneview-sdk/client.rb +++ b/lib/oneview-sdk/client.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + require 'logger' require_relative 'config_loader' require_relative 'rest' @@ -9,32 +20,33 @@ class Client DEFAULT_API_VERSION = 200 attr_reader :url, :user, :token, :password, :max_api_version - attr_accessor :ssl_enabled, :api_version, :logger, :log_level, :cert_store, :print_wait_dots + attr_accessor :ssl_enabled, :api_version, :logger, :log_level, :cert_store, :print_wait_dots, :timeout include Rest - # Create client object, establish connection, and set up logging and api version. + # Creates client object, establish connection, and set up logging and api version. # @param [Hash] options the options to configure the client # @option options [Logger] :logger (Logger.new(STDOUT)) Logger object to use. # Must implement debug(String), info(String), warn(String), error(String), & level= # @option options [Symbol] :log_level (:info) Log level. Logger must define a constant with this name. ie Logger::INFO - # @option options [Boolean] :print_wait_dots (false) When true, prints status dots while waiting on tasks to complete. + # @option options [Boolean] :print_wait_dots (false) When true, prints status dots while waiting on the tasks to complete. # @option options [String] :url URL of OneView appliance - # @option options [String] :user ('Administrator') Username to use for authentication with OneView appliance - # @option options [String] :password (ENV['ONEVIEWSDK_PASSWORD']) Password to use for authentication with OneView appliance - # @option options [String] :token (ENV['ONEVIEWSDK_TOKEN']) Token to use for authentication with OneView appliance - # Use this OR the username and password (not both). Token has precedence. - # @option options [Integer] :api_version (200) API Version to use by default for requests + # @option options [String] :user ('Administrator') The username to use for authentication with the OneView appliance + # @option options [String] :password (ENV['ONEVIEWSDK_PASSWORD']) The password to use for authentication with OneView appliance + # @option options [String] :token (ENV['ONEVIEWSDK_TOKEN']) The token to use for authentication with OneView appliance + # Use the token or the username and password (not both). The token has precedence. + # @option options [Integer] :api_version (200) This is the API version to use by default for requests # @option options [Boolean] :ssl_enabled (true) Use ssl for requests? Respects ENV['ONEVIEWSDK_SSL_ENABLED'] + # @option options [Integer] :timeout (nil) Override the default request timeout value def initialize(options = {}) options = Hash[options.map { |k, v| [k.to_sym, v] }] # Convert string hash keys to symbols @logger = options[:logger] || Logger.new(STDOUT) - [:debug, :info, :warn, :error, :level=].each { |m| fail "Logger must respond to #{m} method " unless @logger.respond_to?(m) } + [:debug, :info, :warn, :error, :level=].each { |m| fail InvalidClient, "Logger must respond to #{m} method " unless @logger.respond_to?(m) } @log_level = options[:log_level] || :info @logger.level = @logger.class.const_get(@log_level.upcase) rescue @log_level @print_wait_dots = options.fetch(:print_wait_dots, false) @url = options[:url] || ENV['ONEVIEWSDK_URL'] - fail 'Must set the url option' unless @url + fail InvalidClient, 'Must set the url option' unless @url @max_api_version = appliance_api_version if options[:api_version] && options[:api_version].to_i > @max_api_version logger.warn "API version #{options[:api_version]} is greater than the appliance API version (#{@max_api_version})" @@ -49,24 +61,25 @@ def initialize(options = {}) end end @ssl_enabled = options[:ssl_enabled] unless options[:ssl_enabled].nil? + @timeout = options[:timeout] unless options[:timeout].nil? @cert_store = OneviewSDK::SSLHelper.load_trusted_certs if @ssl_enabled @token = options[:token] || ENV['ONEVIEWSDK_TOKEN'] return if @token @logger.warn 'User option not set. Using default (Administrator)' unless options[:user] || ENV['ONEVIEWSDK_USER'] @user = options[:user] || ENV['ONEVIEWSDK_USER'] || 'Administrator' @password = options[:password] || ENV['ONEVIEWSDK_PASSWORD'] - fail 'Must set user & password options or token option' unless @password + fail InvalidClient, 'Must set user & password options or token option' unless @password @token = login end - # Tell OneView to create the resource using the current attribute data + # Tells OneView to create the resource using the current attribute data # @param [Resource] resource the object to create def create(resource) resource.client = self resource.create end - # Set attribute data and save to OneView + # Sets the attribute data, and then saves to OneView # @param [Resource] resource the object to update def update(resource, attributes = {}) resource.client = self @@ -95,15 +108,15 @@ def delete(resource) def get_all(type) OneviewSDK.resource_named(type).get_all(self) rescue StandardError - raise "Invalid resource type '#{type}'" + raise TypeError, "Invalid resource type '#{type}'" end # Wait for a task to complete # @param [String] task_uri - # @raise [RuntimeError] if the task resulted in an error or early termination. - # @return [Hash] if the task completed sucessfully, return the task details + # @raise [OneviewSDK::TaskError] if the task resulted in an error or early termination. + # @return [Hash] if the task completed successfully, return the task details def wait_for(task_uri) - fail 'Must specify a task_uri!' if task_uri.nil? || task_uri.empty? + fail ArgumentError, 'Must specify a task_uri!' if task_uri.nil? || task_uri.empty? loop do task_uri.gsub!(%r{/https:(.*)\/rest/}, '/rest') task = rest_get(task_uri) @@ -117,7 +130,7 @@ def wait_for(task_uri) when 'error', 'killed', 'terminated' msg = "Task ended with bad state: '#{body['taskState']}'.\nResponse: " msg += body['taskErrors'] ? JSON.pretty_generate(body['taskErrors']) : JSON.pretty_generate(body) - fail(msg) + fail TaskError, msg else print '.' if @print_wait_dots sleep 10 @@ -133,10 +146,10 @@ def appliance_api_version options = { 'Content-Type' => :none, 'X-API-Version' => :none, 'auth' => :none } response = rest_api(:get, '/rest/version', options) version = response_handler(response)['currentVersion'] - fail "Couldn't get API version" unless version + fail ConnectionError, "Couldn't get API version" unless version version = version.to_i if version.class != Fixnum version - rescue + rescue ConnectionError @logger.warn "Failed to get OneView max api version. Using default (#{DEFAULT_API_VERSION})" DEFAULT_API_VERSION end @@ -153,7 +166,7 @@ def login(retries = 2) response = rest_post('/rest/login-sessions', options) body = response_handler(response) return body['sessionID'] if body['sessionID'] - fail "\nERROR! Couldn't log into OneView server at #{@url}. Response: #{response}\n#{response.body}" + fail ConnectionError, "\nERROR! Couldn't log into OneView server at #{@url}. Response: #{response}\n#{response.body}" rescue StandardError => e raise e unless retries > 0 @logger.debug 'Failed to log in to OneView. Retrying...' diff --git a/lib/oneview-sdk/config_loader.rb b/lib/oneview-sdk/config_loader.rb index 57f6e82aa..978eeb4d4 100644 --- a/lib/oneview-sdk/config_loader.rb +++ b/lib/oneview-sdk/config_loader.rb @@ -1,8 +1,19 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + require 'yaml' require 'json' module OneviewSDK - # Configuration helper class to allow .yaml & .json files to be easily used to specify OneView Configuration + # Configuration helper class to allow .yaml and .json files to be easily used to specify OneView Configuration class Config # Load config from .yaml or .json file diff --git a/lib/oneview-sdk/exceptions.rb b/lib/oneview-sdk/exceptions.rb new file mode 100644 index 000000000..94e8704b7 --- /dev/null +++ b/lib/oneview-sdk/exceptions.rb @@ -0,0 +1,55 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +# Contains all the custom Exception classes +module OneviewSDK + class ConnectionError < StandardError # Cannot connect to client/resource + end + + class InvalidURL < StandardError # URL is invalid + end + + class InvalidClient < StandardError # Client configuration is invalid + end + + class InvalidResource < StandardError # Failed resource validations + end + + class IncompleteResource < StandardError # Missing required resource data to complete action + end + + class MethodUnavailable < StandardError # Resource does not support this method + end + + class UnsupportedVersion < StandardError # Resource not supported on this API version + end + + class InvalidRequest < StandardError # Could not make request + end + + class BadRequest < StandardError # 400 + end + + class Unauthorized < StandardError # 401 + end + + class NotFound < StandardError # 404 + end + + class RequestError < StandardError # Other bad response codes + end + + class TaskError < StandardError # Task ended in a bad state + end + + class InvalidFormat < StandardError # File format is invalid + end +end diff --git a/lib/oneview-sdk/resource.rb b/lib/oneview-sdk/resource.rb index 9eca526f8..04e582163 100644 --- a/lib/oneview-sdk/resource.rb +++ b/lib/oneview-sdk/resource.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + require_relative 'client' # OneviewSDK Resources @@ -13,27 +24,28 @@ class Resource :logger # Create a resource object, associate it with a client, and set its properties. - # @param [Client] client The Client object with a connection to the OneView appliance + # @param [OneviewSDK::Client] client The client object for the OneView appliance # @param [Hash] params The options for this resource (key-value pairs) # @param [Integer] api_ver The api version to use when interracting with this resource. - # Defaults to client.api_version if exists, or OneviewSDK::Client::DEFAULT_API_VERSION. + # Defaults to the client.api_version if it exists, or the OneviewSDK::Client::DEFAULT_API_VERSION. def initialize(client, params = {}, api_ver = nil) - fail 'Must specify a valid client' unless client.is_a?(OneviewSDK::Client) + fail InvalidClient, 'Must specify a valid client' unless client.is_a?(OneviewSDK::Client) @client = client @logger = @client.logger @api_version = api_ver || @client.api_version if @api_version > @client.max_api_version - fail "#{self.class.name} api_version '#{@api_version}' is greater than the client's max_api_version '#{@client.max_api_version}'" + fail UnsupportedVersion, + "#{self.class.name} api_version '#{@api_version}' is greater than the client's max_api_version '#{@client.max_api_version}'" end @data ||= {} set_all(params) end # Retrieve resource details based on this resource's name or URI. - # @note Name or URI must be specified inside resource + # @note Name or URI must be specified inside the resource # @return [Boolean] Whether or not retrieve was successful def retrieve! - fail 'Must set resource name or uri before trying to retrieve!' unless @data['name'] || @data['uri'] + fail IncompleteResource, 'Must set resource name or uri before trying to retrieve!' unless @data['name'] || @data['uri'] results = self.class.find_by(@client, name: @data['name']) if @data['name'] results = self.class.find_by(@client, uri: @data['uri']) if @data['uri'] && (!results || results.empty?) return false unless results.size == 1 @@ -45,14 +57,14 @@ def retrieve! # @note name or uri must be specified inside resource # @return [Boolean] Whether or not resource exists def exists? - fail 'Must set resource name or uri before trying to retrieve!' unless @data['name'] || @data['uri'] + fail IncompleteResource, 'Must set resource name or uri before trying to retrieve!' unless @data['name'] || @data['uri'] return true if @data['name'] && self.class.find_by(@client, name: @data['name']).size == 1 return true if @data['uri'] && self.class.find_by(@client, uri: @data['uri']).size == 1 false end # Set the given hash of key-value pairs as resource data attributes - # @param [Hash, Resource] params The options for this resource (key-value pairs or Resource object) + # @param [Hash, Resource] params The options for this resource (key-value pairs or resource object) # @note All top-level keys will be converted to strings # @return [Resource] self def set_all(params = {}) @@ -105,15 +117,15 @@ def ==(other) end # Check equality of 2 resources. Same as ==(other) - # @param [Resource] other The other resource to check equality for + # @param [Resource] other The other resource to check for equality # @return [Boolean] Whether or not the two objects are equal def eql?(other) self == other end - # Check equality of data on other resource with that of this resource. - # @note Doesn't check the client, logger, or api_version if another Resource is passed in - # @param [Hash, Resource] other Resource or hash to compare key-value pairs with + # Check the equality of the data for the other resource with this resource. + # @note Does not check the client, logger, or api_version if another resource is passed in + # @param [Hash, Resource] other resource or hash to compare the key-value pairs with # @example Compare to hash # myResource = OneviewSDK::Resource.new(client, { name: 'res1', description: 'example'}, 200) # myResource.like?(description: '') # returns false @@ -125,8 +137,8 @@ def like?(other) # Create the resource on OneView using the current data # @note Calls the refresh method to set additional data - # @raise [RuntimeError] if the client is not set - # @raise [RuntimeError] if the resource creation fails + # @raise [OneviewSDK::IncompleteResource] if the client is not set + # @raise [StandardError] if the resource creation fails # @return [Resource] self def create ensure_client @@ -138,8 +150,8 @@ def create # Delete the resource from OneView if it exists, then create it using the current data # @note Calls refresh method to set additional data - # @raise [RuntimeError] if the client is not set - # @raise [RuntimeError] if the resource creation fails + # @raise [OneviewSDK::IncompleteResource] if the client is not set + # @raise [StandardError] if the resource creation fails # @return [Resource] self def create! temp = self.class.new(@client, @data) @@ -160,8 +172,8 @@ def refresh # Set data and save to OneView # @param [Hash] attributes The attributes to add/change for this resource (key-value pairs) - # @raise [RuntimeError] if the client or uri is not set - # @raise [RuntimeError] if the resource save fails + # @raise [OneviewSDK::IncompleteResource] if the client or uri is not set + # @raise [StandardError] if the resource save fails # @return [Resource] self def update(attributes = {}) set_all(attributes) @@ -194,7 +206,7 @@ def to_file(file_path, format = :json) when :yml, :yaml File.open(file_path, 'w') { |f| f.write(temp_data.to_yaml) } else - fail "Invalid format: #{format}" + fail InvalidFormat, "Invalid format: #{format}" end true end @@ -207,7 +219,7 @@ def schema end # Get resource schema - # @param [Client] client + # @param [OneviewSDK::Client] client The client object for the OneView appliance # @return [Hash] Schema def self.schema(client) response = client.rest_get("#{self::BASE_URI}/schema", client.api_version) @@ -218,7 +230,7 @@ def self.schema(client) end # Load resource from a .json or .yaml file - # @param [Client] client The client object to associate this resource with + # @param [OneviewSDK::Client] client The client object for the OneView appliance # @param [String] file_path The full path to the file # @return [Resource] New resource created from the file contents def self.from_file(client, file_path) @@ -226,8 +238,8 @@ def self.from_file(client, file_path) new(client, resource['data'], resource['api_version']) end - # Make a GET request to the resource uri and return an array with results matching the search - # @param [Client] client + # Make a GET request to the resource uri, and returns an array with results matching the search + # @param [OneviewSDK::Client] client The client object for the OneView appliance # @param [Hash] attributes Hash containing the attributes name and value # @param [String] uri URI of the endpoint # @return [Array] Results matching the search @@ -242,35 +254,61 @@ def self.find_by(client, attributes, uri = self::BASE_URI) temp = new(client, member) results.push(temp) if temp.like?(attributes) end - break unless body['nextPageUri'] + break unless body['nextPageUri'] && (body['nextPageUri'] != body['uri']) uri = body['nextPageUri'] end results end - # Make a GET request to the resource base uri and return an array with all objects of this type + # Make a GET request to the resource base uri, and returns an array with all objects of this type # @return [Array] Results def self.get_all(client) find_by(client, {}) end + # Builds a Query string corresponding to the parameters passed + # @param [Hash{String=>String,OneviewSDK::Resource}] query_options Query parameters and values + # to be applied to the query url. + # All key values should be Strings in snake case, the values could be Strings or Resources. + # @option query_options [String] String Values that are Strings can be associated as usual + # @option query_options [String] Resources Values that are Resources can be associated as usual, + # with keys representing only the resource names (like 'ethernet_network'). This method + # translates the SDK and Ruby standards to OneView request standard. + def self.build_query(query_options) + return '' if !query_options || query_options.empty? + query_path = '?' + query_options.each do |k, v| + words = k.to_s.split('_') + words.map!(&:capitalize!) + words[0] = words.first.downcase + new_key = words.join + v.retrieve! if v.respond_to?(:retrieve!) && !v['uri'] + if v.class <= OneviewSDK::Resource + new_key = new_key.concat('Uri') + v = v['uri'] + end + query_path.concat("&#{new_key}=#{v}") + end + query_path.sub('?&', '?') + end + protected # Fail unless @client is set for this resource. def ensure_client - fail 'Please set client attribute before interacting with this resource' unless @client + fail IncompleteResource, 'Please set client attribute before interacting with this resource' unless @client true end # Fail unless @data['uri'] is set for this resource. def ensure_uri - fail 'Please set uri attribute before interacting with this resource' unless @data['uri'] + fail IncompleteResource, 'Please set uri attribute before interacting with this resource' unless @data['uri'] true end # Fail for methods that are not available for one resource def unavailable_method - fail "The method ##{caller[0][/`.*'/][1..-2]} is unavailable for this resource" + fail MethodUnavailable, "The method ##{caller[0][/`.*'/][1..-2]} is unavailable for this resource" end private diff --git a/lib/oneview-sdk/resource/connection_template.rb b/lib/oneview-sdk/resource/connection_template.rb new file mode 100644 index 000000000..a792b5c4e --- /dev/null +++ b/lib/oneview-sdk/resource/connection_template.rb @@ -0,0 +1,48 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +module OneviewSDK + # Connection template resource implementation + class ConnectionTemplate < Resource + BASE_URI = '/rest/connection-templates'.freeze + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. + def initialize(client, params = {}, api_ver = nil) + super + # Default values: + @data['bandwidth'] ||= {} + @data['type'] ||= 'connection-template' + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Get the default network connection template + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @return [OneviewSDK::ConnectionTemplate] Connection template + def self.get_default(client) + response = client.rest_get(BASE_URI + '/defaultConnectionTemplate') + OneviewSDK::ConnectionTemplate.new(client, client.response_handler(response)) + end + end +end diff --git a/lib/oneview-sdk/resource/datacenter.rb b/lib/oneview-sdk/resource/datacenter.rb new file mode 100644 index 000000000..25dc47cd0 --- /dev/null +++ b/lib/oneview-sdk/resource/datacenter.rb @@ -0,0 +1,77 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +module OneviewSDK + # Datacenter resource implementation + class Datacenter < Resource + BASE_URI = '/rest/datacenters'.freeze + + # Add the resource on OneView using the current data + # @note Calls the refresh method to set additional data + # @raise [OneviewSDK::IncompleteResource] if the client is not set + # @raise [StandardError] if the resource creation fails + # @return [OneviewSDK::Datacenter] self + alias add create + + # Remove resource from OneView + # @return [true] if resource was removed successfully + alias remove delete + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. + def initialize(client, params = {}, api_ver = nil) + super + # Default values: + @data['contents'] ||= [] + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Adds an existing rack to the datacenter + # @param [OneviewSDK::Rack] rack rack + # @param [Decimal] pos_x x position + # @param [Decimal] pos_y y position + # @param [Decimal] rotation Rotation degrees (0-359) around the center of the resource + def add_rack(rack, pos_x, pos_y, rotation = 0) + @data['contents'] << { + 'resourceUri' => rack['uri'], + 'x' => pos_x, + 'y' => pos_y, + 'rotation' => rotation + } + end + + # Removes a rack from the datacenter + # @param [OneviewSDK::Rack] rack rack + def remove_rack(rack) + @data['contents'].reject! { |resource| resource['resourceUri'] == rack['uri'] } + end + + # Gets a list of the visual content objects + # @return [Hash] + def get_visual_content + response = @client.rest_get(@data['uri'] + '/visualContent') + @client.response_handler(response) + end + end +end diff --git a/lib/oneview-sdk/resource/enclosure.rb b/lib/oneview-sdk/resource/enclosure.rb index 83b870ced..490301f79 100644 --- a/lib/oneview-sdk/resource/enclosure.rb +++ b/lib/oneview-sdk/resource/enclosure.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + require 'time' require 'date' @@ -6,31 +17,40 @@ module OneviewSDK class Enclosure < Resource BASE_URI = '/rest/enclosures'.freeze + # Remove resource from OneView + # @return [true] if resource was removed successfully + alias remove delete + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values: @data['type'] ||= 'EnclosureV200' end - # @!group Validates - VALID_LICENSING_INTENTS = %w(NotApplicable OneView OneViewNoiLO OneViewStandard).freeze - def validate_licensingIntent(value) - fail 'Invalid licensingIntent' unless VALID_LICENSING_INTENTS.include?(value) || value.nil? + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method end - VALID_REFRESH_STATES = %w(NotRefreshing RefreshFailed RefreshPending Refreshing).freeze - def validate_refreshState(value) - fail 'Invalid refreshState' unless VALID_REFRESH_STATES.include?(value) + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method end - # @!endgroup - # Claim/configure the enclosure and its components to the appliance - def create + # @note Calls the refresh method to set additional data + # @return [OneviewSDK::Enclosure] self + def add ensure_client required_attributes = %w(enclosureGroupUri hostname username password licensingIntent) - required_attributes.each { |k| fail "Missing required attribute: '#{k}'" unless @data.key?(k) } + required_attributes.each { |k| fail IncompleteResource, "Missing required attribute: '#{k}'" unless @data.key?(k) } optional_attrs = %w(enclosureUri firmwareBaselineUri force forceInstallFirmware state unmanagedEnclosure updateFirmwareOn) temp_data = @data.select { |k, _v| required_attributes.include?(k) || optional_attrs.include?(k) } @@ -44,7 +64,9 @@ def create self end - # Override update operation because only the name and rackName can be updated (& it uses PATCH). + # Overrides the update operation because only the name and rackName can be updated (and it uses PATCH). + # @param [Hash] attributes attributes to be updated + # @return [OneviewSDK::Enclosure] self def update(attributes = {}) set_all(attributes) ensure_client && ensure_uri @@ -62,7 +84,7 @@ def update(attributes = {}) self end - # Reapply enclosure configuration + # Reapplies the enclosure configuration def configuration ensure_client && ensure_uri response = @client.rest_put(@data['uri'] + '/configuration', {}, @api_version) @@ -71,13 +93,12 @@ def configuration end - # Refresh enclosure along with all of its components + # Refreshes the enclosure along with all of its components # @param [String] state NotRefreshing, RefreshFailed, RefreshPending, Refreshing # @param [Hash] options Optional force fields for refreshing the enclosure def set_refresh_state(state, options = {}) ensure_client && ensure_uri s = state.to_s rescue state - validate_refreshState(s) # Validate refreshState requestBody = { 'body' => { refreshState: s, @@ -89,7 +110,7 @@ def set_refresh_state(state, options = {}) set_all(new_data) end - # Get enclosure script content + # Gets the enclosure script content # @return [String] Script content def script ensure_client && ensure_uri @@ -97,7 +118,8 @@ def script @client.response_handler(response) end - # Get settings that describe the environmental configuration + # Gets the enclosure settings that describe the environmental configuration + # @return [Hash] The enclosure envirnomental configuration def environmental_configuration ensure_client && ensure_uri response = @client.rest_get(@data['uri'] + '/environmentalConfiguration', @api_version) @@ -133,37 +155,37 @@ def utilization(queryParameters = {}) @client.response_handler(response) end - # Update specific attributes of a given enclosure resource + # Updates specific attributes of a given enclosure resource # @param [String] operation operation to be performed # @param [String] path path # @param [String] value value - def update_attribute(operation, path, value) + def patch(operation, path, value) ensure_client && ensure_uri response = @client.rest_patch(@data['uri'], { 'body' => [{ op: operation, path: path, value: value }] }, @api_version) @client.response_handler(response) end - # Associates one Enclosure Group to the enclosure to be added + # Associates an enclosure group to the enclosure # @param [OneviewSDK] eg Enclosure Group associated def set_enclosure_group(eg) eg.retrieve! unless eg['uri'] @data['enclosureGroupUri'] = eg['uri'] end - private - # Convert Date, Time, or String objects to iso8601 string + # Converts Date, Time, or String objects to iso8601 string + # @raise [InvalidResource] if time is not formatted correctly def convert_time(t) case t when nil then nil when Date then t.to_time.utc.iso8601(3) when Time then t.utc.iso8601(3) when String then Time.parse(t).utc.iso8601(3) - else fail "Invalid time format '#{t.class}'. Valid options are Time, Date, or String" + else fail InvalidResource, "Invalid time format '#{t.class}'. Valid options are Time, Date, or String" end rescue StandardError => e - raise "Failed to parse time value '#{t}'. #{e.message}" + raise InvalidResource, "Failed to parse time value '#{t}'. #{e.message}" end end end diff --git a/lib/oneview-sdk/resource/enclosure_group.rb b/lib/oneview-sdk/resource/enclosure_group.rb index 35bf5d6f3..7217cfd2c 100644 --- a/lib/oneview-sdk/resource/enclosure_group.rb +++ b/lib/oneview-sdk/resource/enclosure_group.rb @@ -1,8 +1,23 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Enclosure group resource implementation class EnclosureGroup < Resource BASE_URI = '/rest/enclosure-groups'.freeze + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values: @@ -11,47 +26,16 @@ def initialize(client, params = {}, api_ver = nil) create_interconnect_bay_mapping unless @data['interconnectBayMappings'] end - # @!group Validates - - VALID_INTERCONNECT_BAY_MAPPING_COUNTS = (1..8).freeze - def validate_interconnectBayMappingCount(value) - fail 'Interconnect Bay Mapping Count out of range 1..8' unless VALID_INTERCONNECT_BAY_MAPPING_COUNTS.include?(value) - end - - VALID_IP_ADDRESSING_MODES = %w(DHCP External IpPool).freeze - def validate_ipAddressingMode(value) - return if !@data['enclosureTypeUri'] || /c7000/ =~ @data['enclosureTypeUri'] - is_not_a_c7000_without_ip_addressing_mode = !(/c7000/ =~ @data['enclosureTypeUri']) && !value - fail "Invalid ip AddressingMode: #{value}" if !VALID_IP_ADDRESSING_MODES.include?(value) || is_not_a_c7000_without_ip_addressing_mode - end - - VALID_PORT_MAPPING_COUNTS = (0..8).freeze - def validate_portMappingCount(value) - fail 'Port Mapping Count out of range 0..8' unless VALID_PORT_MAPPING_COUNTS.include?(value) - end - - VALID_POWER_MODES = ['RedundantPowerFeed', 'RedundantPowerSupply', nil].freeze - def validate_powerMode(value) - fail 'Invalid powerMode' unless VALID_POWER_MODES.include?(value) - end - - VALID_STACKING_MODES = %w(Enclosure MultiEnclosure None SwitchPairs).freeze - def validate_stackingMode(value) - fail 'Invalid stackingMode' unless VALID_STACKING_MODES.include?(value) - end - - # @!endgroup - # Get the script executed by enclosures in this enclosure group - # @return [String] script for this enclosure group + # @return [String] The script for this enclosure group def get_script ensure_client && ensure_uri response = @client.rest_get(@data['uri'] + '/script', @api_version) @client.response_handler(response) end - # Change the script executed by enclosures in this enclosure group - # @param [String] body script to be executed + # Changes the script executed by the enclosures in this enclosure group + # @param [String] body The script to be executed # @return true if set successfully def set_script(body) ensure_client && ensure_uri @@ -60,7 +44,7 @@ def set_script(body) true end - # Add logical interconnect group + # Adds the logical interconnect group # @param [OneviewSDK::LogicalInterconnectGroup] lig Logical Interconnect Group def add_logical_interconnect_group(lig) lig.retrieve! unless lig['uri'] @@ -71,7 +55,7 @@ def add_logical_interconnect_group(lig) end end - # Create interconnect bay mapping + # Creates the interconnect bay mapping def create_interconnect_bay_mapping @data['interconnectBayMappings'] = [] 1.upto(@data['interconnectBayMappingCount']) do |bay_number| diff --git a/lib/oneview-sdk/resource/ethernet_network.rb b/lib/oneview-sdk/resource/ethernet_network.rb index db763dd0a..c9fe464e3 100644 --- a/lib/oneview-sdk/resource/ethernet_network.rb +++ b/lib/oneview-sdk/resource/ethernet_network.rb @@ -1,8 +1,23 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Ethernet network resource implementation class EthernetNetwork < Resource BASE_URI = '/rest/ethernet-networks'.freeze + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values: @@ -10,26 +25,8 @@ def initialize(client, params = {}, api_ver = nil) @data['type'] ||= 'ethernet-networkV3' end - # @!group Validates - - VALID_ETHERNET_NETWORK_TYPES = %w(NotApplicable Tagged Tunnel Unknown Untagged).freeze - # Validate ethernetNetworkType - # @param [String] value Notapplicable, Tagged, Tunnel, Unknown, Untagged - def validate_ethernetNetworkType(value) - fail 'Invalid network type' unless VALID_ETHERNET_NETWORK_TYPES.include?(value) - end - - VALID_PURPOSES = %w(FaultTolerance General Management VMMigration).freeze - # Validate purpose - # @param [String] value FaultTolerance, General, Management, VMMigration - def validate_purpose(value) - fail 'Invalid ethernet purpose' unless VALID_PURPOSES.include?(value) - end - - # @!endgroup - - # Bulk create ethernet networks - # @param [Client] client client to connect with OneView + # Bulk create the ethernet networks + # @param [OneviewSDK::Client] client The client object for the OneView appliance # @param [Hash] options information necessary to create networks # @return [Array] list of ethernet networks created def self.bulk_create(client, options) @@ -42,19 +39,18 @@ def self.bulk_create(client, options) OneviewSDK::EthernetNetwork.get_all(client).select { |network| network_names.include?(network['name']) } end - # Get associatedProfiles + # Gets the associated profiles def get_associated_profiles ensure_client && ensure_uri response = @client.rest_get("#{@data['uri']}/associatedProfiles", @api_version) response.body end - # Get associatedUplinkGroups + # Gets the associated uplink groups def get_associated_uplink_groups ensure_client && ensure_uri response = @client.rest_get("#{@data['uri']}/associatedUplinkGroups", @api_version) response.body end - end end diff --git a/lib/oneview-sdk/resource/fabric.rb b/lib/oneview-sdk/resource/fabric.rb new file mode 100644 index 000000000..cf464f3af --- /dev/null +++ b/lib/oneview-sdk/resource/fabric.rb @@ -0,0 +1,41 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +module OneviewSDK + # FC network resource implementation + class Fabric < Resource + BASE_URI = '/rest/fabrics'.freeze + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def update + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def refresh + unavailable_method + end + end +end diff --git a/lib/oneview-sdk/resource/fc_network.rb b/lib/oneview-sdk/resource/fc_network.rb index 02c6de607..accb78558 100644 --- a/lib/oneview-sdk/resource/fc_network.rb +++ b/lib/oneview-sdk/resource/fc_network.rb @@ -1,8 +1,23 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # FC network resource implementation class FCNetwork < Resource BASE_URI = '/rest/fc-networks'.freeze + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values @@ -11,21 +26,5 @@ def initialize(client, params = {}, api_ver = nil) @data['linkStabilityTime'] ||= 30 @data['fabricType'] ||= 'FabricAttach' end - - # @!group Validates - - VALID_FABRIC_TYPES = %w(DirectAttach FabricAttach).freeze - def validate_fabricType(value) - fail 'Invalid fabric type' unless VALID_FABRIC_TYPES.include?(value) - end - - VALID_LINK_STABILITY_TIMES = (1..1800).freeze - def validate_linkStabilityTime(value) - return unless @data['fabricType'] && @data['fabricType'] == 'FabricAttach' - fail 'Link stability time out of range 1..1800' unless VALID_LINK_STABILITY_TIMES.include?(value) - end - - # @!endgroup - end end diff --git a/lib/oneview-sdk/resource/fcoe_network.rb b/lib/oneview-sdk/resource/fcoe_network.rb index d093d544b..ab88187f4 100644 --- a/lib/oneview-sdk/resource/fcoe_network.rb +++ b/lib/oneview-sdk/resource/fcoe_network.rb @@ -1,25 +1,28 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # FCoE network resource implementation class FCoENetwork < Resource BASE_URI = '/rest/fcoe-networks'.freeze + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values: @data['connectionTemplateUri'] ||= nil @data['type'] ||= 'fcoe-network' end - - # @!group Validates - - VALID_VLAN_IDS = (1..4094).freeze - # Validate vlanId - # @param [Fixnum] value 1..4094 - def validate_vlanId(value) - fail 'vlanId out of range 1..4094' unless VALID_VLAN_IDS.include?(value) - end - - # @!endgroup - end end diff --git a/lib/oneview-sdk/resource/firmware_bundle.rb b/lib/oneview-sdk/resource/firmware_bundle.rb index b3f91e015..733cd5d3d 100644 --- a/lib/oneview-sdk/resource/firmware_bundle.rb +++ b/lib/oneview-sdk/resource/firmware_bundle.rb @@ -1,37 +1,36 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Firmware bundle resource implementation class FirmwareBundle BASE_URI = '/rest/firmware-bundles'.freeze - BOUNDARY = '---OneView-SDK-RubyFormBoundaryWzS4H31b7UMbKMCx'.freeze + BOUNDARY = '----011000010111000001101001'.freeze - # Upload a firmware bundle file - # @param [OneviewSDK::Client] client + # Uploads a firmware bundle file + # @param [OneviewSDK::Client] client The client object for the OneView appliance # @param [String] file_path # @return [OneviewSDK::FirmwareDriver] if the upload was sucessful, return a FirmwareDriver object - def self.upload(client, file_path) - fail "ERROR: File '#{file_path}' not found!" unless File.file?(file_path) - type = case File.extname(file_path) - when '.zip' then 'application/x-zip-compressed' - when '.exe' then 'application/x-msdownload' - else 'application/octet-stream' - end - - body = "--#{BOUNDARY}\r\n" - body << "Content-Disposition: form-data; name=\"file\"; filename=\"#{File.basename(file_path)}\"\r\n" - body << "Content-Type: #{type}\r\n\r\n" - body << File.read(file_path) - body << "\r\n--#{BOUNDARY}--" - - options = { - 'Content-Type' => "multipart/form-data; boundary=#{BOUNDARY}", - 'uploadfilename' => File.basename(file_path), - 'body' => body - } - + def self.add(client, file_path) + fail NotFound, "ERROR: File '#{file_path}' not found!" unless File.file?(file_path) + options = {} + options['Content-Type'] = "multipart/form-data; boundary=#{BOUNDARY}" + options['uploadfilename'] = File.basename(file_path) + options['body'] = "--#{BOUNDARY}\r\n" + options['body'] << "Content-Disposition: form-data; name=\"file\"; filename=\"#{File.basename(file_path)}\"\r\n" + options['body'] << "Content-Type: application/octet-stream; Content-Transfer-Encoding: binary\r\n\r\n" + options['body'] << "#{IO.binread(file_path)}\r\n--#{BOUNDARY}--" response = client.rest_post(BASE_URI, options) data = client.response_handler(response) OneviewSDK::FirmwareDriver.new(client, data) end - end end diff --git a/lib/oneview-sdk/resource/firmware_driver.rb b/lib/oneview-sdk/resource/firmware_driver.rb index 2c80ad670..043129083 100644 --- a/lib/oneview-sdk/resource/firmware_driver.rb +++ b/lib/oneview-sdk/resource/firmware_driver.rb @@ -1,21 +1,33 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Firmware driver resource implementation class FirmwareDriver < Resource BASE_URI = '/rest/firmware-drivers'.freeze - def initialize(client, params = {}, api_ver = nil) - super - # Default values - @data['type'] ||= 'firmware-baselines' - end + # Remove resource from OneView + # @return [true] if resource was removed successfully + alias remove delete - def create - fail 'Method not available for this resource!' + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method end + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available def update - create + unavailable_method end - end end diff --git a/lib/oneview-sdk/resource/interconnect.rb b/lib/oneview-sdk/resource/interconnect.rb index 98a70cdb8..7550802e8 100644 --- a/lib/oneview-sdk/resource/interconnect.rb +++ b/lib/oneview-sdk/resource/interconnect.rb @@ -1,35 +1,56 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Interconnect resource implementation class Interconnect < Resource BASE_URI = '/rest/interconnects'.freeze TYPE_URI = '/rest/interconnect-types'.freeze + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super end + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available def create unavailable_method end + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available def update unavailable_method end + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available def delete unavailable_method end - # Retrieve interconnect types - # @param [Client] client http client + # Retrieves interconnect types + # @param [OneviewSDK::Client] client The client object for the OneView appliance def self.get_types(client) response = client.rest_get(TYPE_URI) response = client.response_handler(response) response['members'] end - # Retrieve interconnect ype with name - # @param [Client] client http client + # Retrieves the interconnect type with name + # @param [OneviewSDK::Client] client The client object for the OneView appliance # @param [String] name Interconnect type name # @return [Array] Interconnect type def self.get_type(client, name) @@ -37,7 +58,7 @@ def self.get_type(client, name) results.find { |interconnect_type| interconnect_type['name'] == name } end - # Retrieve named servers for this interconnect + # Retrieves the named servers for this interconnect def name_servers response = @client.rest_get(@data['uri'] + '/nameServers') response.body @@ -68,20 +89,19 @@ def statistics(portName = nil, subportNumber = nil) response.body end - # Triggers a reset of port protection + # Triggers the reset port protection action def reset_port_protection response = @client.rest_put(@data['uri'] + '/resetportprotection') @client.response_handler(response) end - # Update specific attributes of a given interconnect resource + # Updates specific attributes for a given interconnect resource # @param [String] operation operation to be performed # @param [String] path path # @param [String] value value - def update_attribute(operation, path, value) + def patch(operation, path, value) response = @client.rest_patch(@data['uri'], 'body' => [{ op: operation, path: path, value: value }]) @client.response_handler(response) end - end end diff --git a/lib/oneview-sdk/resource/lig_uplink_set.rb b/lib/oneview-sdk/resource/lig_uplink_set.rb index ef072a5ce..50eed0fc6 100644 --- a/lib/oneview-sdk/resource/lig_uplink_set.rb +++ b/lib/oneview-sdk/resource/lig_uplink_set.rb @@ -1,8 +1,23 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK - # Uplink Sets resource implementation to be used in Logical interconnect groups + # Uplink sets resource implementation to be used in logical interconnect groups class LIGUplinkSet < Resource BASE_URI = '/rest/logical-interconnect-groups'.freeze + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values: @@ -12,35 +27,15 @@ def initialize(client, params = {}, api_ver = nil) @data['networkUris'] ||= [] end - # @!group Validates - - VALID_NETWORK_TYPES = %w(FibreChannel Ethernet).freeze - # Validate ethernetNetworkType request - # @param [String] value FibreChannel, Ethernet - def validate_networkType(value) - fail 'Invalid network type' unless VALID_NETWORK_TYPES.include?(value) - fail 'Attribute missing' if value == 'Ethernet' && !@data['ethernetNetworkType'] - fail 'Attribute not supported' if value == 'FibreChannel' && @data['ethernetNetworkType'] - end - - VALID_ETHERNET_NETWORK_TYPES = %w(NotApplicable Tagged Tunnel Unknown Untagged).freeze - # Validate ethernetNetworkType request - # @param [String] value Notapplicable, Tagged, Tunnel, Unknown, Untagged. Must exist if networkType is 'Ethernet', otherwise shouldn't. - def validate_ethernetNetworkType(value) - fail 'Invalid ethernetNetworkType' unless VALID_ETHERNET_NETWORK_TYPES.include?(value) - end - - # @!endgroup - - # Add existing network to the network list. + # Add an existing network to the network list. # Ethernet and FibreChannel networks are allowed. - # @param [OneviewSDK::Resource] network resource to be added to the list + # @param [OneviewSDK::Resource] network The resource to be added to the list def add_network(network) - fail 'Resource not retrieved from server' unless network['uri'] + network.retrieve! unless network['uri'] @data['networkUris'] << network['uri'] end - # Specify one uplink passing the VC Bay and the port to be attached. + # Specify one uplink passing the virtual connect bay and the port to be attached. # @param [Fixnum] bay number to identify the VC # @param [String] port to attach the uplink. Allowed D1..D16 and X1..X10 def add_uplink(bay, port) @@ -57,7 +52,7 @@ def add_uplink(bay, port) @data['logicalPortConfigInfos'] << entry end - # Set all params + # Sets all params # @overload sets networkType first def set_all(params = {}) params = params.data if params.class <= Resource @@ -77,10 +72,9 @@ def relative_value_of(port) offset = case identifier when 'D' then 0 when 'X' then 16 - else fail "Port not supported: #{identifier} type not found" + else fail InvalidResource, "Port not supported: #{identifier} type not found" end port.to_i + offset end - end end diff --git a/lib/oneview-sdk/resource/logical_downlink.rb b/lib/oneview-sdk/resource/logical_downlink.rb new file mode 100644 index 000000000..e95017ed8 --- /dev/null +++ b/lib/oneview-sdk/resource/logical_downlink.rb @@ -0,0 +1,53 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +module OneviewSDK + # Logical downlink resource implementation + class LogicalDownlink < Resource + BASE_URI = '/rest/logical-downlinks'.freeze + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def update + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Gets a list of logical downlinks, excluding any existing ethernet network + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @return [Array script }, @api_version) @@ -69,16 +72,15 @@ def set_script(script) end # Generates a support dump for the logical enclosure - # @raise [RuntimeError] if the client is not set - # @raise [RuntimeError] if the uri is not set - # @raise [RuntimeError] if the process fails when generating the support dump - # @return [Resource] self + # @raise [OneviewSDK::IncompleteResource] if the client is not set + # @raise [OneviewSDK::IncompleteResource] if the uri is not set + # @raise [StandardError] if the process fails when generating the support dump + # @return [OneviewSDK::LogicalEnclosure] self def support_dump(options) ensure_client && ensure_uri response = @client.rest_post("#{@data['uri']}/support-dumps", { 'body' => options }, @api_version) @client.wait_for(response.header['location']) self end - end end diff --git a/lib/oneview-sdk/resource/logical_interconnect.rb b/lib/oneview-sdk/resource/logical_interconnect.rb index 3ef963862..0b332648b 100644 --- a/lib/oneview-sdk/resource/logical_interconnect.rb +++ b/lib/oneview-sdk/resource/logical_interconnect.rb @@ -1,57 +1,21 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Logical interconnect resource implementation class LogicalInterconnect < Resource BASE_URI = '/rest/logical-interconnects'.freeze LOCATION_URI = '/rest/logical-interconnects/locations/interconnects'.freeze - # @!group Validates - - # Validate ethernet trap categories - VALID_ENET_TRAP_CATEGORIES = %w(Other PortStatus PortThresholds).freeze - def validate_enet_trap_categories(enet_trap_categories) - enet_trap_categories.uniq! - enet_trap_categories.each do |cat| - fail "Ethernet Trap Category #{cat} is not one of the allowed values: #{VALID_ENET_TRAP_CATEGORIES}" unless - VALID_ENET_TRAP_CATEGORIES.include?(cat) - end - end - - # Validate fc trap categories - VALID_FC_TRAP_CATEGORIES = %w(Other PortStatus).freeze - def validate_fc_trap_categories(fc_trap_categories) - fc_trap_categories.uniq! - fc_trap_categories.each do |cat| - fail "FC Trap Category #{cat} is not one of the allowed values: #{VALID_FC_TRAP_CATEGORIES}" unless VALID_FC_TRAP_CATEGORIES.include?(cat) - end - end - - # Validate vcm trap categories - VALID_VCM_TRAP_CATEGORIES = %w(Legacy).freeze - def validate_vcm_trap_categories(vcm_trap_categories) - vcm_trap_categories.uniq! - vcm_trap_categories.each do |cat| - fail "VCM Trap Category #{cat} is not one of the allowed values: #{VALID_VCM_TRAP_CATEGORIES}" unless VALID_VCM_TRAP_CATEGORIES.include?(cat) - end - end - - # Validate trap severities - VALID_TRAP_SEVERITIES = %w(Critical Info Major Minor Normal Unknown Warning).freeze - def validate_trap_severities(trap_severities) - trap_severities.uniq! - trap_severities.each do |cat| - fail "Trap Severities #{cat} is not one of the allowed values: #{VALID_TRAP_SEVERITIES}" unless VALID_TRAP_SEVERITIES.include?(cat) - end - end - - # Validate snmp trap format - VALID_TRAP_FORMATS = %w(SNMPv1 SNMPv2 SNMPv3).freeze - def validate_trap_format(trap_format) - fail "Trap Format #{trap_format} is not one of the allowed values: #{VALID_TRAP_FORMATS}" unless VALID_TRAP_FORMATS.include?(trap_format) - end - - # @!endgroup - - # Create an Interconnect in the desired Bay in a specified enclosure + # Creates an Interconnect in the desired bay in a specified enclosure # WARN: It does not create the LOGICAL INTERCONNECT itself. # It will fail if no interconnect is already present on the specified position # @param [Fixnum] bay_number Number of the bay to put the interconnect @@ -69,9 +33,10 @@ def create(bay_number, enclosure) end # Deletes an INTERCONNECT - # WARN: This won't delete the LOGICAL INTERCONNECT itself, and may cause inconsistency between the enclosure and LIG - # @param [Fixnum] bay_number Number of the bay to locate the logical interconnect - # @param [OneviewSDK::Resource] enclosure Enclosure to remove the logical interconnect + # WARN: This will not delete the LOGICAL INTERCONNECT itself, and may cause inconsistency between the enclosure and LIG + # @param [Fixnum] bay_number The bay number to locate the logical interconnect + # @param [OneviewSDK::Enclosure] enclosure Enclosure to remove the logical interconnect + # @return [OneviewSDK::LogicalInterconnect] self def delete(bay_number, enclosure) enclosure.ensure_uri delete_uri = self.class::LOCATION_URI + "?location=Enclosure:#{enclosure['uri']},Bay:#{bay_number}" @@ -114,12 +79,12 @@ def list_vlan_networks internal_networks end - # Updates ethernet settings of the Logical Interconnect + # Updates ethernet settings of the logical interconnect # @note The attribute is defined inside the instance of the Logical Interconnect # @return Updated instance of the Logical Interconnect def update_ethernet_settings ensure_client && ensure_uri - fail 'Please retrieve the Logical Interconnect before trying to update' unless @data['ethernetSettings'] + fail IncompleteResource, 'Please retrieve the Logical Interconnect before trying to update' unless @data['ethernetSettings'] update_options = { 'If-Match' => @data['ethernetSettings'].delete('eTag'), 'body' => @data['ethernetSettings'] @@ -129,7 +94,7 @@ def update_ethernet_settings set_all(body) end - # Updates settings of the Logical Interconnect + # Updates settings of the logical interconnect # @param options Options to update the Logical Interconnect # @return Updated instance of the Logical Interconnect def update_settings(options = {}) @@ -169,7 +134,7 @@ def configuration # @note The attribute is defined inside the instance of the Logical Interconnect # @return Updated instance of the Logical Interconnect def update_port_monitor - fail 'Please retrieve the Logical Interconnect before trying to update' unless @data['portMonitor'] + fail IncompleteResource, 'Please retrieve the Logical Interconnect before trying to update' unless @data['portMonitor'] update_options = { 'If-Match' => @data['portMonitor'].delete('eTag'), 'body' => @data['portMonitor'] @@ -183,7 +148,7 @@ def update_port_monitor # @note The attribute is defined inside the instance of the Logical Interconnect # @return Updated instance of the Logical Interconnect def update_qos_configuration - fail 'Please retrieve the Logical Interconnect before trying to update' unless @data['qosConfiguration'] + fail IncompleteResource, 'Please retrieve the Logical Interconnect before trying to update' unless @data['qosConfiguration'] update_options = { 'If-Match' => @data['qosConfiguration'].delete('eTag'), 'body' => @data['qosConfiguration'] @@ -197,7 +162,7 @@ def update_qos_configuration # @note The attribute is defined inside the instance of the Logical Interconnect # @return Updated instance of the Logical Interconnect def update_telemetry_configuration - fail 'Please retrieve the Logical Interconnect before trying to update' unless @data['telemetryConfiguration'] + fail IncompleteResource, 'Please retrieve the Logical Interconnect before trying to update' unless @data['telemetryConfiguration'] update_options = { 'If-Match' => @data['telemetryConfiguration'].delete('eTag'), 'body' => @data['telemetryConfiguration'] @@ -212,7 +177,7 @@ def update_telemetry_configuration # Use helper methods to add the trap destination values: #add_snmp_trap_destination and #generate_trap_options # @return Updated instance of the Logical Interconnect def update_snmp_configuration - fail 'Please retrieve the Logical Interconnect before trying to update' unless @data['snmpConfiguration'] + fail IncompleteResource, 'Please retrieve the Logical Interconnect before trying to update' unless @data['snmpConfiguration'] update_options = { 'If-Match' => @data['snmpConfiguration'].delete('eTag'), 'body' => @data['snmpConfiguration'] @@ -225,10 +190,9 @@ def update_snmp_configuration # It will add one trap destination to the Logical Interconnect SNMP configuration # @param trap_format [String] SNMP version for this trap destination, `'SNMPv1'` or `'SNMPv2'` or `'SNMPv3'` # @param trap_destination [String] The trap destination IP address or host name - # @param community_string [String] Authentication string for the trap destination + # @param community_string [String] The Authentication string for the trap destination # @param trap_options [Hash] Hash with the options of the trap. Create it using generate_trap_options method def add_snmp_trap_destination(trap_destination, trap_format = 'SNMPv1', community_string = 'public', trap_options = {}) - validate_trap_format(trap_format) trap_options['communityString'] = community_string trap_options['trapDestination'] = trap_destination trap_options['trapFormat'] = trap_format @@ -245,10 +209,6 @@ def add_snmp_trap_destination(trap_destination, trap_format = 'SNMPv1', communit # can contain, `'Critical'` or `'Info'` or `'Major'` or `'Minor'` or `'Normal'` or `'Unknown'` or `'Warning'` # @return [Hash] Contains all trap options for one SNMP destination def generate_trap_options(enet_trap_categories = [], fc_trap_categories = [], vcm_trap_categories = [], trap_severities = []) - validate_enet_trap_categories(enet_trap_categories) - validate_fc_trap_categories(fc_trap_categories) - validate_vcm_trap_categories(vcm_trap_categories) - validate_trap_severities(trap_severities) options = { 'enetTrapCategories' => enet_trap_categories, 'vcmTrapCategories' => vcm_trap_categories, @@ -266,6 +226,11 @@ def get_firmware @client.response_handler(response) end + # Update firmware + # @param [String] command + # @param [OneviewSDK::FirmwareDriver] firmware_driver + # @param [Hash] firmware_options + # @raise [OneviewSDK::IncompleteResource] if the client or uri is not set def firmware_update(command, firmware_driver, firmware_options) ensure_client && ensure_uri firmware_options['command'] = command @@ -278,6 +243,5 @@ def firmware_update(command, firmware_driver, firmware_options) response = @client.rest_put(@data['uri'] + '/firmware', update_json) @client.response_handler(response) end - end end diff --git a/lib/oneview-sdk/resource/logical_interconnect_group.rb b/lib/oneview-sdk/resource/logical_interconnect_group.rb index e278a1e61..c3a03b3dd 100644 --- a/lib/oneview-sdk/resource/logical_interconnect_group.rb +++ b/lib/oneview-sdk/resource/logical_interconnect_group.rb @@ -1,9 +1,25 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK - # Logical enclosure group resource implementation + # Logical interconnect group resource implementation class LogicalInterconnectGroup < Resource BASE_URI = '/rest/logical-interconnect-groups'.freeze + attr_reader :bay_count + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values: @@ -21,9 +37,10 @@ def initialize(client, params = {}, api_ver = nil) parse_interconnect_map_template if @data['interconnectMapTemplate']['interconnectMapEntryTemplates'] == [] end - # Add an interconnect + # Adds an interconnect # @param [Fixnum] bay Bay number # @param [String] type Interconnect type + # @raise [StandardError] if a invalid type is given then raises an error def add_interconnect(bay, type) @data['interconnectMapTemplate']['interconnectMapEntryTemplates'].each do |entry| entry['logicalLocation']['locationEntries'].each do |location| @@ -37,20 +54,22 @@ def add_interconnect(bay, type) raise "Interconnect type #{type} not found! Supported types: #{list}" end - # Add an uplink set + # Adds an uplink set # @param [OneviewSDK::LIGUplinkSet] uplink_set def add_uplink_set(uplink_set) @data['uplinkSets'] << uplink_set.data end - # Get the default settings + # Get the logical interconnect group default settings + # @return [Hash] The logical interconnect group settings def get_default_settings get_uri = self.class::BASE_URI + '/defaultSettings' response = @client.rest_get(get_uri, @api_version) @client.response_handler(response) end - # Get settings + # Gets the logical interconnect group settings + # @return [Hash] The logical interconnect group settings def get_settings get_uri = @data['uri'] + '/settings' response = @client.rest_get(get_uri, @api_version) @@ -58,6 +77,7 @@ def get_settings end # Saves the current data attributes to the Logical Interconnect Group + # @param [Hash] attributes attributes to be updated # @return Updated instance of the Logical Interconnect Group def update(attributes = {}) set_all(attributes) @@ -72,6 +92,7 @@ def update(attributes = {}) private + # Parse interconnect map template structure def parse_interconnect_map_template 1.upto(@bay_count) do |bay_number| entry = { @@ -87,6 +108,5 @@ def parse_interconnect_map_template @data['interconnectMapTemplate']['interconnectMapEntryTemplates'] << entry end end - end end diff --git a/lib/oneview-sdk/resource/logical_switch.rb b/lib/oneview-sdk/resource/logical_switch.rb new file mode 100644 index 000000000..e2ce69a0a --- /dev/null +++ b/lib/oneview-sdk/resource/logical_switch.rb @@ -0,0 +1,184 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +module OneviewSDK + # Logical switch resource implementation + class LogicalSwitch < Resource + BASE_URI = '/rest/logical-switches'.freeze + + attr_accessor :logical_switch_credentials + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. + def initialize(client, params = {}, api_ver = nil) + super + # Default values + @data['type'] ||= 'logical-switch' + @logical_switch_credentials = {} + end + + # Create method + # @raise [OneviewSDK::IncompleteResource] if the client is not set + # @raise [StandardError] if the resource creation fails + # @return [OneviewSDK::LogicalSwitch] self + def create + ensure_client + request_body = {} + request_body['logicalSwitchCredentials'] = generate_logical_switch_credentials + request_body['logicalSwitch'] = @data.clone + request_body['logicalSwitch']['switchCredentialConfiguration'] = generate_logical_switch_credential_configuration + response = @client.rest_post(self.class::BASE_URI, { 'body' => request_body }, @api_version) + body = @client.response_handler(response) + set_all(body) + self + end + + # Updates this object using the data that exists on OneView + # @note Will overwrite any data that differs from OneView + # @return [Resource] self + def refresh + response = @client.rest_put(@data['uri'] + '/refresh') + @client.response_handler(response) + end + + + # @!group Credentials + CredentialsSSH = Struct.new(:user, :password) + + CredentialsSNMPV1 = Struct.new(:port, :community_string, :version) do + # @return [String] Returns SNMPv1 + def version + 'SNMPv1' + end + end + + CredentialsSNMPV3 = Struct.new(:port, :user, :auth_protocol, :auth_password, :privacy_protocol, :privacy_password, :version) do + # @return [String] Returns SNMPv3 + def version + 'SNMPv3' + end + end + + # Sets switch credentials + # @param [String] host IP address or host name + # @param [CredentialsSSH] ssh_credentials SSH credentials + # @param [CredentialsSNMP] snmp_credentials SNMP credentials + # @return [Array] An Array containing the SSH and SNMP credentials + def set_switch_credentials(host, ssh_credentials, snmp_credentials) + fail TypeError, 'Use struct' if ssh_credentials.class != OneviewSDK::LogicalSwitch::CredentialsSSH + fail TypeError, 'Use struct' unless snmp_credentials.respond_to?('version') + fail TypeError, 'Use struct' if snmp_credentials.version != 'SNMPv1' && + snmp_credentials.version != 'SNMPv3' + @logical_switch_credentials[host] = [ssh_credentials.clone, snmp_credentials.clone] + @logical_switch_credentials[host] + end + + # @!endgroup + + + # Sets the logical switch group + # @param [OneviewSDK::logicalSwitchGroup] logical_switch_group Logical switch group + def set_logical_switch_group(logical_switch_group) + @data['logicalSwitchGroupUri'] = logical_switch_group['uri'] + end + + private + + # Generates the logical switch credentials for POST and PUT requests + # @return [Array] List of connection properties for each logical switch + def generate_logical_switch_credentials + credentials = [] + @logical_switch_credentials.each do |_, switch| + switch_credentials = [] + switch_credentials << { + 'valueFormat' => 'Unknown', + 'propertyName' => 'SshBasicAuthCredentialUser', + 'valueType' => 'String', + 'value' => switch[0].user + } + + switch_credentials << { + 'valueFormat' => 'SecuritySensitive', + 'propertyName' => 'SshBasicAuthCredentialPassword', + 'valueType' => 'String', + 'value' => switch[0].password + } + + if switch[1].version == 'SNMPv3' + switch_credentials << { + 'valueFormat' => 'SecuritySensitive', + 'propertyName' => 'SnmpV3AuthorizationPassword', + 'valueType' => 'String', + 'value' => switch[1].auth_password + } + + switch_credentials << { + 'valueFormat' => 'Unknown', + 'propertyName' => 'SnmpV3User', + 'valueType' => 'String', + 'value' => switch[1].user + } + + if switch[1].privacy_password + switch_credentials << { + 'valueFormat' => 'SecuritySensitive', + 'propertyName' => 'SnmpV3PrivacyPassword', + 'valueType' => 'String', + 'value' => switch[1].privacy_password + } + end + end + + credentials << { 'connectionProperties' => switch_credentials } + end + credentials + end + + # Generates the logical switch credential configuration for POST and PUT requests + # @return [Array] List of logical switch credential configuration for each switch + def generate_logical_switch_credential_configuration + configuration = [] + @logical_switch_credentials.each do |host, switch| + switch_configuration = { + 'snmpPort' => switch[1].port, + 'snmpV3Configuration' => nil, + 'snmpV1Configuration' => nil, + 'logicalSwitchManagementHost' => host, + 'snmpVersion' => switch[1].version + } + + if switch[1].version == 'SNMPv3' + switch_configuration['snmpV1Configuration'] = nil + switch_configuration['snmpV3Configuration'] = { + 'authorizationProtocol' => switch[1].auth_protocol + } + + if switch[1].privacy_protocol + switch_configuration['snmpV3Configuration']['securityLevel'] = 'AuthPrivacy' + switch_configuration['snmpV3Configuration']['privacyProtocol'] = switch[1].privacy_protocol + else + switch_configuration['snmpV3Configuration']['securityLevel'] = 'Auth' + end + + elsif switch[1].version == 'SNMPv1' + switch_configuration['snmpV3Configuration'] = nil + switch_configuration['snmpV1Configuration'] = { + 'communityString' => switch[1].community_string + } + end + configuration << switch_configuration + end + configuration + end + end +end diff --git a/lib/oneview-sdk/resource/logical_switch_group.rb b/lib/oneview-sdk/resource/logical_switch_group.rb new file mode 100644 index 000000000..eb1bdd95c --- /dev/null +++ b/lib/oneview-sdk/resource/logical_switch_group.rb @@ -0,0 +1,66 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +module OneviewSDK + # Logical switch group resource implementation + class LogicalSwitchGroup < Resource + BASE_URI = '/rest/logical-switch-groups'.freeze + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. + def initialize(client, params = {}, api_ver = nil) + super + # Default values: + @data['category'] ||= 'logical-switch-groups' + @data['state'] ||= 'Active' + @data['type'] ||= 'logical-switch-group' + @data['switchMapTemplate'] ||= {} + end + + # Define how the switches will be grouped, setting the number and the type of the switches + # @param [Fixnum] number_of_switches The number of the switch inside the group [1,2] + # @param [String] type Switch type name + # @raise [StandardError] + def set_grouping_parameters(number_of_switches, type) + @data['switchMapTemplate']['switchMapEntryTemplates'] = [] + parse_switch_map_template(number_of_switches) + switch_type_uri = OneviewSDK::Switch.get_type(@client, type)['uri'] + @data['switchMapTemplate']['switchMapEntryTemplates'].each do |entry| + entry['logicalLocation']['locationEntries'].each do |location| + entry['permittedSwitchTypeUri'] = switch_type_uri if location['type'] == 'StackingMemberId' + end + end + rescue StandardError + list = OneviewSDK::Switch.get_types(@client).map { |t| t['name'] } + raise "Switch type #{type} not found! Supported types: #{list}" + end + + private + + # Parse switch map template structure + # @param [Integer] number_of_switches number of switches + def parse_switch_map_template(number_of_switches) + 1.upto(number_of_switches) do |stacking_member_id| + entry = { + 'logicalLocation' => { + 'locationEntries' => [ + { 'relativeValue' => stacking_member_id, 'type' => 'StackingMemberId' } + ] + }, + 'permittedSwitchTypeUri' => nil + } + @data['switchMapTemplate']['switchMapEntryTemplates'] << entry + end + end + end +end diff --git a/lib/oneview-sdk/resource/managed_san.rb b/lib/oneview-sdk/resource/managed_san.rb new file mode 100644 index 000000000..0c2c7d901 --- /dev/null +++ b/lib/oneview-sdk/resource/managed_san.rb @@ -0,0 +1,79 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +module OneviewSDK + # Power device resource implementation + class ManagedSAN < Resource + BASE_URI = '/rest/fc-sans/managed-sans'.freeze + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def update + unavailable_method + end + + # Retrieves a list of endpoints + # @return [Array] List of endpoints + def get_endpoints + response = @client.rest_get(@data['uri'] + '/endpoints') + @client.response_handler(response)['members'] + end + + # Set refresh state for managed SAN + # @param [String] state Desired refresh state + def set_refresh_state(state) + response = @client.rest_put(@data['uri'], 'body' => { refreshState: state }) + @client.response_handler(response) + end + + # Set public attributes + # @param [Hash] attributes Public attributes + # @option attributes [String] :name + # @option attributes [String] :value + # @option attributes [String] :valueType + # @option attributes [String] :valueFormat + def set_public_attributes(attributes) + response = @client.rest_put(@data['uri'], 'body' => { publicAttributes: attributes }) + @client.response_handler(response) + end + + # Set public attributes + # @param [Hash] policy SAN policy + # @option attributes [String] :zoningPolicy + # @option attributes [String] :zoneNameFormat + # @option attributes [String] :enableAliasing + # @option attributes [String] :initiatorNameFormat + # @option attributes [String] :targetNameFormat + # @option attributes [String] :targetGroupNameFormat + def set_san_policy(policy) + response = @client.rest_put(@data['uri'], 'body' => { sanPolicy: policy }) + @client.response_handler(response) + end + + # Creates unexpected zoning report for a SAN + def get_zoning_report + response = @client.rest_post(@data['uri'] + '/issues', 'body' => {}) + @client.response_handler(response) + end + end +end diff --git a/lib/oneview-sdk/resource/network_set.rb b/lib/oneview-sdk/resource/network_set.rb new file mode 100644 index 000000000..f7209146e --- /dev/null +++ b/lib/oneview-sdk/resource/network_set.rb @@ -0,0 +1,64 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +module OneviewSDK + # Network set resource implementation + class NetworkSet < Resource + BASE_URI = '/rest/network-sets'.freeze + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. + def initialize(client, params = {}, api_ver = nil) + super + # Default values: + @data['connectionTemplateUri'] ||= nil + @data['nativeNetworkUri'] ||= nil + @data['networkUris'] ||= [] + @data['type'] ||= 'network-set' + end + + # Sets the native network for the network set + # @param [OneviewSDK::EthernetNetwork] ethernet_network Ethernet Network + def set_native_network(ethernet_network) + @data['nativeNetworkUri'] = ethernet_network['uri'] + @data['networkUris'] << ethernet_network['uri'] unless @data['networkUris'].include?(ethernet_network['uri']) + end + + # Adds an ethernet network to the network set + # @param [OneviewSDK::EthernetNetwork] ethernet_network Ethernet Network + def add_ethernet_network(ethernet_network) + @data['networkUris'] << ethernet_network['uri'] unless @data['networkUris'].include?(ethernet_network['uri']) + end + + # Removes an ethernet network from the network set + # @param [OneviewSDK::EthernetNetwork] ethernet_network Ethernet Network + def remove_ethernet_network(ethernet_network) + @data['networkUris'].delete(ethernet_network['uri']) if @data['networkUris'].include?(ethernet_network['uri']) + end + + # Lists network sets excluding ethernet networks + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @return [Array] List of network sets + def self.get_without_ethernet(client) + response = client.rest_get(BASE_URI + '/withoutEthernet') + client.response_handler(response) + end + + # Lists network set excluding ethernet networks + # @return [OneviewSDK::NetworkSet] Network set + def get_without_ethernet + response = @client.rest_get(@data['uri'] + '/withoutEthernet') + @client.response_handler(response) + end + end +end diff --git a/lib/oneview-sdk/resource/power_device.rb b/lib/oneview-sdk/resource/power_device.rb new file mode 100644 index 000000000..ba8b6be16 --- /dev/null +++ b/lib/oneview-sdk/resource/power_device.rb @@ -0,0 +1,174 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +module OneviewSDK + # Power device resource implementation + class PowerDevice < Resource + BASE_URI = '/rest/power-devices'.freeze + + # Add the resource on OneView using the current data + # @note Calls the refresh method to set additional data + # @raise [OneviewSDK::IncompleteResource] if the client is not set + # @raise [StandardError] if the resource creation fails + # @return [OneviewSDK::PowerDevice] self + alias add create + + # Remove resource from OneView + # @return [true] if resource was removed successfully + alias remove delete + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. + def initialize(client, params = {}, api_ver = nil) + super + # Default values + @data['deviceType'] ||= 'BranchCircuit' + @data['phaseType'] ||= 'Unknown' + @data['powerConnections'] ||= [] + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Adds an iPDU and bring all components under management by discovery of its management modules + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] options options for the iPDU + # @return [OneviewSDK::PowerDevice] The iPDU power device created in OneView + def self.discover(client, options) + options['force'] ||= options[:force] || false + response = client.rest_post(BASE_URI + '/discover', 'body' => options) + power_device_info = client.response_handler(response) + new(client, power_device_info) + end + + # Retrieves the list of power devices given an iPDU hostname + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [String] hostname The iPDU hostname + # @return [Array] array of OneviewSDK::PowerDevice + def self.get_ipdu_devices(client, hostname) + find_by(client, managedBy: { hostName: hostname }) + end + + # Gets the power state of a power device + # @return [String] Power state + def get_power_state + response = @client.rest_get(@data['uri'] + '/powerState') + response.body + end + + # Adds a power connection + # @param [OneviewSDK::Resource] resource + # @param [Integer] connection connection number + def add_connection(resource, connection) + @data['powerConnections'] << { + 'connectionUri' => resource['uri'], + 'deviceConnection' => connection, + 'sourceConnection' => connection + } + end + + # Removes the power connection + # @param [OneviewSDK::Resource] resource + # @param [Integer] connection connection number + def remove_connection(resource, connection) + @data['powerConnections'].reject! do |conn| + conn['connectionUri'] == resource['uri'] && conn['deviceConnection'] == connection + end + end + + # Sets the power state of the power delivery device + # @param [String] state On|Off + def set_power_state(state) + response = @client.rest_put(@data['uri'] + '/powerState', 'body' => { powerState: state }) + @client.response_handler(response) + end + + # Refreshes a power delivery device + # @param [Hash] options + # @option options [String] :refreshState + # @option options [String] :username + # @option options [String] :password + def set_refresh_state(options) + response = @client.rest_put(@data['uri'] + '/refreshState', 'body' => options) + @client.response_handler(response) + end + + # Retrieves the unit identification state of the specified power outlet + # @return [String] Uid state + def get_uid_state + response = @client.rest_get(@data['uri'] + '/uidState') + response.body + end + + # Sets the unit identification light state of the power delivery device + # @param [String] state On|Off + def set_uid_state(state) + response = @client.rest_put(@data['uri'] + '/uidState', 'body' => { uidState: state }) + @client.response_handler(response) + end + + # Retrieves historical utilization + # @param [Hash] queryParameters query parameters (ie :startDate, :endDate, :fields, :view, etc.) + # @option queryParameters [Array] :fields + # @option queryParameters [Time, Date, String] :startDate + # @option queryParameters [Time, Date, String] :endDate + # @return [Hash] Utilization data + def utilization(queryParameters = {}) + ensure_client && ensure_uri + uri = "#{@data['uri']}/utilization?" + + queryParameters[:endDate] = convert_time(queryParameters[:endDate]) + queryParameters[:startDate] = convert_time(queryParameters[:startDate]) + + queryParameters.each do |key, value| + next if value.nil? + uri += case key.to_sym + when :fields + "fields=#{value.join(',')}" + when :startDate, :endDate + "filter=#{key}=#{value}" + else + "#{key}=#{value}" + end + uri += '&' + end + uri.chop! # Get rid of trailing '&' or '?' + response = @client.rest_get(uri, @api_version) + @client.response_handler(response) + end + + private + + # Converts Date, Time, or String objects to iso8601 string + def convert_time(t) + case t + when nil then nil + when Date then t.to_time.utc.iso8601(3) + when Time then t.utc.iso8601(3) + when String then Time.parse(t).utc.iso8601(3) + else fail "Invalid time format '#{t.class}'. Valid options are Time, Date, or String" + end + rescue StandardError => e + raise "Failed to parse time value '#{t}'. #{e.message}" + end + end +end diff --git a/lib/oneview-sdk/resource/rack.rb b/lib/oneview-sdk/resource/rack.rb new file mode 100644 index 000000000..d75c3cc6f --- /dev/null +++ b/lib/oneview-sdk/resource/rack.rb @@ -0,0 +1,83 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +module OneviewSDK + # Rack resource implementation + class Rack < Resource + BASE_URI = '/rest/racks'.freeze + + # Add the resource on OneView using the current data + # @note Calls the refresh method to set additional data + # @raise [OneviewSDK::IncompleteResource] if the client is not set + # @raise [StandardError] if the resource creation fails + # @return [OneviewSDK::Rack] self + alias add create + + # Remove resource from OneView + # @return [true] if resource was removed successfully + alias remove delete + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. + def initialize(client, params = {}, api_ver = nil) + super + # Default values: + @data['rackMounts'] ||= [] + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Adds the rack resource with specified options + # @param [OneviewSDK::Resource] resource Resource to be added + # @param [String] options rack options + def add_rack_resource(resource, options = {}) + rack_resource_options = {} + # Write values to hash and transform any symbol to string + options.each { |key, val| rack_resource_options[key.to_s] = val } + + # Verify if the rack resource exists in the rack, if not init add it + rack_resource = @data['rackMounts'].find { |resource_from_rack| resource_from_rack['mountUri'] == resource['uri'] } + if rack_resource + rack_resource_options.each { |key, val| rack_resource[key] = val } + else + # Set default values if not given + rack_resource_options['mountUri'] = resource['uri'] + rack_resource_options['location'] = 'CenterFront' unless rack_resource_options['location'] + @data['rackMounts'] << rack_resource_options + end + end + + # Remove resources from the rack + # @param [OneviewSDK::Resource] resource Resource to be removed from rack + def remove_rack_resource(resource) + @data['rackMounts'].reject! { |rack_resource| rack_resource['mountUri'] == resource['uri'] } + end + + # Gets topology information for the rack + # @return [Hash] Environmental analysis + def get_device_topology + response = @client.rest_get(@data['uri'] + '/deviceTopology') + @client.response_handler(response) + end + end +end diff --git a/lib/oneview-sdk/resource/san_manager.rb b/lib/oneview-sdk/resource/san_manager.rb new file mode 100644 index 000000000..22bfabe63 --- /dev/null +++ b/lib/oneview-sdk/resource/san_manager.rb @@ -0,0 +1,88 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +module OneviewSDK + # SAN manager resource implementation + class SANManager < Resource + BASE_URI = '/rest/fc-sans/device-managers'.freeze + PROVIDERS_URI = '/rest/fc-sans/providers'.freeze + + # Remove resource from OneView + # @return [true] if resource was removed successfully + alias remove delete + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. + def initialize(client, params = {}, api_ver = nil) + super + # Default values: + @data['type'] = 'FCDeviceManagerV2' + end + + # Adds the resource on OneView using the current data + # @return [OneviewSDK::SANManager] self + def add + ensure_client + fail 'providerDisplayName' unless @data['providerDisplayName'] + @data['providerUri'] = get_provider_uri + response = @client.rest_post(@data['providerUri'] + '/device-managers', { 'body' => @data }, @api_version) + body = @client.response_handler(response) + set_all(body) + self + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Refreshes the san manager state or change connection information + # @param [Hash] options + def update(options) + ensure_client && ensure_uri + response = @client.rest_put(@data['uri'], 'body' => options) + new_data = @client.response_handler(response) + set_all(new_data) + end + + # Retrieves the default connection information for a specific provider + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [String] provider_name Providers name + # @return [Hash] A hash with default connectionInfo information + def self.get_default_connection_info(client, provider_name) + response = client.rest_get(PROVIDERS_URI) + providers = client.response_handler(response)['members'] + desired_provider = providers.find { |provider| provider['displayName'] == provider_name || provider['name'] == provider_name } + desired_provider['defaultConnectionInfo'] + end + + private + + # Gets the provider uri + # @return [String] provider uri + def get_provider_uri + return @data['providerUri'] if @data['providerUri'] + response = @client.rest_get(PROVIDERS_URI) + providers = @client.response_handler(response)['members'] + desired_provider = providers.find { |provider| provider['displayName'] == @data['providerDisplayName'] } + desired_provider['uri'] + end + end +end diff --git a/lib/oneview-sdk/resource/server_hardware.rb b/lib/oneview-sdk/resource/server_hardware.rb index 99d03eb13..8ed8ab399 100644 --- a/lib/oneview-sdk/resource/server_hardware.rb +++ b/lib/oneview-sdk/resource/server_hardware.rb @@ -1,32 +1,52 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Server hardware resource implementation class ServerHardware < Resource BASE_URI = '/rest/server-hardware'.freeze + # Remove resource from OneView + # @return [true] if resource was removed successfully + alias remove delete + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values @data['type'] ||= 'server-hardware-4' end - # @!group Validates - - VALID_LICENSING_INTENTS = ['OneView', 'OneViewNoiLO', 'OneViewStandard', nil].freeze - def validate_licensingIntent(value) - fail 'Invalid licensingIntent' unless VALID_LICENSING_INTENTS.include?(value) + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method end - VALID_CONFIGURATION_STATES = ['Managed', 'Monitored', nil].freeze - def validate_configurationState(value) - fail 'Invalid configurationState' unless VALID_CONFIGURATION_STATES.include?(value) + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method end - # @!endgroup - - def create + # Adds the resource on OneView using the current data + # @raise [OneviewSDK::IncompleteResource] if the client is not set or required attributes are missing + # @return [OneviewSDK::ServerHardware] self + def add ensure_client required_attributes = %w(hostname username password licensingIntent) - required_attributes.each { |k| fail "Missing required attribute: '#{k}'" unless @data.key?(k) } + required_attributes.each { |k| fail IncompleteResource, "Missing required attribute: '#{k}'" unless @data.key?(k) } optional_attrs = %w(configurationState force restore) temp_data = @data.select { |k, _v| required_attributes.include?(k) || optional_attrs.include?(k) } @@ -37,26 +57,128 @@ def create self end + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available def update(*) - fail 'Method not available for this resource!' + unavailable_method end # Power on the server hardware - # @param [String] force Use 'PressAndHold' action - # @return [Boolean] Whether or not server was powered on + # @param [Boolean] force Use 'PressAndHold' action? + # @return [Boolean] Returns whether or not the server was powered on def power_on(force = false) set_power_state('on', force) end # Power off the server hardware - # @param [String] force Use 'PressAndHold' action - # @return [Boolean] Whether or not server was powered off + # @param [Boolean] force Use 'PressAndHold' action? + # @return [Boolean] Returns whether or not the server was powered off def power_off(force = false) set_power_state('off', force) end + # Gets a list of BIOS/UEFI values on the physical server + # @return [Hash] List with BIOS/UEFI settings + def get_bios + response = @client.rest_get(@data['uri'] + '/bios') + @client.response_handler(response) + end + + # Gets a url to the iLO web interface + # @return [Hash] url + def get_ilo_sso_url + response = @client.rest_get(@data['uri'] + '/iloSsoUrl') + @client.response_handler(response) + end + + # Gets a Single Sign-On session for the Java Applet console + # @return [Hash] url + def get_java_remote_sso_url + response = @client.rest_get(@data['uri'] + '/javaRemoteConsoleUrl') + @client.response_handler(response) + end + + # Gets a url to the iLO web interface + # @return [Hash] url + def get_remote_console_url + response = @client.rest_get(@data['uri'] + '/remoteConsoleUrl') + @client.response_handler(response) + end + + # Refreshes the enclosure along with all of its components + # @param [String] state NotRefreshing, RefreshFailed, RefreshPending, Refreshing + # @param [Hash] options Optional force fields for refreshing the enclosure + def set_refresh_state(state, options = {}) + ensure_client && ensure_uri + s = state.to_s rescue state + requestBody = { + 'body' => { + refreshState: s + } + } + requestBody['body'].merge(options) + response = @client.rest_put(@data['uri'] + '/refreshState', requestBody, @api_version) + new_data = @client.response_handler(response) + set_all(new_data) + end + + # Updates the iLO firmware on a physical server to a minimum iLO firmware required by OneView + def update_ilo_firmware + response = @client.rest_put(@data['uri'] + '/mpFirmwareVersion') + @client.response_handler(response) + end + + # Gets the settings that describe the environmental configuration + def environmental_configuration + ensure_client && ensure_uri + response = @client.rest_get(@data['uri'] + '/environmentalConfiguration', @api_version) + @client.response_handler(response) + end + + # Retrieves historical utilization + # @param [Hash] queryParameters query parameters (ie :startDate, :endDate, :fields, :view, etc.) + # @option queryParameters [Array] :fields + # @option queryParameters [Time, Date, String] :startDate + # @option queryParameters [Time, Date, String] :endDate + def utilization(queryParameters = {}) + ensure_client && ensure_uri + uri = "#{@data['uri']}/utilization?" + + queryParameters[:endDate] = convert_time(queryParameters[:endDate]) + queryParameters[:startDate] = convert_time(queryParameters[:startDate]) + + queryParameters.each do |key, value| + next if value.nil? + uri += case key.to_sym + when :fields + "fields=#{value.join(',')}" + when :startDate, :endDate + "filter=#{key}=#{value}" + else + "#{key}=#{value}" + end + uri += '&' + end + uri.chop! # Get rid of trailing '&' or '?' + response = @client.rest_get(uri, @api_version) + @client.response_handler(response) + end + private + # Converts Date, Time, or String objects to iso8601 string + def convert_time(t) + case t + when nil then nil + when Date then t.to_time.utc.iso8601(3) + when Time then t.utc.iso8601(3) + when String then Time.parse(t).utc.iso8601(3) + else fail InvalidResource, "Invalid time format '#{t.class}'. Valid options are Time, Date, or String" + end + rescue StandardError => e + raise InvalidResource, "Failed to parse time value '#{t}'. #{e.message}" + end + # Set power state. Takes into consideration the current state and does the right thing def set_power_state(state, force) refresh @@ -83,6 +205,5 @@ def set_power_state(state, force) set_all(body) true end - end end diff --git a/lib/oneview-sdk/resource/server_hardware_type.rb b/lib/oneview-sdk/resource/server_hardware_type.rb index 02596d965..b9a8074dd 100644 --- a/lib/oneview-sdk/resource/server_hardware_type.rb +++ b/lib/oneview-sdk/resource/server_hardware_type.rb @@ -1,18 +1,50 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Server hardware type resource implementation class ServerHardwareType < Resource BASE_URI = '/rest/server-hardware-types'.freeze + # Remove resource from OneView + # @return [true] if resource was removed successfully + alias remove delete + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values @data['type'] ||= 'server-hardware-type-4' end + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available def create unavailable_method end + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Update resource attributes + # @param [Hash] attributes attributes to be updated + # @option attributes [String] :name server hardware type name + # @option attributes [String] :description server hardware type description + # @return [OneviewSDK::ServerHardwareType] self def update(attributes = {}) set_all(attributes) ensure_client && ensure_uri @@ -22,6 +54,5 @@ def update(attributes = {}) @client.response_handler(response) self end - end end diff --git a/lib/oneview-sdk/resource/server_profile.rb b/lib/oneview-sdk/resource/server_profile.rb index 505ca319f..8ab49edcf 100644 --- a/lib/oneview-sdk/resource/server_profile.rb +++ b/lib/oneview-sdk/resource/server_profile.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Server profile resource implementation class ServerProfile < Resource @@ -9,13 +20,107 @@ def initialize(client, params = {}, api_ver = nil) @data['type'] ||= 'ServerProfileV5' end - # Get available server hardware for this template + # Sets the Server Hardware for the resource + # @param [OneviewSDK::ServerHardware] server_hardware Server Hardware resource + def set_server_hardware(server_hardware) + self['serverHardwareUri'] = server_hardware['uri'] if server_hardware['uri'] || server_hardware.retrieve! + fail "Resource #{server_hardware['name']} could not be found!" unless server_hardware['uri'] + end + + # Sets the Server Hardware Type for the resource + # @param [OneviewSDK::ServerHardwareType] server_hardware_type Type of the desired Server Hardware + def set_server_hardware_type(server_hardware_type) + self['serverHardwareTypeUri'] = server_hardware_type['uri'] if server_hardware_type['uri'] || server_hardware_type.retrieve! + fail "Resource #{server_hardware_type['name']} could not be found!" unless server_hardware_type['uri'] + end + + # Sets the Enclosure Group for the resource + # @param [OneviewSDK::EnclosureGroup] enclosure_group Enclosure Group that the Server is a member + def set_enclosure_group(enclosure_group) + self['enclosureGroupUri'] = enclosure_group['uri'] if enclosure_group['uri'] || enclosure_group.retrieve! + fail "Resource #{enclosure_group['name']} could not be found!" unless enclosure_group['uri'] + end + + # Sets the Enclosure Group for the resource + # @param [OneviewSDK::Enclosure] enclosure Enclosure that the Server is a member + def set_enclosure(enclosure) + self['enclosureUri'] = enclosure['uri'] if enclosure['uri'] || enclosure.retrieve! + fail "Resource #{enclosure['name']} could not be found!" unless enclosure['uri'] + end + + # Gets the preview of manual and automatic updates required to make the server profile consistent with its template. + # @return [Hash] Hash containing the required information + def get_compliance_preview + ensure_client & ensure_uri + response = @client.rest_get("#{self['uri']}/compliance-preview") + @client.response_handler(response) + end + + # Retrieves the error or status messages associated with the specified profile. + # @return [Hash] Hash containing the required information + def get_messages + ensure_client & ensure_uri + response = @client.rest_get("#{self['uri']}/messages") + @client.response_handler(response) + end + + # Transforms an existing profile by supplying a new server hardware type and/or enclosure group. + # A profile will be returned with a new configuration based on the capabilities of the supplied + # server hardware type and/or enclosure group. All deployed connections will have their port assignment + # set to 'Auto'. Re-selection of the server hardware may also be required. The new profile can subsequently + # be used for the PUT https://{appl}/rest/server- profiles/{id} API but is not guaranteed to pass + # validation. Any incompatibilities will be flagged when the transformed server profile is submitted. + # @param [Hash] query Query parameters + # @option query [OneviewSDK::EnclosureGroup] 'enclosure_group' Enclosure Group associated with the resource + # @option query [OneviewSDK::ServerHardware] 'server_hardware' The server hardware associated with the resource + # @option query [OneviewSDK::ServerHardwareType] 'server_hardware_type' The server hardware type associated with the resource + # @return [Hash] Hash containing the required information + def get_transformation(query = nil) + ensure_client & ensure_uri + query_uri = OneviewSDK::Resource.build_query(query) if query + response = @client.rest_get("#{self['uri']}/transformation#{query_uri}") + @client.response_handler(response) + end + + # Updates the server profile from the server profile template. + def update_from_template + ensure_client & ensure_uri + patch_operation = { 'op' => 'replace', 'path' => '/templateCompliance', 'value' => 'Compliant' } + patch_options = { + 'If-Match' => self['eTag'], + 'body' => [patch_operation] + } + response = @client.rest_patch(self['uri'], patch_options) + @client.response_handler(response) + end + + # @!group Helpers + + # Gets attached ServerHardware for the profile + # @return [OneviewSDK::ServerHardware] if hardware is attached + # @return [nil] if no hardware is attached + def get_server_hardware + return nil unless self['serverHardwareUri'] + sh = OneviewSDK::ServerHardware.new(@client, uri: self['serverHardwareUri']) + sh.retrieve! + sh + end + + # Gets all the available Ethernet and FC Networks, and Network Sets + # @return [Hash] + # A hash containing the lists of Ethernet Networks and FC Networks + def get_available_networks + query = { enclosure_group_uri: @data['enclosureGroupUri'], server_hardware_type_uri: @data['serverHardwareTypeUri'] } + self.class.get_available_networks(@client, query) + end + + # Gets available server hardware # @return [Array] Array of ServerHardware resources that matches this # profile's server hardware type and enclosure group and who's state is 'NoProfileApplied' - def available_hardware + def get_available_hardware ensure_client - fail 'Must set @data[\'serverHardwareTypeUri\']' unless @data['serverHardwareTypeUri'] - fail 'Must set @data[\'enclosureGroupUri\']' unless @data['enclosureGroupUri'] + fail IncompleteResource, 'Must set @data[\'serverHardwareTypeUri\']' unless @data['serverHardwareTypeUri'] + fail IncompleteResource, 'Must set @data[\'enclosureGroupUri\']' unless @data['enclosureGroupUri'] params = { state: 'NoProfileApplied', serverHardwareTypeUri: @data['serverHardwareTypeUri'], @@ -23,15 +128,253 @@ def available_hardware } OneviewSDK::ServerHardware.find_by(@client, params) rescue StandardError => e - raise "Failed to get available hardware. Message: #{e.message}" + raise IncompleteResource, "Failed to get available hardware. Message: #{e.message}" + end + + # Adds a connection entry to Server profile template + # @param [OneviewSDK::EthernetNetwork,OneviewSDK::FCNetwork] network Network associated with the connection + # @param [Hash] connection_options Hash containing the configuration of the connection + # @option connection_options [Integer] 'allocatedMbps' The transmit throughput (mbps) currently allocated to + # this connection. When Fibre Channel connections are set to Auto for requested bandwidth, the value can be set to -2000 + # to indicate that the actual value is unknown until OneView is able to negotiate the actual speed. + # @option connection_options [Integer] 'allocatedVFs' The number of virtual functions allocated to this connection. This value will be null. + # @option connection_options [Hash] 'boot' indicates that the server will attempt to boot from this connection. + # This object can only be specified if "boot.manageBoot" is set to 'true' + # @option connection_options [String] 'deploymentStatus' The deployment status of the connection. + # The value can be 'Undefined', 'Reserved', or 'Deployed'. + # @option connection_options [String] 'functionType' Type of function required for the connection. + # functionType cannot be modified after the connection is created. + # @option connection_options [String] 'mac' The MAC address that is currently programmed on the FlexNic. + # @option connection_options [String] 'macType' Specifies the type of MAC address to be programmed into the IO Devices. + # The value can be 'Virtual', 'Physical' or 'UserDefined'. + # @option connection_options [String] 'maximumMbps' Maximum transmit throughput (mbps) allowed on this connection. + # The value is limited by the maximum throughput of the network link and maximumBandwidth of the selected network (networkUri). + # For Fibre Channel connections, the value is limited to the same value as the allocatedMbps. + # @option connection_options [String] 'name' A string used to identify the respective connection. + # The connection name is case insensitive, limited to 63 characters and must be unique within the profile. + # @option connection_options [String] 'portId' Identifies the port (FlexNIC) used for this connection. + # @option connection_options [String] 'requestedMbps' The transmit throughput (mbps) that should be allocated to this connection. + # @option connection_options [String] 'requestedVFs' This value can be "Auto" or 0. + # @option connection_options [String] 'wwnn' The node WWN address that is currently programmed on the FlexNic. + # @option connection_options [String] 'wwpn' The port WWN address that is currently programmed on the FlexNic. + # @option connection_options [String] 'wwpnType' Specifies the type of WWN address to be porgrammed on the FlexNIC. + # The value can be 'Virtual', 'Physical' or 'UserDefined'. + def add_connection(network, connection_options = {}) + self['connections'] = [] unless self['connections'] + connection_options['id'] = 0 # Letting OneView treat the ID registering + connection_options['networkUri'] = network['uri'] if network['uri'] || network.retrieve! + self['connections'] << connection_options + end + + # Removes a connection entry in Server profile template + # @param [String] connection_name Name of the connection + # @return Returns the connection hash if found, otherwise returns nil + def remove_connection(connection_name) + desired_connection = nil + return desired_connection unless self['connections'] + self['connections'].each do |con| + desired_connection = self['connections'].delete(con) if con['name'] == connection_name + end + desired_connection + end + + # Adds volume attachment entry with associated Volume in Server profile + # @param [OneviewSDK::Volume] volume Volume Resource to add an attachment + # @param [Hash] attachment_options Options of the new attachment + # @option attachment_options [Fixnum] 'id' The ID of the attached storage volume. Do not use it if you want it to be created automatically. + # @option attachment_options [String] 'lun' The logical unit number. + # @option attachment_options [String] 'lunType' The logical unit number type: Auto or Manual. + # @option attachment_options [Boolean] 'permanent' Required. If true, indicates that the volume will persist when the profile is deleted. + # If false, then the volume will be deleted when the profile is deleted. + # @option attachment_options [Array] 'storagePaths' A list of host-to-target path associations. + # @return Returns the connection hash if found, otherwise returns nil + def add_volume_attachment(volume, attachment_options = {}) + self['sanStorage'] ||= {} + self['sanStorage']['volumeAttachments'] ||= [] + attachment_options['id'] ||= 0 + + volume.retrieve! unless volume['uri'] || volume['storagePoolUri'] || volume['storageSystemUri'] + attachment_options['volumeUri'] = volume['uri'] + attachment_options['volumeStoragePoolUri'] = volume['storagePoolUri'] + attachment_options['volumeStorageSystemUri'] = volume['storageSystemUri'] + + self['sanStorage']['volumeAttachments'] << attachment_options + end + + # Adds volume attachment entry and creates a new Volume associated in the Server profile + # @param [OneviewSDK::Volume] volume Volume Resource to add an attachment + # @param [Hash] volume_options Options to create a new Volume. + # Please refer to OneviewSDK::Volume documentation for the data necessary to create a new Volume. + # @param [Hash] attachment_options Options of the new attachment + # @option attachment_options [Fixnum] 'id' The ID of the attached storage volume. Do not use it if you want it to be created automatically. + # @option attachment_options [String] 'lun' The logical unit number. + # @option attachment_options [String] 'lunType' The logical unit number type: Auto or Manual. + # @option attachment_options [Boolean] 'permanent' Required. If true, indicates that the volume will persist when the profile is deleted. + # If false, then the volume will be deleted when the profile is deleted. + # @option attachment_options [Array] 'storagePaths' A list of host-to-target path associations. + # @return Returns the connection hash if found, otherwise returns nil + def create_volume_with_attachment(storage_pool, volume_options, attachment_options = {}) + self['sanStorage'] ||= {} + self['sanStorage']['volumeAttachments'] ||= [] + attachment_options['id'] ||= 0 + # Removing provisioningParameters and adding them to the top level hash + provision_param = volume_options.delete('provisioningParameters') || volume_options.delete(:provisioningParameters) + provision_param.each do |k, v| + volume_options[k] = v + end + # Each provisioningParameter has the prefix 'volume' attached to its name in the original options + # Also, it needs to respect the lower camel case + volume_options.each do |k, v| + attachment_options["volume#{k.to_s[0].capitalize}#{k.to_s[1, k.to_s.length - 1]}"] = v + end + + attachment_options['volumeStoragePoolUri'] = storage_pool['uri'] if storage_pool['uri'] || storage_pool.retrieve! + + # Since the volume is being created in this method, it needs to be nil + attachment_options['volumeUri'] = nil + attachment_options['volumeStorageSystemUri'] = nil + + # volumeProvisionedCapacityBytes is not following the same pattern in Volume + attachment_options['volumeProvisionedCapacityBytes'] ||= attachment_options.delete('volumeRequestedCapacity') + + # Defaults + attachment_options['permanent'] ||= true + attachment_options['lunType'] ||= 'Auto' + attachment_options['lun'] ||= nil + attachment_options['storagePaths'] ||= [] + + self['sanStorage']['volumeAttachments'] << attachment_options + end + + # Removes a volume attachment entry in the Server profile + # @param [Fixnum] id ID number of the attachment entry + # @return Returns the volume hash if found, otherwise returns nil + def remove_volume_attachment(id) + self['sanStorage'] ||= {} + self['sanStorage']['volumeAttachments'] ||= [] + return if self['sanStorage'].empty? || self['sanStorage']['volumeAttachments'].empty? + + volume_attachment = nil + self['sanStorage']['volumeAttachments'].each do |entry| + volume_attachment = self['sanStorage']['volumeAttachments'].delete(entry) if entry['id'] == id + end + volume_attachment + end + + # Sets the Firmware Driver for the server profile + # @param [OneviewSDK::FirmwareDriver] firmware Firmware Driver to be associated with the resource + # @param [Hash] firmware_options Firmware Driver options + # @option firmware_options [Boolean] 'manageFirmware' Indicates that the server firmware is configured using the server profile. + # Value can be 'true' or 'false'. + # @option firmware_options [Boolean] 'forceInstallFirmware' Force installation of firmware even if same or newer version is installed. + # Downgrading the firmware can result in the installation of unsupported firmware and cause server hardware to cease operation. + # Value can be 'true' or 'false'. + # @option firmware_options [String] 'firmwareInstallType' Specifies the way a Service Pack for ProLiant (SPP) is installed. + # This field is used if the 'manageFirmware' field is true. + # Values are 'FirmwareAndOSDrivers', 'FirmwareOnly', and 'FirmwareOnlyOfflineMode'. + def set_firmware_driver(firmware, firmware_options = {}) + firmware_options['firmwareBaselineUri'] = firmware['uri'] if firmware['uri'] || firmware.retrieve! + self['firmware'] = firmware_options + end + + # @!endgroup + + # Gets all the available ethernet and fc networks, and network sets + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] query Query parameters + # @option query [OneviewSDK::EnclosureGroup] 'enclosure_group' Enclosure Group associated with the resource + # @option query [String] 'function_type' The FunctionType (Ethernet or FibreChannel) to filter the list of networks returned + # @option query [OneviewSDK::ServerHardware] 'server_hardware' The server hardware associated with the resource + # @option query [OneviewSDK::ServerHardwareType] 'server_hardware_type' The server hardware type associated with the resource + # @option query [String] 'view' Name of a predefined view to return a specific subset of the attributes of the resource or collection + # @return [Hash] + # A hash containing the lists of Ethernet and FC Networks, and Network Sets + # Options: + # * [String] 'ethernetNetworks' The list of Ethernet Networks + # * [String] 'fcNetworks' The list of FC Networks + # * [String] 'networkSets' The list of Networks Sets + def self.get_available_networks(client, query) + query_uri = build_query(query) if query + response = client.rest_get("#{BASE_URI}/available-networks#{query_uri}") + body = client.response_handler(response) + body.select { |k, _v| %w(ethernetNetworks networkSets fcNetworks).include?(k) } + end + + # Gets the available servers based on the query parameters + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] query Query parameters + # @option query [OneviewSDK::EnclosureGroup] 'enclosure_group' Enclosure Group associated with the resource + # @option query [OneviewSDK::ServerProfile] 'server_profile' The server profile associated with the resource + # @option query [OneviewSDK::ServerHardwareType] 'server_hardware_type' The server hardware type associated with the resource + # @return [Hash] Hash containing all the available server information + def self.get_available_servers(client, query = nil) + if query + query_uri = build_query(query) + # profileUri attribute is not following the standards in OneView + query_uri.sub!('serverProfileUri', 'profileUri') + end + response = client.rest_get("#{BASE_URI}/available-servers#{query_uri}") + client.response_handler(response) + end + + # Gets the available storage systems based on the query parameters + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] query Query parameters + # @option query [OneviewSDK::EnclosureGroup] 'enclosure_group' Enclosure Group associated with the resource + # @option query [OneviewSDK::ServerHardwareType] 'server_hardware_type' The server hardware type associated with the resource + # @option query [OneviewSDK::StorageSystem] 'storage_system' The Storage System the resources are associated with + def self.get_available_storage_system(client, query = nil) + # For storage_system the query requires the ID instead the URI + if query && query['storage_system'] + query['storage_system'].retrieve! unless query['storage_system']['uri'] + query['storage_system_id'] = query['storage_system']['uri'].split('/').last + query.delete('storage_system') + end + query_uri = build_query(query) if query + response = client.rest_get("#{BASE_URI}/available-storage-system#{query_uri}") + client.response_handler(response) + end + + # Gets the available storage systems based on the query parameters + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] query Query parameters + # @option query [OneviewSDK::EnclosureGroup] 'enclosure_group' The enclosure group associated with the resource + # @option query [OneviewSDK::ServerHardwareType] 'server_hardware_type' The server hardware type associated with the resource + # @option query [Array] 'filter' A general filter/query string to narrow the list of items returned. + # The default is no filter - all resources are returned. + # @option query [Integer] 'start' The first item to return, using 0-based indexing. + # If not specified, the default is 0 - start with the first available item. + # @option query [Integer] 'count' The sort order of the returned data set. + # By default, the sort order is based on create time, with the oldest entry first. + # @option query [String] 'sort' The number of resources to return. A count of -1 requests all the items. + def self.get_available_storage_systems(client, query = nil) + query_uri = build_query(query) if query + response = client.rest_get("#{BASE_URI}/available-storage-systems#{query_uri}") + client.response_handler(response) end - def validate_serverProfileTemplateUri(*) - fail "Templates only exist on api version >= 200. Resource version: #{@api_version}" if @api_version < 200 + # Get the available targets based on the query parameters + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] query Query parameters + # @option query [OneviewSDK::EnclosureGroup] 'enclosure_group' Enclosure Group associated with the resource + # @option query [OneviewSDK::ServerProfile] 'server_profile' The server profile associated with the resource + # @option query [OneviewSDK::ServerHardwareType] 'server_hardware_type' The server hardware type associated with the resource + def self.get_available_targets(client, query = nil) + query_uri = build_query(query) if query + response = client.rest_get("#{BASE_URI}/available-targets#{query_uri}") + client.response_handler(response) end - def validate_templateCompliance(*) - fail "Templates only exist on api version >= 200. Resource version: #{@api_version}" if @api_version < 200 + # Gets all the available ethernet and fc networks + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] query Query parameters + # @option query [OneviewSDK::EnclosureGroup] 'enclosure_group' Enclosure Group associated with the resource + # @option query [OneviewSDK::ServerHardware] 'server_hardware' The server hardware associated with the resource + # @option query [OneviewSDK::ServerHardwareType] 'server_hardware_type' The server hardware type associated with the resource + def self.get_profile_ports(client, query = nil) + query_uri = build_query(query) if query + response = client.rest_get("#{BASE_URI}/profile-ports#{query_uri}") + client.response_handler(response) end end end diff --git a/lib/oneview-sdk/resource/server_profile_template.rb b/lib/oneview-sdk/resource/server_profile_template.rb index 41ed9769c..7bbfdf87f 100644 --- a/lib/oneview-sdk/resource/server_profile_template.rb +++ b/lib/oneview-sdk/resource/server_profile_template.rb @@ -1,3 +1,14 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Server profile template resource implementation class ServerProfileTemplate < Resource @@ -9,15 +20,193 @@ def initialize(client, params = {}, api_ver = nil) @data['type'] ||= 'ServerProfileTemplateV1' end - # Create ServerProfile using this template + # Sets the Server Hardware Type for the Server Profile Template + # @param [OneviewSDK::ServerHardwareType] server_hardware_type Type of the desired Server Hardware + def set_server_hardware_type(server_hardware_type) + self['serverHardwareTypeUri'] = server_hardware_type['uri'] if server_hardware_type['uri'] || server_hardware_type.retrieve! + fail "Resource #{server_hardware_type['name']} could not be found!" unless server_hardware_type['uri'] + end + + # Sets the enclosure group for the server profile template + # @param [OneviewSDK::EnclosureGroup] enclosure_group Enclosure Group that the Server is a member + def set_enclosure_group(enclosure_group) + self['enclosureGroupUri'] = enclosure_group['uri'] if enclosure_group['uri'] || enclosure_group.retrieve! + fail "Resource #{enclosure_group['name']} could not be found!" unless enclosure_group['uri'] + end + + # Sets the firmware driver for the current server profile template + # @param [OneviewSDK::FirmwareDriver] firmware Firmware Driver to be associated with the resource + # @param [Hash] firmware_options Firmware Driver options + # @option firmware_options [Boolean] 'manageFirmware' Indicates that the server firmware is configured using the server profile. + # Value can be 'true' or 'false'. + # @option firmware_options [Boolean] 'forceInstallFirmware' Force installation of firmware even if same or newer version is installed. + # Downgrading the firmware can result in the installation of unsupported firmware and cause server hardware to cease operation. + # Value can be 'true' or 'false'. + # @option firmware_options [String] 'firmwareInstallType' Specifies the way a Service Pack for ProLiant (SPP) is installed. + # This field is used if the 'manageFirmware' field is true. + # Values are 'FirmwareAndOSDrivers', 'FirmwareOnly', and 'FirmwareOnlyOfflineMode'. + def set_firmware_driver(firmware, firmware_options = {}) + firmware_options['firmwareBaselineUri'] = firmware['uri'] if firmware['uri'] || firmware.retrieve! + self['firmware'] = firmware_options + end + + # Adds a connection entry to server profile template + # @param [OneviewSDK::EthernetNetwork,OneviewSDK::FCNetwork] network Network associated with the connection + # @param [Hash] connection_options Hash containing the configuration of the connection + # @option connection_options [Integer] 'allocatedMbps' The transmit throughput (mbps) currently allocated to + # this connection. When Fibre Channel connections are set to Auto for requested bandwidth, the value can be set to -2000 + # to indicate that the actual value is unknown until OneView is able to negotiate the actual speed. + # @option connection_options [Integer] 'allocatedVFs' The number of virtual functions allocated to this connection. This value will be null. + # @option connection_options [Hash] 'boot' indicates that the server will attempt to boot from this connection. + # This object can only be specified if "boot.manageBoot" is set to 'true' + # @option connection_options [String] 'deploymentStatus' The deployment status of the connection. + # The value can be 'Undefined', 'Reserved', or 'Deployed'. + # @option connection_options [String] 'functionType' Type of function required for the connection. + # functionType cannot be modified after the connection is created. + # @option connection_options [String] 'mac' The MAC address that is currently programmed on the FlexNic. + # @option connection_options [String] 'macType' Specifies the type of MAC address to be programmed into the IO Devices. + # The value can be 'Virtual', 'Physical' or 'UserDefined'. + # @option connection_options [String] 'maximumMbps' Maximum transmit throughput (mbps) allowed on this connection. + # The value is limited by the maximum throughput of the network link and maximumBandwidth of the selected network (networkUri). + # For Fibre Channel connections, the value is limited to the same value as the allocatedMbps. + # @option connection_options [String] 'name' A string used to identify the respective connection. + # The connection name is case insensitive, limited to 63 characters and must be unique within the profile. + # @option connection_options [String] 'portId' Identifies the port (FlexNIC) used for this connection. + # @option connection_options [String] 'requestedMbps' The transmit throughput (mbps) that should be allocated to this connection. + # @option connection_options [String] 'requestedVFs' This value can be "Auto" or 0. + # @option connection_options [String] 'wwnn' The node WWN address that is currently programmed on the FlexNic. + # @option connection_options [String] 'wwpn' The port WWN address that is currently programmed on the FlexNic. + # @option connection_options [String] 'wwpnType' Specifies the type of WWN address to be porgrammed on the FlexNIC. + # The value can be 'Virtual', 'Physical' or 'UserDefined'. + def add_connection(network, connection_options = {}) + self['connections'] = [] unless self['connections'] + connection_options['id'] = 0 # Letting OneView treat the ID registering + connection_options['networkUri'] = network['uri'] if network['uri'] || network.retrieve! + self['connections'] << connection_options + end + + # Removes a connection entry in server profile template + # @param [String] connection_name Name of the connection + # @return Returns the connection hash if found, otherwise returns nil + def remove_connection(connection_name) + desired_connection = nil + return desired_connection unless self['connections'] + self['connections'].each do |con| + desired_connection = self['connections'].delete(con) if con['name'] == connection_name + end + desired_connection + end + + # Adds a volume attachment entry with associated volume in server profile template + # @param [OneviewSDK::Volume] volume Volume Resource to add an attachment + # @param [Hash] attachment_options Options of the new attachment + # @option attachment_options [Fixnum] 'id' The ID of the attached storage volume. Do not use it if you want it to be created automatically. + # @option attachment_options [String] 'lun' The logical unit number. + # @option attachment_options [String] 'lunType' The logical unit number type: Auto or Manual. + # @option attachment_options [Boolean] 'permanent' Required. If true, indicates that the volume will persist when the profile is deleted. + # If false, then the volume will be deleted when the profile is deleted. + # @option attachment_options [Array] 'storagePaths' A list of host-to-target path associations. + # @return Returns the connection hash if found, otherwise returns nil + def add_volume_attachment(volume, attachment_options = {}) + self['sanStorage'] ||= {} + self['sanStorage']['volumeAttachments'] ||= [] + attachment_options['id'] ||= 0 + + volume.retrieve! unless volume['uri'] || volume['storagePoolUri'] || volume['storageSystemUri'] + attachment_options['volumeUri'] = volume['uri'] + attachment_options['volumeStoragePoolUri'] = volume['storagePoolUri'] + attachment_options['volumeStorageSystemUri'] = volume['storageSystemUri'] + + self['sanStorage']['volumeAttachments'] << attachment_options + end + + # Adds a volume attachment entry with new volume in Server profile template + # @param [OneviewSDK::Volume] volume Volume Resource to add an attachment + # @param [Hash] volume_options Options to create a new Volume. + # Please refer to OneviewSDK::Volume documentation for the data necessary to create a new Volume. + # @param [Hash] attachment_options Options of the new attachment + # @option attachment_options [Fixnum] 'id' The ID of the attached storage volume. Do not use it if you want it to be created automatically. + # @option attachment_options [String] 'lun' The logical unit number. + # @option attachment_options [String] 'lunType' The logical unit number type: Auto or Manual. + # @option attachment_options [Boolean] 'permanent' Required. If true, indicates that the volume will persist when the profile is deleted. + # If false, then the volume will be deleted when the profile is deleted. + # @option attachment_options [Array] 'storagePaths' A list of host-to-target path associations. + # @return Returns the connection hash if found, otherwise returns nil + def create_volume_with_attachment(storage_pool, volume_options, attachment_options = {}) + self['sanStorage'] ||= {} + self['sanStorage']['volumeAttachments'] ||= [] + attachment_options['id'] ||= 0 + # Removing provisioningParameters and adding them to the top level hash + provision_param = volume_options.delete('provisioningParameters') || volume_options.delete(:provisioningParameters) + provision_param.each do |k, v| + volume_options[k] = v + end + # Each provisioningParameter has the prefix 'volume' attached to its name in the original options + # Also, it needs to respect the lower camel case + volume_options.each do |k, v| + attachment_options["volume#{k.to_s[0].capitalize}#{k.to_s[1, k.to_s.length - 1]}"] = v + end + + attachment_options['volumeStoragePoolUri'] = storage_pool['uri'] if storage_pool['uri'] || storage_pool.retrieve! + + # Since the volume is being created in this method, it needs to be nil + attachment_options['volumeUri'] = nil + attachment_options['volumeStorageSystemUri'] = nil + + # volumeProvisionedCapacityBytes is not following the same pattern in Volume + attachment_options['volumeProvisionedCapacityBytes'] ||= attachment_options.delete('volumeRequestedCapacity') + + # Defaults + attachment_options['permanent'] ||= true + attachment_options['lunType'] ||= 'Auto' + attachment_options['lun'] ||= nil + attachment_options['storagePaths'] ||= [] + + self['sanStorage']['volumeAttachments'] << attachment_options + end + + # Removes a volume attachment entry in Server profile template + # @param [Fixnum] id ID number of the attachment entry + # @return Returns the volume hash if found, otherwise returns nil + def remove_volume_attachment(id) + self['sanStorage'] ||= {} + self['sanStorage']['volumeAttachments'] ||= [] + return if self['sanStorage'].empty? || self['sanStorage']['volumeAttachments'].empty? + + volume_attachment = nil + self['sanStorage']['volumeAttachments'].each do |entry| + volume_attachment = self['sanStorage']['volumeAttachments'].delete(entry) if entry['id'] == id + end + volume_attachment + end + + # Gets the available server hardwares + # @return [Array] Array of ServerHardware resources that matches this + # profile template's server hardware type and enclosure group and who's state is 'NoProfileApplied' + def get_available_hardware + ensure_client + fail IncompleteResource, 'Must set @data[\'serverHardwareTypeUri\']' unless @data['serverHardwareTypeUri'] + fail IncompleteResource, 'Must set @data[\'enclosureGroupUri\']' unless @data['enclosureGroupUri'] + params = { + state: 'NoProfileApplied', + serverHardwareTypeUri: @data['serverHardwareTypeUri'], + serverGroupUri: @data['enclosureGroupUri'] + } + OneviewSDK::ServerHardware.find_by(@client, params) + rescue StandardError => e + raise IncompleteResource, "Failed to get available hardware. Message: #{e.message}" + end + + # Creates a ServerProfile using this template # @param [String] name Name of new server profile - # @return [ServerProfile] New server profile from template. + # @return [OneviewSDK::ServerProfile] New server profile from template. # Temporary object only; call .create to actually create resource on OneView. def new_profile(name = nil) ensure_client && ensure_uri - options = @client.rest_get("#{@data['uri']}/new-profile") + response = @client.rest_get("#{@data['uri']}/new-profile") + options = @client.response_handler(response) profile = OneviewSDK::ServerProfile.new(@client, options) - profile[:name] = name if name && name.size > 0 + profile['name'] = name ? name : "Server_Profile_created_from_#{@data['name']}" profile end end diff --git a/lib/oneview-sdk/resource/storage_pool.rb b/lib/oneview-sdk/resource/storage_pool.rb index c87304a21..48f1c7489 100644 --- a/lib/oneview-sdk/resource/storage_pool.rb +++ b/lib/oneview-sdk/resource/storage_pool.rb @@ -1,41 +1,63 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Storage pool resource implementation class StoragePool < Resource BASE_URI = '/rest/storage-pools'.freeze + # Add the resource on OneView using the current data + # @note Calls the refresh method to set additional data + # @raise [OneviewSDK::IncompleteResource] if the client is not set + # @raise [StandardError] if the resource creation fails + # @return [OneviewSDK::StoragePool] self + alias add create + + # Remove resource from OneView + # @return [true] if resource was removed successfully + alias remove delete + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values: @data['type'] ||= 'StoragePoolV2' end - # @!group Validates - - VALID_REFRESH_STATES = %w(NotRefreshing RefreshFailed RefreshPending Refreshing).freeze - # Validate refreshState - # @param [String] value NotRefreshing, RefreshFailed, RefreshPending, Refreshing - def validate_refreshState(value) - fail 'Invalid refresh state' unless VALID_REFRESH_STATES.include?(value) - end - - VALID_STATUSES = %w(OK Disabled Warning Critical Unknown).freeze - # Validate status - # @param [String] value OK, Disabled, Warning, Critical, Unknown - def validate_status(value) - fail 'Invalid status' unless VALID_STATUSES.include?(value) + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method end - # @!endgroup - - # Set storage system - # @param [StorageSystem] storage_system - def set_storage_system(storage_system) - set('storageSystemUri', storage_system['uri']) + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method end + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available def update unavailable_method end + # Sets the storage system + # @param [OneviewSDK::StorageSystem] storage_system + def set_storage_system(storage_system) + fail IncompleteResource, 'Please set the storage system\'s uri attribute!' unless storage_system['uri'] + set('storageSystemUri', storage_system['uri']) + end end end diff --git a/lib/oneview-sdk/resource/storage_system.rb b/lib/oneview-sdk/resource/storage_system.rb index 610aa3f83..b0adb37e0 100644 --- a/lib/oneview-sdk/resource/storage_system.rb +++ b/lib/oneview-sdk/resource/storage_system.rb @@ -1,15 +1,49 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Storage system resource implementation class StorageSystem < Resource BASE_URI = '/rest/storage-systems'.freeze + # Remove resource from OneView + # @return [true] if resource was removed successfully + alias remove delete + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values: @data['type'] ||= 'StorageSystemV3' end + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available def create + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Adds the resource to OneView using the current data + # @note Calls the refresh method to set additional data + # @return [OneviewSDK::StorageSystem] self + def add ensure_client task = @client.rest_post(self.class::BASE_URI, { 'body' => self['credentials'] }, @api_version) temp = @data.clone @@ -21,33 +55,50 @@ def create self end - def retrieve! - if @data['name'] - super - else - ip_hostname = self['credentials'][:ip_hostname] || self['credentials']['ip_hostname'] - results = self.class.find_by(@client, credentials: { ip_hostname: ip_hostname }) - return false unless results.size == 1 - set_all(results[0].data) - true + # Checks if the resource already exists + # @note name,uri or ip_hostname must be specified inside resource + # @return [Boolean] Whether or not resource exists + def exists? + ip_hostname = self['credentials'][:ip_hostname] || self['credentials']['ip_hostname'] if self['credentials'] + return true if @data['name'] && self.class.find_by(@client, name: @data['name']).size == 1 + return true if @data['uri'] && self.class.find_by(@client, uri: @data['uri']).size == 1 + return true if ip_hostname && self.class.find_by(@client, credentials: { ip_hostname: ip_hostname }).size == 1 + unless @data['name'] || @data['uri'] || ip_hostname + fail IncompleteResource, 'Must set resource name, uri or ip_hostname before trying to retrieve!' end + false + end + + # Retrieves the resource details based on this resource's name or URI. + # @note Name,URI or ip_hostname must be specified inside resource + # @return [Boolean] Whether or not retrieve was successful + # @raise [OneviewSDK::IncompleteResource] if attributes are not filled + def retrieve! + ip_hostname = self['credentials'][:ip_hostname] || self['credentials']['ip_hostname'] if self['credentials'] + return super if @data['name'] || @data['uri'] + + fail IncompleteResource, 'Must set resource name, uri or ip_hostname before trying to retrieve!' unless ip_hostname + results = self.class.find_by(@client, credentials: { ip_hostname: ip_hostname }) + return false unless results.size == 1 + set_all(results[0].data) + true end - # Get host types for storage system resource - # @param [Client] client client handle REST calls to OV instance + # Gets the host types for the storage system resource + # @param [OneviewSDK::Client] client The client object for the OneView appliance # @return [String] response body def self.get_host_types(client) response = client.rest_get(BASE_URI + '/host-types') response.body end - # List of storage pools + # Lists the storage pools def get_storage_pools response = @client.rest_get(@data['uri'] + '/storage-pools') response.body end - # List of all managed target ports for the specified storage system + # Lists all managed target ports for the specified storage system, # or only the one specified # @param [String] port Target port def get_managed_ports(port = nil) @@ -58,6 +109,5 @@ def get_managed_ports(port = nil) end response.body end - end end diff --git a/lib/oneview-sdk/resource/switch.rb b/lib/oneview-sdk/resource/switch.rb new file mode 100644 index 000000000..99eaa2e17 --- /dev/null +++ b/lib/oneview-sdk/resource/switch.rb @@ -0,0 +1,86 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +module OneviewSDK + # Switch resource implementation + class Switch < Resource + BASE_URI = '/rest/switches'.freeze + TYPE_URI = '/rest/switch-types'.freeze + + # Remove resource from OneView + # @return [true] if resource was removed successfully + alias remove delete + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def update + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def refresh + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Retrieves the switch types + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @return [Array] All the Switch types + def self.get_types(client) + response = client.rest_get(TYPE_URI) + response = client.response_handler(response) + response['members'] + end + + # Retrieves the switch type with the name + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [String] name Switch type name + # @return [Array] Switch type + def self.get_type(client, name) + results = get_types(client) + results.find { |switch_type| switch_type['name'] == name } + end + + # Get statistics for an interconnect, for the specified port or subport + # @param [String] port_name port to retrieve statistics + # @param [String] subport_number subport to retrieve statistics + # @return [Hash] Switch statistics + def statistics(port_name = nil, subport_number = nil) + uri = if subport_number + "#{@data['uri']}/statistics/#{port_name}/subport/#{subport_number}" + else + "#{@data['uri']}/statistics/#{port_name}" + end + response = @client.rest_get(uri) + response.body + end + + # Get settings that describe the environmental configuration + # @return [Hash] Configuration parameters + def environmental_configuration + ensure_client && ensure_uri + response = @client.rest_get(@data['uri'] + '/environmentalConfiguration', @api_version) + @client.response_handler(response) + end + end +end diff --git a/lib/oneview-sdk/resource/unmanaged_device.rb b/lib/oneview-sdk/resource/unmanaged_device.rb new file mode 100644 index 000000000..450dfb5f0 --- /dev/null +++ b/lib/oneview-sdk/resource/unmanaged_device.rb @@ -0,0 +1,55 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +module OneviewSDK + # Storage system resource implementation + class UnmanagedDevice < Resource + BASE_URI = '/rest/unmanaged-devices'.freeze + + # Add the resource on OneView using the current data + # @note Calls the refresh method to set additional data + # @raise [OneviewSDK::IncompleteResource] if the client is not set + # @raise [StandardError] if the resource creation fails + # @return [OneviewSDK::UnmanagedDevice] self + alias add create + + # Remove resource from OneView + # @return [true] if resource was removed successfully + alias remove delete + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Gets a list of unmanaged devices + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @return [Array] list of unmanaged devices + def self.get_devices(client) + response = client.rest_get(BASE_URI) + client.response_handler(response)['members'] + end + + # Get settings that describe the environmental configuration + def environmental_configuration + ensure_client && ensure_uri + response = @client.rest_get(@data['uri'] + '/environmentalConfiguration') + @client.response_handler(response) + end + end +end diff --git a/lib/oneview-sdk/resource/uplink_set.rb b/lib/oneview-sdk/resource/uplink_set.rb index ebc66b1e4..41d3812a4 100644 --- a/lib/oneview-sdk/resource/uplink_set.rb +++ b/lib/oneview-sdk/resource/uplink_set.rb @@ -1,8 +1,23 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Uplink set resource implementation class UplinkSet < Resource BASE_URI = '/rest/uplink-sets'.freeze + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values @@ -14,61 +29,7 @@ def initialize(client, params = {}, api_ver = nil) @data['type'] ||= 'uplink-setV3' end - # @!group Validates - - VALID_ETHERNET_NETWORK_TYPES = %w(NotApplicable Tagged Tunnel Unknown Untagged).freeze - # Validate ethernetNetworkType - # @param [String] value NotApplicable, Tagged, Tunnel, Unknown, Untagged - def validate_ethernetNetworkType(value) - fail 'Invalid ethernet network type' unless VALID_ETHERNET_NETWORK_TYPES.include?(value) - end - - VALID_LACP_TIMERS = %w(Short Long).freeze - # Validate lacpTimer - # @param [String] value Short, Long - def validate_lacpTimer(value) - return if value.to_s.empty? - fail 'Invalid lacp timer' unless %w(Short Long).include?(value) - end - - VALID_MANUAL_LOGIN_REDISTRIBUTION_STATES = %w(Distributed Distributing DistributionFailed NotSupported Supported).freeze - # Validate manualLoginRedistributionState - # @param [String] value Distributed, Distributing, DistributionFailed, NotSupported, Supported - def validate_manualLoginRedistributionState(value) - fail 'Invalid manual login redistribution state' unless VALID_MANUAL_LOGIN_REDISTRIBUTION_STATES.include?(value) - end - - VALID_NETWORK_TYPES = %w(Ethernet FibreChannel).freeze - # Validate networkType - # @param [String] value Ethernet, FibreChannel - def validate_networkType(value) - fail 'Invalid network type' unless VALID_NETWORK_TYPES.include?(value) - end - - VALID_LOCATION_ENTRIES_TYPES = %w(Bay Enclosure Ip Password Port StackingDomainId StackingMemberId UserId).freeze - # Validate locationEntriesType - # @param [String] value Bay Enclosure Ip Password Port StackingDomainId StackingMemberId UserId - def validate_locationEntriesType(value) - fail 'Invalid location entry type' unless VALID_LOCATION_ENTRIES_TYPES.include?(value) - end - - VALID_REACHABILITIES = ['NotReachable', 'Reachable', 'RedundantlyReachable', 'Unknown', nil].freeze - # Validate ethernetNetworkType request - # @param [String] value NotReachable Reachable RedundantlyReachable Unknown - def validate_reachability(value) - fail 'Invalid reachability' unless VALID_REACHABILITIES.include?(value) - end - - VALID_STATUSES = %w(OK Disabled Warning Critical Unknown).freeze - # Validate ethernetNetworkType request - # @param [String] value OK Disabled Warning Critical Unknown - def validate_status(value) - fail 'Invalid status' unless VALID_STATUSES.include?(value) - end - - # @!endgroup - - # Add portConfigInfos to the array + # Adds the portConfigInfos to the array # @param [String] portUri # @param [String] speed # @param [Hash] locationEntries @@ -83,37 +44,36 @@ def add_port_config(portUri, speed, locationEntries) @data['portConfigInfos'] << entry end - # Set logical interconnect uri + # Sets the logical interconnect uri # @param [OneviewSDK::LogicalInterconnect, Hash] logical_interconnect def set_logical_interconnect(logical_interconnect) uri = logical_interconnect[:uri] || logical_interconnect['uri'] - fail 'Invalid object' unless uri + fail IncompleteResource, 'Invalid object' unless uri @data['logicalInterconnectUri'] = uri end - # Add an uri to networkUris array + # Adds an ethernet network to the uplink set # @param [OneviewSDK::EthernetNetwork, Hash] network def add_network(network) uri = network[:uri] || network['uri'] - fail 'Invalid object' unless uri + fail IncompleteResource, 'Must set network uri attribute' unless uri @data['networkUris'].push(uri) end - # Add an uri to fcnetworkUris array + # Adds an fc network to the uplink set # @param [OneviewSDK::FCNetwork, Hash] network must accept hash syntax def add_fcnetwork(network) uri = network[:uri] || network['uri'] - fail 'Invalid object' unless uri + fail IncompleteResource, 'Must set network uri attribute' unless uri @data['fcNetworkUris'].push(uri) end - # Add an uri to fcoenetworkUris array + # Adds an fcoe network to the uplink set # @param [OneviewSDK::FCoENetwork, Hash] network must accept hash syntax def add_fcoenetwork(network) uri = network[:uri] || network['uri'] - fail 'Invalid object' unless uri + fail IncompleteResource, 'Must set network uri attribute' unless uri @data['fcoeNetworkUris'].push(uri) end - end end diff --git a/lib/oneview-sdk/resource/volume.rb b/lib/oneview-sdk/resource/volume.rb index 93d03066c..075a3c2a0 100644 --- a/lib/oneview-sdk/resource/volume.rb +++ b/lib/oneview-sdk/resource/volume.rb @@ -1,19 +1,19 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Volume resource implementation class Volume < Resource BASE_URI = '/rest/storage-volumes'.freeze - # @!group Validates - - VALID_PROVISION_TYPES = %w(Thin Full).freeze - # Validate the type of provisioning - # @param [String] value Must be Thin or Full - def validate_provisionType(value) - fail 'Invalid provision type' unless VALID_PROVISION_TYPES.include?(value) - end - - # @!endgroup - # It's possible to create the volume in 6 different ways: # 1) Common = Storage System + Storage Pool # 2) Template = Storage Volume Template @@ -22,10 +22,10 @@ def validate_provisionType(value) # 5) Management by name = Storage System + Storage System Volume Name # 6) Snapshot = Snapshot Pool + Storage Pool + Snapshot - # Create the volume - # @note provisioningParameters are required for creation, but not afterwards; after creation, they will be removed. - # @raise [RuntimeError] if the client is not set - # @raise [RuntimeError] if the resource creation fails + # Creates the volume + # @note provisioning parameters are required for creation, but not afterwards; after creation, they will be removed. + # @raise [OneviewSDK::IncompleteResource] if the client is not set + # @raise [StandardError] if the resource creation fails # @return [Resource] self def create ensure_client @@ -36,7 +36,7 @@ def create self end - # Delete resource from OneView or from Oneview and storage system + # Deletes the resource from OneView or from Oneview and storage system # @param [Symbol] flag Delete storage system from Oneview only or in storage system as well # @return [true] if resource was deleted successfully def delete(flag = :all) @@ -49,7 +49,7 @@ def delete(flag = :all) response = @client.rest_api(:delete, @data['uri'], {}, @api_version) @client.response_handler(response) else - fail 'Invalid flag value, use :oneview or :all' + fail InvalidResource, 'Invalid flag value, use :oneview or :all' end true end @@ -65,10 +65,11 @@ def set_storage_system(storage_system) # @param [OneviewSDK::StoragePool] storage_pool Storage pool def set_storage_pool(storage_pool) assure_uri(storage_pool) - set('storagePoolUri', storage_pool['uri']) + self['provisioningParameters'] ||= {} + self['provisioningParameters']['storagePoolUri'] = storage_pool['uri'] end - # Adds storage volume template to the volume + # Adds the storage volume template to the volume # @param [OneviewSDK::VolumeTemplate] storage_volume_template Storage Volume Template def set_storage_volume_template(storage_volume_template) assure_uri(storage_volume_template) @@ -82,7 +83,7 @@ def set_snapshot_pool(storage_pool) set('snapshotPoolUri', storage_pool['uri']) end - # Create a snapshot of the volume + # Creates a snapshot of the volume # @param [String, OneviewSDK::VolumeSnapshot] snapshot String or OneviewSDK::VolumeSnapshot object # @param [String] description Provide a description # @return [true] if snapshot was created successfully @@ -104,7 +105,7 @@ def create_snapshot(snapshot, description = nil) true end - # Delete a snapshot of the volume + # Deletes a snapshot of the volume # @param [String] name snapshot name # @return [true] if snapshot was created successfully def delete_snapshot(name) @@ -114,7 +115,7 @@ def delete_snapshot(name) true end - # Retrieve snapshot by name + # Retrieves a snapshot by name # @param [String] name # @return [Hash] snapshot data def get_snapshot(name) @@ -124,7 +125,7 @@ def get_snapshot(name) end end - # Get snapshots of this volume + # Gets all the snapshots of this volume # @return [Array] Array of snapshots def get_snapshots ensure_uri && ensure_client @@ -143,8 +144,8 @@ def get_snapshots results end - # Get all the attachable volumes managed by the appliance - # @param [Client] client The client object for the appliance + # Gets all the attachable volumes managed by the appliance + # @param [OneviewSDK::Client] client The client object for the OneView appliance # @return [Array] Array of volumes def self.get_attachable_volumes(client) results = [] @@ -161,14 +162,14 @@ def self.get_attachable_volumes(client) end # Gets the list of extra managed storage volume paths - # @param [OneviewSDK::Client] client + # @param [OneviewSDK::Client] client The client object for the OneView appliance # @return response def self.get_extra_managed_volume_paths(client) response = client.rest_get(BASE_URI + '/repair?alertFixType=ExtraManagedStorageVolumePaths') client.response_handler(response) end - # Removes extra presentation from volume + # Removes extra presentation from the volume # @return response def repair response = client.rest_post(BASE_URI + '/repair', 'body' => { resourceUri: @data['uri'], type: 'ExtraManagedStorageVolumePaths' }) @@ -181,8 +182,7 @@ def repair # If not, first it tries to retrieve, and then verify for its existence def assure_uri(resource) resource.retrieve! unless resource['uri'] - fail "#{resource.class}: #{resource['name']} not found" unless resource['uri'] + fail IncompleteResource, "#{resource.class}: #{resource['name']} not found" unless resource['uri'] end - end end diff --git a/lib/oneview-sdk/resource/volume_attachment.rb b/lib/oneview-sdk/resource/volume_attachment.rb new file mode 100644 index 000000000..fa30dd4a3 --- /dev/null +++ b/lib/oneview-sdk/resource/volume_attachment.rb @@ -0,0 +1,79 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +module OneviewSDK + # Storage volume attachment resource implementation + class VolumeAttachment < Resource + BASE_URI = '/rest/storage-volume-attachments'.freeze + + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. + def initialize(client, params = {}, api_ver = nil) + super + # Default values: + @data['type'] ||= 'StorageVolumeAttachment' + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def create + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def update + unavailable_method + end + + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available + def delete + unavailable_method + end + + # Gets the list of extra unmanaged storage volumes + # @param [OneviewSDK::Client] client The client object for the OneView appliance + def self.get_extra_unmanaged_volumes(client) + response = client.rest_get(BASE_URI + '/repair?alertFixType=ExtraUnmanagedStorageVolumes') + client.response_handler(response) + end + + # Removes extra presentations from a specific server profile + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [OneviewSDK::Resource] resource Oneview resource + def self.remove_extra_unmanaged_volume(client, resource) + requestBody = { + type: 'ExtraUnmanagedStorageVolumes', + resourceUri: resource['uri'] + } + response = client.rest_post(BASE_URI + '/repair', 'body' => requestBody) + client.response_handler(response) + end + + # Gets all volume attachment paths + # @return [Array] List of the storage volume attachments paths + def get_paths + response = @client.rest_get(@data['uri'] + '/paths') + @client.response_handler(response) + end + + # Gets a volume attachment path by id + # @param [String] id Volume attachament path id + # @return [OneviewSDK::VolumeAttachmentPath] + def get_path(id) + response = @client.rest_get("#{@data['uri']}/paths/#{id}") + @client.response_handler(response) + end + end +end diff --git a/lib/oneview-sdk/resource/volume_snapshot.rb b/lib/oneview-sdk/resource/volume_snapshot.rb index 521d76bed..4eb749830 100644 --- a/lib/oneview-sdk/resource/volume_snapshot.rb +++ b/lib/oneview-sdk/resource/volume_snapshot.rb @@ -1,18 +1,37 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Volume snapshot resource implementation class VolumeSnapshot < Resource BASE_URI = nil + # Create a resource object, associate it with a client, and set its properties. + # @param [OneviewSDK::Client] client The client object for the OneView appliance + # @param [Hash] params The options for this resource (key-value pairs) + # @param [Integer] api_ver The api version to use when interracting with this resource. def initialize(client, params = {}, api_ver = nil) super # Default values @data['type'] ||= 'Snapshot' end + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available def create unavailable_method end + # Method is not available + # @raise [OneviewSDK::MethodUnavailable] method is not available def update unavailable_method end @@ -20,7 +39,7 @@ def update # Sets the volume # @param [OneviewSDK::Volume] volume Volume def set_volume(volume) - fail 'Please set the volume\'s uri attribute!' unless volume['uri'] + volume.retrieve! unless volume['uri'] @data['storageVolumeUri'] = volume['uri'] end end diff --git a/lib/oneview-sdk/resource/volume_template.rb b/lib/oneview-sdk/resource/volume_template.rb index 09547cffa..f230f7068 100644 --- a/lib/oneview-sdk/resource/volume_template.rb +++ b/lib/oneview-sdk/resource/volume_template.rb @@ -1,10 +1,21 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + module OneviewSDK # Volume template resource implementation class VolumeTemplate < Resource BASE_URI = '/rest/storage-volume-templates'.freeze - # Create client object, establish connection, and set up logging and api version. - # @param [Client] client The Client object with a connection to the OneView appliance + # Create the client object, establishes connection, and set up the logging and api version. + # @param [OneviewSDK::Client] client The client object for the OneView appliance # @param [Hash] params The options for this resource (key-value pairs) # @param [Integer] api_ver The api version to use when interracting with this resource. # Defaults to client.api_version if exists, or OneviewSDK::Client::DEFAULT_API_VERSION. @@ -17,29 +28,10 @@ def initialize(client, params = {}, api_ver = nil) @data['type'] ||= 'StorageVolumeTemplateV3' end - # @!group Validates - - VALID_REFRESH_STATES = %w(NotRefreshing RefreshFailed RefreshPending Refreshing).freeze - # Validate refreshState - # @param [String] value NotRefreshing, RefreshFailed, RefreshPending, Refreshing - def validate_refreshState(value) - fail 'Invalid refresh state' unless VALID_REFRESH_STATES.include?(value) - end - - VALID_STATUSES = %w(OK Disabled Warning Critical Unknown).freeze - # Validate status - # @param [String] value OK, Disabled, Warning, Critical, Unknown - def validate_status(value) - fail 'Invalid status' unless VALID_STATUSES.include?(value) - end - - # @!endgroup - # Create the resource on OneView using the current data - # Adds Accept-Language attribute in the Header equal to "en_US" # @note Calls refresh method to set additional data - # @raise [RuntimeError] if the client is not set - # @raise [RuntimeError] if the resource creation fails + # @raise [OneviewSDK::IncompleteResource] if the client is not set + # @raise [StandardError] if the resource creation fails # @return [Resource] self def create ensure_client @@ -48,9 +40,8 @@ def create set_all(body) end - # Delete volume template from OneView - # Adds Accept-Language attribute in the Header equal to "en_US" - # @return [TrueClass] if volume template was deleted successfully + # Deletes the volume template from OneView + # @return [TrueClass] if the volume template was deleted successfully def delete ensure_client && ensure_uri response = @client.rest_delete(@data['uri'], { 'Accept-Language' => 'en_US' }, @api_version) @@ -58,8 +49,7 @@ def delete true end - # Update volume template from OneView - # Adds Accept-Language attribute in the Header equal to "en_US" + # Updates the volume template from OneView # @return [Resource] self def update(attributes = {}) set_all(attributes) @@ -69,7 +59,7 @@ def update(attributes = {}) self end - # Set storage pool + # Sets the storage pool # @param [Boolean] shareable # @param [String] provisionType 'Thin' or 'Full' # @param [String] capacity (in bytes) @@ -82,25 +72,24 @@ def set_provisioning(shareable, provisionType, capacity, storage_pool) @data['provisioning']['storagePoolUri'] = storage_pool['uri'] end - # Set storage system + # Sets the storage system # @param [OneviewSDK::StorageSystem] storage_system Storage System to be used to create the template def set_storage_system(storage_system) storage_system.retrieve! unless storage_system['uri'] @data['storageSystemUri'] = storage_system['uri'] end - # Set snapshot pool + # Sets the snapshot pool # @param [OneviewSDK::StoragePool] storage_pool Storage Pool to generate the template def set_snapshot_pool(storage_pool) storage_pool.retrieve! unless storage_pool['uri'] @data['snapshotPoolUri'] = storage_pool['uri'] end - # Get connectable volume templates by its attributes + # Gets the connectable volume templates by its attributes # @param [Hash] attributes Hash containing the attributes name and value def get_connectable_volume_templates(attributes = {}) OneviewSDK::Resource.find_by(@client, attributes, BASE_URI + '/connectable-volume-templates') end - end end diff --git a/lib/oneview-sdk/rest.rb b/lib/oneview-sdk/rest.rb index 0823ef621..9f578c3bc 100644 --- a/lib/oneview-sdk/rest.rb +++ b/lib/oneview-sdk/rest.rb @@ -1,12 +1,23 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + require 'uri' require 'net/http' require 'openssl' require 'json' module OneviewSDK - # Contains all the methods for making API REST calls + # Contains all of the methods for making API REST calls module Rest - # Make a restful API request to OneView + # Makes a restful API request to OneView # @param [Symbol] type The rest method/type Options: [:get, :post, :delete, :patch, :put] # @param [String] path The path for the request. Usually starts with "/rest/" # @param [Hash] options The options for the request @@ -14,11 +25,12 @@ module Rest # @option options [String] :Content-Type ('application/json') Set to nil or :none to have this option removed # @option options [Integer] :X-API-Version (client.api_version) API version to use for this request # @option options [Integer] :auth (client.token) Authentication token to use for this request - # @raise [RuntimeError] if SSL validation of OneView instance's certificate failed + # @param [Integer] api_ver The api version to use when interracting with this resource + # @raise [OpenSSL::SSL::SSLError] if SSL validation of OneView instance's certificate failed # @return [NetHTTPResponse] Response object def rest_api(type, path, options = {}, api_ver = @api_version) @logger.debug "Making :#{type} rest call to #{@url}#{path}" - fail 'Must specify path' unless path + fail InvalidRequest, 'Must specify path' unless path uri = URI.parse(URI.escape(@url + path)) http = Net::HTTP.new(uri.host, uri.port) @@ -27,6 +39,8 @@ def rest_api(type, path, options = {}, api_ver = @api_version) http.cert_store = @cert_store if @cert_store else http.verify_mode = OpenSSL::SSL::VERIFY_NONE end + http.read_timeout = @timeout if @timeout # Timeout for a request + http.open_timeout = @timeout if @timeout # Timeout for a connection request = build_request(type, uri, options, api_ver) response = http.request(request) @@ -42,32 +56,62 @@ def rest_api(type, path, options = {}, api_ver = @api_version) raise e end - # Make a restful GET request to OneView - # Parameters & return value align with those of the {OneviewSDK::Rest::rest_api} method above + # Makes a restful GET request to OneView + # @param [String] path The path for the request. Usually starts with "/rest/" + # @param [Integer] api_ver The api version to use when interracting with this resource + # @return [NetHTTPResponse] Response object def rest_get(path, api_ver = @api_version) rest_api(:get, path, {}, api_ver) end - # Make a restful POST request to OneView - # Parameters & return value align with those of the {OneviewSDK::Rest::rest_api} method above + # Makes a restful POST request to OneView + # @param [String] path The path for the request. Usually starts with "/rest/" + # @param [Hash] options The options for the request + # @option options [String] :body Hash to be converted into json and set as the request body + # @option options [String] :Content-Type ('application/json') Set to nil or :none to have this option removed + # @option options [Integer] :X-API-Version (client.api_version) API version to use for this request + # @option options [Integer] :auth (client.token) Authentication token to use for this request + # @param [Integer] api_ver The api version to use when interracting with this resource + # @return [NetHTTPResponse] Response object def rest_post(path, options = {}, api_ver = @api_version) rest_api(:post, path, options, api_ver) end - # Make a restful PUT request to OneView - # Parameters & return value align with those of the {OneviewSDK::Rest::rest_api} method above + # Makes a restful PUT request to OneView + # @param [String] path The path for the request. Usually starts with "/rest/" + # @param [Hash] options The options for the request + # @option options [String] :body Hash to be converted into json and set as the request body + # @option options [String] :Content-Type ('application/json') Set to nil or :none to have this option removed + # @option options [Integer] :X-API-Version (client.api_version) API version to use for this request + # @option options [Integer] :auth (client.token) Authentication token to use for this request + # @param [Integer] api_ver The api version to use when interracting with this resource + # @return [NetHTTPResponse] Response object def rest_put(path, options = {}, api_ver = @api_version) rest_api(:put, path, options, api_ver) end - # Make a restful PATCH request to OneView - # Parameters & return value align with those of the {OneviewSDK::Rest::rest_api} method above + # Makes a restful PATCH request to OneView + # @param [String] path The path for the request. Usually starts with "/rest/" + # @param [Hash] options The options for the request + # @option options [String] :body Hash to be converted into json and set as the request body + # @option options [String] :Content-Type ('application/json') Set to nil or :none to have this option removed + # @option options [Integer] :X-API-Version (client.api_version) API version to use for this request + # @option options [Integer] :auth (client.token) Authentication token to use for this request + # @param [Integer] api_ver The api version to use when interracting with this resource + # @return [NetHTTPResponse] Response object def rest_patch(path, options = {}, api_ver = @api_version) rest_api(:patch, path, options, api_ver) end - # Make a restful DELETE request to OneView - # Parameters & return value align with those of the {OneviewSDK::Rest::rest_api} method above + # Makes a restful DELETE request to OneView + # @param [String] path The path for the request. Usually starts with "/rest/" + # @param [Hash] options The options for the request + # @option options [String] :body Hash to be converted into json and set as the request body + # @option options [String] :Content-Type ('application/json') Set to nil or :none to have this option removed + # @option options [Integer] :X-API-Version (client.api_version) API version to use for this request + # @option options [Integer] :auth (client.token) Authentication token to use for this request + # @param [Integer] api_ver The api version to use when interracting with this resource + # @return [NetHTTPResponse] Response object def rest_delete(path, options = {}, api_ver = @api_version) rest_api(:delete, path, options, api_ver) end @@ -80,12 +124,12 @@ def rest_delete(path, options = {}, api_ver = @api_version) RESPONSE_CODE_UNAUTHORIZED = 401 RESPONSE_CODE_NOT_FOUND = 404 - # Handle the response from a rest call. + # Handles the response from a rest call. # If an asynchronous task was started, this waits for it to complete. # @param [HTTPResponse] response HTTP response # @param [Boolean] wait_on_task Wait on task (or just return task details) - # @raise [RuntimeError] if the request failed - # @raise [RuntimeError] if a task was returned that did not complete successfully + # @raise [StandardError] if the request failed + # @raise [StandardError] if a task was returned that did not complete successfully # @return [Hash] The parsed JSON body def response_handler(response, wait_on_task = true) case response.code.to_i @@ -101,27 +145,28 @@ def response_handler(response, wait_on_task = true) when RESPONSE_CODE_ACCEPTED # Asynchronous add, update or delete return JSON.parse(response.body) unless wait_on_task @logger.debug "Waiting for task: response.header['location']" - task = wait_for(response.header['location']) + uri = response.header['location'] || JSON.parse(response.body)['uri'] # If task uri is not returned in header + task = wait_for(uri) return true unless task['associatedResource'] && task['associatedResource']['resourceUri'] resource_data = rest_get(task['associatedResource']['resourceUri']) return JSON.parse(resource_data.body) when RESPONSE_CODE_NO_CONTENT # Synchronous delete return {} when RESPONSE_CODE_BAD_REQUEST - fail "400 BAD REQUEST #{response.body}" + fail BadRequest, "400 BAD REQUEST #{response.body}" when RESPONSE_CODE_UNAUTHORIZED - fail "401 UNAUTHORIZED #{response.body}" + fail Unauthorized, "401 UNAUTHORIZED #{response.body}" when RESPONSE_CODE_NOT_FOUND - fail "404 NOT FOUND #{response.body}" + fail NotFound, "404 NOT FOUND #{response.body}" else - fail "#{response.code} #{response.body}" + fail RequestError, "#{response.code} #{response.body}" end end private - # Build a request object using the data given + # Builds a request object using the data given def build_request(type, uri, options, api_ver) case type.downcase.to_sym when :get @@ -135,7 +180,7 @@ def build_request(type, uri, options, api_ver) when :delete request = Net::HTTP::Delete.new(uri.request_uri) else - fail "Invalid rest call: #{type}" + fail InvalidRequest, "Invalid rest call: #{type}" end options['X-API-Version'] ||= api_ver diff --git a/lib/oneview-sdk/ssl_helper.rb b/lib/oneview-sdk/ssl_helper.rb index 69a3b5724..140212296 100644 --- a/lib/oneview-sdk/ssl_helper.rb +++ b/lib/oneview-sdk/ssl_helper.rb @@ -1,9 +1,20 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + require 'uri' require 'net/http' require 'openssl' module OneviewSDK - # SSL Certificate helper + # SSL certificate helper module SSLHelper CERT_STORE = File.join(Dir.home, '/.oneview-sdk-ruby/trusted_certs.cer') @@ -25,13 +36,13 @@ def self.load_trusted_certs nil end - # Check to see if a OneView instance's certificate is trusted - # @param [String] url URL of the OneView Instance to be added + # Check to see if the OneView instance's certificate is trusted + # @param [String] url URL for the OneView Instance to be added # @return [Boolean] Whether or not certificate is trusted - # @raise [RuntimeError] if the url is invalid + # @raise [OneviewSDK::InvalidURL] if the url is invalid def self.check_cert(url) uri = URI.parse(URI.escape(url)) - fail "Invalid url '#{url}'" unless uri.host + fail InvalidURL, "Invalid url '#{url}'" unless uri.host http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true if uri.scheme == 'https' trusted_certs = load_trusted_certs @@ -42,13 +53,13 @@ def self.check_cert(url) false end - # Fetch and add the ssl certificate of a OneView instance to the trusted certs store. + # Fetch and add the SSL certificate for the OneView instance to the trusted certs store. # Creates/modifies file at ~/.oneview-sdk-ruby/trusted_certs.cer - # @param [String] url URL of the OneView Instance to be added - # @raise [RuntimeError] if the url is invalid + # @param [String] url URL for the OneView Instance to be added + # @raise [OneviewSDK::InvalidURL] if the url is invalid def self.install_cert(url) uri = URI.parse(URI.escape(url)) - fail "Invalid url '#{url}'" unless uri.host + fail InvalidURL, "Invalid url '#{url}'" unless uri.host options = { use_ssl: true, verify_mode: OpenSSL::SSL::VERIFY_NONE } pem = Net::HTTP.start(uri.host, uri.port, options) do |http| http.peer_cert.to_pem diff --git a/lib/oneview-sdk/version.rb b/lib/oneview-sdk/version.rb index 356d3971f..b70f2a031 100644 --- a/lib/oneview-sdk/version.rb +++ b/lib/oneview-sdk/version.rb @@ -1,4 +1,15 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + # Gem version defined here module OneviewSDK - VERSION = '1.0.0'.freeze + VERSION = '2.0.0'.freeze end diff --git a/oneview-sdk.gemspec b/oneview-sdk.gemspec index 58ff14d2a..c855ba9b5 100644 --- a/oneview-sdk.gemspec +++ b/oneview-sdk.gemspec @@ -1,6 +1,17 @@ # coding: utf-8 # http://guides.rubygems.org/specification-reference +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + require_relative './lib/oneview-sdk/version' Gem::Specification.new do |spec| diff --git a/spec/integration/README.md b/spec/integration/README.md index be897e9e7..782f7c4ff 100644 --- a/spec/integration/README.md +++ b/spec/integration/README.md @@ -6,7 +6,7 @@ **The tests do their best cleanup after themselves, but know what they do before running them!** ## Setup -First, there's some setup you'll need to do. Do EITHER of the following: +First, there's some setup you'll need to do. Do **EITHER** of the following: 1. **Use environment variables to specify config file locations:** diff --git a/spec/integration/one_view_config.json.example b/spec/integration/one_view_config.json.example index 706b600d9..70943bd39 100644 --- a/spec/integration/one_view_config.json.example +++ b/spec/integration/one_view_config.json.example @@ -1,6 +1,5 @@ { "url" : "https://oneview.example.com", "user" : "Administrator", - "password" : "secret123", - "ssl_enabled" : false + "password" : "secret123" } diff --git a/spec/integration/one_view_secrets.json.example b/spec/integration/one_view_secrets.json.example index a648ad396..bdff1df16 100644 --- a/spec/integration/one_view_secrets.json.example +++ b/spec/integration/one_view_secrets.json.example @@ -4,5 +4,22 @@ "enclosure1_password": "dcs", "storage_system1_ip": "172.18.11.11", "storage_system1_user": "dcs", - "storage_system1_password": "dcs" + "storage_system1_password": "dcs", + "logical_switch1_ip": "172.19.1.11", + "logical_switch2_ip": "172.19.1.12", + "logical_switch_ssh_user": "dcs", + "logical_switch_ssh_password": "dcs", + "server_hardware_ip": "172.18.6.11", + "server_hardware_username": "dcs", + "server_hardware_password": "dcs", + "server_hardware2_ip": "172.18.6.12", + "server_hardware2_username": "dcs", + "server_hardware2_password": "dcs", + "rack_server_hardware_ip": "172.18.6.5", + "hp_ipdu_ip": "172.18.8.12", + "hp_ipdu_username": "dcs", + "hp_ipdu_password": "dcs", + "san_manager_ip": "172.18.15.1", + "san_manager_username": "dcs", + "san_manager_password": "dcs" } diff --git a/spec/integration/resource/connection_template/update_spec.rb b/spec/integration/resource/connection_template/update_spec.rb new file mode 100644 index 000000000..0280aee7e --- /dev/null +++ b/spec/integration/resource/connection_template/update_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::ConnectionTemplate, integration: true, type: UPDATE do + include_context 'integration context' + + describe '#get_default' do + it 'builds connection template' do + item = OneviewSDK::ConnectionTemplate.get_default($client) + expect(item).to be_a OneviewSDK::ConnectionTemplate + end + end + + describe '#update' do + it 'change bandwidth' do + item = OneviewSDK::ConnectionTemplate.find_by($client, {}).first + old_maximum = item['bandwidth']['maximumBandwidth'] + old_typical = item['bandwidth']['typicalBandwidth'] + item['bandwidth']['maximumBandwidth'] = old_maximum + 1000 + item['bandwidth']['typicalBandwidth'] = old_typical + 500 + item.update + expect(item['bandwidth']['maximumBandwidth']).to eq(old_maximum + 1000) + expect(item['bandwidth']['typicalBandwidth']).to eq(old_typical + 500) + end + end +end diff --git a/spec/integration/resource/datacenter/create_spec.rb b/spec/integration/resource/datacenter/create_spec.rb new file mode 100644 index 000000000..2845cfe4a --- /dev/null +++ b/spec/integration/resource/datacenter/create_spec.rb @@ -0,0 +1,69 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::Datacenter +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + describe '#add' do + it 'Add datacenter with default values' do + options = { + name: DATACENTER1_NAME, + width: 5000, + depth: 5000 + } + item = OneviewSDK::Datacenter.new($client, options) + item.add + expect(item['uri']).not_to be_empty + end + + it 'Add datacenter with specified properties' do + options = { + name: DATACENTER2_NAME, + width: 5000, + depth: 5000, + coolingCapacity: 5, + costPerKilowattHour: 0.10, + currency: 'USD', + deratingType: 'NaJp', + deratingPercentage: 20.0, + defaultPowerLineVoltage: 220, + coolingMultiplier: 1.5 + } + item = OneviewSDK::Datacenter.new($client, options) + item.add + expect(item['uri']).not_to be_empty + options.each do |key, value| + expect(item[key.to_s]).to eq(value) + end + end + + it 'Add datacenter including an existing rack' do + options = { + name: DATACENTER3_NAME, + width: 5000, + depth: 5000 + } + item = OneviewSDK::Datacenter.new($client, options) + item.add + expect(item['uri']).not_to be_empty + end + end + + describe '#get_visual_content' do + it 'Gets utilization data' do + item = OneviewSDK::Datacenter.find_by($client, name: DATACENTER1_NAME).first + expect { item.get_visual_content }.not_to raise_error + end + end +end diff --git a/spec/integration/resource/datacenter/delete_spec.rb b/spec/integration/resource/datacenter/delete_spec.rb new file mode 100644 index 000000000..9e0ff03c6 --- /dev/null +++ b/spec/integration/resource/datacenter/delete_spec.rb @@ -0,0 +1,28 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::Datacenter +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe '#remove' do + it 'removes the resource' do + datacenters = OneviewSDK::Datacenter.find_by($client, {}) + datacenters.each do |datacenter| + datacenter.remove if [DATACENTER1_NAME, DATACENTER2_NAME, DATACENTER3_NAME].include?(datacenter['name']) + end + datacenter_after_deletion = OneviewSDK::Datacenter.find_by($client, {}).map { |datacenter| datacenter['name'] } + [DATACENTER1_NAME, DATACENTER2_NAME, DATACENTER3_NAME].each { |name| expect(datacenter_after_deletion).not_to include(name) } + end + end +end diff --git a/spec/integration/resource/datacenter/update_spec.rb b/spec/integration/resource/datacenter/update_spec.rb new file mode 100644 index 000000000..a2e1d1c94 --- /dev/null +++ b/spec/integration/resource/datacenter/update_spec.rb @@ -0,0 +1,30 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +RSpec.describe OneviewSDK::Datacenter, integration: true, type: UPDATE do + include_context 'integration context' + + before :each do + @item = OneviewSDK::Datacenter.find_by($client, name: DATACENTER1_NAME).first + end + + describe '#update' do + it 'Changes name' do + @item.update(name: DATACENTER1_NAME_UPDATED) + expect(@item[:name]).to eq(DATACENTER1_NAME_UPDATED) + @item.refresh + @item.update(name: DATACENTER1_NAME) # Put it back to normal + expect(@item[:name]).to eq(DATACENTER1_NAME) + end + end +end diff --git a/spec/integration/resource/enclosure/create_spec.rb b/spec/integration/resource/enclosure/create_spec.rb index b70cadc26..2ae858eae 100644 --- a/spec/integration/resource/enclosure/create_spec.rb +++ b/spec/integration/resource/enclosure/create_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::Enclosure, integration: true, type: CREATE, sequence: 4 do +klass = OneviewSDK::Enclosure +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do include_context 'integration context' let(:enclosure_options) do @@ -13,11 +14,11 @@ } end - describe '#create' do + describe '#add' do it 'can add an enclosure' do item = OneviewSDK::Enclosure.new($client, enclosure_options) item.set_enclosure_group(OneviewSDK::EnclosureGroup.new($client, 'name' => ENC_GROUP2_NAME)) - item.create + item.add expect(item['uri']).not_to be_empty end end diff --git a/spec/integration/resource/enclosure/delete_spec.rb b/spec/integration/resource/enclosure/delete_spec.rb index 925230129..ea9f21b59 100644 --- a/spec/integration/resource/enclosure/delete_spec.rb +++ b/spec/integration/resource/enclosure/delete_spec.rb @@ -1,12 +1,13 @@ require 'spec_helper' -RSpec.describe OneviewSDK::Enclosure, integration: true, type: DELETE, sequence: 9 do +klass = OneviewSDK::Enclosure +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do include_context 'integration context' - describe '#delete' do - it 'deletes the resource' do + describe '#remove' do + it 'removes the resource' do item = OneviewSDK::Enclosure.find_by($client, 'name' => ENCL_NAME).first - item.delete + expect { item.remove }.not_to raise_error end end end diff --git a/spec/integration/resource/enclosure_group/create_spec.rb b/spec/integration/resource/enclosure_group/create_spec.rb index e020bda77..3ad369b58 100644 --- a/spec/integration/resource/enclosure_group/create_spec.rb +++ b/spec/integration/resource/enclosure_group/create_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::EnclosureGroup, integration: true, type: CREATE, sequence: 3 do +klass = OneviewSDK::EnclosureGroup +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do include_context 'integration context' let(:enclosure_group_options) do diff --git a/spec/integration/resource/enclosure_group/delete_spec.rb b/spec/integration/resource/enclosure_group/delete_spec.rb index 1c6290a35..ef2b5faa5 100644 --- a/spec/integration/resource/enclosure_group/delete_spec.rb +++ b/spec/integration/resource/enclosure_group/delete_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::EnclosureGroup, integration: true, type: DELETE, sequence: 10 do +klass = OneviewSDK::EnclosureGroup +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do include_context 'integration context' describe '#delete' do diff --git a/spec/integration/resource/ethernet_network/create_spec.rb b/spec/integration/resource/ethernet_network/create_spec.rb index 578574a99..4d9689033 100644 --- a/spec/integration/resource/ethernet_network/create_spec.rb +++ b/spec/integration/resource/ethernet_network/create_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::EthernetNetwork, integration: true, type: CREATE, sequence: 1 do +klass = OneviewSDK::EthernetNetwork +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do include_context 'integration context' let(:file_path) { 'spec/support/fixtures/integration/ethernet_network.json' } diff --git a/spec/integration/resource/ethernet_network/delete_spec.rb b/spec/integration/resource/ethernet_network/delete_spec.rb index 8c4839749..7b3a9aa59 100644 --- a/spec/integration/resource/ethernet_network/delete_spec.rb +++ b/spec/integration/resource/ethernet_network/delete_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::EthernetNetwork, integration: true, type: DELETE, sequence: 12 do +klass = OneviewSDK::EthernetNetwork +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do include_context 'integration context' describe '#delete' do diff --git a/spec/integration/resource/fabric/update_spec.rb b/spec/integration/resource/fabric/update_spec.rb new file mode 100644 index 000000000..bd856c4dd --- /dev/null +++ b/spec/integration/resource/fabric/update_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::Fabric, integration: true, type: UPDATE do + include_context 'integration context' + + describe 'GET' do + it 'by #find_by' do + item = OneviewSDK::Fabric.find_by($client, {}).first + expect(item).to be + end + + it 'by #retrieve!' do + item = OneviewSDK::Fabric.new($client, 'name' => DEFAULT_FABRIC_NAME) + expect { item.retrieve! }.to_not raise_error + expect(item['uri']).to be + end + end +end diff --git a/spec/integration/resource/fc_network/create_spec.rb b/spec/integration/resource/fc_network/create_spec.rb index 4ce3536ab..3a1286098 100644 --- a/spec/integration/resource/fc_network/create_spec.rb +++ b/spec/integration/resource/fc_network/create_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::FCNetwork, integration: true, type: CREATE, sequence: 1 do +klass = OneviewSDK::FCNetwork +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do include_context 'integration context' let(:file_path) { 'spec/support/fixtures/integration/fc_network.json' } diff --git a/spec/integration/resource/fc_network/delete_spec.rb b/spec/integration/resource/fc_network/delete_spec.rb index c0a55c265..fd9aca7ff 100644 --- a/spec/integration/resource/fc_network/delete_spec.rb +++ b/spec/integration/resource/fc_network/delete_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::FCNetwork, integration: true, type: DELETE, sequence: 12 do +klass = OneviewSDK::FCNetwork +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do include_context 'integration context' describe '#delete' do diff --git a/spec/integration/resource/fcoe_network/create_spec.rb b/spec/integration/resource/fcoe_network/create_spec.rb index dc0fa47c9..4b8986431 100644 --- a/spec/integration/resource/fcoe_network/create_spec.rb +++ b/spec/integration/resource/fcoe_network/create_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::FCoENetwork, integration: true, type: CREATE, sequence: 1 do +klass = OneviewSDK::FCoENetwork +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do include_context 'integration context' let(:file_path) { 'spec/support/fixtures/integration/fcoe_network.json' } diff --git a/spec/integration/resource/fcoe_network/delete_spec.rb b/spec/integration/resource/fcoe_network/delete_spec.rb index 573a7f5ad..e3809e7bc 100644 --- a/spec/integration/resource/fcoe_network/delete_spec.rb +++ b/spec/integration/resource/fcoe_network/delete_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::FCoENetwork, integration: true, type: DELETE, sequence: 12 do +klass = OneviewSDK::FCoENetwork +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do include_context 'integration context' describe '#delete' do diff --git a/spec/integration/resource/firmware_bundle/create_spec.rb b/spec/integration/resource/firmware_bundle/create_spec.rb new file mode 100644 index 000000000..f2c2c8bfc --- /dev/null +++ b/spec/integration/resource/firmware_bundle/create_spec.rb @@ -0,0 +1,26 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::FirmwareBundle +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + let(:bundle_path) { 'spec/support/hp-firmware-a1b08f8a6b-HPGH-1.1.i386.rpm' } + + describe '#self.upload' do + it 'Upload hotfix' do + item = OneviewSDK::FirmwareBundle.add($client, bundle_path) + expect(item['uri']).to be + end + end +end diff --git a/spec/integration/resource/firmware_driver/create_spec.rb b/spec/integration/resource/firmware_driver/create_spec.rb new file mode 100644 index 000000000..80ca3e96f --- /dev/null +++ b/spec/integration/resource/firmware_driver/create_spec.rb @@ -0,0 +1,35 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::FirmwareDriver +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + describe '#create' do + it 'Create custom spp' do + spp = OneviewSDK::FirmwareDriver.find_by($client, state: 'Created', bundleType: 'SPP').first + hotfix = OneviewSDK::FirmwareDriver.find_by($client, state: 'Created', bundleType: 'Hotfix').first + expect(spp['uri']).to be + expect(hotfix['uri']).to be + custom = OneviewSDK::FirmwareDriver.new($client) + custom['baselineUri'] = spp['uri'] + custom['hotfixUris'] = [ + hotfix['uri'] + ] + custom['customBaselineName'] = FIRMWARE_DRIVER1_NAME + expect { custom.create }.not_to raise_error + expect(custom['uri']).to be + end + end + +end diff --git a/spec/integration/resource/firmware_driver/delete_spec.rb b/spec/integration/resource/firmware_driver/delete_spec.rb new file mode 100644 index 000000000..45f3353b4 --- /dev/null +++ b/spec/integration/resource/firmware_driver/delete_spec.rb @@ -0,0 +1,31 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::FirmwareDriver +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe '#remove' do + it 'deletes the resource' do + firmware = OneviewSDK::FirmwareDriver.new($client, name: FIRMWARE_DRIVER1_NAME) + firmware.retrieve! + expect { firmware.remove }.not_to raise_error + end + + it 'deletes other drivers' do + OneviewSDK::FirmwareDriver.find_by($client, {}).each do |driver| + expect { driver.remove }.not_to raise_error + end + end + end +end diff --git a/spec/integration/resource/interconnect/create_spec.rb b/spec/integration/resource/interconnect/create_spec.rb index 3fef41d55..55dade9ad 100644 --- a/spec/integration/resource/interconnect/create_spec.rb +++ b/spec/integration/resource/interconnect/create_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' -RSpec.describe OneviewSDK::Interconnect, integration: true, type: CREATE, sequence: 6 do - include_context 'integration context' - +klass = OneviewSDK::Interconnect +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do # Cannot create individually end diff --git a/spec/integration/resource/interconnect/delete_spec.rb b/spec/integration/resource/interconnect/delete_spec.rb index 07808e67c..baadd99f6 100644 --- a/spec/integration/resource/interconnect/delete_spec.rb +++ b/spec/integration/resource/interconnect/delete_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' -RSpec.describe OneviewSDK::Interconnect, integration: true, type: DELETE, sequence: 7 do - include_context 'integration context' - +klass = OneviewSDK::Interconnect +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do # Cannot delete individually end diff --git a/spec/integration/resource/interconnect/update_spec.rb b/spec/integration/resource/interconnect/update_spec.rb index fde42d9cd..e0b96f6a6 100644 --- a/spec/integration/resource/interconnect/update_spec.rb +++ b/spec/integration/resource/interconnect/update_spec.rb @@ -46,7 +46,7 @@ end end - describe '#update_attribute' do + describe '#patch' do it 'is a pending example' end end diff --git a/spec/integration/resource/logical_downlink/create_spec.rb b/spec/integration/resource/logical_downlink/create_spec.rb new file mode 100644 index 000000000..de232fc8d --- /dev/null +++ b/spec/integration/resource/logical_downlink/create_spec.rb @@ -0,0 +1,32 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::LogicalDownlink +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + describe '#get_without_ethernet' do + it 'can get and build logical downlinks without ethernet networks' do + item = OneviewSDK::LogicalDownlink.find_by($client, {}).first + logical_downlink_without_ethernet = item.get_without_ethernet + expect(logical_downlink_without_ethernet.class).to eq(described_class) + end + end + + describe '#self.get_without_ethernet' do + it 'can get and build logical downlinks for a logical downlink without ethernet networks' do + logical_downlinks = OneviewSDK::LogicalDownlink.get_without_ethernet($client) + expect(logical_downlinks.first.class).to eq(described_class) + end + end +end diff --git a/spec/integration/resource/logical_enclosure/create_spec.rb b/spec/integration/resource/logical_enclosure/create_spec.rb index 1d1073e16..c643c3003 100644 --- a/spec/integration/resource/logical_enclosure/create_spec.rb +++ b/spec/integration/resource/logical_enclosure/create_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::LogicalEnclosure, integration: true, type: CREATE, sequence: 5 do +klass = OneviewSDK::LogicalEnclosure +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do include_context 'integration context' it 'is a pending example' diff --git a/spec/integration/resource/logical_enclosure/delete_spec.rb b/spec/integration/resource/logical_enclosure/delete_spec.rb index 81427fb5e..5c9ceeba1 100644 --- a/spec/integration/resource/logical_enclosure/delete_spec.rb +++ b/spec/integration/resource/logical_enclosure/delete_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::LogicalEnclosure, integration: true, type: DELETE, sequence: 8 do +klass = OneviewSDK::LogicalEnclosure +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do include_context 'integration context' it 'is a pending example' diff --git a/spec/integration/resource/logical_interconnect/create_spec.rb b/spec/integration/resource/logical_interconnect/create_spec.rb index bbccf1122..6a632372c 100644 --- a/spec/integration/resource/logical_interconnect/create_spec.rb +++ b/spec/integration/resource/logical_interconnect/create_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' -RSpec.describe OneviewSDK::LogicalInterconnect, integration: true, type: CREATE, sequence: 7 do - include_context 'integration context' - +klass = OneviewSDK::LogicalInterconnect +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do # Cannot create individually end diff --git a/spec/integration/resource/logical_interconnect/delete_spec.rb b/spec/integration/resource/logical_interconnect/delete_spec.rb index 84c96db1e..6f6e3e8ee 100644 --- a/spec/integration/resource/logical_interconnect/delete_spec.rb +++ b/spec/integration/resource/logical_interconnect/delete_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' -RSpec.describe OneviewSDK::LogicalInterconnect, integration: true, type: DELETE, sequence: 6 do - include_context 'integration context' - +klass = OneviewSDK::LogicalInterconnect +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do # Cannot delete individually end diff --git a/spec/integration/resource/logical_interconnect/update_spec.rb b/spec/integration/resource/logical_interconnect/update_spec.rb index 683bf5e06..68d366989 100644 --- a/spec/integration/resource/logical_interconnect/update_spec.rb +++ b/spec/integration/resource/logical_interconnect/update_spec.rb @@ -71,7 +71,7 @@ vlans = log_int.list_vlan_networks expect(vlans.any?).to be vlans.each do |net| - expect(net[:name]).to eq(ETH_NET_NAME) + expect([ETH_NET_NAME, FC_NET_NAME]).to include(net[:name]) end end diff --git a/spec/integration/resource/logical_interconnect_group/create_spec.rb b/spec/integration/resource/logical_interconnect_group/create_spec.rb index c62c713c6..a85808057 100644 --- a/spec/integration/resource/logical_interconnect_group/create_spec.rb +++ b/spec/integration/resource/logical_interconnect_group/create_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::LogicalInterconnectGroup, integration: true, type: CREATE, sequence: 2 do +klass = OneviewSDK::LogicalInterconnectGroup +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do include_context 'integration context' before :all do @@ -25,15 +26,22 @@ } @item_3 = OneviewSDK::LogicalInterconnectGroup.new($client, lig_default_options_3) - uplink_options = { + eth_uplink_options = { name: LIG_UPLINK_SET_NAME, networkType: 'Ethernet', ethernetNetworkType: 'Tagged' } - @lig_uplink_set = OneviewSDK::LIGUplinkSet.new($client, uplink_options) - + @eth_lig_uplink_set = OneviewSDK::LIGUplinkSet.new($client, eth_uplink_options) @ethernet_network = OneviewSDK::EthernetNetwork.new($client, name: ETH_NET_NAME) @ethernet_network.retrieve! + + fc_uplink_options = { + name: LIG_UPLINK_SET2_NAME, + networkType: 'FibreChannel' + } + @fc_lig_uplink_set = OneviewSDK::LIGUplinkSet.new($client, fc_uplink_options) + @fc_network = OneviewSDK::FCNetwork.new($client, name: FC_NET_NAME) + @fc_network.retrieve! end let(:interconnect_type) { 'HP VC FlexFabric 10Gb/24-Port Module' } @@ -49,12 +57,19 @@ expect { @item.add_interconnect(1, 'invalid_type') }.to raise_error(/Interconnect type invalid_type/) end - it 'LIG with interconnect and uplink set' do - @lig_uplink_set.add_network(@ethernet_network) - @lig_uplink_set.add_uplink(1, 'X1') - @lig_uplink_set.add_uplink(1, 'X2') + it 'LIG with interconnect and uplink sets' do @item.add_interconnect(1, interconnect_type) - @item.add_uplink_set(@lig_uplink_set) + + @eth_lig_uplink_set.add_network(@ethernet_network) + @eth_lig_uplink_set.add_uplink(1, 'X1') + @eth_lig_uplink_set.add_uplink(1, 'X2') + @item.add_uplink_set(@eth_lig_uplink_set) + + @fc_lig_uplink_set.add_network(@fc_network) + @fc_lig_uplink_set.add_uplink(1, 'X3') + @fc_lig_uplink_set.add_uplink(1, 'X4') + @item.add_uplink_set(@fc_lig_uplink_set) + expect { @item.create }.not_to raise_error expect(@item['uri']).to be expect(@item['uplinkSets']).to_not be_empty diff --git a/spec/integration/resource/logical_interconnect_group/delete_spec.rb b/spec/integration/resource/logical_interconnect_group/delete_spec.rb index b30318196..34947ddfa 100644 --- a/spec/integration/resource/logical_interconnect_group/delete_spec.rb +++ b/spec/integration/resource/logical_interconnect_group/delete_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::LogicalInterconnectGroup, integration: true, type: DELETE, sequence: 11 do +klass = OneviewSDK::LogicalInterconnectGroup +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do include_context 'integration context' before :all do diff --git a/spec/integration/resource/logical_switch/create_spec.rb b/spec/integration/resource/logical_switch/create_spec.rb new file mode 100644 index 000000000..8a4681590 --- /dev/null +++ b/spec/integration/resource/logical_switch/create_spec.rb @@ -0,0 +1,33 @@ +require 'spec_helper' + +klass = OneviewSDK::LogicalSwitch +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + before :all do + @item = OneviewSDK::LogicalSwitch.new($client, name: LOG_SWI_NAME) + end + + describe '#create' do + it 'Logical switch create' do + ssh_credentials = OneviewSDK::LogicalSwitch::CredentialsSSH.new($secrets['logical_switch_ssh_user'], $secrets['logical_switch_ssh_password']) + snmp_v1 = OneviewSDK::LogicalSwitch::CredentialsSNMPV1.new(161, 'public') + logical_switch_group = OneviewSDK::LogicalSwitchGroup.new($client, name: LOG_SWI_GROUP_NAME) + logical_switch_group.retrieve! + @item.set_logical_switch_group(logical_switch_group) + @item.set_switch_credentials($secrets['logical_switch1_ip'], ssh_credentials, snmp_v1) + @item.set_switch_credentials($secrets['logical_switch2_ip'], ssh_credentials, snmp_v1) + @item.create + expect(@item['uri']).to be + end + end + + describe '#retrieve!' do + it 'retrieves the objects' do + @item = OneviewSDK::LogicalSwitch.new($client, name: LOG_SWI_NAME) + @item.retrieve! + expect(@item['uri']).to be + end + end + +end diff --git a/spec/integration/resource/logical_switch/delete_spec.rb b/spec/integration/resource/logical_switch/delete_spec.rb new file mode 100644 index 000000000..636d13a62 --- /dev/null +++ b/spec/integration/resource/logical_switch/delete_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +klass = OneviewSDK::LogicalSwitch +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + before :all do + @item = OneviewSDK::LogicalSwitch.new($client, name: LOG_SWI_NAME) + @item.retrieve! + end + + describe '#delete' do + it 'removes Logical Switch' do + expect { @item.delete }.to_not raise_error + end + end +end diff --git a/spec/integration/resource/logical_switch/update_spec.rb b/spec/integration/resource/logical_switch/update_spec.rb new file mode 100644 index 000000000..8256478a2 --- /dev/null +++ b/spec/integration/resource/logical_switch/update_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::LogicalSwitch, integration: true, type: UPDATE do + include_context 'integration context' + + before :all do + @item = OneviewSDK::LogicalSwitch.new($client, name: LOG_SWI_NAME) + @item.retrieve! + end + + describe '#refresh' do + it 'refresh logical switch' do + @item.refresh + end + end +end diff --git a/spec/integration/resource/logical_switch_group/create_spec.rb b/spec/integration/resource/logical_switch_group/create_spec.rb new file mode 100644 index 000000000..e3bb64940 --- /dev/null +++ b/spec/integration/resource/logical_switch_group/create_spec.rb @@ -0,0 +1,31 @@ +require 'spec_helper' + +klass = OneviewSDK::LogicalSwitchGroup +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + before :all do + @item = OneviewSDK::LogicalSwitchGroup.new($client, name: LOG_SWI_GROUP_NAME) + @type = 'Cisco Nexus 55xx' + end + + describe '#create' do + it 'LSG with unrecognized interconnect' do + expect { @item.set_grouping_parameters(1, 'invalid_type') }.to raise_error(/Switch type invalid_type/) + end + + it 'LSG with two switches' do + @item.set_grouping_parameters(2, @type) + expect { @item.create }.to_not raise_error + end + end + + describe '#retrieve!' do + it 'retrieves the objects' do + @item = OneviewSDK::LogicalSwitchGroup.new($client, name: LOG_SWI_GROUP_NAME) + @item.retrieve! + expect(@item['uri']).to be + end + end + +end diff --git a/spec/integration/resource/logical_switch_group/delete_spec.rb b/spec/integration/resource/logical_switch_group/delete_spec.rb new file mode 100644 index 000000000..2a268acf6 --- /dev/null +++ b/spec/integration/resource/logical_switch_group/delete_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +klass = OneviewSDK::LogicalSwitchGroup +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + before :all do + @item = OneviewSDK::LogicalSwitchGroup.new($client, name: LOG_SWI_GROUP_NAME) + @item.retrieve! + end + + describe '#delete' do + it 'removes all the Logical Switch groups' do + expect { @item.delete }.to_not raise_error + end + end +end diff --git a/spec/integration/resource/logical_switch_group/update_spec.rb b/spec/integration/resource/logical_switch_group/update_spec.rb new file mode 100644 index 000000000..0419a0965 --- /dev/null +++ b/spec/integration/resource/logical_switch_group/update_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::LogicalSwitchGroup, integration: true, type: UPDATE do + include_context 'integration context' + + describe '#update' do + it 'renaming the Logical Switch Group' do + item = OneviewSDK::LogicalSwitchGroup.new($client, name: LOG_SWI_GROUP_NAME) + item.retrieve! + expect { item.update(name: LOG_SWI_GROUP_NAME_UPDATED) }.not_to raise_error + item.retrieve! + expect(item['uri']).to be + expect(item['name']).to eq(LOG_SWI_GROUP_NAME_UPDATED) + expect { item.update(name: LOG_SWI_GROUP_NAME) }.not_to raise_error + item.retrieve! + expect(item['uri']).to be + expect(item['name']).to eq(LOG_SWI_GROUP_NAME) + end + end +end diff --git a/spec/integration/resource/managed_san/create_spec.rb b/spec/integration/resource/managed_san/create_spec.rb new file mode 100644 index 000000000..9f53c7e9b --- /dev/null +++ b/spec/integration/resource/managed_san/create_spec.rb @@ -0,0 +1,38 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::ManagedSAN +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + let(:fc_options) do + { + connectionTemplateUri: nil, + autoLoginRedistribution: true, + fabricType: 'FabricAttach' + } + end + + describe 'Import SANs' do + it 'create fc networks' do + OneviewSDK::ManagedSAN.find_by($client, deviceManagerName: $secrets['san_manager_ip']).each do |san| + options = fc_options + options[:name] = "FC_#{san['name']}" + options[:managedSanUri] = san['uri'] + fc = OneviewSDK::FCNetwork.new($client, options) + fc.create + expect(fc['uri']).to be + end + end + end +end diff --git a/spec/integration/resource/managed_san/delete_spec.rb b/spec/integration/resource/managed_san/delete_spec.rb new file mode 100644 index 000000000..15647c241 --- /dev/null +++ b/spec/integration/resource/managed_san/delete_spec.rb @@ -0,0 +1,27 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::ManagedSAN +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe 'Remove FC Networks' do + it 'Remove' do + OneviewSDK::ManagedSAN.find_by($client, deviceManagerName: $secrets['san_manager_ip']).each do |san| + fc = OneviewSDK::FCNetwork.new($client, name: "FC_#{san['name']}") + fc.retrieve! + fc.delete + end + end + end +end diff --git a/spec/integration/resource/managed_san/update_spec.rb b/spec/integration/resource/managed_san/update_spec.rb new file mode 100644 index 000000000..1b2399cdd --- /dev/null +++ b/spec/integration/resource/managed_san/update_spec.rb @@ -0,0 +1,82 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +RSpec.describe OneviewSDK::ManagedSAN, integration: true, type: UPDATE do + include_context 'integration context' + + before :each do + @item = OneviewSDK::ManagedSAN.find_by($client, state: 'Managed').first + end + + describe 'Check if SANs were imported' do + it 'check if SAN was imported' do + OneviewSDK::ManagedSAN.find_by($client, deviceManagerName: $secrets['san_manager_ip']).each do |san| + expect(san['state']).to eq('Managed') + end + end + end + + describe '#get_endpoints' do + it 'Refresh' do + expect { @item.get_endpoints }.not_to raise_error + end + end + + describe '#set_refresh_state' do + it 'Refresh SAN' do + expect { @item.set_refresh_state('RefreshPending') }.not_to raise_error + end + end + + describe '#set_public_attributes' do + it 'Update public attributes' do + attributes = [ + { + 'name' => 'MetaSan', + 'value' => 'Neon SAN', + 'valueType' => 'String', + 'valueFormat' => 'None', + 'displayName' => nil, + 'required' => false + } + ] + expect { @item.set_public_attributes(attributes) }.not_to raise_error + expect(@item['publicAttributes']).to eq(attributes) + end + end + + describe '#set_san_policy' do + it 'Update san policy' do + policy = { + zoningPolicy: 'SingleInitiatorAllTargets', + zoneNameFormat: '{hostName}_{initiatorWwn}', + enableAliasing: true, + initiatorNameFormat: '{hostName}_{initiatorWwn}', + targetNameFormat: '{storageSystemName}_{targetName}', + targetGroupNameFormat: '{storageSystemName}_{targetGroupName}' + } + expect { @item.set_san_policy(policy) }.not_to raise_error + @item.refresh + item_policy = @item['sanPolicy'] + policy.each do |key, value| + expect(value).to eq(item_policy[key.to_s]) + end + end + end + + describe '#get_zoning_report' do + it 'Get issues' do + expect { @item.get_zoning_report }.not_to raise_error + end + end +end diff --git a/spec/integration/resource/network_set/create_spec.rb b/spec/integration/resource/network_set/create_spec.rb new file mode 100644 index 000000000..cff2cbb02 --- /dev/null +++ b/spec/integration/resource/network_set/create_spec.rb @@ -0,0 +1,50 @@ +require 'spec_helper' + +klass = OneviewSDK::NetworkSet +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + describe '#create' do + it 'network set withoutEthernet' do + item = OneviewSDK::NetworkSet.new($client) + item['name'] = NETWORK_SET1_NAME + item.create + expect(item['uri']).to_not eq(nil) + end + + it 'network set with ethernet network' do + eth1 = OneviewSDK::EthernetNetwork.find_by($client, {}).first + item = OneviewSDK::NetworkSet.new($client) + item['name'] = NETWORK_SET2_NAME + item.add_ethernet_network(eth1) + item.create + expect(item['uri']).to_not eq(nil) + expect(item['networkUris']).to include(eth1['uri']) + end + + it 'network set with multiple ethernet networks' do + eth1 = OneviewSDK::EthernetNetwork.find_by($client, {}).first + eth2 = OneviewSDK::EthernetNetwork.find_by($client, {}).last + item = OneviewSDK::NetworkSet.new($client) + item['name'] = NETWORK_SET3_NAME + item.add_ethernet_network(eth1) + item.add_ethernet_network(eth2) + item.create + expect(item['uri']).to_not eq(nil) + expect(item['networkUris']).to include(eth1['uri']) + expect(item['networkUris']).to include(eth2['uri']) + end + + it 'network set with native network' do + eth1 = OneviewSDK::EthernetNetwork.find_by($client, {}).first + item = OneviewSDK::NetworkSet.new($client) + item['name'] = NETWORK_SET4_NAME + item.set_native_network(eth1) + item.create + expect(item['uri']).to_not eq(nil) + expect(item['nativeNetworkUri']).to include(eth1['uri']) + end + + end + +end diff --git a/spec/integration/resource/network_set/delete_spec.rb b/spec/integration/resource/network_set/delete_spec.rb new file mode 100644 index 000000000..4fb25f00e --- /dev/null +++ b/spec/integration/resource/network_set/delete_spec.rb @@ -0,0 +1,33 @@ +require 'spec_helper' + +klass = OneviewSDK::NetworkSet +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe '#delete' do + it 'network set 1' do + item = OneviewSDK::NetworkSet.new($client, name: NETWORK_SET1_NAME) + item.retrieve! + item.delete + end + + it 'network set 2' do + item = OneviewSDK::NetworkSet.new($client, name: NETWORK_SET2_NAME) + item.retrieve! + item.delete + end + + it 'network set 3' do + item = OneviewSDK::NetworkSet.new($client, name: NETWORK_SET3_NAME) + item.retrieve! + item.delete + end + + it 'network set 4' do + item = OneviewSDK::NetworkSet.new($client, name: NETWORK_SET4_NAME) + item.retrieve! + item.delete + end + + end +end diff --git a/spec/integration/resource/network_set/update_spec.rb b/spec/integration/resource/network_set/update_spec.rb new file mode 100644 index 000000000..fcb66e3e6 --- /dev/null +++ b/spec/integration/resource/network_set/update_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::NetworkSet, integration: true, type: UPDATE, sequence: 2 do + include_context 'integration context' + + describe '#get_without_ethernet' do + it 'instance' do + item = OneviewSDK::NetworkSet.new($client, name: NETWORK_SET3_NAME) + item.retrieve! + item_without_networks = item.get_without_ethernet + expect(item_without_networks['networkUris']).to eq([]) + end + + it 'class' do + OneviewSDK::NetworkSet.get_without_ethernet($client)['members'].each do |network_set| + expect(network_set['networkUris']).to eq([]) + end + end + end + +end diff --git a/spec/integration/resource/power_device/create_spec.rb b/spec/integration/resource/power_device/create_spec.rb new file mode 100644 index 000000000..cc89f2b41 --- /dev/null +++ b/spec/integration/resource/power_device/create_spec.rb @@ -0,0 +1,45 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::PowerDevice +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + describe '#add' do + it 'can add a power device with default values' do + item = OneviewSDK::PowerDevice.new($client, name: POW_DEVICE1_NAME, ratedCapacity: 500) + item.add + expect(item['uri']).not_to be_empty + end + end + + describe '#discover' do + it 'can discover an HP iPDU' do + options = { + username: $secrets['hp_ipdu_username'], + password: $secrets['hp_ipdu_password'], + hostname: $secrets['hp_ipdu_ip'] + } + + ipdu = OneviewSDK::PowerDevice.discover($client, options) + expect(ipdu['uri']).not_to be_empty + end + end + + describe '#utilization' do + it 'Gets utilization data' do + item = OneviewSDK::PowerDevice.find_by($client, {}).first + expect { item.utilization }.not_to raise_error + end + end +end diff --git a/spec/integration/resource/power_device/delete_spec.rb b/spec/integration/resource/power_device/delete_spec.rb new file mode 100644 index 000000000..b4f6c0ea1 --- /dev/null +++ b/spec/integration/resource/power_device/delete_spec.rb @@ -0,0 +1,34 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::PowerDevice +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe '#remove' do + before :all do + @power_device_1 = OneviewSDK::PowerDevice.new($client, name: POW_DEVICE1_NAME) + @power_device_1.retrieve! + ipdu_list = OneviewSDK::PowerDevice.find_by($client, 'managedBy' => { 'hostName' => $secrets['hp_ipdu_ip'] }) + @power_device_2 = ipdu_list.reject { |ipdu| ipdu['managedBy']['id'] == ipdu['id'] }.first + end + + it 'remove Power device 1' do + expect { @power_device_1.remove }.to_not raise_error + end + + it 'remove Power device 2' do + expect { @power_device_2.remove }.to_not raise_error + end + end +end diff --git a/spec/integration/resource/power_device/update_spec.rb b/spec/integration/resource/power_device/update_spec.rb new file mode 100644 index 000000000..6eeae5ac1 --- /dev/null +++ b/spec/integration/resource/power_device/update_spec.rb @@ -0,0 +1,59 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +require 'spec_helper' + +RSpec.describe OneviewSDK::PowerDevice, integration: true, type: UPDATE do + include_context 'integration context' + + before :all do + @ipdu_list = OneviewSDK::PowerDevice.find_by($client, 'managedBy' => { 'hostName' => $secrets['hp_ipdu_ip'] }) + @item = @ipdu_list.reject { |ipdu| ipdu['managedBy']['id'] == ipdu['id'] }.first + end + + describe '#update' do + it 'Change name' do + name = @item['name'] + @item.update(name: 'PowerDevice_Name_Updated') + expect(@item['name']).to eq('PowerDevice_Name_Updated') + @item.refresh + @item.update(name: name) + end + end + + describe '#set_refresh_state' do + it 'Refresh without changing credentials' do + expect { @item.set_refresh_state(refreshState: 'RefreshPending') }.not_to raise_error + end + + it 'Refresh with new credentials' do + options = { + refreshState: 'RefreshPending', + username: $secrets['hp_ipdu_username'], + password: $secrets['hp_ipdu_password'] + } + expect { @item.set_refresh_state(options) }.not_to raise_error + end + end + + describe '#set_power_state' do + it 'On|off state on a device that supports this operation' do + power_device = @ipdu_list.reject { |ipdu| ipdu['model'] != 'Managed Ext. Bar Outlet' }.first + expect { power_device.set_power_state('On') }.not_to raise_error + end + end + + describe '#set_uid_state' do + it 'On|off' do + expect { @item.set_uid_state('On') }.not_to raise_error + end + end +end diff --git a/spec/integration/resource/rack/create_spec.rb b/spec/integration/resource/rack/create_spec.rb new file mode 100644 index 000000000..ed5d3fd8c --- /dev/null +++ b/spec/integration/resource/rack/create_spec.rb @@ -0,0 +1,57 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::Rack +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + describe '#add' do + it 'Add empty rack' do + item = OneviewSDK::Rack.new($client, name: RACK1_NAME) + item.add + expect(item['name']).to eq(RACK1_NAME) + expect(item['uri']).not_to be_empty + end + + it 'Add rack with custom size and mounted enclosure' do + server_hardware = OneviewSDK::ServerHardware.new($client, name: $secrets['rack_server_hardware_ip']) + server_hardware.retrieve! + + item = OneviewSDK::Rack.new($client, name: RACK2_NAME) + item['depth'] = 1500 + item['width'] = 1200 + item['height'] = 2500 + + item.add_rack_resource(server_hardware, topUSlot: 20, uHeight: 10) + item.add + + expect(item['uri']).not_to be_empty + expect(item['depth']).to eq(1500) + expect(item['width']).to eq(1200) + expect(item['height']).to eq(2500) + + server_hardware_mount = item['rackMounts'].find { |resource_from_rack| resource_from_rack['mountUri'] == server_hardware['uri'] } + expect(server_hardware_mount['mountUri']).to eq(server_hardware['uri']) + expect(server_hardware_mount['topUSlot']).to eq(20) + expect(server_hardware_mount['uHeight']).to eq(10) + end + end + + describe '#get_device_topology' do + it 'Retrieve device topology' do + item = OneviewSDK::Rack.new($client, name: RACK2_NAME) + item.retrieve! + expect { item.get_device_topology }.not_to raise_error + end + end +end diff --git a/spec/integration/resource/rack/delete_spec.rb b/spec/integration/resource/rack/delete_spec.rb new file mode 100644 index 000000000..120dcdac5 --- /dev/null +++ b/spec/integration/resource/rack/delete_spec.rb @@ -0,0 +1,31 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::Rack +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe '#remove' do + it 'Rack_1' do + item = OneviewSDK::Rack.new($client, name: RACK1_NAME) + item.retrieve! + expect { item.remove }.not_to raise_error + end + + it 'Rack_2' do + item = OneviewSDK::Rack.new($client, name: RACK2_NAME) + item.retrieve! + expect { item.remove }.not_to raise_error + end + end +end diff --git a/spec/integration/resource/rack/update_spec.rb b/spec/integration/resource/rack/update_spec.rb new file mode 100644 index 000000000..a5c7328c2 --- /dev/null +++ b/spec/integration/resource/rack/update_spec.rb @@ -0,0 +1,25 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +RSpec.describe OneviewSDK::Rack, integration: true, type: UPDATE do + include_context 'integration context' + + describe '#update' do + it 'updates depth' do + item = OneviewSDK::Rack.new($client, name: RACK1_NAME) + item.retrieve! + item.update(depth: 1300) + expect(item['depth']).to eq(1300) + end + end +end diff --git a/spec/integration/resource/san_manager/create_spec.rb b/spec/integration/resource/san_manager/create_spec.rb new file mode 100644 index 000000000..eb597ea90 --- /dev/null +++ b/spec/integration/resource/san_manager/create_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' + +klass = OneviewSDK::SANManager +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + describe '#create' do + it 'can create resources' do + item = OneviewSDK::SANManager.new($client) + item['providerDisplayName'] = SAN_PROVIDER1_NAME + item['connectionInfo'] = [ + { + 'name' => 'Host', + 'value' => $secrets['san_manager_ip'] + }, + { + 'name' => 'Port', + 'value' => 5989 + }, + { + 'name' => 'Username', + 'value' => $secrets['san_manager_username'] + }, + { + 'name' => 'Password', + 'value' => $secrets['san_manager_password'] + }, + { + 'name' => 'UseSsl', + 'value' => true + } + ] + expect { item.add }.not_to raise_error + expect(item['uri']).to be + end + end + + describe '#self.get_default_connection_info' do + it 'Retrieve connection info for provider' do + expect { OneviewSDK::SANManager.get_default_connection_info($client, SAN_PROVIDER1_NAME) }.to_not raise_error + end + end +end diff --git a/spec/integration/resource/san_manager/delete_spec.rb b/spec/integration/resource/san_manager/delete_spec.rb new file mode 100644 index 000000000..abc4bc404 --- /dev/null +++ b/spec/integration/resource/san_manager/delete_spec.rb @@ -0,0 +1,25 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +klass = OneviewSDK::SANManager +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe '#remove' do + it 'Brocade Network Advisor' do + item = OneviewSDK::SANManager.new($client, name: $secrets['san_manager_ip']) + item.retrieve! + expect { item.remove }.not_to raise_error + end + end +end diff --git a/spec/integration/resource/san_manager/update_spec.rb b/spec/integration/resource/san_manager/update_spec.rb new file mode 100644 index 000000000..3bde5cde4 --- /dev/null +++ b/spec/integration/resource/san_manager/update_spec.rb @@ -0,0 +1,38 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::SANManager, integration: true, type: UPDATE do + include_context 'integration context' + + before :each do + @item = OneviewSDK::SANManager.new($client, name: $secrets['san_manager_ip']) + @item.retrieve! + end + + describe '#update' do + it 'refresh a SAN Device Manager' do + expect { @item.update(refreshState: 'RefreshPending') }.not_to raise_error + end + + it 'Update hostname and credentials' do + connection_info = [ + { + 'name' => 'Host', + 'value' => $secrets['san_manager_ip'] + }, + { + 'name' => 'Username', + 'value' => $secrets['san_manager_username'] + }, + { + 'name' => 'Password', + 'value' => $secrets['san_manager_password'] + } + ] + expect { @item.update(connectionInfo: connection_info) }.not_to raise_error + end + + it 'Update invalid field' do + expect { @item.update(name: 'SANManager_01') }.to raise_error(OneviewSDK::BadRequest) + end + end +end diff --git a/spec/integration/resource/server_hardware/create_spec.rb b/spec/integration/resource/server_hardware/create_spec.rb new file mode 100644 index 000000000..a8bde8a55 --- /dev/null +++ b/spec/integration/resource/server_hardware/create_spec.rb @@ -0,0 +1,64 @@ +require 'spec_helper' + +klass = OneviewSDK::ServerHardware +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + describe '#add' do + it 'can create resources' do + options = { + hostname: $secrets['server_hardware_ip'], + username: $secrets['server_hardware_username'], + password: $secrets['server_hardware_password'], + name: 'test', + licensingIntent: 'OneView' + } + + item = OneviewSDK::ServerHardware.new($client, options) + expect { item.add }.to_not raise_error + end + end + + describe '#get_bios' do + it 'Get list of bios\UEFI values' do + item = OneviewSDK::ServerHardware.find_by($client, name: $secrets['server_hardware_ip']).first + expect { item.get_bios }.not_to raise_error + end + end + + describe '#get_ilo_sso_url' do + it 'Get a url to the iLO web interface' do + item = OneviewSDK::ServerHardware.find_by($client, name: $secrets['server_hardware_ip']).first + expect { item.get_ilo_sso_url }.not_to raise_error + end + end + + describe '#get_java_remote_sso_url' do + it 'Single Sign-On session for the Java Applet console' do + item = OneviewSDK::ServerHardware.find_by($client, name: $secrets['server_hardware_ip']).first + expect { item.get_java_remote_sso_url }.not_to raise_error + end + end + + describe '#get_remote_console_url' do + it 'Get a url to the iLO web interface' do + item = OneviewSDK::ServerHardware.find_by($client, name: $secrets['server_hardware_ip']).first + expect { item.get_remote_console_url }.not_to raise_error + end + end + + describe '#environmental_configuration' do + it 'Gets the script' do + item = OneviewSDK::ServerHardware.find_by($client, name: $secrets['server_hardware_ip']).first + expect { item.environmental_configuration }.not_to raise_error + end + end + + describe '#utilization' do + it 'Gets utilization data' do + item = OneviewSDK::ServerHardware.find_by($client, name: $secrets['server_hardware_ip']).first + expect { item.utilization }.not_to raise_error + end + end + +end diff --git a/spec/integration/resource/server_hardware/delete_spec.rb b/spec/integration/resource/server_hardware/delete_spec.rb new file mode 100644 index 000000000..fe46b78e6 --- /dev/null +++ b/spec/integration/resource/server_hardware/delete_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +klass = OneviewSDK::ServerHardware +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe '#remove' do + it 'deletes the resource' do + item = OneviewSDK::ServerHardware.find_by($client, 'name' => $secrets['server_hardware_ip']).first + item.remove + end + + it 'deletes the resource 2' do + item = OneviewSDK::ServerHardware.find_by($client, 'name' => $secrets['rack_server_hardware_ip']).first + item.remove + end + end +end diff --git a/spec/integration/resource/server_hardware/update_spec.rb b/spec/integration/resource/server_hardware/update_spec.rb new file mode 100644 index 000000000..be6792db4 --- /dev/null +++ b/spec/integration/resource/server_hardware/update_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::ServerHardware, integration: true, type: UPDATE do + include_context 'integration context' + + before :each do + @item = OneviewSDK::ServerHardware.find_by($client, name: $secrets['server_hardware_ip']).first + end + + describe '#set_refresh_state' do + it 'Refresh state with no additional parameters' do + expect { @item.set_refresh_state('RefreshPending') }.not_to raise_error + end + + it 'Refresh state with additional parameters' do + expect { @item.set_refresh_state('RefreshPending', resfreshActions: 'ClearSyslog') }.not_to raise_error + end + end + + describe '#power' do + it 'Power off server hardware' do + expect { @item.power_off }.not_to raise_error + end + + it 'Power on server hardware' do + expect { @item.power_on }.not_to raise_error + end + + it 'Force power off server hardware' do + expect { @item.power_off(true) }.not_to raise_error + end + end + + describe '#update_ilo_firmware' do + it 'Update iLO firmware to OneView minimum supported version' do + expect { @item.update_ilo_firmware }.not_to raise_error + end + end + +end diff --git a/spec/integration/resource/server_hardware_type/create_spec.rb b/spec/integration/resource/server_hardware_type/create_spec.rb new file mode 100644 index 000000000..11290c858 --- /dev/null +++ b/spec/integration/resource/server_hardware_type/create_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +klass = OneviewSDK::ServerHardwareType +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + describe 'Create server hardware type adding by adding a server hardware' do + it 'can create resources' do + options = { + hostname: $secrets['server_hardware2_ip'], + username: $secrets['server_hardware2_username'], + password: $secrets['server_hardware2_password'], + name: 'Server Hardware Type OneViewSDK Test', + licensingIntent: 'OneView' + } + + item = OneviewSDK::ServerHardware.new($client, options) + expect { item.add }.to_not raise_error + end + end +end diff --git a/spec/integration/resource/server_hardware_type/delete_spec.rb b/spec/integration/resource/server_hardware_type/delete_spec.rb new file mode 100644 index 000000000..cad7cc3b4 --- /dev/null +++ b/spec/integration/resource/server_hardware_type/delete_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +klass = OneviewSDK::ServerHardwareType +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe '#remove' do + it 'removes the resource' do + server_hardware = OneviewSDK::ServerHardware.find_by($client, name: $secrets['server_hardware2_ip']).first + model = server_hardware['model'] + expect { server_hardware.remove }.not_to raise_error + item = OneviewSDK::ServerHardwareType.find_by($client, model: model).first + expect { item.remove }.not_to raise_error + end + end +end diff --git a/spec/integration/resource/server_hardware_type/update_spec.rb b/spec/integration/resource/server_hardware_type/update_spec.rb new file mode 100644 index 000000000..f1995a215 --- /dev/null +++ b/spec/integration/resource/server_hardware_type/update_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::ServerHardwareType, integration: true, type: UPDATE do + include_context 'integration context' + + before :each do + server_hardware = OneviewSDK::ServerHardware.find_by($client, name: $secrets['server_hardware2_ip']).first + puts server_hardware['model'] + @item = OneviewSDK::ServerHardwareType.find_by($client, model: server_hardware['model']).first + end + + describe '#update' do + it 'Update name and description' do + old_name = @item['name'] + expect { @item.update(name: 'Test', description: 'Server hardware type description') }.not_to raise_error + @item.update(name: old_name) + end + end + +end diff --git a/spec/integration/resource/server_profile/create_spec.rb b/spec/integration/resource/server_profile/create_spec.rb new file mode 100644 index 000000000..1bd685c35 --- /dev/null +++ b/spec/integration/resource/server_profile/create_spec.rb @@ -0,0 +1,74 @@ +require 'spec_helper' + +klass = OneviewSDK::ServerProfile +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + describe '#create' do + it 'can create a basic connection-less assigned server profile' do + item = OneviewSDK::ServerProfile.new($client, name: SERVER_PROFILE_NAME) + target = OneviewSDK::ServerProfile.get_available_targets($client)['targets'].first + server_hardware = OneviewSDK::ServerHardware.new($client, uri: target['serverHardwareUri']) + item.set_server_hardware(server_hardware) + expect { item.create }.to_not raise_error + end + + it 'can create a basic connection-less unassigned server profile' do + item = OneviewSDK::ServerProfile.new($client, name: SERVER_PROFILE2_NAME) + target = OneviewSDK::ServerProfile.get_available_targets($client)['targets'].first + server_hardware_type = OneviewSDK::ServerHardwareType.new($client, uri: target['serverHardwareTypeUri']) + item.set_server_hardware_type(server_hardware_type) + expect { item.create }.to_not raise_error + end + end + + it 'can be created from template' do + template = OneviewSDK::ServerProfileTemplate.find_by($client, {}).first + item = template.new_profile(SERVER_PROFILE3_NAME) + expect { item.create }.to_not raise_error + expect(item['uri']).to be + end + + it 'can create advanced server profile with connections and volume attachments' do + item = OneviewSDK::ServerProfile.new($client, name: SERVER_PROFILE4_NAME) + + server_hardware_type = OneviewSDK::ServerHardwareType.new($client, name: 'BL460c Gen8 1') + item.set_server_hardware_type(server_hardware_type) + + enclosure_group = OneviewSDK::EnclosureGroup.new($client, name: ENC_GROUP2_NAME) + item.set_enclosure_group(enclosure_group) + + expect(enclosure_group['uri']).to be + expect(server_hardware_type['uri']).to be + + storage_system = OneviewSDK::StorageSystem.find_by($client, {}).first + expect(storage_system['uri']).to be + + available_fc_network = OneviewSDK::FCNetwork.new($client, name: FC_NET_NAME) + available_fc_network.retrieve! + item.add_connection(available_fc_network, 'name' => 'fc_con_1', 'functionType' => 'FibreChannel', 'portId' => 'Auto') + + volume_params = { + 'name' => VOLUME4_NAME, + 'provisioningParameters' => { + 'provisionType' => 'Full', + 'shareable' => true, + 'requestedCapacity' => 1024 * 1024 * 1024 + } + } + + storage_pool = OneviewSDK::StoragePool.new($client, name: STORAGE_POOL_NAME) + item.create_volume_with_attachment(storage_pool, volume_params) + item['sanStorage']['manageSanStorage'] = true + item['sanStorage']['hostOSType'] = 'Windows 2012 / WS2012 R2' + + expect { item.create }.to_not raise_error + end + + describe '#get_available_networks' do + it 'Gets available networks' do + item = OneviewSDK::ServerProfile.find_by($client, name: SERVER_PROFILE_NAME).first + expect { item.get_available_networks }.not_to raise_error + end + end +end diff --git a/spec/integration/resource/server_profile/delete_spec.rb b/spec/integration/resource/server_profile/delete_spec.rb new file mode 100644 index 000000000..e793bcbda --- /dev/null +++ b/spec/integration/resource/server_profile/delete_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +klass = OneviewSDK::ServerProfile +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe '#delete' do + it 'deletes all the resources' do + names = [SERVER_PROFILE_NAME, SERVER_PROFILE2_NAME, SERVER_PROFILE3_NAME, SERVER_PROFILE4_NAME] + names.each do |name| + item = OneviewSDK::ServerProfile.find_by($client, 'name' => name).first + expect(item).to be + expect { item.delete }.to_not raise_error + end + assoc_vol = OneviewSDK::Volume.find_by($client, 'name' => VOLUME4_NAME).first + expect { assoc_vol.delete }.to_not raise_error + end + end +end diff --git a/spec/integration/resource/server_profile/update_spec.rb b/spec/integration/resource/server_profile/update_spec.rb new file mode 100644 index 000000000..c98266ad5 --- /dev/null +++ b/spec/integration/resource/server_profile/update_spec.rb @@ -0,0 +1,100 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::ServerProfile, integration: true, type: UPDATE do + include_context 'integration context' + + before :all do + @item = OneviewSDK::ServerProfile.new($client, name: SERVER_PROFILE_NAME) + @item.retrieve! + @enclosure_group = OneviewSDK::EnclosureGroup.find_by($client, {}).first + @server_hardware_type = OneviewSDK::ServerHardwareType.find_by($client, {}).first + @storage_system = OneviewSDK::StorageSystem.find_by($client, {}).first + @item3 = OneviewSDK::ServerProfile.new($client, name: SERVER_PROFILE3_NAME) + @item3.retrieve! + end + + describe '#self.get_available_networks' do + it 'retrieves available networks without errors' do + query_options = { + 'enclosure_group' => @enclosure_group, + 'server_hardware_type' => @server_hardware_type + } + expect { OneviewSDK::ServerProfile.get_available_networks($client, query_options) }.to_not raise_error + end + end + + describe '#self.get_available_servers' do + it 'retrieves available servers without errors' do + expect { OneviewSDK::ServerProfile.get_available_servers($client) }.to_not raise_error + end + end + + describe '#self.get_available_storage_system' do + it 'retrieves available storage system without errors. FAIL: Bug in OneView/Documentation' do + query_options = { + 'enclosure_group' => @enclosure_group, + 'server_hardware_type' => @server_hardware_type, + 'storage_system' => @storage_system + } + expect { OneviewSDK::ServerProfile.get_available_storage_system($client, query_options) }.to_not raise_error + end + end + + describe '#self.get_available_storage_systems' do + it 'retrieves available storage systems without errors' do + query_options = { + 'enclosure_group' => @enclosure_group, + 'server_hardware_type' => @server_hardware_type + } + expect { OneviewSDK::ServerProfile.get_available_storage_systems($client, query_options) }.to_not raise_error + end + end + + describe '#self.get_available_targets' do + it 'retrieves available targets without errors' do + expect { OneviewSDK::ServerProfile.get_available_targets($client) }.to_not raise_error + end + end + + describe '#self.get_profile_ports' do + it 'retrieves profile ports without errors' do + query_options = { + 'enclosure_group' => @enclosure_group, + 'server_hardware_type' => @server_hardware_type + } + expect { OneviewSDK::ServerProfile.get_profile_ports($client, query_options) }.to_not raise_error + end + end + + describe '#get_messages' do + it 'shows messages' do + expect { @item.get_messages }.to_not raise_error + end + end + + describe '#get_transformation' do + it 'transforms an existing profile' do + expect { @item.get_transformation('server_hardware_type' => @server_hardware_type) }.to_not raise_error + end + end + + describe '#get_compliance_preview' do + it 'shows compliance preview' do + expect { @item3.get_compliance_preview }.to_not raise_error + end + end + + describe '#update_from_template' do + it 'makes the Server Profile compliant with the template' do + expect { @item3.update_from_template }.to_not raise_error + end + end + + describe '#get_available_networks' do + it 'Gets available networks' do + item = OneviewSDK::ServerProfile.find_by($client, name: SERVER_PROFILE_NAME).first + expect { item.get_available_networks }.not_to raise_error + end + end + +end diff --git a/spec/integration/resource/server_profile_template/create_spec.rb b/spec/integration/resource/server_profile_template/create_spec.rb new file mode 100644 index 000000000..b6886458a --- /dev/null +++ b/spec/integration/resource/server_profile_template/create_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' + +klass = OneviewSDK::ServerProfileTemplate +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + describe '#create' do + it 'can create a basic connection-less server profile template' do + item = OneviewSDK::ServerProfileTemplate.new($client, name: SERVER_PROFILE_TEMPLATE_NAME) + server_hardware_type = OneviewSDK::ServerHardwareType.find_by($client, {}).first + enclosure_group = OneviewSDK::EnclosureGroup.find_by($client, {}).first + item.set_server_hardware_type(server_hardware_type) + item.set_enclosure_group(enclosure_group) + expect { item.create }.to_not raise_error + expect(item['uri']).to be + end + end + + describe '#new_profile' do + it 'returns a profile' do + item = OneviewSDK::ServerProfileTemplate.new($client, name: SERVER_PROFILE_TEMPLATE_NAME) + item.retrieve! + profile = item.new_profile + expect(profile.class).to eq(OneviewSDK::ServerProfile) + expect { profile.create }.not_to raise_error + expect(profile['uri']).to be + end + end +end diff --git a/spec/integration/resource/server_profile_template/delete_spec.rb b/spec/integration/resource/server_profile_template/delete_spec.rb new file mode 100644 index 000000000..4994f4d3a --- /dev/null +++ b/spec/integration/resource/server_profile_template/delete_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +klass = OneviewSDK::ServerProfileTemplate +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + let(:names) { [SERVER_PROFILE_TEMPLATE_NAME] } + + describe '#delete' do + it 'deletes the associated Server profiles' do + names.each do |name| + item = OneviewSDK::ServerProfileTemplate.find_by($client, 'name' => name).first + spts = OneviewSDK::ServerProfile.find_by($client, 'serverProfileTemplateUri' => item['uri']) + spts.each do |spt| + expect { spt.delete }.to_not raise_error + end + end + end + + it 'deletes all the resources' do + names.each do |name| + item = OneviewSDK::ServerProfileTemplate.find_by($client, 'name' => name).first + expect(item).to be + expect { item.delete }.to_not raise_error + end + end + end +end diff --git a/spec/integration/resource/server_profile_template/update_spec.rb b/spec/integration/resource/server_profile_template/update_spec.rb new file mode 100644 index 000000000..e2b512312 --- /dev/null +++ b/spec/integration/resource/server_profile_template/update_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::ServerProfileTemplate, integration: true, type: UPDATE do + include_context 'integration context' + + describe '#update' do + it 'updates the name attribute' do + item = OneviewSDK::ServerProfileTemplate.new($client, name: SERVER_PROFILE_TEMPLATE_NAME) + item.retrieve! + expect { item.update(name: SERVER_PROFILE_TEMPLATE_NAME_UPDATED) }.not_to raise_error + expect(item.retrieve!).to be + expect { item.update(name: SERVER_PROFILE_TEMPLATE_NAME) }.not_to raise_error + expect(item.retrieve!).to be + expect(item['name']).to eq(SERVER_PROFILE_TEMPLATE_NAME) + end + end +end diff --git a/spec/integration/resource/storage_pool/create_spec.rb b/spec/integration/resource/storage_pool/create_spec.rb index b8b0dedb0..f057ce9af 100644 --- a/spec/integration/resource/storage_pool/create_spec.rb +++ b/spec/integration/resource/storage_pool/create_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::StoragePool, integration: true, type: CREATE, sequence: 11 do +klass = OneviewSDK::StoragePool +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do include_context 'integration context' let(:file_path) { 'spec/support/fixtures/integration/storage_pool.json' } @@ -12,15 +13,15 @@ } end - describe '#create' do - it 'can create resources' do + describe '#add' do + it 'can add resources' do item = OneviewSDK::StoragePool.from_file($client, file_path) - item.create + item.add storage_system = OneviewSDK::StorageSystem.new($client, storage_system_data) storage_system.retrieve! - expect(item[:storageSystemUri]).to eq(storage_system['uri']) - expect(item[:poolName]).to eq(STORAGE_POOL_NAME) - expect(item[:uri]).to be + expect(item['storageSystemUri']).to eq(storage_system['uri']) + expect(item['poolName']).to eq(STORAGE_POOL_NAME) + expect(item['uri']).to be end end @@ -30,15 +31,15 @@ item.retrieve! storage_system = OneviewSDK::StorageSystem.new($client, storage_system_data) storage_system.retrieve! - expect(item[:storageSystemUri]).to eq(storage_system['uri']) - expect(item[:name]).to eq(STORAGE_POOL_NAME) - expect(item[:uri]).to be + expect(item['storageSystemUri']).to eq(storage_system['uri']) + expect(item['name']).to eq(STORAGE_POOL_NAME) + expect(item['uri']).to be end end describe '#find_by' do it 'returns all resources when the hash is empty' do - names = OneviewSDK::StoragePool.find_by($client, {}).map { |item| item[:name] } + names = OneviewSDK::StoragePool.find_by($client, {}).map { |item| item['name'] } expect(names).to include(STORAGE_POOL_NAME) end @@ -46,7 +47,7 @@ storage_system = OneviewSDK::StorageSystem.new($client, storage_system_data) storage_system.retrieve! attrs = { name: STORAGE_POOL_NAME, storageSystemUri: storage_system['uri'] } - names = OneviewSDK::StoragePool.find_by($client, attrs).map { |item| item[:name] } + names = OneviewSDK::StoragePool.find_by($client, attrs).map { |item| item['name'] } expect(names).to include(STORAGE_POOL_NAME) end end diff --git a/spec/integration/resource/storage_pool/delete_spec.rb b/spec/integration/resource/storage_pool/delete_spec.rb index a92ccd018..b9dc2ebf8 100644 --- a/spec/integration/resource/storage_pool/delete_spec.rb +++ b/spec/integration/resource/storage_pool/delete_spec.rb @@ -1,13 +1,14 @@ require 'spec_helper' -RSpec.describe OneviewSDK::StoragePool, integration: true, type: DELETE, sequence: 2 do +klass = OneviewSDK::StoragePool +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do include_context 'integration context' - describe '#delete' do + describe '#remove' do it 'deletes the resource' do item = OneviewSDK::StoragePool.new($client, name: STORAGE_POOL_NAME) item.retrieve! - expect { item.delete }.to_not raise_error + expect { item.remove }.to_not raise_error end end end diff --git a/spec/integration/resource/storage_system/create_spec.rb b/spec/integration/resource/storage_system/create_spec.rb index b713bd91c..147495974 100644 --- a/spec/integration/resource/storage_system/create_spec.rb +++ b/spec/integration/resource/storage_system/create_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::StorageSystem, integration: true, type: CREATE, sequence: 10 do +klass = OneviewSDK::StorageSystem +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do include_context 'integration context' let(:storage_system_data) do @@ -17,7 +18,7 @@ describe '#create' do it 'can create resources' do item = OneviewSDK::StorageSystem.new($client, storage_system_data) - item.create + item.add expect(item[:uri]).not_to be_empty end end diff --git a/spec/integration/resource/storage_system/delete_spec.rb b/spec/integration/resource/storage_system/delete_spec.rb index 878028421..0fd1fca91 100644 --- a/spec/integration/resource/storage_system/delete_spec.rb +++ b/spec/integration/resource/storage_system/delete_spec.rb @@ -1,14 +1,15 @@ require 'spec_helper' -RSpec.describe OneviewSDK::StorageSystem, integration: true, type: DELETE, sequence: 3 do +klass = OneviewSDK::StorageSystem +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do include_context 'integration context' - describe '#delete' do + describe '#remove' do it 'removes the storage system' do storage_system = OneviewSDK::StorageSystem.new($client, 'credentials' => {}) storage_system['credentials']['ip_hostname'] = $secrets['storage_system1_ip'] storage_system.retrieve! - expect { storage_system.delete }.to_not raise_error + expect { storage_system.remove }.to_not raise_error end end end diff --git a/spec/integration/resource/switch/create_spec.rb b/spec/integration/resource/switch/create_spec.rb new file mode 100644 index 000000000..2e8622398 --- /dev/null +++ b/spec/integration/resource/switch/create_spec.rb @@ -0,0 +1,41 @@ +require 'spec_helper' + +klass = OneviewSDK::Switch +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + before :all do + @item = OneviewSDK::Switch.find_by($client, {}).first + end + + describe '#statistics' do + it 'gets data for the port X1' do + expect(@item.statistics('X1')).to_not be_empty + end + + it 'gets data for the port X1 with subport Q1' do + expect(@item.statistics('X1', 'Q1')).to_not be_empty + end + end + + describe '#environmentalConfiguration' do + it 'gets the current environmental configuration' do + expect(@item.environmental_configuration).to_not be_empty + end + end + + describe '#get_types' do + it 'list all the types' do + expect(OneviewSDK::Switch.get_types($client)).to_not be_empty + end + + it 'get one desired type' do + model_name = 'Cisco Nexus 55xx' + model = OneviewSDK::Switch.get_type($client, model_name) + expect(model).to_not be_empty + expect(model['name']).to eq(model_name) + expect(model['uri']).to_not be_empty + end + end + +end diff --git a/spec/integration/resource/switch/delete_spec.rb b/spec/integration/resource/switch/delete_spec.rb new file mode 100644 index 000000000..22462dcbf --- /dev/null +++ b/spec/integration/resource/switch/delete_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +klass = OneviewSDK::Switch +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe '#remove' do + it 'remove resource' do + @item = OneviewSDK::Switch.find_by($client, {}).first + expect { @item.remove }.to_not raise_error + end + end +end diff --git a/spec/integration/resource/switch/update_spec.rb b/spec/integration/resource/switch/update_spec.rb new file mode 100644 index 000000000..e57467019 --- /dev/null +++ b/spec/integration/resource/switch/update_spec.rb @@ -0,0 +1,8 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::Switch, integration: true, type: UPDATE, sequence: 15 do + include_context 'integration context' + + it 'cannot be updated' + +end diff --git a/spec/integration/resource/unmanaged_device/create_spec.rb b/spec/integration/resource/unmanaged_device/create_spec.rb new file mode 100644 index 000000000..fbe38c63e --- /dev/null +++ b/spec/integration/resource/unmanaged_device/create_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' + +klass = OneviewSDK::UnmanagedDevice +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do + include_context 'integration context' + + describe '#add' do + it 'Add unmanaged device' do + item = OneviewSDK::UnmanagedDevice.new($client, name: UNMANAGED_DEVICE1_NAME, model: 'Unknown') + item.add + expect(item['uri']).to be + end + end + + describe '#environmentalConfiguration' do + it 'Gets the script' do + item = OneviewSDK::UnmanagedDevice.find_by($client, {}).first + expect { item.environmental_configuration }.not_to raise_error + end + end + + describe '#self.get_devices' do + it 'Check if created device is present' do + devices = OneviewSDK::UnmanagedDevice.get_devices($client) + devices = devices.map { |device| device['name'] } + expect(devices).to include(UNMANAGED_DEVICE1_NAME) + end + end +end diff --git a/spec/integration/resource/unmanaged_device/delete_spec.rb b/spec/integration/resource/unmanaged_device/delete_spec.rb new file mode 100644 index 000000000..a2da31c32 --- /dev/null +++ b/spec/integration/resource/unmanaged_device/delete_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +klass = OneviewSDK::UnmanagedDevice +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do + include_context 'integration context' + + describe '#remove' do + it 'remove resource' do + item = OneviewSDK::UnmanagedDevice.new($client, name: UNMANAGED_DEVICE1_NAME) + item.retrieve! + expect { item.remove }.to_not raise_error + end + end + +end diff --git a/spec/integration/resource/unmanaged_device/update_spec.rb b/spec/integration/resource/unmanaged_device/update_spec.rb new file mode 100644 index 000000000..3dda55f31 --- /dev/null +++ b/spec/integration/resource/unmanaged_device/update_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::UnmanagedDevice, integration: true, type: UPDATE do + include_context 'integration context' + + before :each do + @item = OneviewSDK::UnmanagedDevice.new($client, name: UNMANAGED_DEVICE1_NAME) + @item.retrieve! + end + + describe '#update' do + it 'Change name' do + @item.update(name: 'UnmanagedDevice_1_Updated') + @item.refresh + expect(@item['name']).to eq('UnmanagedDevice_1_Updated') + @item.update(name: UNMANAGED_DEVICE1_NAME) + end + end + + +end diff --git a/spec/integration/resource/uplink_set/create_spec.rb b/spec/integration/resource/uplink_set/create_spec.rb index 85e1eb8a9..f721a6625 100644 --- a/spec/integration/resource/uplink_set/create_spec.rb +++ b/spec/integration/resource/uplink_set/create_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::UplinkSet, integration: true, type: CREATE, sequence: 8 do +klass = OneviewSDK::UplinkSet +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do include_context 'integration context' let(:uplink_data) do diff --git a/spec/integration/resource/uplink_set/delete_spec.rb b/spec/integration/resource/uplink_set/delete_spec.rb index 6e293bccb..494890f52 100644 --- a/spec/integration/resource/uplink_set/delete_spec.rb +++ b/spec/integration/resource/uplink_set/delete_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::UplinkSet, integration: true, type: DELETE, sequence: 5 do +klass = OneviewSDK::UplinkSet +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do include_context 'integration context' describe '#delete' do diff --git a/spec/integration/resource/volume/create_spec.rb b/spec/integration/resource/volume/create_spec.rb index 4ab5ddcb1..39e24a40e 100644 --- a/spec/integration/resource/volume/create_spec.rb +++ b/spec/integration/resource/volume/create_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::Volume, integration: true, type: CREATE, sequence: 13 do +klass = OneviewSDK::Volume +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do include_context 'integration context' before :all do diff --git a/spec/integration/resource/volume/delete_spec.rb b/spec/integration/resource/volume/delete_spec.rb index 4002f1597..e0effc2b4 100644 --- a/spec/integration/resource/volume/delete_spec.rb +++ b/spec/integration/resource/volume/delete_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::Volume, integration: true, type: DELETE, sequence: 1 do +klass = OneviewSDK::Volume +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do include_context 'integration context' before :all do diff --git a/spec/integration/resource/volume_attachment/update_spec.rb b/spec/integration/resource/volume_attachment/update_spec.rb new file mode 100644 index 000000000..f331043b1 --- /dev/null +++ b/spec/integration/resource/volume_attachment/update_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::VolumeAttachment, integration: true, type: UPDATE do + include_context 'integration context' + + describe '#get_extra_unmanaged_volumes' do + it 'list' do + expect { OneviewSDK::VolumeAttachment.get_extra_unmanaged_volumes($client) }.to_not raise_error + end + end + + describe '#remove_extra_unmanaged_volume' do + it 'remove' do + expect { OneviewSDK::VolumeAttachment.get_extra_unmanaged_volumes($client) }.to_not raise_error + end + end + + describe '#get_path' do + it 'get all' do + item = OneviewSDK::VolumeAttachment.find_by($client, {}).first + expect { item.get_paths }.to_not raise_error + end + end +end diff --git a/spec/integration/resource/volume_template/create_spec.rb b/spec/integration/resource/volume_template/create_spec.rb index 43464bc2b..8b294086f 100644 --- a/spec/integration/resource/volume_template/create_spec.rb +++ b/spec/integration/resource/volume_template/create_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::VolumeTemplate, integration: true, type: CREATE, sequence: 12 do +klass = OneviewSDK::VolumeTemplate +RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do include_context 'integration context' before :all do diff --git a/spec/integration/resource/volume_template/delete_spec.rb b/spec/integration/resource/volume_template/delete_spec.rb index ad9a6aa90..e67c73701 100644 --- a/spec/integration/resource/volume_template/delete_spec.rb +++ b/spec/integration/resource/volume_template/delete_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe OneviewSDK::VolumeTemplate, integration: true, type: DELETE, sequence: 2 do +klass = OneviewSDK::VolumeTemplate +RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do include_context 'integration context' describe '#delete' do diff --git a/spec/integration/sequence_and_naming.rb b/spec/integration/sequence_and_naming.rb index 55a8fe4ad..9af700dc2 100644 --- a/spec/integration/sequence_and_naming.rb +++ b/spec/integration/sequence_and_naming.rb @@ -1,10 +1,76 @@ +require 'tsort' + # For Ordering Integration Tests: CREATE = 1 UPDATE = 2 DELETE = 3 +# Add the necessary methods to make Hash sortable by tsort +class Hash + include TSort + alias tsort_each_node each_key + def tsort_each_child(node, &block) + fetch(node).each(&block) + end +end + +DEPENDENCIES = { + Datacenter: [], + Enclosure: [:EnclosureGroup], + EnclosureGroup: [:LogicalInterconnectGroup], + EthernetNetwork: [], + Fabric: [], + FCNetwork: [], + FCoENetwork: [], + FirmwareBundle: [], + FirmwareDriver: [:FirmwareBundle], + Interconnect: [:LogicalInterconnect], + LIGUplinkSet: [], + LogicalDownlink: [:Enclosure], + LogicalEnclosure: [:Enclosure], + LogicalInterconnect: [:Enclosure], + LogicalInterconnectGroup: [:NetworkSet, :LIGUplinkSet], + LogicalSwitch: [:LogicalSwitchGroup], + LogicalSwitchGroup: [], + ManagedSAN: [:SANManager], + NetworkSet: [:EthernetNetwork, :FCNetwork, :FCoENetwork], + PowerDevice: [:ServerProfile, :Volume, :LogicalSwitch], + Rack: [:ServerProfile], + SANManager: [], + ServerHardware: [:ServerHardwareType], + ServerHardwareType: [:Enclosure], + ServerProfile: [:ServerHardware, :Enclosure, :ServerProfileTemplate], + ServerProfileTemplate: [:EnclosureGroup, :ServerHardware, :Volume], + StoragePool: [:StorageSystem], + StorageSystem: [], + Switch: [:LogicalSwitch], + UnmanagedDevice: [], + UplinkSet: [:LogicalInterconnectGroup], + Volume: [:StorageSystem, :StoragePool, :VolumeTemplate], + VolumeAttachment: [:ServerProfile], + VolumeTemplate: [:StoragePool] +}.freeze + +SEQ = DEPENDENCIES.tsort +RSEQ = SEQ.reverse + +# Get sequence number for the given class (Create sequence) +# @param [Class] klass +# @return [Integer] sequence number +def seq(klass) + k = klass.to_s.split('::').last.to_sym + (SEQ.index(k) || -1) + 1 +end + +# Get inverse sequence number for the given class (Delete sequence) +# @param [Class] klass +# @return [Integer] sequence number +def rseq(klass) + k = klass.to_s.split('::').last.to_sym + (RSEQ.index(k) || -1) + 1 +end + -# ================================================== # Resource Names: # BulkEthernetNetwork @@ -22,6 +88,12 @@ FCOE_NET_NAME = 'FCoENetwork_1'.freeze FCOE_NET_NAME_UPDATED = 'FCoENetwork_1_UPDATED'.freeze +# Network Set +NETWORK_SET1_NAME = 'NetworkSet_1'.freeze +NETWORK_SET2_NAME = 'NetworkSet_2'.freeze +NETWORK_SET3_NAME = 'NetworkSet_3'.freeze +NETWORK_SET4_NAME = 'NetworkSet_4'.freeze + # LogicalInterconnectGroup LOG_INT_GROUP_NAME = 'LogicalInterconnectGroup_1'.freeze LOG_INT_GROUP_NAME_UPDATED = 'LogicalInterconnectGroup_1_UPDATED'.freeze @@ -47,7 +119,7 @@ # LIGUplinkSet LIG_UPLINK_SET_NAME = 'EthernetUplinkSet_1'.freeze -LIG_UPLINK_SET2_NAME = 'EthernetUplinkSet_2'.freeze +LIG_UPLINK_SET2_NAME = 'FCUplinkSet_1'.freeze # storageSystem STORAGE_SYSTEM_NAME = 'ThreePAR7200-2027'.freeze @@ -63,5 +135,54 @@ VOLUME_NAME = 'Volume_1'.freeze VOLUME2_NAME = 'Volume_2'.freeze VOLUME3_NAME = 'Volume_3'.freeze +VOLUME4_NAME = 'Volume_4'.freeze VOL_SNAPSHOT_NAME = 'snapshot_qa'.freeze VOL_SNAPSHOT2_NAME = 'snapshot_qa_2'.freeze + +# Logical Switch Group +LOG_SWI_GROUP_NAME = 'LogicalSwitchGroup_1'.freeze +LOG_SWI_GROUP_NAME_UPDATED = 'LogicalSwitchGroup_1_UPDATED'.freeze + +# Logical Switch +LOG_SWI_NAME = 'LogicalSwitch_1'.freeze + +# Volume Attachment +VOL_ATTACHMENT_NAME = 'VolumeAttachment_1'.freeze + + +# Power Device +POW_DEVICE1_NAME = 'PowerDevice_1'.freeze + +# Server Profile +SERVER_PROFILE_NAME = 'ServerProfile_1'.freeze +SERVER_PROFILE2_NAME = 'ServerProfile_2'.freeze +SERVER_PROFILE3_NAME = 'ServerProfile_3'.freeze +SERVER_PROFILE4_NAME = 'ServerProfile_4'.freeze +SERVER_PROFILE5_NAME = 'ServerProfile_5'.freeze +SERVER_PROFILE6_NAME = 'ServerProfile_6'.freeze + +# Server Profile Template +SERVER_PROFILE_TEMPLATE_NAME = 'ServerProfileTemplate_1'.freeze +SERVER_PROFILE_TEMPLATE_NAME_UPDATED = 'ServerProfileTemplate_1_UPDATED'.freeze + +# Datacenter +DATACENTER1_NAME = 'Datacenter_1'.freeze +DATACENTER2_NAME = 'Datacenter_2'.freeze +DATACENTER3_NAME = 'Datacenter_3'.freeze +DATACENTER1_NAME_UPDATED = 'Datacenter_1_UPDATED'.freeze + +# Rack +RACK1_NAME = 'Rack_1'.freeze +RACK2_NAME = 'Rack_2'.freeze + +# Fabric +DEFAULT_FABRIC_NAME = 'DefaultFabric'.freeze + +# Unmanaged Device +UNMANAGED_DEVICE1_NAME = 'UnmanagedDevice_1'.freeze + +# FC San Provider +SAN_PROVIDER1_NAME = 'Brocade Network Advisor'.freeze + +# Firmware Driver +FIRMWARE_DRIVER1_NAME = 'CustomSPP_1'.freeze diff --git a/spec/shared_context.rb b/spec/shared_context.rb index f0d83fb2d..c4ccc9450 100644 --- a/spec/shared_context.rb +++ b/spec/shared_context.rb @@ -51,15 +51,18 @@ $client ||= OneviewSDK::Client.new($config.merge(api_version: 200)) end - before :each do |e| # For debugging only: Shows test metadata - action = case e.metadata[:type] - when CREATE then 'CREATE' - when UPDATE then 'UPDATE' - when DELETE then 'DELETE' - else '_____' - end - puts "#{action} #{e.metadata[:sequence] || '_'}: #{described_class}: #{e.metadata[:description]}" - # fail 'Skipped' # Un-comment to skip running the tests + before :each do |e| + if ENV['PRINT_METADATA_ONLY'] + # For debugging only: Shows test metadata without actually running the tests + action = case e.metadata[:type] + when CREATE then 'CREATE' + when UPDATE then 'UPDATE' + when DELETE then 'DELETE' + else '_____' + end + puts "#{action} #{e.metadata[:sequence] || '_'}: #{described_class}: #{e.metadata[:description]}" + fail 'Skipped' + end end end diff --git a/spec/support/fake_firmware.iso b/spec/support/fake_firmware.iso deleted file mode 100644 index 844a67980..000000000 --- a/spec/support/fake_firmware.iso +++ /dev/null @@ -1,10243 +0,0 @@ -Fake firmware with fake information - -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake informationFake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information -Fake firmware with fake information diff --git a/spec/system/light_profile/create_spec.rb b/spec/system/light_profile/create_spec.rb index ea1e85fd9..ae58aedeb 100644 --- a/spec/system/light_profile/create_spec.rb +++ b/spec/system/light_profile/create_spec.rb @@ -1,7 +1,7 @@ # System test script # Light Profie -require_relative '../../spec_helper' +require 'spec_helper' RSpec.describe 'Spin up fluid resource pool', system: true, sequence: 1 do include_context 'system context' @@ -119,7 +119,7 @@ managedDomain: 'TestDomain' } storage = OneviewSDK::StorageSystem.new($client, options) - storage.create + storage.add expect(storage['uri']).not_to be_empty end @@ -132,7 +132,7 @@ poolName: 'FST_CPG2' } storage_pool = OneviewSDK::StoragePool.new($client, options) - storage_pool.create + storage_pool.add expect(storage_pool['uri']).not_to be_empty end diff --git a/spec/unit/cli/output_spec.rb b/spec/unit/cli/output_spec.rb new file mode 100644 index 000000000..9a87a4c5f --- /dev/null +++ b/spec/unit/cli/output_spec.rb @@ -0,0 +1,46 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::Cli do + include_context 'cli context' + + let(:cli) do + OneviewSDK::Cli.new + end + + describe '#output' do + context 'with the default format' do + it 'prints nil for nil' do + expect { cli.instance_eval { output(nil) } }.to output("nil\n").to_stdout_from_any_process + end + + it 'prints nil in arrays' do + expect { cli.instance_eval { output([nil]) } }.to output("nil\n\nTotal: 1\n").to_stdout_from_any_process + end + + it 'prints nil in hash keys and values' do + expect { cli.instance_eval { output(nil => nil) } }.to output("nil: nil\n").to_stdout_from_any_process + end + + it 'prints single values' do + expect { cli.instance_eval { output('val') } }.to output("val\n").to_stdout_from_any_process + end + + it 'prints arrays' do + expect { cli.instance_eval { output(%w(val val2)) } }.to output("val\nval2\n\nTotal: 2\n").to_stdout_from_any_process + end + + it 'prints nested arrays' do + expect { cli.instance_eval { output(['val', %w(val2 val3)]) } }.to output("val\n val2\n val3\n\nTotal: 2\n").to_stdout_from_any_process + end + + it 'prints hashes' do + expect { cli.instance_eval { output(key: 'val', key2: 'val2') } }.to output("key: val\nkey2: val2\n").to_stdout_from_any_process + end + + it 'prints nested hashes' do + expect { cli.instance_eval { output(key: { key2: 'val2' }) } }.to output("key:\n key2: val2\n").to_stdout_from_any_process + end + + end + end +end diff --git a/spec/unit/cli/search_spec.rb b/spec/unit/cli/search_spec.rb index 9ab7c59f3..96d725de8 100644 --- a/spec/unit/cli/search_spec.rb +++ b/spec/unit/cli/search_spec.rb @@ -52,7 +52,7 @@ it 'prints a subset of the resource details when the attribute option is given' do expect(OneviewSDK::Resource).to receive(:find_by).with(OneviewSDK::Client, 'description' => 'Blah') - out = [resource_data.select { |k, _v| k == 'uri' }, resource_data2.select { |k, _v| k == 'uri' }] + out = [{ resource_data['name'] => { 'uri' => resource_data['uri'] } }, { resource_data2['name'] => { 'uri' => resource_data2['uri'] } }] expect { OneviewSDK::Cli.start(%w(search ServerProfile -f yaml --filter description:Blah -a uri)) } .to output(out.to_yaml).to_stdout_from_any_process end diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb index 61e410d58..e0cb2e49d 100644 --- a/spec/unit/client_spec.rb +++ b/spec/unit/client_spec.rb @@ -17,11 +17,11 @@ it 'requires a token or user-password pair' do options = { url: 'https://oneview.example.com', user: 'Administrator' } - expect { OneviewSDK::Client.new(options) }.to raise_error(/Must set user & password options or token/) + expect { OneviewSDK::Client.new(options) }.to raise_error(OneviewSDK::InvalidClient, /Must set user & password options or token/) end it 'requires the url attribute to be set' do - expect { OneviewSDK::Client.new({}) }.to raise_error(/Must set the url option/) + expect { OneviewSDK::Client.new({}) }.to raise_error(OneviewSDK::InvalidClient, /Must set the url option/) end it 'sets the username to "Administrator" by default' do @@ -103,6 +103,18 @@ client = OneviewSDK::Client.new(options) expect(client.cert_store).to eq(nil) end + + it 'sets @timeout to nil by default' do + options = { url: 'https://oneview.example.com', token: 'token123' } + client = OneviewSDK::Client.new(options) + expect(client.timeout).to be_nil + end + + it 'allows @timeout to be set to true' do + options = { url: 'https://oneview.example.com', token: 'token123', timeout: 5 } + client = OneviewSDK::Client.new(options) + expect(client.timeout).to eq(5) + end end describe '#appliance_api_version' do @@ -146,7 +158,7 @@ options = { url: 'https://oneview.example.com', user: 'Administrator', password: 'secret123', log_level: :debug } expect { OneviewSDK::Client.new(options) rescue nil }.to output(/Retrying.../).to_stdout_from_any_process options.delete(:log_level) - expect { OneviewSDK::Client.new(options) }.to raise_error(/Couldn't log into OneView server/) + expect { OneviewSDK::Client.new(options) }.to raise_error(OneviewSDK::ConnectionError, /Couldn't log into OneView server/) end end @@ -187,7 +199,7 @@ end it 'fails when a bogus resource type is given' do - expect { @client.get_all('BogusResources') }.to raise_error(/Invalid resource type/) + expect { @client.get_all('BogusResources') }.to raise_error(TypeError, /Invalid resource type/) end end @@ -195,7 +207,7 @@ include_context 'shared context' it 'requires a task_uri' do - expect { @client.wait_for('') }.to raise_error(/Must specify a task_uri/) + expect { @client.wait_for('') }.to raise_error(ArgumentError, /Must specify a task_uri/) end it 'returns the response body for completed tasks' do @@ -217,7 +229,7 @@ %w(Error Killed Terminated).each do |state| fake_response = FakeResponse.new(taskState: state, message: 'Blah') allow_any_instance_of(OneviewSDK::Client).to receive(:rest_get).and_return(fake_response) - expect { @client.wait_for('/rest/tasks/1') }.to raise_error(/ended with bad state[\S\s]*Blah/) + expect { @client.wait_for('/rest/tasks/1') }.to raise_error(OneviewSDK::TaskError, /ended with bad state[\S\s]*Blah/) end end @@ -225,7 +237,7 @@ %w(Error Killed Terminated).each do |state| fake_response = FakeResponse.new(taskState: state, taskErrors: { message: 'Blah' }) allow_any_instance_of(OneviewSDK::Client).to receive(:rest_get).and_return(fake_response) - expect { @client.wait_for('/rest/tasks/1') }.to raise_error(/ended with bad state[\S\s]*Blah/) + expect { @client.wait_for('/rest/tasks/1') }.to raise_error(OneviewSDK::TaskError, /ended with bad state[\S\s]*Blah/) end end end diff --git a/spec/unit/exceptions_spec.rb b/spec/unit/exceptions_spec.rb new file mode 100644 index 000000000..7bc533940 --- /dev/null +++ b/spec/unit/exceptions_spec.rb @@ -0,0 +1,27 @@ +require_relative './../spec_helper' + +# Tests for custom exception classes + +classes = [ + OneviewSDK::ConnectionError, + OneviewSDK::InvalidURL, + OneviewSDK::InvalidClient, + OneviewSDK::InvalidResource, + OneviewSDK::IncompleteResource, + OneviewSDK::MethodUnavailable, + OneviewSDK::UnsupportedVersion, + OneviewSDK::InvalidRequest, + OneviewSDK::BadRequest, + OneviewSDK::Unauthorized, + OneviewSDK::NotFound, + OneviewSDK::RequestError, + OneviewSDK::TaskError, + OneviewSDK::InvalidFormat +] +classes.each do |klass| + RSpec.describe klass do + it 'exists and supports a message parameter' do + expect { fail described_class, 'Msg' }.to raise_error(described_class, /Msg/) + end + end +end diff --git a/spec/unit/resource/connection_template_spec.rb b/spec/unit/resource/connection_template_spec.rb new file mode 100644 index 000000000..9bb5e7c8a --- /dev/null +++ b/spec/unit/resource/connection_template_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::ConnectionTemplate do + include_context 'shared context' + + describe '#initialize' do + it 'sets the defaults correctly' do + connection = OneviewSDK::ConnectionTemplate.new(@client) + expect(connection['bandwidth']).to eq({}) + expect(connection['type']).to eq('connection-template') + end + + it 'sets maximum and typical bandwidth' do + connection = OneviewSDK::ConnectionTemplate.new(@client) + connection['bandwidth']['maximumBandwidth'] = 1000 + connection['bandwidth']['typicalBandwidth'] = 5000 + expect(connection['bandwidth']['maximumBandwidth']).to eq(1000) + expect(connection['bandwidth']['typicalBandwidth']).to eq(5000) + end + end + + describe '#get_default' do + it 'verify endpoint' do + expect(@client).to receive(:rest_get).with('/rest/connection-templates/defaultConnectionTemplate').and_return(FakeResponse.new({})) + OneviewSDK::ConnectionTemplate.get_default(@client) + end + end + + describe '#create' do + it 'is unavailable' do + connection = OneviewSDK::ConnectionTemplate.new(@client) + expect { connection.create }.to raise_error(/The method #create is unavailable for this resource/) + end + end + + describe '#delete' do + it 'is unavailable' do + connection = OneviewSDK::ConnectionTemplate.new(@client) + expect { connection.delete }.to raise_error(/The method #delete is unavailable for this resource/) + end + end + +end diff --git a/spec/unit/resource/datacenter_spec.rb b/spec/unit/resource/datacenter_spec.rb new file mode 100644 index 000000000..4aef9fab2 --- /dev/null +++ b/spec/unit/resource/datacenter_spec.rb @@ -0,0 +1,109 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +RSpec.describe OneviewSDK::Datacenter do + include_context 'shared context' + + describe '#initialize' do + it 'sets the defaults correctly' do + datacenter = OneviewSDK::Datacenter.new(@client) + expect(datacenter['contents']).to eq([]) + end + end + + describe '#add' do + it 'adds datacenter' do + options = { + name: 'Datacenter', + width: 5000, + depth: 5000 + } + item = OneviewSDK::Datacenter.new(@client, options) + expect(@client).to receive(:rest_post).with( + '/rest/datacenters', + { 'body' => { 'name' => 'Datacenter', 'width' => 5000, 'depth' => 5000, 'contents' => [] } }, + item.api_version + ).and_return(FakeResponse.new('uri' => '/rest/task/fake')) + item.add + end + end + + describe '#remove' do + it 'Should support remove' do + datacenter = OneviewSDK::Datacenter.new(@client, uri: '/rest/datacenters/100') + expect(@client).to receive(:rest_delete).with('/rest/datacenters/100', {}, 200).and_return(FakeResponse.new({})) + datacenter.remove + end + end + + describe '#add_rack' do + before :each do + @datacenter = OneviewSDK::Datacenter.new(@client) + end + + it 'Add one rack without rotation' do + rack1 = Hash.new('uri' => '/rest/fake/rack1') + @datacenter.add_rack(rack1, 5000, 5000) + expect(@datacenter['contents'][0]['resourceUri']).to eq(rack1['uri']) + end + + it 'Add one rack with rotation included' do + rack1 = Hash.new('uri' => '/rest/fake/rack1') + @datacenter.add_rack(rack1, 5000, 5000, 100) + expect(@datacenter['contents'][0]['resourceUri']).to eq(rack1['uri']) + end + + it 'Add multiple racks' do + rack1 = Hash.new('uri' => '/rest/fake/rack1') + rack2 = Hash.new('uri' => '/rest/fake/rack2') + @datacenter.add_rack(rack1, 500, 1000) + @datacenter.add_rack(rack2, 100, 1000) + expect(@datacenter['contents'][0]['resourceUri']).to eq(rack1['uri']) + expect(@datacenter['contents'][1]['resourceUri']).to eq(rack2['uri']) + end + end + + describe '#remove_rack' do + before :each do + @datacenter = OneviewSDK::Datacenter.new(@client) + end + + it 'Remove rack from empty list' do + rack1 = Hash.new('uri' => '/rest/fake/rack1') + expect { @datacenter.remove_rack(rack1) }.not_to raise_error + end + + it 'Remove only one rack' do + rack1 = Hash.new('uri' => '/rest/fake/rack1') + rack2 = Hash.new('uri' => '/rest/fake/rack2') + @datacenter.add_rack(rack1, 100, 100) + @datacenter.add_rack(rack2, 200, 200) + @datacenter.remove_rack(rack1) + results = @datacenter['contents'].map { |rack| rack['resourceUri'] } + expect(results).not_to include(rack1['uri']) + expect(results).to include(rack2['uri']) + end + end + + describe 'undefined methods' do + it 'does not allow the create action' do + datacenter = OneviewSDK::Datacenter.new(@client) + expect { datacenter.create }.to raise_error(/The method #create is unavailable for this resource/) + end + + it 'does not allow the delete action' do + datacenter = OneviewSDK::Datacenter.new(@client) + expect { datacenter.delete }.to raise_error(/The method #delete is unavailable for this resource/) + end + end +end diff --git a/spec/unit/resource/enclosure_group_spec.rb b/spec/unit/resource/enclosure_group_spec.rb index 522673e85..7f5bd5217 100644 --- a/spec/unit/resource/enclosure_group_spec.rb +++ b/spec/unit/resource/enclosure_group_spec.rb @@ -12,80 +12,9 @@ end end - describe 'validations' do - it 'only allows an interconnectBayMappingCount between 1 and 8' do - OneviewSDK::EnclosureGroup::VALID_INTERCONNECT_BAY_MAPPING_COUNTS.each do |i| - expect { OneviewSDK::EnclosureGroup.new(@client, interconnectBayMappingCount: i) }.to_not raise_error - end - expect { OneviewSDK::EnclosureGroup.new(@client, interconnectBayMappingCount: 0) }.to raise_error(/out of range/) - expect { OneviewSDK::EnclosureGroup.new(@client, interconnectBayMappingCount: 9) }.to raise_error(/out of range/) - end - - it 'only allows certain ipAddressingMode values' do - OneviewSDK::EnclosureGroup::VALID_IP_ADDRESSING_MODES.each do |i| - synergy_with_valid_types = { - enclosureTypeUri: 'rest/enclosure-types/synergy', - ipAddressingMode: i - } - expect { OneviewSDK::EnclosureGroup.new(@client, synergy_with_valid_types) }.to_not raise_error - end - synergy_with_invalid_type = { - enclosureTypeUri: 'rest/enclosure-types/synergy', - ipAddressingMode: 'invalid' - } - expect { OneviewSDK::EnclosureGroup.new(@client, synergy_with_invalid_type) }.to raise_error(/Invalid ip AddressingMode/) - - # The invalid param should be ignored if the Enclosure Type is not specified or is C7000 - synergy_with_null_addressing_mode = { - enclosureTypeUri: 'rest/enclosure-types/synergy', - ipAddressingMode: nil - } - expect { OneviewSDK::EnclosureGroup.new(@client, synergy_with_null_addressing_mode) }.to raise_error(/Invalid ip AddressingMode/) - with_nothing_specified = { - enclosureTypeUri: nil, - ipAddressingMode: nil - } - expect { OneviewSDK::EnclosureGroup.new(@client, with_nothing_specified) }.to_not raise_error - without_enclosure_type_specified = { - enclosureTypeUri: nil, - ipAddressingMode: 'invalid' - } - expect { OneviewSDK::EnclosureGroup.new(@client, without_enclosure_type_specified) }.to_not raise_error - with_enclosure_c7000 = { - enclosureTypeUri: nil, - ipAddressingMode: 'invalid' - } - expect { OneviewSDK::EnclosureGroup.new(@client, with_enclosure_c7000) }.to_not raise_error - end - - it 'only allows an portMappingCount between 0 and 8' do - OneviewSDK::EnclosureGroup::VALID_PORT_MAPPING_COUNTS.each do |i| - expect { OneviewSDK::EnclosureGroup.new(@client, portMappingCount: i) }.to_not raise_error - end - expect { OneviewSDK::EnclosureGroup.new(@client, portMappingCount: -1) }.to raise_error(/out of range/) - expect { OneviewSDK::EnclosureGroup.new(@client, portMappingCount: 9) }.to raise_error(/out of range/) - end - - it 'only allows certain powerMode values' do - OneviewSDK::EnclosureGroup::VALID_POWER_MODES.each do |i| - expect { OneviewSDK::EnclosureGroup.new(@client, powerMode: i) }.to_not raise_error - end - expect { OneviewSDK::EnclosureGroup.new(@client, powerMode: '') }.to raise_error(/Invalid powerMode/) - expect { OneviewSDK::EnclosureGroup.new(@client, powerMode: 'invalid') }.to raise_error(/Invalid powerMode/) - end - - it 'only allows certain stackingMode values' do - OneviewSDK::EnclosureGroup::VALID_STACKING_MODES.each do |i| - expect { OneviewSDK::EnclosureGroup.new(@client, stackingMode: i) }.to_not raise_error - end - expect { OneviewSDK::EnclosureGroup.new(@client, stackingMode: '') }.to raise_error(/Invalid stackingMode/) - expect { OneviewSDK::EnclosureGroup.new(@client, stackingMode: 'invalid') }.to raise_error(/Invalid stackingMode/) - end - end - describe '#script' do it 'requires a uri' do - expect { OneviewSDK::EnclosureGroup.new(@client).get_script }.to raise_error(/Please set uri/) + expect { OneviewSDK::EnclosureGroup.new(@client).get_script }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'gets uri/script' do @@ -98,7 +27,7 @@ describe '#set_script' do it 'requires a uri' do - expect { OneviewSDK::EnclosureGroup.new(@client).set_script('Blah') }.to raise_error(/Please set uri/) + expect { OneviewSDK::EnclosureGroup.new(@client).set_script('Blah') }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'does a PUT to uri/script' do diff --git a/spec/unit/resource/enclosure_spec.rb b/spec/unit/resource/enclosure_spec.rb index 07b316b59..c416d510a 100644 --- a/spec/unit/resource/enclosure_spec.rb +++ b/spec/unit/resource/enclosure_spec.rb @@ -13,7 +13,7 @@ end end - describe '#create' do + describe '#add' do context 'with valid data' do before :each do allow_any_instance_of(OneviewSDK::Enclosure).to receive(:update).and_return(true) @@ -34,17 +34,17 @@ it 'only sends certain attributes on the POST' do expect(@client).to receive(:rest_post).with('/rest/enclosures', { 'body' => @data.select { |k, _v| k != 'name' } }, anything) - @enclosure.create + @enclosure.add end it 'sets the enclosure name correctly' do - @enclosure.create + @enclosure.add expect(@enclosure[:name]).to eq('Fake-Enclosure') end it 'uses the given name if one is not specified' do @enclosure.data.delete('name') - @enclosure.create + @enclosure.add expect(@enclosure[:name]).to eq('Encl1') end end @@ -52,7 +52,7 @@ context 'with invalid data' do it 'fails when certain attributes are not set' do enclosure = OneviewSDK::Enclosure.new(@client, {}) - expect { enclosure.create }.to raise_error(/Missing required attribute/) + expect { enclosure.add }.to raise_error(OneviewSDK::IncompleteResource, /Missing required attribute/) end end end @@ -65,7 +65,7 @@ end it 'requires a uri' do - expect { OneviewSDK::Enclosure.new(@client).update }.to raise_error(/Please set uri/) + expect { OneviewSDK::Enclosure.new(@client).update }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'does not send a PATCH request if the name and rackName are the same' do @@ -91,9 +91,17 @@ end end + describe '#remove' do + it 'removes enclosure' do + item = OneviewSDK::Enclosure.new(@client, name: 'E1', rackName: 'R1', uri: '/rest/enclosures/encl1') + expect(@client).to receive(:rest_delete).with('/rest/enclosures/encl1', {}, 200).and_return(FakeResponse.new({})) + item.remove + end + end + describe '#configuration' do it 'requires a uri' do - expect { OneviewSDK::Enclosure.new(@client).configuration }.to raise_error(/Please set uri/) + expect { OneviewSDK::Enclosure.new(@client).configuration }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'does a PUT to /uri/configuration and updates the attributes' do @@ -106,18 +114,7 @@ describe '#set_refresh_state' do it 'requires a uri' do - expect { OneviewSDK::Enclosure.new(@client).set_refresh_state(:state) }.to raise_error(/Please set uri/) - end - - it 'only permits certain states' do - allow(@client).to receive(:rest_put).and_return(FakeResponse.new) - - OneviewSDK::Enclosure::VALID_REFRESH_STATES.each do |i| - expect { OneviewSDK::Enclosure.new(@client, uri: '/rest/fake').set_refresh_state(i) }.to_not raise_error - end - expect { OneviewSDK::Enclosure.new(@client, uri: '/rest/fake').set_refresh_state('') }.to raise_error(/Invalid refreshState/) - expect { OneviewSDK::Enclosure.new(@client, uri: '/rest/fake').set_refresh_state('state') }.to raise_error(/Invalid refreshState/) - expect { OneviewSDK::Enclosure.new(@client, uri: '/rest/fake').set_refresh_state(nil) }.to raise_error(/Invalid refreshState/) + expect { OneviewSDK::Enclosure.new(@client).set_refresh_state(:state) }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'does a PUT to /refreshState' do @@ -139,7 +136,7 @@ describe '#script' do it 'requires a uri' do - expect { OneviewSDK::Enclosure.new(@client).script }.to raise_error(/Please set uri/) + expect { OneviewSDK::Enclosure.new(@client).script }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'gets uri/script' do @@ -152,7 +149,7 @@ describe '#environmentalConfiguration' do it 'requires a uri' do - expect { OneviewSDK::Enclosure.new(@client).environmental_configuration }.to raise_error(/Please set uri/) + expect { OneviewSDK::Enclosure.new(@client).environmental_configuration }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'gets uri/environmentalConfiguration' do @@ -164,7 +161,7 @@ describe '#utilization' do it 'requires a uri' do - expect { OneviewSDK::Enclosure.new(@client).utilization }.to raise_error(/Please set uri/) + expect { OneviewSDK::Enclosure.new(@client).utilization }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'gets uri/utilization' do @@ -198,34 +195,15 @@ describe '#updateAttribute' do it 'requires a uri' do - expect { OneviewSDK::Enclosure.new(@client).update_attribute(:op, :path, :val) }.to raise_error(/Please set uri/) + expect { OneviewSDK::Enclosure.new(@client).patch(:op, :path, :val) } + .to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'does a PATCH to the enclusre uri' do item = OneviewSDK::Enclosure.new(@client, uri: '/rest/fake') data = { 'body' => [{ op: 'operation', path: '/path', value: 'val' }] } expect(@client).to receive(:rest_patch).with('/rest/fake', data, item.api_version).and_return(FakeResponse.new(key: 'Val')) - expect(item.update_attribute('operation', '/path', 'val')).to eq('key' => 'Val') - end - end - - - describe 'validations' do - it 'only allows certain licensingIntent values' do - OneviewSDK::Enclosure::VALID_LICENSING_INTENTS.each do |intent| - expect { OneviewSDK::Enclosure.new(@client, licensingIntent: intent) }.to_not raise_error - end - expect { OneviewSDK::Enclosure.new(@client, licensingIntent: '') }.to raise_error(/Invalid licensingIntent/) - expect { OneviewSDK::Enclosure.new(@client, licensingIntent: 'invalid') }.to raise_error(/Invalid licensingIntent/) - end - - it 'only allows certain refreshState values' do - OneviewSDK::Enclosure::VALID_REFRESH_STATES.each do |i| - expect { OneviewSDK::Enclosure.new(@client, uri: '/rest/fake').validate_refreshState(i) }.to_not raise_error - end - expect { OneviewSDK::Enclosure.new(@client, uri: '/rest/fake').validate_refreshState('') }.to raise_error(/Invalid refreshState/) - expect { OneviewSDK::Enclosure.new(@client, uri: '/rest/fake').validate_refreshState('state') }.to raise_error(/Invalid refreshState/) - expect { OneviewSDK::Enclosure.new(@client, uri: '/rest/fake').validate_refreshState(nil) }.to raise_error(/Invalid refreshState/) + expect(item.patch('operation', '/path', 'val')).to eq('key' => 'Val') end end @@ -257,11 +235,23 @@ end it 'does not accepts other types' do - expect { @item.send(:convert_time, []) }.to raise_error(/Invalid time format/) + expect { @item.send(:convert_time, []) }.to raise_error(OneviewSDK::InvalidResource, /Invalid time format/) end it 'raises an error for invalid strings' do - expect { @item.send(:convert_time, 'badtime') }.to raise_error(/Failed to parse time/) + expect { @item.send(:convert_time, 'badtime') }.to raise_error(OneviewSDK::InvalidResource, /Failed to parse time/) + end + end + + describe 'undefined methods' do + it 'does not allow the create action' do + enclosure = OneviewSDK::Enclosure.new(@client) + expect { enclosure.create }.to raise_error(OneviewSDK::MethodUnavailable, /The method #create is unavailable for this resource/) + end + + it 'does not allow the delete action' do + enclosure = OneviewSDK::Enclosure.new(@client) + expect { enclosure.delete }.to raise_error(OneviewSDK::MethodUnavailable, /The method #delete is unavailable for this resource/) end end end diff --git a/spec/unit/resource/ethernet_network_spec.rb b/spec/unit/resource/ethernet_network_spec.rb index 2251984c5..f99c409e8 100644 --- a/spec/unit/resource/ethernet_network_spec.rb +++ b/spec/unit/resource/ethernet_network_spec.rb @@ -13,7 +13,8 @@ describe '#get_associated_profiles' do it 'requires a uri' do - expect { OneviewSDK::EthernetNetwork.new(@client).get_associated_profiles }.to raise_error(/Please set uri/) + expect { OneviewSDK::EthernetNetwork.new(@client).get_associated_profiles } + .to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'returns the response body from uri/associatedProfiles' do @@ -26,7 +27,8 @@ describe '#get_associated_uplink_groups' do it 'requires a uri' do - expect { OneviewSDK::EthernetNetwork.new(@client).get_associated_uplink_groups }.to raise_error(/Please set uri/) + expect { OneviewSDK::EthernetNetwork.new(@client).get_associated_uplink_groups } + .to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'returns the response body from uri/associatedUplinkGroups' do @@ -55,20 +57,4 @@ expect(list.length).to eq(3) end end - - describe 'validations' do - it 'validates ethernetNetworkType' do - OneviewSDK::EthernetNetwork::VALID_ETHERNET_NETWORK_TYPES.each do |i| - expect { OneviewSDK::EthernetNetwork.new(@client, ethernetNetworkType: i) }.to_not raise_error - end - expect { OneviewSDK::EthernetNetwork.new(@client, ethernetNetworkType: 'FakeType') }.to raise_error(/Invalid network type/) - end - - it 'validates the purpose' do - OneviewSDK::EthernetNetwork::VALID_PURPOSES.each do |i| - expect { OneviewSDK::EthernetNetwork.new(@client, purpose: i) }.to_not raise_error - end - expect { OneviewSDK::EthernetNetwork.new(@client, purpose: 'Fake') }.to raise_error(/Invalid ethernet purpose/) - end - end end diff --git a/spec/unit/resource/fabric_spec.rb b/spec/unit/resource/fabric_spec.rb new file mode 100644 index 000000000..52048b9fc --- /dev/null +++ b/spec/unit/resource/fabric_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::Fabric do + include_context 'shared context' + + describe 'Unavaible methods' do + it '#create' do + item = OneviewSDK::Fabric.new(@client, 'name' => 'unit_fabric') + expect { item.create }.to raise_error(OneviewSDK::MethodUnavailable, /unavailable for this resource/) + end + + it '#update' do + item = OneviewSDK::Fabric.new(@client, 'name' => 'unit_fabric') + expect { item.update }.to raise_error(OneviewSDK::MethodUnavailable, /unavailable for this resource/) + end + + it '#delete' do + item = OneviewSDK::Fabric.new(@client, 'name' => 'unit_fabric') + expect { item.delete }.to raise_error(OneviewSDK::MethodUnavailable, /unavailable for this resource/) + end + + it '#refresh' do + item = OneviewSDK::Fabric.new(@client, 'name' => 'unit_fabric') + expect { item.refresh }.to raise_error(OneviewSDK::MethodUnavailable, /unavailable for this resource/) + end + end +end diff --git a/spec/unit/resource/fc_network_spec.rb b/spec/unit/resource/fc_network_spec.rb index 4bab20bcf..9bb6852f4 100644 --- a/spec/unit/resource/fc_network_spec.rb +++ b/spec/unit/resource/fc_network_spec.rb @@ -12,29 +12,4 @@ expect(item[:fabricType]).to eq('FabricAttach') end end - - describe 'validations' do - it 'validates fabricType' do - OneviewSDK::FCNetwork::VALID_FABRIC_TYPES.each do |i| - expect { OneviewSDK::FCNetwork.new(@client, fabricType: i) }.to_not raise_error - end - expect { OneviewSDK::FCNetwork.new(@client, fabricType: 'FakeAttach') }.to raise_error(/Invalid fabric type/) - end - - it 'validates linkStabilityTime' do - options = { fabricType: 'FabricAttach', linkStabilityTime: 0 } - options2 = { fabricType: 'FabricAttach', linkStabilityTime: 1 } - options3 = { fabricType: 'FabricAttach', linkStabilityTime: 1800 } - options4 = { fabricType: 'FabricAttach', linkStabilityTime: 1801 } - expect { OneviewSDK::FCNetwork.new(@client, options) }.to raise_error(/Link stability time out of range/) - expect { OneviewSDK::FCNetwork.new(@client, options2) }.to_not raise_error - expect { OneviewSDK::FCNetwork.new(@client, options3) }.to_not raise_error - expect { OneviewSDK::FCNetwork.new(@client, options4) }.to raise_error(/Link stability time out of range/) - end - - it 'does not validate linkStabilityTime for DirectAttach networks' do - options = { fabricType: 'DirectAttach', linkStabilityTime: 0 } - expect { OneviewSDK::FCNetwork.new(@client, options) }.to_not raise_error - end - end end diff --git a/spec/unit/resource/fcoe_network_spec.rb b/spec/unit/resource/fcoe_network_spec.rb index e770ae7af..d57cf2ddf 100644 --- a/spec/unit/resource/fcoe_network_spec.rb +++ b/spec/unit/resource/fcoe_network_spec.rb @@ -10,13 +10,4 @@ expect(item[:connectionTemplateUri]).to eq(nil) end end - - describe 'validations' do - it 'validates vlanId' do - described_class::VALID_VLAN_IDS.each do |i| - expect { described_class.new(@client, vlanId: i) }.to_not raise_error - end - expect { described_class.new(@client, vlanId: 0) }.to raise_error(/vlanId out of range/) - end - end end diff --git a/spec/unit/resource/firmware_bundle_spec.rb b/spec/unit/resource/firmware_bundle_spec.rb index 23680faef..5b08803b1 100644 --- a/spec/unit/resource/firmware_bundle_spec.rb +++ b/spec/unit/resource/firmware_bundle_spec.rb @@ -3,61 +3,23 @@ RSpec.describe OneviewSDK::FirmwareBundle do include_context 'shared context' - describe '#upload' do - before :each do - allow_any_instance_of(OneviewSDK::Client).to receive(:response_handler).and_return(uri: '/rest/fake') - allow_any_instance_of(OneviewSDK::Client).to receive(:rest_post).and_return(true) + describe '#add' do + it 'fails if the file does not exist' do + expect { described_class.add(@client, 'file.fake') }.to raise_error(OneviewSDK::NotFound, //) end it 'returns a FirmwareDriver resource' do - driver = OneviewSDK::FirmwareBundle.upload(@client, __FILE__) - expect(driver.class).to eq(OneviewSDK::FirmwareDriver) - expect(driver['uri']).to eq('/rest/fake') - end - - it 'recognizes the .zip file format' do - file = '/tmp/file.zip' - expect(@client).to receive(:rest_post).with( - OneviewSDK::FirmwareBundle::BASE_URI, - hash_including( - 'body' => %r{Content-Type: application/x-zip-compressed\r\n\r\nFAKE FILE CONTENT\r\n--}, - 'uploadfilename' => 'file.zip', - 'Content-Type' => "multipart/form-data; boundary=#{OneviewSDK::FirmwareBundle::BOUNDARY}" - ) - ) - expect(File).to receive('file?').and_return(true) - allow(File).to receive(:read).and_return('FAKE FILE CONTENT') - OneviewSDK::FirmwareBundle.upload(@client, file) - end - - it 'recognizes the .exe file format' do - file = '/tmp/file.exe' - expect(@client).to receive(:rest_post).with( - OneviewSDK::FirmwareBundle::BASE_URI, - hash_including( - 'body' => %r{Content-Type: application/x-msdownload\r\n\r\nFAKE FILE CONTENT\r\n--}, - 'uploadfilename' => 'file.exe', - 'Content-Type' => "multipart/form-data; boundary=#{OneviewSDK::FirmwareBundle::BOUNDARY}" - ) - ) - expect(File).to receive('file?').and_return(true) - allow(File).to receive(:read).and_return('FAKE FILE CONTENT') - OneviewSDK::FirmwareBundle.upload(@client, file) - end - - it 'defaults to type: application/octet-stream for other files' do - file = '/tmp/file.tar' expect(@client).to receive(:rest_post).with( OneviewSDK::FirmwareBundle::BASE_URI, hash_including( - 'body' => %r{Content-Type: application/octet-stream\r\n\r\nFAKE FILE CONTENT\r\n--}, + 'body' => %r{Content-Type: application/octet-stream; Content-Transfer-Encoding: binary\r\n\r\nFAKE FILE CONTENT\r\n--}, 'uploadfilename' => 'file.tar', 'Content-Type' => "multipart/form-data; boundary=#{OneviewSDK::FirmwareBundle::BOUNDARY}" ) - ) + ).and_return(FakeResponse.new({})) expect(File).to receive('file?').and_return(true) - allow(File).to receive(:read).and_return('FAKE FILE CONTENT') - OneviewSDK::FirmwareBundle.upload(@client, file) + allow(IO).to receive(:binread).and_return('FAKE FILE CONTENT') + OneviewSDK::FirmwareBundle.add(@client, 'file.tar') end end end diff --git a/spec/unit/resource/firmware_driver_spec.rb b/spec/unit/resource/firmware_driver_spec.rb index a186709a7..7bbd09865 100644 --- a/spec/unit/resource/firmware_driver_spec.rb +++ b/spec/unit/resource/firmware_driver_spec.rb @@ -3,25 +3,23 @@ RSpec.describe OneviewSDK::FirmwareDriver do include_context 'shared context' - describe '#initialize' do - it 'sets the type correctly' do - profile = OneviewSDK::FirmwareDriver.new(@client) - expect(profile[:type]).to eq('firmware-baselines') + describe '#remove' do + it 'Should support remove' do + firmware = OneviewSDK::FirmwareDriver.new(@client, uri: '/rest/firmware-drivers/100') + expect(@client).to receive(:rest_delete).with('/rest/firmware-drivers/100', {}, 200).and_return(FakeResponse.new({})) + firmware.remove end end describe 'undefined methods' do - before :each do - @item = OneviewSDK::FirmwareDriver.new(@client, {}) - end - - it 'does not allow the create action' do - expect { @item.create }.to raise_error(/not available for this resource/) - end - it 'does not allow the update action' do - expect { @item.update }.to raise_error(/not available for this resource/) + item = OneviewSDK::FirmwareDriver.new(@client, {}) + expect { item.update }.to raise_error(OneviewSDK::MethodUnavailable) end + it 'does not allow the delete action' do + item = OneviewSDK::FirmwareDriver.new(@client, {}) + expect { item.delete }.to raise_error(OneviewSDK::MethodUnavailable) + end end end diff --git a/spec/unit/resource/lig_uplink_set_spec.rb b/spec/unit/resource/lig_uplink_set_spec.rb index 5f2e07214..9665342d3 100644 --- a/spec/unit/resource/lig_uplink_set_spec.rb +++ b/spec/unit/resource/lig_uplink_set_spec.rb @@ -13,37 +13,12 @@ end end - describe 'validations' do - it 'validates ethernetNetworkType' do - described_class::VALID_ETHERNET_NETWORK_TYPES.each do |i| - expect { described_class.new(@client, ethernetNetworkType: i) }.not_to raise_error - end - expect { described_class.new(@client, ethernetNetworkType: 'Auto') }.to raise_error(/Invalid ethernetNetworkType/) - end - it 'Invalid network type' do - options = { networkType: 'N/A' } - expect { OneviewSDK::LIGUplinkSet.new(@client, options) }.to raise_error(/Invalid network type/) - end - it 'Ethernet without type' do - options = { networkType: 'Ethernet' } - expect { OneviewSDK::LIGUplinkSet.new(@client, options) }.to raise_error(/Attribute missing/) - end - it 'Valid Ethernet' do - options = { networkType: 'Ethernet', ethernetNetworkType: 'Tagged' } - expect { OneviewSDK::LIGUplinkSet.new(@client, options) }.not_to raise_error - end - it 'FibreChannel with type' do - options = { networkType: 'FibreChannel', ethernetNetworkType: 'Tagged' } - expect { OneviewSDK::LIGUplinkSet.new(@client, options) }.to raise_error(/Attribute not supported/) - end - end - describe 'adds' do def_options = { networkType: 'Ethernet', ethernetNetworkType: 'NotApplicable' } it 'Add empty network resource' do upset = OneviewSDK::LIGUplinkSet.new(@client, def_options) net = OneviewSDK::EthernetNetwork.new(@client, {}) - expect { upset.add_network(net) }.to raise_error(/Resource not retrieved from server/) + expect { upset.add_network(net) }.to raise_error(OneviewSDK::IncompleteResource, /Must set/) end it 'Add retrieved network resource' do options = { networkType: 'Ethernet', ethernetNetworkType: 'NotApplicable' } @@ -61,7 +36,7 @@ end it 'Add not supported port' do upset = OneviewSDK::LIGUplinkSet.new(@client, def_options) - expect { upset.add_uplink(1, 'V5') }.to raise_error(/Port not supported/) + expect { upset.add_uplink(1, 'V5') }.to raise_error(OneviewSDK::InvalidResource, /Port not supported/) end end diff --git a/spec/unit/resource/logical_downlink_spec.rb b/spec/unit/resource/logical_downlink_spec.rb new file mode 100644 index 000000000..8196d046b --- /dev/null +++ b/spec/unit/resource/logical_downlink_spec.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::LogicalDownlink do + include_context 'shared context' + + describe '#create' do + it 'is unavailable' do + logical_downlink = OneviewSDK::LogicalDownlink.new(@client) + expect { logical_downlink.create }.to raise_error(OneviewSDK::MethodUnavailable, /The method #create is unavailable for this resource/) + end + end + + describe '#delete' do + it 'is unavailable' do + logical_downlink = OneviewSDK::LogicalDownlink.new(@client) + expect { logical_downlink.delete }.to raise_error(OneviewSDK::MethodUnavailable, /The method #delete is unavailable for this resource/) + end + end + + describe '#update' do + it 'is unavailable' do + logical_downlink = OneviewSDK::LogicalDownlink.new(@client) + expect { logical_downlink.update }.to raise_error(OneviewSDK::MethodUnavailable, /The method #update is unavailable for this resource/) + end + end + + describe '#get_without_ethernet' do + it 'retrieve logical downlinks without ethernet' do + expect(@client).to receive(:rest_get).with('/rest/logical-downlinks/ld1/withoutEthernet').and_return(FakeResponse.new({})) + logical_downlink = OneviewSDK::LogicalDownlink.new(@client, uri: '/rest/logical-downlinks/ld1') + logical_downlink.get_without_ethernet + expect(logical_downlink.class).to eq(described_class) + end + end + + describe '#self.get_without_ethernet' do + it 'retrieve logical downlinks without ethernet' do + expect(@client).to receive(:rest_get).with('/rest/logical-downlinks/withoutEthernet').and_return(FakeResponse.new('members' => [{}])) + logical_downlinks = OneviewSDK::LogicalDownlink.get_without_ethernet(@client) + expect(logical_downlinks.first.class).to eq(described_class) + end + end + +end diff --git a/spec/unit/resource/logical_enclosure_spec.rb b/spec/unit/resource/logical_enclosure_spec.rb index 382501bfa..f1d3387b6 100644 --- a/spec/unit/resource/logical_enclosure_spec.rb +++ b/spec/unit/resource/logical_enclosure_spec.rb @@ -12,25 +12,6 @@ end end - describe '#validate' do - context 'valid values' do - it 'allows valids fabricTypes' do - logical_enclosure = OneviewSDK::LogicalEnclosure.new(@client) - described_class::VALID_FABRIC_TYPES.each do |value| - logical_enclosure[:fabricType] = value - expect(logical_enclosure[:fabricType]).to eq(value) - end - end - end - - context 'with invalid values' do - it 'rejects an invalid fabricType' do - logical_enclosure = OneviewSDK::LogicalEnclosure.new(@client) - expect { logical_enclosure[:fabricType] = 'None' }.to raise_error.with_message(/Invalid fabric type/) - end - end - end - describe 'helper-methods' do before :each do @item = OneviewSDK::LogicalEnclosure.new(@client, uri: '/rest/logical-enclosures/fake') diff --git a/spec/unit/resource/logical_interconnect_spec.rb b/spec/unit/resource/logical_interconnect_spec.rb index 77a362dc7..69299c986 100644 --- a/spec/unit/resource/logical_interconnect_spec.rb +++ b/spec/unit/resource/logical_interconnect_spec.rb @@ -13,7 +13,7 @@ describe '#create' do it 'requires the enclosure to have a uri value' do - expect { log_int.create(1, OneviewSDK::Enclosure.new(@client)) }.to raise_error(/Please set uri/) + expect { log_int.create(1, OneviewSDK::Enclosure.new(@client)) }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'makes a POST call to the base uri' do @@ -25,7 +25,7 @@ describe '#delete' do it 'requires the enclosure to have a uri value' do - expect { log_int.delete(1, OneviewSDK::Enclosure.new(@client)) }.to raise_error(/Please set uri/) + expect { log_int.delete(1, OneviewSDK::Enclosure.new(@client)) }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'makes a DELETE call to the base uri' do @@ -38,11 +38,13 @@ describe '#update_ethernet_settings' do it 'requires the uri to be set' do - expect { OneviewSDK::LogicalInterconnect.new(@client).update_ethernet_settings }.to raise_error(/Please set uri/) + expect { OneviewSDK::LogicalInterconnect.new(@client).update_ethernet_settings } + .to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'requires the ethernetSettings attribute to be set' do - expect { OneviewSDK::LogicalInterconnect.new(@client, uri: '/rest/fake').update_ethernet_settings }.to raise_error(/Please retrieve/) + expect { OneviewSDK::LogicalInterconnect.new(@client, uri: '/rest/fake').update_ethernet_settings } + .to raise_error(OneviewSDK::IncompleteResource, /Please retrieve/) end it 'does a PUT to uri/ethernetSettings & updates @data' do @@ -56,7 +58,8 @@ describe '#update_settings' do it 'requires the uri to be set' do - expect { OneviewSDK::LogicalInterconnect.new(@client).update_ethernet_settings }.to raise_error(/Please set uri/) + expect { OneviewSDK::LogicalInterconnect.new(@client).update_ethernet_settings } + .to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'does a PUT to uri/settings & updates @data' do @@ -70,7 +73,7 @@ describe '#compliance' do it 'requires the uri to be set' do - expect { OneviewSDK::LogicalInterconnect.new(@client).compliance }.to raise_error(/Please set uri/) + expect { OneviewSDK::LogicalInterconnect.new(@client).compliance }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'does a PUT to uri/compliance & updates @data' do @@ -84,7 +87,7 @@ describe '#configuration' do it 'requires the uri to be set' do - expect { OneviewSDK::LogicalInterconnect.new(@client).configuration }.to raise_error(/Please set uri/) + expect { OneviewSDK::LogicalInterconnect.new(@client).configuration }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'does a PUT to uri/configuration & updates @data' do @@ -125,37 +128,11 @@ expect(entry['trapFormat']).to eq('SNMPv1') expect(entry['communityString']).to eq('public') end - - describe 'will not let weird values in the fields' do - it 'enetTrapCategories' do - enet_trap.push('WeirdValue') - expect { log_int.generate_trap_options(enet_trap, fc_trap, vcm_trap, trap_sev) }.to raise_error(/not one of the allowed values/) - end - - it 'fcTrapCategories' do - enet_trap.push('WeirdValue') - expect { log_int.generate_trap_options(enet_trap, fc_trap, vcm_trap, trap_sev) }.to raise_error(/not one of the allowed values/) - end - - it 'vcmTrapCategories' do - enet_trap.push('WeirdValue') - expect { log_int.generate_trap_options(enet_trap, fc_trap, vcm_trap, trap_sev) }.to raise_error(/not one of the allowed values/) - end - - it 'trapSeverities' do - enet_trap.push('WeirdValue') - expect { log_int.generate_trap_options(enet_trap, fc_trap, vcm_trap, trap_sev) }.to raise_error(/not one of the allowed values/) - end - - it 'trapFormat' do - expect { log_int.add_snmp_trap_destination('172.18.6.16', 'NO_VERSION', 'public') } - end - end end describe '#get_firmware' do it 'requires the uri to be set' do - expect { OneviewSDK::LogicalInterconnect.new(@client).get_firmware }.to raise_error(/Please set uri/) + expect { OneviewSDK::LogicalInterconnect.new(@client).get_firmware }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'gets uri/firmware & returns the result' do @@ -166,7 +143,8 @@ describe '#firmware_update' do it 'requires the uri to be set' do - expect { OneviewSDK::LogicalInterconnect.new(@client).firmware_update(:cmd, nil, {}) }.to raise_error(/Please set uri/) + expect { OneviewSDK::LogicalInterconnect.new(@client).firmware_update(:cmd, nil, {}) } + .to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) end it 'does a PUT to uri/firmware & returns the result' do @@ -175,45 +153,4 @@ expect(log_int.firmware_update('cmd', driver, {})).to eq('key' => 'val') end end - - describe 'validations' do - before :each do - @item = OneviewSDK::LogicalInterconnect.new(@client) - end - - it 'only allows certain enet_trap_categories' do - %w(Other PortStatus PortThresholds).each do |v| - @item.send(:validate_enet_trap_categories, [v]) - end - expect { @item.send(:validate_enet_trap_categories, ['fake']) }.to raise_error(/not.*allowed/) - end - - it 'only allows certain fc_trap_categories' do - %w(Other PortStatus).each do |v| - @item.send(:validate_fc_trap_categories, [v]) - end - expect { @item.send(:validate_fc_trap_categories, ['fake']) }.to raise_error(/not.*allowed/) - end - - it 'only allows certain vcm_trap_categories' do - %w(Legacy).each do |v| - @item.send(:validate_vcm_trap_categories, [v]) - end - expect { @item.send(:validate_vcm_trap_categories, ['fake']) }.to raise_error(/not.*allowed/) - end - - it 'only allows certain trap_severities' do - %w(Critical Info Major Minor Normal Unknown Warning).each do |v| - @item.send(:validate_trap_severities, [v]) - end - expect { @item.send(:validate_trap_severities, ['fake']) }.to raise_error(/not.*allowed/) - end - - it 'only allows certain trap_format' do - %w(SNMPv1 SNMPv2 SNMPv3).each do |v| - @item.send(:validate_trap_format, v) - end - expect { @item.send(:validate_trap_format, 'fake') }.to raise_error(/not.*allowed/) - end - end end diff --git a/spec/unit/resource/logical_switch_group_spec.rb b/spec/unit/resource/logical_switch_group_spec.rb new file mode 100644 index 000000000..b6f21a904 --- /dev/null +++ b/spec/unit/resource/logical_switch_group_spec.rb @@ -0,0 +1,38 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::LogicalSwitchGroup do + include_context 'shared context' + + describe '#initialize' do + it 'sets the defaults correctly' do + item = OneviewSDK::LogicalSwitchGroup.new(@client) + expect(item['category']).to eq('logical-switch-groups') + expect(item['state']).to eq('Active') + expect(item['type']).to eq('logical-switch-group') + expect(item['switchMapTemplate']).to be + end + end + + describe '#set_grouping_parameters' do + before :each do + @item = OneviewSDK::LogicalSwitchGroup.new(@client) + @type = 'Cisco Nexus 55xx' + end + + it 'defines a valid siwtch group' do + expect(OneviewSDK::Switch).to receive(:get_type).with(@client, @type) + .and_return('uri' => '/rest/fake') + @item.set_grouping_parameters(1, @type) + expect(@item['switchMapTemplate']['switchMapEntryTemplates'].first['permittedSwitchTypeUri']) + .to eq('/rest/fake') + end + + it 'raises an error if the switch is not found' do + expect(OneviewSDK::Switch).to receive(:get_type).with(@client, @type) + .and_return([]) + expect(OneviewSDK::Switch).to receive(:get_types).and_return([{ 'name' => '1' }, { 'name' => '2' }]) + expect { @item.set_grouping_parameters(1, @type) }.to raise_error(/not found!/) + end + end + +end diff --git a/spec/unit/resource/logical_switch_spec.rb b/spec/unit/resource/logical_switch_spec.rb new file mode 100644 index 000000000..8689f69f5 --- /dev/null +++ b/spec/unit/resource/logical_switch_spec.rb @@ -0,0 +1,237 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::LogicalSwitch do + include_context 'shared context' + + describe '#initialize' do + context 'OneView 2.0' do + it 'sets the defaults correctly' do + logical_switch = OneviewSDK::LogicalSwitch.new(@client) + expect(logical_switch[:type]).to eq('logical-switch') + end + end + end + + describe 'Validate structs' do + it 'SSH credentials' do + ssh_credentials = OneviewSDK::LogicalSwitch::CredentialsSSH.new('ssh_user', 'ssh_password') + expect(ssh_credentials.user).to eq('ssh_user') + expect(ssh_credentials.password).to eq('ssh_password') + end + + it 'SNMPv1 Credentials' do + snmp_v1 = OneviewSDK::LogicalSwitch::CredentialsSNMPV1.new(161, 'public') + expect(snmp_v1.port).to eq(161) + expect(snmp_v1.community_string).to eq('public') + expect(snmp_v1.version).to eq('SNMPv1') + end + + it 'SNMPv3 Credentials' do + snmp_v3 = OneviewSDK::LogicalSwitch::CredentialsSNMPV3.new(161, 'user', 'MD5', 'auth_password', 'AES128', 'privacy_password') + expect(snmp_v3.port).to eq(161) + expect(snmp_v3.user).to eq('user') + expect(snmp_v3.auth_protocol).to eq('MD5') + expect(snmp_v3.auth_password).to eq('auth_password') + expect(snmp_v3.privacy_protocol).to eq('AES128') + expect(snmp_v3.privacy_password).to eq('privacy_password') + expect(snmp_v3.version).to eq('SNMPv3') + end + end + + describe '#refresh' do + it 'Refresh' do + item = OneviewSDK::LogicalSwitch.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_put).with("#{item['uri']}/refresh").and_return(FakeResponse.new({})) + item.refresh + end + end + + describe '#set_logical_switch_group' do + it 'Valid logical switch group' do + logical_switch_group = { 'uri' => '/rest/fake/logical-switch-groups' } + item = OneviewSDK::LogicalSwitch.new(@client) + item.set_logical_switch_group(logical_switch_group) + expect(item['logicalSwitchGroupUri']).to eq('/rest/fake/logical-switch-groups') + end + end + + describe '#set_switch_credentials' do + it 'Valid structure and host for SNMPv1' do + item = OneviewSDK::LogicalSwitch.new(@client) + ssh_credentials = OneviewSDK::LogicalSwitch::CredentialsSSH.new('ssh_user', 'ssh_password') + snmp_v1 = OneviewSDK::LogicalSwitch::CredentialsSNMPV1.new(161, 'public') + item.set_switch_credentials('127.0.0.1', ssh_credentials, snmp_v1) + expect(item.logical_switch_credentials['127.0.0.1'][0]).to eq(ssh_credentials) + expect(item.logical_switch_credentials['127.0.0.1'][1]).to eq(snmp_v1) + end + + it 'Valid structure and host for SNMPv3' do + item = OneviewSDK::LogicalSwitch.new(@client) + ssh_credentials = OneviewSDK::LogicalSwitch::CredentialsSSH.new('ssh_user', 'ssh_password') + snmp_v3 = OneviewSDK::LogicalSwitch::CredentialsSNMPV3.new(161, 'public', 'MD5', 'auth_password', 'AES128', 'privacy_password') + item.set_switch_credentials('127.0.0.1', ssh_credentials, snmp_v3) + expect(item.logical_switch_credentials['127.0.0.1'][0]).to eq(ssh_credentials) + expect(item.logical_switch_credentials['127.0.0.1'][1]).to eq(snmp_v3) + end + + it 'Invalid SSH crendential parameter' do + item = OneviewSDK::LogicalSwitch.new(@client) + SSHFake = Struct.new(:user, :password) + ssh_credentials = SSHFake.new('ssh_user', 'ssh_password') + snmp_v1 = OneviewSDK::LogicalSwitch::CredentialsSNMPV1.new(161, 'public') + expect { item.set_switch_credentials('127.0.0.1', ssh_credentials, snmp_v1) }.to raise_error( + TypeError, /Use struct/ + ) + end + + it 'Invalid SNMP credential parameter' do + item = OneviewSDK::LogicalSwitch.new(@client) + ssh_credentials = OneviewSDK::LogicalSwitch::CredentialsSSH.new('ssh_user', 'ssh_password') + SNMPFake = Struct.new(:port, :community_string, :version) do + def version + 'SNMP' + end + end + snmp_v1 = SNMPFake.new(161, 'public') + expect { item.set_switch_credentials('127.0.0.1', ssh_credentials, snmp_v1) }.to raise_error( + TypeError, /Use struct/ + ) + end + end + + describe '#create' do + it 'Basic structure' do + logical_switch = OneviewSDK::LogicalSwitch.new(@client) + expect(@client).to receive(:rest_post).with( + '/rest/logical-switches', + { + 'body' => { + 'logicalSwitch' => { + 'type' => 'logical-switch', + 'switchCredentialConfiguration' => [] + }, + 'logicalSwitchCredentials' => [] + } + }, + 200 + ).and_return(FakeResponse.new({})) + logical_switch.create + end + + it 'Adding SNMPv1 switch' do + logical_switch = OneviewSDK::LogicalSwitch.new(@client) + ssh_credentials = OneviewSDK::LogicalSwitch::CredentialsSSH.new('ssh_user', 'ssh_password') + snmp_v1 = OneviewSDK::LogicalSwitch::CredentialsSNMPV1.new(161, 'public') + logical_switch.set_switch_credentials('127.0.0.1', ssh_credentials, snmp_v1) + expect(@client).to receive(:rest_post).with( + '/rest/logical-switches', + { + 'body' => { + 'logicalSwitch' => { + 'type' => 'logical-switch', + 'switchCredentialConfiguration' => [ + { + 'snmpPort' => 161, + 'snmpV3Configuration' => nil, + 'snmpV1Configuration' => { + 'communityString' => 'public' + }, + 'logicalSwitchManagementHost' => '127.0.0.1', + 'snmpVersion' => 'SNMPv1' + } + ] + }, + 'logicalSwitchCredentials' => [ + { + 'connectionProperties' => [ + { + 'valueFormat' => 'Unknown', + 'propertyName' => 'SshBasicAuthCredentialUser', + 'valueType' => 'String', + 'value' => 'ssh_user' + }, + { + 'valueFormat' => 'SecuritySensitive', + 'propertyName' => 'SshBasicAuthCredentialPassword', + 'valueType' => 'String', + 'value' => 'ssh_password' + } + ] + } + ] + } + }, + 200 + ).and_return(FakeResponse.new({})) + logical_switch.create + end + + it 'Adding SNMPv3 switch' do + logical_switch = OneviewSDK::LogicalSwitch.new(@client) + ssh_credentials = OneviewSDK::LogicalSwitch::CredentialsSSH.new('ssh_user', 'ssh_password') + snmp_v3 = OneviewSDK::LogicalSwitch::CredentialsSNMPV3.new(161, 'user', 'MD5', 'auth_password', 'AES128', 'privacy_password') + logical_switch.set_switch_credentials('127.0.0.1', ssh_credentials, snmp_v3) + expect(@client).to receive(:rest_post).with( + '/rest/logical-switches', + { + 'body' => { + 'logicalSwitch' => { + 'type' => 'logical-switch', + 'switchCredentialConfiguration' => [ + { + 'snmpPort' => 161, + 'snmpV3Configuration' => { + 'securityLevel' => 'AuthPrivacy', + 'privacyProtocol' => 'AES128', + 'authorizationProtocol' => 'MD5' + }, + 'snmpV1Configuration' => nil, + 'logicalSwitchManagementHost' => '127.0.0.1', + 'snmpVersion' => 'SNMPv3' + } + ] + }, + 'logicalSwitchCredentials' => [ + { + 'connectionProperties' => [ + { + 'valueFormat' => 'Unknown', + 'propertyName' => 'SshBasicAuthCredentialUser', + 'valueType' => 'String', + 'value' => 'ssh_user' + }, + { + 'valueFormat' => 'SecuritySensitive', + 'propertyName' => 'SshBasicAuthCredentialPassword', + 'valueType' => 'String', + 'value' => 'ssh_password' + }, + { + 'valueFormat' => 'SecuritySensitive', + 'propertyName' => 'SnmpV3AuthorizationPassword', + 'valueType' => 'String', + 'value' => 'auth_password' + }, + { + 'valueFormat' => 'Unknown', + 'propertyName' => 'SnmpV3User', + 'valueType' => 'String', + 'value' => 'user' + }, + { + 'valueFormat' => 'SecuritySensitive', + 'propertyName' => 'SnmpV3PrivacyPassword', + 'valueType' => 'String', + 'value' => 'privacy_password' + } + ] + } + ] + } + }, + 200 + ).and_return(FakeResponse.new({})) + logical_switch.create + end + end +end diff --git a/spec/unit/resource/managed_san_spec.rb b/spec/unit/resource/managed_san_spec.rb new file mode 100644 index 000000000..451180779 --- /dev/null +++ b/spec/unit/resource/managed_san_spec.rb @@ -0,0 +1,94 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::ManagedSAN do + include_context 'shared context' + + describe '#create' do + it 'is unavailable' do + san = OneviewSDK::ManagedSAN.new(@client) + expect { san.create }.to raise_error(/The method #create is unavailable for this resource/) + end + end + + describe '#delete' do + it 'is unavailable' do + san = OneviewSDK::ManagedSAN.new(@client) + expect { san.delete }.to raise_error(/The method #delete is unavailable for this resource/) + end + end + + describe '#update' do + it 'is unavailable' do + san = OneviewSDK::ManagedSAN.new(@client) + expect { san.update }.to raise_error(/The method #update is unavailable for this resource/) + end + end + + describe '#get_endpoints' do + it 'List endpoints' do + san = OneviewSDK::ManagedSAN.new(@client, uri: '/rest/fc-sans/managed-sans/100') + expect(@client).to receive(:rest_get).with('/rest/fc-sans/managed-sans/100/endpoints').and_return(FakeResponse.new({})) + expect { san.get_endpoints }.not_to raise_error + end + end + + describe '#set_refresh_state' do + it 'Refresh managed SAN' do + san = OneviewSDK::ManagedSAN.new(@client, uri: '/rest/fc-sans/managed-sans/100') + expect(@client).to receive(:rest_put).with( + '/rest/fc-sans/managed-sans/100', + 'body' => { refreshState: 'RefreshPending' } + ).and_return(FakeResponse.new({})) + san.set_refresh_state('RefreshPending') + end + end + + describe '#set_public_attributes' do + it 'Update public attributes' do + attributes = [ + { + name: 'MetaSan', + value: 'Neon SAN', + valueType: 'String', + valueFormat: 'None' + } + ] + san = OneviewSDK::ManagedSAN.new(@client, uri: '/rest/fc-sans/managed-sans/100') + expect(@client).to receive(:rest_put).with( + '/rest/fc-sans/managed-sans/100', + 'body' => { publicAttributes: attributes } + ).and_return(FakeResponse.new({})) + san.set_public_attributes(attributes) + end + end + + describe '#set_san_policy' do + it 'Update san policy' do + policy = { + zoningPolicy: 'SingleInitiatorAllTargets', + zoneNameFormat: '{hostName}_{initiatorWwn}', + enableAliasing: true, + initiatorNameFormat: '{hostName}_{initiatorWwn}', + targetNameFormat: '{storageSystemName}_{targetName}', + targetGroupNameFormat: '{storageSystemName}_{targetGroupName}' + } + san = OneviewSDK::ManagedSAN.new(@client, uri: '/rest/fc-sans/managed-sans/100') + expect(@client).to receive(:rest_put).with( + '/rest/fc-sans/managed-sans/100', + 'body' => { sanPolicy: policy } + ).and_return(FakeResponse.new({})) + san.set_san_policy(policy) + end + end + + describe '#get_zoning_report' do + it 'Retrieve zoning report' do + san = OneviewSDK::ManagedSAN.new(@client, uri: '/rest/fc-sans/managed-sans/100') + expect(@client).to receive(:rest_post).with( + '/rest/fc-sans/managed-sans/100/issues', + 'body' => {} + ).and_return(FakeResponse.new({})) + san.get_zoning_report + end + end +end diff --git a/spec/unit/resource/network_set_spec.rb b/spec/unit/resource/network_set_spec.rb new file mode 100644 index 000000000..73065320e --- /dev/null +++ b/spec/unit/resource/network_set_spec.rb @@ -0,0 +1,85 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::NetworkSet do + include_context 'shared context' + + describe '#initialize' do + it 'sets the defaults correctly api_ver 200' do + item = OneviewSDK::NetworkSet.new(@client, {}, 200) + expect(item['connectionTemplateUri']).to eq(nil) + expect(item['nativeNetworkUri']).to eq(nil) + expect(item['networkUris']).to eq([]) + expect(item['type']).to eq('network-set') + end + end + + describe '#set_native_network' do + it 'sets native network for network set' do + eth1 = OneviewSDK::EthernetNetwork.new(@client, uri: '/rest/ethernet-networks/eth1') + item = OneviewSDK::NetworkSet.new(@client, {}, 200) + item.set_native_network(eth1) + expect(item['nativeNetworkUri']).to eq(eth1['uri']) + end + end + + describe '#add_ethernet_network' do + it 'add ethernet network to network set' do + eth1 = OneviewSDK::EthernetNetwork.new(@client, uri: '/rest/ethernet-networks/eth1') + item = OneviewSDK::NetworkSet.new(@client, {}, 200) + item.add_ethernet_network(eth1) + expect(item['networkUris']).to include(eth1['uri']) + end + + it 'add multiple ethernet networks to network set' do + eth1 = OneviewSDK::EthernetNetwork.new(@client, uri: '/rest/ethernet-networks/eth1') + eth2 = OneviewSDK::EthernetNetwork.new(@client, uri: '/rest/ethernet-networks/eth2') + item = OneviewSDK::NetworkSet.new(@client, {}, 200) + item.add_ethernet_network(eth1) + item.add_ethernet_network(eth2) + expect(item['networkUris']).to include(eth1['uri']) + expect(item['networkUris']).to include(eth2['uri']) + end + end + + describe '#remove_ethernet_network' do + it 'remove ethernet network from network set' do + eth1 = OneviewSDK::EthernetNetwork.new(@client, uri: '/rest/ethernet-networks/eth1') + item = OneviewSDK::NetworkSet.new(@client, {}, 200) + item.add_ethernet_network(eth1) + expect(item['networkUris']).to include(eth1['uri']) + item.remove_ethernet_network(eth1) + expect(item['networkUris']).to_not include(eth1['uri']) + end + + it 'remove multiple ethernet networks from network set' do + eth1 = OneviewSDK::EthernetNetwork.new(@client, uri: '/rest/ethernet-networks/eth1') + eth2 = OneviewSDK::EthernetNetwork.new(@client, uri: '/rest/ethernet-networks/eth2') + item = OneviewSDK::NetworkSet.new(@client, {}, 200) + item.add_ethernet_network(eth1) + item.add_ethernet_network(eth2) + expect(item['networkUris']).to include(eth1['uri']) + expect(item['networkUris']).to include(eth2['uri']) + + item.remove_ethernet_network(eth2) + expect(item['networkUris']).to include(eth1['uri']) + expect(item['networkUris']).to_not include(eth2['uri']) + + item.remove_ethernet_network(eth1) + expect(item['networkUris']).to_not include(eth1['uri']) + expect(item['networkUris']).to_not include(eth2['uri']) + end + end + + describe '#get_without_ethernet' do + it 'instance get network set without ethernet' do + item = OneviewSDK::NetworkSet.new(@client, uri: '/rest/network-sets/nset1') + expect(@client).to receive(:rest_get).with('/rest/network-sets/nset1/withoutEthernet').and_return(FakeResponse.new({})) + item.get_without_ethernet + end + + it 'class get network set without ethernet' do + expect(@client).to receive(:rest_get).with('/rest/network-sets/withoutEthernet').and_return(FakeResponse.new({})) + OneviewSDK::NetworkSet.get_without_ethernet(@client) + end + end +end diff --git a/spec/unit/resource/power_device_spec.rb b/spec/unit/resource/power_device_spec.rb new file mode 100644 index 000000000..d3325b3be --- /dev/null +++ b/spec/unit/resource/power_device_spec.rb @@ -0,0 +1,203 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +require 'spec_helper' + +RSpec.describe OneviewSDK::PowerDevice do + include_context 'shared context' + + before :each do + @item = OneviewSDK::PowerDevice.new(@client, uri: '/rest/fake') + end + + describe '#initialize' do + it 'sets the defaults correctly' do + expect(@item['deviceType']).to eq('BranchCircuit') + expect(@item['phaseType']).to eq('Unknown') + expect(@item['powerConnections']).to eq([]) + end + end + + describe '#add_connection' do + it 'add one connection' do + resource = Hash.new(uri: '/rest/enclosure/fake-encl1') + @item.add_connection(resource, 1) + connection = @item['powerConnections'].first + expect(connection['connectionUri']).to eq(resource[:uri]) + expect(connection['deviceConnection']).to eq(1) + end + + it 'add multiple connections' do + resource = Hash.new(uri: '/rest/enclosure/fake-encl1') + @item.add_connection(resource, 1) + @item.add_connection(resource, 2) + connection1 = @item['powerConnections'].first + connection2 = @item['powerConnections'].last + expect(connection1['connectionUri']).to eq(resource[:uri]) + expect(connection1['deviceConnection']).to eq(1) + expect(connection2['connectionUri']).to eq(resource[:uri]) + expect(connection2['deviceConnection']).to eq(2) + end + end + + describe '#remove_connection' do + it 'remove connection' do + resource = Hash.new(uri: '/rest/enclosure/fake-encl1') + @item.add_connection(resource, 1) + @item.remove_connection(resource, 1) + expect(@item['powerConnections'].size).to eq(0) + end + + it 'remove connection and verify others' do + resource = Hash.new(uri: '/rest/enclosure/fake-encl1') + @item.add_connection(resource, 1) + @item.add_connection(resource, 2) + @item.add_connection(resource, 3) + @item.remove_connection(resource, 2) + expect(@item['powerConnections'].size).to eq(2) + connection1 = @item['powerConnections'].first + connection2 = @item['powerConnections'].last + expect(connection1['connectionUri']).to eq(resource[:uri]) + expect(connection1['deviceConnection']).to eq(1) + expect(connection2['connectionUri']).to eq(resource[:uri]) + expect(connection2['deviceConnection']).to eq(3) + end + end + + describe '#add' do + it 'Should support add' do + power_device = OneviewSDK::PowerDevice.new(@client, name: 'power_device', ratedCapacity: 500) + expected_request_body = { + 'name' => 'power_device', + 'ratedCapacity' => 500, + 'deviceType' => 'BranchCircuit', + 'phaseType' => 'Unknown', + 'powerConnections' => [] + } + expect(@client).to receive(:rest_post).with('/rest/power-devices', { 'body' => expected_request_body }, 200) + .and_return(FakeResponse.new({})) + power_device.add + end + end + + describe '#remove' do + it 'Should support remove' do + power_device = OneviewSDK::PowerDevice.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_delete).with('/rest/fake', {}, 200).and_return(FakeResponse.new({})) + power_device.remove + end + end + + describe '#create' do + it 'Should raise error if used' do + power_device = OneviewSDK::PowerDevice.new(@client) + expect { power_device.create }.to raise_error(OneviewSDK::MethodUnavailable) + end + end + + describe '#delete' do + it 'Should raise error if used' do + power_device = OneviewSDK::PowerDevice.new(@client) + expect { power_device.delete }.to raise_error(OneviewSDK::MethodUnavailable) + end + end + + + describe '#discover' do + it 'Correct request' do + options = { + username: 'user', + password: 'pass', + hostname: '/rest/fake' + } + expect(@client).to receive(:rest_post).with('/rest/power-devices/discover', 'body' => options) + .and_return(FakeResponse.new({})) + expect { OneviewSDK::PowerDevice.discover(@client, options) }.not_to raise_error + end + end + + describe '#get_power_state' do + it 'powerState' do + expect(@client).to receive(:rest_get).with('/rest/fake/powerState') + .and_return(FakeResponse.new({})) + expect { @item.get_power_state }.not_to raise_error + end + end + + describe '#set_power_state' do + it 'On|Off state given' do + expect(@client).to receive(:rest_put).with('/rest/fake/powerState', 'body' => { powerState: 'On' }) + .and_return(FakeResponse.new({})) + expect { @item.set_power_state('On') }.not_to raise_error + end + end + + describe '#set_refresh_state' do + it 'Refresh without changing username and password' do + expect(@client).to receive(:rest_put).with('/rest/fake/refreshState', 'body' => { refreshState: 'RefreshPending' }) + .and_return(FakeResponse.new({})) + expect { @item.set_refresh_state(refreshState: 'RefreshPending') }.not_to raise_error + end + + it 'Refresh providing username/password' do + options = { refreshState: 'RefreshPending', username: 'user', password: 'pass' } + expect(@client).to receive(:rest_put).with('/rest/fake/refreshState', 'body' => options) + .and_return(FakeResponse.new({})) + expect { @item.set_refresh_state(refreshState: 'RefreshPending', username: 'user', password: 'pass') }.not_to raise_error + end + end + + describe '#get_uid_state' do + it 'uidState' do + expect(@client).to receive(:rest_get).with('/rest/fake/uidState') + .and_return(FakeResponse.new({})) + expect { @item.get_uid_state }.not_to raise_error + end + end + + describe '#set_uid_state' do + it 'On|Off state' do + expect(@client).to receive(:rest_put).with('/rest/fake/uidState', 'body' => { uidState: 'On' }) + .and_return(FakeResponse.new({})) + expect { @item.set_uid_state('On') }.not_to raise_error + end + end + + describe '#utilization' do + it 'requires a uri' do + expect { OneviewSDK::PowerDevice.new(@client).utilization }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) + end + + it 'gets uri/utilization' do + expect(@client).to receive(:rest_get).with('/rest/fake/utilization', @item.api_version).and_return(FakeResponse.new(key: 'val')) + expect(@item.utilization).to eq('key' => 'val') + end + + it 'takes query parameters' do + expect(@client).to receive(:rest_get).with('/rest/fake/utilization?key=val', @item.api_version) + .and_return(FakeResponse.new(key: 'val')) + expect(@item.utilization(key: :val)).to eq('key' => 'val') + end + + it 'takes an array for the :fields query parameter' do + expect(@client).to receive(:rest_get).with('/rest/fake/utilization?fields=one,two,three', @item.api_version) + .and_return(FakeResponse.new(key: 'val')) + expect(@item.utilization(fields: %w(one two three))).to eq('key' => 'val') + end + + it 'converts Time query parameters' do + t = Time.now + expect(@client).to receive(:rest_get).with("/rest/fake/utilization?filter=startDate=#{t.utc.iso8601(3)}", @item.api_version) + .and_return(FakeResponse.new(key: 'val')) + expect(@item.utilization(startDate: t)).to eq('key' => 'val') + end + end +end diff --git a/spec/unit/resource/rack_spec.rb b/spec/unit/resource/rack_spec.rb new file mode 100644 index 000000000..3c36625b1 --- /dev/null +++ b/spec/unit/resource/rack_spec.rb @@ -0,0 +1,138 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +RSpec.describe OneviewSDK::Rack do + include_context 'shared context' + + describe '#initialize' do + it 'sets the defaults correctly' do + rack = OneviewSDK::Rack.new(@client) + expect(rack['rackMounts']).to eq([]) + end + end + + describe '#add' do + it 'Should support add' do + rack = OneviewSDK::Rack.new(@client, uri: '/rest/racks') + expect(@client).to receive(:rest_post).with('/rest/racks', { 'body' => { 'uri' => '/rest/racks', 'rackMounts' => [] } }, 200) + .and_return(FakeResponse.new({})) + rack.add + end + end + + describe '#remove' do + it 'Should support remove' do + rack = OneviewSDK::Rack.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_delete).with('/rest/fake', {}, 200).and_return(FakeResponse.new({})) + rack.remove + end + end + + describe '#add_rack_resource' do + before :each do + @rack = OneviewSDK::Rack.new(@client) + end + + it 'Add one resource' do + enclosure1 = OneviewSDK::Enclosure.new(@client, uri: '/rest/enclosures/fake') + @rack.add_rack_resource(enclosure1) + expect(@rack['rackMounts'].first['mountUri']).to eq(enclosure1['uri']) + expect(@rack['rackMounts'].first['location']).to eq('CenterFront') + end + + it 'Add one resource with options' do + enclosure1 = OneviewSDK::Enclosure.new(@client, uri: '/rest/enclosures/fake') + @rack.add_rack_resource(enclosure1, location: 'Left', topUSlot: 20, uHeight: 10) + expect(@rack['rackMounts'].first['mountUri']).to eq(enclosure1['uri']) + expect(@rack['rackMounts'].first['location']).to eq('Left') + expect(@rack['rackMounts'].first['topUSlot']).to eq(20) + expect(@rack['rackMounts'].first['uHeight']).to eq(10) + end + + it 'Add existing resource and update attributes' do + enclosure1 = OneviewSDK::Enclosure.new(@client, uri: '/rest/enclosures/fake') + @rack.add_rack_resource(enclosure1, location: 'Left', topUSlot: 20, uHeight: 10) + expect(@rack['rackMounts'].first['mountUri']).to eq(enclosure1['uri']) + expect(@rack['rackMounts'].first['location']).to eq('Left') + expect(@rack['rackMounts'].first['topUSlot']).to eq(20) + expect(@rack['rackMounts'].first['uHeight']).to eq(10) + mount_count = @rack['rackMounts'].size + + @rack.add_rack_resource(enclosure1, topUSlot: 5, uHeight: 11) + expect(@rack['rackMounts'].first['mountUri']).to eq(enclosure1['uri']) + expect(@rack['rackMounts'].first['location']).to eq('Left') + expect(@rack['rackMounts'].first['topUSlot']).to eq(5) + expect(@rack['rackMounts'].first['uHeight']).to eq(11) + expect(@rack['rackMounts'].size).to eq(mount_count) + + end + + it 'Add multiple resources' do + enclosure1 = OneviewSDK::Enclosure.new(@client, uri: '/rest/enclosures/fake1') + enclosure2 = OneviewSDK::Enclosure.new(@client, uri: '/rest/enclosures/fake2') + @rack.add_rack_resource(enclosure1) + @rack.add_rack_resource(enclosure2) + + # Retrieve only the uris for the mounted resources + mounts = @rack['rackMounts'].map { |resource| resource['mountUri'] } + expect(mounts).to include(enclosure1['uri']) + expect(mounts).to include(enclosure2['uri']) + end + end + + describe '#remove_rack_resource' do + before :each do + @rack = OneviewSDK::Rack.new(@client) + end + + it 'Remove one resource' do + enclosure1 = OneviewSDK::Enclosure.new(@client, uri: '/rest/enclosures/fake') + @rack.add_rack_resource(enclosure1) + end + + it 'Remove only one resource' do + enclosure1 = OneviewSDK::Enclosure.new(@client, uri: '/rest/enclosures/fake1') + enclosure2 = OneviewSDK::Enclosure.new(@client, uri: '/rest/enclosures/fake2') + @rack.add_rack_resource(enclosure1) + @rack.add_rack_resource(enclosure2) + @rack.remove_rack_resource(enclosure2) + + # Retrieve only the uris for the mounted resources + mounts = @rack['rackMounts'].map { |resource| resource['mountUri'] } + expect(mounts).to include(enclosure1['uri']) + expect(mounts).not_to include(enclosure2['uri']) + end + end + + describe '#create' do + it 'Should raise error if used' do + rack = OneviewSDK::Rack.new(@client) + expect { rack.create }.to raise_error(/The method #create is unavailable for this resource/) + end + end + + describe '#delete' do + it 'Should raise error if used' do + rack = OneviewSDK::Rack.new(@client) + expect { rack.delete }.to raise_error(/The method #delete is unavailable for this resource/) + end + end + + describe '#get_device_topology' do + it 'Device topology' do + rack = OneviewSDK::Rack.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_get).with('/rest/fake/deviceTopology').and_return(FakeResponse.new({})) + rack.get_device_topology + end + end +end diff --git a/spec/unit/resource/san_manager_spec.rb b/spec/unit/resource/san_manager_spec.rb new file mode 100644 index 000000000..dca7ef279 --- /dev/null +++ b/spec/unit/resource/san_manager_spec.rb @@ -0,0 +1,100 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. + +require 'spec_helper' + +RSpec.describe OneviewSDK::SANManager do + include_context 'shared context' + + describe '#initialize' do + it 'sets the defaults correctly' do + san_manager = OneviewSDK::SANManager.new(@client) + expect(san_manager['type']).to eq('FCDeviceManagerV2') + end + end + + describe '#add' do + it 'Should support add' do + san_manager = OneviewSDK::SANManager.new( + @client, + name: 'san_manager_1', + providerDisplayName: 'Brocade', + providerUri: '/rest/fc-sans/providers/100' + ) + expect(@client).to receive(:rest_post).with( + '/rest/fc-sans/providers/100/device-managers', + { + 'body' => { + 'name' => 'san_manager_1', + 'providerDisplayName' => 'Brocade', + 'providerUri' => '/rest/fc-sans/providers/100', + 'type' => 'FCDeviceManagerV2' + } + }, + 200 + ).and_return(FakeResponse.new({})) + san_manager.add + end + end + + describe '#remove' do + it 'Should support remove' do + san_manager = OneviewSDK::SANManager.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_delete).with('/rest/fake', {}, 200).and_return(FakeResponse.new({})) + san_manager.remove + end + end + + describe '#create' do + it 'Should raise error if used' do + san_manager = OneviewSDK::SANManager.new(@client) + expect { san_manager.create }.to raise_error(/The method #create is unavailable for this resource/) + end + end + + describe '#delete' do + it 'Should raise error if used' do + san_manager = OneviewSDK::SANManager.new(@client) + expect { san_manager.delete }.to raise_error(/The method #delete is unavailable for this resource/) + end + end + + describe '#self.get_default_connection_info' do + it 'Get default connection info' do + expect(@client).to receive(:rest_get).with('/rest/fc-sans/providers').and_return( + FakeResponse.new( + 'members' => [ + { + 'displayName' => 'FCProvider_01', + 'defaultConnectionInfo' => [ + { + 'name' => 'Host', + 'value' => 'san01.hpe.com' + }, + { + 'name' => 'Username', + 'value' => 'user' + } + ], + 'uri' => '/rest/providers/100' + } + ] + ) + ) + default_connection = OneviewSDK::SANManager.get_default_connection_info(@client, 'FCProvider_01') + expect(default_connection.first['name']).to eq('Host') + expect(default_connection.first['value']).to eq('san01.hpe.com') + expect(default_connection.last['name']).to eq('Username') + expect(default_connection.last['value']).to eq('user') + end + end + +end diff --git a/spec/unit/resource/server_hardware_spec.rb b/spec/unit/resource/server_hardware_spec.rb index c687cb642..87d5de8a7 100644 --- a/spec/unit/resource/server_hardware_spec.rb +++ b/spec/unit/resource/server_hardware_spec.rb @@ -10,7 +10,120 @@ end end - describe '#create' do + describe '#update_ilo_firmware' do + it '' do + item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_put).with(item['uri'] + '/mpFirmwareVersion') + .and_return(FakeResponse.new({})) + item.update_ilo_firmware + end + end + + describe '#get_bios' do + it '' do + item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_get).with(item['uri'] + '/bios') + .and_return(FakeResponse.new({})) + item.get_bios + end + end + + describe '#get_remote_console_url' do + it '' do + item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_get).with(item['uri'] + '/remoteConsoleUrl') + .and_return(FakeResponse.new({})) + item.get_remote_console_url + end + end + + describe '#get_ilo_sso_url' do + it '' do + item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_get).with(item['uri'] + '/iloSsoUrl') + .and_return(FakeResponse.new({})) + item.get_ilo_sso_url + end + end + + describe '#get_java_remote_sso_url' do + it '' do + item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_get).with(item['uri'] + '/javaRemoteConsoleUrl') + .and_return(FakeResponse.new({})) + item.get_java_remote_sso_url + end + end + + describe '#set_refresh_state' do + it 'requires a uri' do + expect { OneviewSDK::ServerHardware.new(@client).set_refresh_state(:state) }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) + end + + it 'does a PUT to /refreshState' do + item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake', refreshState: 'NotRefreshing') + expect(@client).to receive(:rest_put).with(item['uri'] + '/refreshState', Hash, item.api_version) + .and_return(FakeResponse.new(refreshState: 'Refreshing')) + item.set_refresh_state('Refreshing') + expect(item['refreshState']).to eq('Refreshing') + end + + it 'allows string or symbol refreshState values' do + item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake', refreshState: 'NotRefreshing') + expect(@client).to receive(:rest_put).with(item['uri'] + '/refreshState', Hash, item.api_version) + .and_return(FakeResponse.new(refreshState: 'Refreshing')) + item.set_refresh_state(:Refreshing) + expect(item['refreshState']).to eq('Refreshing') + end + end + + describe '#environmentalConfiguration' do + it 'requires a uri' do + expect { OneviewSDK::ServerHardware.new(@client).environmental_configuration }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) + end + + it 'gets uri/environmentalConfiguration' do + item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_get).with('/rest/fake/environmentalConfiguration', item.api_version).and_return(FakeResponse.new(key: 'val')) + expect(item.environmental_configuration).to eq('key' => 'val') + end + end + + describe '#utilization' do + it 'requires a uri' do + expect { OneviewSDK::ServerHardware.new(@client).utilization }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) + end + + it 'gets uri/utilization' do + item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_get).with('/rest/fake/utilization', item.api_version).and_return(FakeResponse.new(key: 'val')) + expect(item.utilization).to eq('key' => 'val') + end + + it 'takes query parameters' do + item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_get).with('/rest/fake/utilization?key=val', item.api_version) + .and_return(FakeResponse.new(key: 'val')) + expect(item.utilization(key: :val)).to eq('key' => 'val') + end + + it 'takes an array for the :fields query parameter' do + item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_get).with('/rest/fake/utilization?fields=one,two,three', item.api_version) + .and_return(FakeResponse.new(key: 'val')) + expect(item.utilization(fields: %w(one two three))).to eq('key' => 'val') + end + + it 'converts Time query parameters' do + t = Time.now + item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_get).with("/rest/fake/utilization?filter=startDate=#{t.utc.iso8601(3)}", item.api_version) + .and_return(FakeResponse.new(key: 'val')) + expect(item.utilization(startDate: t)).to eq('key' => 'val') + end + end + + describe '#add' do context 'with valid data' do before :each do allow_any_instance_of(OneviewSDK::Client).to receive(:rest_api).and_return(true) @@ -31,26 +144,18 @@ it 'only sends certain attributes on the POST' do data = @data.select { |k, _v| k != 'other' } expect(@client).to receive(:rest_post).with('/rest/server-hardware', { 'body' => data }, anything) - @server_hardware.create + @server_hardware.add end end context 'with invalid data' do it 'fails when certain attributes are not set' do server_hardware = OneviewSDK::ServerHardware.new(@client, {}) - expect { server_hardware.create }.to raise_error(/Missing required attribute/) + expect { server_hardware.add }.to raise_error(OneviewSDK::IncompleteResource, /Missing required attribute/) end end end - describe '#update' do - it 'does not allow it' do - server_hardware = OneviewSDK::ServerHardware.new(@client, {}) - expect { server_hardware.update(name: 'new') }.to raise_error(/Method not available/) - expect(server_hardware[:name]).to be_nil - end - end - describe '#power_on' do it 'calls #set_power_state' do item = OneviewSDK::ServerHardware.new(@client) @@ -79,24 +184,6 @@ end end - describe 'validations' do - it 'only allows certain licensingIntent values' do - described_class::VALID_LICENSING_INTENTS.each do |v| - expect { OneviewSDK::ServerHardware.new(@client, licensingIntent: v) }.to_not raise_error - end - expect { OneviewSDK::ServerHardware.new(@client, licensingIntent: '') }.to raise_error(/Invalid licensingIntent/) - expect { OneviewSDK::ServerHardware.new(@client, licensingIntent: 'Invalid') }.to raise_error(/Invalid licensingIntent/) - end - - it 'only allows certain configurationState values' do - described_class::VALID_CONFIGURATION_STATES.each do |v| - expect { OneviewSDK::ServerHardware.new(@client, configurationState: v) }.to_not raise_error - end - expect { OneviewSDK::ServerHardware.new(@client, configurationState: '') }.to raise_error(/Invalid configurationState/) - expect { OneviewSDK::ServerHardware.new(@client, configurationState: 'Invalid') }.to raise_error(/Invalid configurationState/) - end - end - describe '#set_power_state' do before :each do @item = OneviewSDK::ServerHardware.new(@client, uri: '/rest/fake', powerState: 'on') @@ -140,4 +227,31 @@ expect(@item['powerState']).to eq('Off') end end + + + describe 'undefined methods' do + it 'does not allow the create action' do + server_hardware = OneviewSDK::ServerHardware.new(@client) + expect { server_hardware.create }.to raise_error( + OneviewSDK::MethodUnavailable, + /The method #create is unavailable for this resource/ + ) + end + + it 'does not allow the update action' do + server_hardware = OneviewSDK::ServerHardware.new(@client) + expect { server_hardware.update }.to raise_error( + OneviewSDK::MethodUnavailable, + /The method #update is unavailable for this resource/ + ) + end + + it 'does not allow the delete action' do + server_hardware = OneviewSDK::ServerHardware.new(@client) + expect { server_hardware.delete }.to raise_error( + OneviewSDK::MethodUnavailable, + /The method #delete is unavailable for this resource/ + ) + end + end end diff --git a/spec/unit/resource/server_hardware_type_spec.rb b/spec/unit/resource/server_hardware_type_spec.rb index 45183b1eb..cf9d8677f 100644 --- a/spec/unit/resource/server_hardware_type_spec.rb +++ b/spec/unit/resource/server_hardware_type_spec.rb @@ -10,13 +10,6 @@ end end - describe '#create' do - it 'does not allow it' do - item = OneviewSDK::ServerHardwareType.new(@client) - expect { item.create }.to raise_error(/The method #create is unavailable for this resource/) - end - end - describe '#update' do it 'requires a uri' do expect { OneviewSDK::ServerHardwareType.new(@client).update }.to raise_error(/Please set uri/) @@ -29,4 +22,24 @@ item.update end end + + describe '#remove' do + it 'removes server hardware type' do + item = OneviewSDK::ServerHardwareType.new(@client, uri: '/rest/server-hardware-types/100') + expect(@client).to receive(:rest_delete).with('/rest/server-hardware-types/100', {}, item.api_version).and_return(FakeResponse.new) + item.remove + end + end + + describe 'undefined methods' do + it 'does not allow the create action' do + server_hardware_type = OneviewSDK::ServerHardwareType.new(@client) + expect { server_hardware_type.create }.to raise_error(OneviewSDK::MethodUnavailable, /The method #create is unavailable for this resource/) + end + + it 'does not allow the delete action' do + server_hardware_type = OneviewSDK::ServerHardwareType.new(@client) + expect { server_hardware_type.delete }.to raise_error(OneviewSDK::MethodUnavailable, /The method #delete is unavailable for this resource/) + end + end end diff --git a/spec/unit/resource/server_profile_spec.rb b/spec/unit/resource/server_profile_spec.rb index d53ad2f94..5f67684f4 100644 --- a/spec/unit/resource/server_profile_spec.rb +++ b/spec/unit/resource/server_profile_spec.rb @@ -3,6 +3,10 @@ RSpec.describe OneviewSDK::ServerProfile do include_context 'shared context' + before :each do + @item = described_class.new(@client, name: 'unit_server_profile', uri: 'rest/server-profiles/fake') + end + describe '#initialize' do it 'sets the type correctly' do profile = OneviewSDK::ServerProfile.new(@client) @@ -10,21 +14,433 @@ end end + describe '#set_server_hardware' do + before :each do + @server_hardware = OneviewSDK::ServerHardware.new(@client, name: 'server_hardware') + @server_hardware_uri = '/rest/fake/server-hardwares/test' + end + + it 'will set the serverHardwareUri correctly' do + @server_hardware['uri'] = @server_hardware_uri + @item.set_server_hardware(@server_hardware) + expect(@item['serverHardwareUri']).to eq(@server_hardware_uri) + end + + it 'will retrieve and set the serverHardwareUri correctly' do + expect(@client).to receive(:rest_get).with('/rest/server-hardware') + .and_return(FakeResponse.new(members: [ + { name: 'server_hardware', uri: @server_hardware_uri }, + { name: 'wrong_server_hardware', uri: 'wrong_uri' } + ])) + @item.set_server_hardware(@server_hardware) + expect(@item['serverHardwareUri']).to eq(@server_hardware_uri) + end + + it 'will fail to put serverHardwareUri since the resource does not exists' do + expect(@client).to receive(:rest_get).with('/rest/server-hardware') + .and_return(FakeResponse.new(members: [ + { name: 'wrong_server_hardware', uri: 'wrong_uri' } + ])) + expect { @item.set_server_hardware(@server_hardware) }.to raise_error(/could not be found/) + end + end + + describe '#set_server_hardware_type' do + before :each do + @server_hardware_type = OneviewSDK::ServerHardwareType.new(@client, name: 'server_hardware_type') + @server_hardware_type_uri = '/rest/fake/server-hardware-types/test' + end + + it 'will set the serverHardwareTypeUri correctly' do + @server_hardware_type['uri'] = @server_hardware_type_uri + @item.set_server_hardware_type(@server_hardware_type) + expect(@item['serverHardwareTypeUri']).to eq(@server_hardware_type_uri) + end + + it 'will retrieve and set the serverHardwareTypeUri correctly' do + expect(@client).to receive(:rest_get).with('/rest/server-hardware-types') + .and_return(FakeResponse.new(members: [ + { name: 'server_hardware_type', uri: @server_hardware_type_uri }, + { name: 'wrong_server_hardware_type', uri: 'wrong_uri' } + ])) + @item.set_server_hardware_type(@server_hardware_type) + expect(@item['serverHardwareTypeUri']).to eq(@server_hardware_type_uri) + end + + it 'will fail to put serverHardwareTypeUri since the resource does not exists' do + expect(@client).to receive(:rest_get).with('/rest/server-hardware-types') + .and_return(FakeResponse.new(members: [ + { name: 'wrong_server_hardware_type', uri: 'wrong_uri' } + ])) + expect { @item.set_server_hardware_type(@server_hardware_type) }.to raise_error(/could not be found/) + end + end + + describe '#set_enclosure_group' do + before :each do + @enclosure_group = OneviewSDK::EnclosureGroup.new(@client, name: 'enclosure_group') + @enclosure_group_uri = '/rest/fake/enclosure-groups/test' + end + + it 'will set the enclosureGroupUri correctly' do + @enclosure_group['uri'] = @enclosure_group_uri + @item.set_enclosure_group(@enclosure_group) + expect(@item['enclosureGroupUri']).to eq(@enclosure_group_uri) + end + + it 'will retrieve and set the enclosureGroupUri correctly' do + expect(@client).to receive(:rest_get).with('/rest/enclosure-groups') + .and_return(FakeResponse.new(members: [ + { name: 'enclosure_group', uri: @enclosure_group_uri }, + { name: 'wrong_enclosure_group', uri: 'wrong_uri' } + ])) + @item.set_enclosure_group(@enclosure_group) + expect(@item['enclosureGroupUri']).to eq(@enclosure_group_uri) + end + + it 'will fail to put enclosureGroupUri since the resource does not exists' do + expect(@client).to receive(:rest_get).with('/rest/enclosure-groups') + .and_return(FakeResponse.new(members: [ + { name: 'wrong_enclosure_group', uri: 'wrong_uri' } + ])) + expect { @item.set_enclosure_group(@enclosure_group) }.to raise_error(/could not be found/) + end + end + + describe '#set_enclosure' do + before :each do + @enclosure = OneviewSDK::Enclosure.new(@client, name: 'enclosure') + @enclosure_uri = '/rest/fake/enclosures/test' + end + + it 'will set the enclosureUri correctly' do + @enclosure['uri'] = @enclosure_uri + @item.set_enclosure(@enclosure) + expect(@item['enclosureUri']).to eq(@enclosure_uri) + end + + it 'will retrieve and set the enclosureUri correctly' do + expect(@client).to receive(:rest_get).with('/rest/enclosures') + .and_return(FakeResponse.new(members: [ + { name: 'enclosure', uri: @enclosure_uri }, + { name: 'wrong_enclosure', uri: 'wrong_uri' } + ])) + @item.set_enclosure(@enclosure) + expect(@item['enclosureUri']).to eq(@enclosure_uri) + end + + it 'will fail to put enclosureUri since the resource does not exists' do + expect(@client).to receive(:rest_get).with('/rest/enclosures') + .and_return(FakeResponse.new(members: [ + { name: 'wrong_enclosure', uri: 'wrong_uri' } + ])) + expect { @item.set_enclosure(@enclosure) }.to raise_error(/could not be found/) + end + end + + describe '#set_firmware_driver' do + before :each do + @firmware_uri = '/rest/fake/firmware-drivers/unit' + @firmware = OneviewSDK::FirmwareDriver.new(@client, name: 'unit_firmware_driver', uri: @firmware_uri) + end + + it 'will set the FirmwareDriver with options correctly' do + @item.set_firmware_driver(@firmware, 'manageFirmware' => false) + expect(@item['firmware']['firmwareBaselineUri']).to eq(@firmware_uri) + expect(@item['firmware']['manageFirmware']).to eq(false) + end + end + + describe '#self.get_available_networks' do + it 'returns all the available networks' do + expect(@client).to receive(:rest_get).with("#{OneviewSDK::ServerProfile::BASE_URI}/available-networks?view=unit") + .and_return(FakeResponse.new( + 'ethernetNetworks' => [ + { 'name' => 'ethernet_network_1', 'uri' => 'fake1', 'vlan' => 1 }, + { 'name' => 'ethernet_network_2', 'uri' => 'fake2', 'vlan' => 2 } + ], + 'fcNetworks' => [ + { 'name' => 'fc_network_1', 'uri' => 'fake3', 'vlan' => 3 }, + { 'name' => 'fc_network_2', 'uri' => 'fake4', 'vlan' => 4 } + ], + 'networkSets' => [ + { 'name' => 'network_set_1', 'uri' => 'fake5' } + ], + 'type' => 'fakeType' + )) + + returned_set = OneviewSDK::ServerProfile.get_available_networks(@client, 'view' => 'unit') + expect(returned_set['ethernetNetworks'].size).to eq(2) + returned_set['ethernetNetworks'].each { |net| expect(net['name']).to match(/ethernet_network/) } + expect(returned_set['fcNetworks'].size).to eq(2) + returned_set['fcNetworks'].each { |net| expect(net['name']).to match(/fc_network/) } + expect(returned_set['networkSets'].size).to eq(1) + returned_set['networkSets'].each { |net| expect(net['name']).to match(/network_set/) } + expect(returned_set['type']).to be_nil + end + end + + describe '#self.get_available_servers' do + it 'retrieves available servers based on a query' do + server_profile_uri = 'rest/fake/server-profiles/unit' + server_profile = OneviewSDK::ServerProfile.new(@client, name: 'unit_server_profile', uri: server_profile_uri) + expect(@client).to receive(:rest_get) + .with("#{OneviewSDK::ServerProfile::BASE_URI}/available-servers?profileUri=#{server_profile_uri}") + .and_return(FakeResponse.new('it' => 'works')) + expect(OneviewSDK::ServerProfile.get_available_servers(@client, 'server_profile' => server_profile)['it']) + .to eq('works') + end + end + + describe '#self.get_available_storage_system' do + it 'retrieves available storage system based on a query' do + storage_system_uri = 'rest/fake/storage-systems/unit' + storage_system = OneviewSDK::StorageSystem.new(@client, name: 'unit_storage_system', uri: storage_system_uri) + expect(@client).to receive(:rest_get) + .with("#{OneviewSDK::ServerProfile::BASE_URI}/available-storage-system?storageSystemId=unit") + .and_return(FakeResponse.new('it' => 'works')) + expect(OneviewSDK::ServerProfile.get_available_storage_system(@client, 'storage_system' => storage_system)['it']) + .to eq('works') + end + end + + describe '#self.get_available_storage_systems' do + it 'retrieves available storage system based on a query' do + expect(@client).to receive(:rest_get) + .with("#{OneviewSDK::ServerProfile::BASE_URI}/available-storage-systems") + .and_return(FakeResponse.new('it' => 'works')) + expect(OneviewSDK::ServerProfile.get_available_storage_systems(@client)['it']).to eq('works') + end + end + + describe '#self.get_available_targets' do + it 'retrieves available targets based on a query' do + expect(@client).to receive(:rest_get) + .with("#{OneviewSDK::ServerProfile::BASE_URI}/available-targets") + .and_return(FakeResponse.new('it' => 'works')) + expect(OneviewSDK::ServerProfile.get_available_targets(@client)['it']).to eq('works') + end + end + + describe '#self.get_profile_ports' do + it 'retrieves profile ports based on a query' do + expect(@client).to receive(:rest_get) + .with("#{OneviewSDK::ServerProfile::BASE_URI}/profile-ports") + .and_return(FakeResponse.new('it' => 'works')) + expect(OneviewSDK::ServerProfile.get_profile_ports(@client)['it']).to eq('works') + end + end + + describe '#get_compliance_preview' do + it 'shows compliance preview' do + expect(@client).to receive(:rest_get).with("#{@item['uri']}/compliance-preview") + .and_return(FakeResponse.new('it' => 'works')) + expect(@item.get_compliance_preview['it']).to eq('works') + end + end + + describe '#get_messages' do + it 'shows messages' do + expect(@client).to receive(:rest_get).with("#{@item['uri']}/messages") + .and_return(FakeResponse.new('it' => 'works')) + expect(@item.get_messages['it']).to eq('works') + end + end + + describe '#get_transformation' do + it 'transforms an existing profile' do + expect(@client).to receive(:rest_get).with("#{@item['uri']}/transformation?queryTest=Test") + .and_return(FakeResponse.new('it' => 'works')) + expect(@item.get_transformation('query_test' => 'Test')['it']).to eq('works') + end + end + + describe '#update_from_template' do + it 'transforms an existing profile' do + patch_ops = [{ 'op' => 'replace', 'path' => '/templateCompliance', 'value' => 'Compliant' }] + request = { + 'If-Match' => @item['eTag'], + 'body' => patch_ops + } + expect(@client).to receive(:rest_patch) + .with(@item['uri'], request) + .and_return(FakeResponse.new) + expect { @item.update_from_template }.to_not raise_error + end + end + + describe '#add_connection' do + before :each do + @item['connections'] = [] + @network = OneviewSDK::EthernetNetwork.new(@client, name: 'unit_ethernet_network', uri: 'rest/fake/ethernet-networks/unit') + end + + it 'adds simple connection' do + expect { @item.add_connection(@network, 'name' => 'unit_net') }.to_not raise_error + expect(@item['connections']).to be + expect(@item['connections'].first['id']).to eq(0) + expect(@item['connections'].first['networkUri']).to eq('rest/fake/ethernet-networks/unit') + end + + it 'adds multiple connections' do + base_uri = @network['uri'] + 1.upto(4) do |count| + @network['uri'] = "#{@network['uri']}_#{count}" + expect { @item.add_connection(@network, 'name' => "unit_net_#{count}") }.to_not raise_error + @network['uri'] = base_uri + end + @item['connections'].each do |connection| + expect(connection['id']).to eq(0) + expect(connection['name']).to match(/unit_net_/) + end + end + + describe '#remove_connection' do + before :each do + @item['connections'] = [] + @network = OneviewSDK::EthernetNetwork.new(@client, name: 'unit_ethernet_network', uri: 'rest/fake/ethernet-networks/unit') + base_uri = @network['uri'] + 1.upto(5) do |count| + @network['uri'] = "#{@network['uri']}_#{count}" + @item.add_connection(@network, 'name' => "unit_con_#{count}") + @network['uri'] = base_uri + end + end + + it 'removes a connection' do + removed_connection = @item.remove_connection('unit_con_2') + expect(removed_connection['name']).to eq('unit_con_2') + expect(removed_connection['networkUri']).to eq("#{@network['uri']}_2") + @item['connections'].each do |connection| + expect(connection['name']).to_not eq(removed_connection['name']) + end + end + + it 'removes all connections' do + 1.upto(5) do |count| + removed_connection = @item.remove_connection("unit_con_#{count}") + expect(removed_connection['name']).to eq("unit_con_#{count}") + expect(removed_connection['networkUri']).to eq("#{@network['uri']}_#{count}") + @item['connections'].each do |connection| + expect(connection['name']).to_not eq(removed_connection['name']) + end + end + expect(@item['connections']).to be_empty + end + + it 'returns nil if no connection set' do + @item.data.delete('connections') + expect(@item.remove_connection('fake')).not_to be + end + + it 'returns nil if connection does not exists' do + expect(@item.remove_connection('fake')).not_to be + end + end + end + + describe '#get_server_hardware' do + it 'returns nil if no hardware is assigned' do + hw = OneviewSDK::ServerProfile.new(@client).get_server_hardware + expect(hw).to be_nil + end + + it 'retrieves and returns the hardware if it is assigned' do + expect_any_instance_of(OneviewSDK::ServerHardware).to receive(:retrieve!).and_return(true) + hw = OneviewSDK::ServerProfile.new(@client, serverHardwareUri: '/rest/fake').get_server_hardware + expect(hw).to be_a(OneviewSDK::ServerHardware) + end + end + + describe '#get_available_networks' do + it 'calls the #get_available_networks class method' do + p = OneviewSDK::ServerProfile.new(@client, enclosureGroupUri: '/rest/fake', serverHardwareTypeUri: '/rest/fake2') + query = { enclosure_group_uri: p['enclosureGroupUri'], server_hardware_type_uri: p['serverHardwareTypeUri'] } + expect(OneviewSDK::ServerProfile).to receive(:get_available_networks).with(@client, query).and_return([]) + expect(p.get_available_networks).to eq([]) + end + end + describe '#available_hardware' do it 'requires the serverHardwareTypeUri value to be set' do - expect { OneviewSDK::ServerProfile.new(@client).available_hardware }.to raise_error(/Must set.*serverHardwareTypeUri/) + expect { OneviewSDK::ServerProfile.new(@client).get_available_hardware } + .to raise_error(OneviewSDK::IncompleteResource, /Must set.*serverHardwareTypeUri/) end it 'requires the enclosureGroupUri value to be set' do - expect { OneviewSDK::ServerProfile.new(@client, serverHardwareTypeUri: '/rest/fake').available_hardware } - .to raise_error(/Must set.*enclosureGroupUri/) + expect { OneviewSDK::ServerProfile.new(@client, serverHardwareTypeUri: '/rest/fake').get_available_hardware } + .to raise_error(OneviewSDK::IncompleteResource, /Must set.*enclosureGroupUri/) end it 'calls #find_by with the serverHardwareTypeUri and enclosureGroupUri' do - item = OneviewSDK::ServerProfile.new(@client, serverHardwareTypeUri: '/rest/fake', enclosureGroupUri: '/rest/fake2') - params = { state: 'NoProfileApplied', serverHardwareTypeUri: item['serverHardwareTypeUri'], serverGroupUri: item['enclosureGroupUri'] } + @item = OneviewSDK::ServerProfile.new(@client, serverHardwareTypeUri: '/rest/fake', enclosureGroupUri: '/rest/fake2') + params = { state: 'NoProfileApplied', serverHardwareTypeUri: @item['serverHardwareTypeUri'], serverGroupUri: @item['enclosureGroupUri'] } expect(OneviewSDK::ServerHardware).to receive(:find_by).with(@client, params).and_return([]) - expect(item.available_hardware).to eq([]) + expect(@item.get_available_hardware).to eq([]) + end + end + + describe 'Volume attachment operations' do + it 'can call the #add_volume_attachment using a specific already created Volume' do + volume = OneviewSDK::Volume.new(@client, uri: '/fake/volume', storagePoolUri: '/fake/storage-pool', storageSystemUri: '/fake/storage-system') + @item.add_volume_attachment(volume) + + expect(@item['sanStorage']['volumeAttachments'].size).to eq(1) + va = @item['sanStorage']['volumeAttachments'].first + expect(va['volumeUri']).to eq(volume['uri']) + expect(va['volumeStoragePoolUri']).to eq(volume['storagePoolUri']) + expect(va['volumeStorageSystemUri']).to eq(volume['storageSystemUri']) + end + + describe 'can call #remove_volume_attachment' do + it 'and remove attachment with id 0' do + volume = OneviewSDK::Volume.new(@client, uri: '/fake/volume', storagePoolUri: '/fake/storage-pool', storageSystemUri: '/fake/storage-system') + @item.add_volume_attachment(volume, 'id' => 7) + expect(@item['sanStorage']['volumeAttachments'].size).to eq(1) + va = @item.remove_volume_attachment(7) + expect(@item['sanStorage']['volumeAttachments']).to be_empty + expect(va['volumeUri']).to eq(volume['uri']) + expect(va['volumeStoragePoolUri']).to eq(volume['storagePoolUri']) + expect(va['volumeStorageSystemUri']).to eq(volume['storageSystemUri']) + end + + it 'and return nil if no attachment found' do + volume = OneviewSDK::Volume.new(@client, uri: '/fake/volume', storagePoolUri: '/fake/storage-pool', storageSystemUri: '/fake/storage-system') + @item.add_volume_attachment(volume, 'id' => 7) + expect(@item['sanStorage']['volumeAttachments'].size).to eq(1) + va = @item.remove_volume_attachment(5) + expect(@item['sanStorage']['volumeAttachments']).not_to be_empty + expect(va).not_to be + end + + it 'and return nil if there is no attachment' do + expect(@item['sanStorage']).not_to be + va = @item.remove_volume_attachment(0) + expect(@item['sanStorage']['volumeAttachments']).to be_empty + expect(va).not_to be + end + end + + it 'can call #create_volume_with_attachment and generate the data required for a new Volume with attachment' do + storage_pool = OneviewSDK::StoragePool.new(@client, uri: 'fake/storage-pool') + volume_options = { + name: 'TestVolume', + description: 'Test Volume for Server Profile Volume Attachment', + provisioningParameters: { + provisionType: 'Full', + shareable: true, + requestedCapacity: 1024 * 1024 * 1024 + } + } + @item.create_volume_with_attachment(storage_pool, volume_options) + expect(@item['sanStorage']['volumeAttachments'].size).to eq(1) + va = @item['sanStorage']['volumeAttachments'].first + expect(va['volumeUri']).not_to be + expect(va['volumeStorageSystemUri']).not_to be + expect(va['volumeStoragePoolUri']).to eq('fake/storage-pool') + expect(va['volumeShareable']).to eq(true) + expect(va['volumeProvisionedCapacityBytes']).to eq(1024 * 1024 * 1024) + expect(va['volumeProvisionType']).to eq('Full') end end diff --git a/spec/unit/resource/server_profile_template_spec.rb b/spec/unit/resource/server_profile_template_spec.rb index 28c587f34..daea61bba 100644 --- a/spec/unit/resource/server_profile_template_spec.rb +++ b/spec/unit/resource/server_profile_template_spec.rb @@ -3,27 +3,260 @@ RSpec.describe OneviewSDK::ServerProfileTemplate do include_context 'shared context' + before(:each) do + @item = OneviewSDK::ServerProfileTemplate.new(@client, name: 'server_profile_template') + end + describe '#initialize' do it 'sets the type correctly' do - template = OneviewSDK::ServerProfileTemplate.new(@client) - expect(template[:type]).to eq('ServerProfileTemplateV1') + expect(@item[:type]).to eq('ServerProfileTemplateV1') + end + end + + describe '#set_server_hardware_type' do + before :each do + @server_hardware_type = OneviewSDK::ServerHardwareType.new(@client, name: 'server_hardware_type') + @server_hardware_type_uri = '/rest/fake/server-hardware-types/test' + end + + it 'will set the serverHardwareTypeUri correctly' do + @server_hardware_type['uri'] = @server_hardware_type_uri + @item.set_server_hardware_type(@server_hardware_type) + expect(@item['serverHardwareTypeUri']).to eq(@server_hardware_type_uri) + end + + it 'will retrieve and set the serverHardwareTypeUri correctly' do + expect(@client).to receive(:rest_get).with('/rest/server-hardware-types') + .and_return(FakeResponse.new(members: [ + { name: 'server_hardware_type', uri: @server_hardware_type_uri }, + { name: 'wrong_server_hardware_type', uri: 'wrong_uri' } + ])) + @item.set_server_hardware_type(@server_hardware_type) + expect(@item['serverHardwareTypeUri']).to eq(@server_hardware_type_uri) + end + + it 'will fail to put serverHardwareTypeUri since the resource does not exists' do + expect(@client).to receive(:rest_get).with('/rest/server-hardware-types') + .and_return(FakeResponse.new(members: [ + { name: 'wrong_server_hardware_type', uri: 'wrong_uri' } + ])) + expect { @item.set_server_hardware_type(@server_hardware_type) }.to raise_error(/could not be found/) + end + end + + describe '#set_enclosure_group' do + before :each do + @enclosure_group = OneviewSDK::EnclosureGroup.new(@client, name: 'enclosure_group') + @enclosure_group_uri = '/rest/fake/enclosure-groups/test' + end + + it 'will set the enclosureGroupUri correctly' do + @enclosure_group['uri'] = @enclosure_group_uri + @item.set_enclosure_group(@enclosure_group) + expect(@item['enclosureGroupUri']).to eq(@enclosure_group_uri) + end + + it 'will retrieve and set the enclosureGroupUri correctly' do + expect(@client).to receive(:rest_get).with('/rest/enclosure-groups') + .and_return(FakeResponse.new(members: [ + { name: 'enclosure_group', uri: @enclosure_group_uri }, + { name: 'wrong_enclosure_group', uri: 'wrong_uri' } + ])) + @item.set_enclosure_group(@enclosure_group) + expect(@item['enclosureGroupUri']).to eq(@enclosure_group_uri) + end + + it 'will fail to put enclosureGroupUri since the resource does not exists' do + expect(@client).to receive(:rest_get).with('/rest/enclosure-groups') + .and_return(FakeResponse.new(members: [ + { name: 'wrong_enclosure_group', uri: 'wrong_uri' } + ])) + expect { @item.set_enclosure_group(@enclosure_group) }.to raise_error(/could not be found/) + end + end + + describe '#set_firmware_driver' do + before :each do + @firmware_uri = '/rest/fake/firmware-drivers/unit' + @firmware = OneviewSDK::FirmwareDriver.new(@client, name: 'unit_firmware_driver', uri: @firmware_uri) + end + + it 'will set the FirmwareDriver with options correctly' do + @item.set_firmware_driver(@firmware, 'manageFirmware' => false) + expect(@item['firmware']['firmwareBaselineUri']).to eq(@firmware_uri) + expect(@item['firmware']['manageFirmware']).to eq(false) + end + end + + describe '#add_connection' do + before :each do + @item['connections'] = [] + @network = OneviewSDK::EthernetNetwork.new(@client, name: 'unit_ethernet_network', uri: 'rest/fake/ethernet-networks/unit') + end + + it 'adds simple connection' do + expect { @item.add_connection(@network, 'name' => 'unit_net') }.to_not raise_error + expect(@item['connections']).to be + expect(@item['connections'].first['id']).to eq(0) + expect(@item['connections'].first['networkUri']).to eq('rest/fake/ethernet-networks/unit') + end + + it 'adds multiple connections' do + base_uri = @network['uri'] + 1.upto(4) do |count| + @network['uri'] = "#{@network['uri']}_#{count}" + expect { @item.add_connection(@network, 'name' => "unit_net_#{count}") }.to_not raise_error + @network['uri'] = base_uri + end + @item['connections'].each do |connection| + expect(connection['id']).to eq(0) + expect(connection['name']).to match(/unit_net_/) + end + end + + describe '#remove_connection' do + before :each do + @item['connections'] = [] + @network = OneviewSDK::EthernetNetwork.new(@client, name: 'unit_ethernet_network', uri: 'rest/fake/ethernet-networks/unit') + base_uri = @network['uri'] + 1.upto(5) do |count| + @network['uri'] = "#{@network['uri']}_#{count}" + @item.add_connection(@network, 'name' => "unit_con_#{count}") + @network['uri'] = base_uri + end + end + + it 'removes a connection' do + removed_connection = @item.remove_connection('unit_con_2') + expect(removed_connection['name']).to eq('unit_con_2') + expect(removed_connection['networkUri']).to eq("#{@network['uri']}_2") + @item['connections'].each do |connection| + expect(connection['name']).to_not eq(removed_connection['name']) + end + end + + it 'removes all connections' do + 1.upto(5) do |count| + removed_connection = @item.remove_connection("unit_con_#{count}") + expect(removed_connection['name']).to eq("unit_con_#{count}") + expect(removed_connection['networkUri']).to eq("#{@network['uri']}_#{count}") + @item['connections'].each do |connection| + expect(connection['name']).to_not eq(removed_connection['name']) + end + end + expect(@item['connections']).to be_empty + end + + it 'returns nil if no connection set' do + @item.data.delete('connections') + expect(@item.remove_connection('fake')).not_to be + end + + it 'returns nil if connection does not exists' do + expect(@item.remove_connection('fake')).not_to be + end + end + end + + describe '#available_hardware' do + it 'requires the serverHardwareTypeUri value to be set' do + expect { OneviewSDK::ServerProfileTemplate.new(@client).get_available_hardware } + .to raise_error(OneviewSDK::IncompleteResource, /Must set.*serverHardwareTypeUri/) + end + + it 'requires the enclosureGroupUri value to be set' do + expect { OneviewSDK::ServerProfileTemplate.new(@client, serverHardwareTypeUri: '/rest/fake').get_available_hardware } + .to raise_error(OneviewSDK::IncompleteResource, /Must set.*enclosureGroupUri/) + end + + it 'calls #find_by with the serverHardwareTypeUri and enclosureGroupUri' do + @item = OneviewSDK::ServerProfileTemplate.new(@client, serverHardwareTypeUri: '/rest/fake', enclosureGroupUri: '/rest/fake2') + params = { state: 'NoProfileApplied', serverHardwareTypeUri: @item['serverHardwareTypeUri'], serverGroupUri: @item['enclosureGroupUri'] } + expect(OneviewSDK::ServerHardware).to receive(:find_by).with(@client, params).and_return([]) + expect(@item.get_available_hardware).to eq([]) end end describe '#new_profile' do it 'returns a profile' do - allow_any_instance_of(OneviewSDK::Client).to receive(:rest_get).and_return(name: 'NewProfile') + allow_any_instance_of(OneviewSDK::Client).to receive(:rest_get).and_return(FakeResponse.new(name: 'NewProfile')) expect(@client).to receive(:rest_get).with('/rest/server-profile-templates/fake/new-profile') - template = OneviewSDK::ServerProfileTemplate.new(@client, uri: '/rest/server-profile-templates/fake') + template = OneviewSDK::ServerProfileTemplate.new(@client, name: 'unit_server_profile_template') + template['uri'] = '/rest/server-profile-templates/fake' profile = template.new_profile expect(profile.class).to eq(OneviewSDK::ServerProfile) + expect(profile['name']).to eq("Server_Profile_created_from_#{template['name']}") end it 'can set the name of a new profile' do - allow_any_instance_of(OneviewSDK::Client).to receive(:rest_get).and_return(name: 'NewProfile') + allow_any_instance_of(OneviewSDK::Client).to receive(:rest_get).and_return(FakeResponse.new(name: 'NewProfile')) template = OneviewSDK::ServerProfileTemplate.new(@client, uri: '/rest/server-profile-templates/fake') profile = template.new_profile('NewName') expect(profile[:name]).to eq('NewName') end end + + describe 'Volume attachment operations' do + it 'can call the #add_volume_attachment using a specific already created Volume' do + volume = OneviewSDK::Volume.new(@client, uri: '/fake/volume', storagePoolUri: '/fake/storage-pool', storageSystemUri: '/fake/storage-system') + @item.add_volume_attachment(volume) + + expect(@item['sanStorage']['volumeAttachments'].size).to eq(1) + va = @item['sanStorage']['volumeAttachments'].first + expect(va['volumeUri']).to eq(volume['uri']) + expect(va['volumeStoragePoolUri']).to eq(volume['storagePoolUri']) + expect(va['volumeStorageSystemUri']).to eq(volume['storageSystemUri']) + end + + describe 'can call #remove_volume_attachment' do + it 'and remove attachment with id 0' do + volume = OneviewSDK::Volume.new(@client, uri: '/fake/volume', storagePoolUri: '/fake/storage-pool', storageSystemUri: '/fake/storage-system') + @item.add_volume_attachment(volume, 'id' => 7) + expect(@item['sanStorage']['volumeAttachments'].size).to eq(1) + va = @item.remove_volume_attachment(7) + expect(@item['sanStorage']['volumeAttachments']).to be_empty + expect(va['volumeUri']).to eq(volume['uri']) + expect(va['volumeStoragePoolUri']).to eq(volume['storagePoolUri']) + expect(va['volumeStorageSystemUri']).to eq(volume['storageSystemUri']) + end + + it 'and return nil if no attachment found' do + volume = OneviewSDK::Volume.new(@client, uri: '/fake/volume', storagePoolUri: '/fake/storage-pool', storageSystemUri: '/fake/storage-system') + @item.add_volume_attachment(volume, 'id' => 7) + expect(@item['sanStorage']['volumeAttachments'].size).to eq(1) + va = @item.remove_volume_attachment(5) + expect(@item['sanStorage']['volumeAttachments']).not_to be_empty + expect(va).not_to be + end + + it 'and return nil if there is no attachment' do + expect(@item['sanStorage']).not_to be + va = @item.remove_volume_attachment(0) + expect(@item['sanStorage']['volumeAttachments']).to be_empty + expect(va).not_to be + end + end + + it 'can call #create_volume_with_attachment and generate the data required for a new Volume with attachment' do + storage_pool = OneviewSDK::StoragePool.new(@client, uri: 'fake/storage-pool') + volume_options = { + name: 'TestVolume', + description: 'Test Volume for Server Profile Volume Attachment', + provisioningParameters: { + provisionType: 'Full', + shareable: true, + requestedCapacity: 1024 * 1024 * 1024 + } + } + @item.create_volume_with_attachment(storage_pool, volume_options) + expect(@item['sanStorage']['volumeAttachments'].size).to eq(1) + va = @item['sanStorage']['volumeAttachments'].first + expect(va['volumeUri']).not_to be + expect(va['volumeStorageSystemUri']).not_to be + expect(va['volumeStoragePoolUri']).to eq('fake/storage-pool') + expect(va['volumeShareable']).to eq(true) + expect(va['volumeProvisionedCapacityBytes']).to eq(1024 * 1024 * 1024) + expect(va['volumeProvisionType']).to eq('Full') + end + end end diff --git a/spec/unit/resource/storage_pool_spec.rb b/spec/unit/resource/storage_pool_spec.rb index 283deda76..b66c8c39c 100644 --- a/spec/unit/resource/storage_pool_spec.rb +++ b/spec/unit/resource/storage_pool_spec.rb @@ -5,8 +5,28 @@ describe '#initialize' do it 'sets the defaults correctly' do - profile = OneviewSDK::StoragePool.new(@client) - expect(profile[:type]).to eq('StoragePoolV2') + pool = OneviewSDK::StoragePool.new(@client) + expect(pool['type']).to eq('StoragePoolV2') + end + end + + describe '#add' do + it 'Should support add' do + pool = OneviewSDK::StoragePool.new(@client, name: 'StoragePool_1') + expect(@client).to receive(:rest_post).with( + '/rest/storage-pools', + { 'body' => { 'name' => 'StoragePool_1', 'type' => 'StoragePoolV2' } }, + 200 + ).and_return(FakeResponse.new({})) + pool.add + end + end + + describe '#remove' do + it 'Should support remove' do + pool = OneviewSDK::StoragePool.new(@client, uri: '/rest/storage-pools/100') + expect(@client).to receive(:rest_delete).with('/rest/storage-pools/100', {}, 200).and_return(FakeResponse.new({})) + pool.remove end end @@ -16,44 +36,27 @@ item.set_storage_system(OneviewSDK::StorageSystem.new(@client, uri: '/rest/fake')) expect(item['storageSystemUri']).to eq('/rest/fake') end + + it 'requires a storage_system with a uri' do + item = OneviewSDK::StoragePool.new(@client) + expect { item.set_storage_system(OneviewSDK::StorageSystem.new(@client)) }.to raise_error(OneviewSDK::IncompleteResource, /Please set/) + end end - describe '#validate' do - context 'refreshState' do - it 'allows valid refresh states' do - storage_pool = OneviewSDK::StoragePool.new(@client) - described_class::VALID_REFRESH_STATES.each do |state| - storage_pool[:refreshState] = state - expect(storage_pool[:refreshState]).to eq(state) - end - end - - it 'does not allow invalid refresh states' do - storage_pool = OneviewSDK::StoragePool.new(@client) - expect { storage_pool[:refreshState] = 'Complete' }.to raise_error.with_message(/Invalid refresh state/) - end - end - - context 'status' do - it 'allows valid statuses' do - storage_pool = OneviewSDK::StoragePool.new(@client) - described_class::VALID_STATUSES.each do |state| - storage_pool[:status] = state - expect(storage_pool[:status]).to eq(state) - end - end - - it 'does not allow invalid statuses' do - storage_pool = OneviewSDK::StoragePool.new(@client) - expect { storage_pool[:status] = 'Complete' }.to raise_error.with_message(/Invalid status/) - end - end - - describe 'undefined methods' do - it 'does not allow the update action' do - storage_pool = OneviewSDK::StoragePool.new(@client) - expect { storage_pool.update }.to raise_error(/The method #update is unavailable for this resource/) - end + describe 'undefined methods' do + it 'does not allow the create action' do + pool = OneviewSDK::StoragePool.new(@client) + expect { pool.create }.to raise_error(/The method #create is unavailable for this resource/) + end + + it 'does not allow the update action' do + storage_pool = OneviewSDK::StoragePool.new(@client) + expect { storage_pool.update }.to raise_error(OneviewSDK::MethodUnavailable, /The method #update is unavailable for this resource/) + end + + it 'does not allow the delete action' do + pool = OneviewSDK::StoragePool.new(@client) + expect { pool.delete }.to raise_error(/The method #delete is unavailable for this resource/) end end end diff --git a/spec/unit/resource/storage_system_spec.rb b/spec/unit/resource/storage_system_spec.rb index d7923336b..213290f8a 100644 --- a/spec/unit/resource/storage_system_spec.rb +++ b/spec/unit/resource/storage_system_spec.rb @@ -10,7 +10,7 @@ end end - describe '#create' do + describe '#add' do it 'sends just the credentials hash, then the rest of the data' do item = OneviewSDK::StorageSystem.new(@client, name: 'Fake', credentials: { ip_hostname: 'a.com', username: 'admin', password: 'secret' }) expect(@client).to receive(:rest_post).with('/rest/storage-systems', { 'body' => item['credentials'] }, item.api_version) @@ -18,7 +18,15 @@ allow(@client).to receive(:wait_for).and_return(FakeResponse.new(nil, 200, 'associatedResource' => { 'resourceUri' => '/rest/fake' })) expect(item).to receive(:refresh).and_return(true) expect(item).to receive(:update).with('name' => 'Fake', 'type' => 'StorageSystemV3').and_return(true) - item.create + item.add + end + end + + describe '#remove' do + it 'Should support remove' do + storage = OneviewSDK::StorageSystem.new(@client, uri: '/rest/storage-systems/100') + expect(@client).to receive(:rest_delete).with('/rest/storage-systems/100', {}, 200).and_return(FakeResponse.new({})) + storage.remove end end @@ -35,6 +43,31 @@ .and_return([item]) expect(item.retrieve!).to eq(true) end + + it 'no parameter given' do + item = OneviewSDK::StorageSystem.new(@client, {}) + expect { item.retrieve! }.to raise_error(OneviewSDK::IncompleteResource) + end + end + + describe '#exists?' do + it 'finds by name if it is set' do + item = OneviewSDK::StorageSystem.new(@client, name: 'Fake') + expect(OneviewSDK::Resource).to receive(:find_by).with(@client, name: 'Fake').and_return([item]) + expect(item.exists?).to eq(true) + end + + it 'finds by credentials if the name is not set' do + item = OneviewSDK::StorageSystem.new(@client, credentials: { ip_hostname: 'a.com', username: 'admin', password: 'secret' }) + expect(OneviewSDK::Resource).to receive(:find_by).with(@client, credentials: { ip_hostname: item['credentials'][:ip_hostname] }) + .and_return([item]) + expect(item.exists?).to eq(true) + end + + it 'no parameter given' do + item = OneviewSDK::StorageSystem.new(@client, {}) + expect { item.exists? }.to raise_error(OneviewSDK::IncompleteResource) + end end describe '#get_managed_ports' do @@ -49,4 +82,16 @@ item.get_managed_ports(100) end end + + describe 'undefined methods' do + it 'does not allow the create action' do + storage = OneviewSDK::StorageSystem.new(@client) + expect { storage.create }.to raise_error(/The method #create is unavailable for this resource/) + end + + it 'does not allow the delete action' do + storage = OneviewSDK::StorageSystem.new(@client) + expect { storage.delete }.to raise_error(/The method #delete is unavailable for this resource/) + end + end end diff --git a/spec/unit/resource/switch_spec.rb b/spec/unit/resource/switch_spec.rb new file mode 100644 index 000000000..f603e2b86 --- /dev/null +++ b/spec/unit/resource/switch_spec.rb @@ -0,0 +1,66 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::Switch do + include_context 'shared context' + + describe '#remove' do + it 'Should support remove' do + switch = OneviewSDK::Switch.new(@client, uri: '/rest/switches/100') + expect(@client).to receive(:rest_delete).with('/rest/switches/100', {}, 200).and_return(FakeResponse.new({})) + switch.remove + end + end + + describe '#get_type' do + it 'finds the specified switch' do + switch_type_list = FakeResponse.new( + 'members' => [ + { 'name' => 'SwitchA', 'uri' => 'rest/fake/A' }, + { 'name' => 'TheSwitch', 'uri' => 'rest/fake/switch' }, + { 'name' => 'SwitchC', 'uri' => 'rest/fake/C' } + ] + ) + expect(@client).to receive(:rest_get).with('/rest/switch-types').and_return(switch_type_list) + @item = OneviewSDK::Switch.get_type(@client, 'TheSwitch') + expect(@item['uri']).to eq('rest/fake/switch') + end + end + + describe 'statistics' do + before :each do + @item = OneviewSDK::Switch.new(@client, {}) + end + + it 'port' do + expect(@client).to receive(:rest_get).with('/statistics/p1').and_return(FakeResponse.new) + @item.statistics('p1') + end + + it 'port and subport' do + expect(@client).to receive(:rest_get).with('/statistics/p1/subport/sp1').and_return(FakeResponse.new) + @item.statistics('p1', 'sp1') + end + end + + describe 'undefined methods' do + it 'does not allow the create action' do + switch = OneviewSDK::Switch.new(@client) + expect { switch.create }.to raise_error(OneviewSDK::MethodUnavailable, /The method #create is unavailable for this resource/) + end + + it 'does not allow the update action' do + switch = OneviewSDK::Switch.new(@client) + expect { switch.update }.to raise_error(OneviewSDK::MethodUnavailable, /The method #update is unavailable for this resource/) + end + + it 'does not allow the refresh action' do + switch = OneviewSDK::Switch.new(@client) + expect { switch.refresh }.to raise_error(OneviewSDK::MethodUnavailable, /The method #refresh is unavailable for this resource/) + end + + it 'does not allow the delete action' do + switch = OneviewSDK::Switch.new(@client) + expect { switch.delete }.to raise_error(OneviewSDK::MethodUnavailable, /The method #delete is unavailable for this resource/) + end + end +end diff --git a/spec/unit/resource/unmanaged_device_spec.rb b/spec/unit/resource/unmanaged_device_spec.rb new file mode 100644 index 000000000..8ba1bbc66 --- /dev/null +++ b/spec/unit/resource/unmanaged_device_spec.rb @@ -0,0 +1,67 @@ +# (C) Copyright 2016 Hewlett Packard Enterprise Development LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. + +require 'spec_helper' + +RSpec.describe OneviewSDK::UnmanagedDevice do + include_context 'shared context' + + describe '#self.get_devices' do + it 'Get unmanaged devices' do + expect(@client).to receive(:rest_get).with('/rest/unmanaged-devices').and_return(FakeResponse.new({})) + expect { OneviewSDK::UnmanagedDevice.get_devices(@client) }.not_to raise_error + end + end + + describe '#add' do + it 'Should support add' do + device = OneviewSDK::UnmanagedDevice.new(@client, name: 'UnmanagedDevice_1') + expect(@client).to receive(:rest_post).with('/rest/unmanaged-devices', { 'body' => { 'name' => 'UnmanagedDevice_1' } }, 200) + .and_return(FakeResponse.new({})) + expect { device.add }.not_to raise_error + end + end + + describe '#remove' do + it 'Should support remove' do + device = OneviewSDK::UnmanagedDevice.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_delete).with('/rest/fake', {}, 200).and_return(FakeResponse.new({})) + expect { device.remove }.not_to raise_error + end + end + + describe '#create' do + it 'Should raise error if used' do + device = OneviewSDK::UnmanagedDevice.new(@client) + expect { device.create }.to raise_error(OneviewSDK::MethodUnavailable) + end + end + + describe '#delete' do + it 'Should raise error if used' do + device = OneviewSDK::UnmanagedDevice.new(@client) + expect { device.delete }.to raise_error(OneviewSDK::MethodUnavailable) + end + end + + describe '#environmentalConfiguration' do + it 'requires a uri' do + expect { OneviewSDK::UnmanagedDevice.new(@client).environmental_configuration } + .to raise_error(OneviewSDK::IncompleteResource, /Please set uri/) + end + + it 'gets uri/environmentalConfiguration' do + item = OneviewSDK::UnmanagedDevice.new(@client, uri: '/rest/fake') + expect(@client).to receive(:rest_get).with('/rest/fake/environmentalConfiguration').and_return(FakeResponse.new({})) + expect { item.environmental_configuration }.not_to raise_error + end + end +end diff --git a/spec/unit/resource/uplink_set_spec.rb b/spec/unit/resource/uplink_set_spec.rb index c083a0dbe..b400f3b11 100644 --- a/spec/unit/resource/uplink_set_spec.rb +++ b/spec/unit/resource/uplink_set_spec.rb @@ -15,113 +15,6 @@ end end - describe 'validations' do - context 'ethernetNetworkType' do - it 'validates ethernetNetworkType' do - uplink = OneviewSDK::UplinkSet.new(@client) - values = %w(NotApplicable Tagged Tunnel Unknown Untagged) - values.each do |value| - uplink[:ethernetNetworkType] = value - expect(uplink[:ethernetNetworkType]).to eq(value) - end - end - - it 'Incorrect ethernetNetworkType' do - uplink = OneviewSDK::UplinkSet.new(@client) - expect { uplink[:ethernetNetworkType] = 'None' }.to raise_error(/Invalid ethernet network type/) - end - end - - context 'lacpTimer' do - it 'validates lacpTimer' do - uplink = OneviewSDK::UplinkSet.new(@client) - values = %w(Long Short) - values.each do |value| - uplink[:lacpTimer] = value - expect(uplink[:lacpTimer]).to eq(value) - end - end - - it 'Incorrect lacpTimer' do - uplink = OneviewSDK::UplinkSet.new(@client) - expect { uplink[:lacpTimer] = 'None' }.to raise_error(/Invalid lacp timer/) - end - end - - context 'manualLoginRedistributionState' do - it 'validates manualLoginRedistributionState' do - uplink = OneviewSDK::UplinkSet.new(@client) - values = %w(Distributed Distributing DistributionFailed NotSupported Supported) - values.each do |value| - uplink[:manualLoginRedistributionState] = value - expect(uplink[:manualLoginRedistributionState]).to eq(value) - end - end - - it 'Incorrect manualLoginRedistributionState' do - uplink = OneviewSDK::UplinkSet.new(@client) - expect { uplink[:manualLoginRedistributionState] = 'None' }.to \ - raise_error(/Invalid manual login redistribution state/) - end - end - - context 'networkType' do - it 'validates networkType' do - uplink = OneviewSDK::UplinkSet.new(@client) - values = %w(Ethernet FibreChannel) - values.each do |value| - uplink[:networkType] = value - expect(uplink[:networkType]).to eq(value) - end - end - - it 'Incorrect ethernetNetworkType' do - uplink = OneviewSDK::UplinkSet.new(@client) - expect { uplink[:networkType] = 'None' }.to raise_error(/Invalid network type/) - end - end - - context 'reachability' do - it 'validates reachability' do - uplink = OneviewSDK::UplinkSet.new(@client) - values = %w(NotReachable Reachable RedundantlyReachable Unknown) - values.each do |value| - uplink[:reachability] = value - expect(uplink[:reachability]).to eq(value) - end - end - - it 'Incorrect reachability' do - uplink = OneviewSDK::UplinkSet.new(@client) - expect { uplink[:reachability] = 'None' }.to raise_error(/Invalid reachability/) - end - end - - context 'status' do - it 'validates status' do - uplink = OneviewSDK::UplinkSet.new(@client) - values = %w(OK Disabled Warning Critical Unknown) - values.each do |value| - uplink[:status] = value - expect(uplink[:status]).to eq(value) - end - end - - it 'Incorrect status' do - uplink = OneviewSDK::UplinkSet.new(@client) - expect { uplink[:status] = 'None' }.to raise_error(/Invalid status/) - end - end - - it 'only allows certain locationEntriesType values' do - %w(Bay Enclosure Ip Password Port StackingDomainId StackingMemberId UserId).each do |v| - expect { OneviewSDK::UplinkSet.new(@client, locationEntriesType: v) }.to_not raise_error - end - expect { OneviewSDK::UplinkSet.new(@client, locationEntriesType: '') }.to raise_error(/Invalid location entry type/) - expect { OneviewSDK::UplinkSet.new(@client, locationEntriesType: 'invalid') }.to raise_error(/Invalid location entry type/) - end - end - describe '#add_port_config' do it 'updates the portConfigInfos value' do item = OneviewSDK::UplinkSet.new(@client) @@ -147,9 +40,9 @@ it 'Incorrect' do uplink = OneviewSDK::UplinkSet.new(@client) - expect { uplink.add_network({}) }.to raise_error(/Invalid object/) - expect { uplink.add_fcnetwork({}) }.to raise_error(/Invalid object/) - expect { uplink.add_fcoenetwork({}) }.to raise_error(/Invalid object/) + expect { uplink.add_network({}) }.to raise_error(OneviewSDK::IncompleteResource, /Must set/) + expect { uplink.add_fcnetwork({}) }.to raise_error(OneviewSDK::IncompleteResource, /Must set/) + expect { uplink.add_fcoenetwork({}) }.to raise_error(OneviewSDK::IncompleteResource, /Must set/) end end @@ -162,7 +55,7 @@ it 'Incorrect' do uplink = OneviewSDK::UplinkSet.new(@client) - expect { uplink.set_logical_interconnect({}) }.to raise_error(/Invalid object/) + expect { uplink.set_logical_interconnect({}) }.to raise_error(OneviewSDK::IncompleteResource, /Invalid object/) end end end diff --git a/spec/unit/resource/volume_attachment_spec.rb b/spec/unit/resource/volume_attachment_spec.rb new file mode 100644 index 000000000..1d2970908 --- /dev/null +++ b/spec/unit/resource/volume_attachment_spec.rb @@ -0,0 +1,63 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::VolumeAttachment do + include_context 'shared context' + + describe '#initialize' do + it 'sets the defaults correctly api_ver 200' do + item = OneviewSDK::VolumeAttachment.new(@client) + expect(item[:type]).to eq('StorageVolumeAttachment') + end + end + + describe 'Unmanaged Storage volumes' do + it 'remove' do + expect(@client).to receive(:rest_post).with( + '/rest/storage-volume-attachments/repair', + 'body' => { + type: 'ExtraUnmanagedStorageVolumes', + resourceUri: '/rest/server-profiles/1' + } + ).and_return(FakeResponse.new({})) + OneviewSDK::VolumeAttachment.remove_extra_unmanaged_volume(@client, 'uri' => '/rest/server-profiles/1') + end + + it 'list' do + expect(@client).to receive(:rest_get).with('/rest/storage-volume-attachments/repair?alertFixType=ExtraUnmanagedStorageVolumes') + .and_return(FakeResponse.new({})) + OneviewSDK::VolumeAttachment.get_extra_unmanaged_volumes(@client) + end + end + + describe '#path' do + it 'retrieve by id' do + expect(@client).to receive(:rest_get).with('/rest/storage-volume-attachments/volume_attach_1/paths/volume_path_1') + .and_return(FakeResponse.new({})) + item = OneviewSDK::VolumeAttachment.new(@client, uri: '/rest/storage-volume-attachments/volume_attach_1') + item.get_path('volume_path_1') + end + + it 'get list' do + expect(@client).to receive(:rest_get).with('/rest/storage-volume-attachments/volume_attach_1/paths') + .and_return(FakeResponse.new({})) + item = OneviewSDK::VolumeAttachment.new(@client, uri: '/rest/storage-volume-attachments/volume_attach_1') + item.get_paths + end + end + + describe 'unavailable methods' do + it 'create' do + item = OneviewSDK::VolumeAttachment.new(@client, uri: '/rest/storage-volume-attachments/volume_attach_1') + expect { item.create }.to raise_error(/The method #create is unavailable for this resource/) + end + it 'update' do + item = OneviewSDK::VolumeAttachment.new(@client, uri: '/rest/storage-volume-attachments/volume_attach_1') + expect { item.update }.to raise_error(/The method #update is unavailable for this resource/) + end + it 'delete' do + item = OneviewSDK::VolumeAttachment.new(@client, uri: '/rest/storage-volume-attachments/volume_attach_1') + expect { item.delete }.to raise_error(/The method #delete is unavailable for this resource/) + end + end + +end diff --git a/spec/unit/resource/volume_snapshot_spec.rb b/spec/unit/resource/volume_snapshot_spec.rb index 143640e34..1d3ffb424 100644 --- a/spec/unit/resource/volume_snapshot_spec.rb +++ b/spec/unit/resource/volume_snapshot_spec.rb @@ -24,11 +24,11 @@ end it 'does not allow the create action' do - expect { @item.create }.to raise_error(/The method #create is unavailable for this resource/) + expect { @item.create }.to raise_error(OneviewSDK::MethodUnavailable, /The method #create is unavailable for this resource/) end it 'does not allow the update action' do - expect { @item.update }.to raise_error(/The method #update is unavailable for this resource/) + expect { @item.update }.to raise_error(OneviewSDK::MethodUnavailable, /The method #update is unavailable for this resource/) end end @@ -43,6 +43,11 @@ @item.set_volume(OneviewSDK::Volume.new(@client, uri: '/rest/storage-volumes/fake')) expect(@item['storageVolumeUri']).to eq('/rest/storage-volumes/fake') end + + it 'requires a storage_volume with a uri' do + vol = OneviewSDK::Volume.new(@client) + expect { @item.set_volume(vol) }.to raise_error(OneviewSDK::IncompleteResource, /Must set/) + end end end diff --git a/spec/unit/resource/volume_spec.rb b/spec/unit/resource/volume_spec.rb index 9d59dd469..e1b11167c 100644 --- a/spec/unit/resource/volume_spec.rb +++ b/spec/unit/resource/volume_spec.rb @@ -59,7 +59,7 @@ describe '#set_storage_pool' do it 'sets the storagePoolUri' do @item.set_storage_pool(OneviewSDK::StoragePool.new(@client, uri: '/rest/fake')) - expect(@item['storagePoolUri']).to eq('/rest/fake') + expect(@item['provisioningParameters']['storagePoolUri']).to eq('/rest/fake') end end @@ -120,12 +120,4 @@ end end end - - describe '#validate' do - it 'validates provisionType' do - vol = OneviewSDK::Volume.new(@client, {}) - expect { vol['provisionType'] = 'N/A' }.to raise_error(/Invalid provision type/) - end - end - end diff --git a/spec/unit/resource/volume_template_spec.rb b/spec/unit/resource/volume_template_spec.rb index e72721292..87e59ba68 100644 --- a/spec/unit/resource/volume_template_spec.rb +++ b/spec/unit/resource/volume_template_spec.rb @@ -87,38 +87,4 @@ end end end - - describe '#validate' do - context 'refreshState' do - it 'allows valid refresh states' do - volume_template = OneviewSDK::VolumeTemplate.new(@client) - valid_states = %w(NotRefreshing RefreshFailed RefreshPending Refreshing) - valid_states.each do |state| - volume_template[:refreshState] = state - expect(volume_template[:refreshState]).to eq(state) - end - end - - it 'does not allow invalid refresh states' do - volume_template = OneviewSDK::VolumeTemplate.new(@client) - expect { volume_template[:refreshState] = 'Complete' }.to raise_error.with_message(/Invalid refresh state/) - end - end - - context 'status' do - it 'allows valid statuses' do - volume_template = OneviewSDK::VolumeTemplate.new(@client) - valid_statuses = %w(OK Disabled Warning Critical Unknown) - valid_statuses.each do |state| - volume_template[:status] = state - expect(volume_template[:status]).to eq(state) - end - end - - it 'does not allow invalid statuses' do - volume_template = OneviewSDK::VolumeTemplate.new(@client) - expect { volume_template[:status] = 'Complete' }.to raise_error.with_message(/Invalid status/) - end - end - end end diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index d354729ab..4d16682dc 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -5,8 +5,8 @@ describe '#initialize' do it 'requires a valid client to be passed' do - expect { OneviewSDK::Resource.new(nil) }.to raise_error(/Must specify a valid client/) - expect { OneviewSDK::Resource.new('client') }.to raise_error(/Must specify a valid client/) + expect { OneviewSDK::Resource.new(nil) }.to raise_error(OneviewSDK::InvalidClient, /Must specify a valid client/) + expect { OneviewSDK::Resource.new('client') }.to raise_error(OneviewSDK::InvalidClient, /Must specify a valid client/) end it 'uses the client\'s logger' do @@ -26,7 +26,7 @@ end it 'can\'t use an api version greater than the client\'s max' do - expect { OneviewSDK::Resource.new(@client, {}, 300) }.to raise_error(/is greater than the client's max/) + expect { OneviewSDK::Resource.new(@client, {}, 300) }.to raise_error(OneviewSDK::UnsupportedVersion, /is greater than the client's max/) end it 'starts with an empty data hash' do @@ -44,7 +44,7 @@ describe '#retrieve!' do it 'requires the name attribute to be set' do res = OneviewSDK::Resource.new(@client) - expect { res.retrieve! }.to raise_error(/Must set resource name/) + expect { res.retrieve! }.to raise_error(OneviewSDK::IncompleteResource, /Must set resource name/) end it 'sets the data if the resource is found' do @@ -67,7 +67,7 @@ describe '#exists?' do it 'requires the name attribute to be set' do res = OneviewSDK::Resource.new(@client) - expect { res.exists? }.to raise_error(/Must set resource name or uri/) + expect { res.exists? }.to raise_error(OneviewSDK::IncompleteResource, /Must set resource name or uri/) end it 'uses the uri attribute when the name is not set' do @@ -171,7 +171,7 @@ it 'requires the client to be set' do res = OneviewSDK::Resource.new(@client) res.client = nil - expect { res.create }.to raise_error(/Please set client attribute/) + expect { res.create }.to raise_error(OneviewSDK::IncompleteResource, /Please set client attribute/) end it 'sets the data from the response' do @@ -186,7 +186,7 @@ res = OneviewSDK::Resource.new(@client, name: 'Name') fake_response = FakeResponse.new({ message: 'Invalid' }, 400) allow(@client).to receive(:rest_post).and_return(fake_response) - expect { res.create }.to raise_error(/400 BAD REQUEST {"message":"Invalid"}/) + expect { res.create }.to raise_error(OneviewSDK::BadRequest, /400 BAD REQUEST {"message":"Invalid"}/) end end @@ -214,12 +214,12 @@ it 'requires the client to be set' do res = OneviewSDK::Resource.new(@client) res.client = nil - expect { res.refresh }.to raise_error(/Please set client attribute/) + expect { res.refresh }.to raise_error(OneviewSDK::IncompleteResource, /Please set client attribute/) end it 'requires the uri to be set' do res = OneviewSDK::Resource.new(@client) - expect { res.refresh }.to raise_error(/Please set uri attribute/) + expect { res.refresh }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri attribute/) end it 'sets the data from the server\'s response' do @@ -236,12 +236,12 @@ it 'requires the client to be set' do res = OneviewSDK::Resource.new(@client) res.client = nil - expect { res.update }.to raise_error(/Please set client attribute/) + expect { res.update }.to raise_error(OneviewSDK::IncompleteResource, /Please set client attribute/) end it 'requires the uri to be set' do res = OneviewSDK::Resource.new(@client) - expect { res.update }.to raise_error(/Please set uri attribute/) + expect { res.update }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri attribute/) end it 'uses the rest_put method to update the data' do @@ -256,7 +256,7 @@ fake_response = FakeResponse.new({ message: 'Invalid' }, 400) expect(@client).to receive(:rest_put).with( res['uri'], { 'body' => res.data }, res.api_version).and_return(fake_response) - expect { res.update }.to raise_error(/400 BAD REQUEST {"message":"Invalid"}/) + expect { res.update }.to raise_error(OneviewSDK::BadRequest, /400 BAD REQUEST {"message":"Invalid"}/) end end @@ -264,12 +264,12 @@ it 'requires the client to be set' do res = OneviewSDK::Resource.new(@client) res.client = nil - expect { res.delete }.to raise_error(/Please set client attribute/) + expect { res.delete }.to raise_error(OneviewSDK::IncompleteResource, /Please set client attribute/) end it 'requires the uri to be set' do res = OneviewSDK::Resource.new(@client) - expect { res.delete }.to raise_error(/Please set uri attribute/) + expect { res.delete }.to raise_error(OneviewSDK::IncompleteResource, /Please set uri attribute/) end it 'returns true if the delete was successful' do @@ -284,7 +284,7 @@ fake_response = FakeResponse.new({ message: 'Invalid' }, 400) expect(@client).to receive(:rest_delete).with( res['uri'], {}, res.api_version).and_return(fake_response) - expect { res.delete }.to raise_error(/400 BAD REQUEST {"message":"Invalid"}/) + expect { res.delete }.to raise_error(OneviewSDK::BadRequest, /400 BAD REQUEST {"message":"Invalid"}/) end end @@ -312,7 +312,7 @@ it 'fails when an invalid format is specified' do path = 'res.txt' - expect { @res.to_file(path, 'txt') }.to raise_error(/Invalid format/) + expect { @res.to_file(path, 'txt') }.to raise_error(OneviewSDK::InvalidFormat, /Invalid format/) end end @@ -331,9 +331,10 @@ end it 'displays a nice error if the schema endpoint returns a 404 response' do - allow(@client).to receive(:rest_get).and_raise('ERROR: 404 NOT FOUND /schema') + fake_response = FakeResponse.new({ message: 'Not Found' }, 404) + allow(@client).to receive(:rest_get).and_return(fake_response) expect(@client.logger).to receive(:error).with(/does not implement the schema endpoint/) - expect { OneviewSDK::Resource.schema(@client) }.to raise_error(/404 NOT FOUND/) + expect { OneviewSDK::Resource.schema(@client) }.to raise_error(OneviewSDK::NotFound, /404 NOT FOUND/) end end @@ -368,6 +369,27 @@ OneviewSDK::Resource.get_all(@client) end end + + describe '#build_query' do + it 'builds basic query' do + expect(OneviewSDK::Resource.build_query('test' => 'TEST')).to eq('?test=TEST') + end + + it 'builds resource query' do + fake_resource = OneviewSDK::Resource.new(@client, 'uri' => 'URI') + expect(OneviewSDK::Resource.build_query('this_resource' => fake_resource)).to eq('?thisResourceUri=URI') + end + + it 'builds composed query' do + fake_resource = OneviewSDK::Resource.new(@client, 'uri' => 'URI') + expect(OneviewSDK::Resource.build_query('test' => 'TEST', 'this_resource' => fake_resource)).to eq('?test=TEST&thisResourceUri=URI') + end + + it 'returns empty String for invalid values' do + expect(OneviewSDK::Resource.build_query('')).to eq('') + expect(OneviewSDK::Resource.build_query(nil)).to eq('') + end + end end RSpec.describe OneviewSDK do diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb index 44a51b5fd..0f6d71f73 100644 --- a/spec/unit/rest_spec.rb +++ b/spec/unit/rest_spec.rb @@ -14,7 +14,7 @@ end it 'requires a path' do - expect { @client.rest_api(:get, nil) }.to raise_error(/Must specify path/) + expect { @client.rest_api(:get, nil) }.to raise_error(OneviewSDK::InvalidRequest, /Must specify path/) end it 'logs the request type and path (debug level)' do @@ -30,6 +30,13 @@ expect(@client.logger).to receive(:error).with(/SSL verification failed/) expect { @client.rest_api(:get, path) }.to raise_error(OpenSSL::SSL::SSLError) end + + it 'respects the client.timeout value' do + client = OneviewSDK::Client.new(url: 'https://oneview.example.com', token: 'secret123', timeout: 5) + expect_any_instance_of(Net::HTTP).to receive(:read_timeout=).with(5).and_call_original + expect_any_instance_of(Net::HTTP).to receive(:open_timeout=).with(5).and_call_original + client.rest_api(:get, path) + end end describe '#rest_get' do @@ -117,23 +124,23 @@ it 'raises an error for 400 status' do resp = FakeResponse.new({ message: 'Blah' }, 400) - expect { @client.response_handler(resp) }.to raise_error(/400 BAD REQUEST.*Blah/) + expect { @client.response_handler(resp) }.to raise_error(OneviewSDK::BadRequest, /400 BAD REQUEST.*Blah/) end it 'raises an error for 401 status' do resp = FakeResponse.new({ message: 'Blah' }, 401) - expect { @client.response_handler(resp) }.to raise_error(/401 UNAUTHORIZED.*Blah/) + expect { @client.response_handler(resp) }.to raise_error(OneviewSDK::Unauthorized, /401 UNAUTHORIZED.*Blah/) end it 'raises an error for 404 status' do resp = FakeResponse.new({ message: 'Blah' }, 404) - expect { @client.response_handler(resp) }.to raise_error(/404 NOT FOUND.*Blah/) + expect { @client.response_handler(resp) }.to raise_error(OneviewSDK::NotFound, /404 NOT FOUND.*Blah/) end it 'raises an error for undefined status codes' do [0, 19, 199, 203, 399, 402, 500].each do |status| resp = FakeResponse.new({ message: 'Blah' }, status) - expect { @client.response_handler(resp) }.to raise_error(/#{status}.*Blah/) + expect { @client.response_handler(resp) }.to raise_error(OneviewSDK::RequestError, /#{status}.*Blah/) end end end @@ -148,7 +155,7 @@ end it 'fails when an invalid request type is given' do - expect { @client.send(:build_request, :fake, @uri, {}, @client.api_version) }.to raise_error(/Invalid rest call/) + expect { @client.send(:build_request, :fake, @uri, {}, @client.api_version) }.to raise_error(OneviewSDK::InvalidRequest, /Invalid rest call/) end context 'default header values' do diff --git a/spec/unit/ssl_helper_spec.rb b/spec/unit/ssl_helper_spec.rb index 97777a5ba..6d2075bac 100644 --- a/spec/unit/ssl_helper_spec.rb +++ b/spec/unit/ssl_helper_spec.rb @@ -51,9 +51,9 @@ end it 'requires a valid url' do - expect { described_class.check_cert('blah') }.to raise_error(/Invalid url/) + expect { described_class.check_cert('blah') }.to raise_error(OneviewSDK::InvalidURL, /Invalid url/) expect { described_class.check_cert('http://') }.to raise_error(/(Invalid url)|(bad URI)/) # Differs on Ruby 2.1 and 2.2 - expect { described_class.check_cert('10.0.0.1') }.to raise_error(/Invalid url/) + expect { described_class.check_cert('10.0.0.1') }.to raise_error(OneviewSDK::InvalidURL, /Invalid url/) end end @@ -78,9 +78,9 @@ end it 'requires a valid url' do - expect { described_class.install_cert('blah') }.to raise_error(/Invalid url/) + expect { described_class.install_cert('blah') }.to raise_error(OneviewSDK::InvalidURL, /Invalid url/) expect { described_class.check_cert('http://') }.to raise_error(/(Invalid url)|(bad URI)/) # Differs on Ruby 2.1 and 2.2 - expect { described_class.install_cert('10.0.0.1') }.to raise_error(/Invalid url/) + expect { described_class.install_cert('10.0.0.1') }.to raise_error(OneviewSDK::InvalidURL, /Invalid url/) end end