download_ssh_commands view, deprecated
[plstackapi.git] / planetstack / core / dashboard / views / download_ssh_commands.py
1 from view_common import *
2 from core.xoslib.objects.sliceplus import SlicePlus
3
4 # This was intended to serve as a download feature for the tenant view. Found
5 # a better way to do it. This is deprecated.
6
7 class DownloadSSHCommandsView(View):
8     url = r'^sshcommands/(?P<sliceid>\d+)/$'
9
10     def get(self, request, sliceid=None, **kwargs):
11         #slice = Slices.objects.get(id=sliceid);
12         #for sliver in slice.slivers.all():
13         #    if (sliver.instance_id && sliver.instance_name):
14
15         slice = SlicePlus.objects.get(id=sliceid)
16
17         return HttpResponse(slice.getSliceInfo()["sshCommands"], content_type='text/text')
18