Class: CpOraclecloud::SoaComponent

Inherits:
CloudComponent
  • Object
show all
Includes:
SoaMixin
Defined in:
app/models/cp_oraclecloud/soa_component.rb

Instance Method Summary collapse

Methods included from SoaMixin

#calculate_monthly_cost

Instance Method Details

#admin_password_complexityObject



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'app/models/cp_oraclecloud/soa_component.rb', line 33

def admin_password_complexity
  if admin_password.size < 8 or admin_password.size > 30
    errors.add :admin_password, "Must be at betweeen 8 and 30 characters long."
  end
  if !(admin_password[0] =~ /[[:alpha:]]/)
    errors.add :admin_password, "First character must be a letter"
  end
  if (admin_password =~ /[a-z]/).blank? then errors.add :admin_password, 'Must contain a lower case letter' end
  if (admin_password =~ /[A-Z]/).blank? then errors.add :admin_password, 'Must contain an upper case letter' end
  if (admin_password =~ /[0-9]/).blank? then errors.add :admin_password, 'Must contain atleast one number' end
  if (admin_password =~ /[-_#$]/).blank? then errors.add :admin_password, 'Must contain a special character (-, _, #, $)' end

end

#initObject



22
23
24
25
26
27
# File 'app/models/cp_oraclecloud/soa_component.rb', line 22

def init
  self.provision_otd ||= false
  self.level ||= 'PAAS'
  self.subscription_type ||= 'MONTHLY'
  self.num_nodes ||= 1
end

#instance_nameObject



51
52
53
# File 'app/models/cp_oraclecloud/soa_component.rb', line 51

def instance_name
  "service_name"
end

#instance_typeObject



55
56
57
# File 'app/models/cp_oraclecloud/soa_component.rb', line 55

def instance_type
  "CpOraclecloud::SoaInstance"
end

#pretty_typeObject



47
48
49
# File 'app/models/cp_oraclecloud/soa_component.rb', line 47

def pretty_type
  'Oracle SOA Cloud Service'
end

#server_count_correctObject



29
30
31
# File 'app/models/cp_oraclecloud/soa_component.rb', line 29

def server_count_correct
  if ![1,2,4].include?(num_nodes.to_i) then errors.add :num_nodes, "Invalid server count" end
end