API v1beta1 service for Cloud AI Platform Notebooks. v1beta1
Package
@google-cloud/notebooks
Constructors
(constructor)(opts)
constructor(opts?: ClientOptions);
Construct an instance of NotebookServiceClient.
Parameter
Name | Description |
opts |
ClientOptions
|
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
notebookServiceStub
notebookServiceStub?: Promise<{
[name: string]: Function;
}>;
operationsClient
operationsClient: gax.OperationsClient;
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
checkCreateEnvironmentProgress(name)
checkCreateEnvironmentProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Environment, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by createEnvironment()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Environment, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format: `projects/{project_id}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Required. User-defined unique ID of this environment. The `environment_id`
* must be 1 to 63 characters long and contain only lowercase letters, numeric
* characters, and dashes. The first character must be a lowercase letter and
* the last character cannot be a dash.
*/
// const environmentId = 'abc123'
/**
* Required. The environment to be created.
*/
// const environment = {}
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callCreateEnvironment() {
// Construct request
const request = {
parent,
environmentId,
environment,
};
// Run request
const [operation] = await notebooksClient.createEnvironment(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateEnvironment();
checkCreateInstanceProgress(name)
checkCreateInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by createInstance()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `parent=projects/{project_id}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Required. User-defined unique ID of this instance.
*/
// const instanceId = 'abc123'
/**
* Required. The instance to be created.
*/
// const instance = {}
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callCreateInstance() {
// Construct request
const request = {
parent,
instanceId,
instance,
};
// Run request
const [operation] = await notebooksClient.createInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateInstance();
checkDeleteEnvironmentProgress(name)
checkDeleteEnvironmentProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by deleteEnvironment()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/environments/{environment_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callDeleteEnvironment() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.deleteEnvironment(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteEnvironment();
checkDeleteInstanceProgress(name)
checkDeleteInstanceProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by deleteInstance()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callDeleteInstance() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.deleteInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteInstance();
checkRegisterInstanceProgress(name)
checkRegisterInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by registerInstance()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `parent=projects/{project_id}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Required. User defined unique ID of this instance. The `instance_id` must
* be 1 to 63 characters long and contain only lowercase letters,
* numeric characters, and dashes. The first character must be a lowercase
* letter and the last character cannot be a dash.
*/
// const instanceId = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callRegisterInstance() {
// Construct request
const request = {
parent,
instanceId,
};
// Run request
const [operation] = await notebooksClient.registerInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callRegisterInstance();
checkReportInstanceInfoProgress(name)
checkReportInstanceInfoProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by reportInstanceInfo()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
/**
* Required. The VM hardware token for authenticating the VM.
* https://cloud.google.com/compute/docs/instances/verifying-instance-identity
*/
// const vmId = 'abc123'
/**
* The metadata reported to Notebooks API. This will be merged to the instance
* metadata store
*/
// const metadata = 1234
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callReportInstanceInfo() {
// Construct request
const request = {
name,
vmId,
};
// Run request
const [operation] = await notebooksClient.reportInstanceInfo(request);
const [response] = await operation.promise();
console.log(response);
}
callReportInstanceInfo();
checkResetInstanceProgress(name)
checkResetInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by resetInstance()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callResetInstance() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.resetInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callResetInstance();
checkSetInstanceAcceleratorProgress(name)
checkSetInstanceAcceleratorProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by setInstanceAccelerator()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
/**
* Required. Type of this accelerator.
*/
// const type = {}
/**
* Required. Count of cores of this accelerator. Note that not all
* combinations of `type` and `core_count` are valid. Check GPUs on Compute
* Engine (https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a
* valid combination. TPUs are not supported.
*/
// const coreCount = 1234
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callSetInstanceAccelerator() {
// Construct request
const request = {
name,
type,
coreCount,
};
// Run request
const [operation] = await notebooksClient.setInstanceAccelerator(request);
const [response] = await operation.promise();
console.log(response);
}
callSetInstanceAccelerator();
checkSetInstanceLabelsProgress(name)
checkSetInstanceLabelsProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by setInstanceLabels()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
/**
* Labels to apply to this instance.
* These can be later modified by the setLabels method
*/
// const labels = 1234
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callSetInstanceLabels() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.setInstanceLabels(request);
const [response] = await operation.promise();
console.log(response);
}
callSetInstanceLabels();
checkSetInstanceMachineTypeProgress(name)
checkSetInstanceMachineTypeProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by setInstanceMachineType()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
/**
* Required. The Compute Engine machine
* type (https://cloud.google.com/compute/docs/machine-types).
*/
// const machineType = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callSetInstanceMachineType() {
// Construct request
const request = {
name,
machineType,
};
// Run request
const [operation] = await notebooksClient.setInstanceMachineType(request);
const [response] = await operation.promise();
console.log(response);
}
callSetInstanceMachineType();
checkStartInstanceProgress(name)
checkStartInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by startInstance()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callStartInstance() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.startInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callStartInstance();
checkStopInstanceProgress(name)
checkStopInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by stopInstance()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callStopInstance() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.stopInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callStopInstance();
checkUpgradeInstanceInternalProgress(name)
checkUpgradeInstanceInternalProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by upgradeInstanceInternal()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
/**
* Required. The VM hardware token for authenticating the VM.
* https://cloud.google.com/compute/docs/instances/verifying-instance-identity
*/
// const vmId = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callUpgradeInstanceInternal() {
// Construct request
const request = {
name,
vmId,
};
// Run request
const [operation] = await notebooksClient.upgradeInstanceInternal(request);
const [response] = await operation.promise();
console.log(response);
}
callUpgradeInstanceInternal();
checkUpgradeInstanceProgress(name)
checkUpgradeInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>>;
Check the status of the long running operation returned by upgradeInstance()
.
Parameter
Name | Description |
name |
string
The operation name that will be passed.
|
Returns
Type | Description |
Promise<LROperation<protos.google.cloud.notebooks.v1beta1.Instance, protos.google.cloud.notebooks.v1beta1.OperationMetadata>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callUpgradeInstance() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.upgradeInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callUpgradeInstance();
close()
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed.
|
createEnvironment(request, options)
createEnvironment(request?: protos.google.cloud.notebooks.v1beta1.ICreateEnvironmentRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IEnvironment, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Creates a new Environment.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ICreateEnvironmentRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IEnvironment, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format: `projects/{project_id}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Required. User-defined unique ID of this environment. The `environment_id`
* must be 1 to 63 characters long and contain only lowercase letters, numeric
* characters, and dashes. The first character must be a lowercase letter and
* the last character cannot be a dash.
*/
// const environmentId = 'abc123'
/**
* Required. The environment to be created.
*/
// const environment = {}
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callCreateEnvironment() {
// Construct request
const request = {
parent,
environmentId,
environment,
};
// Run request
const [operation] = await notebooksClient.createEnvironment(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateEnvironment();
createEnvironment(request, options, callback)
createEnvironment(request: protos.google.cloud.notebooks.v1beta1.ICreateEnvironmentRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IEnvironment, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ICreateEnvironmentRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IEnvironment, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
createEnvironment(request, callback)
createEnvironment(request: protos.google.cloud.notebooks.v1beta1.ICreateEnvironmentRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IEnvironment, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ICreateEnvironmentRequest
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IEnvironment, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
createInstance(request, options)
createInstance(request?: protos.google.cloud.notebooks.v1beta1.ICreateInstanceRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Creates a new Instance in a given project and location.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ICreateInstanceRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `parent=projects/{project_id}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Required. User-defined unique ID of this instance.
*/
// const instanceId = 'abc123'
/**
* Required. The instance to be created.
*/
// const instance = {}
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callCreateInstance() {
// Construct request
const request = {
parent,
instanceId,
instance,
};
// Run request
const [operation] = await notebooksClient.createInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateInstance();
createInstance(request, options, callback)
createInstance(request: protos.google.cloud.notebooks.v1beta1.ICreateInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ICreateInstanceRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
createInstance(request, callback)
createInstance(request: protos.google.cloud.notebooks.v1beta1.ICreateInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ICreateInstanceRequest
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
deleteEnvironment(request, options)
deleteEnvironment(request?: protos.google.cloud.notebooks.v1beta1.IDeleteEnvironmentRequest, options?: CallOptions): Promise<[LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Deletes a single Environment.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IDeleteEnvironmentRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/environments/{environment_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callDeleteEnvironment() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.deleteEnvironment(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteEnvironment();
deleteEnvironment(request, options, callback)
deleteEnvironment(request: protos.google.cloud.notebooks.v1beta1.IDeleteEnvironmentRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IDeleteEnvironmentRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
deleteEnvironment(request, callback)
deleteEnvironment(request: protos.google.cloud.notebooks.v1beta1.IDeleteEnvironmentRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IDeleteEnvironmentRequest
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
deleteInstance(request, options)
deleteInstance(request?: protos.google.cloud.notebooks.v1beta1.IDeleteInstanceRequest, options?: CallOptions): Promise<[LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Deletes a single Instance.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IDeleteInstanceRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callDeleteInstance() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.deleteInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteInstance();
deleteInstance(request, options, callback)
deleteInstance(request: protos.google.cloud.notebooks.v1beta1.IDeleteInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IDeleteInstanceRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
deleteInstance(request, callback)
deleteInstance(request: protos.google.cloud.notebooks.v1beta1.IDeleteInstanceRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IDeleteInstanceRequest
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
environmentPath(project, environment)
environmentPath(project: string, environment: string): string;
Return a fully-qualified environment resource name string.
Parameters
Name | Description |
project |
string
|
environment |
string
|
Returns
Type | Description |
string | {string} Resource name string.
|
getEnvironment(request, options)
getEnvironment(request?: protos.google.cloud.notebooks.v1beta1.IGetEnvironmentRequest, options?: CallOptions): Promise<[protos.google.cloud.notebooks.v1beta1.IEnvironment, protos.google.cloud.notebooks.v1beta1.IGetEnvironmentRequest | undefined, {} | undefined]>;
Gets details of a single Environment.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IGetEnvironmentRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[protos.google.cloud.notebooks.v1beta1.IEnvironment, protos.google.cloud.notebooks.v1beta1.IGetEnvironmentRequest | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Environment]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/environments/{environment_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callGetEnvironment() {
// Construct request
const request = {
name,
};
// Run request
const response = await notebooksClient.getEnvironment(request);
console.log(response);
}
callGetEnvironment();
getEnvironment(request, options, callback)
getEnvironment(request: protos.google.cloud.notebooks.v1beta1.IGetEnvironmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.notebooks.v1beta1.IEnvironment, protos.google.cloud.notebooks.v1beta1.IGetEnvironmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IGetEnvironmentRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.notebooks.v1beta1.IEnvironment, protos.google.cloud.notebooks.v1beta1.IGetEnvironmentRequest | null | undefined, {} | null | undefined>
|
Returns
getEnvironment(request, callback)
getEnvironment(request: protos.google.cloud.notebooks.v1beta1.IGetEnvironmentRequest, callback: Callback<protos.google.cloud.notebooks.v1beta1.IEnvironment, protos.google.cloud.notebooks.v1beta1.IGetEnvironmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IGetEnvironmentRequest
|
callback |
Callback<protos.google.cloud.notebooks.v1beta1.IEnvironment, protos.google.cloud.notebooks.v1beta1.IGetEnvironmentRequest | null | undefined, {} | null | undefined>
|
Returns
getInstance(request, options)
getInstance(request?: protos.google.cloud.notebooks.v1beta1.IGetInstanceRequest, options?: CallOptions): Promise<[protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IGetInstanceRequest | undefined, {} | undefined]>;
Gets details of a single Instance.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IGetInstanceRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IGetInstanceRequest | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Instance]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callGetInstance() {
// Construct request
const request = {
name,
};
// Run request
const response = await notebooksClient.getInstance(request);
console.log(response);
}
callGetInstance();
getInstance(request, options, callback)
getInstance(request: protos.google.cloud.notebooks.v1beta1.IGetInstanceRequest, options: CallOptions, callback: Callback<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IGetInstanceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IGetInstanceRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IGetInstanceRequest | null | undefined, {} | null | undefined>
|
Returns
getInstance(request, callback)
getInstance(request: protos.google.cloud.notebooks.v1beta1.IGetInstanceRequest, callback: Callback<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IGetInstanceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IGetInstanceRequest
|
callback |
Callback<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IGetInstanceRequest | null | undefined, {} | null | undefined>
|
Returns
getProjectId()
getProjectId(): Promise<string>;
Returns
Type | Description |
Promise<string> | |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns
Type | Description |
Promise<{
[name: string]: Function;
}> | {Promise} A promise that resolves to an authenticated service stub.
|
instancePath(project, instance)
instancePath(project: string, instance: string): string;
Return a fully-qualified instance resource name string.
Parameters
Name | Description |
project |
string
|
instance |
string
|
Returns
Type | Description |
string | {string} Resource name string.
|
isInstanceUpgradeable(request, options)
isInstanceUpgradeable(request?: protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableRequest, options?: CallOptions): Promise<[protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableResponse, (protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableRequest | undefined), {} | undefined]>;
Check if a notebook instance is upgradable.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableResponse, (protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableRequest | undefined), {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [IsInstanceUpgradeableResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const notebookInstance = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callIsInstanceUpgradeable() {
// Construct request
const request = {
notebookInstance,
};
// Run request
const response = await notebooksClient.isInstanceUpgradeable(request);
console.log(response);
}
callIsInstanceUpgradeable();
isInstanceUpgradeable(request, options, callback)
isInstanceUpgradeable(request: protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableRequest, options: CallOptions, callback: Callback<protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableResponse, protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableResponse, protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableRequest | null | undefined, {} | null | undefined>
|
Returns
isInstanceUpgradeable(request, callback)
isInstanceUpgradeable(request: protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableRequest, callback: Callback<protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableResponse, protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableRequest
|
callback |
Callback<protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableResponse, protos.google.cloud.notebooks.v1beta1.IIsInstanceUpgradeableRequest | null | undefined, {} | null | undefined>
|
Returns
listEnvironments(request, options)
listEnvironments(request?: protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest, options?: CallOptions): Promise<[protos.google.cloud.notebooks.v1beta1.IEnvironment[], protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest | null, protos.google.cloud.notebooks.v1beta1.IListEnvironmentsResponse]>;
Lists environments in a project.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[protos.google.cloud.notebooks.v1beta1.IEnvironment[], protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest | null, protos.google.cloud.notebooks.v1beta1.IListEnvironmentsResponse]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [Environment]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listEnvironmentsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
listEnvironments(request, options, callback)
listEnvironments(request: protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest, protos.google.cloud.notebooks.v1beta1.IListEnvironmentsResponse | null | undefined, protos.google.cloud.notebooks.v1beta1.IEnvironment>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest, protos.google.cloud.notebooks.v1beta1.IListEnvironmentsResponse | null | undefined, protos.google.cloud.notebooks.v1beta1.IEnvironment>
|
Returns
listEnvironments(request, callback)
listEnvironments(request: protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest, callback: PaginationCallback<protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest, protos.google.cloud.notebooks.v1beta1.IListEnvironmentsResponse | null | undefined, protos.google.cloud.notebooks.v1beta1.IEnvironment>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest
|
callback |
PaginationCallback<protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest, protos.google.cloud.notebooks.v1beta1.IListEnvironmentsResponse | null | undefined, protos.google.cloud.notebooks.v1beta1.IEnvironment>
|
Returns
listEnvironmentsAsync(request, options)
listEnvironmentsAsync(request?: protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.notebooks.v1beta1.IEnvironment>;
Equivalent to listEnvironments
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
AsyncIterable<protos.google.cloud.notebooks.v1beta1.IEnvironment> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Environment]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format: `projects/{project_id}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Maximum return size of the list call.
*/
// const pageSize = 1234
/**
* A previous returned page token that can be used to continue listing from
* the last result.
*/
// const pageToken = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callListEnvironments() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await notebooksClient.listEnvironmentsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListEnvironments();
listEnvironmentsStream(request, options)
listEnvironmentsStream(request?: protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IListEnvironmentsRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Transform | {Stream} An object stream which emits an object representing [Environment] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listEnvironmentsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
listInstances(request, options)
listInstances(request?: protos.google.cloud.notebooks.v1beta1.IListInstancesRequest, options?: CallOptions): Promise<[protos.google.cloud.notebooks.v1beta1.IInstance[], protos.google.cloud.notebooks.v1beta1.IListInstancesRequest | null, protos.google.cloud.notebooks.v1beta1.IListInstancesResponse]>;
Lists instances in a given project and location.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IListInstancesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[protos.google.cloud.notebooks.v1beta1.IInstance[], protos.google.cloud.notebooks.v1beta1.IListInstancesRequest | null, protos.google.cloud.notebooks.v1beta1.IListInstancesResponse]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [Instance]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listInstancesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
listInstances(request, options, callback)
listInstances(request: protos.google.cloud.notebooks.v1beta1.IListInstancesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.notebooks.v1beta1.IListInstancesRequest, protos.google.cloud.notebooks.v1beta1.IListInstancesResponse | null | undefined, protos.google.cloud.notebooks.v1beta1.IInstance>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IListInstancesRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.notebooks.v1beta1.IListInstancesRequest, protos.google.cloud.notebooks.v1beta1.IListInstancesResponse | null | undefined, protos.google.cloud.notebooks.v1beta1.IInstance>
|
Returns
listInstances(request, callback)
listInstances(request: protos.google.cloud.notebooks.v1beta1.IListInstancesRequest, callback: PaginationCallback<protos.google.cloud.notebooks.v1beta1.IListInstancesRequest, protos.google.cloud.notebooks.v1beta1.IListInstancesResponse | null | undefined, protos.google.cloud.notebooks.v1beta1.IInstance>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IListInstancesRequest
|
callback |
PaginationCallback<protos.google.cloud.notebooks.v1beta1.IListInstancesRequest, protos.google.cloud.notebooks.v1beta1.IListInstancesResponse | null | undefined, protos.google.cloud.notebooks.v1beta1.IInstance>
|
Returns
listInstancesAsync(request, options)
listInstancesAsync(request?: protos.google.cloud.notebooks.v1beta1.IListInstancesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.notebooks.v1beta1.IInstance>;
Equivalent to listInstances
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IListInstancesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
AsyncIterable<protos.google.cloud.notebooks.v1beta1.IInstance> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Instance]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `parent=projects/{project_id}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Maximum return size of the list call.
*/
// const pageSize = 1234
/**
* A previous returned page token that can be used to continue listing
* from the last result.
*/
// const pageToken = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callListInstances() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await notebooksClient.listInstancesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListInstances();
listInstancesStream(request, options)
listInstancesStream(request?: protos.google.cloud.notebooks.v1beta1.IListInstancesRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IListInstancesRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Transform | {Stream} An object stream which emits an object representing [Instance] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listInstancesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
|
matchEnvironmentFromEnvironmentName(environmentName)
matchEnvironmentFromEnvironmentName(environmentName: string): string | number;
Parse the environment from Environment resource.
Parameter
Name | Description |
environmentName |
string
A fully-qualified path representing Environment resource.
|
Returns
Type | Description |
string | number | {string} A string representing the environment.
|
matchInstanceFromInstanceName(instanceName)
matchInstanceFromInstanceName(instanceName: string): string | number;
Parse the instance from Instance resource.
Parameter
Name | Description |
instanceName |
string
A fully-qualified path representing Instance resource.
|
Returns
Type | Description |
string | number | {string} A string representing the instance.
|
matchProjectFromEnvironmentName(environmentName)
matchProjectFromEnvironmentName(environmentName: string): string | number;
Parse the project from Environment resource.
Parameter
Name | Description |
environmentName |
string
A fully-qualified path representing Environment resource.
|
Returns
Type | Description |
string | number | {string} A string representing the project.
|
matchProjectFromInstanceName(instanceName)
matchProjectFromInstanceName(instanceName: string): string | number;
Parse the project from Instance resource.
Parameter
Name | Description |
instanceName |
string
A fully-qualified path representing Instance resource.
|
Returns
Type | Description |
string | number | {string} A string representing the project.
|
registerInstance(request, options)
registerInstance(request?: protos.google.cloud.notebooks.v1beta1.IRegisterInstanceRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances are instances created with the legacy Compute Engine calls. They are not manageable by the Notebooks API out of the box. This call makes these instances manageable by the Notebooks API.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IRegisterInstanceRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `parent=projects/{project_id}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Required. User defined unique ID of this instance. The `instance_id` must
* be 1 to 63 characters long and contain only lowercase letters,
* numeric characters, and dashes. The first character must be a lowercase
* letter and the last character cannot be a dash.
*/
// const instanceId = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callRegisterInstance() {
// Construct request
const request = {
parent,
instanceId,
};
// Run request
const [operation] = await notebooksClient.registerInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callRegisterInstance();
registerInstance(request, options, callback)
registerInstance(request: protos.google.cloud.notebooks.v1beta1.IRegisterInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IRegisterInstanceRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
registerInstance(request, callback)
registerInstance(request: protos.google.cloud.notebooks.v1beta1.IRegisterInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IRegisterInstanceRequest
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
reportInstanceInfo(request, options)
reportInstanceInfo(request?: protos.google.cloud.notebooks.v1beta1.IReportInstanceInfoRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Allows notebook instances to report their latest instance information to the Notebooks API server. The server will merge the reported information to the instance metadata store. Do not use this method directly.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IReportInstanceInfoRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
/**
* Required. The VM hardware token for authenticating the VM.
* https://cloud.google.com/compute/docs/instances/verifying-instance-identity
*/
// const vmId = 'abc123'
/**
* The metadata reported to Notebooks API. This will be merged to the instance
* metadata store
*/
// const metadata = 1234
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callReportInstanceInfo() {
// Construct request
const request = {
name,
vmId,
};
// Run request
const [operation] = await notebooksClient.reportInstanceInfo(request);
const [response] = await operation.promise();
console.log(response);
}
callReportInstanceInfo();
reportInstanceInfo(request, options, callback)
reportInstanceInfo(request: protos.google.cloud.notebooks.v1beta1.IReportInstanceInfoRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IReportInstanceInfoRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
reportInstanceInfo(request, callback)
reportInstanceInfo(request: protos.google.cloud.notebooks.v1beta1.IReportInstanceInfoRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IReportInstanceInfoRequest
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
resetInstance(request, options)
resetInstance(request?: protos.google.cloud.notebooks.v1beta1.IResetInstanceRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Resets a notebook instance.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IResetInstanceRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callResetInstance() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.resetInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callResetInstance();
resetInstance(request, options, callback)
resetInstance(request: protos.google.cloud.notebooks.v1beta1.IResetInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IResetInstanceRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
resetInstance(request, callback)
resetInstance(request: protos.google.cloud.notebooks.v1beta1.IResetInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IResetInstanceRequest
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
setInstanceAccelerator(request, options)
setInstanceAccelerator(request?: protos.google.cloud.notebooks.v1beta1.ISetInstanceAcceleratorRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Updates the guest accelerators of a single Instance.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ISetInstanceAcceleratorRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
/**
* Required. Type of this accelerator.
*/
// const type = {}
/**
* Required. Count of cores of this accelerator. Note that not all
* combinations of `type` and `core_count` are valid. Check GPUs on Compute
* Engine (https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a
* valid combination. TPUs are not supported.
*/
// const coreCount = 1234
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callSetInstanceAccelerator() {
// Construct request
const request = {
name,
type,
coreCount,
};
// Run request
const [operation] = await notebooksClient.setInstanceAccelerator(request);
const [response] = await operation.promise();
console.log(response);
}
callSetInstanceAccelerator();
setInstanceAccelerator(request, options, callback)
setInstanceAccelerator(request: protos.google.cloud.notebooks.v1beta1.ISetInstanceAcceleratorRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ISetInstanceAcceleratorRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
setInstanceAccelerator(request, callback)
setInstanceAccelerator(request: protos.google.cloud.notebooks.v1beta1.ISetInstanceAcceleratorRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ISetInstanceAcceleratorRequest
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
setInstanceLabels(request, options)
setInstanceLabels(request?: protos.google.cloud.notebooks.v1beta1.ISetInstanceLabelsRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Updates the labels of an Instance.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ISetInstanceLabelsRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
/**
* Labels to apply to this instance.
* These can be later modified by the setLabels method
*/
// const labels = 1234
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callSetInstanceLabels() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.setInstanceLabels(request);
const [response] = await operation.promise();
console.log(response);
}
callSetInstanceLabels();
setInstanceLabels(request, options, callback)
setInstanceLabels(request: protos.google.cloud.notebooks.v1beta1.ISetInstanceLabelsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ISetInstanceLabelsRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
setInstanceLabels(request, callback)
setInstanceLabels(request: protos.google.cloud.notebooks.v1beta1.ISetInstanceLabelsRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ISetInstanceLabelsRequest
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
setInstanceMachineType(request, options)
setInstanceMachineType(request?: protos.google.cloud.notebooks.v1beta1.ISetInstanceMachineTypeRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Updates the machine type of a single Instance.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ISetInstanceMachineTypeRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
/**
* Required. The Compute Engine machine
* type (https://cloud.google.com/compute/docs/machine-types).
*/
// const machineType = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callSetInstanceMachineType() {
// Construct request
const request = {
name,
machineType,
};
// Run request
const [operation] = await notebooksClient.setInstanceMachineType(request);
const [response] = await operation.promise();
console.log(response);
}
callSetInstanceMachineType();
setInstanceMachineType(request, options, callback)
setInstanceMachineType(request: protos.google.cloud.notebooks.v1beta1.ISetInstanceMachineTypeRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ISetInstanceMachineTypeRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
setInstanceMachineType(request, callback)
setInstanceMachineType(request: protos.google.cloud.notebooks.v1beta1.ISetInstanceMachineTypeRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.ISetInstanceMachineTypeRequest
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
startInstance(request, options)
startInstance(request?: protos.google.cloud.notebooks.v1beta1.IStartInstanceRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Starts a notebook instance.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IStartInstanceRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callStartInstance() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.startInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callStartInstance();
startInstance(request, options, callback)
startInstance(request: protos.google.cloud.notebooks.v1beta1.IStartInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IStartInstanceRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
startInstance(request, callback)
startInstance(request: protos.google.cloud.notebooks.v1beta1.IStartInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IStartInstanceRequest
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
stopInstance(request, options)
stopInstance(request?: protos.google.cloud.notebooks.v1beta1.IStopInstanceRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Stops a notebook instance.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IStopInstanceRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callStopInstance() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.stopInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callStopInstance();
stopInstance(request, options, callback)
stopInstance(request: protos.google.cloud.notebooks.v1beta1.IStopInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IStopInstanceRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
stopInstance(request, callback)
stopInstance(request: protos.google.cloud.notebooks.v1beta1.IStopInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IStopInstanceRequest
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
upgradeInstance(request, options)
upgradeInstance(request?: protos.google.cloud.notebooks.v1beta1.IUpgradeInstanceRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Upgrades a notebook instance to the latest version.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IUpgradeInstanceRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callUpgradeInstance() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await notebooksClient.upgradeInstance(request);
const [response] = await operation.promise();
console.log(response);
}
callUpgradeInstance();
upgradeInstance(request, options, callback)
upgradeInstance(request: protos.google.cloud.notebooks.v1beta1.IUpgradeInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IUpgradeInstanceRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
upgradeInstance(request, callback)
upgradeInstance(request: protos.google.cloud.notebooks.v1beta1.IUpgradeInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IUpgradeInstanceRequest
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
upgradeInstanceInternal(request, options)
upgradeInstanceInternal(request?: protos.google.cloud.notebooks.v1beta1.IUpgradeInstanceInternalRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly.
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IUpgradeInstanceInternalRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns
Type | Description |
Promise<[LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.
|
Example
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Format:
* `projects/{project_id}/locations/{location}/instances/{instance_id}`
*/
// const name = 'abc123'
/**
* Required. The VM hardware token for authenticating the VM.
* https://cloud.google.com/compute/docs/instances/verifying-instance-identity
*/
// const vmId = 'abc123'
// Imports the Notebooks library
const {NotebookServiceClient} = require('@google-cloud/notebooks').v1beta1;
// Instantiates a client
const notebooksClient = new NotebookServiceClient();
async function callUpgradeInstanceInternal() {
// Construct request
const request = {
name,
vmId,
};
// Run request
const [operation] = await notebooksClient.upgradeInstanceInternal(request);
const [response] = await operation.promise();
console.log(response);
}
callUpgradeInstanceInternal();
upgradeInstanceInternal(request, options, callback)
upgradeInstanceInternal(request: protos.google.cloud.notebooks.v1beta1.IUpgradeInstanceInternalRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IUpgradeInstanceInternalRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns
upgradeInstanceInternal(request, callback)
upgradeInstanceInternal(request: protos.google.cloud.notebooks.v1beta1.IUpgradeInstanceInternalRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name | Description |
request |
protos.google.cloud.notebooks.v1beta1.IUpgradeInstanceInternalRequest
|
callback |
Callback<LROperation<protos.google.cloud.notebooks.v1beta1.IInstance, protos.google.cloud.notebooks.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns