Class: Fog::Compute::Aliyun::Server
- Inherits:
-
Server
- Object
- Server
- Fog::Compute::Aliyun::Server
- Defined in:
- lib/fog/aliyun/models/compute/server.rb
Instance Attribute Summary collapse
-
#personality ⇒ Hash
Hash containing data to inject into the file system of the cloud server instance during server creation.
Instance Method Summary collapse
Instance Attribute Details
#personality ⇒ Hash
Note:
This attribute is only used for server creation. This field will be nil on subsequent retrievals.
Returns Hash containing data to inject into the file system of the cloud server instance during server creation.
|
# File 'lib/fog/aliyun/models/compute/server.rb', line 72
|
Instance Method Details
#image ⇒ Object
41 42 43 44 |
# File 'lib/fog/aliyun/models/compute/server.rb', line 41 def image requires :image_id Fog::Compute::Aliyun::Image.new(service: service).all(imageId: image_id)[0] end |
#save(options = {}) ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'lib/fog/aliyun/models/compute/server.rb', line 51 def save( = {}) requires :image_id, :security_group_ids, :type [:VSwitchId] = vswitch_id if vswitch_id [:KeyPairName] = key_pair_name if key_pair_name [:UserData] = user_data if user_data [:InstanceName] = name if name data = Fog::JSON.decode(service.create_server(image_id, security_group_ids, type, ).body) merge_attributes(data) end |