@google-cloud/dms 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2021 Google LLC
2
+ // Copyright 2022 Google LLC
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -300,23 +300,6 @@ class DataMigrationServiceClient {
300
300
  }
301
301
  return this.auth.getProjectId();
302
302
  }
303
- /**
304
- * Gets details of a single migration job.
305
- *
306
- * @param {Object} request
307
- * The request object that will be sent.
308
- * @param {string} request.name
309
- * Required. Name of the migration job resource to get.
310
- * @param {object} [options]
311
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
312
- * @returns {Promise} - The promise which resolves to an array.
313
- * The first element of the array is an object representing [MigrationJob]{@link google.cloud.clouddms.v1.MigrationJob}.
314
- * Please see the
315
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
316
- * for more details and examples.
317
- * @example
318
- * const [response] = await client.getMigrationJob(request);
319
- */
320
303
  getMigrationJob(request, optionsOrCallback, callback) {
321
304
  request = request || {};
322
305
  let options;
@@ -337,32 +320,6 @@ class DataMigrationServiceClient {
337
320
  this.initialize();
338
321
  return this.innerApiCalls.getMigrationJob(request, options, callback);
339
322
  }
340
- /**
341
- * Generate a SSH configuration script to configure the reverse SSH
342
- * connectivity.
343
- *
344
- * @param {Object} request
345
- * The request object that will be sent.
346
- * @param {string} request.migrationJob
347
- * Name of the migration job resource to generate the SSH script.
348
- * @param {string} request.vm
349
- * Required. Bastion VM Instance name to use or to create.
350
- * @param {google.cloud.clouddms.v1.VmCreationConfig} request.vmCreationConfig
351
- * The VM creation configuration
352
- * @param {google.cloud.clouddms.v1.VmSelectionConfig} request.vmSelectionConfig
353
- * The VM selection configuration
354
- * @param {number} request.vmPort
355
- * The port that will be open on the bastion host
356
- * @param {object} [options]
357
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
358
- * @returns {Promise} - The promise which resolves to an array.
359
- * The first element of the array is an object representing [SshScript]{@link google.cloud.clouddms.v1.SshScript}.
360
- * Please see the
361
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
362
- * for more details and examples.
363
- * @example
364
- * const [response] = await client.generateSshScript(request);
365
- */
366
323
  generateSshScript(request, optionsOrCallback, callback) {
367
324
  request = request || {};
368
325
  let options;
@@ -383,23 +340,6 @@ class DataMigrationServiceClient {
383
340
  this.initialize();
384
341
  return this.innerApiCalls.generateSshScript(request, options, callback);
385
342
  }
386
- /**
387
- * Gets details of a single connection profile.
388
- *
389
- * @param {Object} request
390
- * The request object that will be sent.
391
- * @param {string} request.name
392
- * Required. Name of the connection profile resource to get.
393
- * @param {object} [options]
394
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
395
- * @returns {Promise} - The promise which resolves to an array.
396
- * The first element of the array is an object representing [ConnectionProfile]{@link google.cloud.clouddms.v1.ConnectionProfile}.
397
- * Please see the
398
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
399
- * for more details and examples.
400
- * @example
401
- * const [response] = await client.getConnectionProfile(request);
402
- */
403
343
  getConnectionProfile(request, optionsOrCallback, callback) {
404
344
  request = request || {};
405
345
  let options;
@@ -420,40 +360,6 @@ class DataMigrationServiceClient {
420
360
  this.initialize();
421
361
  return this.innerApiCalls.getConnectionProfile(request, options, callback);
422
362
  }
423
- /**
424
- * Creates a new migration job in a given project and location.
425
- *
426
- * @param {Object} request
427
- * The request object that will be sent.
428
- * @param {string} request.parent
429
- * Required. The parent, which owns this collection of migration jobs.
430
- * @param {string} request.migrationJobId
431
- * Required. The ID of the instance to create.
432
- * @param {google.cloud.clouddms.v1.MigrationJob} request.migrationJob
433
- * Required. Represents a [migration
434
- * job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs)
435
- * object.
436
- * @param {string} request.requestId
437
- * A unique id used to identify the request. If the server receives two
438
- * requests with the same id, then the second request will be ignored.
439
- *
440
- * It is recommended to always set this value to a UUID.
441
- *
442
- * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores
443
- * (_), and hyphens (-). The maximum length is 40 characters.
444
- * @param {object} [options]
445
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
446
- * @returns {Promise} - The promise which resolves to an array.
447
- * The first element of the array is an object representing
448
- * a long running operation. Its `promise()` method returns a promise
449
- * you can `await` for.
450
- * Please see the
451
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
452
- * for more details and examples.
453
- * @example
454
- * const [operation] = await client.createMigrationJob(request);
455
- * const [response] = await operation.promise();
456
- */
457
363
  createMigrationJob(request, optionsOrCallback, callback) {
458
364
  request = request || {};
459
365
  let options;
@@ -483,11 +389,8 @@ class DataMigrationServiceClient {
483
389
  * Please see the
484
390
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
485
391
  * for more details and examples.
486
- * @example
487
- * const decodedOperation = await checkCreateMigrationJobProgress(name);
488
- * console.log(decodedOperation.result);
489
- * console.log(decodedOperation.done);
490
- * console.log(decodedOperation.metadata);
392
+ * @example <caption>include:samples/generated/v1/data_migration_service.create_migration_job.js</caption>
393
+ * region_tag:datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async
491
394
  */
492
395
  async checkCreateMigrationJobProgress(name) {
493
396
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
@@ -495,37 +398,6 @@ class DataMigrationServiceClient {
495
398
  const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createMigrationJob, gax.createDefaultBackoffSettings());
496
399
  return decodeOperation;
497
400
  }
498
- /**
499
- * Updates the parameters of a single migration job.
500
- *
501
- * @param {Object} request
502
- * The request object that will be sent.
503
- * @param {google.protobuf.FieldMask} request.updateMask
504
- * Required. Field mask is used to specify the fields to be overwritten in the
505
- * migration job resource by the update.
506
- * @param {google.cloud.clouddms.v1.MigrationJob} request.migrationJob
507
- * Required. The migration job parameters to update.
508
- * @param {string} request.requestId
509
- * A unique id used to identify the request. If the server receives two
510
- * requests with the same id, then the second request will be ignored.
511
- *
512
- * It is recommended to always set this value to a UUID.
513
- *
514
- * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores
515
- * (_), and hyphens (-). The maximum length is 40 characters.
516
- * @param {object} [options]
517
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
518
- * @returns {Promise} - The promise which resolves to an array.
519
- * The first element of the array is an object representing
520
- * a long running operation. Its `promise()` method returns a promise
521
- * you can `await` for.
522
- * Please see the
523
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
524
- * for more details and examples.
525
- * @example
526
- * const [operation] = await client.updateMigrationJob(request);
527
- * const [response] = await operation.promise();
528
- */
529
401
  updateMigrationJob(request, optionsOrCallback, callback) {
530
402
  request = request || {};
531
403
  let options;
@@ -555,11 +427,8 @@ class DataMigrationServiceClient {
555
427
  * Please see the
556
428
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
557
429
  * for more details and examples.
558
- * @example
559
- * const decodedOperation = await checkUpdateMigrationJobProgress(name);
560
- * console.log(decodedOperation.result);
561
- * console.log(decodedOperation.done);
562
- * console.log(decodedOperation.metadata);
430
+ * @example <caption>include:samples/generated/v1/data_migration_service.update_migration_job.js</caption>
431
+ * region_tag:datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async
563
432
  */
564
433
  async checkUpdateMigrationJobProgress(name) {
565
434
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
@@ -567,38 +436,6 @@ class DataMigrationServiceClient {
567
436
  const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateMigrationJob, gax.createDefaultBackoffSettings());
568
437
  return decodeOperation;
569
438
  }
570
- /**
571
- * Deletes a single migration job.
572
- *
573
- * @param {Object} request
574
- * The request object that will be sent.
575
- * @param {string} request.name
576
- * Required. Name of the migration job resource to delete.
577
- * @param {string} request.requestId
578
- * A unique id used to identify the request. If the server receives two
579
- * requests with the same id, then the second request will be ignored.
580
- *
581
- * It is recommended to always set this value to a UUID.
582
- *
583
- * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores
584
- * (_), and hyphens (-). The maximum length is 40 characters.
585
- * @param {boolean} request.force
586
- * The destination CloudSQL connection profile is always deleted with the
587
- * migration job. In case of force delete, the destination CloudSQL replica
588
- * database is also deleted.
589
- * @param {object} [options]
590
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
591
- * @returns {Promise} - The promise which resolves to an array.
592
- * The first element of the array is an object representing
593
- * a long running operation. Its `promise()` method returns a promise
594
- * you can `await` for.
595
- * Please see the
596
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
597
- * for more details and examples.
598
- * @example
599
- * const [operation] = await client.deleteMigrationJob(request);
600
- * const [response] = await operation.promise();
601
- */
602
439
  deleteMigrationJob(request, optionsOrCallback, callback) {
603
440
  request = request || {};
604
441
  let options;
@@ -628,11 +465,8 @@ class DataMigrationServiceClient {
628
465
  * Please see the
629
466
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
630
467
  * for more details and examples.
631
- * @example
632
- * const decodedOperation = await checkDeleteMigrationJobProgress(name);
633
- * console.log(decodedOperation.result);
634
- * console.log(decodedOperation.done);
635
- * console.log(decodedOperation.metadata);
468
+ * @example <caption>include:samples/generated/v1/data_migration_service.delete_migration_job.js</caption>
469
+ * region_tag:datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async
636
470
  */
637
471
  async checkDeleteMigrationJobProgress(name) {
638
472
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
@@ -640,26 +474,6 @@ class DataMigrationServiceClient {
640
474
  const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteMigrationJob, gax.createDefaultBackoffSettings());
641
475
  return decodeOperation;
642
476
  }
643
- /**
644
- * Start an already created migration job.
645
- *
646
- * @param {Object} request
647
- * The request object that will be sent.
648
- * @param {string} request.name
649
- * Name of the migration job resource to start.
650
- * @param {object} [options]
651
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
652
- * @returns {Promise} - The promise which resolves to an array.
653
- * The first element of the array is an object representing
654
- * a long running operation. Its `promise()` method returns a promise
655
- * you can `await` for.
656
- * Please see the
657
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
658
- * for more details and examples.
659
- * @example
660
- * const [operation] = await client.startMigrationJob(request);
661
- * const [response] = await operation.promise();
662
- */
663
477
  startMigrationJob(request, optionsOrCallback, callback) {
664
478
  request = request || {};
665
479
  let options;
@@ -689,11 +503,8 @@ class DataMigrationServiceClient {
689
503
  * Please see the
690
504
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
691
505
  * for more details and examples.
692
- * @example
693
- * const decodedOperation = await checkStartMigrationJobProgress(name);
694
- * console.log(decodedOperation.result);
695
- * console.log(decodedOperation.done);
696
- * console.log(decodedOperation.metadata);
506
+ * @example <caption>include:samples/generated/v1/data_migration_service.start_migration_job.js</caption>
507
+ * region_tag:datamigration_v1_generated_DataMigrationService_StartMigrationJob_async
697
508
  */
698
509
  async checkStartMigrationJobProgress(name) {
699
510
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
@@ -701,26 +512,6 @@ class DataMigrationServiceClient {
701
512
  const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.startMigrationJob, gax.createDefaultBackoffSettings());
702
513
  return decodeOperation;
703
514
  }
704
- /**
705
- * Stops a running migration job.
706
- *
707
- * @param {Object} request
708
- * The request object that will be sent.
709
- * @param {string} request.name
710
- * Name of the migration job resource to stop.
711
- * @param {object} [options]
712
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
713
- * @returns {Promise} - The promise which resolves to an array.
714
- * The first element of the array is an object representing
715
- * a long running operation. Its `promise()` method returns a promise
716
- * you can `await` for.
717
- * Please see the
718
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
719
- * for more details and examples.
720
- * @example
721
- * const [operation] = await client.stopMigrationJob(request);
722
- * const [response] = await operation.promise();
723
- */
724
515
  stopMigrationJob(request, optionsOrCallback, callback) {
725
516
  request = request || {};
726
517
  let options;
@@ -750,11 +541,8 @@ class DataMigrationServiceClient {
750
541
  * Please see the
751
542
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
752
543
  * for more details and examples.
753
- * @example
754
- * const decodedOperation = await checkStopMigrationJobProgress(name);
755
- * console.log(decodedOperation.result);
756
- * console.log(decodedOperation.done);
757
- * console.log(decodedOperation.metadata);
544
+ * @example <caption>include:samples/generated/v1/data_migration_service.stop_migration_job.js</caption>
545
+ * region_tag:datamigration_v1_generated_DataMigrationService_StopMigrationJob_async
758
546
  */
759
547
  async checkStopMigrationJobProgress(name) {
760
548
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
@@ -762,27 +550,6 @@ class DataMigrationServiceClient {
762
550
  const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.stopMigrationJob, gax.createDefaultBackoffSettings());
763
551
  return decodeOperation;
764
552
  }
765
- /**
766
- * Resume a migration job that is currently stopped and is resumable (was
767
- * stopped during CDC phase).
768
- *
769
- * @param {Object} request
770
- * The request object that will be sent.
771
- * @param {string} request.name
772
- * Name of the migration job resource to resume.
773
- * @param {object} [options]
774
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
775
- * @returns {Promise} - The promise which resolves to an array.
776
- * The first element of the array is an object representing
777
- * a long running operation. Its `promise()` method returns a promise
778
- * you can `await` for.
779
- * Please see the
780
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
781
- * for more details and examples.
782
- * @example
783
- * const [operation] = await client.resumeMigrationJob(request);
784
- * const [response] = await operation.promise();
785
- */
786
553
  resumeMigrationJob(request, optionsOrCallback, callback) {
787
554
  request = request || {};
788
555
  let options;
@@ -812,11 +579,8 @@ class DataMigrationServiceClient {
812
579
  * Please see the
813
580
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
814
581
  * for more details and examples.
815
- * @example
816
- * const decodedOperation = await checkResumeMigrationJobProgress(name);
817
- * console.log(decodedOperation.result);
818
- * console.log(decodedOperation.done);
819
- * console.log(decodedOperation.metadata);
582
+ * @example <caption>include:samples/generated/v1/data_migration_service.resume_migration_job.js</caption>
583
+ * region_tag:datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async
820
584
  */
821
585
  async checkResumeMigrationJobProgress(name) {
822
586
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
@@ -824,27 +588,6 @@ class DataMigrationServiceClient {
824
588
  const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.resumeMigrationJob, gax.createDefaultBackoffSettings());
825
589
  return decodeOperation;
826
590
  }
827
- /**
828
- * Promote a migration job, stopping replication to the destination and
829
- * promoting the destination to be a standalone database.
830
- *
831
- * @param {Object} request
832
- * The request object that will be sent.
833
- * @param {string} request.name
834
- * Name of the migration job resource to promote.
835
- * @param {object} [options]
836
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
837
- * @returns {Promise} - The promise which resolves to an array.
838
- * The first element of the array is an object representing
839
- * a long running operation. Its `promise()` method returns a promise
840
- * you can `await` for.
841
- * Please see the
842
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
843
- * for more details and examples.
844
- * @example
845
- * const [operation] = await client.promoteMigrationJob(request);
846
- * const [response] = await operation.promise();
847
- */
848
591
  promoteMigrationJob(request, optionsOrCallback, callback) {
849
592
  request = request || {};
850
593
  let options;
@@ -874,11 +617,8 @@ class DataMigrationServiceClient {
874
617
  * Please see the
875
618
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
876
619
  * for more details and examples.
877
- * @example
878
- * const decodedOperation = await checkPromoteMigrationJobProgress(name);
879
- * console.log(decodedOperation.result);
880
- * console.log(decodedOperation.done);
881
- * console.log(decodedOperation.metadata);
620
+ * @example <caption>include:samples/generated/v1/data_migration_service.promote_migration_job.js</caption>
621
+ * region_tag:datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async
882
622
  */
883
623
  async checkPromoteMigrationJobProgress(name) {
884
624
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
@@ -886,27 +626,6 @@ class DataMigrationServiceClient {
886
626
  const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.promoteMigrationJob, gax.createDefaultBackoffSettings());
887
627
  return decodeOperation;
888
628
  }
889
- /**
890
- * Verify a migration job, making sure the destination can reach the source
891
- * and that all configuration and prerequisites are met.
892
- *
893
- * @param {Object} request
894
- * The request object that will be sent.
895
- * @param {string} request.name
896
- * Name of the migration job resource to verify.
897
- * @param {object} [options]
898
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
899
- * @returns {Promise} - The promise which resolves to an array.
900
- * The first element of the array is an object representing
901
- * a long running operation. Its `promise()` method returns a promise
902
- * you can `await` for.
903
- * Please see the
904
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
905
- * for more details and examples.
906
- * @example
907
- * const [operation] = await client.verifyMigrationJob(request);
908
- * const [response] = await operation.promise();
909
- */
910
629
  verifyMigrationJob(request, optionsOrCallback, callback) {
911
630
  request = request || {};
912
631
  let options;
@@ -936,11 +655,8 @@ class DataMigrationServiceClient {
936
655
  * Please see the
937
656
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
938
657
  * for more details and examples.
939
- * @example
940
- * const decodedOperation = await checkVerifyMigrationJobProgress(name);
941
- * console.log(decodedOperation.result);
942
- * console.log(decodedOperation.done);
943
- * console.log(decodedOperation.metadata);
658
+ * @example <caption>include:samples/generated/v1/data_migration_service.verify_migration_job.js</caption>
659
+ * region_tag:datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async
944
660
  */
945
661
  async checkVerifyMigrationJobProgress(name) {
946
662
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
@@ -948,28 +664,6 @@ class DataMigrationServiceClient {
948
664
  const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.verifyMigrationJob, gax.createDefaultBackoffSettings());
949
665
  return decodeOperation;
950
666
  }
951
- /**
952
- * Restart a stopped or failed migration job, resetting the destination
953
- * instance to its original state and starting the migration process from
954
- * scratch.
955
- *
956
- * @param {Object} request
957
- * The request object that will be sent.
958
- * @param {string} request.name
959
- * Name of the migration job resource to restart.
960
- * @param {object} [options]
961
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
962
- * @returns {Promise} - The promise which resolves to an array.
963
- * The first element of the array is an object representing
964
- * a long running operation. Its `promise()` method returns a promise
965
- * you can `await` for.
966
- * Please see the
967
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
968
- * for more details and examples.
969
- * @example
970
- * const [operation] = await client.restartMigrationJob(request);
971
- * const [response] = await operation.promise();
972
- */
973
667
  restartMigrationJob(request, optionsOrCallback, callback) {
974
668
  request = request || {};
975
669
  let options;
@@ -999,11 +693,8 @@ class DataMigrationServiceClient {
999
693
  * Please see the
1000
694
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1001
695
  * for more details and examples.
1002
- * @example
1003
- * const decodedOperation = await checkRestartMigrationJobProgress(name);
1004
- * console.log(decodedOperation.result);
1005
- * console.log(decodedOperation.done);
1006
- * console.log(decodedOperation.metadata);
696
+ * @example <caption>include:samples/generated/v1/data_migration_service.restart_migration_job.js</caption>
697
+ * region_tag:datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async
1007
698
  */
1008
699
  async checkRestartMigrationJobProgress(name) {
1009
700
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
@@ -1011,38 +702,6 @@ class DataMigrationServiceClient {
1011
702
  const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restartMigrationJob, gax.createDefaultBackoffSettings());
1012
703
  return decodeOperation;
1013
704
  }
1014
- /**
1015
- * Creates a new connection profile in a given project and location.
1016
- *
1017
- * @param {Object} request
1018
- * The request object that will be sent.
1019
- * @param {string} request.parent
1020
- * Required. The parent, which owns this collection of connection profiles.
1021
- * @param {string} request.connectionProfileId
1022
- * Required. The connection profile identifier.
1023
- * @param {google.cloud.clouddms.v1.ConnectionProfile} request.connectionProfile
1024
- * Required. The create request body including the connection profile data
1025
- * @param {string} request.requestId
1026
- * A unique id used to identify the request. If the server receives two
1027
- * requests with the same id, then the second request will be ignored.
1028
- *
1029
- * It is recommended to always set this value to a UUID.
1030
- *
1031
- * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores
1032
- * (_), and hyphens (-). The maximum length is 40 characters.
1033
- * @param {object} [options]
1034
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1035
- * @returns {Promise} - The promise which resolves to an array.
1036
- * The first element of the array is an object representing
1037
- * a long running operation. Its `promise()` method returns a promise
1038
- * you can `await` for.
1039
- * Please see the
1040
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1041
- * for more details and examples.
1042
- * @example
1043
- * const [operation] = await client.createConnectionProfile(request);
1044
- * const [response] = await operation.promise();
1045
- */
1046
705
  createConnectionProfile(request, optionsOrCallback, callback) {
1047
706
  request = request || {};
1048
707
  let options;
@@ -1072,11 +731,8 @@ class DataMigrationServiceClient {
1072
731
  * Please see the
1073
732
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1074
733
  * for more details and examples.
1075
- * @example
1076
- * const decodedOperation = await checkCreateConnectionProfileProgress(name);
1077
- * console.log(decodedOperation.result);
1078
- * console.log(decodedOperation.done);
1079
- * console.log(decodedOperation.metadata);
734
+ * @example <caption>include:samples/generated/v1/data_migration_service.create_connection_profile.js</caption>
735
+ * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async
1080
736
  */
1081
737
  async checkCreateConnectionProfileProgress(name) {
1082
738
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
@@ -1084,37 +740,6 @@ class DataMigrationServiceClient {
1084
740
  const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createConnectionProfile, gax.createDefaultBackoffSettings());
1085
741
  return decodeOperation;
1086
742
  }
1087
- /**
1088
- * Update the configuration of a single connection profile.
1089
- *
1090
- * @param {Object} request
1091
- * The request object that will be sent.
1092
- * @param {google.protobuf.FieldMask} request.updateMask
1093
- * Required. Field mask is used to specify the fields to be overwritten in the
1094
- * connection profile resource by the update.
1095
- * @param {google.cloud.clouddms.v1.ConnectionProfile} request.connectionProfile
1096
- * Required. The connection profile parameters to update.
1097
- * @param {string} request.requestId
1098
- * A unique id used to identify the request. If the server receives two
1099
- * requests with the same id, then the second request will be ignored.
1100
- *
1101
- * It is recommended to always set this value to a UUID.
1102
- *
1103
- * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores
1104
- * (_), and hyphens (-). The maximum length is 40 characters.
1105
- * @param {object} [options]
1106
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1107
- * @returns {Promise} - The promise which resolves to an array.
1108
- * The first element of the array is an object representing
1109
- * a long running operation. Its `promise()` method returns a promise
1110
- * you can `await` for.
1111
- * Please see the
1112
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1113
- * for more details and examples.
1114
- * @example
1115
- * const [operation] = await client.updateConnectionProfile(request);
1116
- * const [response] = await operation.promise();
1117
- */
1118
743
  updateConnectionProfile(request, optionsOrCallback, callback) {
1119
744
  request = request || {};
1120
745
  let options;
@@ -1144,11 +769,8 @@ class DataMigrationServiceClient {
1144
769
  * Please see the
1145
770
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1146
771
  * for more details and examples.
1147
- * @example
1148
- * const decodedOperation = await checkUpdateConnectionProfileProgress(name);
1149
- * console.log(decodedOperation.result);
1150
- * console.log(decodedOperation.done);
1151
- * console.log(decodedOperation.metadata);
772
+ * @example <caption>include:samples/generated/v1/data_migration_service.update_connection_profile.js</caption>
773
+ * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async
1152
774
  */
1153
775
  async checkUpdateConnectionProfileProgress(name) {
1154
776
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
@@ -1156,39 +778,6 @@ class DataMigrationServiceClient {
1156
778
  const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateConnectionProfile, gax.createDefaultBackoffSettings());
1157
779
  return decodeOperation;
1158
780
  }
1159
- /**
1160
- * Deletes a single Database Migration Service connection profile.
1161
- * A connection profile can only be deleted if it is not in use by any
1162
- * active migration jobs.
1163
- *
1164
- * @param {Object} request
1165
- * The request object that will be sent.
1166
- * @param {string} request.name
1167
- * Required. Name of the connection profile resource to delete.
1168
- * @param {string} request.requestId
1169
- * A unique id used to identify the request. If the server receives two
1170
- * requests with the same id, then the second request will be ignored.
1171
- *
1172
- * It is recommended to always set this value to a UUID.
1173
- *
1174
- * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores
1175
- * (_), and hyphens (-). The maximum length is 40 characters.
1176
- * @param {boolean} request.force
1177
- * In case of force delete, the CloudSQL replica database is also deleted
1178
- * (only for CloudSQL connection profile).
1179
- * @param {object} [options]
1180
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1181
- * @returns {Promise} - The promise which resolves to an array.
1182
- * The first element of the array is an object representing
1183
- * a long running operation. Its `promise()` method returns a promise
1184
- * you can `await` for.
1185
- * Please see the
1186
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1187
- * for more details and examples.
1188
- * @example
1189
- * const [operation] = await client.deleteConnectionProfile(request);
1190
- * const [response] = await operation.promise();
1191
- */
1192
781
  deleteConnectionProfile(request, optionsOrCallback, callback) {
1193
782
  request = request || {};
1194
783
  let options;
@@ -1218,11 +807,8 @@ class DataMigrationServiceClient {
1218
807
  * Please see the
1219
808
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
1220
809
  * for more details and examples.
1221
- * @example
1222
- * const decodedOperation = await checkDeleteConnectionProfileProgress(name);
1223
- * console.log(decodedOperation.result);
1224
- * console.log(decodedOperation.done);
1225
- * console.log(decodedOperation.metadata);
810
+ * @example <caption>include:samples/generated/v1/data_migration_service.delete_connection_profile.js</caption>
811
+ * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async
1226
812
  */
1227
813
  async checkDeleteConnectionProfileProgress(name) {
1228
814
  const request = new google_gax_1.operationsProtos.google.longrunning.GetOperationRequest({ name });
@@ -1230,50 +816,6 @@ class DataMigrationServiceClient {
1230
816
  const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteConnectionProfile, gax.createDefaultBackoffSettings());
1231
817
  return decodeOperation;
1232
818
  }
1233
- /**
1234
- * Lists migration jobs in a given project and location.
1235
- *
1236
- * @param {Object} request
1237
- * The request object that will be sent.
1238
- * @param {string} request.parent
1239
- * Required. The parent, which owns this collection of migrationJobs.
1240
- * @param {number} request.pageSize
1241
- * The maximum number of migration jobs to return. The service may return
1242
- * fewer than this value. If unspecified, at most 50 migration jobs will be
1243
- * returned. The maximum value is 1000; values above 1000 will be coerced to
1244
- * 1000.
1245
- * @param {string} request.pageToken
1246
- * The nextPageToken value received in the previous call to
1247
- * migrationJobs.list, used in the subsequent request to retrieve the next
1248
- * page of results. On first call this should be left blank. When paginating,
1249
- * all other parameters provided to migrationJobs.list must match the call
1250
- * that provided the page token.
1251
- * @param {string} request.filter
1252
- * A filter expression that filters migration jobs listed in the response.
1253
- * The expression must specify the field name, a comparison operator, and the
1254
- * value that you want to use for filtering. The value must be a string,
1255
- * a number, or a boolean. The comparison operator must be
1256
- * either =, !=, >, or <. For example, list migration jobs created this year
1257
- * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.**
1258
- * You can also filter nested fields. For example, you could specify
1259
- * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration
1260
- * jobs connecting through the specific SSH tunnel bastion.
1261
- * @param {string} request.orderBy
1262
- * Sort the results based on the migration job name.
1263
- * Valid values are: "name", "name asc", and "name desc".
1264
- * @param {object} [options]
1265
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1266
- * @returns {Promise} - The promise which resolves to an array.
1267
- * The first element of the array is Array of [MigrationJob]{@link google.cloud.clouddms.v1.MigrationJob}.
1268
- * The client library will perform auto-pagination by default: it will call the API as many
1269
- * times as needed and will merge results from all the pages into this array.
1270
- * Note that it can affect your quota.
1271
- * We recommend using `listMigrationJobsAsync()`
1272
- * method described below for async iteration which you can stop as needed.
1273
- * Please see the
1274
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1275
- * for more details and examples.
1276
- */
1277
819
  listMigrationJobs(request, optionsOrCallback, callback) {
1278
820
  request = request || {};
1279
821
  let options;
@@ -1345,7 +887,8 @@ class DataMigrationServiceClient {
1345
887
  gax.routingHeader.fromParams({
1346
888
  parent: request.parent || '',
1347
889
  });
1348
- const callSettings = new gax.CallSettings(options);
890
+ const defaultCallSettings = this._defaults['listMigrationJobs'];
891
+ const callSettings = defaultCallSettings.merge(options);
1349
892
  this.initialize();
1350
893
  return this.descriptors.page.listMigrationJobs.createStream(this.innerApiCalls.listMigrationJobs, request, callSettings);
1351
894
  }
@@ -1391,11 +934,8 @@ class DataMigrationServiceClient {
1391
934
  * Please see the
1392
935
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1393
936
  * for more details and examples.
1394
- * @example
1395
- * const iterable = client.listMigrationJobsAsync(request);
1396
- * for await (const response of iterable) {
1397
- * // process response
1398
- * }
937
+ * @example <caption>include:samples/generated/v1/data_migration_service.list_migration_jobs.js</caption>
938
+ * region_tag:datamigration_v1_generated_DataMigrationService_ListMigrationJobs_async
1399
939
  */
1400
940
  listMigrationJobsAsync(request, options) {
1401
941
  request = request || {};
@@ -1406,54 +946,11 @@ class DataMigrationServiceClient {
1406
946
  gax.routingHeader.fromParams({
1407
947
  parent: request.parent || '',
1408
948
  });
1409
- options = options || {};
1410
- const callSettings = new gax.CallSettings(options);
949
+ const defaultCallSettings = this._defaults['listMigrationJobs'];
950
+ const callSettings = defaultCallSettings.merge(options);
1411
951
  this.initialize();
1412
952
  return this.descriptors.page.listMigrationJobs.asyncIterate(this.innerApiCalls['listMigrationJobs'], request, callSettings);
1413
953
  }
1414
- /**
1415
- * Retrieve a list of all connection profiles in a given project and location.
1416
- *
1417
- * @param {Object} request
1418
- * The request object that will be sent.
1419
- * @param {string} request.parent
1420
- * Required. The parent, which owns this collection of connection profiles.
1421
- * @param {number} request.pageSize
1422
- * The maximum number of connection profiles to return. The service may return
1423
- * fewer than this value. If unspecified, at most 50 connection profiles will
1424
- * be returned. The maximum value is 1000; values above 1000 will be coerced
1425
- * to 1000.
1426
- * @param {string} request.pageToken
1427
- * A page token, received from a previous `ListConnectionProfiles` call.
1428
- * Provide this to retrieve the subsequent page.
1429
- *
1430
- * When paginating, all other parameters provided to `ListConnectionProfiles`
1431
- * must match the call that provided the page token.
1432
- * @param {string} request.filter
1433
- * A filter expression that filters connection profiles listed in the
1434
- * response. The expression must specify the field name, a comparison
1435
- * operator, and the value that you want to use for filtering. The value must
1436
- * be a string, a number, or a boolean. The comparison operator must be either
1437
- * =, !=, >, or <. For example, list connection profiles created this year by
1438
- * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can
1439
- * also filter nested fields. For example, you could specify **mySql.username
1440
- * = %lt;my_username%gt;** to list all connection profiles configured to
1441
- * connect with a specific username.
1442
- * @param {string} request.orderBy
1443
- * the order by fields for the result.
1444
- * @param {object} [options]
1445
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1446
- * @returns {Promise} - The promise which resolves to an array.
1447
- * The first element of the array is Array of [ConnectionProfile]{@link google.cloud.clouddms.v1.ConnectionProfile}.
1448
- * The client library will perform auto-pagination by default: it will call the API as many
1449
- * times as needed and will merge results from all the pages into this array.
1450
- * Note that it can affect your quota.
1451
- * We recommend using `listConnectionProfilesAsync()`
1452
- * method described below for async iteration which you can stop as needed.
1453
- * Please see the
1454
- * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1455
- * for more details and examples.
1456
- */
1457
954
  listConnectionProfiles(request, optionsOrCallback, callback) {
1458
955
  request = request || {};
1459
956
  let options;
@@ -1524,7 +1021,8 @@ class DataMigrationServiceClient {
1524
1021
  gax.routingHeader.fromParams({
1525
1022
  parent: request.parent || '',
1526
1023
  });
1527
- const callSettings = new gax.CallSettings(options);
1024
+ const defaultCallSettings = this._defaults['listConnectionProfiles'];
1025
+ const callSettings = defaultCallSettings.merge(options);
1528
1026
  this.initialize();
1529
1027
  return this.descriptors.page.listConnectionProfiles.createStream(this.innerApiCalls.listConnectionProfiles, request, callSettings);
1530
1028
  }
@@ -1569,11 +1067,8 @@ class DataMigrationServiceClient {
1569
1067
  * Please see the
1570
1068
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1571
1069
  * for more details and examples.
1572
- * @example
1573
- * const iterable = client.listConnectionProfilesAsync(request);
1574
- * for await (const response of iterable) {
1575
- * // process response
1576
- * }
1070
+ * @example <caption>include:samples/generated/v1/data_migration_service.list_connection_profiles.js</caption>
1071
+ * region_tag:datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_async
1577
1072
  */
1578
1073
  listConnectionProfilesAsync(request, options) {
1579
1074
  request = request || {};
@@ -1584,8 +1079,8 @@ class DataMigrationServiceClient {
1584
1079
  gax.routingHeader.fromParams({
1585
1080
  parent: request.parent || '',
1586
1081
  });
1587
- options = options || {};
1588
- const callSettings = new gax.CallSettings(options);
1082
+ const defaultCallSettings = this._defaults['listConnectionProfiles'];
1083
+ const callSettings = defaultCallSettings.merge(options);
1589
1084
  this.initialize();
1590
1085
  return this.descriptors.page.listConnectionProfiles.asyncIterate(this.innerApiCalls['listConnectionProfiles'], request, callSettings);
1591
1086
  }
@@ -1746,8 +1241,7 @@ class DataMigrationServiceClient {
1746
1241
  * @returns {Promise} A promise that resolves when the client is closed.
1747
1242
  */
1748
1243
  close() {
1749
- this.initialize();
1750
- if (!this._terminated) {
1244
+ if (this.dataMigrationServiceStub && !this._terminated) {
1751
1245
  return this.dataMigrationServiceStub.then(stub => {
1752
1246
  this._terminated = true;
1753
1247
  stub.close();