Sha256: f9cfb94f8a0bbf3c6e229fef0ace9e8a3991cfa8fcfa3735b4122042f2c12827

Contents?: true

Size: 643 Bytes

Versions: 2

Compression:

Stored size: 643 Bytes

Contents

module Vultr
  class IsoResource < Resource
    def list(**params)
      response = get_request("iso", params: params)
      Collection.from_response(response, key: "isos", type: Iso)
    end

    def create(**attributes)
      Iso.new post_request("iso", body: attributes).body.dig("iso")
    end

    def retrieve(iso_id:)
      Iso.new get_request("iso/#{iso_id}").body.dig("iso")
    end

    def delete(iso_id:)
      delete_request("iso/#{iso_id}")
    end

    def list_public(**params)
      response = get_request("iso-public", params: params)
      Collection.from_response(response, key: "public_isos", type: Iso)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vultr-2.0.0 lib/vultr/resources/iso.rb
vultr-1.0.0 lib/vultr/resources/iso.rb