Class: OneviewSDK::API200::ConnectionTemplate

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

Overview

Connection template resource implementation

Constant Summary collapse

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

Constants inherited from Resource

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 Resource

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



24
25
26
27
28
29
# File 'lib/oneview-sdk/resource/api200/connection_template.rb', line 24

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:

  • (OneviewSDK::ConnectionTemplate)

    Connection template



46
47
48
49
50
# File 'lib/oneview-sdk/resource/api200/connection_template.rb', line 46

def self.get_default(client)
  response = client.rest_get(BASE_URI + '/defaultConnectionTemplate')
  variant = name.split('::').at(-2)
  OneviewSDK.resource_named('ConnectionTemplate', client.api_version, variant).new(client, client.response_handler(response))
end

Instance Method Details

#createObject

Method is not available

Raises:



33
34
35
# File 'lib/oneview-sdk/resource/api200/connection_template.rb', line 33

def create(*)
  unavailable_method
end

#deleteObject

Method is not available

Raises:



39
40
41
# File 'lib/oneview-sdk/resource/api200/connection_template.rb', line 39

def delete(*)
  unavailable_method
end