Class: Openlayer::Resources::Storage::PresignedURL
- Inherits:
-
Object
- Object
- Openlayer::Resources::Storage::PresignedURL
- Defined in:
- lib/openlayer/resources/storage/presigned_url.rb,
sig/openlayer/resources/storage/presigned_url.rbs
Instance Method Summary collapse
-
#create(object_name:, request_options: {}) ⇒ Openlayer::Models::Storage::PresignedURLCreateResponse
Retrieve a presigned url to post storage artifacts.
-
#initialize(client:) ⇒ PresignedURL
constructor
private
A new instance of PresignedURL.
-
#retrieve(storage_uri:, request_options: {}) ⇒ Openlayer::Models::Storage::PresignedURLRetrieveResponse
Exchange a
storageUrifor a short-lived presigned url you can download the object from.
Constructor Details
#initialize(client:) ⇒ PresignedURL
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of PresignedURL.
65 66 67 |
# File 'lib/openlayer/resources/storage/presigned_url.rb', line 65 def initialize(client:) @client = client end |
Instance Method Details
#create(object_name:, request_options: {}) ⇒ Openlayer::Models::Storage::PresignedURLCreateResponse
Retrieve a presigned url to post storage artifacts.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/openlayer/resources/storage/presigned_url.rb', line 18 def create(params) parsed, = Openlayer::Storage::PresignedURLCreateParams.dump_request(params) query = Openlayer::Internal::Util.encode_query_params(parsed) @client.request( method: :post, path: "storage/presigned-url", query: query.transform_keys(object_name: "objectName"), model: Openlayer::Models::Storage::PresignedURLCreateResponse, options: ) end |
#retrieve(storage_uri:, request_options: {}) ⇒ Openlayer::Models::Storage::PresignedURLRetrieveResponse
Exchange a storageUri for a short-lived presigned url you can download the
object from.
Use it to collect anything the platform stored on your behalf -- for example the
archive a framework export leaves behind, whose storageUri comes back in the
background task's outputs.
The workspace is taken from the API key, so there is nothing else to send. The
url is only issued for objects your workspace owns, and 404 covers both "no
such object" and "not yours".
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/openlayer/resources/storage/presigned_url.rb', line 50 def retrieve(params) parsed, = Openlayer::Storage::PresignedURLRetrieveParams.dump_request(params) query = Openlayer::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "storage/presigned-url", query: query.transform_keys(storage_uri: "storageUri"), model: Openlayer::Models::Storage::PresignedURLRetrieveResponse, options: ) end |