Update the spec of a node.

        Args:
            node_id: The ID or name of the node
            version: version number of the node being updated
            spec: fields to be updated
181122
async def update(
        self, *, node_id: str, version: int, spec: Mapping[str, Any]
    ) -> Mapping[str, Any]:
        

        params = {"version": version}

        if "Role" in spec:
            assert spec["Role"] in {"worker", "manager"}

        if "Availability" in spec:
            assert spec["Availability"] in {"active", "pause", "drain"}

        response = await self.docker._query_json(
            "nodes/{node_id}/update".format(node_id=node_id),
            method="POST",
            params=params,
            data=spec,
        )
        return response
32356
def version(self, id, expand=None):
        
        version = Version(self._options, self._session)
        params = {}
        if expand is not None:
            params['expand'] = expand
        version.find(id, params=params)
        return version
873839
def update(self, ng_template_id, name=NotUpdated, plugin_name=NotUpdated,
               plugin_version=NotUpdated, flavor_id=NotUpdated,
               description=NotUpdated, volumes_per_node=NotUpdated,
               volumes_size=NotUpdated, node_processes=NotUpdated,
               node_configs=NotUpdated, floating_ip_pool=NotUpdated,
               security_groups=NotUpdated, auto_security_group=NotUpdated,
               availability_zone=NotUpdated,
               volumes_availability_zone=NotUpdated, volume_type=NotUpdated,
               image_id=NotUpdated, is_proxy_gateway=NotUpdated,
               volume_local_to_instance=NotUpdated, use_autoconfig=NotUpdated,
               shares=NotUpdated, is_public=NotUpdated,
               is_protected=NotUpdated, volume_mount_prefix=NotUpdated,
               boot_from_volume=NotUpdated,
               boot_volume_type=NotUpdated,
               boot_volume_availability_zone=NotUpdated,
               boot_volume_local_to_instance=NotUpdated):
        """"""

        data = {}
        self._copy_if_updated(
            data, name=name, plugin_name=plugin_name,
            plugin_version=plugin_version, flavor_id=flavor_id,
            description=description, volumes_per_node=volumes_per_node,
            volumes_size=volumes_size, node_processes=node_processes,
            node_configs=node_configs, floating_ip_pool=floating_ip_pool,
            security_groups=security_groups,
            auto_security_group=auto_security_group,
            availability_zone=availability_zone,
            volumes_availability_zone=volumes_availability_zone,
            volume_type=volume_type, image_id=image_id,
            is_proxy_gateway=is_proxy_gateway,
            volume_local_to_instance=volume_local_to_instance,
            use_autoconfig=use_autoconfig, shares=shares,
            is_public=is_public, is_protected=is_protected,
            volume_mount_prefix=volume_mount_prefix,
            boot_from_volume=boot_from_volume,
            boot_volume_type=boot_volume_type,
            boot_volume_availability_zone=boot_volume_availability_zone,
            boot_volume_local_to_instance=boot_volume_local_to_instance
        )

        return self._patch('/node-group-templates/%s' % ng_template_id, data,
                           'node_group_template')
12510
def update(cls, cluster_id_label, cluster_info):
        
        conn = Qubole.agent(version="v2")
        return conn.put(cls.element_path(cluster_id_label), data=cluster_info)
507961
def update_node_ids(self, sub_job_num=None):
        
        # Build condor_q and condor_history commands
        dag_id = '%s.%s' % (self.cluster_id, sub_job_num) if sub_job_num else str(self.cluster_id)
        job_delimiter = '+++'
        attr_delimiter = ';;;'

        format = [
            '-format', '"%d' + attr_delimiter + '"', 'ClusterId',
            '-format', '"%v' + attr_delimiter + '"', 'Cmd',
            '-format', '"%v' + attr_delimiter + '"', 'Args',     # Old way
            '-format', '"%v' + job_delimiter + '"', 'Arguments'  # New way
        ]
        # Get ID, Executable, and Arguments for each job that is either started to be processed or finished in the workflow
        cmd = 'condor_q -constraint DAGManJobID=={0} {1} && condor_history -constraint DAGManJobID=={0} {1}'.format(dag_id, ' '.join(format))

        # 'condor_q -constraint DAGManJobID==1018 -format "%d\n" ClusterId -format "%s\n" CMD -format "%s\n" ARGS && condor_history -constraint DAGManJobID==1018 -format "%d\n" ClusterId -format "%s\n" CMD -format "%s\n" ARGS'
        _args = [cmd]
        out, err = self._execute(_args, shell=True, run_in_job_dir=False)

        if err:
            log.error('Error while associating ids for jobs dag %s: %s', dag_id, err)
            raise HTCondorError(err)
        if not out:
            log.warning('Error while associating ids for jobs in dag %s: No jobs found for dag.', dag_id)

        try:
            # Split into one line per job
            jobs_out = out.split(job_delimiter)

            # Match node to cluster id using combination of cmd and arguments
            for node in self._node_set:
                job = node.job

                # Skip jobs that already have cluster id defined
                if job.cluster_id != job.NULL_CLUSTER_ID:
                    continue

                for job_out in jobs_out:
                    if not job_out or attr_delimiter not in job_out:
                        continue

                    # Split line by attributes
                    cluster_id, cmd, _args, _arguments = job_out.split(attr_delimiter)

                    # If new form of arguments is used, _args will be 'undefined' and _arguments will not
                    if _args == 'undefined' and _arguments != 'undefined':
                        args = _arguments.strip()

                    # If both are undefined, then there are no arguments
                    elif _args == 'undefined' and _arguments == 'undefined':
                        args = None

                    # Otherwise, using old form and _arguments will be 'undefined' and _args will not.
                    else:
                        args = _args.strip()

                    job_cmd = job.executable
                    job_args = job.arguments.strip() if job.arguments else None

                    if job_cmd in cmd and job_args == args:
                        log.info('Linking cluster_id %s to job with command and arguments: %s %s', cluster_id,
                                  job_cmd, job_args)
                        job._cluster_id = int(cluster_id)
                        break

        except ValueError as e:
            log.warning(str(e))
210882
def update_node(cls, cluster_id_label, command, private_dns, parameters=None):
        
        conn = Qubole.agent(version=Cluster.api_version)
        parameters = {} if not parameters else parameters
        data = {"command" : command, "private_dns" : private_dns, "parameters" : parameters}
        return conn.put(cls.element_path(cluster_id_label) + "/nodes", data)
909901
def update(self, id, data):
        
        id = self.as_id(id)
        response = self.http.patch(
            '%s/%s' % (self, id), json=data, auth=self.auth
        )
        response.raise_for_status()
        return response.json()
131013
def apply(self, node):
        
        new_node = self.run(node)
        return self.update, new_node
1043611
def ID(self, ID):
        
        ret = libxml2mod.xmlGetID(self._o, ID)
        if ret is None:raise treeError('xmlGetID() failed')
        __tmp = xmlAttr(_obj=ret)
        return __tmp
768138
def update_all_nodes(self):
        
        item_model_controller = self.item_model_controller
        if item_model_controller:
            if self.__node_counts_dirty:
                for item in self.__mapping.values():
                    if "tree_node" in item.data:  # don't update the root node
                        tree_node = item.data["tree_node"]
                        item.data["display"] = self.__display_for_tree_node(tree_node)
                        item_model_controller.data_changed(item.row, item.parent.row, item.parent.id)
                self.__node_counts_dirty = False
950896
def add_node(self, node_id, name, labels):
        
        node = self.graph_db.get_or_create_indexed_node('Node', 'node_id', node_id, {'node_id': node_id, 'name': name})
        try:
            node.add_labels(*labels)
        except NotImplementedError:
            pass
598322
def update_attributes(self, id, old_attrs, new_attrs):
        
        update = dict()
        set_value = {'attributes.' + k: v for k, v in new_attrs.items() if v is not None}
        if set_value:
            update['$set'] = set_value
        unset_value = {'attributes.' + k: v for k, v in new_attrs.items() if v is None}
        if unset_value:
            update['$unset'] = unset_value

        if update:
            response = self.get_db().alerts.update_one({'_id': {'$regex': '^' + id}}, update=update)
            return response.matched_count > 0
946447
public void updateNode (NodeRecord record)
    {
        record.lastUpdated = new Timestamp(System.currentTimeMillis());
        store(record);
    }
1348556
def update(self, document_id, update_spec, namespace, timestamp):
        

        index, doc_type = self._index_and_mapping(namespace)
        with self.lock:
            # Check if document source is stored in local buffer
            document = self.BulkBuffer.get_from_sources(index,
                                                        doc_type,
                                                        u(document_id))
        if document:
            # Document source collected from local buffer
            # Perform apply_update on it and then it will be
            # ready for commiting to Elasticsearch
            updated = self.apply_update(document, update_spec)
            # _id is immutable in MongoDB, so won't have changed in update
            updated['_id'] = document_id
            self.upsert(updated, namespace, timestamp)
        else:
            # Document source needs to be retrieved from Elasticsearch
            # before performing update. Pass update_spec to upsert function
            updated = {"_id": document_id}
            self.upsert(updated, namespace, timestamp, update_spec)
        # upsert() strips metadata, so only _id + fields in _source still here
        return updated
983116
def get_node_details(self, node_id: list) -> dict:
        
        # Raise an exception if we are not a manager
        if not self._manager:
            raise RuntimeError('Only the Swarm manager node can '
                               'retrieve node details.')

        node = self._client.nodes.get(node_id)
        return node.attrs
99071
def update_node_with_values(node, updates, merge = false)
      updated = []

      # merge the normal attributes (but not tags)
      updated << 'normal' if update_attrs(node, updates['normal'], merge)

      # update runlist
      updated << 'run_list' if update_runlist(node, updates['run_list'])

      # update chef env
      if update_chef_env(node, updates['chef_environment'])
        updated << 'chef_environment'
      end

      # merge tags
      updated << 'tags' if update_tags(node, updates['tags'])

      # return false if no updates, else return array of property names
      !updated.empty? && updated
    end
1207609
def update(self, tag_id, name):
        
        name = to_text(name)
        return self._post(
            'tags/update',
            data={
                'tag': {
                    'id': int(tag_id),
                    'name': name
                }
            }
        )