Get available Restore Points

REST: GET /vps/{serviceName}/automatedBackup/restorePoints
@param state [required] The state of the restore point
@param serviceName [required] The internal name of your VPS offer
188671
public ArrayList<Date> serviceName_automatedBackup_restorePoints_GET(String serviceName, OvhRestoreStateEnum state) throws IOException {
		String qPath = "/vps/{serviceName}/automatedBackup/restorePoints";
		StringBuilder sb = path(qPath, serviceName);
		query(sb, "state", state);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t2);
	}
1361729
func (sc *stateCheckpoint) restoreState() error {
	sc.mux.Lock()
	defer sc.mux.Unlock()
	var err error

	// used when all parsing is ok
	tmpAssignments := make(ContainerCPUAssignments)
	tmpDefaultCPUSet := cpuset.NewCPUSet()
	tmpContainerCPUSet := cpuset.NewCPUSet()

	checkpoint := NewCPUManagerCheckpoint()
	if err = sc.checkpointManager.GetCheckpoint(sc.checkpointName, checkpoint); err != nil {
		if err == errors.ErrCheckpointNotFound {
			sc.storeState()
			return nil
		}
		return err
	}

	if sc.policyName != checkpoint.PolicyName {
		return fmt.Errorf("configured policy %q differs from state checkpoint policy %q", sc.policyName, checkpoint.PolicyName)
	}

	if tmpDefaultCPUSet, err = cpuset.Parse(checkpoint.DefaultCPUSet); err != nil {
		return fmt.Errorf("could not parse default cpu set %q: %v", checkpoint.DefaultCPUSet, err)
	}

	for containerID, cpuString := range checkpoint.Entries {
		if tmpContainerCPUSet, err = cpuset.Parse(cpuString); err != nil {
			return fmt.Errorf("could not parse cpuset %q for container id %q: %v", cpuString, containerID, err)
		}
		tmpAssignments[containerID] = tmpContainerCPUSet
	}

	sc.cache.SetDefaultCPUSet(tmpDefaultCPUSet)
	sc.cache.SetCPUAssignments(tmpAssignments)

	klog.V(2).Info("[cpumanager] state checkpoint: restored state from checkpoint")
	klog.V(2).Infof("[cpumanager] state checkpoint: defaultCPUSet: %s", tmpDefaultCPUSet.String())

	return nil
}
156173
public ServiceStatus getServiceStatus() {
        boolean canSendProbeRequest = !isHardTrip && lastFailure.get() > 0
            && allowRequest();

        if (byPass) {
            return new ServiceStatus(name, Status.DEGRADED, "Bypassed");
        }

        switch(state) {
            case OPEN:
                return (canSendProbeRequest ?
                        new ServiceStatus(name, Status.DEGRADED, "Send Probe Request")
                        : new ServiceStatus(name, Status.DOWN, "Open"));
            case HALF_CLOSED: return new ServiceStatus(name, Status.DEGRADED, "Half Closed");
            case CLOSED:
            default:
                return new ServiceStatus(name, Status.UP);
        }
    }
572349
def get_service_state_list() -> List[ServiceState]:
    """"""
    keys = DB.get_keys('states*')
    LOG.debug('Loading list of known services.')
    services = []
    for key in keys:
        values = key.split(':')
        if len(values) == 4:
            services.append(ServiceState(*values[1:4]))
    return services
677617
public URI getRedirectToFromState(final String state)
	{
		final String[] pieces = decodeState(state).split(" ", 2);

		if (!StringUtils.equals(callbackNonce, pieces[0]))
		{
			// The callback nonce is not what we expect; this is usually caused by:
			// - The user has followed a previous oauth callback entry from their history
			// - The user has accessed a service via a non-canonical endpoint and been redirected by the oauth server to the canonical one
			//   which means the original nonce stored in the session is not available to this session.

			// To get around this, we simply redirect the user to the root of this service so they can start the oauth flow again
			throw new LiteralRestResponseException(Response.seeOther(URI.create("/")).build());
		}

		if (pieces.length == 2)
			return URI.create(pieces[1]);
		else
			return null;
	}
1138885
def restore_backup(self, subid, backupid, params=None):
        ''' 
        '''
        params = update_params(params, {
            'SUBID': subid,
            'BACKUPID': backupid
        })
        return self.request('/v1/server/restore_backup', params, 'POST')
391798
public ArrayList<String> loadBalancing_serviceName_probeIp_GET(String serviceName, OvhLoadBalancingZoneEnum zone) throws IOException {
		String qPath = "/ip/loadBalancing/{serviceName}/probeIp";
		StringBuilder sb = path(qPath, serviceName);
		query(sb, "zone", zone);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t2);
	}
312754
def get_service_packages(self):
        """"""
        api = self._get_api(billing.DefaultApi)
        package_response = api.get_service_packages()
        packages = []
        for state in PACKAGE_STATES:
            # iterate states in order
            items = getattr(package_response, state) or []
            for item in ensure_listable(items):
                params = item.to_dict()
                params['state'] = state
                packages.append(ServicePackage(params))
        return packages
430608
public function retrieveAuthorizationState($service)
    {
        $service = $this->normalizeServiceName($service);

        if ($this->hasAuthorizationState($service)) {
            $states = $this->sessionScope->get(self::SESSION_STATE);
            return $states[$service];
        }

        throw new AuthorizationStateNotFoundException('State not found in session, are you sure you stored it?');
    }
631831
def clear_restore_points(self, name=None):
        '''
        '''
        if name is None:
            self.config_state.clear()
        else:
            del self.config_state[name]
665096
public OvhTask serviceName_restoreSnapshot_POST(String serviceName, net.minidev.ovh.api.hosting.web.backup.OvhTypeEnum backup) throws IOException {
		String qPath = "/hosting/web/{serviceName}/restoreSnapshot";
		StringBuilder sb = path(qPath, serviceName);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "backup", backup);
		String resp = exec(qPath, "POST", sb.toString(), o);
		return convertTo(resp, OvhTask.class);
	}
142058
public static String getStateKey(CmsResourceState state) {

        StringBuffer sb = new StringBuffer(STATE_PREFIX);
        sb.append(state);
        sb.append(STATE_POSTFIX);
        return sb.toString();

    }
1165401
def get_target_service_state(self, service_id: str):
        """"""
        state = self._get_service_state(service_id)
        return state.target_state
14337
@Override
    protected StateEpisode getStateEpisodeForState(IState state)
    {
        if (!(state instanceof ServerState))
            return null;

        ServerState sstate = (ServerState)state;
        switch (sstate)
        {
        case WAITING_FOR_MOD_READY:
            return new InitialiseServerModEpisode(this);
        case DORMANT:
            return new DormantEpisode(this);
        case BUILDING_WORLD:
            return new BuildingWorldEpisode(this);
        case WAITING_FOR_AGENTS_TO_ASSEMBLE:
            return new WaitingForAgentsEpisode(this);
        case RUNNING:
            return new RunningEpisode(this);
        case WAITING_FOR_AGENTS_TO_QUIT:
            return new WaitingForAgentsToQuitEpisode(this);
        case ERROR:
            return new ErrorEpisode(this);
        case CLEAN_UP:
            return new CleanUpEpisode(this);
        case MISSION_ENDED:
            return null;//new MissionEndedEpisode(this, MissionResult.ENDED);
        case MISSION_ABORTED:
            return null;//new MissionEndedEpisode(this, MissionResult.AGENT_QUIT);
        default:
            break;
        }
        return null;
    }
365218
public static String getTopicName(State state) {
    Preconditions.checkArgument(state.contains(KafkaSource.TOPIC_NAME),
        "Missing configuration property " + KafkaSource.TOPIC_NAME);

    return state.getProp(KafkaSource.TOPIC_NAME);
  }
1026139
public ArrayList<OvhFarmAvailableProbe> serviceName_availableFarmProbes_GET(String serviceName) throws IOException {
		String qPath = "/ipLoadbalancing/{serviceName}/availableFarmProbes";
		StringBuilder sb = path(qPath, serviceName);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t5);
	}
498420
public static base_response restore(nitro_service client, systembackup resource) throws Exception {
		systembackup restoreresource = new systembackup();
		restoreresource.filename = resource.filename;
		return restoreresource.perform_operation(client,"restore");
	}