Class: OneviewSDK::FCoENetwork

Inherits:
Resource
  • Object
show all
Defined in:
lib/oneview-sdk/resource/fcoe_network.rb

Overview

FCoE network resource implementation

Validates collapse

VALID_VLAN_IDS =
(1..4094).freeze

Constant Summary collapse

BASE_URI =
'/rest/fcoe-networks'.freeze

Instance Attribute Summary

Attributes inherited from Resource

#api_version, #client, #data, #logger

Validates collapse

Instance Method Summary collapse

Methods inherited from Resource

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

Constructor Details

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

Returns a new instance of FCoENetwork.



6
7
8
9
10
11
# File 'lib/oneview-sdk/resource/fcoe_network.rb', line 6

def initialize(client, params = {}, api_ver = nil)
  super
  # Default values:
  @data['connectionTemplateUri'] ||= nil
  @data['type'] ||= 'fcoe-network'
end

Instance Method Details

#validate_vlanId(value) ⇒ Object

Validate vlanId

Parameters:

  • value (Fixnum)

    1..4094



18
19
20
# File 'lib/oneview-sdk/resource/fcoe_network.rb', line 18

def validate_vlanId(value)
  fail 'vlanId out of range 1..4094' unless VALID_VLAN_IDS.include?(value)
end