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

com.pulumi.consul.ServiceArgs Maven / Gradle / Ivy

// *** 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.consul;

import com.pulumi.consul.inputs.ServiceCheckArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class ServiceArgs extends com.pulumi.resources.ResourceArgs {

    public static final ServiceArgs Empty = new ServiceArgs();

    /**
     * The address of the service. Defaults to the address of the node.
     * 
     */
    @Import(name="address")
    private @Nullable Output address;

    /**
     * @return The address of the service. Defaults to the address of the node.
     * 
     */
    public Optional> address() {
        return Optional.ofNullable(this.address);
    }

    @Import(name="checks")
    private @Nullable Output> checks;

    public Optional>> checks() {
        return Optional.ofNullable(this.checks);
    }

    /**
     * The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
     * 
     */
    @Import(name="datacenter")
    private @Nullable Output datacenter;

    /**
     * @return The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
     * 
     */
    public Optional> datacenter() {
        return Optional.ofNullable(this.datacenter);
    }

    /**
     * Specifies to disable the anti-entropy feature for this service's tags. Defaults to `false`.
     * 
     */
    @Import(name="enableTagOverride")
    private @Nullable Output enableTagOverride;

    /**
     * @return Specifies to disable the anti-entropy feature for this service's tags. Defaults to `false`.
     * 
     */
    public Optional> enableTagOverride() {
        return Optional.ofNullable(this.enableTagOverride);
    }

    /**
     * @deprecated
     * The external field has been deprecated and does nothing.
     * 
     */
    @Deprecated /* The external field has been deprecated and does nothing. */
    @Import(name="external")
    private @Nullable Output external;

    /**
     * @deprecated
     * The external field has been deprecated and does nothing.
     * 
     */
    @Deprecated /* The external field has been deprecated and does nothing. */
    public Optional> external() {
        return Optional.ofNullable(this.external);
    }

    /**
     * A map of arbitrary KV metadata linked to the service instance.
     * 
     */
    @Import(name="meta")
    private @Nullable Output> meta;

    /**
     * @return A map of arbitrary KV metadata linked to the service instance.
     * 
     */
    public Optional>> meta() {
        return Optional.ofNullable(this.meta);
    }

    /**
     * The name of the header.
     * 
     */
    @Import(name="name")
    private @Nullable Output name;

    /**
     * @return The name of the header.
     * 
     */
    public Optional> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * The namespace to create the service within.
     * 
     */
    @Import(name="namespace")
    private @Nullable Output namespace;

    /**
     * @return The namespace to create the service within.
     * 
     */
    public Optional> namespace() {
        return Optional.ofNullable(this.namespace);
    }

    /**
     * The name of the node the to register the service on.
     * 
     */
    @Import(name="node", required=true)
    private Output node;

    /**
     * @return The name of the node the to register the service on.
     * 
     */
    public Output node() {
        return this.node;
    }

    /**
     * The partition the service is associated with.
     * 
     */
    @Import(name="partition")
    private @Nullable Output partition;

    /**
     * @return The partition the service is associated with.
     * 
     */
    public Optional> partition() {
        return Optional.ofNullable(this.partition);
    }

    /**
     * The port of the service.
     * 
     */
    @Import(name="port")
    private @Nullable Output port;

    /**
     * @return The port of the service.
     * 
     */
    public Optional> port() {
        return Optional.ofNullable(this.port);
    }

    /**
     * If the service ID is not provided, it will be defaulted to the value of the `name` attribute.
     * 
     */
    @Import(name="serviceId")
    private @Nullable Output serviceId;

    /**
     * @return If the service ID is not provided, it will be defaulted to the value of the `name` attribute.
     * 
     */
    public Optional> serviceId() {
        return Optional.ofNullable(this.serviceId);
    }

    /**
     * A list of values that are opaque to Consul, but can be used to distinguish between services or nodes.
     * 
     */
    @Import(name="tags")
    private @Nullable Output> tags;

    /**
     * @return A list of values that are opaque to Consul, but can be used to distinguish between services or nodes.
     * 
     */
    public Optional>> tags() {
        return Optional.ofNullable(this.tags);
    }

    private ServiceArgs() {}

    private ServiceArgs(ServiceArgs $) {
        this.address = $.address;
        this.checks = $.checks;
        this.datacenter = $.datacenter;
        this.enableTagOverride = $.enableTagOverride;
        this.external = $.external;
        this.meta = $.meta;
        this.name = $.name;
        this.namespace = $.namespace;
        this.node = $.node;
        this.partition = $.partition;
        this.port = $.port;
        this.serviceId = $.serviceId;
        this.tags = $.tags;
    }

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

    public static final class Builder {
        private ServiceArgs $;

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

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

        /**
         * @param address The address of the service. Defaults to the address of the node.
         * 
         * @return builder
         * 
         */
        public Builder address(@Nullable Output address) {
            $.address = address;
            return this;
        }

        /**
         * @param address The address of the service. Defaults to the address of the node.
         * 
         * @return builder
         * 
         */
        public Builder address(String address) {
            return address(Output.of(address));
        }

        public Builder checks(@Nullable Output> checks) {
            $.checks = checks;
            return this;
        }

        public Builder checks(List checks) {
            return checks(Output.of(checks));
        }

        public Builder checks(ServiceCheckArgs... checks) {
            return checks(List.of(checks));
        }

        /**
         * @param datacenter The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
         * 
         * @return builder
         * 
         */
        public Builder datacenter(@Nullable Output datacenter) {
            $.datacenter = datacenter;
            return this;
        }

        /**
         * @param datacenter The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
         * 
         * @return builder
         * 
         */
        public Builder datacenter(String datacenter) {
            return datacenter(Output.of(datacenter));
        }

        /**
         * @param enableTagOverride Specifies to disable the anti-entropy feature for this service's tags. Defaults to `false`.
         * 
         * @return builder
         * 
         */
        public Builder enableTagOverride(@Nullable Output enableTagOverride) {
            $.enableTagOverride = enableTagOverride;
            return this;
        }

        /**
         * @param enableTagOverride Specifies to disable the anti-entropy feature for this service's tags. Defaults to `false`.
         * 
         * @return builder
         * 
         */
        public Builder enableTagOverride(Boolean enableTagOverride) {
            return enableTagOverride(Output.of(enableTagOverride));
        }

        /**
         * @return builder
         * 
         * @deprecated
         * The external field has been deprecated and does nothing.
         * 
         */
        @Deprecated /* The external field has been deprecated and does nothing. */
        public Builder external(@Nullable Output external) {
            $.external = external;
            return this;
        }

        /**
         * @return builder
         * 
         * @deprecated
         * The external field has been deprecated and does nothing.
         * 
         */
        @Deprecated /* The external field has been deprecated and does nothing. */
        public Builder external(Boolean external) {
            return external(Output.of(external));
        }

        /**
         * @param meta A map of arbitrary KV metadata linked to the service instance.
         * 
         * @return builder
         * 
         */
        public Builder meta(@Nullable Output> meta) {
            $.meta = meta;
            return this;
        }

        /**
         * @param meta A map of arbitrary KV metadata linked to the service instance.
         * 
         * @return builder
         * 
         */
        public Builder meta(Map meta) {
            return meta(Output.of(meta));
        }

        /**
         * @param name The name of the header.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name The name of the header.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param namespace The namespace to create the service within.
         * 
         * @return builder
         * 
         */
        public Builder namespace(@Nullable Output namespace) {
            $.namespace = namespace;
            return this;
        }

        /**
         * @param namespace The namespace to create the service within.
         * 
         * @return builder
         * 
         */
        public Builder namespace(String namespace) {
            return namespace(Output.of(namespace));
        }

        /**
         * @param node The name of the node the to register the service on.
         * 
         * @return builder
         * 
         */
        public Builder node(Output node) {
            $.node = node;
            return this;
        }

        /**
         * @param node The name of the node the to register the service on.
         * 
         * @return builder
         * 
         */
        public Builder node(String node) {
            return node(Output.of(node));
        }

        /**
         * @param partition The partition the service is associated with.
         * 
         * @return builder
         * 
         */
        public Builder partition(@Nullable Output partition) {
            $.partition = partition;
            return this;
        }

        /**
         * @param partition The partition the service is associated with.
         * 
         * @return builder
         * 
         */
        public Builder partition(String partition) {
            return partition(Output.of(partition));
        }

        /**
         * @param port The port of the service.
         * 
         * @return builder
         * 
         */
        public Builder port(@Nullable Output port) {
            $.port = port;
            return this;
        }

        /**
         * @param port The port of the service.
         * 
         * @return builder
         * 
         */
        public Builder port(Integer port) {
            return port(Output.of(port));
        }

        /**
         * @param serviceId If the service ID is not provided, it will be defaulted to the value of the `name` attribute.
         * 
         * @return builder
         * 
         */
        public Builder serviceId(@Nullable Output serviceId) {
            $.serviceId = serviceId;
            return this;
        }

        /**
         * @param serviceId If the service ID is not provided, it will be defaulted to the value of the `name` attribute.
         * 
         * @return builder
         * 
         */
        public Builder serviceId(String serviceId) {
            return serviceId(Output.of(serviceId));
        }

        /**
         * @param tags A list of values that are opaque to Consul, but can be used to distinguish between services or nodes.
         * 
         * @return builder
         * 
         */
        public Builder tags(@Nullable Output> tags) {
            $.tags = tags;
            return this;
        }

        /**
         * @param tags A list of values that are opaque to Consul, but can be used to distinguish between services or nodes.
         * 
         * @return builder
         * 
         */
        public Builder tags(List tags) {
            return tags(Output.of(tags));
        }

        /**
         * @param tags A list of values that are opaque to Consul, but can be used to distinguish between services or nodes.
         * 
         * @return builder
         * 
         */
        public Builder tags(String... tags) {
            return tags(List.of(tags));
        }

        public ServiceArgs build() {
            $.node = Objects.requireNonNull($.node, "expected parameter 'node' to be non-null");
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy