def obj_create(self, bundle, **kwargs): request = bundle.request if "objects" in bundle.data: nids_data = bundle.data["objects"] else: nids_data = [bundle.data] for nid_data in nids_data: nid_data["network_interface"] = ( NetworkInterfaceResource().get_via_uri(nid_data["network_interface"], bundle.request).id ) command_id = JobSchedulerClient.update_nids(nids_data) try: command = Command.objects.get(pk=command_id) except ObjectDoesNotExist: command = None raise custom_response(self, request, http.HttpAccepted, {"command": dehydrate_command(command)})