Sha256: 27f63940cb82b1ab5f780967f1a2e04303f07a8989ac3bae52fd3a4ab37d513f

Contents?: true

Size: 686 Bytes

Versions: 4

Compression:

Stored size: 686 Bytes

Contents

require 'fog/huaweicloud/models/collection'
require 'fog/shared_file_system/huaweicloud/models/share'

module Fog
  module SharedFileSystem
    class HuaweiCloud
      class Shares < Fog::HuaweiCloud::Collection
        model Fog::SharedFileSystem::HuaweiCloud::Share

        def all(options = {})
          load_response(service.list_shares_detail(options), 'shares')
        end

        def find_by_id(id)
          share_hash = service.get_share(id).body['share']
          new(share_hash.merge(:service => service))
        end

        alias get find_by_id

        def destroy(id)
          share = find_by_id(id)
          share.destroy
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/shared_file_system/huaweicloud/models/shares.rb
fog-huaweicloud-0.0.2 lib/fog/shared_file_system/huaweicloud/models/shares.rb
fog-huaweicloud-0.1.3 lib/fog/shared_file_system/huaweicloud/models/shares.rb
fog-huaweicloud-0.1.2 lib/fog/shared_file_system/huaweicloud/models/shares.rb