def reinstall(request, cluster_slug, instance): new_operating_system = request.POST.get('operating_system', 'none') user = request.user action = notifyuseradvancedactions( user, cluster_slug, instance, action_id=1, action_value=None, new_operating_system=new_operating_system) return HttpResponse(json.dumps(action))
def rename_instance( request, cluster_slug, instance, action_id, action_value=None ): user = request.user form = InstanceRenameForm(request.POST or None) if form.is_valid(): data = form.cleaned_data action_value = data['hostname'] action = notifyuseradvancedactions( user, cluster_slug, instance, action_id, action_value, None ) return HttpResponse(json.dumps(action)) else: return render( request, 'instances/rename_instance.html', { 'form': form, 'instance': instance, 'cluster_slug': cluster_slug } )
def destroy(request, cluster_slug, instance): user = request.user action = notifyuseradvancedactions(user, cluster_slug, instance, action_id=2, action_value=None, new_operating_system=None) return HttpResponse(json.dumps(action))
def reinstalldestroy(request, cluster_slug, instance, action_id, action_value=None): new_operating_system = request.POST.get('operating_system', 'none') or None user = request.user action = notifyuseradvancedactions(user, cluster_slug, instance, action_id, action_value, new_operating_system) return HttpResponse(json.dumps(action))
def rename_instance(request, cluster_slug, instance, action_id, action_value=None): user = request.user form = InstanceRenameForm(request.POST or None) if form.is_valid(): data = form.cleaned_data action_value = data["hostname"] action = notifyuseradvancedactions(user, cluster_slug, instance, action_id, action_value, None) return HttpResponse(json.dumps(action)) else: return render( request, "instances/rename_instance.html", {"form": form, "instance": instance, "cluster_slug": cluster_slug}, )
def rename_instance(request, cluster_slug, instance): user = request.user form = InstanceRenameForm(request.POST or None) if form.is_valid(): data = form.cleaned_data action = notifyuseradvancedactions(user, cluster_slug, instance, action_id=3, action_value=data['hostname'], new_operating_system=None) return HttpResponse(json.dumps(action)) else: return render(request, 'instances/rename_instance.html', { 'form': form, 'instance': instance, 'cluster_slug': cluster_slug })
def destroy(request, cluster_slug, instance): user = request.user action = notifyuseradvancedactions( user, cluster_slug, instance, action_id=2, action_value=None, new_operating_system=None) return HttpResponse(json.dumps(action))
def reinstalldestroy(request, cluster_slug, instance, action_id, action_value=None): new_operating_system = request.POST.get("operating_system", "none") or None user = request.user action = notifyuseradvancedactions(user, cluster_slug, instance, action_id, action_value, new_operating_system) return HttpResponse(json.dumps(action))