Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ankaios_sdk/_components/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
.. code-block:: python

manifest = Manifest.from_dict({"apiVersion": "1.0", "workloads": {}})

- Check if the manifest is valid:
.. code-block:: python

try:
manifest = Manifest.from_file("path/to/manifest.yaml")
except InvalidManifestException as e:
print(f"Invalid manifest: {e}")
"""

import yaml
Expand Down
18 changes: 9 additions & 9 deletions ankaios_sdk/_components/workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@
- Create a workload using the WorkloadBuilder:
.. code-block:: python

workload = Workload.builder()
.workload_name("nginx")
.agent_name("agent_A")
.runtime("podman")
.restart_policy("NEVER")
workload = Workload.builder() \\
.workload_name("nginx") \\
.agent_name("agent_A") \\
.runtime("podman") \\
.restart_policy("NEVER") \\
.runtime_config("image: docker.io/library/nginx\\n"
+ "commandOptions: [\"-p\", \"8080:80\"]")
.add_dependency("other_workload", "ADD_COND_RUNNING")
.add_tag("key1", "value1")
.add_tag("key2", "value2")
+ "commandOptions: [\\"-p\\", \\"8080:80\\"]") \\
.add_dependency("other_workload", "ADD_COND_RUNNING") \\
.add_tag("key1", "value1") \\
.add_tag("key2", "value2") \\
.build()

- Update fields of the workload:
Expand Down
2 changes: 1 addition & 1 deletion ankaios_sdk/_components/workload_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class WorkloadExecutionState:
Attributes:
state (WorkloadStateEnum): The state of the workload.
substate (WorkloadSubStateEnum): The sub-state of the workload.
info (str): Additional information about the workload state.
additional_info (str): Additional information about the workload state.
"""
def __init__(self, state: _ank_base.ExecutionState) -> None:
"""
Expand Down
13 changes: 8 additions & 5 deletions ankaios_sdk/ankaios.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,14 @@
- Wait for a workload to reach a state:
.. code-block:: python

ret = ankaios.wait_for_workload_to_reach_state(
instance_name,
WorkloadStateEnum.RUNNING
)
if ret:
try:
ankaios.wait_for_workload_to_reach_state(
instance_name,
WorkloadStateEnum.RUNNING
)
except TimeoutError:
print(f"State not reached in time.")
else:
print(f"State reached.")
"""

Expand Down
8 changes: 0 additions & 8 deletions docs/source/ankaios.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,3 @@ Ankaios Class
:members:
:undoc-members:
:show-inheritance:

AnkaiosLogLevel Enum
---------------------

.. autoclass:: ankaios_sdk.ankaios.AnkaiosLogLevel
:members:
:undoc-members:
:show-inheritance: