Class: Apcera::Route
- Inherits:
-
BaseObject
- Object
- BaseObject
- Apcera::Route
- Defined in:
- lib/apcera/models/route.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#type ⇒ Object
Returns the value of attribute type.
-
#weight ⇒ Object
Returns the value of attribute weight.
Class Method Summary collapse
-
.attribute_map ⇒ Object
attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
attribute type.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Route
constructor
A new instance of Route.
Methods inherited from BaseObject
#_deserialize, #_to_hash, #build_from_hash, #to_body, #to_hash, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ Route
Returns a new instance of Route.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/apcera/models/route.rb', line 31 def initialize(attributes = {}) return if !attributes.is_a?(Hash) || attributes.empty? # convert string to symbol for hash key attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} if attributes[:'endpoint'] self.endpoint = attributes[:'endpoint'] end if attributes[:'type'] self.type = attributes[:'type'] end if attributes[:'weight'] self.weight = attributes[:'weight'] end end |
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint.
4 5 6 |
# File 'lib/apcera/models/route.rb', line 4 def endpoint @endpoint end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/apcera/models/route.rb', line 4 def type @type end |
#weight ⇒ Object
Returns the value of attribute weight.
4 5 6 |
# File 'lib/apcera/models/route.rb', line 4 def weight @weight end |
Class Method Details
.attribute_map ⇒ Object
attribute mapping from ruby-style variable name to JSON key
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/apcera/models/route.rb', line 6 def self.attribute_map { # The URI where the traffic should being routed to. For HTTP routes, the value should contain the route's host and path; for TCP routes, the value should take the form of \"ip:port\". :'endpoint' => :'endpoint', # The type of route. Valid values are `http` or `tcp`. :'type' => :'type', # A value between 0 and 1 that specifies the route's weight, which is used to balance incoming traffic across apps that share the route. Weights are not on a specific scale; weights of all routes for a given job are normalized. :'weight' => :'weight' } end |
.swagger_types ⇒ Object
attribute type
22 23 24 25 26 27 28 29 |
# File 'lib/apcera/models/route.rb', line 22 def self.swagger_types { :'endpoint' => :'String', :'type' => :'String', :'weight' => :'Float' } end |