Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
5
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ac664c40
authored
2 years ago
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get instance pk
parent
28bda55b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletions
+12
-1
circle/dashboard/urls.py
+2
-1
circle/dashboard/views/vm.py
+10
-0
No files found.
circle/dashboard/urls.py
View file @
ac664c40
...
...
@@ -56,7 +56,7 @@ from .views import (
NodeActivityView
,
UserList
,
TemplateREST
,
LeaseREST
,
DiskRest
,
InstanceREST
,
InterfaceREST
,
InstanceFromTemplateREST
,
InstanceFTforUsersREST
,
DownloadDiskREST
,
DownloadDiskREST
,
GetInstanceREST
,
StorageDetail
,
DiskDetail
,
MessageList
,
MessageDetail
,
MessageCreate
,
MessageDelete
,
EnableTwoFactorView
,
DisableTwoFactorView
,
...
...
@@ -68,6 +68,7 @@ from .views.vm import vm_ops, vm_mass_ops
urlpatterns
=
[
path
(
'acpi/vm/'
,
InstanceREST
.
as_view
()),
path
(
'acpi/vm/<int:pk>/'
,
GetInstanceREST
.
as_view
()),
path
(
'acpi/template/'
,
TemplateREST
.
as_view
()),
path
(
'acpi/ft/'
,
InstanceFromTemplateREST
.
as_view
()),
path
(
'acpi/lease/'
,
LeaseREST
.
as_view
()),
...
...
This diff is collapsed.
Click to expand it.
circle/dashboard/views/vm.py
View file @
ac664c40
...
...
@@ -107,6 +107,16 @@ class InterfaceREST(APIView):
return
JsonResponse
({
'interfaces'
:
serializer
.
data
},
safe
=
False
)
class
GetInstanceREST
(
APIView
):
authentication_classes
=
[
TokenAuthentication
,
BasicAuthentication
]
permission_classes
=
[
IsAdminUser
]
def
get
(
self
,
request
,
pk
,
format
=
None
):
template
=
Instance
.
objects
.
get
(
pk
=
pk
)
serializer
=
InstanceSerializer
(
template
,
many
=
False
)
return
JsonResponse
(
serializer
.
data
,
safe
=
False
)
class
InstanceREST
(
APIView
):
authentication_classes
=
[
TokenAuthentication
,
BasicAuthentication
]
permission_classes
=
[
IsAdminUser
]
...
...
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