Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
netvs-middleware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
scc-net
netvs
netvs-middleware
Commits
b3846e08
Commit
b3846e08
authored
2 months ago
by
Alexander Kaschta
Browse files
Options
Downloads
Patches
Plain Diff
ADD: BCD Request model
parent
51f62577
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#397579
passed
2 months ago
Stage: lint
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/bcd_request.py
+15
-1
15 additions, 1 deletion
api/bcd_request.py
model/bcd_request.py
+27
-0
27 additions, 0 deletions
model/bcd_request.py
with
42 additions
and
1 deletion
api/bcd_request.py
+
15
−
1
View file @
b3846e08
from
fastapi
import
APIRouter
from
fastapi
import
APIRouter
,
Depends
,
HTTPException
from
starlette
import
status
from
api
import
get_conn
from
model.bcd_request
import
BCDRequestModel
from
model.wapi.cntl
import
APIToken
,
Mgr
from
util.auth
import
check_auth
router
=
APIRouter
(
prefix
=
"
/api/bcd_request
"
,
...
...
@@ -8,3 +14,11 @@ js_mods = ['bcdrequest']
# TODO: implement methods...
@router.post
(
''
)
async
def
handle_request
(
bcd_request
:
BCDRequestModel
,
token
:
APIToken
=
Depends
(
check_auth
),
conn
=
Depends
(
get_conn
)):
user
=
Mgr
.
check_token
(
conn
,
token
)
if
user
:
return
"
Success
"
raise
HTTPException
(
status_code
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
)
This diff is collapsed.
Click to expand it.
model/bcd_request.py
+
27
−
0
View file @
b3846e08
...
...
@@ -22,6 +22,11 @@ class BCDSystemType(Enum):
OTHER
=
6
class
IPAddressVersion
(
Enum
):
IPV6_ONLY
=
1
DUAL_STACK
=
2
class
BCDRequestModel
(
BaseModel
):
oe
:
str
=
Field
()
group
:
str
=
Field
()
...
...
@@ -30,3 +35,25 @@ class BCDRequestModel(BaseModel):
type_of_system
:
BCDSystemType
=
Field
()
type_of_system_note
:
Optional
[
str
]
=
Field
(
default
=
None
)
load_balancer
:
bool
=
Field
()
bcd_name
:
str
=
Field
()
access_to_internet
:
bool
=
Field
()
access_from_internet
:
bool
=
Field
()
access_from_internet_explanation
:
Optional
[
str
]
=
Field
(
default
=
None
)
type_of_subnet
:
IPAddressVersion
=
Field
()
ipv4_subnet_size
:
int
=
Field
()
ipv4_subnet_size_explanation
:
Optional
[
str
]
=
Field
(
default
=
None
)
dhcp
:
bool
=
Field
()
dhcp_pool
:
bool
=
Field
()
dhcp_pool_size
:
int
=
Field
()
own_dhcp_server
:
bool
=
Field
()
location_cs
:
bool
=
Field
()
location_cn
:
bool
=
Field
()
location_vm_cluster_unknown
:
bool
=
Field
()
location_vm_cluster_cs
:
bool
=
Field
()
location_vm_cluster_cn
:
bool
=
Field
()
location_scc_server_room_cs
:
bool
=
Field
()
location_scc_server_room_cn
:
bool
=
Field
()
location_vpn_wifi_to_vlan
:
bool
=
Field
()
vpn2vlan
:
bool
=
Field
()
wifi2vlan
:
bool
=
Field
()
additional_comments
:
Optional
[
str
]
=
Field
(
default
=
None
)
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