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
Merge requests
!238
add tasks for partner creation, modification and deletion
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add tasks for partner creation, modification and deletion
feature/NAT-677-creat-update-task-for-partner
into
develop
Overview
2
Commits
4
Pipelines
13
Changes
17
Merged
Mohammad Torkashvand
requested to merge
feature/NAT-677-creat-update-task-for-partner
into
develop
10 months ago
Overview
2
Commits
4
Pipelines
13
Changes
17
Expand
0
0
Merge request reports
Viewing commit
1b94915b
Show latest version
17 files
+
749
−
98
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
17
Search (e.g. *.vue) (Ctrl+P)
1b94915b
add task for partner creation,modification and deletion
· 1b94915b
Mohammad Torkashvand
authored
10 months ago
gso/db/models.py
+
1
−
26
Options
"""
Database model definitions and table mappings for the GSO system.
"""
import
enum
import
structlog
from
orchestrator.db
import
UtcTimestamp
from
orchestrator.db.database
import
BaseModel
from
sqlalchemy
import
(
Enum
,
String
,
text
,
)
from
sqlalchemy.dialects.postgresql
import
ARRAY
from
sqlalchemy.orm
import
mapped_column
logger
=
structlog
.
get_logger
(
__name__
)
class
PartnerType
(
str
,
enum
.
Enum
):
"""
Defining different types of partners in the GSO system.
"""
NREN
=
"
NREN
"
RE_PEER
=
"
RE_PEER
"
PUBLIC_PEER
=
"
PUBLIC_PEER
"
PRIVATE_PEER
=
"
PRIVATE_PEER
"
UPSTREAM
=
"
UPSTREAM
"
GEANT
=
"
GEANT
"
class
PartnerTable
(
BaseModel
):
"""
Database table for the partners in the GSO system.
"""
__tablename__
=
"
partners
"
partner_id
=
mapped_column
(
String
,
server_default
=
text
(
"
uuid_generate_v4
"
),
primary_key
=
True
)
name
=
mapped_column
(
String
,
unique
=
True
,
nullable
=
Tru
e
)
name
=
mapped_column
(
String
,
unique
=
True
,
nullable
=
Fals
e
)
email
=
mapped_column
(
String
,
unique
=
True
,
nullable
=
False
)
partner_type
=
mapped_column
(
Enum
(
PartnerType
),
nullable
=
False
)
as_number
=
mapped_column
(
String
,
unique
=
True
,
nullable
=
True
)
# the as_number and as_set are mutually exclusive. if you give me one I don't need the other
as_set
=
mapped_column
(
String
,
nullable
=
True
)
route_set
=
mapped_column
(
String
,
nullable
=
True
)
black_listed_as_sets
=
mapped_column
(
ARRAY
(
String
),
nullable
=
True
)
additional_routers
=
mapped_column
(
ARRAY
(
String
),
nullable
=
True
)
additional_bgp_speakers
=
mapped_column
(
ARRAY
(
String
),
nullable
=
True
)
created_at
=
mapped_column
(
UtcTimestamp
,
server_default
=
text
(
"
current_timestamp
"
),
nullable
=
False
)
updated_at
=
mapped_column
(
Loading