class OneviewSDK::API200::Datacenter
Datacenter
resource implementation
Constants
- BASE_URI
Public Class Methods
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 interracting with this resource.
OneviewSDK::Resource::new
# File lib/oneview-sdk/resource/api200/datacenter.rb, line 35 def initialize(client, params = {}, api_ver = nil) super # Default values: @data['contents'] ||= [] end
Public Instance Methods
Add the resource on OneView using the current data @note Calls the refresh method to set additional data @raise [OneviewSDK::IncompleteResource] if the client is not set @raise [StandardError] if the resource creation fails @return [OneviewSDK::Datacenter] self
Adds an existing rack to the datacenter @param [OneviewSDK::Rack] rack rack @param [Decimal] pos_x x position @param [Decimal] pos_y y position @param [Decimal] rotation Rotation degrees (0-359) around the center of the resource
# File lib/oneview-sdk/resource/api200/datacenter.rb, line 58 def add_rack(rack, pos_x, pos_y, rotation = 0) @data['contents'] << { 'resourceUri' => rack['uri'], 'x' => pos_x, 'y' => pos_y, 'rotation' => rotation } end
Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available
# File lib/oneview-sdk/resource/api200/datacenter.rb, line 43 def create(*) unavailable_method end
Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available
# File lib/oneview-sdk/resource/api200/datacenter.rb, line 49 def delete(*) unavailable_method end
Gets a list of the visual content objects @return [Hash]
# File lib/oneview-sdk/resource/api200/datacenter.rb, line 75 def get_visual_content response = @client.rest_get(@data['uri'] + '/visualContent') @client.response_handler(response) end
Remove resource from OneView @return [true] if resource was removed successfully
Removes a rack from the datacenter @param [OneviewSDK::Rack] rack rack
# File lib/oneview-sdk/resource/api200/datacenter.rb, line 69 def remove_rack(rack) @data['contents'].reject! { |resource| resource['resourceUri'] == rack['uri'] } end