Sha256: 6a6dc2b0be17f71ff3e7e858ede5d2296e75df9e6f0548506239111891521f3b
Contents?: true
Size: 1.61 KB
Versions: 9
Compression:
Stored size: 1.61 KB
Contents
require 'fog/core/model' module Fog module Compute class OracleCloud class Instance < Fog::Model identity :name attribute :account attribute :boot_order attribute :disk_attach attribute :domain attribute :entry attribute :error_reason attribute :fingerprint attribute :hostname attribute :hypervisor attribute :image_format attribute :imagelist attribute :ip attribute :label attribute :networking attribute :placement_requirements attribute :platform attribute :priority attribute :quota attribute :quota_reservation attribute :resolvers attribute :reverse_dns attribute :shape attribute :site attribute :sshkeys attribute :start_time attribute :state attribute :storage_attachments attribute :tags attribute :uri attribute :vcable_id attribute :virtio attribute :vnc def ready? state == 'running' end def clean_name name.sub %r{\/.*\/}, '' end def save #identity ? update : create create end def create requires :name, :shape, :imagelist, :label, :sshkeys data = service.create_instance(name, shape, imagelist, label, sshkeys) merge_attributes(data.body['instances'][0]) end def destroy requires :name service.delete_instance(name) end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems