Skip to content

Commit

Permalink
resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
sijeesh committed Apr 20, 2018
2 parents e0c61dd + 8210c56 commit 49ce2b8
Show file tree
Hide file tree
Showing 224 changed files with 4,598 additions and 2,514 deletions.
37 changes: 31 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
## v5.5.0(Unreleased)
## v5.5.0 (unreleased)

#### Notes
Extends support of the SDK to OneView Rest API version 800 (OneView v4.10).
Extended support to Image Streamer Rest API version 500((ImageStreamer v3.10)) and API version 600 (ImageStreamer v4.0).

#### Features Supported
This release adds support to OneView Rest API version 800 for the hardware variants C7000 and Synergy to the already existing features:
- Server Profile Template
#### Features supported
Extends support to OneView Rest API version 600 for the hardware variants C7000 and Synergy to the already existing features:
- OS Deployment Plan

Extended support to Image Streamer Rest API version 500 and 600 to the already existing features:
- Build Plan
- Deployment Plan
- Golden Image
- OS Volume

## v5.4.0(Unreleased)

## v5.4.0

#### Notes
Extends support of the SDK to OneView Rest API version 600 (OneView v4.0).

#### Features supported
This release adds support to OneView Rest API version 600 for the hardware variants C7000 and Synergy to the already existing features:
- Connection Templates
- Enclosure
- Enclosure Group
- Ethernet Network
Expand All @@ -25,12 +33,29 @@ This release adds support to OneView Rest API version 600 for the hardware varia
- Logical Enclosure
- Logical Interconnect
- Logical Interconnect Group
- Logical Switch
- Logical Switch Group
- Managed SAN
- Network Set
- SAS Interconnect
- SAS Interconnect Type
- SAS Logical Interconnect
- SAS Logical Interconnect Group
- Scope
- Server Hardware
- Server Hardware Types
- Server Profile
- Server Profile Template
- Storage Pool
- Switch
- Switch Type
- Storage System
- Uplink Set
- Volume
- Volume Template

Extended support to Image Streamer Rest API version 500 and 600 to the already existing features:
- Plan Script

## v5.3.0

Expand Down
297 changes: 152 additions & 145 deletions endpoints-support.md

Large diffs are not rendered by default.

47 changes: 0 additions & 47 deletions examples/api500/storage_pool.rb

This file was deleted.

36 changes: 20 additions & 16 deletions examples/api500/storage_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@
# - API200 for C7000 and Synergy (see /examples/shared_samples/storage_system.rb)
# - API300 for C7000 and Synergy (see /examples/shared_samples/storage_system.rb)
# - API500 for C7000 and Synergy
# - API600 for C7000 and Synergy (see /examples/api600/storage_system.rb)

raise 'ERROR: Must set @storage_system_ip in _client.rb' unless @storage_system_ip
raise 'ERROR: Must set @storage_system_username in _client.rb' unless @storage_system_username
raise 'ERROR: Must set @storage_system_password in _client.rb' unless @storage_system_password

if @client.api_version < 500
raise "If you want execute sample for API < #{@client.api_version}, you should execute the ruby file '/examples/shared_samples/storage_system.rb'"
raise "If you want execute sample for API < #{@client.api_version}," \
"you should execute the ruby file '/examples/shared_samples/storage_system.rb'"
elsif @client.api_version == 600
raise "If you want execute sample for API #{@client.api_version}," \
"you should execute the ruby file '/examples/api600/storage_system.rb'"
end

# Resources classes that you can use for Storage System in this example:
Expand All @@ -36,28 +41,28 @@
storage_system_class = OneviewSDK.resource_named('StorageSystem', @client.api_version)

# for StorageSystem with family StoreServ
# options = {
# credentials: {
# username: @storage_system_username,
# password: @storage_system_password
# },
# hostname: @storage_system_ip,
# family: 'StoreServ',
# deviceSpecificAttributes: {
# managedDomain: 'TestDomain'
# }
# }

# for StorageSystem with family StoreVirtual
options = {
credentials: {
username: @storage_system_username,
password: @storage_system_password
},
hostname: @storage_system_ip,
family: 'StoreVirtual'
family: 'StoreServ',
deviceSpecificAttributes: {
managedDomain: 'TestDomain'
}
}

# for StorageSystem with family StoreVirtual
# options = {
# credentials: {
# username: @storage_system_username,
# password: @storage_system_password
# },
# hostname: @storage_system_ip,
# family: 'StoreVirtual'
# }

storage_system = storage_system_class.new(@client, options)
puts "\nAdding a storage system with"
puts "Managed Domain: #{storage_system['deviceSpecificAttributes']['managedDomain']}" if options['family'] == 'StoreServ'
Expand All @@ -73,7 +78,6 @@

storage_system = storage_system_class.new(@client, hostname: storage_system['hostname'])
storage_system.retrieve!

port = storage_system['ports'].find { |item| item['protocolType'].downcase.include?('fc') } # find first correct protocolType for using our fc network
if port
fc_network = OneviewSDK::API500::C7000::FCNetwork.get_all(@client).first
Expand Down
107 changes: 107 additions & 0 deletions examples/api600/storage_system.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# (C) Copyright 2017 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 1: You'll need to add a FCNetwork before execute this sample
# NOTE 2: You'll need to add the following instance variables to the _client.rb file with valid credentials for your environment:
# @storage_system_ip
# @storage_system_username
# @storage_system_password

# All supported APIs for Storage System:
# - API200 for C7000 and Synergy (see /examples/shared_samples/storage_system.rb)
# - API300 for C7000 and Synergy (see /examples/shared_samples/storage_system.rb)
# - API500 for C7000 and Synergy (see /examples/api500/storage_system.rb)
# - API600 for C7000 and Synergy

raise 'ERROR: Must set @storage_system_ip in _client.rb' unless @storage_system_ip
raise 'ERROR: Must set @storage_system_username in _client.rb' unless @storage_system_username
raise 'ERROR: Must set @storage_system_password in _client.rb' unless @storage_system_password

if @client.api_version < 500
raise "If you want execute sample for API < #{@client.api_version}," \
"you should execute the ruby file '/examples/shared_samples/storage_system.rb'"
elsif @client.api_version == 500
raise "If you want execute sample for API #{@client.api_version}," \
"you should execute the ruby file '/examples/api500/storage_system.rb'"
end

# Resources classes that you can use for Storage System in this example:
# storage_system_class = OneviewSDK::API600::C7000::StorageSystem
# storage_system_class = OneviewSDK::API600::Synergy::StorageSystem
storage_system_class = OneviewSDK.resource_named('StorageSystem', @client.api_version)

# for StorageSystem with family StoreServ
options = {
credentials: {
username: @storage_system_username,
password: @storage_system_password
},
hostname: @storage_system_ip,
family: 'StoreServ',
deviceSpecificAttributes: {
managedDomain: 'TestDomain'
}
}

# for StorageSystem with family StoreVirtual
# options = {
# credentials: {
# username: @storage_system_username,
# password: @storage_system_password
# },
# hostname: @storage_system_ip,
# family: 'StoreVirtual'
# }

storage_system = storage_system_class.new(@client, options)
puts "\nAdding a storage system with"
puts "Managed Domain: #{storage_system['deviceSpecificAttributes']['managedDomain']}" if options['family'] == 'StoreServ'
puts "Family: #{storage_system['family']}"
puts "Hostname: #{storage_system['hostname']}."
storage_system.add
puts "\nStorage system with uri='#{storage_system['uri']}' added successfully."

puts "\nFinding a storage system with hostname: #{storage_system['hostname']}"
storage_system_class.find_by(@client, hostname: storage_system['hostname']).each do |storage|
puts "\nStorage system with uri='#{storage['uri']}' found."
end

storage_system = storage_system_class.new(@client, hostname: storage_system['hostname'])
storage_system.retrieve!
port = storage_system['ports'].find { |item| item['protocolType'].downcase.include?('fc') } # find first correct protocolType for using our fc network
if port
fc_network = OneviewSDK::API600::C7000::FCNetwork.get_all(@client).first
puts "\n Adding a fc network named '#{fc_network['name']}' with uri='#{fc_network['uri']}' to the storage system."
port['expectedNetworkUri'] = fc_network['uri']
port['expectedNetworkName'] = fc_network['name']
port['mode'] = 'Managed'
storage_system.update
puts "\nNetwork added successfully."
storage_system.refresh
end

puts "\nReachable ports:"
puts storage_system.get_reachable_ports

puts "\nTemplates:"
storage_system.get_templates

puts "\nLast refresh time: #{storage_system['lastRefreshTime']}"
puts "\nRefreshing the storage system"
storage_system.request_refresh
storage_system.refresh
puts "\nLast refresh time: #{storage_system['lastRefreshTime']}"

puts "\nRemoving the storage system."
storage_system.remove
puts "\nStorage system removed successfully."
Loading

0 comments on commit 49ce2b8

Please sign in to comment.