class Vultr::SnapshotsResource

Public Instance Methods

create(**attributes) click to toggle source
# File lib/vultr/resources/snapshots.rb, line 8
def create(**attributes)
  Snapshot.new post_request("snapshots", body: attributes).body.dig("snapshot")
end
create_from_url(url) click to toggle source
# File lib/vultr/resources/snapshots.rb, line 16
def create_from_url(url)
  Snapshot.new post_request("snapshots/create-from-url", body: {url: url}).body.dig("snapshot")
end
delete(snapshot_id:) click to toggle source
# File lib/vultr/resources/snapshots.rb, line 24
def delete(snapshot_id:)
  delete_request("snapshots/#{snapshot_id}")
end
list(**params) click to toggle source
# File lib/vultr/resources/snapshots.rb, line 3
def list(**params)
  response = get_request("snapshots", params: params)
  Collection.from_response(response, key: "snapshots", type: Snapshot)
end
retrieve(snapshot_id:) click to toggle source
# File lib/vultr/resources/snapshots.rb, line 12
def retrieve(snapshot_id:)
  Snapshot.new get_request("snapshots/#{snapshot_id}").body.dig("snapshot")
end
update(snapshot_id:, **attributes) click to toggle source
# File lib/vultr/resources/snapshots.rb, line 20
def update(snapshot_id:, **attributes)
  put_request("snapshots/#{snapshot_id}", body: attributes)
end