Table of Contents
TrimbleCloud.DataOcean3.DataOcean3Client
DataOcean3Client
class DataOcean3Client()The client interface for interacting with the DataOcean Service
__init__
def __init__(httpClientProvider, productName=None)Initialize the client.
Arguments:
httpClientProvider: Pre-configured HTTP client provider for communication with the Dataocean endpointproductName: The product name of the consuming application
TrimbleCloud.DataOcean3.DirectoriesAPI
DirectoriesAPI
class DirectoriesAPI()The handler for DirectoriesAPI resource requests.
__init__
def __init__(httpClientProvider)Initialize the DirectoriesAPI handler.
Arguments:
httpClientProvider: The provider used to dispatch HTTP requests
Copy
async def Copy(id, value)Copy the directory by id
Arguments:
id: The ID of the directory to be copiedvalue: Specify the fields of the new target directory
Returns:
copy directory job response object
CopyByPath
async def CopyByPath(path, value)Copy the directory by path
Arguments:
path: The Path of the directory to be copiedvalue: Specify the fields of the new target directory
Returns:
copy directory job response object
GetDirectoriesList
def GetDirectoriesList(id)Retrieve an directories list by id
Arguments:
id: The ID of the directory
Returns:
The directories list response object
GetDirectoriesListByPath
def GetDirectoriesListByPath(path=':')Retrieve an directories list by path
Arguments:
path: The path of the directory
Returns:
The directories list response object
GetFilesList
def GetFilesList(id)Retrieve an files list by directory id
Arguments:
id: The ID of the directory
Returns:
The files list response object
GetFilesListByPath
def GetFilesListByPath(path=':')Retrieve an files list by directory path
Arguments:
path: The path of the directory
Returns:
The files list response object
Create
async def Create(value)Create a new directory
Arguments:
value: The input value of directory request
Returns:
Created directory response object
Read
async def Read(id, version=None)Fetch a directory by id
Arguments:
id: The ID of the directoryversion: The version of the directory (optional)
Returns:
The directory response object
ReadByPath
async def ReadByPath(path, version=None)Fetch a directory by path
Arguments:
path: The path of the directoryversion: The version of the directory (optional)
Returns:
The directory response object
Update
async def Update(id, value)Update the directory by id
Arguments:
id: The ID of the directoryvalue: Specify the fields that require updation
Returns:
Updated directory response object
UpdateByPath
async def UpdateByPath(path, value)Update the directory by path
Arguments:
path: The Path of the directoryvalue: Specify the fields that require updation
Returns:
Updated directory response object
Delete
async def Delete(id)Delete a directory by id
Arguments:
id: The ID of the directory
DeleteByPath
async def DeleteByPath(path, recursive=False)Delete a directory by path
Arguments:
path: The path of the directory
TrimbleCloud.DataOcean3.FilesAPI
FilesAPI
class FilesAPI()The handler for FilesAPI resource requests.
__init__
def __init__(httpClientProvider)Initialize the FilesAPI handler.
Arguments:
httpClientProvider: The provider used to dispatch HTTP requests
Create
async def Create(value)Create a file or new version
Arguments:
value: The file request object
Returns:
Created file response object
GetVersionsList
def GetVersionsList(id)Get version list of the file
Arguments:
id: The ID of the file
Returns:
File response object
GetVersionsListByPath
def GetVersionsListByPath(path)Get version list of the file by path
Arguments:
path: The Path of the file
Returns:
File response object
Read
async def Read(id, version=None, **kwargs)Get a file
Arguments:
id: The ID of the fileversion: The version of the file (optional)**kwargs: The Keyword arguments (optional)
Returns:
File response object
ReadByPath
async def ReadByPath(path, version=None, **kwargs)Get a file
Arguments:
path: The path of the fileversion: The version of the file (optional)**kwargs: The Keyword arguments (optional)
Returns:
File response object
GetFilesetManifest
def GetFilesetManifest(id, version=None)Get the manifest, i.e. a list of files, in a fileset.
GetFilesetManifestByPath
def GetFilesetManifestByPath(path, version=None)Get the manifest, i.e. a list of files, in a fileset.
Update
async def Update(id, value)Update a file
Arguments:
id: The ID of the filevalue: Update file request object
Returns:
Updated File response object
UpdateByPath
async def UpdateByPath(path, value)Update a file
Arguments:
path: The path of the filevalue: Update file request object
Returns:
Updated File response object
Delete
async def Delete(id)Delete a file
Arguments:
id: The ID of the file
DeleteByPath
async def DeleteByPath(path)Delete a file
Arguments:
path: The Path of the file
Upload
async def Upload(id, stream, **kwargs)Upload a file
Arguments:
id: The ID of the filestream: Stream of the contents to upload
Returns:
None
UploadByPath
async def UploadByPath(path, stream, **kwargs)Upload the contents of a stream to a file path in Data Ocean @param path: Data Ocean path to upload the file to @param stream: Stream of the contents to upload @kwparam concurrent_limit: The maximum number of chunks to upload concurrently @return: None
UploadObject
async def UploadObject(file_object, stream, **kwargs)Upload the contents of a file stream to the Data Ocean file specified by a file object @param file_object: A Data Ocean file object. This most common source of a file object is the response from CreateFile. @param stream: Stream of the contents to upload @kwparam concurrent_limit: The maximum number of chunks to upload concurrently @return: None
Download
async def Download(id, stream, version=None, region=None, **kwargs)Download the contents of a file to a file stream. @param id: The Data Ocean identifier of the file to download @param stream: Stream to download the content to @param version: version of the file to download @param region: Data Ocean region to download the file from @kwparam concurrent_limit: The maximum number of chunks to download concurrently @kwparam subpath: path and filename from the fileset root of the individual subfile to download @kwparam subsize: size of the fileset, retrieved via HTTP HEAD if not set @return: None
DownloadByPath
async def DownloadByPath(path, stream, version=None, region=None, **kwargs)Download the contents of a file to a file stream. @param path: The path to the Data Ocean file to download @param stream: Stream to download the content to @param version: version of the file to download @param region: Data Ocean region to download the file from @kwparam concurrent_limit: The maximum number of chunks to download concurrently @kwparam subpath: path and filename from the fileset root of the individual subfile to download @kwparam subsize: size of the fileset, retrieved via HTTP HEAD if not set @return: None
Copy
async def Copy(id, value, version=None)Copies a file. Requires a value for path, optionally takes values for restricted_access, regions, expires_at and metadata.
CopyByPath
async def CopyByPath(path, value, version=None)Copies a file. Requires a value for path, optionally takes values for restricted_access, regions, expires_at and metadata.
RequestScan
async def RequestScan(id, version=None)Requests that the file be scanned for malware.
RequestScanByPath
async def RequestScanByPath(path, version=None)Requests that the file be scanned for malware.
limited_as_completed
@staticmethoddef limited_as_completed(coros, limit, maintain_order=False)Run the coroutines (or futures) supplied in the iterable coros, ensuring that there are at most limit coroutines running concurrently.
https://www.artificialworlds.net/blog/2017/05/31/python-3-large-numbers-of-tasks-with-limited-concurrency/ @param coros: An iterable of coroutines to schedule for execution. @param limit: The maximum number of coroutines to run concurrently @param maintain_order: Whether to maintain the order of the coroutines returned from the generator @return: Return an generator of Future instances. The futures can be awaited to obtain the results of the coroutines. If maintain_order is False the results may be provided in any order, as they become available.