Sha256: 5762b6c9f3d804e95a397a6dbd6e951c573e1a659a5a4ee03078568a3263c9c0

Contents?: true

Size: 1.49 KB

Versions: 2

Compression:

Stored size: 1.49 KB

Contents

# frozen_string_literal: true

module Lunanode
  module APIActions
    module Volume
      def volume_list(region:)
        action(:volume, :list, region: region)
      end

      def volume_create(region:, label:, size:, image: nil, snapshot_id: nil)
        action(:volume, :create, region: region, label: label, size: size, image: image, snapshot_id: snapshot_id)
      end

      def volume_delete(region:, volume_id:)
        action(:volume, :delete, region: region, volume_id: volume_id)
      end

      def volume_attach(region:, volume_id:, vm_id:, target:)
        action(:volume, :attach, region: region, volume_id: volume_id, vm_id: vm_id, target: target)
      end

      def volume_detach(region:, volume_id:)
        action(:volume, :detach, region: region, volume_id: volume_id)
      end

      def volume_info(region:, volume_id:)
        action(:volume, :info, region: region, volume_id: volume_id)
      end

      def volume_extend(region:, volume_id:, size:)
        action(:volume, :extend, region: region, volume_id: volume_id, size: size)
      end

      def volume_snapshot_create(region:, volume_id:, label:)
        action(:volume, :"snapshot-create", region: region, volume_id: volume_id, label: label)
      end

      def volume_snapshot_delete(region:, snapshot_id:)
        action(:volume, :"snapshot-delete", region: region, snapshot_id: snapshot_id)
      end

      def volume_snapshot_list(region:)
        action(:volume, :"snapshot-list", region: region)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lunanode-0.2.0 lib/lunanode/api_actions/default/volume.rb
lunanode-0.1.6 lib/lunanode/api_actions/default/volume.rb