List datasets

List datasets for a Google Cloud project.

Code sample

Node.js

To learn how to install and use the client library for Data Labeling Service, see Data Labeling Service client libraries.

To authenticate to Data Labeling Service, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

const {DataLabelingServiceClient} = require('@google-cloud/datalabeling');
const client = new DataLabelingServiceClient();

async function quickstart() {
  const parent = client.projectPath(projectId);
  const [result] = await client.listDatasets({parent});
  console.log('Datasets:');
  console.log(result);
}
quickstart();

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.