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
d3af8344
Verified
Commit
d3af8344
authored
6 months ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
Update switch domain model
parent
4e26ec68
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!300
Feature/lan switch interconnect
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/migrations/versions/2024-08-29_bd9be532b3f9_update_switch_domain_model.py
+29
-0
29 additions, 0 deletions
...ons/2024-08-29_bd9be532b3f9_update_switch_domain_model.py
gso/products/product_blocks/switch.py
+6
-6
6 additions, 6 deletions
gso/products/product_blocks/switch.py
with
35 additions
and
6 deletions
gso/migrations/versions/2024-08-29_bd9be532b3f9_update_switch_domain_model.py
0 → 100644
+
29
−
0
View file @
d3af8344
"""
Update switch domain model.
Revision ID: bd9be532b3f9
Revises: 87a05eddee3e
Create Date: 2024-08-29 11:41:06.936423
"""
import
sqlalchemy
as
sa
from
alembic
import
op
# revision identifiers, used by Alembic.
revision
=
'
bd9be532b3f9
'
down_revision
=
'
87a05eddee3e
'
branch_labels
=
None
depends_on
=
None
def
upgrade
()
->
None
:
conn
=
op
.
get_bind
()
conn
.
execute
(
sa
.
text
(
"""
UPDATE resource_types SET resource_type=
'
switch_fqdn
'
WHERE resource_types.resource_type =
'
switch_hostname
'
"""
))
def
downgrade
()
->
None
:
conn
=
op
.
get_bind
()
conn
.
execute
(
sa
.
text
(
"""
UPDATE resource_types SET resource_type=
'
switch_hostname
'
WHERE resource_types.resource_type =
'
switch_fqdn
'
"""
))
This diff is collapsed.
Click to expand it.
gso/products/product_blocks/switch.py
+
6
−
6
View file @
d3af8344
...
...
@@ -26,7 +26,7 @@ class SwitchBlockInactive(
):
"""
A switch that
'
s being currently inactive. See :class:`SwitchBlock`.
"""
switch_
hostname
:
str
|
None
=
None
switch_
fqdn
:
str
|
None
=
None
switch_ts_port
:
PortNumber
|
None
=
None
switch_site
:
SiteBlockInactive
|
None
=
None
switch_vendor
:
Vendor
|
None
=
None
...
...
@@ -36,18 +36,18 @@ class SwitchBlockInactive(
class
SwitchBlockProvisioning
(
SwitchBlockInactive
,
lifecycle
=
[
SubscriptionLifecycle
.
PROVISIONING
]):
"""
A switch that
'
s being provisioned. See :class:`SwitchBlock`.
"""
switch_
hostname
:
str
switch_
fqdn
:
str
switch_ts_port
:
PortNumber
switch_site
:
SiteBlockProvisioning
switch_vendor
:
Vendor
switch_model
:
SwitchModel
|
None
=
None
switch_model
:
SwitchModel
class
SwitchBlock
(
SwitchBlockProvisioning
,
lifecycle
=
[
SubscriptionLifecycle
.
ACTIVE
]):
"""
A switch that
'
s currently deployed in the network.
"""
#: The
hostname
of the switch.
switch_
hostname
:
str
#: The
:term:`FQDN`
of the switch.
switch_
fqdn
:
str
#: The port of the terminal server that this switch is connected to. Used to offer out of band access.
switch_ts_port
:
PortNumber
#: The :class:`Site` that this switch resides in. Both physically and computationally.
...
...
@@ -55,4 +55,4 @@ class SwitchBlock(SwitchBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTI
#: The vendor of the switch.
switch_vendor
:
Vendor
#: The model of the switch.
switch_model
:
SwitchModel
|
None
=
None
switch_model
:
SwitchModel
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