Class: Rafflesia::Objects

Inherits:
Object
  • Object
show all
Defined in:
lib/rafflesia/objects.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Objects

Returns a new instance of Objects.



9
10
11
# File 'lib/rafflesia/objects.rb', line 9

def initialize(client)
  @client = client
end

Instance Method Details

#artifactsImport(kind:, allow_incomplete: nil, archive_inventory_object_id: nil, archive_inventory_path: nil, archive_required_member_paths: nil, dataset_name: nil, dataset_version: nil, dependency_manifest_ids: nil, is_collection: nil, layout_prefix: nil, license: nil, marker_paths: nil, mount_path: nil, name: nil, output_dir: nil, path: nil, shard_size_bytes: nil, source_uri: nil, tool_name: nil, tool_version: nil, version: nil, request_options: {}) ⇒ Rafflesia::EnvelopeObjectArtifactImportData

POST /v1/objects/artifacts/import

Parameters:

  • allow_incomplete (Boolean, nil) (defaults to: nil)

    Allow import even when required material file sets are incomplete.

  • archive_inventory_object_id (String, nil) (defaults to: nil)

    Object id containing an archive inventory manifest whose extracted member objects become a collection. Mutually exclusive with path and archive_inventory_path.

  • archive_inventory_path (String, nil) (defaults to: nil)

    Archive inventory manifest whose extracted member objects become a collection without a local copy. Mutually exclusive with path and archive_inventory_object_id.

  • archive_required_member_paths (Array<String>, nil) (defaults to: nil)

    Archive member paths that must have extracted, hash-verified objects before marker files are created.

  • dataset_name (String, nil) (defaults to: nil)

    Optional dataset name carried into the manifest.

  • dataset_version (String, nil) (defaults to: nil)

    Optional dataset version carried into the manifest.

  • dependency_manifest_ids (Array<String>, nil) (defaults to: nil)

    Immutable manifest ids required by this collection.

  • is_collection (Boolean, nil) (defaults to: nil)

    Force directory input to use a shard-aware collection manifest even when it has no nested directories.

  • kind (String)

    Immutable material kind: blast_db, blast_index, foldseek_index, mmseqs2_index, hmmer_index, model_weights, model_parameters, sequence_database, structure_database, annotation_database, or task_input.

  • layout_prefix (String, nil) (defaults to: nil)

    Optional portable path prefix prepended to archive member paths in the collection.

  • license (String, nil) (defaults to: nil)

    License identifier or source license label for this collection.

  • marker_paths (Array<String>, nil) (defaults to: nil)

    Optional portable marker-file paths created after every archive member object is validated.

  • mount_path (String, nil) (defaults to: nil)

    Expected absolute sandbox mount path for this collection.

  • name (String, nil) (defaults to: nil)

    Optional manifest name.

  • output_dir (String, nil) (defaults to: nil)

    Optional local directory where the stamped manifest JSON should be written.

  • path (String, nil) (defaults to: nil)

    Local material file, directory tree, or supported database/index prefix path. Mutually exclusive with archive_inventory_path and archive_inventory_object_id.

  • shard_size_bytes (Integer, nil) (defaults to: nil)

    Target collection shard size in bytes. Files are never split; zero defaults to 4 GiB.

  • source_uri (String, nil) (defaults to: nil)

    Source distribution URI recorded as provenance; no implicit download is performed.

  • tool_name (String, nil) (defaults to: nil)

    Optional external tool name. Defaults from kind.

  • tool_version (String, nil) (defaults to: nil)

    Optional external tool version string.

  • version (String, nil) (defaults to: nil)

    Optional manifest version.

  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/rafflesia/objects.rb', line 37

def artifactsImport(
  kind:,
  allow_incomplete: nil,
  archive_inventory_object_id: nil,
  archive_inventory_path: nil,
  archive_required_member_paths: nil,
  dataset_name: nil,
  dataset_version: nil,
  dependency_manifest_ids: nil,
  is_collection: nil,
  layout_prefix: nil,
  license: nil,
  marker_paths: nil,
  mount_path: nil,
  name: nil,
  output_dir: nil,
  path: nil,
  shard_size_bytes: nil,
  source_uri: nil,
  tool_name: nil,
  tool_version: nil,
  version: nil,
  request_options: {}
)
  body = {
    'allow_incomplete' => allow_incomplete,
    'archive_inventory_object_id' => archive_inventory_object_id,
    'archive_inventory_path' => archive_inventory_path,
    'archive_required_member_paths' => archive_required_member_paths,
    'dataset_name' => dataset_name,
    'dataset_version' => dataset_version,
    'dependency_manifest_ids' => dependency_manifest_ids,
    'is_collection' => is_collection,
    'kind' => kind,
    'layout_prefix' => layout_prefix,
    'license' => license,
    'marker_paths' => marker_paths,
    'mount_path' => mount_path,
    'name' => name,
    'output_dir' => output_dir,
    'path' => path,
    'shard_size_bytes' => shard_size_bytes,
    'source_uri' => source_uri,
    'tool_name' => tool_name,
    'tool_version' => tool_version,
    'version' => version
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/objects/artifacts/import',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeObjectArtifactImportData.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end

#artifactsMaterialize(manifest_object_id: nil, manifest_path: nil, shards: nil, target_dir: nil, verify: nil, request_options: {}) ⇒ Rafflesia::EnvelopeObjectArtifactMaterializeData

POST /v1/objects/artifacts/materialize

Parameters:

  • manifest_object_id (String, nil) (defaults to: nil)

    Neutral object-artifact manifest object id

  • manifest_path (String, nil) (defaults to: nil)

    Local neutral object-artifact manifest path

  • shards (Array<String>, nil) (defaults to: nil)

    Optional shard ids to materialize; empty materializes every shard

  • target_dir (String, nil) (defaults to: nil)

    Local object-artifact cache root

  • verify (Boolean, nil) (defaults to: nil)

    Verify materialized files by SHA-256

  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/rafflesia/objects.rb', line 104

def artifactsMaterialize(
  manifest_object_id: nil,
  manifest_path: nil,
  shards: nil,
  target_dir: nil,
  verify: nil,
  request_options: {}
)
  body = {
    'manifest_object_id' => manifest_object_id,
    'manifest_path' => manifest_path,
    'shards' => shards,
    'target_dir' => target_dir,
    'verify' => verify
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/objects/artifacts/materialize',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeObjectArtifactMaterializeData.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end

#contentGet(object_id:, filename: nil, request_options: {}) ⇒ String

Return raw content-addressed object bytes.

Parameters:

  • object_id (String)
  • filename (String, nil) (defaults to: nil)
  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:

  • (String)


136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/rafflesia/objects.rb', line 136

def contentGet(
  object_id:,
  filename: nil,
  request_options: {}
)
  params = {
    'object_id' => object_id,
    'filename' => filename
  }.compact
  response = @client.request(
    method: :get,
    path: '/v1/objects/content/get',
    auth: true,
    params: params,
    request_options: request_options
  )
  response.body
end

#download(url:, allow_network: nil, content_type: nil, file_name: nil, kind: nil, max_download_bytes: nil, request_options: {}) ⇒ Rafflesia::EnvelopeObjectDownloadData

POST /v1/objects/download

Parameters:

  • allow_network (Boolean, nil) (defaults to: nil)
  • content_type (String, nil) (defaults to: nil)
  • file_name (String, nil) (defaults to: nil)
  • kind (String, nil) (defaults to: nil)
  • max_download_bytes (Integer, nil) (defaults to: nil)
  • url (String)
  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/rafflesia/objects.rb', line 164

def download(
  url:,
  allow_network: nil,
  content_type: nil,
  file_name: nil,
  kind: nil,
  max_download_bytes: nil,
  request_options: {}
)
  body = {
    'allow_network' => allow_network,
    'content_type' => content_type,
    'file_name' => file_name,
    'kind' => kind,
    'max_download_bytes' => max_download_bytes,
    'url' => url
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/objects/download',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeObjectDownloadData.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end

#gc(candidate_object_ids: nil, delete: nil, dry_run: nil, max_candidates: nil, max_delete: nil, max_scan_object_bytes: nil, older_than_seconds: nil, protect_object_ids: nil, scan_object_contents: nil, scan_records: nil, request_options: {}) ⇒ Rafflesia::EnvelopeObjectGcData

POST /v1/objects/gc

Parameters:

  • candidate_object_ids (Array<String>, nil) (defaults to: nil)

    Optional object ids to evaluate instead of every local CAS object.

  • delete (Boolean, nil) (defaults to: nil)

    Delete eligible unreferenced local CAS files when dry_run is false.

  • dry_run (Boolean, nil) (defaults to: nil)

    When true, compute candidates without deleting. Defaults to true.

  • max_candidates (Integer, nil) (defaults to: nil)

    Maximum candidate rows to return. 0 returns every candidate.

  • max_delete (Integer, nil) (defaults to: nil)

    Maximum candidate files to delete when delete is enabled. 0 deletes every eligible returned candidate.

  • max_scan_object_bytes (Integer, nil) (defaults to: nil)

    Maximum size of live JSON objects to scan transitively for object refs. Defaults to 16777216.

  • older_than_seconds (Integer, nil) (defaults to: nil)

    Only local CAS files with mtime older than this age are eligible. Defaults to 604800 seconds.

  • protect_object_ids (Array<String>, nil) (defaults to: nil)

    Additional object ids to force-retain.

  • scan_object_contents (Boolean, nil) (defaults to: nil)

    Scan reachable JSON objects for transitive object refs. Defaults to true.

  • scan_records (Boolean, nil) (defaults to: nil)

    Scan local record JSON files for live object refs. Defaults to true.

  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/rafflesia/objects.rb', line 206

def gc(
  candidate_object_ids: nil,
  delete: nil,
  dry_run: nil,
  max_candidates: nil,
  max_delete: nil,
  max_scan_object_bytes: nil,
  older_than_seconds: nil,
  protect_object_ids: nil,
  scan_object_contents: nil,
  scan_records: nil,
  request_options: {}
)
  body = {
    'candidate_object_ids' => candidate_object_ids,
    'delete' => delete,
    'dry_run' => dry_run,
    'max_candidates' => max_candidates,
    'max_delete' => max_delete,
    'max_scan_object_bytes' => max_scan_object_bytes,
    'older_than_seconds' => older_than_seconds,
    'protect_object_ids' => protect_object_ids,
    'scan_object_contents' => scan_object_contents,
    'scan_records' => scan_records
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/objects/gc',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeObjectGcData.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end

#get(object_id:, filename: nil, request_options: {}) ⇒ String

Return raw content-addressed object bytes.

Parameters:

  • object_id (String)
  • filename (String, nil) (defaults to: nil)
  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:

  • (String)


248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/rafflesia/objects.rb', line 248

def get(
  object_id:,
  filename: nil,
  request_options: {}
)
  params = {
    'object_id' => object_id,
    'filename' => filename
  }.compact
  response = @client.request(
    method: :get,
    path: '/v1/objects/get',
    auth: true,
    params: params,
    request_options: request_options
  )
  response.body
end

#hash(path:, content_type: nil, kind: nil, request_options: {}) ⇒ Rafflesia::EnvelopeObjectHashData

POST /v1/objects/hash

Parameters:

  • content_type (String, nil) (defaults to: nil)
  • kind (String, nil) (defaults to: nil)
  • path (String)
  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/rafflesia/objects.rb', line 273

def hash(
  path:,
  content_type: nil,
  kind: nil,
  request_options: {}
)
  body = {
    'content_type' => content_type,
    'kind' => kind,
    'path' => path
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/objects/hash',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeObjectHashData.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end

#head(object_id:, encoding: nil, limit: nil, request_options: {}) ⇒ Rafflesia::EnvelopeObjectHeadData

POST /v1/objects/head

Parameters:

  • encoding (Rafflesia::Types::ObjectHeadRequestEncoding, nil) (defaults to: nil)
  • limit (Integer, nil) (defaults to: nil)
  • object_id (String)
  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/rafflesia/objects.rb', line 302

def head(
  object_id:,
  encoding: nil,
  limit: nil,
  request_options: {}
)
  body = {
    'encoding' => encoding,
    'limit' => limit,
    'object_id' => object_id
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/objects/head',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeObjectHeadData.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end

#jsonGet(object_id:, limit: nil, max_bytes: nil, path: nil, request_options: {}) ⇒ Rafflesia::EnvelopeObjectJsonGetData

POST /v1/objects/json/get

Parameters:

  • limit (Integer, nil) (defaults to: nil)
  • max_bytes (Integer, nil) (defaults to: nil)
  • object_id (String)
  • path (String, nil) (defaults to: nil)
  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/rafflesia/objects.rb', line 332

def jsonGet(
  object_id:,
  limit: nil,
  max_bytes: nil,
  path: nil,
  request_options: {}
)
  body = {
    'limit' => limit,
    'max_bytes' => max_bytes,
    'object_id' => object_id,
    'path' => path
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/objects/json/get',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeObjectJsonGetData.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end

#jsonInspect(object_id:, max_bytes: nil, max_children: nil, request_options: {}) ⇒ Rafflesia::EnvelopeObjectJsonInspectData

POST /v1/objects/json/inspect

Parameters:

  • max_bytes (Integer, nil) (defaults to: nil)
  • max_children (Integer, nil) (defaults to: nil)
  • object_id (String)
  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/rafflesia/objects.rb', line 363

def jsonInspect(
  object_id:,
  max_bytes: nil,
  max_children: nil,
  request_options: {}
)
  body = {
    'max_bytes' => max_bytes,
    'max_children' => max_children,
    'object_id' => object_id
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/objects/json/inspect',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeObjectJsonInspectData.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end

#lineage(object_id:, request_options: {}) ⇒ Rafflesia::EnvelopeObjectLineageData

POST /v1/objects/lineage

Parameters:

  • object_id (String)
  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/rafflesia/objects.rb', line 390

def lineage(
  object_id:,
  request_options: {}
)
  body = {
    'object_id' => object_id
  }
  response = @client.request(
    method: :post,
    path: '/v1/objects/lineage',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeObjectLineageData.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end

#metadata(object_id:, request_options: {}) ⇒ Rafflesia::EnvelopeObjectMetadataData

POST /v1/objects/metadata

Parameters:

  • object_id (String)
  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/rafflesia/objects.rb', line 413

def (
  object_id:,
  request_options: {}
)
  body = {
    'object_id' => object_id
  }
  response = @client.request(
    method: :post,
    path: '/v1/objects/metadata',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeObjectMetadataData.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end

#put(path:, content_type: nil, kind: nil, request_options: {}) ⇒ Rafflesia::EnvelopeObjectPutData

POST /v1/objects/put

Parameters:

  • content_type (String, nil) (defaults to: nil)
  • kind (String, nil) (defaults to: nil)
  • path (String)
  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/rafflesia/objects.rb', line 438

def put(
  path:,
  content_type: nil,
  kind: nil,
  request_options: {}
)
  body = {
    'content_type' => content_type,
    'kind' => kind,
    'path' => path
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/objects/put',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeObjectPutData.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end