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
fc1801db
Verified
Commit
fc1801db
authored
1 year ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
add documentation to main, products/__init__, and settings
parent
b9a3897d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!18
Feature/cleanup
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.pylintrc
+9
-0
9 additions, 0 deletions
.pylintrc
gso/main.py
+5
-2
5 additions, 2 deletions
gso/main.py
gso/products/__init__.py
+4
-0
4 additions, 0 deletions
gso/products/__init__.py
gso/settings.py
+38
-8
38 additions, 8 deletions
gso/settings.py
with
56 additions
and
10 deletions
.pylintrc
0 → 100644
+
9
−
0
View file @
fc1801db
[MAIN]
extension-pkg-whitelist=pydantic
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
# Note that it does not contain TODO, only the default FIXME and XXX
notes=FIXME,
XXX
This diff is collapsed.
Click to expand it.
gso/main.py
+
5
−
2
View file @
fc1801db
"""
The main module, from where GSO is run.
"""
from
orchestrator
import
OrchestratorCore
from
orchestrator.cli.main
import
app
as
core_cli
from
orchestrator.settings
import
AppSettings
import
gso.products
#
noqa: F401
import
gso.workflows
#
noqa: F401
import
gso.products
#
pylint: disable=unused-import
import
gso.workflows
#
pylint: disable=unused-import
app
=
OrchestratorCore
(
base_settings
=
AppSettings
())
...
...
This diff is collapsed.
Click to expand it.
gso/products/__init__.py
+
4
−
0
View file @
fc1801db
"""
Module that updated the domain model of GSO. Should contain all types of
subscriptions.
"""
from
orchestrator.domain
import
SUBSCRIPTION_MODEL_REGISTRY
from
gso.products.product_types.device
import
Device
...
...
This diff is collapsed.
Click to expand it.
gso/settings.py
+
38
−
8
View file @
fc1801db
"""
GSO settings, ensuring that the required parameters are set correctly.
"""
import
ipaddress
import
json
import
os
from
pydantic
import
BaseSettings
from
pydantic
import
BaseSettings
,
Field
class
GeneralParams
(
BaseSettings
):
"""
General parameters for a GSO configuration file.
"""
#: The hostname that GSO is publicly served at, used for building the
#: callback URL that the provisioning proxy uses.
public_hostname
:
str
class
InfoBloxParams
(
BaseSettings
):
"""
Parameters related to InfoBlox.
"""
scheme
:
str
wapi_version
:
str
host
:
str
...
...
@@ -17,24 +28,37 @@ class InfoBloxParams(BaseSettings):
class
V4NetworkParams
(
BaseSettings
):
"""
A set of parameters that describe an IPv4 network in InfoBlox.
"""
containers
:
list
[
ipaddress
.
IPv4Network
]
networks
:
list
[
ipaddress
.
IPv4Network
]
mask
:
int
# TODO: validation on mask?
mask
:
int
=
Field
(
None
,
ge
=
0
,
le
=
32
)
class
V6NetworkParams
(
BaseSettings
):
"""
A set of parameters that describe an IPv6 network in InfoBlox.
"""
containers
:
list
[
ipaddress
.
IPv6Network
]
networks
:
list
[
ipaddress
.
IPv6Network
]
mask
:
int
# TODO: validation on mask?
mask
:
int
=
Field
(
None
,
ge
=
0
,
le
=
128
)
class
ServiceNetworkParams
(
BaseSettings
):
"""
Parameters for InfoBlox that describe IPv4 and v6 networks, and the
corresponding domain name that should be used as a suffix.
"""
V4
:
V4NetworkParams
V6
:
V6NetworkParams
domain_name
:
str
class
IPAMParams
(
BaseSettings
):
"""
A set of parameters related to IPAM.
"""
INFOBLOX
:
InfoBloxParams
LO
:
ServiceNetworkParams
TRUNK
:
ServiceNetworkParams
...
...
@@ -42,6 +66,9 @@ class IPAMParams(BaseSettings):
class
ProvisioningProxyParams
(
BaseSettings
):
"""
Parameters for the provisioning proxy.
"""
scheme
:
str
api_base
:
str
auth
:
str
# FIXME: unfinished
...
...
@@ -49,19 +76,22 @@ class ProvisioningProxyParams(BaseSettings):
class
OSSParams
(
BaseSettings
):
"""
The set of parameters required for running GSO.
"""
GENERAL
:
GeneralParams
IPAM
:
IPAMParams
RESOURCE_MANAGER_API_PREFIX
:
str
# api prefix
RESOURCE_MANAGER_API_PREFIX
:
str
PROVISIONING_PROXY
:
ProvisioningProxyParams
def
load_oss_params
()
->
OSSParams
:
"""
look for OSS_PARAMS_FILENAME in the environment and load the
parameters
from that file
look for OSS_PARAMS_FILENAME in the environment and load the
parameters
from that file
.
"""
with
open
(
os
.
environ
[
'
OSS_PARAMS_FILENAME
'
])
as
f
:
return
OSSParams
(
**
json
.
loads
(
f
.
read
()))
with
open
(
os
.
environ
[
'
OSS_PARAMS_FILENAME
'
])
as
f
ile
:
return
OSSParams
(
**
json
.
loads
(
f
ile
.
read
()))
if
__name__
==
'
__main__
'
:
...
...
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