class OneviewSDK::API200::WebServerCertificate

Web Server Certificate certificate resource implementation

Constants

BASE_URI

Public Class Methods

get_certificate(client, address, options = { 'requestername' => 'DEFAULT' }) click to toggle source

Retrieves the existing SSL certificate information @param [OneviewSDK::Client] client The client object for the OneView appliance @param [String] address The hostname or IP address @param [Hash] options The header options of request (key-value pairs) @option options [String] :requestername Used to identify requester to allow querying of proper trust store.

Default value is "DEFAULT". List of valid input values are { "DEFAULT", "AUTHN", "RABBITMQ", "ILOOA" }.

@option options [String] :Accept-Language The language code requested in the response.

If a suitable match to the requested language is not available, en-US or the appliance locale is used.

@return [Boolean] Whether or not retrieve was successful @return [WebServerCertificate] the resource

# File lib/oneview-sdk/resource/api200/web_server_certificate.rb, line 57
def self.get_certificate(client, address, options = { 'requestername' => 'DEFAULT' })
  response = client.rest_api(:get, self::BASE_URI + "/remote/#{address}", options)
  body = client.response_handler(response)
  new(client, body)
end

Public Instance Methods

create() click to toggle source

Creates a Certificate Signing Request (CSR) using input certificate data and returns the newly-created CSR. @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 [Resource] self

# File lib/oneview-sdk/resource/api200/web_server_certificate.rb, line 78
def create
  ensure_client
  response = @client.rest_post(self.class::BASE_URI + '/certificaterequest', { 'body' => @data }, @api_version)
  body = @client.response_handler(response)
  set_all(body)
end
create!(*) click to toggle source

Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available

# File lib/oneview-sdk/resource/api200/web_server_certificate.rb, line 34
def create!(*)
  unavailable_method
end
create_self_signed() click to toggle source

Creates a new self-signed appliance certificate based on the certificate data provided. @raise [OneviewSDK::IncompleteResource] if the client is not set @raise [StandardError] if the resource creation fails @return [Resource] self

# File lib/oneview-sdk/resource/api200/web_server_certificate.rb, line 89
def create_self_signed
  ensure_client
  response = @client.rest_put(self.class::BASE_URI, { 'body' => @data }, @api_version)
  body = @client.response_handler(response)
  set_all(body)
end
delete(*) click to toggle source

Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available

# File lib/oneview-sdk/resource/api200/web_server_certificate.rb, line 28
def delete(*)
  unavailable_method
end
import() click to toggle source

Imports a signed server certificate into the appliance @raise [OneviewSDK::IncompleteResource] if the client is not set @return [Resource] self

# File lib/oneview-sdk/resource/api200/web_server_certificate.rb, line 66
def import
  ensure_client
  response = @client.rest_put(self.class::BASE_URI + '/certificaterequest', { 'body' => @data }, @api_version)
  body = @client.response_handler(response)
  set_all(body)
end
retrieve!() click to toggle source

Retrieves the existing SSL certificate information @return [Boolean] Whether or not retrieve was successful

# File lib/oneview-sdk/resource/api200/web_server_certificate.rb, line 40
def retrieve!
  response = @client.rest_get(self.class::BASE_URI)
  body = @client.response_handler(response)
  set_all(body)
  true
end
update(*) click to toggle source

Method is not available @raise [OneviewSDK::MethodUnavailable] method is not available

# File lib/oneview-sdk/resource/api200/web_server_certificate.rb, line 22
def update(*)
  unavailable_method
end