Genera un certificado de cliente

Genera un certificado SSL/TLS de cliente para un clúster especificado. Este certificado se usa para establecer una conexión segura y encriptada desde una aplicación cliente al clúster.

Muestra de código

C#

Para autenticarte en AlloyDB, configura las credenciales predeterminadas de la aplicación. Para obtener más información, consulta Configura la autenticación para un entorno de desarrollo local.

using Google.Cloud.AlloyDb.V1;

public sealed partial class GeneratedAlloyDBAdminClientSnippets
{
    /// <summary>Snippet for GenerateClientCertificate</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 GenerateClientCertificate()
    {
        // Create client
        AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
        // Initialize request argument(s)
        string parent = "projects/[PROJECT]/locations/[LOCATION]/clusters/[CLUSTER]";
        // Make the request
        GenerateClientCertificateResponse response = alloyDBAdminClient.GenerateClientCertificate(parent);
    }
}

¿Qué sigue?

Si quieres buscar y filtrar muestras de código para otros productos de Google Cloud , consulta el navegador de muestras deGoogle Cloud .