Class v1.NotebookServiceClient (4.1.0)

API v1 service for Cloud AI Platform Notebooks. v1

Package

@google-cloud/notebooks

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of NotebookServiceClient.

Parameters
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new NotebookServiceClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

iamClient

iamClient: IamClient;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

locationsClient

locationsClient: LocationsClient;

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.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

cancelOperation(request, optionsOrCallback, callback)

cancelOperation(request: protos.google.longrunning.CancelOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED.

Parameters
Name Description
request CancelOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
callback Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});

checkCreateEnvironmentProgress(name)

checkCreateEnvironmentProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1.Environment, protos.google.cloud.notebooks.v1.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.v1.Environment, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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();

checkCreateExecutionProgress(name)

checkCreateExecutionProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1.Execution, protos.google.cloud.notebooks.v1.OperationMetadata>>;

Check the status of the long running operation returned by createExecution().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.notebooks.v1.Execution, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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 execution.
   */
  // const executionId = 'abc123'
  /**
   *  Required. The execution to be created.
   */
  // const execution = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callCreateExecution() {
    // Construct request
    const request = {
      parent,
      executionId,
      execution,
    };

    // Run request
    const [operation] = await notebooksClient.createExecution(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateExecution();

checkCreateInstanceProgress(name)

checkCreateInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1.Instance, protos.google.cloud.notebooks.v1.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.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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();

checkCreateScheduleProgress(name)

checkCreateScheduleProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1.Schedule, protos.google.cloud.notebooks.v1.OperationMetadata>>;

Check the status of the long running operation returned by createSchedule().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.notebooks.v1.Schedule, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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 schedule.
   */
  // const scheduleId = 'abc123'
  /**
   *  Required. The schedule to be created.
   */
  // const schedule = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callCreateSchedule() {
    // Construct request
    const request = {
      parent,
      scheduleId,
      schedule,
    };

    // Run request
    const [operation] = await notebooksClient.createSchedule(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateSchedule();

checkDeleteEnvironmentProgress(name)

checkDeleteEnvironmentProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.notebooks.v1.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.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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();

checkDeleteExecutionProgress(name)

checkDeleteExecutionProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.notebooks.v1.OperationMetadata>>;

Check the status of the long running operation returned by deleteExecution().

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.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/executions/{execution_id}`
   */
  // const name = 'abc123'

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callDeleteExecution() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await notebooksClient.deleteExecution(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteExecution();

checkDeleteInstanceProgress(name)

checkDeleteInstanceProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.notebooks.v1.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.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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();

checkDeleteScheduleProgress(name)

checkDeleteScheduleProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.notebooks.v1.OperationMetadata>>;

Check the status of the long running operation returned by deleteSchedule().

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.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
   */
  // const name = 'abc123'

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callDeleteSchedule() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await notebooksClient.deleteSchedule(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteSchedule();

checkDiagnoseInstanceProgress(name)

checkDiagnoseInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1.Instance, protos.google.cloud.notebooks.v1.OperationMetadata>>;

Check the status of the long running operation returned by diagnoseInstance().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.notebooks.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const name = 'abc123'
  /**
   *  Required. Defines flags that are used to run the diagnostic tool
   */
  // const diagnosticConfig = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callDiagnoseInstance() {
    // Construct request
    const request = {
      name,
      diagnosticConfig,
    };

    // Run request
    const [operation] = await notebooksClient.diagnoseInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDiagnoseInstance();

checkRegisterInstanceProgress(name)

checkRegisterInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1.Instance, protos.google.cloud.notebooks.v1.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.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.Instance, protos.google.cloud.notebooks.v1.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.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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 = [1,2,3,4]

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // 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.v1.Instance, protos.google.cloud.notebooks.v1.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.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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();

checkRollbackInstanceProgress(name)

checkRollbackInstanceProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1.Instance, protos.google.cloud.notebooks.v1.OperationMetadata>>;

Check the status of the long running operation returned by rollbackInstance().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.notebooks.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const name = 'abc123'
  /**
   *  Required. The snapshot for rollback.
   *  Example: `projects/test-project/global/snapshots/krwlzipynril`.
   */
  // const targetSnapshot = 'abc123'

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callRollbackInstance() {
    // Construct request
    const request = {
      name,
      targetSnapshot,
    };

    // Run request
    const [operation] = await notebooksClient.rollbackInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callRollbackInstance();

checkSetInstanceAcceleratorProgress(name)

checkSetInstanceAcceleratorProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1.Instance, protos.google.cloud.notebooks.v1.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.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.Instance, protos.google.cloud.notebooks.v1.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.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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 = [1,2,3,4]

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // 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.v1.Instance, protos.google.cloud.notebooks.v1.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.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.Instance, protos.google.cloud.notebooks.v1.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.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.Instance, protos.google.cloud.notebooks.v1.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.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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();

checkTriggerScheduleProgress(name)

checkTriggerScheduleProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1.Schedule, protos.google.cloud.notebooks.v1.OperationMetadata>>;

Check the status of the long running operation returned by triggerSchedule().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.notebooks.v1.Schedule, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `parent=projects/{project_id}/locations/{location}/schedules/{schedule_id}`
   */
  // const name = 'abc123'

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callTriggerSchedule() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await notebooksClient.triggerSchedule(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callTriggerSchedule();

checkUpdateInstanceConfigProgress(name)

checkUpdateInstanceConfigProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1.Instance, protos.google.cloud.notebooks.v1.OperationMetadata>>;

Check the status of the long running operation returned by updateInstanceConfig().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.notebooks.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const name = 'abc123'
  /**
   *  The instance configurations to be updated.
   */
  // const config = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callUpdateInstanceConfig() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await notebooksClient.updateInstanceConfig(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateInstanceConfig();

checkUpdateShieldedInstanceConfigProgress(name)

checkUpdateShieldedInstanceConfigProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1.Instance, protos.google.cloud.notebooks.v1.OperationMetadata>>;

Check the status of the long running operation returned by updateShieldedInstanceConfig().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.notebooks.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const name = 'abc123'
  /**
   *  ShieldedInstance configuration to be updated.
   */
  // const shieldedInstanceConfig = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callUpdateShieldedInstanceConfig() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await notebooksClient.updateShieldedInstanceConfig(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateShieldedInstanceConfig();

checkUpgradeInstanceInternalProgress(name)

checkUpgradeInstanceInternalProgress(name: string): Promise<LROperation<protos.google.cloud.notebooks.v1.Instance, protos.google.cloud.notebooks.v1.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.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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'
  /**
   *  Optional. The optional UpgradeType. Setting this field will search for additional
   *  compute images to upgrade this instance.
   */
  // const type = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // 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.v1.Instance, protos.google.cloud.notebooks.v1.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.v1.Instance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const name = 'abc123'
  /**
   *  Optional. The optional UpgradeType. Setting this field will search for additional
   *  compute images to upgrade this instance.
   */
  // const type = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // 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()

close(): Promise<void>;

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.v1.ICreateEnvironmentRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IEnvironment, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new Environment.

Parameters
Name Description
request 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.v1.IEnvironment, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.ICreateEnvironmentRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IEnvironment, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateEnvironmentRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IEnvironment, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createEnvironment(request, callback)

createEnvironment(request: protos.google.cloud.notebooks.v1.ICreateEnvironmentRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IEnvironment, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateEnvironmentRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IEnvironment, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createExecution(request, options)

createExecution(request?: protos.google.cloud.notebooks.v1.ICreateExecutionRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IExecution, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new Execution in a given project and location.

Parameters
Name Description
request ICreateExecutionRequest

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.v1.IExecution, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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 execution.
   */
  // const executionId = 'abc123'
  /**
   *  Required. The execution to be created.
   */
  // const execution = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callCreateExecution() {
    // Construct request
    const request = {
      parent,
      executionId,
      execution,
    };

    // Run request
    const [operation] = await notebooksClient.createExecution(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateExecution();

createExecution(request, options, callback)

createExecution(request: protos.google.cloud.notebooks.v1.ICreateExecutionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IExecution, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateExecutionRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IExecution, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createExecution(request, callback)

createExecution(request: protos.google.cloud.notebooks.v1.ICreateExecutionRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IExecution, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateExecutionRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IExecution, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createInstance(request, options)

createInstance(request?: protos.google.cloud.notebooks.v1.ICreateInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new Instance in a given project and location.

Parameters
Name Description
request 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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.ICreateInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createInstance(request, callback)

createInstance(request: protos.google.cloud.notebooks.v1.ICreateInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateInstanceRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createSchedule(request, options)

createSchedule(request?: protos.google.cloud.notebooks.v1.ICreateScheduleRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new Scheduled Notebook in a given project and location.

Parameters
Name Description
request ICreateScheduleRequest

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.v1.ISchedule, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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 schedule.
   */
  // const scheduleId = 'abc123'
  /**
   *  Required. The schedule to be created.
   */
  // const schedule = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callCreateSchedule() {
    // Construct request
    const request = {
      parent,
      scheduleId,
      schedule,
    };

    // Run request
    const [operation] = await notebooksClient.createSchedule(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateSchedule();

createSchedule(request, options, callback)

createSchedule(request: protos.google.cloud.notebooks.v1.ICreateScheduleRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateScheduleRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createSchedule(request, callback)

createSchedule(request: protos.google.cloud.notebooks.v1.ICreateScheduleRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateScheduleRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteEnvironment(request, options)

deleteEnvironment(request?: protos.google.cloud.notebooks.v1.IDeleteEnvironmentRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a single Environment.

Parameters
Name Description
request 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.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.IDeleteEnvironmentRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteEnvironmentRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteEnvironment(request, callback)

deleteEnvironment(request: protos.google.cloud.notebooks.v1.IDeleteEnvironmentRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteEnvironmentRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteExecution(request, options)

deleteExecution(request?: protos.google.cloud.notebooks.v1.IDeleteExecutionRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes execution

Parameters
Name Description
request IDeleteExecutionRequest

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.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/executions/{execution_id}`
   */
  // const name = 'abc123'

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callDeleteExecution() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await notebooksClient.deleteExecution(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteExecution();

deleteExecution(request, options, callback)

deleteExecution(request: protos.google.cloud.notebooks.v1.IDeleteExecutionRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteExecutionRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteExecution(request, callback)

deleteExecution(request: protos.google.cloud.notebooks.v1.IDeleteExecutionRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteExecutionRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteInstance(request, options)

deleteInstance(request?: protos.google.cloud.notebooks.v1.IDeleteInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a single Instance.

Parameters
Name Description
request 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.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.IDeleteInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteInstance(request, callback)

deleteInstance(request: protos.google.cloud.notebooks.v1.IDeleteInstanceRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteInstanceRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteOperation(request, optionsOrCallback, callback)

deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
Name Description
request DeleteOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
callback Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});

deleteSchedule(request, options)

deleteSchedule(request?: protos.google.cloud.notebooks.v1.IDeleteScheduleRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes schedule and all underlying jobs

Parameters
Name Description
request IDeleteScheduleRequest

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.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
   */
  // const name = 'abc123'

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callDeleteSchedule() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await notebooksClient.deleteSchedule(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteSchedule();

deleteSchedule(request, options, callback)

deleteSchedule(request: protos.google.cloud.notebooks.v1.IDeleteScheduleRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteScheduleRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteSchedule(request, callback)

deleteSchedule(request: protos.google.cloud.notebooks.v1.IDeleteScheduleRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteScheduleRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

diagnoseInstance(request, options)

diagnoseInstance(request?: protos.google.cloud.notebooks.v1.IDiagnoseInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a Diagnostic File and runs Diagnostic Tool given an Instance.

Parameters
Name Description
request IDiagnoseInstanceRequest

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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const name = 'abc123'
  /**
   *  Required. Defines flags that are used to run the diagnostic tool
   */
  // const diagnosticConfig = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callDiagnoseInstance() {
    // Construct request
    const request = {
      name,
      diagnosticConfig,
    };

    // Run request
    const [operation] = await notebooksClient.diagnoseInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDiagnoseInstance();

diagnoseInstance(request, options, callback)

diagnoseInstance(request: protos.google.cloud.notebooks.v1.IDiagnoseInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDiagnoseInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

diagnoseInstance(request, callback)

diagnoseInstance(request: protos.google.cloud.notebooks.v1.IDiagnoseInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDiagnoseInstanceRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

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.

executionPath(project, location, execution)

executionPath(project: string, location: string, execution: string): string;

Return a fully-qualified execution resource name string.

Parameters
Name Description
project string
location string
execution string
Returns
Type Description
string

{string} Resource name string.

getEnvironment(request, options)

getEnvironment(request?: protos.google.cloud.notebooks.v1.IGetEnvironmentRequest, options?: CallOptions): Promise<[
        protos.google.cloud.notebooks.v1.IEnvironment,
        protos.google.cloud.notebooks.v1.IGetEnvironmentRequest | undefined,
        {} | undefined
    ]>;

Gets details of a single Environment.

Parameters
Name Description
request 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.v1.IEnvironment, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.IGetEnvironmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.notebooks.v1.IEnvironment, protos.google.cloud.notebooks.v1.IGetEnvironmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetEnvironmentRequest
options CallOptions
callback Callback<protos.google.cloud.notebooks.v1.IEnvironment, protos.google.cloud.notebooks.v1.IGetEnvironmentRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getEnvironment(request, callback)

getEnvironment(request: protos.google.cloud.notebooks.v1.IGetEnvironmentRequest, callback: Callback<protos.google.cloud.notebooks.v1.IEnvironment, protos.google.cloud.notebooks.v1.IGetEnvironmentRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetEnvironmentRequest
callback Callback<protos.google.cloud.notebooks.v1.IEnvironment, protos.google.cloud.notebooks.v1.IGetEnvironmentRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getExecution(request, options)

getExecution(request?: protos.google.cloud.notebooks.v1.IGetExecutionRequest, options?: CallOptions): Promise<[
        protos.google.cloud.notebooks.v1.IExecution,
        protos.google.cloud.notebooks.v1.IGetExecutionRequest | undefined,
        {} | undefined
    ]>;

Gets details of executions

Parameters
Name Description
request IGetExecutionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.notebooks.v1.IExecution, protos.google.cloud.notebooks.v1.IGetExecutionRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/executions/{execution_id}`
   */
  // const name = 'abc123'

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callGetExecution() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await notebooksClient.getExecution(request);
    console.log(response);
  }

  callGetExecution();

getExecution(request, options, callback)

getExecution(request: protos.google.cloud.notebooks.v1.IGetExecutionRequest, options: CallOptions, callback: Callback<protos.google.cloud.notebooks.v1.IExecution, protos.google.cloud.notebooks.v1.IGetExecutionRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetExecutionRequest
options CallOptions
callback Callback<protos.google.cloud.notebooks.v1.IExecution, protos.google.cloud.notebooks.v1.IGetExecutionRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getExecution(request, callback)

getExecution(request: protos.google.cloud.notebooks.v1.IGetExecutionRequest, callback: Callback<protos.google.cloud.notebooks.v1.IExecution, protos.google.cloud.notebooks.v1.IGetExecutionRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetExecutionRequest
callback Callback<protos.google.cloud.notebooks.v1.IExecution, protos.google.cloud.notebooks.v1.IGetExecutionRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getIamPolicy(request, options, callback)

getIamPolicy(request: IamProtos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters
Name Description
request IamProtos.google.iam.v1.GetIamPolicyRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
Type Description
Promise<[google.iam.v1.Policy]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

getInstance(request, options)

getInstance(request?: protos.google.cloud.notebooks.v1.IGetInstanceRequest, options?: CallOptions): Promise<[
        protos.google.cloud.notebooks.v1.IInstance,
        protos.google.cloud.notebooks.v1.IGetInstanceRequest | undefined,
        {} | undefined
    ]>;

Gets details of a single Instance.

Parameters
Name Description
request 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.v1.IInstance, protos.google.cloud.notebooks.v1.IGetInstanceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.IGetInstanceRequest, options: CallOptions, callback: Callback<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IGetInstanceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetInstanceRequest
options CallOptions
callback Callback<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IGetInstanceRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getInstance(request, callback)

getInstance(request: protos.google.cloud.notebooks.v1.IGetInstanceRequest, callback: Callback<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IGetInstanceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetInstanceRequest
callback Callback<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IGetInstanceRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getInstanceHealth(request, options)

getInstanceHealth(request?: protos.google.cloud.notebooks.v1.IGetInstanceHealthRequest, options?: CallOptions): Promise<[
        protos.google.cloud.notebooks.v1.IGetInstanceHealthResponse,
        protos.google.cloud.notebooks.v1.IGetInstanceHealthRequest | undefined,
        {} | undefined
    ]>;

Check if a notebook instance is healthy.

Parameters
Name Description
request IGetInstanceHealthRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.notebooks.v1.IGetInstanceHealthResponse, protos.google.cloud.notebooks.v1.IGetInstanceHealthRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callGetInstanceHealth() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await notebooksClient.getInstanceHealth(request);
    console.log(response);
  }

  callGetInstanceHealth();

getInstanceHealth(request, options, callback)

getInstanceHealth(request: protos.google.cloud.notebooks.v1.IGetInstanceHealthRequest, options: CallOptions, callback: Callback<protos.google.cloud.notebooks.v1.IGetInstanceHealthResponse, protos.google.cloud.notebooks.v1.IGetInstanceHealthRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetInstanceHealthRequest
options CallOptions
callback Callback<protos.google.cloud.notebooks.v1.IGetInstanceHealthResponse, protos.google.cloud.notebooks.v1.IGetInstanceHealthRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getInstanceHealth(request, callback)

getInstanceHealth(request: protos.google.cloud.notebooks.v1.IGetInstanceHealthRequest, callback: Callback<protos.google.cloud.notebooks.v1.IGetInstanceHealthResponse, protos.google.cloud.notebooks.v1.IGetInstanceHealthRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetInstanceHealthRequest
callback Callback<protos.google.cloud.notebooks.v1.IGetInstanceHealthResponse, protos.google.cloud.notebooks.v1.IGetInstanceHealthRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getLocation(request, options, callback)

getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;

Gets information about a location.

Parameters
Name Description
request LocationProtos.google.cloud.location.IGetLocationRequest

The request object that will be sent.

options CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>

Call options. See CallOptions for more details.

callback Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
Promise<google.cloud.location.ILocation>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

const [response] = await client.getLocation(request);

getOperation(request, optionsOrCallback, callback)

getOperation(request: protos.google.longrunning.GetOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters
Name Description
request GetOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
callback Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<[protos.google.longrunning.Operation]>
Example

const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)

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
Type Description
void

getSchedule(request, options)

getSchedule(request?: protos.google.cloud.notebooks.v1.IGetScheduleRequest, options?: CallOptions): Promise<[
        protos.google.cloud.notebooks.v1.ISchedule,
        protos.google.cloud.notebooks.v1.IGetScheduleRequest | undefined,
        {} | undefined
    ]>;

Gets details of schedule

Parameters
Name Description
request IGetScheduleRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IGetScheduleRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
   */
  // const name = 'abc123'

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callGetSchedule() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await notebooksClient.getSchedule(request);
    console.log(response);
  }

  callGetSchedule();

getSchedule(request, options, callback)

getSchedule(request: protos.google.cloud.notebooks.v1.IGetScheduleRequest, options: CallOptions, callback: Callback<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IGetScheduleRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetScheduleRequest
options CallOptions
callback Callback<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IGetScheduleRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getSchedule(request, callback)

getSchedule(request: protos.google.cloud.notebooks.v1.IGetScheduleRequest, callback: Callback<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IGetScheduleRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetScheduleRequest
callback Callback<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IGetScheduleRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

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.v1.IIsInstanceUpgradeableRequest, options?: CallOptions): Promise<[
        protos.google.cloud.notebooks.v1.IIsInstanceUpgradeableResponse,
        (protos.google.cloud.notebooks.v1.IIsInstanceUpgradeableRequest | undefined),
        {} | undefined
    ]>;

Check if a notebook instance is upgradable.

Parameters
Name Description
request 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.v1.IIsInstanceUpgradeableResponse, (protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const notebookInstance = 'abc123'
  /**
   *  Optional. The optional UpgradeType. Setting this field will search for additional
   *  compute images to upgrade this instance.
   */
  // const type = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // 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.v1.IIsInstanceUpgradeableRequest, options: CallOptions, callback: Callback<protos.google.cloud.notebooks.v1.IIsInstanceUpgradeableResponse, protos.google.cloud.notebooks.v1.IIsInstanceUpgradeableRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IIsInstanceUpgradeableRequest
options CallOptions
callback Callback<protos.google.cloud.notebooks.v1.IIsInstanceUpgradeableResponse, protos.google.cloud.notebooks.v1.IIsInstanceUpgradeableRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

isInstanceUpgradeable(request, callback)

isInstanceUpgradeable(request: protos.google.cloud.notebooks.v1.IIsInstanceUpgradeableRequest, callback: Callback<protos.google.cloud.notebooks.v1.IIsInstanceUpgradeableResponse, protos.google.cloud.notebooks.v1.IIsInstanceUpgradeableRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IIsInstanceUpgradeableRequest
callback Callback<protos.google.cloud.notebooks.v1.IIsInstanceUpgradeableResponse, protos.google.cloud.notebooks.v1.IIsInstanceUpgradeableRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

listEnvironments(request, options)

listEnvironments(request?: protos.google.cloud.notebooks.v1.IListEnvironmentsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.notebooks.v1.IEnvironment[],
        protos.google.cloud.notebooks.v1.IListEnvironmentsRequest | null,
        protos.google.cloud.notebooks.v1.IListEnvironmentsResponse
    ]>;

Lists environments in a project.

Parameters
Name Description
request 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.v1.IEnvironment[], protos.google.cloud.notebooks.v1.IListEnvironmentsRequest | null, protos.google.cloud.notebooks.v1.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 for more details and examples.

listEnvironments(request, options, callback)

listEnvironments(request: protos.google.cloud.notebooks.v1.IListEnvironmentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.notebooks.v1.IListEnvironmentsRequest, protos.google.cloud.notebooks.v1.IListEnvironmentsResponse | null | undefined, protos.google.cloud.notebooks.v1.IEnvironment>): void;
Parameters
Name Description
request IListEnvironmentsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.notebooks.v1.IListEnvironmentsRequest, protos.google.cloud.notebooks.v1.IListEnvironmentsResponse | null | undefined, protos.google.cloud.notebooks.v1.IEnvironment>
Returns
Type Description
void

listEnvironments(request, callback)

listEnvironments(request: protos.google.cloud.notebooks.v1.IListEnvironmentsRequest, callback: PaginationCallback<protos.google.cloud.notebooks.v1.IListEnvironmentsRequest, protos.google.cloud.notebooks.v1.IListEnvironmentsResponse | null | undefined, protos.google.cloud.notebooks.v1.IEnvironment>): void;
Parameters
Name Description
request IListEnvironmentsRequest
callback PaginationCallback<protos.google.cloud.notebooks.v1.IListEnvironmentsRequest, protos.google.cloud.notebooks.v1.IListEnvironmentsResponse | null | undefined, protos.google.cloud.notebooks.v1.IEnvironment>
Returns
Type Description
void

listEnvironmentsAsync(request, options)

listEnvironmentsAsync(request?: protos.google.cloud.notebooks.v1.IListEnvironmentsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.notebooks.v1.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 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.v1.IEnvironment>

{Object} An iterable Object that allows async iteration. 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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callListEnvironments() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = notebooksClient.listEnvironmentsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListEnvironments();

listEnvironmentsStream(request, options)

listEnvironmentsStream(request?: protos.google.cloud.notebooks.v1.IListEnvironmentsRequest, options?: CallOptions): Transform;

Equivalent to listEnvironments, but returns a NodeJS Stream object.

Parameters
Name Description
request 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 for more details and examples.

listExecutions(request, options)

listExecutions(request?: protos.google.cloud.notebooks.v1.IListExecutionsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.notebooks.v1.IExecution[],
        protos.google.cloud.notebooks.v1.IListExecutionsRequest | null,
        protos.google.cloud.notebooks.v1.IListExecutionsResponse
    ]>;

Lists executions in a given project and location

Parameters
Name Description
request IListExecutionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.notebooks.v1.IExecution[], protos.google.cloud.notebooks.v1.IListExecutionsRequest | null, protos.google.cloud.notebooks.v1.IListExecutionsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . 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 listExecutionsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listExecutions(request, options, callback)

listExecutions(request: protos.google.cloud.notebooks.v1.IListExecutionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.notebooks.v1.IListExecutionsRequest, protos.google.cloud.notebooks.v1.IListExecutionsResponse | null | undefined, protos.google.cloud.notebooks.v1.IExecution>): void;
Parameters
Name Description
request IListExecutionsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.notebooks.v1.IListExecutionsRequest, protos.google.cloud.notebooks.v1.IListExecutionsResponse | null | undefined, protos.google.cloud.notebooks.v1.IExecution>
Returns
Type Description
void

listExecutions(request, callback)

listExecutions(request: protos.google.cloud.notebooks.v1.IListExecutionsRequest, callback: PaginationCallback<protos.google.cloud.notebooks.v1.IListExecutionsRequest, protos.google.cloud.notebooks.v1.IListExecutionsResponse | null | undefined, protos.google.cloud.notebooks.v1.IExecution>): void;
Parameters
Name Description
request IListExecutionsRequest
callback PaginationCallback<protos.google.cloud.notebooks.v1.IListExecutionsRequest, protos.google.cloud.notebooks.v1.IListExecutionsResponse | null | undefined, protos.google.cloud.notebooks.v1.IExecution>
Returns
Type Description
void

listExecutionsAsync(request, options)

listExecutionsAsync(request?: protos.google.cloud.notebooks.v1.IListExecutionsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.notebooks.v1.IExecution>;

Equivalent to listExecutions, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request IListExecutionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.notebooks.v1.IExecution>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . 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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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'
  /**
   *  Filter applied to resulting executions. Currently only supports filtering
   *  executions by a specified `schedule_id`.
   *  Format: `schedule_id=

listExecutionsStream(request, options)

listExecutionsStream(request?: protos.google.cloud.notebooks.v1.IListExecutionsRequest, options?: CallOptions): Transform;

Equivalent to listExecutions, but returns a NodeJS Stream object.

Parameters
Name Description
request IListExecutionsRequest

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 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 listExecutionsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listInstances(request, options)

listInstances(request?: protos.google.cloud.notebooks.v1.IListInstancesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.notebooks.v1.IInstance[],
        protos.google.cloud.notebooks.v1.IListInstancesRequest | null,
        protos.google.cloud.notebooks.v1.IListInstancesResponse
    ]>;

Lists instances in a given project and location.

Parameters
Name Description
request 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.v1.IInstance[], protos.google.cloud.notebooks.v1.IListInstancesRequest | null, protos.google.cloud.notebooks.v1.IListInstancesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . 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 for more details and examples.

listInstances(request, options, callback)

listInstances(request: protos.google.cloud.notebooks.v1.IListInstancesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.notebooks.v1.IListInstancesRequest, protos.google.cloud.notebooks.v1.IListInstancesResponse | null | undefined, protos.google.cloud.notebooks.v1.IInstance>): void;
Parameters
Name Description
request IListInstancesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.notebooks.v1.IListInstancesRequest, protos.google.cloud.notebooks.v1.IListInstancesResponse | null | undefined, protos.google.cloud.notebooks.v1.IInstance>
Returns
Type Description
void

listInstances(request, callback)

listInstances(request: protos.google.cloud.notebooks.v1.IListInstancesRequest, callback: PaginationCallback<protos.google.cloud.notebooks.v1.IListInstancesRequest, protos.google.cloud.notebooks.v1.IListInstancesResponse | null | undefined, protos.google.cloud.notebooks.v1.IInstance>): void;
Parameters
Name Description
request IListInstancesRequest
callback PaginationCallback<protos.google.cloud.notebooks.v1.IListInstancesRequest, protos.google.cloud.notebooks.v1.IListInstancesResponse | null | undefined, protos.google.cloud.notebooks.v1.IInstance>
Returns
Type Description
void

listInstancesAsync(request, options)

listInstancesAsync(request?: protos.google.cloud.notebooks.v1.IListInstancesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.notebooks.v1.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 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.v1.IInstance>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . 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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callListInstances() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = notebooksClient.listInstancesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListInstances();

listInstancesStream(request, options)

listInstancesStream(request?: protos.google.cloud.notebooks.v1.IListInstancesRequest, options?: CallOptions): Transform;

Equivalent to listInstances, but returns a NodeJS Stream object.

Parameters
Name Description
request 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 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 for more details and examples.

listLocationsAsync(request, options)

listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;

Lists information about the supported locations for this service. Returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<google.cloud.location.ILocation>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . 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 for more details and examples.

Example

const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
  // process response
}

listOperationsAsync(request, options)

listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. Returns an iterable object.

For-await-of syntax is used with the iterable to recursively get response element on-demand.

Parameters
Name Description
request ListOperationsRequest

The request object that will be sent.

options CallOptions

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

Returns
Type Description
AsyncIterable<protos.google.longrunning.IOperation>

{Object} An iterable Object that conforms to iteration protocols.

Example

const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)

listSchedules(request, options)

listSchedules(request?: protos.google.cloud.notebooks.v1.IListSchedulesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.notebooks.v1.ISchedule[],
        protos.google.cloud.notebooks.v1.IListSchedulesRequest | null,
        protos.google.cloud.notebooks.v1.IListSchedulesResponse
    ]>;

Lists schedules in a given project and location.

Parameters
Name Description
request IListSchedulesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.notebooks.v1.ISchedule[], protos.google.cloud.notebooks.v1.IListSchedulesRequest | null, protos.google.cloud.notebooks.v1.IListSchedulesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . 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 listSchedulesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listSchedules(request, options, callback)

listSchedules(request: protos.google.cloud.notebooks.v1.IListSchedulesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.notebooks.v1.IListSchedulesRequest, protos.google.cloud.notebooks.v1.IListSchedulesResponse | null | undefined, protos.google.cloud.notebooks.v1.ISchedule>): void;
Parameters
Name Description
request IListSchedulesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.notebooks.v1.IListSchedulesRequest, protos.google.cloud.notebooks.v1.IListSchedulesResponse | null | undefined, protos.google.cloud.notebooks.v1.ISchedule>
Returns
Type Description
void

listSchedules(request, callback)

listSchedules(request: protos.google.cloud.notebooks.v1.IListSchedulesRequest, callback: PaginationCallback<protos.google.cloud.notebooks.v1.IListSchedulesRequest, protos.google.cloud.notebooks.v1.IListSchedulesResponse | null | undefined, protos.google.cloud.notebooks.v1.ISchedule>): void;
Parameters
Name Description
request IListSchedulesRequest
callback PaginationCallback<protos.google.cloud.notebooks.v1.IListSchedulesRequest, protos.google.cloud.notebooks.v1.IListSchedulesResponse | null | undefined, protos.google.cloud.notebooks.v1.ISchedule>
Returns
Type Description
void

listSchedulesAsync(request, options)

listSchedulesAsync(request?: protos.google.cloud.notebooks.v1.IListSchedulesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.notebooks.v1.ISchedule>;

Equivalent to listSchedules, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request IListSchedulesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.notebooks.v1.ISchedule>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . 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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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'
  /**
   *  Filter applied to resulting schedules.
   */
  // const filter = 'abc123'
  /**
   *  Field to order results by.
   */
  // const orderBy = 'abc123'

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callListSchedules() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = notebooksClient.listSchedulesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListSchedules();

listSchedulesStream(request, options)

listSchedulesStream(request?: protos.google.cloud.notebooks.v1.IListSchedulesRequest, options?: CallOptions): Transform;

Equivalent to listSchedules, but returns a NodeJS Stream object.

Parameters
Name Description
request IListSchedulesRequest

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 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 listSchedulesAsync() method described below for async iteration which you can stop as needed. Please see the documentation 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.

matchExecutionFromExecutionName(executionName)

matchExecutionFromExecutionName(executionName: string): string | number;

Parse the execution from Execution resource.

Parameter
Name Description
executionName string

A fully-qualified path representing Execution resource.

Returns
Type Description
string | number

{string} A string representing the execution.

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.

matchLocationFromExecutionName(executionName)

matchLocationFromExecutionName(executionName: string): string | number;

Parse the location from Execution resource.

Parameter
Name Description
executionName string

A fully-qualified path representing Execution resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromRuntimeName(runtimeName)

matchLocationFromRuntimeName(runtimeName: string): string | number;

Parse the location from Runtime resource.

Parameter
Name Description
runtimeName string

A fully-qualified path representing Runtime resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromScheduleName(scheduleName)

matchLocationFromScheduleName(scheduleName: string): string | number;

Parse the location from Schedule resource.

Parameter
Name Description
scheduleName string

A fully-qualified path representing Schedule resource.

Returns
Type Description
string | number

{string} A string representing the location.

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.

matchProjectFromExecutionName(executionName)

matchProjectFromExecutionName(executionName: string): string | number;

Parse the project from Execution resource.

Parameter
Name Description
executionName string

A fully-qualified path representing Execution 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.

matchProjectFromRuntimeName(runtimeName)

matchProjectFromRuntimeName(runtimeName: string): string | number;

Parse the project from Runtime resource.

Parameter
Name Description
runtimeName string

A fully-qualified path representing Runtime resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromScheduleName(scheduleName)

matchProjectFromScheduleName(scheduleName: string): string | number;

Parse the project from Schedule resource.

Parameter
Name Description
scheduleName string

A fully-qualified path representing Schedule resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchRuntimeFromRuntimeName(runtimeName)

matchRuntimeFromRuntimeName(runtimeName: string): string | number;

Parse the runtime from Runtime resource.

Parameter
Name Description
runtimeName string

A fully-qualified path representing Runtime resource.

Returns
Type Description
string | number

{string} A string representing the runtime.

matchScheduleFromScheduleName(scheduleName)

matchScheduleFromScheduleName(scheduleName: string): string | number;

Parse the schedule from Schedule resource.

Parameter
Name Description
scheduleName string

A fully-qualified path representing Schedule resource.

Returns
Type Description
string | number

{string} A string representing the schedule.

registerInstance(request, options)

registerInstance(request?: protos.google.cloud.notebooks.v1.IRegisterInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.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 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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.IRegisterInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRegisterInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

registerInstance(request, callback)

registerInstance(request: protos.google.cloud.notebooks.v1.IRegisterInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRegisterInstanceRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

reportInstanceInfo(request, options)

reportInstanceInfo(request?: protos.google.cloud.notebooks.v1.IReportInstanceInfoRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.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 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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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 = [1,2,3,4]

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // 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.v1.IReportInstanceInfoRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IReportInstanceInfoRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

reportInstanceInfo(request, callback)

reportInstanceInfo(request: protos.google.cloud.notebooks.v1.IReportInstanceInfoRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IReportInstanceInfoRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

resetInstance(request, options)

resetInstance(request?: protos.google.cloud.notebooks.v1.IResetInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Resets a notebook instance.

Parameters
Name Description
request 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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.IResetInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IResetInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

resetInstance(request, callback)

resetInstance(request: protos.google.cloud.notebooks.v1.IResetInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IResetInstanceRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

rollbackInstance(request, options)

rollbackInstance(request?: protos.google.cloud.notebooks.v1.IRollbackInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Rollbacks a notebook instance to the previous version.

Parameters
Name Description
request IRollbackInstanceRequest

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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const name = 'abc123'
  /**
   *  Required. The snapshot for rollback.
   *  Example: `projects/test-project/global/snapshots/krwlzipynril`.
   */
  // const targetSnapshot = 'abc123'

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callRollbackInstance() {
    // Construct request
    const request = {
      name,
      targetSnapshot,
    };

    // Run request
    const [operation] = await notebooksClient.rollbackInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callRollbackInstance();

rollbackInstance(request, options, callback)

rollbackInstance(request: protos.google.cloud.notebooks.v1.IRollbackInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRollbackInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

rollbackInstance(request, callback)

rollbackInstance(request: protos.google.cloud.notebooks.v1.IRollbackInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRollbackInstanceRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

runtimePath(project, location, runtime)

runtimePath(project: string, location: string, runtime: string): string;

Return a fully-qualified runtime resource name string.

Parameters
Name Description
project string
location string
runtime string
Returns
Type Description
string

{string} Resource name string.

schedulePath(project, location, schedule)

schedulePath(project: string, location: string, schedule: string): string;

Return a fully-qualified schedule resource name string.

Parameters
Name Description
project string
location string
schedule string
Returns
Type Description
string

{string} Resource name string.

setIamPolicy(request, options, callback)

setIamPolicy(request: IamProtos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
Name Description
request IamProtos.google.iam.v1.SetIamPolicyRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
Type Description
Promise<[google.iam.v1.Policy]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

setInstanceAccelerator(request, options)

setInstanceAccelerator(request?: protos.google.cloud.notebooks.v1.ISetInstanceAcceleratorRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates the guest accelerators of a single Instance.

Parameters
Name Description
request 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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.ISetInstanceAcceleratorRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ISetInstanceAcceleratorRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

setInstanceAccelerator(request, callback)

setInstanceAccelerator(request: protos.google.cloud.notebooks.v1.ISetInstanceAcceleratorRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ISetInstanceAcceleratorRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

setInstanceLabels(request, options)

setInstanceLabels(request?: protos.google.cloud.notebooks.v1.ISetInstanceLabelsRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Replaces all the labels of an Instance.

Parameters
Name Description
request 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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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 = [1,2,3,4]

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // 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.v1.ISetInstanceLabelsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ISetInstanceLabelsRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

setInstanceLabels(request, callback)

setInstanceLabels(request: protos.google.cloud.notebooks.v1.ISetInstanceLabelsRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ISetInstanceLabelsRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

setInstanceMachineType(request, options)

setInstanceMachineType(request?: protos.google.cloud.notebooks.v1.ISetInstanceMachineTypeRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates the machine type of a single Instance.

Parameters
Name Description
request 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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.ISetInstanceMachineTypeRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ISetInstanceMachineTypeRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

setInstanceMachineType(request, callback)

setInstanceMachineType(request: protos.google.cloud.notebooks.v1.ISetInstanceMachineTypeRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ISetInstanceMachineTypeRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

startInstance(request, options)

startInstance(request?: protos.google.cloud.notebooks.v1.IStartInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Starts a notebook instance.

Parameters
Name Description
request 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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.IStartInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IStartInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

startInstance(request, callback)

startInstance(request: protos.google.cloud.notebooks.v1.IStartInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IStartInstanceRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

stopInstance(request, options)

stopInstance(request?: protos.google.cloud.notebooks.v1.IStopInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Stops a notebook instance.

Parameters
Name Description
request 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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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').v1;

  // 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.v1.IStopInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IStopInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

stopInstance(request, callback)

stopInstance(request: protos.google.cloud.notebooks.v1.IStopInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IStopInstanceRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

testIamPermissions(request, options, callback)

testIamPermissions(request: IamProtos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]>;

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
Name Description
request IamProtos.google.iam.v1.TestIamPermissionsRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
Type Description
Promise<[google.iam.v1.TestIamPermissionsResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

triggerSchedule(request, options)

triggerSchedule(request?: protos.google.cloud.notebooks.v1.ITriggerScheduleRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Triggers execution of an existing schedule.

Parameters
Name Description
request ITriggerScheduleRequest

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.v1.ISchedule, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `parent=projects/{project_id}/locations/{location}/schedules/{schedule_id}`
   */
  // const name = 'abc123'

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callTriggerSchedule() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await notebooksClient.triggerSchedule(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callTriggerSchedule();

triggerSchedule(request, options, callback)

triggerSchedule(request: protos.google.cloud.notebooks.v1.ITriggerScheduleRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ITriggerScheduleRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

triggerSchedule(request, callback)

triggerSchedule(request: protos.google.cloud.notebooks.v1.ITriggerScheduleRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ITriggerScheduleRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.ISchedule, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateInstanceConfig(request, options)

updateInstanceConfig(request?: protos.google.cloud.notebooks.v1.IUpdateInstanceConfigRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Update Notebook Instance configurations.

Parameters
Name Description
request IUpdateInstanceConfigRequest

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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const name = 'abc123'
  /**
   *  The instance configurations to be updated.
   */
  // const config = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callUpdateInstanceConfig() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await notebooksClient.updateInstanceConfig(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateInstanceConfig();

updateInstanceConfig(request, options, callback)

updateInstanceConfig(request: protos.google.cloud.notebooks.v1.IUpdateInstanceConfigRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateInstanceConfigRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateInstanceConfig(request, callback)

updateInstanceConfig(request: protos.google.cloud.notebooks.v1.IUpdateInstanceConfigRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateInstanceConfigRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateInstanceMetadataItems(request, options)

updateInstanceMetadataItems(request?: protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsResponse,
        (protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsRequest | undefined),
        {} | undefined
    ]>;

Add/update metadata items for an instance.

Parameters
Name Description
request IUpdateInstanceMetadataItemsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsResponse, (protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing UpdateInstanceMetadataItemsResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const name = 'abc123'
  /**
   *  Metadata items to add/update for the instance.
   */
  // const items = [1,2,3,4]

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callUpdateInstanceMetadataItems() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await notebooksClient.updateInstanceMetadataItems(request);
    console.log(response);
  }

  callUpdateInstanceMetadataItems();

updateInstanceMetadataItems(request, options, callback)

updateInstanceMetadataItems(request: protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsRequest, options: CallOptions, callback: Callback<protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsResponse, protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateInstanceMetadataItemsRequest
options CallOptions
callback Callback<protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsResponse, protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateInstanceMetadataItems(request, callback)

updateInstanceMetadataItems(request: protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsRequest, callback: Callback<protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsResponse, protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateInstanceMetadataItemsRequest
callback Callback<protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsResponse, protos.google.cloud.notebooks.v1.IUpdateInstanceMetadataItemsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateShieldedInstanceConfig(request, options)

updateShieldedInstanceConfig(request?: protos.google.cloud.notebooks.v1.IUpdateShieldedInstanceConfigRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates the Shielded instance configuration of a single Instance.

Parameters
Name Description
request IUpdateShieldedInstanceConfigRequest

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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const name = 'abc123'
  /**
   *  ShieldedInstance configuration to be updated.
   */
  // const shieldedInstanceConfig = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // Instantiates a client
  const notebooksClient = new NotebookServiceClient();

  async function callUpdateShieldedInstanceConfig() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await notebooksClient.updateShieldedInstanceConfig(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateShieldedInstanceConfig();

updateShieldedInstanceConfig(request, options, callback)

updateShieldedInstanceConfig(request: protos.google.cloud.notebooks.v1.IUpdateShieldedInstanceConfigRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateShieldedInstanceConfigRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateShieldedInstanceConfig(request, callback)

updateShieldedInstanceConfig(request: protos.google.cloud.notebooks.v1.IUpdateShieldedInstanceConfigRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateShieldedInstanceConfigRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

upgradeInstance(request, options)

upgradeInstance(request?: protos.google.cloud.notebooks.v1.IUpgradeInstanceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Upgrades a notebook instance to the latest version.

Parameters
Name Description
request 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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Format:
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const name = 'abc123'
  /**
   *  Optional. The optional UpgradeType. Setting this field will search for additional
   *  compute images to upgrade this instance.
   */
  // const type = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // 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.v1.IUpgradeInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpgradeInstanceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

upgradeInstance(request, callback)

upgradeInstance(request: protos.google.cloud.notebooks.v1.IUpgradeInstanceRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpgradeInstanceRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

upgradeInstanceInternal(request, options)

upgradeInstanceInternal(request?: protos.google.cloud.notebooks.v1.IUpgradeInstanceInternalRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.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 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.v1.IInstance, protos.google.cloud.notebooks.v1.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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * 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'
  /**
   *  Optional. The optional UpgradeType. Setting this field will search for additional
   *  compute images to upgrade this instance.
   */
  // const type = {}

  // Imports the Notebooks library
  const {NotebookServiceClient} = require('@google-cloud/notebooks').v1;

  // 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.v1.IUpgradeInstanceInternalRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpgradeInstanceInternalRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

upgradeInstanceInternal(request, callback)

upgradeInstanceInternal(request: protos.google.cloud.notebooks.v1.IUpgradeInstanceInternalRequest, callback: Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpgradeInstanceInternalRequest
callback Callback<LROperation<protos.google.cloud.notebooks.v1.IInstance, protos.google.cloud.notebooks.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void