Scott Baker | c0ec1d8 | 2015-01-25 11:49:56 -0800 | [diff] [blame] | 1 | from view_common import * |
| 2 | from core.xoslib.objects.sliceplus import SlicePlus |
| 3 | |
Scott Baker | a488735 | 2015-01-25 17:05:14 -0800 | [diff] [blame^] | 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 | |
Scott Baker | c0ec1d8 | 2015-01-25 11:49:56 -0800 | [diff] [blame] | 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 | |
Scott Baker | c0ec1d8 | 2015-01-25 11:49:56 -0800 | [diff] [blame] | 17 | return HttpResponse(slice.getSliceInfo()["sshCommands"], content_type='text/text') |
| 18 | |