CRUD
delete_run(identifier, project=None, **kwargs)
Delete object from backend.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier
|
str
|
Entity key (store://...) or entity ID. |
required |
project
|
str
|
Project name. |
None
|
**kwargs
|
dict
|
Parameters to pass to the API call. |
{}
|
Returns:
Type | Description |
---|---|
dict
|
Response from backend. |
Examples:
Source code in digitalhub/entities/run/crud.py
get_run(identifier, project=None, **kwargs)
Get object from backend.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier
|
str
|
Entity key (store://...) or entity ID. |
required |
project
|
str
|
Project name. |
None
|
**kwargs
|
dict
|
Parameters to pass to the API call. |
{}
|
Returns:
Type | Description |
---|---|
Run
|
Object instance. |
Examples:
Using entity key:
Using entity ID:
Source code in digitalhub/entities/run/crud.py
import_run(file)
Get object from file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file
|
str
|
Path to YAML file. |
required |
Returns:
Type | Description |
---|---|
Run
|
Object instance. |
Example
obj = import_run("my-run.yaml")
Source code in digitalhub/entities/run/crud.py
list_runs(project, **kwargs)
List all latest version objects from backend.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project
|
str
|
Project name. |
required |
**kwargs
|
dict
|
Parameters to pass to the API call. |
{}
|
Returns:
Type | Description |
---|---|
list[Run]
|
List of object instances. |
Examples:
Source code in digitalhub/entities/run/crud.py
new_run(project, kind, uuid=None, labels=None, task=None, local_execution=False, **kwargs)
Create a new object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project
|
str
|
Project name. |
required |
kind
|
str
|
Kind the object. |
required |
uuid
|
str
|
ID of the object (UUID4, e.g. 40f25c4b-d26b-4221-b048-9527aff291e2). |
None
|
labels
|
list[str]
|
List of labels. |
None
|
task
|
str
|
Name of the task associated with the run. |
None
|
local_execution
|
bool
|
Flag to determine if object has local execution. |
False
|
**kwargs
|
dict
|
Spec keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
Run
|
Object instance. |
Examples:
>>> obj = new_function(project="my-project",
>>> name="my-function",
>>> kind="python+run",
>>> task="task-string"
Source code in digitalhub/entities/run/crud.py
update_run(entity)
Update object. Note that object spec are immutable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity
|
Run
|
Object to update. |
required |
Returns:
Type | Description |
---|---|
Run
|
Entity updated. |
Examples: