Class: OneviewSDK::ConnectionTemplate

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

Overview

Connection template resource implementation

Constant Summary collapse

BASE_URI =
'/rest/connection-templates'.freeze

Instance Attribute Summary

Attributes inherited from Resource

#api_version, #client, #data, #logger

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#==, #[], #[]=, build_query, #create!, #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) ⇒ ConnectionTemplate

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



21
22
23
24
25
26
# File 'lib/oneview-sdk/resource/connection_template.rb', line 21

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

Class Method Details

.get_default(client) ⇒ OneviewSDK::ConnectionTemplate

Get the default network connection template

Parameters:

Returns:



43
44
45
46
# File 'lib/oneview-sdk/resource/connection_template.rb', line 43

def self.get_default(client)
  response = client.rest_get(BASE_URI + '/defaultConnectionTemplate')
  OneviewSDK::ConnectionTemplate.new(client, client.response_handler(response))
end

Instance Method Details

#createObject

Method is not available

Raises:



30
31
32
# File 'lib/oneview-sdk/resource/connection_template.rb', line 30

def create
  unavailable_method
end

#deleteObject

Method is not available

Raises:



36
37
38
# File 'lib/oneview-sdk/resource/connection_template.rb', line 36

def delete
  unavailable_method
end