DatasetsOperations Class
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
<xref:datasets> attribute.
Constructor
DatasetsOperations(*args, **kwargs)
Methods
| begin_create_generation_job |
Create a data generation job. |
| cancel_generation_job |
Cancel a data generation job. Cancels the specified data generation job if it is still in progress. |
| create_or_update |
Create or update a version. Create a new or update an existing DatasetVersion with the given version id. |
| delete |
Delete a version. Delete the specific version of the DatasetVersion. The service returns 204 No Content if the DatasetVersion was deleted successfully or if the DatasetVersion does not exist. |
| delete_generation_job |
Delete a data generation job. Removes the specified data generation job and its associated output. |
| get |
Get a version. Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the DatasetVersion does not exist. |
| get_credentials |
Get dataset credentials. Retrieves the SAS credential to access the storage account associated with a dataset version. |
| get_generation_job |
Get a data generation job. Retrieves the specified data generation job and its current status. |
| list |
List latest versions. List the latest version of each DatasetVersion. |
| list_generation_jobs |
List data generation jobs. Returns a list of data generation jobs. |
| list_versions |
List versions. List all versions of the given DatasetVersion. |
| pending_upload |
Start a pending upload. Initiates a new pending upload or retrieves an existing one for the specified dataset version. |
| upload_file |
Upload file to a blob storage, and create a dataset that references this file. This method uses the ContainerClient.upload_blob method from the azure-storage-blob package to upload the file. Any keyword arguments provided will be passed to the upload_blob method. |
| upload_folder |
Upload all files in a folder and its sub folders to a blob storage, while maintaining relative paths, and create a dataset that references this folder. This method uses the ContainerClient.upload_blob method from the azure-storage-blob package to upload each file. Any keyword arguments provided will be passed to the upload_blob method. |
begin_create_generation_job
Create a data generation job.
begin_create_generation_job(job: DataGenerationJobInputs | MutableMapping[str, Any] | IO[bytes], *, operation_id: str | None = None, **kwargs: Any) -> DatasetGenerationLROPoller
Parameters
| Name | Description |
|---|---|
|
job
Required
|
The job to create. Required. |
Keyword-Only Parameters
| Name | Description |
|---|---|
|
operation_id
|
Client-generated unique ID for idempotent retries. When absent, the server creates the job unconditionally. Default value is None. Default value: None
|
Returns
| Type | Description |
|---|---|
|
A poller that returns DataGenerationJobResult and exposes the job ID in |
Exceptions
| Type | Description |
|---|---|
cancel_generation_job
Cancel a data generation job.
Cancels the specified data generation job if it is still in progress.
cancel_generation_job(job_id: str, **kwargs: Any) -> DataGenerationJob
Parameters
| Name | Description |
|---|---|
|
job_id
Required
|
The ID of the job to cancel. Required. |
Returns
| Type | Description |
|---|---|
|
DataGenerationJob. The DataGenerationJob is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
create_or_update
Create or update a version.
Create a new or update an existing DatasetVersion with the given version id.
create_or_update(name: str, version: str, dataset_version: DatasetVersion | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) -> DatasetVersion
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the resource. Required. |
|
version
Required
|
The specific version id of the DatasetVersion to create or update. Required. |
|
dataset_version
Required
|
The DatasetVersion to create or update. Is one of the following types: DatasetVersion, JSON, IO[bytes] Required. |
Returns
| Type | Description |
|---|---|
|
DatasetVersion. The DatasetVersion is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
delete
Delete a version.
Delete the specific version of the DatasetVersion. The service returns 204 No Content if the DatasetVersion was deleted successfully or if the DatasetVersion does not exist.
delete(name: str, version: str, **kwargs: Any) -> None
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the resource. Required. |
|
version
Required
|
The version of the DatasetVersion to delete. Required. |
Returns
| Type | Description |
|---|---|
|
None |
Exceptions
| Type | Description |
|---|---|
delete_generation_job
Delete a data generation job.
Removes the specified data generation job and its associated output.
delete_generation_job(job_id: str, **kwargs: Any) -> None
Parameters
| Name | Description |
|---|---|
|
job_id
Required
|
The ID of the job to delete. Required. |
Returns
| Type | Description |
|---|---|
|
None |
Exceptions
| Type | Description |
|---|---|
get
Get a version.
Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the DatasetVersion does not exist.
get(name: str, version: str, **kwargs: Any) -> DatasetVersion
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the resource. Required. |
|
version
Required
|
The specific version id of the DatasetVersion to retrieve. Required. |
Returns
| Type | Description |
|---|---|
|
DatasetVersion. The DatasetVersion is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
get_credentials
Get dataset credentials.
Retrieves the SAS credential to access the storage account associated with a dataset version.
get_credentials(name: str, version: str, **kwargs: Any) -> DatasetCredential
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the resource. Required. |
|
version
Required
|
The specific version id of the DatasetVersion to operate on. Required. |
Returns
| Type | Description |
|---|---|
|
DatasetCredential. The DatasetCredential is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
get_generation_job
Get a data generation job.
Retrieves the specified data generation job and its current status.
get_generation_job(job_id: str, **kwargs: Any) -> DataGenerationJob
Parameters
| Name | Description |
|---|---|
|
job_id
Required
|
The ID of the job. Required. |
Returns
| Type | Description |
|---|---|
|
DataGenerationJob. The DataGenerationJob is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
list
List latest versions.
List the latest version of each DatasetVersion.
list(**kwargs: Any) -> ItemPaged[DatasetVersion]
Returns
| Type | Description |
|---|---|
|
An iterator like instance of DatasetVersion |
Exceptions
| Type | Description |
|---|---|
list_generation_jobs
List data generation jobs.
Returns a list of data generation jobs.
list_generation_jobs(*, limit: int | None = None, order: str | PageOrder | None = None, before: str | None = None, **kwargs: Any) -> ItemPaged[DataGenerationJob]
Keyword-Only Parameters
| Name | Description |
|---|---|
|
limit
|
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Default value is None. Default value: None
|
|
order
|
Sort order by the Default value: None
|
|
before
|
A cursor for use in pagination. Default value: None
|
Returns
| Type | Description |
|---|---|
|
An iterator like instance of DataGenerationJob |
Exceptions
| Type | Description |
|---|---|
list_versions
List versions.
List all versions of the given DatasetVersion.
list_versions(name: str, **kwargs: Any) -> ItemPaged[DatasetVersion]
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the resource. Required. |
Returns
| Type | Description |
|---|---|
|
An iterator like instance of DatasetVersion |
Exceptions
| Type | Description |
|---|---|
pending_upload
Start a pending upload.
Initiates a new pending upload or retrieves an existing one for the specified dataset version.
pending_upload(name: str, version: str, pending_upload_request: PendingUploadRequest | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) -> PendingUploadResponse
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the resource. Required. |
|
version
Required
|
The specific version id of the DatasetVersion to operate on. Required. |
|
pending_upload_request
Required
|
The pending upload request parameters. Is one of the following types: PendingUploadRequest, JSON, IO[bytes] Required. |
Returns
| Type | Description |
|---|---|
|
PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
upload_file
Upload file to a blob storage, and create a dataset that references this file. This method uses the ContainerClient.upload_blob method from the azure-storage-blob package to upload the file. Any keyword arguments provided will be passed to the upload_blob method.
upload_file(*, name: str, version: str, file_path: str, connection_name: str | None = None, **kwargs: Any) -> FileDatasetVersion
Keyword-Only Parameters
| Name | Description |
|---|---|
|
name
|
The name of the dataset. Required. |
|
version
|
The version identifier for the dataset. Required. |
|
file_path
|
The file name (including optional path) to be uploaded. Required. |
|
connection_name
|
The name of an Azure Storage Account connection, where the file should be uploaded. If not specified, the default Azure Storage Account connection will be used. Optional. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The created dataset version. |
Exceptions
| Type | Description |
|---|---|
|
If an error occurs during the HTTP request. |
upload_folder
Upload all files in a folder and its sub folders to a blob storage, while maintaining relative paths, and create a dataset that references this folder. This method uses the ContainerClient.upload_blob method from the azure-storage-blob package to upload each file. Any keyword arguments provided will be passed to the upload_blob method.
upload_folder(*, name: str, version: str, folder: str, connection_name: str | None = None, file_pattern: Pattern | None = None, **kwargs: Any) -> FolderDatasetVersion
Keyword-Only Parameters
| Name | Description |
|---|---|
|
name
|
The name of the dataset. Required. |
|
version
|
The version identifier for the dataset. Required. |
|
folder
|
The folder name (including optional path) to be uploaded. Required. |
|
connection_name
|
The name of an Azure Storage Account connection, where the file should be uploaded. If not specified, the default Azure Storage Account connection will be used. Optional. Default value: None
|
|
file_pattern
|
A regex pattern to filter files to be uploaded. Only files matching the pattern will be uploaded. Optional. Default value: None
|
Returns
| Type | Description |
|---|---|
|
The created dataset version. |
Exceptions
| Type | Description |
|---|---|
|
If an error occurs during the HTTP request. |