class OneviewSDK::API600::C7000::ServerProfile

Server Profile resource implementation on API600 C7000

Public Class Methods

get_available_storage_system(*) click to toggle source

Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available

# File lib/oneview-sdk/resource/api600/c7000/server_profile.rb, line 32
def self.get_available_storage_system(*)
  unavailable_method
end
get_available_storage_systems(*) click to toggle source

Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available

# File lib/oneview-sdk/resource/api600/c7000/server_profile.rb, line 38
def self.get_available_storage_systems(*)
  unavailable_method
end
new(client, params = {}, api_ver = nil) click to toggle source

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 interacting with this resource.

# File lib/oneview-sdk/resource/api600/c7000/server_profile.rb, line 23
def initialize(client, params = {}, api_ver = nil)
  @data ||= {}
  # Default values
  @data['type'] ||= 'ServerProfileV8'
  super
end

Public Instance Methods

add_connection(network, connection_options = {}) click to toggle source

Adds a connection entry to server profile @param [OneviewSDK::EthernetNetwork, OneviewSDK::FCNetwork] network Network associated with the connection @param [Hash<String,String>] connection_options Hash containing the configuration of the connection @option connection_options [Boolean] 'boot' Indicates that the server will attempt to boot from this connection. @option connection_options [String] 'functionType' Type of function required for the connection. Values: Ethernet, FibreChannel, iSCSI. @option connection_options [Integer] 'id' A unique identifier for this connection. If 0, id is automatically assigned. @option connection_options [String] 'ipv4' The IP information for a connection. This is only used for iSCSI connections. @option connection_options [String] 'name' Name of the connection. @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.

# File lib/oneview-sdk/resource/api600/c7000/server_profile.rb, line 59
def add_connection(network, connection_options = {})
  connection_options = Hash[connection_options.map { |k, v| [k.to_s, v] }]
  self['connectionSettings'] = {} unless self['connectionSettings']
  self['connectionSettings']['connections'] = [] unless self['connectionSettings']['connections']
  connection_options['id'] ||= 0
  connection_options['networkUri'] = network['uri'] if network['uri'] || network.retrieve!
  self['connectionSettings']['connections'] << connection_options
end
get_messages(*) click to toggle source

Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available

# File lib/oneview-sdk/resource/api600/c7000/server_profile.rb, line 44
def get_messages(*)
  unavailable_method
end
remove_connection(connection_name) click to toggle source

Removes a connection entry in server profile @param [String] connection_name Name of the connection @return Returns the connection hash if found, otherwise returns nil

# File lib/oneview-sdk/resource/api600/c7000/server_profile.rb, line 71
def remove_connection(connection_name)
  desired_connection = nil
  return desired_connection unless self['connectionSettings']['connections']
  self['connectionSettings']['connections'].each do |con|
    desired_connection = self['connectionSettings']['connections'].delete(con) if con['name'] == connection_name
  end
  desired_connection
end