Restart a service
        Usage:
            > restart_service <service>
547877
def do_restart_service(self, service):
        
        if not self.has_cluster():
            return None

        if self.service_action(service=service, action="restart"):
            print("%s is being restarted" % (service))
        else:
            print("Error restarting service")
            return None
271026
def restart(self, instance_id):
        
        try:
            if not self._paused:
                log.debug("node %s is not paused, can't restart", instance_id)
                return
            self._paused = False
            result = self._subscription._sms.start_role(
                service_name=self._cloud_service._name,
                deployment_name=self._cloud_service._name,
                role_name=instance_id)
            self._subscription._wait_result(result)
        except Exception as exc:
            log.error('error restarting instance %s: %s', instance_id, exc)
            raise
        log.debug('restarted instance(instance_id=%s)', instance_id)
221847
def start(self, service):
        
        try:
            map(self.start_class, service.depends)
            if service.is_running():
                return
            if service in self.failed:
                log.warning("%s previously failed to start", service)
                return
            service.start()
        except Exception:
            log.exception("Unable to start service %s", service)
            self.failed.add(service)
125304
def do_start_service(self, service):
        
        if not self.has_cluster():
            return None

        if self.service_action(service=service, action="start"):
            print("%s is being started" % (service))
        else:
            print("Error starting service")
            return None
80917
def restart(self, start_from=1, occupied=[]):
        

        # initial ID
        self.top = start_from - 1

        # occupied IDs
        self._occupied = sorted(occupied, key=lambda x: x[0])

        # main dictionary storing the mapping from objects to variable IDs
        self.obj2id = collections.defaultdict(lambda: self._next())

        # mapping back from variable IDs to objects
        # (if for whatever reason necessary)
        self.id2obj = {}
170440
def service_restart(name):
    '''
    
    '''
    cmd = 'restart ' + name

    # Send the command to execute
    out, err = DETAILS['server'].sendline(cmd)

    # "scrape" the output and return the right fields as a dict
    return parse(out)
107768
def restart(job_label, runas=None):
    '''
    
    '''
    stop(job_label, runas=runas)
    return start(job_label, runas=runas)
1169088
def resume_all(self):
        """"""
        for alias, service in self._service_objects.items():
            with expects.expect_no_raises(
                    'Failed to pause service "%s".' % alias):
                service.resume()
471185
def start(name):
    '''
    
    '''
    if _service_is_upstart(name):
        cmd = 'start {0}'.format(name)
    else:
        cmd = '/sbin/service {0} start'.format(name)
    return not __salt__['cmd.retcode'](cmd, python_shell=False)
1228404
async def restart(request: web.Request) -> web.Response:
    
    session = session_from_request(request)
    if session and session.stage != Stages.READY_FOR_RESTART:
        return web.json_response(
            data={'error': 'not-ready',
                  'message': 'System is not ready to restart '
                  f'(currently {session.stage.value.short})'},
            status=409)

    asyncio.get_event_loop().call_later(1, dbus_actions.restart)
    return web.json_response({'message': 'Restarting in 1s'},
                             status=200)
899950
def start_service(conn, service='ceph'):
    
    if is_systemd(conn):
        remoto.process.run(
            conn,
            [
                'systemctl',
                'start',
                '{service}'.format(service=service),
            ]
        )
1015879
def restartservices(member_order="SEQUENTIALLY",
      restart_option="RESTART_IF_NEEDED",
      sequential_delay=15,
      service_option="DHCP")

      post_body = {
        :member_order =>      member_order,
        :restart_option =>    restart_option,
        :sequential_delay =>  sequential_delay.to_i,
        :service_option =>    service_option
      }
      JSON.parse(connection.post(resource_uri + "?_function=restartservices", post_body).body);
    end
738452
async def restart(self):
        '''
        
        '''
        params = {}
        if self.owner_access_key:
            params['owner_access_key'] = self.owner_access_key
        rqst = Request(self.session,
                       'PATCH', '/kernel/{}'.format(self.kernel_id),
                       params=params)
        async with rqst.fetch():
            pass
599178
public static br_restart restart(nitro_service client, br_restart resource) throws Exception
	{
		return ((br_restart[]) resource.perform_operation(client, "restart"))[0];
	}
287369
def restart(self):
        
        command = const.CMD_RESTART
        cmd_response = self.__send_command(command)
        if cmd_response.get('status'):
            self.is_connect = False
            self.next_uid = 1
            return True
        else:
            raise ZKErrorResponse("can't restart device")
706498
def restart(self):
        """"""
        yield from self.manager.query("POST", "containers/{}/restart".format(self._cid))
        log.info("Docker container '{name}' [{image}] restarted".format(
            name=self._name, image=self._image))
603551
def restart_user(self, subid):
    ''''''
    p = self.revoke_token(subid)
    p = self.refresh_token(subid)
    return p