Search in sources :

Example 1 with Hostname

use of com.yahoo.vespa.hosted.controller.api.identifiers.Hostname in project vespa by vespa-engine.

the class ApplicationApiHandler method restart.

/**
 * Schedule restart of deployment, or specific host in a deployment
 */
private HttpResponse restart(String tenantName, String applicationName, String instanceName, String environment, String region, HttpRequest request) {
    DeploymentId deploymentId = new DeploymentId(ApplicationId.from(tenantName, applicationName, instanceName), ZoneId.from(environment, region));
    // TODO: Propagate all filters
    Optional<Hostname> hostname = Optional.ofNullable(request.getProperty("hostname")).map(Hostname::new);
    controller.applications().restart(deploymentId, hostname);
    // TODO: Change to return JSON
    return new StringResponse("Requested restart of " + path(TenantResource.API_PATH, tenantName, ApplicationResource.API_PATH, applicationName, EnvironmentResource.API_PATH, environment, "region", region, "instance", instanceName));
}
Also used : DeploymentId(com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId) Hostname(com.yahoo.vespa.hosted.controller.api.identifiers.Hostname) StringResponse(com.yahoo.vespa.hosted.controller.restapi.StringResponse)

Aggregations

DeploymentId (com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId)1 Hostname (com.yahoo.vespa.hosted.controller.api.identifiers.Hostname)1 StringResponse (com.yahoo.vespa.hosted.controller.restapi.StringResponse)1