Reboot an instance

REST: POST /cloud/project/{serviceName}/instance/{instanceId}/reboot
@param instanceId [required] Instance id
@param serviceName [required] Service name
@param type [required] Reboot type (default soft)
515890
public void project_serviceName_instance_instanceId_reboot_POST(String serviceName, String instanceId, OvhRebootTypeEnum type) throws IOException {
		String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/reboot";
		StringBuilder sb = path(qPath, serviceName, instanceId);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "type", type);
		exec(qPath, "POST", sb.toString(), o);
	}
1162679
public static mps reboot(nitro_service client, mps resource) throws Exception
	{
		return ((mps[]) resource.perform_operation(client, "reboot"))[0];
	}
217770
def reboot(name, call=None):
    '''
    
    '''

    if call != 'action':
        raise SaltCloudException(
            'The reboot action must be called with -a or --action.'
        )

    local = salt.client.LocalClient()
    return local.cmd(name, 'system.reboot')
286237
public static br[] reboot(nitro_service client, br[] resources) throws Exception
	{
		if(resources == null)
			throw new Exception("Null resource array");
		
		if(resources.length == 1)
			return ((br[]) resources[0].perform_operation(client, "reboot"));
		
		return ((br[]) perform_operation_bulk_request(client, resources, "reboot"));
	}
1258485
public void setServiceType(java.util.Collection<ServiceTypeDetail> serviceType) {
        if (serviceType == null) {
            this.serviceType = null;
            return;
        }

        this.serviceType = new com.amazonaws.internal.SdkInternalList<ServiceTypeDetail>(serviceType);
    }
634820
public OperationFuture<List<Server>> reboot(ServerFilter serverFilter) {
        List<Server> serverList = findServers(serverFilter);

        return powerOperationResponse(
            serverList,
            "Reboot",
            client.reboot(ids(serverList))
        );
    }
1172274
public static <X> ServiceTypeLoader<X> load(Class<X> serviceType) {
        return load(serviceType, Thread.currentThread().getContextClassLoader());
    }
238383
def reboot(id, recovery=false)
      response = request(:post, "/virtual_machines/#{id}/reboot.json", { query: recovery ? { mode: :recovery } : nil })
      response['virtual_machine']
    end
948583
public void updateServiceInstanceInternalStatus(String serviceName, String instanceId, OperationalStatus status){
        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.UpdateServiceInstanceInternalStatus);

        UpdateServiceInstanceInternalStatusProtocol protocol = new UpdateServiceInstanceInternalStatusProtocol(serviceName, instanceId, status);
        connection.submitRequest(header, protocol, null);
    }
1217935
@RequestMapping(value = "/cloud/subnet/refresh", method = POST, consumes = APPLICATION_JSON_VALUE,
            produces = APPLICATION_JSON_VALUE)
    public ResponseEntity<Collection<String>> refreshInstances(
            @Valid @RequestBody CloudInstanceListRefreshRequest request) {
        return ResponseEntity.ok().body(cloudSubnetService.refreshSubnets(request));
    }
603900
public void project_serviceName_storage_containerId_PUT(String serviceName, String containerId, OvhTypeEnum containerType) throws IOException {
		String qPath = "/cloud/project/{serviceName}/storage/{containerId}";
		StringBuilder sb = path(qPath, serviceName, containerId);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "containerType", containerType);
		exec(qPath, "PUT", sb.toString(), o);
	}
170367
public void setReturnType(String type) {
		if (!Strings.isEmpty(type)
				&& !Objects.equals("void", type)
				&& !Objects.equals(Void.class.getName(), type)) {
			this.sarlAction.setReturnType(newTypeRef(container, type));
		} else {
			this.sarlAction.setReturnType(null);
		}
	}
586638
def reboot(name, conn=None):
    '''
    
    '''
    if not conn:
        conn = get_conn()   # pylint: disable=E0602

    node = get_node(conn, name)
    if node is None:
        log.error('Unable to find the VM %s', name)
    log.info('Rebooting VM: %s', name)
    ret = conn.reboot_node(node)
    if ret:
        log.info('Rebooted VM: %s', name)
        # Fire reboot action
        __utils__['cloud.fire_event'](
            'event',
            '{0} has been rebooted'.format(name), 'salt-cloud'
            'salt/cloud/{0}/rebooting'.format(name),
            args={'name': name},
            sock_dir=__opts__['sock_dir'],
            transport=__opts__['transport']
        )
        return True

    log.error('Failed to reboot VM: %s', name)
    return False
283890
def reboot(env, identifier, hard):
    """"""

    virtual_guest = env.client['Virtual_Guest']
    mgr = SoftLayer.HardwareManager(env.client)
    vs_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'VS')
    if not (env.skip_confirmations or
            formatting.confirm('This will reboot the VS with id %s. '
                               'Continue?' % vs_id)):
        raise exceptions.CLIAbort('Aborted.')

    if hard is True:
        virtual_guest.rebootHard(id=vs_id)
    elif hard is False:
        virtual_guest.rebootSoft(id=vs_id)
    else:
        virtual_guest.rebootDefault(id=vs_id)
495481
public static ns reboot(nitro_service client, ns resource) throws Exception
	{
		return ((ns[]) resource.perform_operation(client, "reboot"))[0];
	}
1297513
public static xen[] reboot(nitro_service client, xen[] resources) throws Exception
	{
		if(resources == null)
			throw new Exception("Null resource array");
		
		if(resources.length == 1)
			return ((xen[]) resources[0].perform_operation(client, "reboot"));
		
		return ((xen[]) perform_operation_bulk_request(client, resources, "reboot"));
	}
832419
def recall_service(self, service):
        
        if not isinstance(service, Service):
            raise TypeError("service must be of type Service.")

        logger.warning("The deployment for {0} on {1} failed starting the rollback.".format(service.alias, self.url.geturl()))

        def anonymous(anonymous_service):
            if not isinstance(anonymous_service, Service):
                raise TypeError("service must be an instance of Service.")

            containers = self.find_previous_service_containers(anonymous_service)
            if containers:
                for name in list(anonymous_service.containers.keys()):
                    del anonymous_service.containers[name]

                anonymous_service.cargo.delete()

                for name, container in six.iteritems(containers):
                    # TODO: add function to container obj to see if its running.
                    if container.state().get('running'):
                        logger.info(
                            "is already running... Might want to investigate.",
                            extra={'formatter': 'container', 'container': container.name}
                        )
                    else:
                        if container.start():
                            logger.info(
                                "is restarted and healthy.",
                                extra={'formatter': 'container', 'container': container.name}
                            )
                        else:
                            logger.error(
                                "failed to start.",
                                extra={'formatter': 'container', 'container': container.name}
                            )

                            container.dump_logs()
                            raise Exception(
                                "The deployment for {0} on {1} went horribly wrong".format(container.name, self.url.geturl())
                            )

        self._service_map(service, anonymous, descending=False)