Class: Apcera::Resource
- Inherits:
-
BaseObject
- Object
- BaseObject
- Apcera::Resource
- Defined in:
- lib/apcera/models/resource.rb
Instance Attribute Summary collapse
-
#cpu ⇒ Object
Returns the value of attribute cpu.
-
#disk ⇒ Object
Returns the value of attribute disk.
-
#memory ⇒ Object
Returns the value of attribute memory.
-
#netmax ⇒ Object
Returns the value of attribute netmax.
-
#network ⇒ Object
Returns the value of attribute network.
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 = {}) ⇒ Resource
constructor
A new instance of Resource.
Methods inherited from BaseObject
#_deserialize, #_to_hash, #build_from_hash, #to_body, #to_hash, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ Resource
Returns a new instance of Resource.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/apcera/models/resource.rb', line 39 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[:'cpu'] self.cpu = attributes[:'cpu'] end if attributes[:'disk'] self.disk = attributes[:'disk'] end if attributes[:'memory'] self.memory = attributes[:'memory'] end if attributes[:'netmax'] self.netmax = attributes[:'netmax'] end if attributes[:'network'] self.network = attributes[:'network'] end end |
Instance Attribute Details
#cpu ⇒ Object
Returns the value of attribute cpu.
4 5 6 |
# File 'lib/apcera/models/resource.rb', line 4 def cpu @cpu end |
#disk ⇒ Object
Returns the value of attribute disk.
4 5 6 |
# File 'lib/apcera/models/resource.rb', line 4 def disk @disk end |
#memory ⇒ Object
Returns the value of attribute memory.
4 5 6 |
# File 'lib/apcera/models/resource.rb', line 4 def memory @memory end |
#netmax ⇒ Object
Returns the value of attribute netmax.
4 5 6 |
# File 'lib/apcera/models/resource.rb', line 4 def netmax @netmax end |
#network ⇒ Object
Returns the value of attribute network.
4 5 6 |
# File 'lib/apcera/models/resource.rb', line 4 def network @network 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 20 21 22 23 24 25 |
# File 'lib/apcera/models/resource.rb', line 6 def self.attribute_map { # Milliseconds of CPU time per second of physical time allocated to the job. May be greater than 1000ms/second in cases where time is across multiple cores. :'cpu' => :'cpu', # Amount of disk space allocated to the job, in MB. :'disk' => :'disk', # Memory allocated to job, in MB. :'memory' => :'memory', # Maximum amount of network throughput (ceiling) allowed, in Mbps. :'netmax' => :'netmax', # Amount of network throughput (floor) allocated to the job, in Mbps. :'network' => :'network' } end |
.swagger_types ⇒ Object
attribute type
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/apcera/models/resource.rb', line 28 def self.swagger_types { :'cpu' => :'Integer', :'disk' => :'Integer', :'memory' => :'Integer', :'netmax' => :'Integer', :'network' => :'Integer' } end |