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

com.azure.resourcemanager.azurestackhci.models.HciEdgeDeviceHostNetwork Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2024-04.

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

package com.azure.resourcemanager.azurestackhci.models;

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.List;

/**
 * The HostNetwork of a cluster.
 */
@Immutable
public final class HciEdgeDeviceHostNetwork implements JsonSerializable {
    /*
     * The network intents assigned to the network reference pattern used for the deployment. Each intent will define
     * its own name, traffic type, adapter names, and overrides as recommended by your OEM.
     */
    private List intents;

    /*
     * List of StorageNetworks config to deploy AzureStackHCI Cluster.
     */
    private List storageNetworks;

    /*
     * Defines how the storage adapters between nodes are connected either switch or switch less.
     */
    private Boolean storageConnectivitySwitchless;

    /*
     * Optional parameter required only for 3 Nodes Switchless deployments. This allows users to specify IPs and Mask
     * for Storage NICs when Network ATC is not assigning the IPs for storage automatically.
     */
    private Boolean enableStorageAutoIp;

    /**
     * Creates an instance of HciEdgeDeviceHostNetwork class.
     */
    public HciEdgeDeviceHostNetwork() {
    }

    /**
     * Get the intents property: The network intents assigned to the network reference pattern used for the deployment.
     * Each intent will define its own name, traffic type, adapter names, and overrides as recommended by your OEM.
     * 
     * @return the intents value.
     */
    public List intents() {
        return this.intents;
    }

    /**
     * Get the storageNetworks property: List of StorageNetworks config to deploy AzureStackHCI Cluster.
     * 
     * @return the storageNetworks value.
     */
    public List storageNetworks() {
        return this.storageNetworks;
    }

    /**
     * Get the storageConnectivitySwitchless property: Defines how the storage adapters between nodes are connected
     * either switch or switch less.
     * 
     * @return the storageConnectivitySwitchless value.
     */
    public Boolean storageConnectivitySwitchless() {
        return this.storageConnectivitySwitchless;
    }

    /**
     * Get the enableStorageAutoIp property: Optional parameter required only for 3 Nodes Switchless deployments. This
     * allows users to specify IPs and Mask for Storage NICs when Network ATC is not assigning the IPs for storage
     * automatically.
     * 
     * @return the enableStorageAutoIp value.
     */
    public Boolean enableStorageAutoIp() {
        return this.enableStorageAutoIp;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (intents() != null) {
            intents().forEach(e -> e.validate());
        }
        if (storageNetworks() != null) {
            storageNetworks().forEach(e -> e.validate());
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of HciEdgeDeviceHostNetwork from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of HciEdgeDeviceHostNetwork if the JsonReader was pointing to an instance of it, or null if
     * it was pointing to JSON null.
     * @throws IOException If an error occurs while reading the HciEdgeDeviceHostNetwork.
     */
    public static HciEdgeDeviceHostNetwork fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            HciEdgeDeviceHostNetwork deserializedHciEdgeDeviceHostNetwork = new HciEdgeDeviceHostNetwork();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("intents".equals(fieldName)) {
                    List intents
                        = reader.readArray(reader1 -> HciEdgeDeviceIntents.fromJson(reader1));
                    deserializedHciEdgeDeviceHostNetwork.intents = intents;
                } else if ("storageNetworks".equals(fieldName)) {
                    List storageNetworks
                        = reader.readArray(reader1 -> HciEdgeDeviceStorageNetworks.fromJson(reader1));
                    deserializedHciEdgeDeviceHostNetwork.storageNetworks = storageNetworks;
                } else if ("storageConnectivitySwitchless".equals(fieldName)) {
                    deserializedHciEdgeDeviceHostNetwork.storageConnectivitySwitchless
                        = reader.getNullable(JsonReader::getBoolean);
                } else if ("enableStorageAutoIp".equals(fieldName)) {
                    deserializedHciEdgeDeviceHostNetwork.enableStorageAutoIp
                        = reader.getNullable(JsonReader::getBoolean);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedHciEdgeDeviceHostNetwork;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy