Sha256: 70c5bf862adb96e982a5607f11cac289e43bcaf86ae1bef554bf5e2ab420c4c7
Contents?: true
Size: 1.21 KB
Versions: 44
Compression:
Stored size: 1.21 KB
Contents
require 'fog/openstack/models/model' module Fog module NFV class OpenStack 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
44 entries across 42 versions & 3 rubygems