Constructor
new AutoMlClient(optionsopt)
Construct an instance of AutoMlClient.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. See the subsequent parameters for more details. Properties
|
- Source:
Members
(static) apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
- Source:
(static) port
The port for this API service.
- Source:
(static) scopes
The scopes needed to make gRPC calls for every method defined in this service.
- Source:
(static) servicePath
The DNS address for this API service.
- Source:
Methods
createDataset(request, optionsopt, callbackopt) → {Promise}
Creates a dataset.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is a gax.Operation object. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
const dataset = {};
const request = {
parent: formattedParent,
dataset: dataset,
};
// Handle the operation using the promise pattern.
client.createDataset(request)
.then(responses => {
const [operation, initialApiResponse] = responses;
// Operation#promise starts polling for the completion of the LRO.
return operation.promise();
})
.then(responses => {
const result = responses[0];
const metadata = responses[1];
const finalApiResponse = responses[2];
})
.catch(err => {
console.error(err);
});
const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
const dataset = {};
const request = {
parent: formattedParent,
dataset: dataset,
};
// Handle the operation using the event emitter pattern.
client.createDataset(request)
.then(responses => {
const [operation, initialApiResponse] = responses;
// Adding a listener for the "complete" event starts polling for the
// completion of the operation.
operation.on('complete', (result, metadata, finalApiResponse) => {
// doSomethingWith(result);
});
// Adding a listener for the "progress" event causes the callback to be
// called on any change in metadata when the operation is polled.
operation.on('progress', (metadata, apiResponse) => {
// doSomethingWith(metadata)
});
// Adding a listener for the "error" event handles any errors found during polling.
operation.on('error', err => {
// throw(err);
});
})
.catch(err => {
console.error(err);
});
const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
const dataset = {};
const request = {
parent: formattedParent,
dataset: dataset,
};
// Handle the operation using the await pattern.
const [operation] = await client.createDataset(request);
const [response] = await operation.promise();
createModel(request, optionsopt, callbackopt) → {Promise}
Creates a model. Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is a gax.Operation object. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
const model = {};
const request = {
parent: formattedParent,
model: model,
};
// Handle the operation using the promise pattern.
client.createModel(request)
.then(responses => {
const [operation, initialApiResponse] = responses;
// Operation#promise starts polling for the completion of the LRO.
return operation.promise();
})
.then(responses => {
const result = responses[0];
const metadata = responses[1];
const finalApiResponse = responses[2];
})
.catch(err => {
console.error(err);
});
const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
const model = {};
const request = {
parent: formattedParent,
model: model,
};
// Handle the operation using the event emitter pattern.
client.createModel(request)
.then(responses => {
const [operation, initialApiResponse] = responses;
// Adding a listener for the "complete" event starts polling for the
// completion of the operation.
operation.on('complete', (result, metadata, finalApiResponse) => {
// doSomethingWith(result);
});
// Adding a listener for the "progress" event causes the callback to be
// called on any change in metadata when the operation is polled.
operation.on('progress', (metadata, apiResponse) => {
// doSomethingWith(metadata)
});
// Adding a listener for the "error" event handles any errors found during polling.
operation.on('error', err => {
// throw(err);
});
})
.catch(err => {
console.error(err);
});
const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
const model = {};
const request = {
parent: formattedParent,
model: model,
};
// Handle the operation using the await pattern.
const [operation] = await client.createModel(request);
const [response] = await operation.promise();
datasetPath(project, location, dataset) → {String}
Return a fully-qualified dataset resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
String | |
location |
String | |
dataset |
String |
- Source:
deleteDataset(request, optionsopt, callbackopt) → {Promise}
Deletes a dataset and all of its contents.
Returns empty response in the
response field when it completes,
and delete_details in the
metadata field.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is a gax.Operation object. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const formattedName = client.datasetPath('[PROJECT]', '[LOCATION]', '[DATASET]');
// Handle the operation using the promise pattern.
client.deleteDataset({name: formattedName})
.then(responses => {
const [operation, initialApiResponse] = responses;
// Operation#promise starts polling for the completion of the LRO.
return operation.promise();
})
.then(responses => {
const result = responses[0];
const metadata = responses[1];
const finalApiResponse = responses[2];
})
.catch(err => {
console.error(err);
});
const formattedName = client.datasetPath('[PROJECT]', '[LOCATION]', '[DATASET]');
// Handle the operation using the event emitter pattern.
client.deleteDataset({name: formattedName})
.then(responses => {
const [operation, initialApiResponse] = responses;
// Adding a listener for the "complete" event starts polling for the
// completion of the operation.
operation.on('complete', (result, metadata, finalApiResponse) => {
// doSomethingWith(result);
});
// Adding a listener for the "progress" event causes the callback to be
// called on any change in metadata when the operation is polled.
operation.on('progress', (metadata, apiResponse) => {
// doSomethingWith(metadata)
});
// Adding a listener for the "error" event handles any errors found during polling.
operation.on('error', err => {
// throw(err);
});
})
.catch(err => {
console.error(err);
});
const formattedName = client.datasetPath('[PROJECT]', '[LOCATION]', '[DATASET]');
// Handle the operation using the await pattern.
const [operation] = await client.deleteDataset({name: formattedName});
const [response] = await operation.promise();
deleteModel(request, optionsopt, callbackopt) → {Promise}
Deletes a model.
Returns google.protobuf.Empty in the
response field when it completes,
and delete_details in the
metadata field.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is a gax.Operation object. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]');
// Handle the operation using the promise pattern.
client.deleteModel({name: formattedName})
.then(responses => {
const [operation, initialApiResponse] = responses;
// Operation#promise starts polling for the completion of the LRO.
return operation.promise();
})
.then(responses => {
const result = responses[0];
const metadata = responses[1];
const finalApiResponse = responses[2];
})
.catch(err => {
console.error(err);
});
const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]');
// Handle the operation using the event emitter pattern.
client.deleteModel({name: formattedName})
.then(responses => {
const [operation, initialApiResponse] = responses;
// Adding a listener for the "complete" event starts polling for the
// completion of the operation.
operation.on('complete', (result, metadata, finalApiResponse) => {
// doSomethingWith(result);
});
// Adding a listener for the "progress" event causes the callback to be
// called on any change in metadata when the operation is polled.
operation.on('progress', (metadata, apiResponse) => {
// doSomethingWith(metadata)
});
// Adding a listener for the "error" event handles any errors found during polling.
operation.on('error', err => {
// throw(err);
});
})
.catch(err => {
console.error(err);
});
const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]');
// Handle the operation using the await pattern.
const [operation] = await client.deleteModel({name: formattedName});
const [response] = await operation.promise();
exportData(request, optionsopt, callbackopt) → {Promise}
Exports dataset's data to the provided output location. Returns an empty response in the response field when it completes.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is a gax.Operation object. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const formattedName = client.datasetPath('[PROJECT]', '[LOCATION]', '[DATASET]');
const outputConfig = {};
const request = {
name: formattedName,
outputConfig: outputConfig,
};
// Handle the operation using the promise pattern.
client.exportData(request)
.then(responses => {
const [operation, initialApiResponse] = responses;
// Operation#promise starts polling for the completion of the LRO.
return operation.promise();
})
.then(responses => {
const result = responses[0];
const metadata = responses[1];
const finalApiResponse = responses[2];
})
.catch(err => {
console.error(err);
});
const formattedName = client.datasetPath('[PROJECT]', '[LOCATION]', '[DATASET]');
const outputConfig = {};
const request = {
name: formattedName,
outputConfig: outputConfig,
};
// Handle the operation using the event emitter pattern.
client.exportData(request)
.then(responses => {
const [operation, initialApiResponse] = responses;
// Adding a listener for the "complete" event starts polling for the
// completion of the operation.
operation.on('complete', (result, metadata, finalApiResponse) => {
// doSomethingWith(result);
});
// Adding a listener for the "progress" event causes the callback to be
// called on any change in metadata when the operation is polled.
operation.on('progress', (metadata, apiResponse) => {
// doSomethingWith(metadata)
});
// Adding a listener for the "error" event handles any errors found during polling.
operation.on('error', err => {
// throw(err);
});
})
.catch(err => {
console.error(err);
});
const formattedName = client.datasetPath('[PROJECT]', '[LOCATION]', '[DATASET]');
const outputConfig = {};
const request = {
name: formattedName,
outputConfig: outputConfig,
};
// Handle the operation using the await pattern.
const [operation] = await client.exportData(request);
const [response] = await operation.promise();
getDataset(request, optionsopt, callbackopt) → {Promise}
Gets a dataset.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Dataset. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const formattedName = client.datasetPath('[PROJECT]', '[LOCATION]', '[DATASET]');
client.getDataset({name: formattedName})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
getModel(request, optionsopt, callbackopt) → {Promise}
Gets a model.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Model. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]');
client.getModel({name: formattedName})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
getModelEvaluation(request, optionsopt, callbackopt) → {Promise}
Gets a model evaluation.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing ModelEvaluation. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const formattedName = client.modelEvaluationPath('[PROJECT]', '[LOCATION]', '[MODEL]', '[MODEL_EVALUATION]');
client.getModelEvaluation({name: formattedName})
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
getProjectId(callback)
Return the project ID used by this class.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function |
the callback to be called with the current project Id. |
- Source:
importData(request, optionsopt, callbackopt) → {Promise}
Imports data into a dataset.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is a gax.Operation object. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const formattedName = client.datasetPath('[PROJECT]', '[LOCATION]', '[DATASET]');
const inputConfig = {};
const request = {
name: formattedName,
inputConfig: inputConfig,
};
// Handle the operation using the promise pattern.
client.importData(request)
.then(responses => {
const [operation, initialApiResponse] = responses;
// Operation#promise starts polling for the completion of the LRO.
return operation.promise();
})
.then(responses => {
const result = responses[0];
const metadata = responses[1];
const finalApiResponse = responses[2];
})
.catch(err => {
console.error(err);
});
const formattedName = client.datasetPath('[PROJECT]', '[LOCATION]', '[DATASET]');
const inputConfig = {};
const request = {
name: formattedName,
inputConfig: inputConfig,
};
// Handle the operation using the event emitter pattern.
client.importData(request)
.then(responses => {
const [operation, initialApiResponse] = responses;
// Adding a listener for the "complete" event starts polling for the
// completion of the operation.
operation.on('complete', (result, metadata, finalApiResponse) => {
// doSomethingWith(result);
});
// Adding a listener for the "progress" event causes the callback to be
// called on any change in metadata when the operation is polled.
operation.on('progress', (metadata, apiResponse) => {
// doSomethingWith(metadata)
});
// Adding a listener for the "error" event handles any errors found during polling.
operation.on('error', err => {
// throw(err);
});
})
.catch(err => {
console.error(err);
});
const formattedName = client.datasetPath('[PROJECT]', '[LOCATION]', '[DATASET]');
const inputConfig = {};
const request = {
name: formattedName,
inputConfig: inputConfig,
};
// Handle the operation using the await pattern.
const [operation] = await client.importData(request);
const [response] = await operation.promise();
listDatasets(request, optionsopt, callbackopt) → {Promise}
Lists datasets in a project.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is Array of Dataset. When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListDatasetsResponse. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
// Iterate over all elements.
const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
client.listDatasets({parent: formattedParent})
.then(responses => {
const resources = responses[0];
for (const resource of resources) {
// doThingsWith(resource)
}
})
.catch(err => {
console.error(err);
});
// Or obtain the paged response.
const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
const resources = responses[0];
// The next request if the response shows that there are more responses.
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (const resource of resources) {
// doThingsWith(resource);
}
if (nextRequest) {
// Fetch the next page.
return client.listDatasets(nextRequest, options).then(callback);
}
}
client.listDatasets({parent: formattedParent}, options)
.then(callback)
.catch(err => {
console.error(err);
});
listDatasetsStream(request, optionsopt) → {Stream}
Equivalent to listDatasets, but returns a NodeJS Stream object.
This fetches the paged responses for listDatasets continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
- Source:
- See:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
client.listDatasetsStream({parent: formattedParent})
.on('data', element => {
// doThingsWith(element)
}).on('error', err => {
console.log(err);
});
listModelEvaluations(request, optionsopt, callbackopt) → {Promise}
Lists model evaluations.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is Array of ModelEvaluation. When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListModelEvaluationsResponse. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
// Iterate over all elements.
const formattedParent = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]');
const filter = '';
const request = {
parent: formattedParent,
filter: filter,
};
client.listModelEvaluations(request)
.then(responses => {
const resources = responses[0];
for (const resource of resources) {
// doThingsWith(resource)
}
})
.catch(err => {
console.error(err);
});
// Or obtain the paged response.
const formattedParent = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]');
const filter = '';
const request = {
parent: formattedParent,
filter: filter,
};
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
const resources = responses[0];
// The next request if the response shows that there are more responses.
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (const resource of resources) {
// doThingsWith(resource);
}
if (nextRequest) {
// Fetch the next page.
return client.listModelEvaluations(nextRequest, options).then(callback);
}
}
client.listModelEvaluations(request, options)
.then(callback)
.catch(err => {
console.error(err);
});
listModelEvaluationsStream(request, optionsopt) → {Stream}
Equivalent to listModelEvaluations, but returns a NodeJS Stream object.
This fetches the paged responses for listModelEvaluations continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
- Source:
- See:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const formattedParent = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]');
const filter = '';
const request = {
parent: formattedParent,
filter: filter,
};
client.listModelEvaluationsStream(request)
.on('data', element => {
// doThingsWith(element)
}).on('error', err => {
console.log(err);
});
listModels(request, optionsopt, callbackopt) → {Promise}
Lists models.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is Array of Model. When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListModelsResponse. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
// Iterate over all elements.
const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
client.listModels({parent: formattedParent})
.then(responses => {
const resources = responses[0];
for (const resource of resources) {
// doThingsWith(resource)
}
})
.catch(err => {
console.error(err);
});
// Or obtain the paged response.
const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
const options = {autoPaginate: false};
const callback = responses => {
// The actual resources in a response.
const resources = responses[0];
// The next request if the response shows that there are more responses.
const nextRequest = responses[1];
// The actual response object, if necessary.
// const rawResponse = responses[2];
for (const resource of resources) {
// doThingsWith(resource);
}
if (nextRequest) {
// Fetch the next page.
return client.listModels(nextRequest, options).then(callback);
}
}
client.listModels({parent: formattedParent}, options)
.then(callback)
.catch(err => {
console.error(err);
});
listModelsStream(request, optionsopt) → {Stream}
Equivalent to listModels, but returns a NodeJS Stream object.
This fetches the paged responses for listModels continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
- Source:
- See:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]');
client.listModelsStream({parent: formattedParent})
.on('data', element => {
// doThingsWith(element)
}).on('error', err => {
console.log(err);
});
locationPath(project, location) → {String}
Return a fully-qualified location resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
String | |
location |
String |
- Source:
matchDatasetFromDatasetName(datasetName) → {String}
Parse the datasetName from a dataset resource.
Parameters:
| Name | Type | Description |
|---|---|---|
datasetName |
String |
A fully-qualified path representing a dataset resources. |
- Source:
matchLocationFromDatasetName(datasetName) → {String}
Parse the datasetName from a dataset resource.
Parameters:
| Name | Type | Description |
|---|---|---|
datasetName |
String |
A fully-qualified path representing a dataset resources. |
- Source:
matchLocationFromLocationName(locationName) → {String}
Parse the locationName from a location resource.
Parameters:
| Name | Type | Description |
|---|---|---|
locationName |
String |
A fully-qualified path representing a location resources. |
- Source:
matchLocationFromModelEvaluationName(modelEvaluationName) → {String}
Parse the modelEvaluationName from a model_evaluation resource.
Parameters:
| Name | Type | Description |
|---|---|---|
modelEvaluationName |
String |
A fully-qualified path representing a model_evaluation resources. |
- Source:
matchLocationFromModelName(modelName) → {String}
Parse the modelName from a model resource.
Parameters:
| Name | Type | Description |
|---|---|---|
modelName |
String |
A fully-qualified path representing a model resources. |
- Source:
matchModelEvaluationFromModelEvaluationName(modelEvaluationName) → {String}
Parse the modelEvaluationName from a model_evaluation resource.
Parameters:
| Name | Type | Description |
|---|---|---|
modelEvaluationName |
String |
A fully-qualified path representing a model_evaluation resources. |
- Source:
matchModelFromModelEvaluationName(modelEvaluationName) → {String}
Parse the modelEvaluationName from a model_evaluation resource.
Parameters:
| Name | Type | Description |
|---|---|---|
modelEvaluationName |
String |
A fully-qualified path representing a model_evaluation resources. |
- Source:
matchModelFromModelName(modelName) → {String}
Parse the modelName from a model resource.
Parameters:
| Name | Type | Description |
|---|---|---|
modelName |
String |
A fully-qualified path representing a model resources. |
- Source:
matchProjectFromDatasetName(datasetName) → {String}
Parse the datasetName from a dataset resource.
Parameters:
| Name | Type | Description |
|---|---|---|
datasetName |
String |
A fully-qualified path representing a dataset resources. |
- Source:
matchProjectFromLocationName(locationName) → {String}
Parse the locationName from a location resource.
Parameters:
| Name | Type | Description |
|---|---|---|
locationName |
String |
A fully-qualified path representing a location resources. |
- Source:
matchProjectFromModelEvaluationName(modelEvaluationName) → {String}
Parse the modelEvaluationName from a model_evaluation resource.
Parameters:
| Name | Type | Description |
|---|---|---|
modelEvaluationName |
String |
A fully-qualified path representing a model_evaluation resources. |
- Source:
matchProjectFromModelName(modelName) → {String}
Parse the modelName from a model resource.
Parameters:
| Name | Type | Description |
|---|---|---|
modelName |
String |
A fully-qualified path representing a model resources. |
- Source:
modelEvaluationPath(project, location, model, modelEvaluation) → {String}
Return a fully-qualified model_evaluation resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
String | |
location |
String | |
model |
String | |
modelEvaluation |
String |
- Source:
modelPath(project, location, model) → {String}
Return a fully-qualified model resource name string.
Parameters:
| Name | Type | Description |
|---|---|---|
project |
String | |
location |
String | |
model |
String |
- Source:
updateDataset(request, optionsopt, callbackopt) → {Promise}
Updates a dataset.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Dataset. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const dataset = {};
const updateMask = {};
const request = {
dataset: dataset,
updateMask: updateMask,
};
client.updateDataset(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});
updateModel(request, optionsopt, callbackopt) → {Promise}
Updates a model.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Model. |
- Source:
Example
const automl = require('automl.v1');
const client = new automl.v1.AutoMlClient({
// optional auth parameters.
});
const model = {};
const updateMask = {};
const request = {
model: model,
updateMask: updateMask,
};
client.updateModel(request)
.then(responses => {
const response = responses[0];
// doThingsWith(response)
})
.catch(err => {
console.error(err);
});