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
690ef195
Verified
Commit
690ef195
authored
1 year ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
split off generic code for provisioning service and sending pp request
parent
d0cd532b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!12
Add sites, and add integration of IPtrunks and routers with LSO deployment
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/services/provisioning_proxy.py
+16
-11
16 additions, 11 deletions
gso/services/provisioning_proxy.py
gso/workflows/device/create_device.py
+2
-2
2 additions, 2 deletions
gso/workflows/device/create_device.py
with
18 additions
and
13 deletions
gso/services/provisioning_proxy.py
+
16
−
11
View file @
690ef195
...
...
@@ -4,6 +4,7 @@ import logging
import
requests
from
orchestrator
import
inputstep
from
orchestrator.config.assignee
import
Assignee
from
orchestrator.domain.lifecycle
import
SubscriptionModel
from
orchestrator.forms
import
FormPage
,
ReadOnlyField
from
orchestrator.forms.validators
import
Accept
,
Label
,
LongText
from
orchestrator.types
import
UUIDstr
,
State
...
...
@@ -15,24 +16,16 @@ from gso.products.product_types.device import DeviceProvisioning
logger
=
logging
.
getLogger
(
__name__
)
def
provision_node
(
node_subscription_params
:
DeviceProvisioning
,
process_id
:
UUIDstr
,
dry_run
:
bool
=
True
):
def
_send_request
(
parameters
:
dict
,
process_id
:
UUIDstr
):
oss
=
settings
.
load_oss_params
()
pp_params
=
oss
.
PROVISIONING_PROXY
assert
pp_params
device_params
=
node_subscription_params
.
device
callback_url
=
f
'
{
settings
.
load_oss_params
().
GENERAL
.
public_hostname
}
'
\
f
'
/api/processes/
{
process_id
}
/resume
'
logger
.
debug
(
f
'
[
disabled] provisioning node
{
device_params
}
'
)
logger
.
debug
(
f
'
[
provisioning proxy] provisioning for process
{
process_id
}
'
)
parameters
=
{
'
callback
'
:
callback_url
,
'
dry_run
'
:
dry_run
,
'
device
'
:
json
.
loads
(
json_dumps
(
node_subscription_params
))
}
parameters
.
update
({
'
callback
'
:
callback_url
})
post_request
=
requests
.
post
(
f
'
{
pp_params
.
scheme
}
://
{
pp_params
.
api_base
}
/api/device
'
,
...
...
@@ -42,6 +35,18 @@ def provision_node(
raise
AssertionError
(
post_request
.
text
)
def
provision_service
(
subscription
:
SubscriptionModel
,
process_id
:
UUIDstr
,
dry_run
:
bool
=
True
):
parameters
=
{
'
dry_run
'
:
dry_run
,
'
subscription
'
:
json
.
loads
(
json_dumps
(
subscription
))
}
_send_request
(
parameters
,
process_id
)
@inputstep
(
'
Await provisioning proxy results
'
,
assignee
=
Assignee
(
'
SYSTEM
'
))
def
await_pp_results
()
->
State
:
class
ProvisioningResultPage
(
FormPage
):
...
...
This diff is collapsed.
Click to expand it.
gso/workflows/device/create_device.py
+
2
−
2
View file @
690ef195
...
...
@@ -123,7 +123,7 @@ def initialize_subscription(
@step
(
'
Provision device [DRY RUN]
'
)
def
provision_device_dry
(
subscription
:
DeviceProvisioning
,
process_id
:
UUIDstr
)
->
State
:
provisioning_proxy
.
provision_
nod
e
(
provisioning_proxy
.
provision_
servic
e
(
subscription
,
process_id
)
...
...
@@ -134,7 +134,7 @@ def provision_device_dry(subscription: DeviceProvisioning,
@step
(
'
Provision device [FOR REAL]
'
)
def
provision_device_real
(
subscription
:
DeviceProvisioning
,
process_id
:
UUIDstr
)
->
State
:
provisioning_proxy
.
provision_
nod
e
(
provisioning_proxy
.
provision_
servic
e
(
subscription
,
process_id
,
False
# No dry run this time, run it for real
...
...
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