controller/app/models/application.rb
# Register a DNS alias for the application.
#
# == Parameters:
# fqdn::
#   Fully qualified domain name of the alias to associate with this application
# ssl_certificate:: SSL certificate to add
# private_key::Private key for the SSL certificate
# pass_phrase::Optional passphrase for the private key
#
# == Returns:
# {PendingAppOps} object which tracks the progress of the operation.
#
# == Raises:
# OpenShift::UserException if the alias is already been associated with an application.
Register a DNS alias for the application.

{PendingAppOps} object which tracks the progress of the operation.

:UserException if the alias is already been associated with an application.
Register a DNS alias for the application . { PendingAppOps } object which tracks the progress of the operation . : UserException if the alias is already been associated with an application .
def add_alias(fqdn, ssl_certificate=nil, private_key=nil, pass_phrase="")
    server_alias = validate_alias(fqdn) or
      raise OpenShift::UserException.new("The specified alias is not allowed: '#{fqdn}'", 105, "id")
    validate_certificate(ssl_certificate, private_key, pass_phrase)
    Lock.run_in_app_lock(self) do
      raise OpenShift::UserException.new("Alias #{server_alias} is already registered", 140, "id") if Application.where("aliases.fqdn" => server_alias).count > 0
      op_group = AddAliasOpGroup.new(fqdn: server_alias, user_agent: self.user_agent)
      self.pending_op_groups << op_group
      if ssl_certificate.present?
        op_group = AddSslCertOpGroup.new(fqdn: server_alias, ssl_certificate: ssl_certificate, private_key: private_key, pass_phrase: pass_phrase, user_agent: self.user_agent)
        self.pending_op_groups << op_group
      end
      result_io = ResultIO.new
      self.run_jobs(result_io)
      result_io
    end
  end
def add_alias ( fqdn , ssl_certificate = nil , private_key = nil , pass_phrase = "" ) server_alias = validate_alias ( fqdn ) or raise OpenShift :: UserException . new ( "The specified alias is not allowed: '#{fqdn}'" , 105 , "id" ) validate_certificate ( ssl_certificate , private_key , pass_phrase ) Lock . run_in_app_lock ( self ) do raise OpenShift :: UserException . new ( "Alias #{server_alias} is already registered" , 140 , "id" ) if Application . where ( "aliases.fqdn" => server_alias ) . count > 0 op_group = AddAliasOpGroup . new ( fqdn : server_alias , user_agent : self . user_agent ) self . pending_op_groups << op_group if ssl_certificate . present? op_group = AddSslCertOpGroup . new ( fqdn : server_alias , ssl_certificate : ssl_certificate , private_key : private_key , pass_phrase : pass_phrase , user_agent : self . user_agent ) self . pending_op_groups << op_group end result_io = ResultIO . new self . run_jobs ( result_io ) result_io end end
Register a DNS alias for the application.
Register a DNS alias for the application .
# Server aliases validate as DNS host names in accordance with RFC # 1123 and RFC 952.  Additionally, OpenShift does not allow an # Alias to be an IP address or a host in the service domain. # Since DNS is case insensitive, all names are downcased for # indexing/compares.
fqdn
<not_specific>
ssl_certificate
<not_specific>
private_key
<not_specific>
pass_phrase
<not_specific>