Start a verification for a Cluster.
772646
def verification_update(self, cluster_id, status):
        """"""
        data = {'verification': {'status': status}}
        return self._patch("/clusters/%s" % cluster_id, data)
921500
def verify_create(self, recipient, params=None):
        """"""
        if params is None: params = {}
        params.update({'recipient': recipient})
        return Verify().load(self.request('verify', 'POST', params))
1220586
def do_start_cluster(self, cluster):
        
        try:
            cluster = api.get_cluster(cluster)
            cluster.start()
            print("Starting Cluster")
        except ApiException:
            print("Cluster not found")
            return None
165858
def _put_cluster(self, dic, params=None):
    """"""
    cluster = self._put('', ApiCluster, data=dic, params=params)
    self._update(cluster)
    return self
674596
public void verify() throws VerificationException {
        final Transaction fromTx = getOutpoint().fromTx;
        long spendingIndex = getOutpoint().getIndex();
        checkNotNull(fromTx, "Not connected");
        final TransactionOutput output = fromTx.getOutput((int) spendingIndex);
        verify(output);
    }
309812
def add_cluster(
        self, 
        name, 
        server=None,
        certificate_authority_data=None,
        **attrs):
        """"""
        if self.cluster_exists(name):
            raise KubeConfError("Cluster with the given name already exists.")

        clusters = self.get_clusters()
        
        # Add parameters.
        new_cluster = {'name': name, 'cluster':{}}
        attrs_ = new_cluster['cluster']
        if server is not None:
            attrs_['server'] = server
        if certificate_authority_data is not None:
            attrs_['certificate-authority-data'] = certificate_authority_data

        attrs_.update(attrs)
        clusters.append(new_cluster)
8380
def start(self):
        """"""
        super().start()
        self.__poller = zmq.asyncio.Poller()
        self.__poller.register(self.zap_socket, zmq.POLLIN)
        self.__task = asyncio.ensure_future(self.__handle_zap())
728208
def verify(self, connection_type=None):
        
        req_body = self._cli.make_body(connectionType=connection_type)

        resp = self.action('verify', **req_body)
        resp.raise_if_err()
        return resp
823125
@Validate
    public void start() {
        metrics.register("executors", new MetricSet() {
            @Override
            public Map<String, Metric> getMetrics() {
                return ImmutableMap.<String, Metric>of(
                        "executors.count", new Gauge<Integer>() {
                            @Override
                            public Integer getValue() {
                                return getExecutors().length;
                            }
                        },
                        "schedulers.count", new Gauge<Integer>() {

                            @Override
                            public Integer getValue() {
                                return getSchedulers().length;
                            }
                        },
                        "hung.count", new Gauge<Integer>() {

                            @Override
                            public Integer getValue() {
                                return getHungTasks();
                            }
                        },
                        "completed.count", new Gauge<Integer>() {

                            @Override
                            public Integer getValue() {
                                return getCompletedTasks();
                            }
                        }
                );
            }
        });

        for (ManagedExecutorService service : executors) {
            metrics.register(service.name(), metricsForExecutor(service));
        }

        for (ManagedExecutorService service : schedulers) {
            metrics.register(service.name(), metricsForExecutor(service));
        }
    }
969649
def verify(self, data, signature=None, keyrings=None, homedir=None):
        '''
        
        '''

        if isinstance(data, six.text_type):
            data = data.encode('utf-8')

        tmpdir = tempfile.mkdtemp()
        data_file, data_path = tempfile.mkstemp(dir=tmpdir)
        data_file = os.fdopen(data_file, 'wb')
        data_file.write(data)
        data_file.close()
        if signature:
            sig_file, sig_path = tempfile.mkstemp(dir=tmpdir)
            sig_file = os.fdopen(sig_file, 'wb')
            sig_file.write(signature)
            sig_file.close()
        else:
            sig_path = None
        try:
            return self.verify_from_file(
                data_path,
                sig_path=sig_path,
                keyrings=keyrings,
                homedir=homedir
            )
        finally:
            shutil.rmtree(tmpdir)
415068
def start(self):
        """"""
        if not self._started:
            self.sig_started.emit(self)
            self._started = True
1248008
def verify(verified_entity, verification_key):
        
        verification = get_object_or_none(Verification, verified_entity=verified_entity)

        if verification is None:
            raise ServerError(VerificationHandler.STATUS_VERIFICATION_NOT_FOUND)
        if not verification.verify(verification_key):
            raise ServerError(VerificationHandler.STATUS_INVALID_VERIFICATION_KEY)

        verification.verified = True
        verification.save()
1006619
def __verify_job_has_started(self):
        """"""
        # Verify that the job started
        self.__get_job()

        # Verify that the pod started
        pods = self.__get_pods()

        assert len(pods) > 0, "No pod scheduled by " + self.uu_name
        for pod in pods:
            status = pod.obj['status']
            for cont_stats in status.get('containerStatuses', []):
                if 'terminated' in cont_stats['state']:
                    t = cont_stats['state']['terminated']
                    err_msg = "Pod %s %s (exit code %d). Logs: `kubectl logs pod/%s`" % (
                        pod.name, t['reason'], t['exitCode'], pod.name)
                    assert t['exitCode'] == 0, err_msg

                if 'waiting' in cont_stats['state']:
                    wr = cont_stats['state']['waiting']['reason']
                    assert wr == 'ContainerCreating', "Pod %s %s. Logs: `kubectl logs pod/%s`" % (
                        pod.name, wr, pod.name)

            for cond in status.get('conditions', []):
                if 'message' in cond:
                    if cond['reason'] == 'ContainersNotReady':
                        return False
                    assert cond['status'] != 'False', \
                        "[ERROR] %s - %s" % (cond['reason'], cond['message'])
        return True
863254
def init(self, **settings):
        """"""
        if self.get_status() != 'not-initialized':
            raise ClusterError(
                'cluster in {!r} has already been initialized'.format(
                    self._data_dir))

        if settings:
            settings_args = ['--{}={}'.format(k, v)
                             for k, v in settings.items()]
            extra_args = ['-o'] + [' '.join(settings_args)]
        else:
            extra_args = []

        process = subprocess.run(
            [self._pg_ctl, 'init', '-D', self._data_dir] + extra_args,
            stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

        output = process.stdout

        if process.returncode != 0:
            raise ClusterError(
                'pg_ctl init exited with status {:d}:\n{}'.format(
                    process.returncode, output.decode()))

        return output.decode()
1219533
def update_cluster(cluster_ref, cluster_spec):
    '''
    
    '''
    cluster_name = get_managed_object_name(cluster_ref)
    log.trace('Updating cluster \'%s\'', cluster_name)
    try:
        task = cluster_ref.ReconfigureComputeResource_Task(cluster_spec,
                                                           modify=True)
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(
            'Not enough permissions. Required privilege: '
            '{}'.format(exc.privilegeId))
    except vim.fault.VimFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(exc.msg)
    except vmodl.RuntimeFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareRuntimeError(exc.msg)
    wait_for_task(task, cluster_name, 'ClusterUpdateTask')
1235302
public static void validateInterimFinalCluster(final Cluster interimCluster,
                                                   final Cluster finalCluster) {
        validateClusterPartitionCounts(interimCluster, finalCluster);
        validateClusterZonesSame(interimCluster, finalCluster);
        validateClusterNodeCounts(interimCluster, finalCluster);
        validateClusterNodeState(interimCluster, finalCluster);
        return;
    }
654784
private void verifyNodeStarted() {
        NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
        nodeStartCompleted = nodeEngine.getNode().getNodeExtension().isStartCompleted();
        if (!nodeStartCompleted) {
            throw new IllegalStateException("Migration operation is received before startup is completed. "
                    + "Sender: " + getCallerAddress());
        }
    }