Class: RHC::Rest::Alias

Inherits:
Base show all
Defined in:
lib/rhc/rest/alias.rb

Direct Known Subclasses

Mock::MockRestAlias

Instance Method Summary collapse

Methods inherited from Base

#add_message, #has_param?, #initialize, #link_href, #links, #rest_method, #supports?

Methods included from AttributesClass

#define_attr, #model_name

Methods included from Attributes

#attribute, #attributes, #attributes=, #clear_attribute

Constructor Details

This class inherits a constructor from RHC::Rest::Base

Instance Method Details

#<=>(a) ⇒ Object



33
34
35
# File 'lib/rhc/rest/alias.rb', line 33

def <=>(a)
  return self.name <=> a.name
end

#add_certificate(ssl_certificate_content, private_key_content, pass_phrase) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/rhc/rest/alias.rb', line 17

def add_certificate(ssl_certificate_content, private_key_content, pass_phrase)
  debug "Running add_certificate for alias #{@id}"
  raise RHC::Rest::SslCertificatesNotSupported, "The server does not support SSL certificates for custom aliases." unless supports? :update
  foo = rest_method :update, {
    :ssl_certificate => ssl_certificate_content, 
    :private_key => private_key_content, 
    :pass_phrase => pass_phrase
  }
end

#delete_certificateObject



27
28
29
30
31
# File 'lib/rhc/rest/alias.rb', line 27

def delete_certificate
  debug "Running delete_certificate for alias #{@id}"
  raise RHC::Rest::SslCertificatesNotSupported, "The server does not support SSL certificates for custom aliases." unless supports? :update
  rest_method :update, {}
end

#destroyObject Also known as: delete



11
12
13
14
# File 'lib/rhc/rest/alias.rb', line 11

def destroy
  debug "Deleting alias #{self.id}"
  rest_method :delete
end

#has_private_ssl_certificate?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/rhc/rest/alias.rb', line 7

def has_private_ssl_certificate?
  has_private_ssl_certificate
end

#to_sObject



37
38
39
# File 'lib/rhc/rest/alias.rb', line 37

def to_s
  self.id
end