Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
4ea0b717
Commit
4ea0b717
authored
2 years ago
by
JORGE SASIAIN
Browse files
Options
Downloads
Patches
Plain Diff
Register workflows
parent
8855b523
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
main.py
+1
-0
1 addition, 0 deletions
main.py
migrations/versions/schema/2023-01-16_69a2eb84aae4_add_workflows.py
+88
-0
88 additions, 0 deletions
.../versions/schema/2023-01-16_69a2eb84aae4_add_workflows.py
workflows/__init__.py
+11
-0
11 additions, 0 deletions
workflows/__init__.py
with
100 additions
and
0 deletions
main.py
+
1
−
0
View file @
4ea0b717
...
...
@@ -3,6 +3,7 @@ from orchestrator.cli.main import app as core_cli
from
orchestrator.settings
import
AppSettings
import
products
import
workflows
app
=
OrchestratorCore
(
base_settings
=
AppSettings
())
...
...
This diff is collapsed.
Click to expand it.
migrations/versions/schema/2023-01-16_69a2eb84aae4_add_workflows.py
0 → 100644
+
88
−
0
View file @
4ea0b717
"""
add workflows.
Revision ID: 69a2eb84aae4
Revises: b815abc87ce9
Create Date: 2023-01-16 08:33:12.302351
"""
import
sqlalchemy
as
sa
from
alembic
import
op
from
orchestrator.migrations.helpers
import
create_workflow
,
delete_workflow
from
orchestrator.targets
import
Target
# revision identifiers, used by Alembic.
revision
=
'
69a2eb84aae4
'
down_revision
=
'
b815abc87ce9
'
branch_labels
=
None
depends_on
=
None
new_workflows
=
[
{
"
name
"
:
"
create_node
"
,
"
target
"
:
Target
.
CREATE
,
"
description
"
:
"
Create node
"
,
"
product_type
"
:
"
Node
"
,
},
{
"
name
"
:
"
modify_node
"
,
"
target
"
:
Target
.
MODIFY
,
"
description
"
:
"
Modify node
"
,
"
product_type
"
:
"
Node
"
,
},
{
"
name
"
:
"
terminate_node
"
,
"
target
"
:
Target
.
TERMINATE
,
"
description
"
:
"
Terminate node
"
,
"
product_type
"
:
"
Node
"
,
},
{
"
name
"
:
"
create_line_card
"
,
"
target
"
:
Target
.
CREATE
,
"
description
"
:
"
Create line card
"
,
"
product_type
"
:
"
LineCard
"
,
},
{
"
name
"
:
"
modify_line_card
"
,
"
target
"
:
Target
.
MODIFY
,
"
description
"
:
"
Modify line card
"
,
"
product_type
"
:
"
LineCard
"
,
},
{
"
name
"
:
"
terminate_node
"
,
"
target
"
:
Target
.
TERMINATE
,
"
description
"
:
"
Terminate line card
"
,
"
product_type
"
:
"
LineCard
"
,
},
{
"
name
"
:
"
create_port
"
,
"
target
"
:
Target
.
CREATE
,
"
description
"
:
"
Create port
"
,
"
product_type
"
:
"
Port
"
,
},
{
"
name
"
:
"
modify_port
"
,
"
target
"
:
Target
.
MODIFY
,
"
description
"
:
"
Modify port
"
,
"
product_type
"
:
"
Port
"
,
},
{
"
name
"
:
"
terminate_port
"
,
"
target
"
:
Target
.
TERMINATE
,
"
description
"
:
"
Terminate port
"
,
"
product_type
"
:
"
Port
"
,
},
]
def
upgrade
()
->
None
:
conn
=
op
.
get_bind
()
for
workflow
in
new_workflows
:
create_workflow
(
conn
,
workflow
)
def
downgrade
()
->
None
:
conn
=
op
.
get_bind
()
for
workflow
in
new_workflows
:
delete_workflow
(
conn
,
workflow
[
"
name
"
])
This diff is collapsed.
Click to expand it.
workflows/__init__.py
+
11
−
0
View file @
4ea0b717
from
orchestrator.workflows
import
LazyWorkflowInstance
LazyWorkflowInstance
(
"
workflows.user_group.create_node
"
,
"
create_node
"
)
LazyWorkflowInstance
(
"
workflows.user_group.modify_node
"
,
"
modify_node
"
)
LazyWorkflowInstance
(
"
workflows.user_group.terminate_node
"
,
"
terminate_node
"
)
LazyWorkflowInstance
(
"
workflows.user.create_line_card
"
,
"
create_line_card
"
)
LazyWorkflowInstance
(
"
workflows.user.modify_line_card
"
,
"
modify_line_card
"
)
LazyWorkflowInstance
(
"
workflows.user.terminate_line_card
"
,
"
terminate_line_card
"
)
LazyWorkflowInstance
(
"
workflows.user_group.create_port
"
,
"
create_port
"
)
LazyWorkflowInstance
(
"
workflows.user_group.modify_port
"
,
"
modify_port
"
)
LazyWorkflowInstance
(
"
workflows.user_group.terminate_port
"
,
"
terminate_port
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment