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
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
2e56aca8
Commit
2e56aca8
authored
1 year ago
by
Simone Spinelli
Browse files
Options
Downloads
Patches
Plain Diff
IPtrunk model and IPtrunk workflow with placeholders - to be refined with the ansible part
parent
5f5870c1
No related branches found
No related tags found
1 merge request
!8
Feature/iptrunks prototype
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/products/product_blocks/iptrunk.py
+9
-8
9 additions, 8 deletions
gso/products/product_blocks/iptrunk.py
gso/workflows/iptrunk/create_iptrunk.py
+6
-12
6 additions, 12 deletions
gso/workflows/iptrunk/create_iptrunk.py
with
15 additions
and
20 deletions
gso/products/product_blocks/iptrunk.py
+
9
−
8
View file @
2e56aca8
from
typing
import
Optional
from
typing
import
List
from
pydantic
import
Field
from
orchestrator.domain.base
import
ProductBlockModel
from
orchestrator.types
import
SubscriptionLifecycle
,
strEnum
...
...
@@ -74,14 +75,14 @@ class IptrunkBlockProvisioning(IptrunkBlockInactive,
iptrunk_sideA_node
:
DeviceBlockProvisioning
iptrunk_sideA_ae_iface
:
Optional
[
str
]
=
None
iptrunk_sideA_ae_geant_a_sid
:
Optional
[
str
]
=
None
iptrunk_sideA_ae_members
:
Optional
[
li
st
]
=
None
iptrunk_sideA_ae_members_description
:
Optional
[
li
st
]
=
None
iptrunk_sideA_ae_members
:
list
[
st
r
]
=
Field
(
default_factory
=
list
)
iptrunk_sideA_ae_members_description
:
list
[
st
r
]
=
Field
(
default_factory
=
list
)
#
iptrunk_sideB_node
:
DeviceBlockProvisioning
iptrunk_sideB_ae_iface
:
Optional
[
str
]
=
None
iptrunk_sideB_ae_geant_a_sid
:
Optional
[
str
]
=
None
iptrunk_sideB_ae_members
:
Optional
[
li
st
]
=
None
iptrunk_sideB_ae_members_description
:
Optional
[
li
st
]
=
None
iptrunk_sideB_ae_members
:
list
[
st
r
]
=
Field
(
default_factory
=
list
)
iptrunk_sideB_ae_members_description
:
list
[
st
r
]
=
Field
(
default_factory
=
list
)
class
IptrunkBlock
(
IptrunkBlockProvisioning
,
...
...
@@ -97,11 +98,11 @@ class IptrunkBlock(IptrunkBlockProvisioning,
iptrunk_sideA_node
:
DeviceBlock
iptrunk_sideA_ae_iface
:
str
iptrunk_sideA_ae_geant_a_sid
:
str
iptrunk_sideA_ae_members
:
list
[
str
]
iptrunk_sideA_ae_members_description
:
list
[
str
]
iptrunk_sideA_ae_members
:
list
[
str
]
=
Field
(
default_factory
=
list
)
iptrunk_sideA_ae_members_description
:
list
[
str
]
=
Field
(
default_factory
=
list
)
#
iptrunk_sideB_node
:
DeviceBlock
iptrunk_sideB_ae_iface
:
str
iptrunk_sideB_ae_geant_a_sid
:
str
iptrunk_sideB_ae_members
:
list
[
str
]
iptrunk_sideB_ae_members_description
:
list
[
str
]
iptrunk_sideB_ae_members
:
list
[
str
]
=
Field
(
default_factory
=
list
)
iptrunk_sideB_ae_members_description
:
list
[
str
]
=
Field
(
default_factory
=
list
)
This diff is collapsed.
Click to expand it.
gso/workflows/iptrunk/create_iptrunk.py
+
6
−
12
View file @
2e56aca8
...
...
@@ -143,9 +143,6 @@ def initialize_subscription(
@step
(
"
Provision iptrunk [DRY RUN]
"
)
def
provision_iptrunk_dry
(
subscription
:
iptrunk
.
IptrunkProvisioning
,
fqdn
:
str
,
ts_address
:
str
,
ts_port
:
str
)
->
State
:
# import ansible_runner
#
...
...
@@ -170,9 +167,9 @@ def provision_iptrunk_dry(
# # if r.rc != 0:
# # raise ValueError("Ansible has failed")
# return {"dry_run_output": out_splitted, "return_code": r.rc}
provisioning_proxy
.
provision_node
(
node_subscription_params
=
subscription
,
dry_run
=
True
)
#
provisioning_proxy.provision_node(
#
node_subscription_params=subscription,
#
dry_run=True)
# TODO: figure out what to return when we are suspending & waiting
# for the provisioning-proxy to call back
return
{
"
return_code
"
:
0
}
...
...
@@ -191,9 +188,6 @@ def confirm_step() -> FormGenerator:
@step
(
"
Provision iptrunk [FOR REAL]
"
)
def
provision_iptrunk_real
(
subscription
:
iptrunk
.
IptrunkProvisioning
,
fqdn
:
str
,
ts_address
:
str
,
ts_port
:
str
)
->
State
:
# import ansible_runner
#
...
...
@@ -216,9 +210,9 @@ def provision_iptrunk_real(
# out = r.stdout.read()
# out_splitted = out.splitlines()
#
# return {"real_run_output": out_splitted, "return_code": r.rc}
provisioning_proxy
.
provision_node
(
node_subscription_params
=
subscription
)
#
#
return {"real_run_output": out_splitted, "return_code": r.rc}
#
provisioning_proxy.provision_node(
#
node_subscription_params=subscription)
# TODO: figure out what to return when we are suspending & waiting
# for the provisioning-proxy to call back
return
{
"
return_code
"
:
0
}
...
...
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