Class v2.MigrationServiceClient (1.0.1)

Service to handle EDW migrations. v2

Package

@google-cloud/bigquery-migration

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of MigrationServiceClient.

Parameters
NameDescription
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 MigrationServiceClient({fallback: true}, gax); ```

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

innerApiCalls

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

migrationServiceStub

migrationServiceStub?: Promise<{
        [name: string]: Function;
    }>;

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

warn

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

Methods

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
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

createMigrationWorkflow(request, options)

createMigrationWorkflow(request?: protos.google.cloud.bigquery.migration.v2.ICreateMigrationWorkflowRequest, options?: CallOptions): Promise<[
        protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow,
        (protos.google.cloud.bigquery.migration.v2.ICreateMigrationWorkflowRequest | undefined),
        {} | undefined
    ]>;

Creates a migration workflow.

Parameters
NameDescription
request ICreateMigrationWorkflowRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, (protos.google.cloud.bigquery.migration.v2.ICreateMigrationWorkflowRequest | 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. The name of the project to which this migration workflow belongs.
   *  Example: `projects/foo/locations/bar`
   */
  // const parent = 'abc123'
  /**
   *  Required. The migration workflow to create.
   */
  // const migrationWorkflow = {}

  // Imports the Migration library
  const {MigrationServiceClient} = require('@google-cloud/bigquery-migration').v2;

  // Instantiates a client
  const migrationClient = new MigrationServiceClient();

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

    // Run request
    const response = await migrationClient.createMigrationWorkflow(request);
    console.log(response);
  }

  callCreateMigrationWorkflow();

createMigrationWorkflow(request, options, callback)

createMigrationWorkflow(request: protos.google.cloud.bigquery.migration.v2.ICreateMigrationWorkflowRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, protos.google.cloud.bigquery.migration.v2.ICreateMigrationWorkflowRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateMigrationWorkflowRequest
options CallOptions
callback Callback<protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, protos.google.cloud.bigquery.migration.v2.ICreateMigrationWorkflowRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createMigrationWorkflow(request, callback)

createMigrationWorkflow(request: protos.google.cloud.bigquery.migration.v2.ICreateMigrationWorkflowRequest, callback: Callback<protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, protos.google.cloud.bigquery.migration.v2.ICreateMigrationWorkflowRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateMigrationWorkflowRequest
callback Callback<protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, protos.google.cloud.bigquery.migration.v2.ICreateMigrationWorkflowRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteMigrationWorkflow(request, options)

deleteMigrationWorkflow(request?: protos.google.cloud.bigquery.migration.v2.IDeleteMigrationWorkflowRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        (protos.google.cloud.bigquery.migration.v2.IDeleteMigrationWorkflowRequest | undefined),
        {} | undefined
    ]>;

Deletes a migration workflow by name.

Parameters
NameDescription
request IDeleteMigrationWorkflowRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.bigquery.migration.v2.IDeleteMigrationWorkflowRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. 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. The unique identifier for the migration workflow.
   *  Example: `projects/123/locations/us/workflows/1234`
   */
  // const name = 'abc123'

  // Imports the Migration library
  const {MigrationServiceClient} = require('@google-cloud/bigquery-migration').v2;

  // Instantiates a client
  const migrationClient = new MigrationServiceClient();

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

    // Run request
    const response = await migrationClient.deleteMigrationWorkflow(request);
    console.log(response);
  }

  callDeleteMigrationWorkflow();

deleteMigrationWorkflow(request, options, callback)

deleteMigrationWorkflow(request: protos.google.cloud.bigquery.migration.v2.IDeleteMigrationWorkflowRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.migration.v2.IDeleteMigrationWorkflowRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteMigrationWorkflowRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.migration.v2.IDeleteMigrationWorkflowRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteMigrationWorkflow(request, callback)

deleteMigrationWorkflow(request: protos.google.cloud.bigquery.migration.v2.IDeleteMigrationWorkflowRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.migration.v2.IDeleteMigrationWorkflowRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteMigrationWorkflowRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.migration.v2.IDeleteMigrationWorkflowRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getMigrationSubtask(request, options)

getMigrationSubtask(request?: protos.google.cloud.bigquery.migration.v2.IGetMigrationSubtaskRequest, options?: CallOptions): Promise<[
        protos.google.cloud.bigquery.migration.v2.IMigrationSubtask,
        (protos.google.cloud.bigquery.migration.v2.IGetMigrationSubtaskRequest | undefined),
        {} | undefined
    ]>;

Gets a previously created migration subtask.

Parameters
NameDescription
request IGetMigrationSubtaskRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.bigquery.migration.v2.IMigrationSubtask, (protos.google.cloud.bigquery.migration.v2.IGetMigrationSubtaskRequest | 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. The unique identifier for the migration subtask.
   *  Example: `projects/123/locations/us/workflows/1234/subtasks/543`
   */
  // const name = 'abc123'
  /**
   *  Optional. The list of fields to be retrieved.
   */
  // const readMask = {}

  // Imports the Migration library
  const {MigrationServiceClient} = require('@google-cloud/bigquery-migration').v2;

  // Instantiates a client
  const migrationClient = new MigrationServiceClient();

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

    // Run request
    const response = await migrationClient.getMigrationSubtask(request);
    console.log(response);
  }

  callGetMigrationSubtask();

getMigrationSubtask(request, options, callback)

getMigrationSubtask(request: protos.google.cloud.bigquery.migration.v2.IGetMigrationSubtaskRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.migration.v2.IMigrationSubtask, protos.google.cloud.bigquery.migration.v2.IGetMigrationSubtaskRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetMigrationSubtaskRequest
options CallOptions
callback Callback<protos.google.cloud.bigquery.migration.v2.IMigrationSubtask, protos.google.cloud.bigquery.migration.v2.IGetMigrationSubtaskRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getMigrationSubtask(request, callback)

getMigrationSubtask(request: protos.google.cloud.bigquery.migration.v2.IGetMigrationSubtaskRequest, callback: Callback<protos.google.cloud.bigquery.migration.v2.IMigrationSubtask, protos.google.cloud.bigquery.migration.v2.IGetMigrationSubtaskRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetMigrationSubtaskRequest
callback Callback<protos.google.cloud.bigquery.migration.v2.IMigrationSubtask, protos.google.cloud.bigquery.migration.v2.IGetMigrationSubtaskRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getMigrationWorkflow(request, options)

getMigrationWorkflow(request?: protos.google.cloud.bigquery.migration.v2.IGetMigrationWorkflowRequest, options?: CallOptions): Promise<[
        protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow,
        (protos.google.cloud.bigquery.migration.v2.IGetMigrationWorkflowRequest | undefined),
        {} | undefined
    ]>;

Gets a previously created migration workflow.

Parameters
NameDescription
request IGetMigrationWorkflowRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, (protos.google.cloud.bigquery.migration.v2.IGetMigrationWorkflowRequest | 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. The unique identifier for the migration workflow.
   *  Example: `projects/123/locations/us/workflows/1234`
   */
  // const name = 'abc123'
  /**
   *  The list of fields to be retrieved.
   */
  // const readMask = {}

  // Imports the Migration library
  const {MigrationServiceClient} = require('@google-cloud/bigquery-migration').v2;

  // Instantiates a client
  const migrationClient = new MigrationServiceClient();

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

    // Run request
    const response = await migrationClient.getMigrationWorkflow(request);
    console.log(response);
  }

  callGetMigrationWorkflow();

getMigrationWorkflow(request, options, callback)

getMigrationWorkflow(request: protos.google.cloud.bigquery.migration.v2.IGetMigrationWorkflowRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, protos.google.cloud.bigquery.migration.v2.IGetMigrationWorkflowRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetMigrationWorkflowRequest
options CallOptions
callback Callback<protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, protos.google.cloud.bigquery.migration.v2.IGetMigrationWorkflowRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getMigrationWorkflow(request, callback)

getMigrationWorkflow(request: protos.google.cloud.bigquery.migration.v2.IGetMigrationWorkflowRequest, callback: Callback<protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, protos.google.cloud.bigquery.migration.v2.IGetMigrationWorkflowRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetMigrationWorkflowRequest
callback Callback<protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, protos.google.cloud.bigquery.migration.v2.IGetMigrationWorkflowRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
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
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

listMigrationSubtasks(request, options)

listMigrationSubtasks(request?: protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest, options?: CallOptions): Promise<[
        protos.google.cloud.bigquery.migration.v2.IMigrationSubtask[],
        protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest | null,
        protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksResponse
    ]>;

Lists previously created migration subtasks.

Parameters
NameDescription
request IListMigrationSubtasksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.bigquery.migration.v2.IMigrationSubtask[], protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest | null, protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksResponse ]>

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

listMigrationSubtasks(request, options, callback)

listMigrationSubtasks(request: protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest, protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksResponse | null | undefined, protos.google.cloud.bigquery.migration.v2.IMigrationSubtask>): void;
Parameters
NameDescription
request IListMigrationSubtasksRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest, protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksResponse | null | undefined, protos.google.cloud.bigquery.migration.v2.IMigrationSubtask>
Returns
TypeDescription
void

listMigrationSubtasks(request, callback)

listMigrationSubtasks(request: protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest, callback: PaginationCallback<protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest, protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksResponse | null | undefined, protos.google.cloud.bigquery.migration.v2.IMigrationSubtask>): void;
Parameters
NameDescription
request IListMigrationSubtasksRequest
callback PaginationCallback<protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest, protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksResponse | null | undefined, protos.google.cloud.bigquery.migration.v2.IMigrationSubtask>
Returns
TypeDescription
void

listMigrationSubtasksAsync(request, options)

listMigrationSubtasksAsync(request?: protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.bigquery.migration.v2.IMigrationSubtask>;

Equivalent to listMigrationSubtasks, but returns an iterable object.

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

Parameters
NameDescription
request IListMigrationSubtasksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.bigquery.migration.v2.IMigrationSubtask>

{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. The migration task of the subtasks to list.
   *  Example: `projects/123/locations/us/workflows/1234`
   */
  // const parent = 'abc123'
  /**
   *  Optional. The list of fields to be retrieved.
   */
  // const readMask = {}
  /**
   *  Optional. The maximum number of migration tasks to return. The service may
   *  return fewer than this number.
   */
  // const pageSize = 1234
  /**
   *  Optional. A page token, received from previous `ListMigrationSubtasks`
   *  call. Provide this to retrieve the subsequent page.
   *  When paginating, all other parameters provided to `ListMigrationSubtasks`
   *  must match the call that provided the page token.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. The filter to apply. This can be used to get the subtasks of a
   *  specific tasks in a workflow, e.g. `migration_task = "ab012"` where
   *  `"ab012"` is the task ID (not the name in the named map).
   */
  // const filter = 'abc123'

  // Imports the Migration library
  const {MigrationServiceClient} = require('@google-cloud/bigquery-migration').v2;

  // Instantiates a client
  const migrationClient = new MigrationServiceClient();

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

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

  callListMigrationSubtasks();

listMigrationSubtasksStream(request, options)

listMigrationSubtasksStream(request?: protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request IListMigrationSubtasksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

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

listMigrationWorkflows(request, options)

listMigrationWorkflows(request?: protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow[],
        protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest | null,
        protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsResponse
    ]>;

Lists previously created migration workflow.

Parameters
NameDescription
request IListMigrationWorkflowsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow[], protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest | null, protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsResponse ]>

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

listMigrationWorkflows(request, options, callback)

listMigrationWorkflows(request: protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest, protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsResponse | null | undefined, protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow>): void;
Parameters
NameDescription
request IListMigrationWorkflowsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest, protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsResponse | null | undefined, protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow>
Returns
TypeDescription
void

listMigrationWorkflows(request, callback)

listMigrationWorkflows(request: protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest, callback: PaginationCallback<protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest, protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsResponse | null | undefined, protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow>): void;
Parameters
NameDescription
request IListMigrationWorkflowsRequest
callback PaginationCallback<protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest, protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsResponse | null | undefined, protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow>
Returns
TypeDescription
void

listMigrationWorkflowsAsync(request, options)

listMigrationWorkflowsAsync(request?: protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow>;

Equivalent to listMigrationWorkflows, but returns an iterable object.

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

Parameters
NameDescription
request IListMigrationWorkflowsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The project and location of the migration workflows to list.
   *  Example: `projects/123/locations/us`
   */
  // const parent = 'abc123'
  /**
   *  The list of fields to be retrieved.
   */
  // const readMask = {}
  /**
   *  The maximum number of migration workflows to return. The service may return
   *  fewer than this number.
   */
  // const pageSize = 1234
  /**
   *  A page token, received from previous `ListMigrationWorkflows` call.
   *  Provide this to retrieve the subsequent page.
   *  When paginating, all other parameters provided to `ListMigrationWorkflows`
   *  must match the call that provided the page token.
   */
  // const pageToken = 'abc123'

  // Imports the Migration library
  const {MigrationServiceClient} =
    require('@google-cloud/bigquery-migration').v2;

  // Instantiates a client
  const migrationClient = new MigrationServiceClient();

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

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

  callListMigrationWorkflows();

listMigrationWorkflowsStream(request, options)

listMigrationWorkflowsStream(request?: protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request IListMigrationWorkflowsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

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

locationPath(project, location)

locationPath(project: string, location: string): string;

Return a fully-qualified location resource name string.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
string

{string} Resource name string.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromMigrationSubtaskName(migrationSubtaskName)

matchLocationFromMigrationSubtaskName(migrationSubtaskName: string): string | number;

Parse the location from MigrationSubtask resource.

Parameter
NameDescription
migrationSubtaskName string

A fully-qualified path representing MigrationSubtask resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromMigrationWorkflowName(migrationWorkflowName)

matchLocationFromMigrationWorkflowName(migrationWorkflowName: string): string | number;

Parse the location from MigrationWorkflow resource.

Parameter
NameDescription
migrationWorkflowName string

A fully-qualified path representing MigrationWorkflow resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromMigrationSubtaskName(migrationSubtaskName)

matchProjectFromMigrationSubtaskName(migrationSubtaskName: string): string | number;

Parse the project from MigrationSubtask resource.

Parameter
NameDescription
migrationSubtaskName string

A fully-qualified path representing MigrationSubtask resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromMigrationWorkflowName(migrationWorkflowName)

matchProjectFromMigrationWorkflowName(migrationWorkflowName: string): string | number;

Parse the project from MigrationWorkflow resource.

Parameter
NameDescription
migrationWorkflowName string

A fully-qualified path representing MigrationWorkflow resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchSubtaskFromMigrationSubtaskName(migrationSubtaskName)

matchSubtaskFromMigrationSubtaskName(migrationSubtaskName: string): string | number;

Parse the subtask from MigrationSubtask resource.

Parameter
NameDescription
migrationSubtaskName string

A fully-qualified path representing MigrationSubtask resource.

Returns
TypeDescription
string | number

{string} A string representing the subtask.

matchWorkflowFromMigrationSubtaskName(migrationSubtaskName)

matchWorkflowFromMigrationSubtaskName(migrationSubtaskName: string): string | number;

Parse the workflow from MigrationSubtask resource.

Parameter
NameDescription
migrationSubtaskName string

A fully-qualified path representing MigrationSubtask resource.

Returns
TypeDescription
string | number

{string} A string representing the workflow.

matchWorkflowFromMigrationWorkflowName(migrationWorkflowName)

matchWorkflowFromMigrationWorkflowName(migrationWorkflowName: string): string | number;

Parse the workflow from MigrationWorkflow resource.

Parameter
NameDescription
migrationWorkflowName string

A fully-qualified path representing MigrationWorkflow resource.

Returns
TypeDescription
string | number

{string} A string representing the workflow.

migrationSubtaskPath(project, location, workflow, subtask)

migrationSubtaskPath(project: string, location: string, workflow: string, subtask: string): string;

Return a fully-qualified migrationSubtask resource name string.

Parameters
NameDescription
project string
location string
workflow string
subtask string
Returns
TypeDescription
string

{string} Resource name string.

migrationWorkflowPath(project, location, workflow)

migrationWorkflowPath(project: string, location: string, workflow: string): string;

Return a fully-qualified migrationWorkflow resource name string.

Parameters
NameDescription
project string
location string
workflow string
Returns
TypeDescription
string

{string} Resource name string.

startMigrationWorkflow(request, options)

startMigrationWorkflow(request?: protos.google.cloud.bigquery.migration.v2.IStartMigrationWorkflowRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        (protos.google.cloud.bigquery.migration.v2.IStartMigrationWorkflowRequest | undefined),
        {} | undefined
    ]>;

Starts a previously created migration workflow. I.e., the state transitions from DRAFT to RUNNING. This is a no-op if the state is already RUNNING. An error will be signaled if the state is anything other than DRAFT or RUNNING.

Parameters
NameDescription
request IStartMigrationWorkflowRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.bigquery.migration.v2.IStartMigrationWorkflowRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. 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. The unique identifier for the migration workflow.
   *  Example: `projects/123/locations/us/workflows/1234`
   */
  // const name = 'abc123'

  // Imports the Migration library
  const {MigrationServiceClient} = require('@google-cloud/bigquery-migration').v2;

  // Instantiates a client
  const migrationClient = new MigrationServiceClient();

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

    // Run request
    const response = await migrationClient.startMigrationWorkflow(request);
    console.log(response);
  }

  callStartMigrationWorkflow();

startMigrationWorkflow(request, options, callback)

startMigrationWorkflow(request: protos.google.cloud.bigquery.migration.v2.IStartMigrationWorkflowRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.migration.v2.IStartMigrationWorkflowRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IStartMigrationWorkflowRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.migration.v2.IStartMigrationWorkflowRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

startMigrationWorkflow(request, callback)

startMigrationWorkflow(request: protos.google.cloud.bigquery.migration.v2.IStartMigrationWorkflowRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.migration.v2.IStartMigrationWorkflowRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IStartMigrationWorkflowRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.migration.v2.IStartMigrationWorkflowRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void