Skip to content
Snippets Groups Projects
Verified Commit 585b3821 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

resolve Vale errors and warnings

parent 27e52aaa
No related branches found
No related tags found
1 merge request!38Update documentation
Pipeline #83230 failed
......@@ -6,7 +6,7 @@
- ``add-apt-repository ppa:deadsnakes/ppa``
- ``apt install python3.10 python3.10-distutils``
- Follow Steps 1 and 2 from here to install dependencies and setup DB: https://workfloworchestrator.org/orchestrator-core/workshops/beginner/debian/
- To install the orchestrator GUI, you can follow the steps 5 and 6 from the above link.
- To install the orchestrator GUI, you can follow the steps 5 and 6 from the previous link.
- Create a virtual environment:
- ``source /usr/share/virtualenvwrapper/virtualenvwrapper.sh``
- ``mkvirtualenv --python python3.10 gso``
......@@ -16,7 +16,7 @@
## Installation
Do all of this inside the virtual environment.
Do all this inside the virtual environment.
- Clone this repository and ``cd`` into it
- ``pip install -r requirements.txt``
- If you get an error because you pip version is too old, run this: `curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10`
......@@ -27,11 +27,11 @@ Do all of this inside the virtual environment.
## Run
- The core of workflow orchestrator can be started with ``uvicorn --host 0.0.0.0 --port 8080 main:app`` from inside the ``gso`` directory of this repository.
- The GUI can be started with ``yarn start``.
- Start the workflow orchestrator core with ``uvicorn --host 0.0.0.0 --port 8080 main:app`` from inside the ``gso`` directory of this repository.
- Start the GUI with ``yarn start``.
## Useful WFO Resources
## Useful workflow orchestrator resources
- WFO API (Swagger): <https://workfloworchestrator.org/orchestrator-core/architecture/application/api/>
- WFO API (repository): <https://github.com/workfloworchestrator/orchestrator-core/tree/main/orchestrator/api/api_v1/endpoints>
......@@ -53,10 +53,10 @@ Create process that manipulates the state of a subscription (TERMINATE workflow)
**Deleting subscriptions** (not the same as running a TERMINATE workflow for a subscription, but to actually erase it from the WFO database)
Delete a subscription:
To do this, you first have to delete the processes first:
``curl -X 'DELETE' 'http://10.98.1.62:8080/api/subscriptions/3f16532b-0a48-4fe3-802a-36b3f54eed0e'``
``curl -X 'DELETE' 'http://10.98.1.62:8080/api/processes/7447a3e9-7c58-4ae7-8804-c0a75c39c924'``
To do the above, you first have to delete the processes first:
Delete a subscription:
``curl -X 'DELETE' 'http://10.98.1.62:8080/api/processes/7447a3e9-7c58-4ae7-8804-c0a75c39c924'``
``curl -X 'DELETE' 'http://10.98.1.62:8080/api/subscriptions/3f16532b-0a48-4fe3-802a-36b3f54eed0e'``
......@@ -8,28 +8,10 @@ Packages = proselint, Microsoft
[*]
BasedOnStyles = Vale, proselint, Microsoft
; Disable style rules for headings, as these conflict with what is generated by autodoc
; Microsoft.Headings = NO
; Microsoft.HeadingAcronyms = NO
; Microsoft.Dashes = NO
; Ignore acronyms if they are tagged as a term
; TokenIgnores = ([^\n]+std-term[^\n]+)
; TokenIgnores = ('<span class="xref std std-term">GSO<\/span>')
; TokenIgnores = ({term}`[^\n]+`)
; Ignore the table of contents directive
; BlockIgnores = (?s) *(\x60\x60\x60{toctree}.*?\x60\x60\x60)
; BlockIgnores = (?s) *(# {py:mod}\x60[^\n]+\x60)
; Ignore <link>-style links
; TokenIgnores = (<http[^\n]+>+?)
Microsoft.Headings = NO
[*.html]
Microsoft.Dashes = NO
Microsoft.Headings = NO
Microsoft.HeadingAcronyms = NO
[/docs/source/glossary.md]
......
toctree
[Ss]ubpackages
virtualenv
Previous
[Pp]revious
GÉANT Automation Platform
[GSO|gso]
Vereniging
TERMINATE
WFO
Ansible
[Dd]eprovision
API
dry_run
Dark_fiber
"""The main module, from where GSO is run."""
"""The main module that runs {term}`GSO`."""
from orchestrator import OrchestratorCore
from orchestrator.cli.main import app as core_cli
from orchestrator.settings import AppSettings
......
"""Module that updates the domain model of GSO. Should contain all types of subscriptions."""
"""Module that updates the domain model of {term}`GSO`. Should contain all types of subscriptions."""
from orchestrator.domain import SUBSCRIPTION_MODEL_REGISTRY
from gso.products.product_types.device import Device
......
......@@ -23,9 +23,9 @@ logger = logging.getLogger(__name__)
class CUDOperation(strEnum):
"""Enum for different C(R)UD operations that the provisioning proxy supports.
"""Enumerator for different C(R)UD operations that the provisioning proxy supports.
Read is not applicable, hence these become CUD and not CRUD operations.
Read isn't applicable, hence these become CUD and not CRUD operations.
"""
#: Creation is done with a POST request
......@@ -39,12 +39,12 @@ class CUDOperation(strEnum):
def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr, operation: CUDOperation) -> None:
"""Send a request to LSO. The callback address is derived using the process ID provided.
:param str endpoint: The LSO-specific endpoint to call, depending on the type of service object that is acted upon.
:param str endpoint: The LSO-specific endpoint to call, depending on the type of service object that's acted upon.
:param dict parameters: JSON body for the request, which will almost always at least consist of a subscription
object, and a boolean value to indicate a dry run.
:param UUIDstr process_id: The process ID that this request is a part of, used to call back to when the execution
of the playbook is completed.
:param :class:`CUDOperation` operation: The specific operation that is performed with the request.
:param :class:`CUDOperation` operation: The specific operation that's performed with the request.
"""
oss = settings.load_oss_params()
pp_params = oss.PROVISIONING_PROXY
......@@ -73,11 +73,9 @@ def _send_request(endpoint: str, parameters: dict, process_id: UUIDstr, operatio
def provision_device(subscription: DeviceProvisioning, process_id: UUIDstr, dry_run: bool = True) -> None:
"""Provision a new device using LSO.
:param :class:`DeviceProvisioning` subscription: The subscription object
that is to be provisioned.
:param :class:`DeviceProvisioning` subscription: The subscription object that's to be provisioned.
:param UUIDstr process_id: The related process ID, used for callback.
:param bool dry_run: A boolean indicating whether this should be a dry run
or not, defaults to ``True``.
:param bool dry_run: A boolean indicating whether this should be a dry run or not, defaults to ``True``.
"""
parameters = {"dry_run": dry_run, "subscription": json.loads(json_dumps(subscription))}
......@@ -89,12 +87,10 @@ def provision_ip_trunk(
) -> None:
"""Provision an IP trunk service using LSO.
:param :class:`IptrunkProvisioning` subscription: The subscription object
that is to be provisioned.
:param :class:`IptrunkProvisioning` subscription: The subscription object that's to be provisioned.
:param UUIDstr process_id: The related process ID, used for callback.
:param str config_object: The type of object that is deployed
:param bool dry_run: A boolean indicating whether this should be a dry run
or not, defaults to ``True``.
:param str config_object: The type of object that's deployed
:param bool dry_run: A boolean indicating whether this should be a dry run or not, defaults to ``True``.
"""
parameters = {
"subscription": json.loads(json_dumps(subscription)),
......@@ -134,11 +130,9 @@ def provision_ip_trunk(
def deprovision_ip_trunk(subscription: Iptrunk, process_id: UUIDstr, dry_run: bool = True) -> None:
"""Deprovision an IP trunk service using LSO.
:param :class:`IptrunkProvisioning` subscription: The subscription object
that is to be provisioned.
:param :class:`IptrunkProvisioning` subscription: The subscription object that's to be provisioned.
:param UUIDstr process_id: The related process ID, used for callback.
:param bool dry_run: A boolean indicating whether this should be a dry run
or not, defaults to ``True``.
:param bool dry_run: A boolean indicating whether this should be a dry run or not, defaults to ``True``.
"""
parameters = {"subscription": json.loads(json_dumps(subscription)), "dry_run": dry_run, "verb": "terminate"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment