Enumera las marcas de bases de datos compatibles

En este fragmento, se muestra cómo enumerar las marcas de bases de datos compatibles con el servicio. Puedes usarlo para saber qué marcas están disponibles para configurar en tus clústeres.

Muestra de código

Node.js

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.

/**
 * 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.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Required. The name of the parent resource. The required format is:
 *   * projects/{project}/locations/{location}
 *  Regardless of the parent specified here, as long it is contains a valid
 *  project and location, the service will return a static list of supported
 *  flags resources. Note that we do not yet support region-specific
 *  flags.
 */
// const parent = 'abc123'
/**
 *  Requested page size. Server may return fewer items than requested.
 *  If unspecified, server will pick an appropriate default.
 */
// const pageSize = 1234
/**
 *  A token identifying a page of results the server should return.
 */
// const pageToken = 'abc123'

// Imports the Alloydb library
const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1alpha;

// Instantiates a client
const alloydbClient = new AlloyDBAdminClient();

async function callListSupportedDatabaseFlags() {
  // Construct request
  const request = {
    parent,
  };

  // Run request
  const iterable =
    await alloydbClient.listSupportedDatabaseFlagsAsync(request);
  for await (const response of iterable) {
    console.log(response);
  }
}

callListSupportedDatabaseFlags();

¿Qué sigue?

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