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
503b5c02
authored
5 years ago
by
Belákovics Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create Flavor, BlockDeviceMaping resource
parent
43003cf9
Pipeline
#709
failed with stage
in 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
17 deletions
+28
-17
interface/vm/instance.py
+9
-12
interface/vm/resources.py
+19
-5
No files found.
interface/vm/instance.py
View file @
503b5c02
...
...
@@ -7,10 +7,13 @@ It should be implemented for using other providers e. g. OpenStack
class
InstanceInterface
:
def
create_
vm_from_template
(
self
,
template
,
resource
):
def
create_
base_vm
(
self
,
name
,
flavor
,
networks
,
block_device_mapping
):
raise
NotImplementedError
def
create_multiple_vm_from_template
(
self
,
template
,
resource
,
number
):
def
create_vm_from_template
(
self
,
name
,
image
,
flavor
,
networks
):
raise
NotImplementedError
def
create_multiple_vm_from_template
(
self
,
image
,
flavor
,
networks
,
number
):
raise
NotImplementedError
def
get_vm
(
self
,
name_or_id
):
...
...
@@ -40,9 +43,6 @@ class InstanceInterface:
def
destroy_vm
(
self
,
name_or_id
):
raise
NotImplementedError
def
migrate_vm
(
self
,
name_or_id
,
to
):
raise
NotImplementedError
def
get_status
(
self
,
name_or_id
):
raise
NotImplementedError
...
...
@@ -52,17 +52,14 @@ class InstanceInterface:
def
install_ssh_key
(
self
,
name_or_id
,
key
):
raise
NotImplementedError
def
save_as_templat
e
(
self
,
name_or_id
):
def
get_vnc_consol
e
(
self
,
name_or_id
):
raise
NotImplementedError
def
get_vnc_console
(
self
,
name_or_id
):
def
change_password
(
self
,
name_or_id
):
raise
NotImplementedError
# def change_password(self, name_or_id):
# raise NotImplementedError
#
# def get_password(self, name_or_id):
# raise NotImplementedError
def
get_password
(
self
,
name_or_id
):
raise
NotImplementedError
def
resize_vm
(
self
,
name_or_id
):
raise
NotImplementedError
...
...
This diff is collapsed.
Click to expand it.
interface/vm/resources.py
View file @
503b5c02
...
...
@@ -10,11 +10,11 @@ class Instance:
ssh_keys
=
None
console_access_url
=
None
def
__init__
(
self
,
id
,
name
,
resource
,
image_id
,
status
,
addresses
,
launched_at
,
terminated_at
,
disks
=
None
):
def
__init__
(
self
,
id
,
name
,
flavor
,
image_id
,
status
,
addresses
,
launched_at
,
terminated_at
,
disks
=
None
):
self
.
id
=
id
self
.
name
=
name
self
.
resource
=
resource
self
.
flavor
=
flavor
self
.
image
=
image_id
self
.
disks
=
disks
self
.
status
=
status
...
...
@@ -34,6 +34,20 @@ class Flavor:
self
.
vcpus
=
vcpus
self
.
initial_disk
=
disk
def
JSON
(
self
):
return
json
.
dumps
(
self
.
__dict__
)
class
Volume
:
pass
class
BlockDeviceMapping
:
def
__init__
(
self
,
boot_index
,
uuid
,
source_type
,
volume_size
,
destination_type
,
delete_on_termination
,
disk_bus
):
self
.
boot_index
=
boot_index
self
.
uuid
=
uuid
self
.
source_type
=
source_type
self
.
volume_size
=
volume_size
self
.
destination_type
=
destination_type
self
.
delete_on_termination
=
delete_on_termination
self
.
disk_bus
=
disk_bus
def
JSON
(
self
):
return
json
.
dumps
(
self
.
__dict__
)
This diff is collapsed.
Click to expand it.
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