def delete(self, request, *args, **kwargs): """Delete environment.""" obj_ids = kwargs['obj_ids'].split(';') facade.delete_environment(obj_ids) return Response({}, status=status.HTTP_200_OK)
def delete(self, request, *args, **kwargs): """Delete environment.""" obj_ids = kwargs['obj_ids'].split(';') facade.delete_environment(obj_ids) return Response({}, status=status.HTTP_200_OK)
def delete(self, request, *args, **kwargs): """ Delete environment """ env_ids = kwargs['environment_ids'].split(';') response = {} facade.delete_environment(env_ids) return CustomResponse(response, status=status.HTTP_200_OK, request=request)
vlans_ids = models_vlan.Vlan.objects.filter( nome__icontains=rack.nome).values_list('id', flat=True) log.debug("rack vlan. Qtd: %s - VLans: %s" % (str(len(vlans_ids)), str(vlans_ids))) for idt in vlans_ids: try: facade_vlan_v3.delete_vlan(idt) except (models_vlan.VlanError, models_vlan.VlanErrorV3, ValidationAPIException, ObjectDoesNotExistException, Exception, NetworkAPIException), e: error_vlans.append({'vlan_id': idt, 'error': e}) try: facade_env.delete_environment(envs_ids) except (models_env.AmbienteUsedByEquipmentVlanError, models_env.AmbienteError, Exception), e: error_envs.append({'env_error': e}) if error_vlans: log.debug("Vlans não removidas: %s" % str(error_vlans)) raise Exception("Vlans não removidas: %s" % str(error_vlans)) if error_envs: log.debug("Envs não removidos: %s" % str(error_envs)) raise Exception("Envs não removidos: %s" % str(error_envs)) rack.del_rack() def _buscar_roteiro(id_sw, tipo):
log.debug("rack vlan. Qtd: %s - VLans: %s" % (str(len(vlans_ids)), str(vlans_ids))) for idt in vlans_ids: try: facade_vlan_v3.delete_vlan(idt) except (models_vlan.VlanError, models_vlan.VlanErrorV3, ValidationAPIException, ObjectDoesNotExistException, Exception, NetworkAPIException), e: error_vlans.append({'vlan_id': idt, 'error': e}) try: facade_env.delete_environment(envs_ids) except (models_env.AmbienteUsedByEquipmentVlanError, models_env.AmbienteError, Exception), e: error_envs.append({'env_error': e}) if error_vlans: log.debug("Vlans não removidas: %s" % str(error_vlans)) raise Exception("Vlans não removidas: %s" % str(error_vlans)) if error_envs: log.debug("Envs não removidos: %s" % str(error_envs)) raise Exception("Envs não removidos: %s" % str(error_envs)) rack.del_rack() def _buscar_roteiro(id_sw, tipo):