Provided Methods
- Run PL with setting variables and version
- Get certain/last job of PL
Method documentation
All the examples expect that there is already a OneDataApi object initialized and assigned to a variable called "onedata_api".
### Creation of the ONE DATA Api ###
oneddata_api = OneDataApi(base_url=base_url, username=user,
password=pw, verify=False, timeout=999)
Production Lines Module
executeAsync
Description
Executes the production line with the given ID and version or with name, project ID and version asynchronously.
Execute by name can be configured with force_exact_match and force_distinct. Use variables, if the production line relies on them.
The ProductionLineJob is returned immediately even if the execution is still running. If version is not specified, the latest version is executed.
Optional request options (request_transformers, response_transformers, timeout, verify, sleep_after_response_millis, deserializer) can be specified.
Returns: ProductionLineJob
Parameters
Property | Type | Required | Default | Description |
---|---|---|---|---|
id | Union[str, uuid.UUID] | false | None | ID of the production line |
version | int | false | None | Version number of the production line |
name | str | false | None | Name of the data table |
project_id | Union[str, uuid.UUID] | false | None | ID of the project |
force_exact_match | bool | false | True | Search for exact match, False: Data table includes the name |
force_distinct | bool | false | True | Raise exception if name is ambiguous, False: execute on first match |
variable_assignments | [dict] | false | None | List of variable assignments |
Usage
### Execution of production line by id ###
pl_job: ProductionLineJob = onedata_api.production_lines.execute_async(id=pl_id,
version=version,
sleep_after_response_millis=300)
### Execution of production line by name ###
pl_job: ProductionLineJob = onedata_api.production_lines.execute_async(name=pl_name,
project_id=project_id,
force_exact_match=True,
force_distinct=True,
sleep_after_response_millis=300)
### Execution of production line by name with variables ###
variable_assignments = [
{
"valueType": "SINGLE",
"variableType": "string",
"variableName": "String Variable 1",
"variableValue": "xyz"
}
]
pl_job: ProductionLineJob = onedata_api.production_lines.execute_async(name=pl_name,
project_id=project_id,
variable_assignments=variable_assignments,
force_exact_match=True,
force_distinct=True)
executeSync
Description:
Executes the production line with the given ID and version or with name, project ID and version synchronously. Execute by name can be configured with force_exact_match and force_distinct. Use variables, if the production line relies on them.
The ProductionLineJob is not returned immediately. The SDK will request the ProductionLineJob until a terminal state of the execution is reached. If the version is not specified, the latest version is executed.
Optional request options (request_transformers, response_transformers, timeout, verify, sleep_after_response_millis, deserializer) can be specified.
Returns: ProductionLineJob
Parameters:
Property | Type | Required | Default | Description |
---|---|---|---|---|
id | Union[str, uuid.UUID] | false | None | ID of the production line |
version | int | false | None | Version number of the production line |
name | str | false | None | Name of the data table |
project_id | Union[str, uuid.UUID] | false | None | ID of the project |
force_exact_match | bool | false | True | Search for exact match, False: Data table includes the name |
force_distinct | bool | false | True | Raise exception if name is ambiguous, False: execute on first match |
variable_assignments | [dict] | false | None | List of variable assignments |
Usage
### Execution of production line by id ###
pl_job: ProductionLineJob = onedata_api.production_lines.execute_sync(id=pl_id, version=version,
sleep_after_response_millis=300)
### Execution of production line by name ###
pl_job: ProductionLineJob = onedata_api.production_lines.execute_sync(name=pl_name, project_id=project_id,
force_exact_match=True, force_distinct=True,
sleep_after_response_millis=300)
Production Line Jobs Module
get
Description
Retrieves a ProductionLineJob from the OneDataAPI by its given production line job id. Optional request options (retry_interval, retry_count, retry_until, request_transformers, response_transformers, timeout, verify, sleep_after_response_millis, deserializer) can be specified.
Returns:ProductionLineJob
Parameters:
Property | Type | Required | Default | Description |
---|---|---|---|---|
id | Union[str, uuid.UUID] | false | None | ID of the production line |
Usage
### Retrieval of a production line job ###
pd: ProductionLineJob = onedata_api.production_lines.jobs.get(id=pl_job_id)
getLatest
Description
Retrieves the latest ProductionLineJob from the OneDataAPI by its given production line id. Optional request options (request_transformers, response_transformers, timeout, verify, sleep_after_response_millis, deserializer) can be specified.
Returns: ProductionLineJob
Parameters
Property | Type | Required | Default | Description |
---|---|---|---|---|
pl_id | Union[str, uuid.UUID] | false | None | ID of the production line |
Usage
### Retrieval of a production line job ###
pd: ProductionLineJob = onedata_api.production_lines.jobs.get_latest(pl_id=pl_id)