// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.batchai.models;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.util.Context;
import com.azure.resourcemanager.batchai.fluent.models.ClusterInner;
import java.time.OffsetDateTime;
import java.util.List;

/** An immutable client-side representation of Cluster. */
public interface Cluster {
    /**
     * Gets the id property: Fully qualified resource Id for the resource.
     *
     * @return the id value.
     */
    String id();

    /**
     * Gets the name property: The name of the resource.
     *
     * @return the name value.
     */
    String name();

    /**
     * Gets the type property: The type of the resource.
     *
     * @return the type value.
     */
    String type();

    /**
     * Gets the vmSize property: The size of the virtual machines in the cluster. All nodes in a cluster have the same
     * VM size.
     *
     * @return the vmSize value.
     */
    String vmSize();

    /**
     * Gets the vmPriority property: VM priority of cluster nodes.
     *
     * @return the vmPriority value.
     */
    VmPriority vmPriority();

    /**
     * Gets the scaleSettings property: Scale settings of the cluster.
     *
     * @return the scaleSettings value.
     */
    ScaleSettings scaleSettings();

    /**
     * Gets the virtualMachineConfiguration property: Virtual machine configuration (OS image) of the compute nodes. All
     * nodes in a cluster have the same OS image configuration.
     *
     * @return the virtualMachineConfiguration value.
     */
    VirtualMachineConfiguration virtualMachineConfiguration();

    /**
     * Gets the nodeSetup property: Setup (mount file systems, performance counters settings and custom setup task) to
     * be performed on each compute node in the cluster.
     *
     * @return the nodeSetup value.
     */
    NodeSetup nodeSetup();

    /**
     * Gets the userAccountSettings property: Administrator user account settings which can be used to SSH to compute
     * nodes.
     *
     * @return the userAccountSettings value.
     */
    UserAccountSettings userAccountSettings();

    /**
     * Gets the subnet property: Virtual network subnet resource ID the cluster nodes belong to.
     *
     * @return the subnet value.
     */
    ResourceId subnet();

    /**
     * Gets the creationTime property: The time when the cluster was created.
     *
     * @return the creationTime value.
     */
    OffsetDateTime creationTime();

    /**
     * Gets the provisioningState property: Provisioning state of the cluster. Possible value are: creating - Specifies
     * that the cluster is being created. succeeded - Specifies that the cluster has been created successfully. failed -
     * Specifies that the cluster creation has failed. deleting - Specifies that the cluster is being deleted.
     *
     * @return the provisioningState value.
     */
    ProvisioningState provisioningState();

    /**
     * Gets the provisioningStateTransitionTime property: Time when the provisioning state was changed.
     *
     * @return the provisioningStateTransitionTime value.
     */
    OffsetDateTime provisioningStateTransitionTime();

    /**
     * Gets the allocationState property: Allocation state of the cluster. Possible values are: steady - Indicates that
     * the cluster is not resizing. There are no changes to the number of compute nodes in the cluster in progress. A
     * cluster enters this state when it is created and when no operations are being performed on the cluster to change
     * the number of compute nodes. resizing - Indicates that the cluster is resizing; that is, compute nodes are being
     * added to or removed from the cluster.
     *
     * @return the allocationState value.
     */
    AllocationState allocationState();

    /**
     * Gets the allocationStateTransitionTime property: The time at which the cluster entered its current allocation
     * state.
     *
     * @return the allocationStateTransitionTime value.
     */
    OffsetDateTime allocationStateTransitionTime();

    /**
     * Gets the errors property: Collection of errors encountered by various compute nodes during node setup.
     *
     * @return the errors value.
     */
    List<BatchAIError> errors();

    /**
     * Gets the currentNodeCount property: The number of compute nodes currently assigned to the cluster.
     *
     * @return the currentNodeCount value.
     */
    Integer currentNodeCount();

    /**
     * Gets the nodeStateCounts property: Counts of various node states on the cluster.
     *
     * @return the nodeStateCounts value.
     */
    NodeStateCounts nodeStateCounts();

    /**
     * Gets the inner com.azure.resourcemanager.batchai.fluent.models.ClusterInner object.
     *
     * @return the inner object.
     */
    ClusterInner innerModel();

    /** The entirety of the Cluster definition. */
    interface Definition
        extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate {
    }
    /** The Cluster definition stages. */
    interface DefinitionStages {
        /** The first stage of the Cluster definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the Cluster definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, workspaceName.
             *
             * @param resourceGroupName Name of the resource group to which the resource belongs.
             * @param workspaceName The name of the workspace. Workspace names can only contain a combination of
             *     alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
             *     characters long.
             * @return the next definition stage.
             */
            WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName);
        }
        /**
         * The stage of the Cluster definition which contains all the minimum required properties for the resource to be
         * created, but also allows for any other optional properties to be specified.
         */
        interface WithCreate
            extends DefinitionStages.WithVmSize,
                DefinitionStages.WithVmPriority,
                DefinitionStages.WithScaleSettings,
                DefinitionStages.WithVirtualMachineConfiguration,
                DefinitionStages.WithNodeSetup,
                DefinitionStages.WithUserAccountSettings,
                DefinitionStages.WithSubnet {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            Cluster create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            Cluster create(Context context);
        }
        /** The stage of the Cluster definition allowing to specify vmSize. */
        interface WithVmSize {
            /**
             * Specifies the vmSize property: The size of the virtual machines in the cluster. All nodes in a cluster
             * have the same VM size. For information about available VM sizes for clusters using images from the
             * Virtual Machines Marketplace see Sizes for Virtual Machines (Linux). Batch AI service supports all Azure
             * VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2
             * series)..
             *
             * @param vmSize The size of the virtual machines in the cluster. All nodes in a cluster have the same VM
             *     size. For information about available VM sizes for clusters using images from the Virtual Machines
             *     Marketplace see Sizes for Virtual Machines (Linux). Batch AI service supports all Azure VM sizes
             *     except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2
             *     series).
             * @return the next definition stage.
             */
            WithCreate withVmSize(String vmSize);
        }
        /** The stage of the Cluster definition allowing to specify vmPriority. */
        interface WithVmPriority {
            /**
             * Specifies the vmPriority property: VM priority. Allowed values are: dedicated (default) and lowpriority..
             *
             * @param vmPriority VM priority. Allowed values are: dedicated (default) and lowpriority.
             * @return the next definition stage.
             */
            WithCreate withVmPriority(VmPriority vmPriority);
        }
        /** The stage of the Cluster definition allowing to specify scaleSettings. */
        interface WithScaleSettings {
            /**
             * Specifies the scaleSettings property: Scale settings for the cluster. Batch AI service supports manual
             * and auto scale clusters..
             *
             * @param scaleSettings Scale settings for the cluster. Batch AI service supports manual and auto scale
             *     clusters.
             * @return the next definition stage.
             */
            WithCreate withScaleSettings(ScaleSettings scaleSettings);
        }
        /** The stage of the Cluster definition allowing to specify virtualMachineConfiguration. */
        interface WithVirtualMachineConfiguration {
            /**
             * Specifies the virtualMachineConfiguration property: OS image configuration for cluster nodes. All nodes
             * in a cluster have the same OS image..
             *
             * @param virtualMachineConfiguration OS image configuration for cluster nodes. All nodes in a cluster have
             *     the same OS image.
             * @return the next definition stage.
             */
            WithCreate withVirtualMachineConfiguration(VirtualMachineConfiguration virtualMachineConfiguration);
        }
        /** The stage of the Cluster definition allowing to specify nodeSetup. */
        interface WithNodeSetup {
            /**
             * Specifies the nodeSetup property: Setup to be performed on each compute node in the cluster..
             *
             * @param nodeSetup Setup to be performed on each compute node in the cluster.
             * @return the next definition stage.
             */
            WithCreate withNodeSetup(NodeSetup nodeSetup);
        }
        /** The stage of the Cluster definition allowing to specify userAccountSettings. */
        interface WithUserAccountSettings {
            /**
             * Specifies the userAccountSettings property: Settings for an administrator user account that will be
             * created on each compute node in the cluster..
             *
             * @param userAccountSettings Settings for an administrator user account that will be created on each
             *     compute node in the cluster.
             * @return the next definition stage.
             */
            WithCreate withUserAccountSettings(UserAccountSettings userAccountSettings);
        }
        /** The stage of the Cluster definition allowing to specify subnet. */
        interface WithSubnet {
            /**
             * Specifies the subnet property: Existing virtual network subnet to put the cluster nodes in. Note, if a
             * File Server mount configured in node setup, the File Server's subnet will be used automatically..
             *
             * @param subnet Existing virtual network subnet to put the cluster nodes in. Note, if a File Server mount
             *     configured in node setup, the File Server's subnet will be used automatically.
             * @return the next definition stage.
             */
            WithCreate withSubnet(ResourceId subnet);
        }
    }
    /**
     * Begins update for the Cluster resource.
     *
     * @return the stage of resource update.
     */
    Cluster.Update update();

    /** The template for Cluster update. */
    interface Update extends UpdateStages.WithScaleSettings {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        Cluster apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        Cluster apply(Context context);
    }
    /** The Cluster update stages. */
    interface UpdateStages {
        /** The stage of the Cluster update allowing to specify scaleSettings. */
        interface WithScaleSettings {
            /**
             * Specifies the scaleSettings property: Desired scale settings for the cluster. Batch AI service supports
             * manual and auto scale clusters..
             *
             * @param scaleSettings Desired scale settings for the cluster. Batch AI service supports manual and auto
             *     scale clusters.
             * @return the next definition stage.
             */
            Update withScaleSettings(ScaleSettings scaleSettings);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    Cluster refresh();

    /**
     * Refreshes the resource to sync with Azure.
     *
     * @param context The context to associate with this operation.
     * @return the refreshed resource.
     */
    Cluster refresh(Context context);

    /**
     * Get the IP address, port of all the compute nodes in the Cluster.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the IP address, port of all the compute nodes in the Cluster.
     */
    PagedIterable<RemoteLoginInformation> listRemoteLoginInformation();

    /**
     * Get the IP address, port of all the compute nodes in the Cluster.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the IP address, port of all the compute nodes in the Cluster.
     */
    PagedIterable<RemoteLoginInformation> listRemoteLoginInformation(Context context);
}
