Home | Trees | Indices | Help |
---|
|
builtins.object --+ | CollectionBase --+ | RichCollectionBase --+ | Collection
Represents the root of an Arvados Collection. This class is threadsafe. The root collection object, all subcollections and files are protected by a single lock (i.e. each access locks the entire collection). Brief summary of useful methods: :To read an existing file: `c.open("myfile", "r")` :To write a new file: `c.open("myfile", "w")` :To determine if a file exists: `c.find("myfile") is not None` :To copy a file: `c.copy("source", "dest")` :To delete a file: `c.remove("myfile")` :To save to an existing collection record: `c.save()` :To save a new collection record: `c.save_new()` :To merge remote changes into this object: `c.update()` Must be associated with an API server Collection record (during initialization, or using `save_new`) to use `save` or `update`
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
_token_re = re.compile(r'(\S+)(\s+|$)')
|
|||
_block_re = re.compile(r'[0-9a-f]{32}\+(\d+)(\+\S+)*')
|
|||
_segment_re = re.compile(r'(\d+):(\d+):(\S+)')
|
|
Collection constructor. :manifest_locator_or_text: An Arvados collection UUID, portable data hash, raw manifest text, or (if creating an empty collection) None. :parent: the parent Collection, may be None. :apiconfig: A dict containing keys for ARVADOS_API_HOST and ARVADOS_API_TOKEN. Prefer this over supplying your own api_client and keep_client (except in testing). Will use default config settings if not specified. :api_client: The API client object to use for requests. If not specified, create one using `apiconfig`. :keep_client: the Keep client to use for requests. If not specified, create one using `apiconfig`. :num_retries: the number of retries for API and Keep requests. :block_manager: the block manager to use. If not specified, create one. :replication_desired: How many copies should Arvados maintain. If None, API server default configuration applies. If not None, this value will also be used for determining the number of block copies being written.
|
|
|
|
|
Merge the latest collection on the API server with the current collection.
|
|
|
|
|
Support scoped auto-commit in a with: block.
|
Get the manifest locator, if any. The manifest locator will be set when the collection is loaded from an API server record or the portable data hash of a manifest. The manifest locator will be None if the collection is newly created or was created directly from manifest text. The method `save_new()` will assign a manifest locator.
|
|
Returns information about this Collection fetched from the API server. If the Collection exists in Keep but not the API server, currently returns None. Future versions may provide a synthetic response.
|
See `RichCollectionBase.find_or_create`
|
See `RichCollectionBase.find`
|
See `RichCollectionBase.remove`
|
Save collection to an existing collection record. Commit pending buffer blocks to Keep, merge with remote record (if merge=True, the default), and update the collection record. Returns the current manifest text. Will raise AssertionError if not associated with a collection record on the API server. If you want to save a manifest to Keep only, see `save_new()`. :properties: Additional properties of collection. This value will replace any existing properties of collection. :storage_classes: Specify desirable storage classes to be used when writing data to Keep. :trash_at: A collection is *expiring* when it has a *trash_at* time in the future. An expiring collection can be accessed as normal, but is scheduled to be trashed automatically at the *trash_at* time. :merge: Update and merge remote changes before saving. Otherwise, any remote changes will be ignored and overwritten. :num_retries: Retry count on API calls (if None, use the collection default)
|
Save collection to a new collection record. Commit pending buffer blocks to Keep and, when create_collection_record is True (default), create a new collection record. After creating a new collection record, this Collection object will be associated with the new record used by `save()`. Returns the current manifest text. :name: The collection name. :create_collection_record: If True, create a collection record on the API server. If False, only commit blocks to Keep and return the manifest text. :owner_uuid: the user, or project uuid that will own this collection. If None, defaults to the current user. :properties: Additional properties of collection. This value will replace any existing properties of collection. :storage_classes: Specify desirable storage classes to be used when writing data to Keep. :trash_at: A collection is *expiring* when it has a *trash_at* time in the future. An expiring collection can be accessed as normal, but is scheduled to be trashed automatically at the *trash_at* time. :ensure_unique_name: If True, ask the API server to rename the collection if it conflicts with a collection with the same name and owner. If False, a name conflict will result in an error. :num_retries: Retry count on API calls (if None, use the collection default)
|
Import a manifest into a `Collection`. :manifest_text: The manifest text to import from.
|
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Dec 28 19:40:39 2023 | http://epydoc.sourceforge.net |