All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yahoo.vespa.hosted.provision.provisioning.HostProvisionRequest Maven / Gradle / Ivy

There is a newer version: 8.441.21
Show newest version
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.provision.provisioning;

import com.yahoo.component.Version;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.CloudAccount;
import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.NodeType;

import java.util.List;
import java.util.Objects;
import java.util.Optional;

/**
 * A host provisioning request. This contains the details required to provision a host.
 *
 * @param indices                 List of unique provision indices which will be used to generate the node hostnames
 *                                on the form of [prefix][index].[domain].
 * @param type                    The host type to provision.
 * @param resources               The resources needed per node - the provisioned host may be significantly larger.
 * @param owner                   ID of the application that will own the provisioned host.
 * @param osVersion               The OS version to use. If this version does not exist, implementations may choose a suitable
 *                                fallback version.
 * @param sharing                 Puts requirements on sharing or exclusivity of the host to be provisioned.
 * @param clusterType             The cluster we are provisioning for, or empty if we are provisioning hosts
 *                                to be shared by multiple cluster nodes.
 * @param clusterId               The ID of the cluster we are provisioning for, or empty if we are provisioning hosts
 *                                to be shared by multiple cluster nodes.
 * @param cloudAccount            The cloud account to use.
 * @param requireBestMatchingFlavor Whether to only try provisioning with the best matching flavor. If that flavor is
 *                                unavailable for whatever reason, the request will fail without trying other
 *                                flavors that could satisfy the request.
 * @author mpolden
 */
public record HostProvisionRequest(List indices,
                                   NodeType type,
                                   NodeResources resources,
                                   ApplicationId owner,
                                   Version osVersion,
                                   HostProvisioner.HostSharing sharing,
                                   Optional clusterType,
                                   Optional clusterId,
                                   CloudAccount cloudAccount,
                                   boolean requireBestMatchingFlavor) {

    public HostProvisionRequest(List indices, NodeType type, NodeResources resources,
                                ApplicationId owner, Version osVersion, HostProvisioner.HostSharing sharing,
                                Optional clusterType, Optional clusterId,
                                CloudAccount cloudAccount, boolean requireBestMatchingFlavor) {
        this.indices = List.copyOf(Objects.requireNonNull(indices));
        this.type = Objects.requireNonNull(type);
        this.resources = Objects.requireNonNull(resources);
        this.owner = Objects.requireNonNull(owner);
        this.osVersion = Objects.requireNonNull(osVersion);
        this.sharing = Objects.requireNonNull(sharing);
        this.clusterType = Objects.requireNonNull(clusterType);
        this.clusterId = Objects.requireNonNull(clusterId);
        this.cloudAccount = Objects.requireNonNull(cloudAccount);
        this.requireBestMatchingFlavor = requireBestMatchingFlavor;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy