class Fog::Compute::Aliyun::Server

Public Instance Methods

image() click to toggle source
# 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 = {}) click to toggle source
# File lib/fog/aliyun/models/compute/server.rb, line 51
def save(options = {})
  requires :image_id, :security_group_ids, :type
  options[:VSwitchId] = vswitch_id if vswitch_id
  options[:KeyPairName] = key_pair_name if key_pair_name
  options[:UserData] = user_data if user_data
  options[:InstanceName] = name if name
  data = Fog::JSON.decode(service.create_server(image_id, security_group_ids, type, options).body)
  merge_attributes(data)
end
vpc() click to toggle source
# File lib/fog/aliyun/models/compute/server.rb, line 46
def vpc
  requires :vpc_id
  $vpc = Fog::Compute::Aliyun::Vpcs.new(service: service).all('vpcId' => vpc_id)[0]
end