```ts // Imports the Google Cloud Dataset Service Client library const {DatasetServiceClient} = require('@google-cloud/aiplatform'); // Specifies the location of the api endpoint const clientOptions = { apiEndpoint: 'us-central1-aiplatform.googleapis.com', }; // Instantiates a client const datasetServiceClient = new DatasetServiceClient(clientOptions); async function createDataset() { const name = datasetServiceClient.datasetPath(projectId, location, datasetId); // Configure the parent resource const parent = `projects/${projectId}/locations/${location}`; const request = { parent, dataset: { displayName: displayName, }, }; // Create Dataset Request const [response] = await datasetServiceClient.createDataset(request); console.log('Create dataset response'); console.log(`\tName : ${response.name}`); console.log(`\tDisplay name : ${response.displayName}`); console.log(`\tMetadata schema uri : ${response.metadataSchemaUri}`); console.log(`\tMetadata : ${JSON.stringify(response.metadata)}`); console.log(`\tLabels : ${JSON.stringify(response.labels)}`); } createDataset(); ```
Comments