| 36 | const client = new AutoMlClient(); |
| 37 | |
| 38 | async function importDataset() { |
| 39 | // Construct request |
| 40 | const request = { |
| 41 | name: client.datasetPath(projectId, location, datasetId), |
| 42 | inputConfig: { |
| 43 | gcsSource: { |
| 44 | inputUris: path.split(','), |
| 45 | }, |
| 46 | }, |
| 47 | }; |
| 48 | |
| 49 | // Import dataset |
| 50 | console.log('Proccessing import'); |
| 51 | const [operation] = await client.importData(request); |
| 52 | |
| 53 | // Wait for operation to complete. |
| 54 | const [response] = await operation.promise(); |
| 55 | console.log(`Dataset imported: ${response}`); |
| 56 | } |
| 57 | |
| 58 | importDataset(); |
| 59 | // [END automl_import_dataset_beta] |