Sha256: 53e6b1d9b6510180a0c0eca47641927ff251351e58ebbbfc74961735d7decec7
Contents?: true
Size: 1.21 KB
Versions: 22
Compression:
Stored size: 1.21 KB
Contents
require 'fog/openstack/models/model' module Fog module OpenStack class NFV class Vnf < Fog::OpenStack::Model identity :id attribute :status attribute :name attribute :tenant_id attribute :instance_id attribute :mgmt_url attribute :description attribute :vnf_attributes # Attributes for create and update attribute :vnf attribute :auth def create(options = {}) merge_attributes(service.create_vnf(default_options.merge(options)).body['vnf']) self end def update(options = {}) merge_attributes(service.update_vnf(identity, default_options.merge(options)).body['vnf']) self end def save(options = {}) identity ? update(options) : create(options) end def destroy requires :id service.delete_vnf(id) true end def default_options { :vnf => vnf, :auth => auth } end def vnf_attributes attributes['attributes'] end def ready? status == 'ACTIVE' end end end end end
Version data entries
22 entries across 22 versions & 3 rubygems