Class: Jelastic::Environment
- Inherits:
-
Object
- Object
- Jelastic::Environment
- Defined in:
- lib/jelastic/environment.rb
Instance Attribute Summary collapse
-
#action_key ⇒ Object
Returns the value of attribute action_key.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#engine ⇒ Object
Returns the value of attribute engine.
-
#high_availability ⇒ Object
Returns the value of attribute high_availability.
-
#nodes ⇒ Object
Returns the value of attribute nodes.
-
#region ⇒ Object
Returns the value of attribute region.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#short_domain ⇒ Object
Returns the value of attribute short_domain.
-
#ssl ⇒ Object
Returns the value of attribute ssl.
Class Method Summary collapse
Instance Method Summary collapse
- #add_docker_node {|node| ... } ⇒ Object
- #add_node {|node| ... } ⇒ Object
- #high_availability? ⇒ Boolean
- #ssl? ⇒ Boolean
- #with_high_availability ⇒ Object
- #with_ssl ⇒ Object
Instance Attribute Details
#action_key ⇒ Object
Returns the value of attribute action_key.
7 8 9 |
# File 'lib/jelastic/environment.rb', line 7 def action_key @action_key end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
9 10 11 |
# File 'lib/jelastic/environment.rb', line 9 def client @client end |
#display_name ⇒ Object
Returns the value of attribute display_name.
7 8 9 |
# File 'lib/jelastic/environment.rb', line 7 def display_name @display_name end |
#engine ⇒ Object
Returns the value of attribute engine.
7 8 9 |
# File 'lib/jelastic/environment.rb', line 7 def engine @engine end |
#high_availability ⇒ Object
Returns the value of attribute high_availability.
7 8 9 |
# File 'lib/jelastic/environment.rb', line 7 def high_availability @high_availability end |
#nodes ⇒ Object
Returns the value of attribute nodes.
7 8 9 |
# File 'lib/jelastic/environment.rb', line 7 def nodes @nodes end |
#region ⇒ Object
Returns the value of attribute region.
7 8 9 |
# File 'lib/jelastic/environment.rb', line 7 def region @region end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
9 10 11 |
# File 'lib/jelastic/environment.rb', line 9 def response @response end |
#short_domain ⇒ Object
Returns the value of attribute short_domain.
7 8 9 |
# File 'lib/jelastic/environment.rb', line 7 def short_domain @short_domain end |
#ssl ⇒ Object
Returns the value of attribute ssl.
7 8 9 |
# File 'lib/jelastic/environment.rb', line 7 def ssl @ssl end |
Class Method Details
.create(client, **params) {|environment| ... } ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/jelastic/environment.rb', line 15 def self.create(client, **params) environment = allocate environment.nodes = [] yield(environment) environment.action_key ||= SecureRandom.hex serialized_env = Serializers::Environment.new(environment).serialize response = client.create_environment(serialized_env) environment.instance_variable_set('@response', response) environment end |
Instance Method Details
#add_docker_node {|node| ... } ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/jelastic/environment.rb', line 40 def add_docker_node node = DockerNode.new nodes << node yield(node) nil end |
#add_node {|node| ... } ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/jelastic/environment.rb', line 31 def add_node node = Node.new nodes << node yield(node) nil end |
#high_availability? ⇒ Boolean
53 54 55 |
# File 'lib/jelastic/environment.rb', line 53 def high_availability? high_availability end |
#ssl? ⇒ Boolean
61 62 63 |
# File 'lib/jelastic/environment.rb', line 61 def ssl? ssl end |
#with_high_availability ⇒ Object
49 50 51 |
# File 'lib/jelastic/environment.rb', line 49 def with_high_availability @high_availability = true end |
#with_ssl ⇒ Object
57 58 59 |
# File 'lib/jelastic/environment.rb', line 57 def with_ssl @ssl = true end |