Recuperare un cluster

Questo snippet mostra come ottenere informazioni su un cluster specifico. Utilizzalo per recuperare dettagli come lo stato del cluster, la configurazione di rete o le informazioni sulla crittografia.

Esempio di codice

C#

Per eseguire l'autenticazione in AlloyDB, configura le credenziali predefinite dell'applicazione. Per saperne di più, consulta Configura l'autenticazione per un ambiente di sviluppo locale.

using Google.Cloud.AlloyDb.V1;

public sealed partial class GeneratedAlloyDBAdminClientSnippets
{
    /// <summary>Snippet for GetCluster</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void GetCluster()
    {
        // Create client
        AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
        // Initialize request argument(s)
        string name = "projects/[PROJECT]/locations/[LOCATION]/clusters/[CLUSTER]";
        // Make the request
        Cluster response = alloyDBAdminClient.GetCluster(name);
    }
}

Passaggi successivi

Per cercare e filtrare gli esempi di codice per altri prodotti Google Cloud , consulta il browser degli esempi diGoogle Cloud .