Class: OneviewSDK::API600::C7000::ServerProfile

Inherits:
OneviewSDK::API500::C7000::ServerProfile show all
Defined in:
lib/oneview-sdk/resource/api600/c7000/server_profile.rb

Overview

Server Profile resource implementation on API600 C7000

Constant Summary

Constants inherited from OneviewSDK::API200::ServerProfile

OneviewSDK::API200::ServerProfile::BASE_URI, OneviewSDK::API200::ServerProfile::UNIQUE_IDENTIFIERS

Constants inherited from Resource

Resource::BASE_URI, Resource::DEFAULT_REQUEST_HEADER, Resource::UNIQUE_IDENTIFIERS

Instance Attribute Summary

Attributes inherited from Resource

#api_version, #client, #data, #logger

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OneviewSDK::API500::C7000::ServerProfile

#create_volume_with_attachment, #get_profile_template

Methods inherited from OneviewSDK::API200::ServerProfile

#add_volume_attachment, #create_volume_with_attachment, #get_available_hardware, #get_available_networks, get_available_networks, get_available_servers, get_available_targets, #get_compliance_preview, get_profile_ports, #get_server_hardware, #get_transformation, #remove_volume_attachment, #set_enclosure, #set_enclosure_group, #set_firmware_driver, #set_server_hardware, #set_server_hardware_type, #update_from_template

Methods included from ResourceHelper::PatchOperation

#patch

Methods inherited from Resource

#==, #[], #[]=, build_query, #create, #create!, #deep_merge!, #delete, #each, #eql?, #exists?, find_by, find_with_pagination, from_file, get_all, get_all_with_query, #like?, #refresh, #retrieve!, #schema, schema, #set, #set_all, #to_file, #update

Constructor Details

#initialize(client, params = {}, api_ver = nil) ⇒ ServerProfile

Create a resource object, associate it with a client, and set its properties.

Parameters:

  • client (OneviewSDK::Client)

    The client object for the OneView appliance

  • params (Hash) (defaults to: {})

    The options for this resource (key-value pairs)

  • api_ver (Integer) (defaults to: nil)

    The api version to use when interacting with this resource.



23
24
25
26
27
28
# 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

Class Method Details

.get_available_storage_systemObject

Method is not available

Raises:



32
33
34
# File 'lib/oneview-sdk/resource/api600/c7000/server_profile.rb', line 32

def self.get_available_storage_system(*)
  unavailable_method
end

.get_available_storage_systemsObject

Method is not available

Raises:



38
39
40
# File 'lib/oneview-sdk/resource/api600/c7000/server_profile.rb', line 38

def self.get_available_storage_systems(*)
  unavailable_method
end

Instance Method Details

#add_connection(network, connection_options = {}) ⇒ Object

Adds a connection entry to server profile

Parameters:

  • network (OneviewSDK::EthernetNetwork, OneviewSDK::FCNetwork)

    Network associated with the connection

  • connection_options (Hash<String,String>) (defaults to: {})

    Hash containing the configuration of the connection

Options Hash (connection_options):

  • 'boot' (Boolean)

    Indicates that the server will attempt to boot from this connection.

  • 'functionType' (String)

    Type of function required for the connection. Values: Ethernet, FibreChannel, iSCSI.

  • 'id' (Integer)

    A unique identifier for this connection. If 0, id is automatically assigned.

  • 'ipv4' (String)

    The IP information for a connection. This is only used for iSCSI connections.

  • 'name' (String)

    Name of the connection.

  • 'portId' (String)

    Identifies the port (FlexNIC) used for this connection.

  • 'requestedMbps' (String)

    The transmit throughput (mbps) that should be allocated to this connection.

  • 'requestedVFs' (String)

    This value can be “Auto” or 0.



59
60
61
62
63
64
65
66
# 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_messagesObject

Method is not available

Raises:



44
45
46
# File 'lib/oneview-sdk/resource/api600/c7000/server_profile.rb', line 44

def get_messages(*)
  unavailable_method
end

#remove_connection(connection_name) ⇒ Object

Removes a connection entry in server profile

Parameters:

  • connection_name (String)

    Name of the connection

Returns:

  • Returns the connection hash if found, otherwise returns nil



71
72
73
74
75
76
77
78
# 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