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

com.pulumi.azurenative.servicefabric.inputs.ServiceLoadMetricArgs Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azurenative.servicefabric.inputs;

import com.pulumi.azurenative.servicefabric.enums.ServiceLoadMetricWeight;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * Specifies a metric to load balance a service during runtime.
 * 
 */
public final class ServiceLoadMetricArgs extends com.pulumi.resources.ResourceArgs {

    public static final ServiceLoadMetricArgs Empty = new ServiceLoadMetricArgs();

    /**
     * Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric.
     * 
     */
    @Import(name="defaultLoad")
    private @Nullable Output defaultLoad;

    /**
     * @return Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric.
     * 
     */
    public Optional> defaultLoad() {
        return Optional.ofNullable(this.defaultLoad);
    }

    /**
     * The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive.
     * 
     */
    @Import(name="name", required=true)
    private Output name;

    /**
     * @return The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive.
     * 
     */
    public Output name() {
        return this.name;
    }

    /**
     * Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica.
     * 
     */
    @Import(name="primaryDefaultLoad")
    private @Nullable Output primaryDefaultLoad;

    /**
     * @return Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica.
     * 
     */
    public Optional> primaryDefaultLoad() {
        return Optional.ofNullable(this.primaryDefaultLoad);
    }

    /**
     * Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica.
     * 
     */
    @Import(name="secondaryDefaultLoad")
    private @Nullable Output secondaryDefaultLoad;

    /**
     * @return Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica.
     * 
     */
    public Optional> secondaryDefaultLoad() {
        return Optional.ofNullable(this.secondaryDefaultLoad);
    }

    /**
     * The service load metric relative weight, compared to other metrics configured for this service, as a number.
     * 
     */
    @Import(name="weight")
    private @Nullable Output> weight;

    /**
     * @return The service load metric relative weight, compared to other metrics configured for this service, as a number.
     * 
     */
    public Optional>> weight() {
        return Optional.ofNullable(this.weight);
    }

    private ServiceLoadMetricArgs() {}

    private ServiceLoadMetricArgs(ServiceLoadMetricArgs $) {
        this.defaultLoad = $.defaultLoad;
        this.name = $.name;
        this.primaryDefaultLoad = $.primaryDefaultLoad;
        this.secondaryDefaultLoad = $.secondaryDefaultLoad;
        this.weight = $.weight;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(ServiceLoadMetricArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private ServiceLoadMetricArgs $;

        public Builder() {
            $ = new ServiceLoadMetricArgs();
        }

        public Builder(ServiceLoadMetricArgs defaults) {
            $ = new ServiceLoadMetricArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param defaultLoad Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric.
         * 
         * @return builder
         * 
         */
        public Builder defaultLoad(@Nullable Output defaultLoad) {
            $.defaultLoad = defaultLoad;
            return this;
        }

        /**
         * @param defaultLoad Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric.
         * 
         * @return builder
         * 
         */
        public Builder defaultLoad(Integer defaultLoad) {
            return defaultLoad(Output.of(defaultLoad));
        }

        /**
         * @param name The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive.
         * 
         * @return builder
         * 
         */
        public Builder name(Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param primaryDefaultLoad Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica.
         * 
         * @return builder
         * 
         */
        public Builder primaryDefaultLoad(@Nullable Output primaryDefaultLoad) {
            $.primaryDefaultLoad = primaryDefaultLoad;
            return this;
        }

        /**
         * @param primaryDefaultLoad Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica.
         * 
         * @return builder
         * 
         */
        public Builder primaryDefaultLoad(Integer primaryDefaultLoad) {
            return primaryDefaultLoad(Output.of(primaryDefaultLoad));
        }

        /**
         * @param secondaryDefaultLoad Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica.
         * 
         * @return builder
         * 
         */
        public Builder secondaryDefaultLoad(@Nullable Output secondaryDefaultLoad) {
            $.secondaryDefaultLoad = secondaryDefaultLoad;
            return this;
        }

        /**
         * @param secondaryDefaultLoad Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica.
         * 
         * @return builder
         * 
         */
        public Builder secondaryDefaultLoad(Integer secondaryDefaultLoad) {
            return secondaryDefaultLoad(Output.of(secondaryDefaultLoad));
        }

        /**
         * @param weight The service load metric relative weight, compared to other metrics configured for this service, as a number.
         * 
         * @return builder
         * 
         */
        public Builder weight(@Nullable Output> weight) {
            $.weight = weight;
            return this;
        }

        /**
         * @param weight The service load metric relative weight, compared to other metrics configured for this service, as a number.
         * 
         * @return builder
         * 
         */
        public Builder weight(Either weight) {
            return weight(Output.of(weight));
        }

        /**
         * @param weight The service load metric relative weight, compared to other metrics configured for this service, as a number.
         * 
         * @return builder
         * 
         */
        public Builder weight(String weight) {
            return weight(Either.ofLeft(weight));
        }

        /**
         * @param weight The service load metric relative weight, compared to other metrics configured for this service, as a number.
         * 
         * @return builder
         * 
         */
        public Builder weight(ServiceLoadMetricWeight weight) {
            return weight(Either.ofRight(weight));
        }

        public ServiceLoadMetricArgs build() {
            if ($.name == null) {
                throw new MissingRequiredPropertyException("ServiceLoadMetricArgs", "name");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy