Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
interface-openstack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
4
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
10775612
authored
Apr 26, 2019
by
Adam Torok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix return type
parent
56309ef2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
1 deletions
+69
-1
interface/network/PortManager.py
+1
-1
main.py
+68
-0
No files found.
interface/network/PortManager.py
View file @
10775612
...
...
@@ -11,7 +11,7 @@ class PortManager:
def
get
(
self
,
id
)
->
Port
:
raise
NotImplementedError
def
update
(
self
,
id
,
params
):
def
update
(
self
,
id
,
params
)
->
Port
:
raise
NotImplementedError
def
delete
(
self
,
id
)
->
bool
:
...
...
main.py
View file @
10775612
# This file is for testing the openstack api access
import
openstack
from
implementation.network.OpenstackNetworkManager
import
OpenstackNetworkManager
from
implementation.network.OpenstackPortManager
import
OpenstackPortManager
from
implementation.network.OpenstackRouterManager
import
OpenstackRouterManager
from
implementation.network.OpenstackSubnetManager
import
OpenstackSubnetManager
os
=
openstack
.
connect
(
cloud
=
'openstack'
)
network_manager
=
OpenstackNetworkManager
(
os
)
subnet_manager
=
OpenstackSubnetManager
(
os
)
router_manager
=
OpenstackRouterManager
(
os
)
port_manager
=
OpenstackPortManager
(
os
)
print
(
'*'
*
40
)
print
(
'Networks:'
)
for
network
in
network_manager
.
list
():
print
(
'
\t
'
,
network
)
print
(
'*'
*
40
)
print
(
'*'
*
40
)
print
(
'Subnets:'
)
for
subnet
in
subnet_manager
.
list
():
print
(
'
\t
'
,
subnet
)
print
(
'*'
*
40
)
print
(
'*'
*
40
)
print
(
'Routers:'
)
for
router
in
router_manager
.
list
():
print
(
'
\t
'
,
router
)
print
(
'*'
*
40
)
print
(
'*'
*
40
)
print
(
'Ports:'
)
for
port
in
port_manager
.
list
():
print
(
'
\t
'
,
port
)
print
(
'*'
*
40
)
os_network
=
network_manager
.
get
(
'86a53890-5821-4718-b1d7-accee304c497'
)
# network_manager.create()
print
(
'Network:'
)
print
(
os_network
)
os_subnet
=
subnet_manager
.
get
(
'4b68dd3f-cbc1-49d7-9b8d-bbb2fae6e687'
)
# subnet_manager.create(os_network.id, 4, '10.10.0.0/16')
print
(
'Subnet:'
)
print
(
os_subnet
)
os_port
=
port_manager
.
get
(
'74bae615-1189-4d9a-ae44-1a2a3f5eb98a'
)
# port_manager.create(os_network.id)
print
(
'Port:'
)
print
(
os_port
)
#print(subnet_manager.create('10.10.0.0/16'))
#for subnet in subnet_manager.list():
# print(subnet)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment