diff --git a/CHANGELOG.md b/CHANGELOG.md index 85c036d..710ab76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.1.0](https://github.com/googleapis/python-vm-migration/compare/v1.0.0...v1.1.0) (2022-02-11) + + +### Features + +* add api key support ([#14](https://github.com/googleapis/python-vm-migration/issues/14)) ([bf6760c](https://github.com/googleapis/python-vm-migration/commit/bf6760ce5ead26b352a5a89e079fa2ca20c0c3c6)) + + +### Bug Fixes + +* resolve DuplicateCredentialArgs error when using credentials_file ([c53543e](https://github.com/googleapis/python-vm-migration/commit/c53543e159c2513089223fdc956860a051244c29)) + ## [1.0.0](https://github.com/googleapis/python-vm-migration/compare/v0.1.0...v1.0.0) (2022-01-24) diff --git a/google/cloud/vmmigration_v1/services/vm_migration/async_client.py b/google/cloud/vmmigration_v1/services/vm_migration/async_client.py index 5daee50..2f62ff9 100644 --- a/google/cloud/vmmigration_v1/services/vm_migration/async_client.py +++ b/google/cloud/vmmigration_v1/services/vm_migration/async_client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import functools import re -from typing import Dict, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -130,6 +130,42 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): from_service_account_json = from_service_account_file + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[ClientOptions] = None + ): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variabel is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + return VmMigrationClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore + @property def transport(self) -> VmMigrationTransport: """Returns the transport used by the client instance. @@ -201,6 +237,27 @@ async def list_sources( ) -> pagers.ListSourcesAsyncPager: r"""Lists Sources in a given project and location. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_sources(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListSourcesRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_sources(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListSourcesRequest, dict]): The request object. Request message for 'ListSources' @@ -228,7 +285,7 @@ async def list_sources( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -281,6 +338,25 @@ async def get_source( ) -> vmmigration.Source: r"""Gets details of a single Source. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_source(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetSourceRequest( + name="name_value", + ) + + # Make the request + response = client.get_source(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetSourceRequest, dict]): The request object. Request message for 'GetSource' @@ -305,7 +381,7 @@ async def get_source( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -354,6 +430,30 @@ async def create_source( ) -> operation_async.AsyncOperation: r"""Creates a new Source in a given project and location. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_source(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateSourceRequest( + parent="parent_value", + source_id="source_id_value", + ) + + # Make the request + operation = client.create_source(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateSourceRequest, dict]): The request object. Request message for 'CreateSource' @@ -388,7 +488,7 @@ async def create_source( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, source, source_id]) if request is not None and has_flattened_params: @@ -448,6 +548,28 @@ async def update_source( ) -> operation_async.AsyncOperation: r"""Updates the parameters of a single Source. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_update_source(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateSourceRequest( + ) + + # Make the request + operation = client.update_source(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.UpdateSourceRequest, dict]): The request object. Update message for 'UpdateSources' @@ -483,7 +605,7 @@ async def update_source( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([source, update_mask]) if request is not None and has_flattened_params: @@ -542,6 +664,29 @@ async def delete_source( ) -> operation_async.AsyncOperation: r"""Deletes a single Source. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_delete_source(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteSourceRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_source(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.DeleteSourceRequest, dict]): The request object. Request message for 'DeleteSource' @@ -577,7 +722,7 @@ async def delete_source( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -638,6 +783,26 @@ async def fetch_inventory( as opposed to listing the MigratingVms resources in the vmmigration service. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_fetch_inventory(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.FetchInventoryRequest( + source="source_value", + ) + + # Make the request + response = client.fetch_inventory(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.FetchInventoryRequest, dict]): The request object. Request message for @@ -660,7 +825,7 @@ async def fetch_inventory( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([source]) if request is not None and has_flattened_params: @@ -707,6 +872,27 @@ async def list_utilization_reports( ) -> pagers.ListUtilizationReportsAsyncPager: r"""Lists Utilization Reports of the given Source. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_utilization_reports(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListUtilizationReportsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_utilization_reports(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListUtilizationReportsRequest, dict]): The request object. Request message for @@ -734,7 +920,7 @@ async def list_utilization_reports( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -787,6 +973,25 @@ async def get_utilization_report( ) -> vmmigration.UtilizationReport: r"""Gets a single Utilization Report. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_utilization_report(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetUtilizationReportRequest( + name="name_value", + ) + + # Make the request + response = client.get_utilization_report(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetUtilizationReportRequest, dict]): The request object. Request message for @@ -812,7 +1017,7 @@ async def get_utilization_report( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -861,6 +1066,30 @@ async def create_utilization_report( ) -> operation_async.AsyncOperation: r"""Creates a new UtilizationReport. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_utilization_report(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateUtilizationReportRequest( + parent="parent_value", + utilization_report_id="utilization_report_id_value", + ) + + # Make the request + operation = client.create_utilization_report(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateUtilizationReportRequest, dict]): The request object. Request message for @@ -904,7 +1133,7 @@ async def create_utilization_report( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, utilization_report, utilization_report_id]) if request is not None and has_flattened_params: @@ -963,6 +1192,29 @@ async def delete_utilization_report( ) -> operation_async.AsyncOperation: r"""Deletes a single Utilization Report. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_delete_utilization_report(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteUtilizationReportRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_utilization_report(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.DeleteUtilizationReportRequest, dict]): The request object. Request message for @@ -1000,7 +1252,7 @@ async def delete_utilization_report( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -1055,6 +1307,27 @@ async def list_datacenter_connectors( ) -> pagers.ListDatacenterConnectorsAsyncPager: r"""Lists DatacenterConnectors in a given Source. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_datacenter_connectors(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListDatacenterConnectorsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_datacenter_connectors(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListDatacenterConnectorsRequest, dict]): The request object. Request message for @@ -1082,7 +1355,7 @@ async def list_datacenter_connectors( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -1135,6 +1408,25 @@ async def get_datacenter_connector( ) -> vmmigration.DatacenterConnector: r"""Gets details of a single DatacenterConnector. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_datacenter_connector(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetDatacenterConnectorRequest( + name="name_value", + ) + + # Make the request + response = client.get_datacenter_connector(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetDatacenterConnectorRequest, dict]): The request object. Request message for @@ -1163,7 +1455,7 @@ async def get_datacenter_connector( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -1212,6 +1504,30 @@ async def create_datacenter_connector( ) -> operation_async.AsyncOperation: r"""Creates a new DatacenterConnector in a given Source. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_datacenter_connector(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateDatacenterConnectorRequest( + parent="parent_value", + datacenter_connector_id="datacenter_connector_id_value", + ) + + # Make the request + operation = client.create_datacenter_connector(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateDatacenterConnectorRequest, dict]): The request object. Request message for @@ -1254,7 +1570,7 @@ async def create_datacenter_connector( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [parent, datacenter_connector, datacenter_connector_id] @@ -1315,6 +1631,29 @@ async def delete_datacenter_connector( ) -> operation_async.AsyncOperation: r"""Deletes a single DatacenterConnector. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_delete_datacenter_connector(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteDatacenterConnectorRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_datacenter_connector(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.DeleteDatacenterConnectorRequest, dict]): The request object. Request message for @@ -1352,7 +1691,7 @@ async def delete_datacenter_connector( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -1409,6 +1748,30 @@ async def create_migrating_vm( ) -> operation_async.AsyncOperation: r"""Creates a new MigratingVm in a given Source. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateMigratingVmRequest( + parent="parent_value", + migrating_vm_id="migrating_vm_id_value", + ) + + # Make the request + operation = client.create_migrating_vm(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateMigratingVmRequest, dict]): The request object. Request message for @@ -1443,7 +1806,7 @@ async def create_migrating_vm( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, migrating_vm, migrating_vm_id]) if request is not None and has_flattened_params: @@ -1502,6 +1865,27 @@ async def list_migrating_vms( ) -> pagers.ListMigratingVmsAsyncPager: r"""Lists MigratingVms in a given Source. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_migrating_vms(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListMigratingVmsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_migrating_vms(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListMigratingVmsRequest, dict]): The request object. Request message for @@ -1529,7 +1913,7 @@ async def list_migrating_vms( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -1582,6 +1966,25 @@ async def get_migrating_vm( ) -> vmmigration.MigratingVm: r"""Gets details of a single MigratingVm. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetMigratingVmRequest( + name="name_value", + ) + + # Make the request + response = client.get_migrating_vm(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetMigratingVmRequest, dict]): The request object. Request message for 'GetMigratingVm' @@ -1607,7 +2010,7 @@ async def get_migrating_vm( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -1655,6 +2058,28 @@ async def update_migrating_vm( ) -> operation_async.AsyncOperation: r"""Updates the parameters of a single MigratingVm. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_update_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateMigratingVmRequest( + ) + + # Make the request + operation = client.update_migrating_vm(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.UpdateMigratingVmRequest, dict]): The request object. Request message for @@ -1690,7 +2115,7 @@ async def update_migrating_vm( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([migrating_vm, update_mask]) if request is not None and has_flattened_params: @@ -1749,6 +2174,29 @@ async def delete_migrating_vm( ) -> operation_async.AsyncOperation: r"""Deletes a single MigratingVm. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_delete_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteMigratingVmRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_migrating_vm(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.DeleteMigratingVmRequest, dict]): The request object. Request message for @@ -1786,7 +2234,7 @@ async def delete_migrating_vm( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -1843,6 +2291,30 @@ async def start_migration( uploading data and creating snapshots, in replication cycles scheduled by the policy. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_start_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.StartMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.start_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.StartMigrationRequest, dict]): The request object. Request message for @@ -1870,7 +2342,7 @@ async def start_migration( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([migrating_vm]) if request is not None and has_flattened_params: @@ -1931,6 +2403,30 @@ async def resume_migration( start the process of uploading data and creating snapshots. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_resume_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ResumeMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.resume_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ResumeMigrationRequest, dict]): The request object. Request message for @@ -1996,6 +2492,30 @@ async def pause_migration( data. Further replication cycles will not be triggered while the VM is paused. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_pause_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.PauseMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.pause_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.PauseMigrationRequest, dict]): The request object. Request message for 'PauseMigration' @@ -2061,6 +2581,30 @@ async def finalize_migration( resources that are no longer being used. Only applicable after cutover is done. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_finalize_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.FinalizeMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.finalize_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.FinalizeMigrationRequest, dict]): The request object. Request message for @@ -2088,7 +2632,7 @@ async def finalize_migration( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([migrating_vm]) if request is not None and has_flattened_params: @@ -2147,6 +2691,30 @@ async def create_clone_job( ) -> operation_async.AsyncOperation: r"""Initiates a Clone of a specific migrating VM. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_clone_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateCloneJobRequest( + parent="parent_value", + clone_job_id="clone_job_id_value", + ) + + # Make the request + operation = client.create_clone_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateCloneJobRequest, dict]): The request object. Request message for 'CreateCloneJob' @@ -2193,7 +2761,7 @@ async def create_clone_job( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, clone_job, clone_job_id]) if request is not None and has_flattened_params: @@ -2252,6 +2820,29 @@ async def cancel_clone_job( ) -> operation_async.AsyncOperation: r"""Initiates the cancellation of a running clone job. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_cancel_clone_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CancelCloneJobRequest( + name="name_value", + ) + + # Make the request + operation = client.cancel_clone_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CancelCloneJobRequest, dict]): The request object. Request message for 'CancelCloneJob' @@ -2277,7 +2868,7 @@ async def cancel_clone_job( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -2332,6 +2923,27 @@ async def list_clone_jobs( ) -> pagers.ListCloneJobsAsyncPager: r"""Lists CloneJobs of a given migrating VM. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_clone_jobs(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListCloneJobsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_clone_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListCloneJobsRequest, dict]): The request object. Request message for @@ -2359,7 +2971,7 @@ async def list_clone_jobs( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -2412,6 +3024,25 @@ async def get_clone_job( ) -> vmmigration.CloneJob: r"""Gets details of a single CloneJob. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_clone_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetCloneJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_clone_job(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetCloneJobRequest, dict]): The request object. Request message for 'GetCloneJob' @@ -2446,7 +3077,7 @@ async def get_clone_job( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -2497,6 +3128,31 @@ async def create_cutover_job( The returned LRO is completed when the cutover job resource is created and the job is initiated. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_cutover_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateCutoverJobRequest( + parent="parent_value", + cutover_job_id="cutover_job_id_value", + ) + + # Make the request + operation = client.create_cutover_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateCutoverJobRequest, dict]): The request object. Request message for @@ -2533,7 +3189,7 @@ async def create_cutover_job( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, cutover_job, cutover_job_id]) if request is not None and has_flattened_params: @@ -2592,6 +3248,29 @@ async def cancel_cutover_job( ) -> operation_async.AsyncOperation: r"""Initiates the cancellation of a running cutover job. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_cancel_cutover_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CancelCutoverJobRequest( + name="name_value", + ) + + # Make the request + operation = client.cancel_cutover_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CancelCutoverJobRequest, dict]): The request object. Request message for @@ -2617,7 +3296,7 @@ async def cancel_cutover_job( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -2672,6 +3351,27 @@ async def list_cutover_jobs( ) -> pagers.ListCutoverJobsAsyncPager: r"""Lists CutoverJobs of a given migrating VM. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_cutover_jobs(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListCutoverJobsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_cutover_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListCutoverJobsRequest, dict]): The request object. Request message for @@ -2699,7 +3399,7 @@ async def list_cutover_jobs( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -2752,6 +3452,25 @@ async def get_cutover_job( ) -> vmmigration.CutoverJob: r"""Gets details of a single CutoverJob. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_cutover_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetCutoverJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_cutover_job(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetCutoverJobRequest, dict]): The request object. Request message for 'GetCutoverJob' @@ -2778,7 +3497,7 @@ async def get_cutover_job( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -2825,6 +3544,27 @@ async def list_groups( ) -> pagers.ListGroupsAsyncPager: r"""Lists Groups in a given project and location. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_groups(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListGroupsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_groups(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListGroupsRequest, dict]): The request object. Request message for 'ListGroups' @@ -2852,7 +3592,7 @@ async def list_groups( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -2905,6 +3645,25 @@ async def get_group( ) -> vmmigration.Group: r"""Gets details of a single Group. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_group(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetGroupRequest( + name="name_value", + ) + + # Make the request + response = client.get_group(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetGroupRequest, dict]): The request object. Request message for 'GetGroup' @@ -2928,7 +3687,7 @@ async def get_group( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -2977,6 +3736,30 @@ async def create_group( ) -> operation_async.AsyncOperation: r"""Creates a new Group in a given project and location. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_group(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateGroupRequest( + parent="parent_value", + group_id="group_id_value", + ) + + # Make the request + operation = client.create_group(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateGroupRequest, dict]): The request object. Request message for 'CreateGroup' @@ -3011,7 +3794,7 @@ async def create_group( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, group, group_id]) if request is not None and has_flattened_params: @@ -3071,6 +3854,28 @@ async def update_group( ) -> operation_async.AsyncOperation: r"""Updates the parameters of a single Group. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_update_group(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateGroupRequest( + ) + + # Make the request + operation = client.update_group(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.UpdateGroupRequest, dict]): The request object. Update message for 'UpdateGroups' @@ -3106,7 +3911,7 @@ async def update_group( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([group, update_mask]) if request is not None and has_flattened_params: @@ -3165,6 +3970,29 @@ async def delete_group( ) -> operation_async.AsyncOperation: r"""Deletes a single Group. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_delete_group(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteGroupRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_group(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.DeleteGroupRequest, dict]): The request object. Request message for 'DeleteGroup' @@ -3200,7 +4028,7 @@ async def delete_group( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -3255,6 +4083,29 @@ async def add_group_migration( ) -> operation_async.AsyncOperation: r"""Adds a MigratingVm to a Group. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_add_group_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.AddGroupMigrationRequest( + group="group_value", + ) + + # Make the request + operation = client.add_group_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.AddGroupMigrationRequest, dict]): The request object. Request message for @@ -3282,7 +4133,7 @@ async def add_group_migration( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([group]) if request is not None and has_flattened_params: @@ -3337,6 +4188,29 @@ async def remove_group_migration( ) -> operation_async.AsyncOperation: r"""Removes a MigratingVm from a Group. + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_remove_group_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.RemoveGroupMigrationRequest( + group="group_value", + ) + + # Make the request + operation = client.remove_group_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.RemoveGroupMigrationRequest, dict]): The request object. Request message for @@ -3362,7 +4236,7 @@ async def remove_group_migration( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([group]) if request is not None and has_flattened_params: @@ -3420,6 +4294,28 @@ async def list_target_projects( NOTE: TargetProject is a global resource; hence the only supported value for location is ``global``. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_target_projects(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListTargetProjectsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_target_projects(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListTargetProjectsRequest, dict]): The request object. Request message for @@ -3447,7 +4343,7 @@ async def list_target_projects( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -3503,6 +4399,26 @@ async def get_target_project( NOTE: TargetProject is a global resource; hence the only supported value for location is ``global``. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetTargetProjectRequest( + name="name_value", + ) + + # Make the request + response = client.get_target_project(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetTargetProjectRequest, dict]): The request object. Request message for @@ -3526,7 +4442,7 @@ async def get_target_project( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -3578,6 +4494,31 @@ async def create_target_project( NOTE: TargetProject is a global resource; hence the only supported value for location is ``global``. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateTargetProjectRequest( + parent="parent_value", + target_project_id="target_project_id_value", + ) + + # Make the request + operation = client.create_target_project(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateTargetProjectRequest, dict]): The request object. Request message for @@ -3612,7 +4553,7 @@ async def create_target_project( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, target_project, target_project_id]) if request is not None and has_flattened_params: @@ -3675,6 +4616,29 @@ async def update_target_project( NOTE: TargetProject is a global resource; hence the only supported value for location is ``global``. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_update_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateTargetProjectRequest( + ) + + # Make the request + operation = client.update_target_project(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.UpdateTargetProjectRequest, dict]): The request object. Update message for @@ -3710,7 +4674,7 @@ async def update_target_project( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([target_project, update_mask]) if request is not None and has_flattened_params: @@ -3772,6 +4736,30 @@ async def delete_target_project( NOTE: TargetProject is a global resource; hence the only supported value for location is ``global``. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_delete_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteTargetProjectRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_target_project(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.DeleteTargetProjectRequest, dict]): The request object. Request message for @@ -3807,7 +4795,7 @@ async def delete_target_project( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: diff --git a/google/cloud/vmmigration_v1/services/vm_migration/client.py b/google/cloud/vmmigration_v1/services/vm_migration/client.py index 9f50c70..5439f4d 100644 --- a/google/cloud/vmmigration_v1/services/vm_migration/client.py +++ b/google/cloud/vmmigration_v1/services/vm_migration/client.py @@ -377,6 +377,73 @@ def parse_common_location_path(path: str) -> Dict[str, str]: m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) return m.groupdict() if m else {} + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[client_options_lib.ClientOptions] = None + ): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variabel is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + if client_options is None: + client_options = client_options_lib.ClientOptions() + use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") + if use_client_cert not in ("true", "false"): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Figure out the client cert source to use. + client_cert_source = None + if use_client_cert == "true": + if client_options.client_cert_source: + client_cert_source = client_options.client_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + + # Figure out which api endpoint to use. + if client_options.api_endpoint is not None: + api_endpoint = client_options.api_endpoint + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + api_endpoint = cls.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = cls.DEFAULT_ENDPOINT + + return api_endpoint, client_cert_source + def __init__( self, *, @@ -427,57 +494,22 @@ def __init__( if client_options is None: client_options = client_options_lib.ClientOptions() - # Create SSL credentials for mutual TLS if needed. - if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in ( - "true", - "false", - ): - raise ValueError( - "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" - ) - use_client_cert = ( - os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true" + api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( + client_options ) - client_cert_source_func = None - is_mtls = False - if use_client_cert: - if client_options.client_cert_source: - is_mtls = True - client_cert_source_func = client_options.client_cert_source - else: - is_mtls = mtls.has_default_client_cert_source() - if is_mtls: - client_cert_source_func = mtls.default_client_cert_source() - else: - client_cert_source_func = None - - # Figure out which api endpoint to use. - if client_options.api_endpoint is not None: - api_endpoint = client_options.api_endpoint - else: - use_mtls_env = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") - if use_mtls_env == "never": - api_endpoint = self.DEFAULT_ENDPOINT - elif use_mtls_env == "always": - api_endpoint = self.DEFAULT_MTLS_ENDPOINT - elif use_mtls_env == "auto": - if is_mtls: - api_endpoint = self.DEFAULT_MTLS_ENDPOINT - else: - api_endpoint = self.DEFAULT_ENDPOINT - else: - raise MutualTLSChannelError( - "Unsupported GOOGLE_API_USE_MTLS_ENDPOINT value. Accepted " - "values: never, auto, always" - ) + api_key_value = getattr(client_options, "api_key", None) + if api_key_value and credentials: + raise ValueError( + "client_options.api_key and credentials are mutually exclusive" + ) # Save or instantiate the transport. # Ordinarily, we provide the transport, but allowing a custom transport # instance provides an extensibility point for unusual situations. if isinstance(transport, VmMigrationTransport): # transport is a VmMigrationTransport instance. - if credentials or client_options.credentials_file: + if credentials or client_options.credentials_file or api_key_value: raise ValueError( "When providing a transport instance, " "provide its credentials directly." @@ -489,6 +521,15 @@ def __init__( ) self._transport = transport else: + import google.auth._default # type: ignore + + if api_key_value and hasattr( + google.auth._default, "get_api_key_credentials" + ): + credentials = google.auth._default.get_api_key_credentials( + api_key_value + ) + Transport = type(self).get_transport_class(transport) self._transport = Transport( credentials=credentials, @@ -512,6 +553,28 @@ def list_sources( ) -> pagers.ListSourcesPager: r"""Lists Sources in a given project and location. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_sources(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListSourcesRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_sources(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListSourcesRequest, dict]): The request object. Request message for 'ListSources' @@ -539,7 +602,7 @@ def list_sources( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -592,6 +655,26 @@ def get_source( ) -> vmmigration.Source: r"""Gets details of a single Source. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_source(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetSourceRequest( + name="name_value", + ) + + # Make the request + response = client.get_source(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetSourceRequest, dict]): The request object. Request message for 'GetSource' @@ -616,7 +699,7 @@ def get_source( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -665,6 +748,31 @@ def create_source( ) -> operation.Operation: r"""Creates a new Source in a given project and location. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_source(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateSourceRequest( + parent="parent_value", + source_id="source_id_value", + ) + + # Make the request + operation = client.create_source(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateSourceRequest, dict]): The request object. Request message for 'CreateSource' @@ -699,7 +807,7 @@ def create_source( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, source, source_id]) if request is not None and has_flattened_params: @@ -759,6 +867,29 @@ def update_source( ) -> operation.Operation: r"""Updates the parameters of a single Source. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_update_source(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateSourceRequest( + ) + + # Make the request + operation = client.update_source(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.UpdateSourceRequest, dict]): The request object. Update message for 'UpdateSources' @@ -794,7 +925,7 @@ def update_source( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([source, update_mask]) if request is not None and has_flattened_params: @@ -853,6 +984,30 @@ def delete_source( ) -> operation.Operation: r"""Deletes a single Source. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_delete_source(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteSourceRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_source(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.DeleteSourceRequest, dict]): The request object. Request message for 'DeleteSource' @@ -888,7 +1043,7 @@ def delete_source( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -949,6 +1104,27 @@ def fetch_inventory( as opposed to listing the MigratingVms resources in the vmmigration service. + + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_fetch_inventory(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.FetchInventoryRequest( + source="source_value", + ) + + # Make the request + response = client.fetch_inventory(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.FetchInventoryRequest, dict]): The request object. Request message for @@ -971,7 +1147,7 @@ def fetch_inventory( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([source]) if request is not None and has_flattened_params: @@ -1018,6 +1194,28 @@ def list_utilization_reports( ) -> pagers.ListUtilizationReportsPager: r"""Lists Utilization Reports of the given Source. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_utilization_reports(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListUtilizationReportsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_utilization_reports(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListUtilizationReportsRequest, dict]): The request object. Request message for @@ -1045,7 +1243,7 @@ def list_utilization_reports( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -1098,6 +1296,26 @@ def get_utilization_report( ) -> vmmigration.UtilizationReport: r"""Gets a single Utilization Report. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_utilization_report(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetUtilizationReportRequest( + name="name_value", + ) + + # Make the request + response = client.get_utilization_report(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetUtilizationReportRequest, dict]): The request object. Request message for @@ -1123,7 +1341,7 @@ def get_utilization_report( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -1172,6 +1390,31 @@ def create_utilization_report( ) -> operation.Operation: r"""Creates a new UtilizationReport. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_utilization_report(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateUtilizationReportRequest( + parent="parent_value", + utilization_report_id="utilization_report_id_value", + ) + + # Make the request + operation = client.create_utilization_report(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateUtilizationReportRequest, dict]): The request object. Request message for @@ -1215,7 +1458,7 @@ def create_utilization_report( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, utilization_report, utilization_report_id]) if request is not None and has_flattened_params: @@ -1276,6 +1519,30 @@ def delete_utilization_report( ) -> operation.Operation: r"""Deletes a single Utilization Report. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_delete_utilization_report(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteUtilizationReportRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_utilization_report(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.DeleteUtilizationReportRequest, dict]): The request object. Request message for @@ -1313,7 +1580,7 @@ def delete_utilization_report( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -1370,6 +1637,28 @@ def list_datacenter_connectors( ) -> pagers.ListDatacenterConnectorsPager: r"""Lists DatacenterConnectors in a given Source. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_datacenter_connectors(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListDatacenterConnectorsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_datacenter_connectors(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListDatacenterConnectorsRequest, dict]): The request object. Request message for @@ -1397,7 +1686,7 @@ def list_datacenter_connectors( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -1452,6 +1741,26 @@ def get_datacenter_connector( ) -> vmmigration.DatacenterConnector: r"""Gets details of a single DatacenterConnector. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_datacenter_connector(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetDatacenterConnectorRequest( + name="name_value", + ) + + # Make the request + response = client.get_datacenter_connector(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetDatacenterConnectorRequest, dict]): The request object. Request message for @@ -1480,7 +1789,7 @@ def get_datacenter_connector( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -1529,6 +1838,31 @@ def create_datacenter_connector( ) -> operation.Operation: r"""Creates a new DatacenterConnector in a given Source. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_datacenter_connector(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateDatacenterConnectorRequest( + parent="parent_value", + datacenter_connector_id="datacenter_connector_id_value", + ) + + # Make the request + operation = client.create_datacenter_connector(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateDatacenterConnectorRequest, dict]): The request object. Request message for @@ -1571,7 +1905,7 @@ def create_datacenter_connector( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [parent, datacenter_connector, datacenter_connector_id] @@ -1634,6 +1968,30 @@ def delete_datacenter_connector( ) -> operation.Operation: r"""Deletes a single DatacenterConnector. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_delete_datacenter_connector(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteDatacenterConnectorRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_datacenter_connector(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.DeleteDatacenterConnectorRequest, dict]): The request object. Request message for @@ -1671,7 +2029,7 @@ def delete_datacenter_connector( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -1730,6 +2088,31 @@ def create_migrating_vm( ) -> operation.Operation: r"""Creates a new MigratingVm in a given Source. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateMigratingVmRequest( + parent="parent_value", + migrating_vm_id="migrating_vm_id_value", + ) + + # Make the request + operation = client.create_migrating_vm(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateMigratingVmRequest, dict]): The request object. Request message for @@ -1764,7 +2147,7 @@ def create_migrating_vm( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, migrating_vm, migrating_vm_id]) if request is not None and has_flattened_params: @@ -1823,6 +2206,28 @@ def list_migrating_vms( ) -> pagers.ListMigratingVmsPager: r"""Lists MigratingVms in a given Source. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_migrating_vms(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListMigratingVmsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_migrating_vms(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListMigratingVmsRequest, dict]): The request object. Request message for @@ -1850,7 +2255,7 @@ def list_migrating_vms( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -1903,6 +2308,26 @@ def get_migrating_vm( ) -> vmmigration.MigratingVm: r"""Gets details of a single MigratingVm. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetMigratingVmRequest( + name="name_value", + ) + + # Make the request + response = client.get_migrating_vm(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetMigratingVmRequest, dict]): The request object. Request message for 'GetMigratingVm' @@ -1928,7 +2353,7 @@ def get_migrating_vm( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -1976,6 +2401,29 @@ def update_migrating_vm( ) -> operation.Operation: r"""Updates the parameters of a single MigratingVm. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_update_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateMigratingVmRequest( + ) + + # Make the request + operation = client.update_migrating_vm(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.UpdateMigratingVmRequest, dict]): The request object. Request message for @@ -2011,7 +2459,7 @@ def update_migrating_vm( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([migrating_vm, update_mask]) if request is not None and has_flattened_params: @@ -2070,6 +2518,30 @@ def delete_migrating_vm( ) -> operation.Operation: r"""Deletes a single MigratingVm. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_delete_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteMigratingVmRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_migrating_vm(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.DeleteMigratingVmRequest, dict]): The request object. Request message for @@ -2107,7 +2579,7 @@ def delete_migrating_vm( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -2164,6 +2636,31 @@ def start_migration( uploading data and creating snapshots, in replication cycles scheduled by the policy. + + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_start_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.StartMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.start_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.StartMigrationRequest, dict]): The request object. Request message for @@ -2191,7 +2688,7 @@ def start_migration( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([migrating_vm]) if request is not None and has_flattened_params: @@ -2252,6 +2749,31 @@ def resume_migration( start the process of uploading data and creating snapshots. + + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_resume_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ResumeMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.resume_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ResumeMigrationRequest, dict]): The request object. Request message for @@ -2318,6 +2840,31 @@ def pause_migration( data. Further replication cycles will not be triggered while the VM is paused. + + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_pause_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.PauseMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.pause_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.PauseMigrationRequest, dict]): The request object. Request message for 'PauseMigration' @@ -2384,6 +2931,31 @@ def finalize_migration( resources that are no longer being used. Only applicable after cutover is done. + + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_finalize_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.FinalizeMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.finalize_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.FinalizeMigrationRequest, dict]): The request object. Request message for @@ -2411,7 +2983,7 @@ def finalize_migration( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([migrating_vm]) if request is not None and has_flattened_params: @@ -2470,6 +3042,31 @@ def create_clone_job( ) -> operation.Operation: r"""Initiates a Clone of a specific migrating VM. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_clone_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateCloneJobRequest( + parent="parent_value", + clone_job_id="clone_job_id_value", + ) + + # Make the request + operation = client.create_clone_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateCloneJobRequest, dict]): The request object. Request message for 'CreateCloneJob' @@ -2516,7 +3113,7 @@ def create_clone_job( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, clone_job, clone_job_id]) if request is not None and has_flattened_params: @@ -2575,6 +3172,30 @@ def cancel_clone_job( ) -> operation.Operation: r"""Initiates the cancellation of a running clone job. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_cancel_clone_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CancelCloneJobRequest( + name="name_value", + ) + + # Make the request + operation = client.cancel_clone_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CancelCloneJobRequest, dict]): The request object. Request message for 'CancelCloneJob' @@ -2600,7 +3221,7 @@ def cancel_clone_job( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -2655,6 +3276,28 @@ def list_clone_jobs( ) -> pagers.ListCloneJobsPager: r"""Lists CloneJobs of a given migrating VM. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_clone_jobs(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListCloneJobsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_clone_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListCloneJobsRequest, dict]): The request object. Request message for @@ -2682,7 +3325,7 @@ def list_clone_jobs( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -2735,6 +3378,26 @@ def get_clone_job( ) -> vmmigration.CloneJob: r"""Gets details of a single CloneJob. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_clone_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetCloneJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_clone_job(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetCloneJobRequest, dict]): The request object. Request message for 'GetCloneJob' @@ -2769,7 +3432,7 @@ def get_clone_job( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -2820,6 +3483,32 @@ def create_cutover_job( The returned LRO is completed when the cutover job resource is created and the job is initiated. + + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_cutover_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateCutoverJobRequest( + parent="parent_value", + cutover_job_id="cutover_job_id_value", + ) + + # Make the request + operation = client.create_cutover_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateCutoverJobRequest, dict]): The request object. Request message for @@ -2856,7 +3545,7 @@ def create_cutover_job( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, cutover_job, cutover_job_id]) if request is not None and has_flattened_params: @@ -2915,6 +3604,30 @@ def cancel_cutover_job( ) -> operation.Operation: r"""Initiates the cancellation of a running cutover job. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_cancel_cutover_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CancelCutoverJobRequest( + name="name_value", + ) + + # Make the request + operation = client.cancel_cutover_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CancelCutoverJobRequest, dict]): The request object. Request message for @@ -2940,7 +3653,7 @@ def cancel_cutover_job( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -2995,6 +3708,28 @@ def list_cutover_jobs( ) -> pagers.ListCutoverJobsPager: r"""Lists CutoverJobs of a given migrating VM. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_cutover_jobs(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListCutoverJobsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_cutover_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListCutoverJobsRequest, dict]): The request object. Request message for @@ -3022,7 +3757,7 @@ def list_cutover_jobs( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -3075,6 +3810,26 @@ def get_cutover_job( ) -> vmmigration.CutoverJob: r"""Gets details of a single CutoverJob. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_cutover_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetCutoverJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_cutover_job(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetCutoverJobRequest, dict]): The request object. Request message for 'GetCutoverJob' @@ -3101,7 +3856,7 @@ def get_cutover_job( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -3148,6 +3903,28 @@ def list_groups( ) -> pagers.ListGroupsPager: r"""Lists Groups in a given project and location. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_groups(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListGroupsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_groups(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListGroupsRequest, dict]): The request object. Request message for 'ListGroups' @@ -3175,7 +3952,7 @@ def list_groups( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -3228,6 +4005,26 @@ def get_group( ) -> vmmigration.Group: r"""Gets details of a single Group. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_group(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetGroupRequest( + name="name_value", + ) + + # Make the request + response = client.get_group(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetGroupRequest, dict]): The request object. Request message for 'GetGroup' @@ -3251,7 +4048,7 @@ def get_group( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -3300,6 +4097,31 @@ def create_group( ) -> operation.Operation: r"""Creates a new Group in a given project and location. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_group(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateGroupRequest( + parent="parent_value", + group_id="group_id_value", + ) + + # Make the request + operation = client.create_group(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateGroupRequest, dict]): The request object. Request message for 'CreateGroup' @@ -3334,7 +4156,7 @@ def create_group( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, group, group_id]) if request is not None and has_flattened_params: @@ -3394,6 +4216,29 @@ def update_group( ) -> operation.Operation: r"""Updates the parameters of a single Group. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_update_group(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateGroupRequest( + ) + + # Make the request + operation = client.update_group(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.UpdateGroupRequest, dict]): The request object. Update message for 'UpdateGroups' @@ -3429,7 +4274,7 @@ def update_group( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([group, update_mask]) if request is not None and has_flattened_params: @@ -3488,6 +4333,30 @@ def delete_group( ) -> operation.Operation: r"""Deletes a single Group. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_delete_group(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteGroupRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_group(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.DeleteGroupRequest, dict]): The request object. Request message for 'DeleteGroup' @@ -3523,7 +4392,7 @@ def delete_group( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -3578,6 +4447,30 @@ def add_group_migration( ) -> operation.Operation: r"""Adds a MigratingVm to a Group. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_add_group_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.AddGroupMigrationRequest( + group="group_value", + ) + + # Make the request + operation = client.add_group_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.AddGroupMigrationRequest, dict]): The request object. Request message for @@ -3605,7 +4498,7 @@ def add_group_migration( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([group]) if request is not None and has_flattened_params: @@ -3660,6 +4553,30 @@ def remove_group_migration( ) -> operation.Operation: r"""Removes a MigratingVm from a Group. + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_remove_group_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.RemoveGroupMigrationRequest( + group="group_value", + ) + + # Make the request + operation = client.remove_group_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.RemoveGroupMigrationRequest, dict]): The request object. Request message for @@ -3685,7 +4602,7 @@ def remove_group_migration( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([group]) if request is not None and has_flattened_params: @@ -3743,6 +4660,29 @@ def list_target_projects( NOTE: TargetProject is a global resource; hence the only supported value for location is ``global``. + + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_list_target_projects(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListTargetProjectsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_target_projects(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.ListTargetProjectsRequest, dict]): The request object. Request message for @@ -3770,7 +4710,7 @@ def list_target_projects( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -3826,6 +4766,27 @@ def get_target_project( NOTE: TargetProject is a global resource; hence the only supported value for location is ``global``. + + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_get_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetTargetProjectRequest( + name="name_value", + ) + + # Make the request + response = client.get_target_project(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.GetTargetProjectRequest, dict]): The request object. Request message for @@ -3849,7 +4810,7 @@ def get_target_project( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -3901,6 +4862,32 @@ def create_target_project( NOTE: TargetProject is a global resource; hence the only supported value for location is ``global``. + + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_create_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateTargetProjectRequest( + parent="parent_value", + target_project_id="target_project_id_value", + ) + + # Make the request + operation = client.create_target_project(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.CreateTargetProjectRequest, dict]): The request object. Request message for @@ -3935,7 +4922,7 @@ def create_target_project( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent, target_project, target_project_id]) if request is not None and has_flattened_params: @@ -3998,6 +4985,30 @@ def update_target_project( NOTE: TargetProject is a global resource; hence the only supported value for location is ``global``. + + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_update_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateTargetProjectRequest( + ) + + # Make the request + operation = client.update_target_project(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.UpdateTargetProjectRequest, dict]): The request object. Update message for @@ -4033,7 +5044,7 @@ def update_target_project( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([target_project, update_mask]) if request is not None and has_flattened_params: @@ -4095,6 +5106,31 @@ def delete_target_project( NOTE: TargetProject is a global resource; hence the only supported value for location is ``global``. + + + .. code-block:: + + from google.cloud import vmmigration_v1 + + def sample_delete_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteTargetProjectRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_target_project(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.vmmigration_v1.types.DeleteTargetProjectRequest, dict]): The request object. Request message for @@ -4130,7 +5166,7 @@ def delete_target_project( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: diff --git a/google/cloud/vmmigration_v1/services/vm_migration/transports/grpc.py b/google/cloud/vmmigration_v1/services/vm_migration/transports/grpc.py index c01573f..671bb7d 100644 --- a/google/cloud/vmmigration_v1/services/vm_migration/transports/grpc.py +++ b/google/cloud/vmmigration_v1/services/vm_migration/transports/grpc.py @@ -161,8 +161,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, @@ -235,7 +238,7 @@ def operations_client(self) -> operations_v1.OperationsClient: This property caches on the instance; repeated calls return the same client. """ - # Sanity check: Only create a new client if we do not already have one. + # Quick check: Only create a new client if we do not already have one. if self._operations_client is None: self._operations_client = operations_v1.OperationsClient(self.grpc_channel) diff --git a/google/cloud/vmmigration_v1/services/vm_migration/transports/grpc_asyncio.py b/google/cloud/vmmigration_v1/services/vm_migration/transports/grpc_asyncio.py index 4a033b4..25bd19b 100644 --- a/google/cloud/vmmigration_v1/services/vm_migration/transports/grpc_asyncio.py +++ b/google/cloud/vmmigration_v1/services/vm_migration/transports/grpc_asyncio.py @@ -206,8 +206,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, @@ -237,7 +240,7 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient: This property caches on the instance; repeated calls return the same client. """ - # Sanity check: Only create a new client if we do not already have one. + # Quick check: Only create a new client if we do not already have one. if self._operations_client is None: self._operations_client = operations_v1.OperationsAsyncClient( self.grpc_channel diff --git a/google/cloud/vmmigration_v1/types/vmmigration.py b/google/cloud/vmmigration_v1/types/vmmigration.py index e56b081..7becaed 100644 --- a/google/cloud/vmmigration_v1/types/vmmigration.py +++ b/google/cloud/vmmigration_v1/types/vmmigration.py @@ -870,8 +870,7 @@ class VmwareVmDetails(proto.Message): the VM in MB. guest_description (str): The VM's OS. See for example - https://pubs.vmware.com/vi- - sdk/visdk250/ReferenceGuide/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html + https://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html for types of strings this might hold. boot_option (google.cloud.vmmigration_v1.types.VmwareVmDetails.BootOption): Output only. The VM Boot Option. @@ -1049,9 +1048,9 @@ class VmUtilizationMetrics(proto.Message): Average disk IO rate, in kilobytes per second. network_throughput_max_kbps (int): - Max network throughput (combined transmit- - ates and receive-rates), in kilobytes per - second. + Max network throughput (combined + transmit-rates and receive-rates), in kilobytes + per second. network_throughput_average_kbps (int): Average network throughput (combined transmit-rates and receive-rates), in kilobytes diff --git a/samples/generated_samples/snippet_metadata_vmmigration_v1.json b/samples/generated_samples/snippet_metadata_vmmigration_v1.json new file mode 100644 index 0000000..bfd6da3 --- /dev/null +++ b/samples/generated_samples/snippet_metadata_vmmigration_v1.json @@ -0,0 +1,3831 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "AddGroupMigration" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_add_group_migration_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_AddGroupMigration_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "AddGroupMigration" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_add_group_migration_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_AddGroupMigration_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CancelCloneJob" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_cancel_clone_job_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CancelCloneJob_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CancelCloneJob" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_cancel_clone_job_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CancelCloneJob_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CancelCutoverJob" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_cancel_cutover_job_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CancelCutoverJob_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CancelCutoverJob" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_cancel_cutover_job_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CancelCutoverJob_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateCloneJob" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_clone_job_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateCloneJob_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateCloneJob" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_clone_job_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateCloneJob_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateCutoverJob" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_cutover_job_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateCutoverJob_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateCutoverJob" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_cutover_job_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateCutoverJob_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateDatacenterConnector" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_datacenter_connector_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateDatacenterConnector_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateDatacenterConnector" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_datacenter_connector_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateDatacenterConnector_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateGroup" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_group_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateGroup_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateGroup" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_group_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateGroup_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateMigratingVm" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_migrating_vm_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateMigratingVm_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateMigratingVm" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_migrating_vm_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateMigratingVm_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateSource" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_source_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateSource_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateSource" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_source_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateSource_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateTargetProject" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_target_project_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateTargetProject_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateTargetProject" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_target_project_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateTargetProject_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateUtilizationReport" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_utilization_report_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateUtilizationReport_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "CreateUtilizationReport" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_create_utilization_report_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_CreateUtilizationReport_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "DeleteDatacenterConnector" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_delete_datacenter_connector_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_DeleteDatacenterConnector_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "DeleteDatacenterConnector" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_delete_datacenter_connector_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_DeleteDatacenterConnector_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "DeleteGroup" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_delete_group_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_DeleteGroup_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "DeleteGroup" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_delete_group_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_DeleteGroup_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "DeleteMigratingVm" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_delete_migrating_vm_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_DeleteMigratingVm_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "DeleteMigratingVm" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_delete_migrating_vm_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_DeleteMigratingVm_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "DeleteSource" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_delete_source_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_DeleteSource_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "DeleteSource" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_delete_source_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_DeleteSource_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "DeleteTargetProject" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_delete_target_project_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_DeleteTargetProject_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "DeleteTargetProject" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_delete_target_project_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_DeleteTargetProject_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "DeleteUtilizationReport" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_delete_utilization_report_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_DeleteUtilizationReport_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "DeleteUtilizationReport" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_delete_utilization_report_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_DeleteUtilizationReport_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "FetchInventory" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_fetch_inventory_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_FetchInventory_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "FetchInventory" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_fetch_inventory_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_FetchInventory_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "FinalizeMigration" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_finalize_migration_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_FinalizeMigration_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "FinalizeMigration" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_finalize_migration_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_FinalizeMigration_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetCloneJob" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_clone_job_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetCloneJob_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetCloneJob" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_clone_job_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetCloneJob_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetCutoverJob" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_cutover_job_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetCutoverJob_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetCutoverJob" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_cutover_job_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetCutoverJob_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetDatacenterConnector" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_datacenter_connector_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetDatacenterConnector_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetDatacenterConnector" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_datacenter_connector_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetDatacenterConnector_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetGroup" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_group_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetGroup_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetGroup" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_group_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetGroup_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetMigratingVm" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_migrating_vm_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetMigratingVm_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetMigratingVm" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_migrating_vm_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetMigratingVm_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetSource" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_source_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetSource_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetSource" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_source_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetSource_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetTargetProject" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_target_project_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetTargetProject_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetTargetProject" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_target_project_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetTargetProject_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetUtilizationReport" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_utilization_report_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetUtilizationReport_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "GetUtilizationReport" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_get_utilization_report_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_GetUtilizationReport_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListCloneJobs" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_clone_jobs_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListCloneJobs_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListCloneJobs" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_clone_jobs_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListCloneJobs_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListCutoverJobs" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_cutover_jobs_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListCutoverJobs_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListCutoverJobs" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_cutover_jobs_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListCutoverJobs_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListDatacenterConnectors" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_datacenter_connectors_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListDatacenterConnectors_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListDatacenterConnectors" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_datacenter_connectors_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListDatacenterConnectors_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListGroups" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_groups_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListGroups_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListGroups" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_groups_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListGroups_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListMigratingVms" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_migrating_vms_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListMigratingVms_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListMigratingVms" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_migrating_vms_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListMigratingVms_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListSources" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_sources_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListSources_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListSources" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_sources_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListSources_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListTargetProjects" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_target_projects_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListTargetProjects_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListTargetProjects" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_target_projects_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListTargetProjects_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListUtilizationReports" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_utilization_reports_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListUtilizationReports_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ListUtilizationReports" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_list_utilization_reports_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ListUtilizationReports_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "PauseMigration" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_pause_migration_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_PauseMigration_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "PauseMigration" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_pause_migration_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_PauseMigration_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "RemoveGroupMigration" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_remove_group_migration_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_RemoveGroupMigration_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "RemoveGroupMigration" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_remove_group_migration_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_RemoveGroupMigration_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ResumeMigration" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_resume_migration_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ResumeMigration_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "ResumeMigration" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_resume_migration_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_ResumeMigration_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "StartMigration" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_start_migration_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_StartMigration_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "StartMigration" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_start_migration_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_StartMigration_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "UpdateGroup" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_update_group_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_UpdateGroup_async", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "UpdateGroup" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_update_group_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_UpdateGroup_sync", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "UpdateMigratingVm" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_update_migrating_vm_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_UpdateMigratingVm_async", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "UpdateMigratingVm" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_update_migrating_vm_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_UpdateMigratingVm_sync", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "UpdateSource" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_update_source_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_UpdateSource_async", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "UpdateSource" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_update_source_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_UpdateSource_sync", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "UpdateTargetProject" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_update_target_project_async.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_UpdateTargetProject_async", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VmMigration" + }, + "shortName": "UpdateTargetProject" + } + }, + "file": "vmmigration_generated_vmmigration_v1_vm_migration_update_target_project_sync.py", + "regionTag": "vmmigration_generated_vmmigration_v1_VmMigration_UpdateTargetProject_sync", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 44, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 45, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_add_group_migration_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_add_group_migration_async.py new file mode 100644 index 0000000..45cb4ca --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_add_group_migration_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AddGroupMigration +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_AddGroupMigration_async] +from google.cloud import vmmigration_v1 + + +async def sample_add_group_migration(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.AddGroupMigrationRequest( + group="group_value", + ) + + # Make the request + operation = client.add_group_migration(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_AddGroupMigration_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_add_group_migration_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_add_group_migration_sync.py new file mode 100644 index 0000000..d014da3 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_add_group_migration_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AddGroupMigration +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_AddGroupMigration_sync] +from google.cloud import vmmigration_v1 + + +def sample_add_group_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.AddGroupMigrationRequest( + group="group_value", + ) + + # Make the request + operation = client.add_group_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_AddGroupMigration_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_cancel_clone_job_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_cancel_clone_job_async.py new file mode 100644 index 0000000..2ba3b24 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_cancel_clone_job_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CancelCloneJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CancelCloneJob_async] +from google.cloud import vmmigration_v1 + + +async def sample_cancel_clone_job(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.CancelCloneJobRequest( + name="name_value", + ) + + # Make the request + operation = client.cancel_clone_job(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CancelCloneJob_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_cancel_clone_job_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_cancel_clone_job_sync.py new file mode 100644 index 0000000..e43ebd7 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_cancel_clone_job_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CancelCloneJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CancelCloneJob_sync] +from google.cloud import vmmigration_v1 + + +def sample_cancel_clone_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CancelCloneJobRequest( + name="name_value", + ) + + # Make the request + operation = client.cancel_clone_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CancelCloneJob_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_cancel_cutover_job_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_cancel_cutover_job_async.py new file mode 100644 index 0000000..0689546 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_cancel_cutover_job_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CancelCutoverJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CancelCutoverJob_async] +from google.cloud import vmmigration_v1 + + +async def sample_cancel_cutover_job(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.CancelCutoverJobRequest( + name="name_value", + ) + + # Make the request + operation = client.cancel_cutover_job(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CancelCutoverJob_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_cancel_cutover_job_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_cancel_cutover_job_sync.py new file mode 100644 index 0000000..e56bdba --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_cancel_cutover_job_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CancelCutoverJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CancelCutoverJob_sync] +from google.cloud import vmmigration_v1 + + +def sample_cancel_cutover_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CancelCutoverJobRequest( + name="name_value", + ) + + # Make the request + operation = client.cancel_cutover_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CancelCutoverJob_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_clone_job_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_clone_job_async.py new file mode 100644 index 0000000..1f0b4e9 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_clone_job_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCloneJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateCloneJob_async] +from google.cloud import vmmigration_v1 + + +async def sample_create_clone_job(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateCloneJobRequest( + parent="parent_value", + clone_job_id="clone_job_id_value", + ) + + # Make the request + operation = client.create_clone_job(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateCloneJob_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_clone_job_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_clone_job_sync.py new file mode 100644 index 0000000..b0d5533 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_clone_job_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCloneJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateCloneJob_sync] +from google.cloud import vmmigration_v1 + + +def sample_create_clone_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateCloneJobRequest( + parent="parent_value", + clone_job_id="clone_job_id_value", + ) + + # Make the request + operation = client.create_clone_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateCloneJob_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_cutover_job_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_cutover_job_async.py new file mode 100644 index 0000000..57703ec --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_cutover_job_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCutoverJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateCutoverJob_async] +from google.cloud import vmmigration_v1 + + +async def sample_create_cutover_job(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateCutoverJobRequest( + parent="parent_value", + cutover_job_id="cutover_job_id_value", + ) + + # Make the request + operation = client.create_cutover_job(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateCutoverJob_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_cutover_job_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_cutover_job_sync.py new file mode 100644 index 0000000..0f13741 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_cutover_job_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCutoverJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateCutoverJob_sync] +from google.cloud import vmmigration_v1 + + +def sample_create_cutover_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateCutoverJobRequest( + parent="parent_value", + cutover_job_id="cutover_job_id_value", + ) + + # Make the request + operation = client.create_cutover_job(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateCutoverJob_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_datacenter_connector_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_datacenter_connector_async.py new file mode 100644 index 0000000..e983cc3 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_datacenter_connector_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateDatacenterConnector +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateDatacenterConnector_async] +from google.cloud import vmmigration_v1 + + +async def sample_create_datacenter_connector(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateDatacenterConnectorRequest( + parent="parent_value", + datacenter_connector_id="datacenter_connector_id_value", + ) + + # Make the request + operation = client.create_datacenter_connector(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateDatacenterConnector_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_datacenter_connector_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_datacenter_connector_sync.py new file mode 100644 index 0000000..68b6df2 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_datacenter_connector_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateDatacenterConnector +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateDatacenterConnector_sync] +from google.cloud import vmmigration_v1 + + +def sample_create_datacenter_connector(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateDatacenterConnectorRequest( + parent="parent_value", + datacenter_connector_id="datacenter_connector_id_value", + ) + + # Make the request + operation = client.create_datacenter_connector(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateDatacenterConnector_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_group_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_group_async.py new file mode 100644 index 0000000..d6feed0 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_group_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateGroup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateGroup_async] +from google.cloud import vmmigration_v1 + + +async def sample_create_group(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateGroupRequest( + parent="parent_value", + group_id="group_id_value", + ) + + # Make the request + operation = client.create_group(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateGroup_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_group_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_group_sync.py new file mode 100644 index 0000000..1facf1f --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_group_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateGroup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateGroup_sync] +from google.cloud import vmmigration_v1 + + +def sample_create_group(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateGroupRequest( + parent="parent_value", + group_id="group_id_value", + ) + + # Make the request + operation = client.create_group(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateGroup_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_migrating_vm_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_migrating_vm_async.py new file mode 100644 index 0000000..35c3712 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_migrating_vm_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateMigratingVm +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateMigratingVm_async] +from google.cloud import vmmigration_v1 + + +async def sample_create_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateMigratingVmRequest( + parent="parent_value", + migrating_vm_id="migrating_vm_id_value", + ) + + # Make the request + operation = client.create_migrating_vm(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateMigratingVm_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_migrating_vm_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_migrating_vm_sync.py new file mode 100644 index 0000000..da6e9bf --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_migrating_vm_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateMigratingVm +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateMigratingVm_sync] +from google.cloud import vmmigration_v1 + + +def sample_create_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateMigratingVmRequest( + parent="parent_value", + migrating_vm_id="migrating_vm_id_value", + ) + + # Make the request + operation = client.create_migrating_vm(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateMigratingVm_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_source_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_source_async.py new file mode 100644 index 0000000..dc04b4f --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_source_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateSource +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateSource_async] +from google.cloud import vmmigration_v1 + + +async def sample_create_source(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateSourceRequest( + parent="parent_value", + source_id="source_id_value", + ) + + # Make the request + operation = client.create_source(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateSource_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_source_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_source_sync.py new file mode 100644 index 0000000..d72be42 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_source_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateSource +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateSource_sync] +from google.cloud import vmmigration_v1 + + +def sample_create_source(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateSourceRequest( + parent="parent_value", + source_id="source_id_value", + ) + + # Make the request + operation = client.create_source(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateSource_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_target_project_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_target_project_async.py new file mode 100644 index 0000000..1489bae --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_target_project_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateTargetProject +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateTargetProject_async] +from google.cloud import vmmigration_v1 + + +async def sample_create_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateTargetProjectRequest( + parent="parent_value", + target_project_id="target_project_id_value", + ) + + # Make the request + operation = client.create_target_project(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateTargetProject_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_target_project_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_target_project_sync.py new file mode 100644 index 0000000..67a117c --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_target_project_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateTargetProject +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateTargetProject_sync] +from google.cloud import vmmigration_v1 + + +def sample_create_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateTargetProjectRequest( + parent="parent_value", + target_project_id="target_project_id_value", + ) + + # Make the request + operation = client.create_target_project(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateTargetProject_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_utilization_report_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_utilization_report_async.py new file mode 100644 index 0000000..8f824cf --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_utilization_report_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateUtilizationReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateUtilizationReport_async] +from google.cloud import vmmigration_v1 + + +async def sample_create_utilization_report(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateUtilizationReportRequest( + parent="parent_value", + utilization_report_id="utilization_report_id_value", + ) + + # Make the request + operation = client.create_utilization_report(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateUtilizationReport_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_utilization_report_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_utilization_report_sync.py new file mode 100644 index 0000000..8d06a42 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_create_utilization_report_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateUtilizationReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_CreateUtilizationReport_sync] +from google.cloud import vmmigration_v1 + + +def sample_create_utilization_report(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.CreateUtilizationReportRequest( + parent="parent_value", + utilization_report_id="utilization_report_id_value", + ) + + # Make the request + operation = client.create_utilization_report(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_CreateUtilizationReport_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_datacenter_connector_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_datacenter_connector_async.py new file mode 100644 index 0000000..1b0c473 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_datacenter_connector_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteDatacenterConnector +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_DeleteDatacenterConnector_async] +from google.cloud import vmmigration_v1 + + +async def sample_delete_datacenter_connector(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteDatacenterConnectorRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_datacenter_connector(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_DeleteDatacenterConnector_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_datacenter_connector_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_datacenter_connector_sync.py new file mode 100644 index 0000000..fade4f5 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_datacenter_connector_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteDatacenterConnector +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_DeleteDatacenterConnector_sync] +from google.cloud import vmmigration_v1 + + +def sample_delete_datacenter_connector(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteDatacenterConnectorRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_datacenter_connector(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_DeleteDatacenterConnector_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_group_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_group_async.py new file mode 100644 index 0000000..7a6c73e --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_group_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteGroup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_DeleteGroup_async] +from google.cloud import vmmigration_v1 + + +async def sample_delete_group(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteGroupRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_group(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_DeleteGroup_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_group_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_group_sync.py new file mode 100644 index 0000000..6c5e464 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_group_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteGroup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_DeleteGroup_sync] +from google.cloud import vmmigration_v1 + + +def sample_delete_group(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteGroupRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_group(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_DeleteGroup_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_migrating_vm_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_migrating_vm_async.py new file mode 100644 index 0000000..17dca7b --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_migrating_vm_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteMigratingVm +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_DeleteMigratingVm_async] +from google.cloud import vmmigration_v1 + + +async def sample_delete_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteMigratingVmRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_migrating_vm(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_DeleteMigratingVm_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_migrating_vm_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_migrating_vm_sync.py new file mode 100644 index 0000000..1c71443 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_migrating_vm_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteMigratingVm +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_DeleteMigratingVm_sync] +from google.cloud import vmmigration_v1 + + +def sample_delete_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteMigratingVmRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_migrating_vm(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_DeleteMigratingVm_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_source_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_source_async.py new file mode 100644 index 0000000..a0e2014 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_source_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteSource +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_DeleteSource_async] +from google.cloud import vmmigration_v1 + + +async def sample_delete_source(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteSourceRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_source(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_DeleteSource_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_source_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_source_sync.py new file mode 100644 index 0000000..7b8d7e2 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_source_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteSource +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_DeleteSource_sync] +from google.cloud import vmmigration_v1 + + +def sample_delete_source(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteSourceRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_source(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_DeleteSource_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_target_project_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_target_project_async.py new file mode 100644 index 0000000..02dcde6 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_target_project_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteTargetProject +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_DeleteTargetProject_async] +from google.cloud import vmmigration_v1 + + +async def sample_delete_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteTargetProjectRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_target_project(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_DeleteTargetProject_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_target_project_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_target_project_sync.py new file mode 100644 index 0000000..e6b39fa --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_target_project_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteTargetProject +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_DeleteTargetProject_sync] +from google.cloud import vmmigration_v1 + + +def sample_delete_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteTargetProjectRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_target_project(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_DeleteTargetProject_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_utilization_report_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_utilization_report_async.py new file mode 100644 index 0000000..2fad030 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_utilization_report_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteUtilizationReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_DeleteUtilizationReport_async] +from google.cloud import vmmigration_v1 + + +async def sample_delete_utilization_report(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteUtilizationReportRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_utilization_report(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_DeleteUtilizationReport_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_utilization_report_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_utilization_report_sync.py new file mode 100644 index 0000000..3f97c86 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_delete_utilization_report_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteUtilizationReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_DeleteUtilizationReport_sync] +from google.cloud import vmmigration_v1 + + +def sample_delete_utilization_report(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.DeleteUtilizationReportRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_utilization_report(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_DeleteUtilizationReport_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_fetch_inventory_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_fetch_inventory_async.py new file mode 100644 index 0000000..5288652 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_fetch_inventory_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for FetchInventory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_FetchInventory_async] +from google.cloud import vmmigration_v1 + + +async def sample_fetch_inventory(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.FetchInventoryRequest( + source="source_value", + ) + + # Make the request + response = await client.fetch_inventory(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_FetchInventory_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_fetch_inventory_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_fetch_inventory_sync.py new file mode 100644 index 0000000..fe133a1 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_fetch_inventory_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for FetchInventory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_FetchInventory_sync] +from google.cloud import vmmigration_v1 + + +def sample_fetch_inventory(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.FetchInventoryRequest( + source="source_value", + ) + + # Make the request + response = client.fetch_inventory(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_FetchInventory_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_finalize_migration_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_finalize_migration_async.py new file mode 100644 index 0000000..cc57000 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_finalize_migration_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for FinalizeMigration +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_FinalizeMigration_async] +from google.cloud import vmmigration_v1 + + +async def sample_finalize_migration(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.FinalizeMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.finalize_migration(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_FinalizeMigration_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_finalize_migration_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_finalize_migration_sync.py new file mode 100644 index 0000000..297181b --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_finalize_migration_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for FinalizeMigration +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_FinalizeMigration_sync] +from google.cloud import vmmigration_v1 + + +def sample_finalize_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.FinalizeMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.finalize_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_FinalizeMigration_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_clone_job_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_clone_job_async.py new file mode 100644 index 0000000..b30e948 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_clone_job_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCloneJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetCloneJob_async] +from google.cloud import vmmigration_v1 + + +async def sample_get_clone_job(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetCloneJobRequest( + name="name_value", + ) + + # Make the request + response = await client.get_clone_job(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetCloneJob_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_clone_job_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_clone_job_sync.py new file mode 100644 index 0000000..6aa9502 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_clone_job_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCloneJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetCloneJob_sync] +from google.cloud import vmmigration_v1 + + +def sample_get_clone_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetCloneJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_clone_job(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetCloneJob_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_cutover_job_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_cutover_job_async.py new file mode 100644 index 0000000..3e380da --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_cutover_job_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCutoverJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetCutoverJob_async] +from google.cloud import vmmigration_v1 + + +async def sample_get_cutover_job(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetCutoverJobRequest( + name="name_value", + ) + + # Make the request + response = await client.get_cutover_job(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetCutoverJob_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_cutover_job_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_cutover_job_sync.py new file mode 100644 index 0000000..7ebc1c5 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_cutover_job_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCutoverJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetCutoverJob_sync] +from google.cloud import vmmigration_v1 + + +def sample_get_cutover_job(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetCutoverJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_cutover_job(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetCutoverJob_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_datacenter_connector_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_datacenter_connector_async.py new file mode 100644 index 0000000..37ab8f0 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_datacenter_connector_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetDatacenterConnector +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetDatacenterConnector_async] +from google.cloud import vmmigration_v1 + + +async def sample_get_datacenter_connector(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetDatacenterConnectorRequest( + name="name_value", + ) + + # Make the request + response = await client.get_datacenter_connector(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetDatacenterConnector_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_datacenter_connector_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_datacenter_connector_sync.py new file mode 100644 index 0000000..1c4de81 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_datacenter_connector_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetDatacenterConnector +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetDatacenterConnector_sync] +from google.cloud import vmmigration_v1 + + +def sample_get_datacenter_connector(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetDatacenterConnectorRequest( + name="name_value", + ) + + # Make the request + response = client.get_datacenter_connector(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetDatacenterConnector_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_group_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_group_async.py new file mode 100644 index 0000000..69e1bf2 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_group_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetGroup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetGroup_async] +from google.cloud import vmmigration_v1 + + +async def sample_get_group(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetGroupRequest( + name="name_value", + ) + + # Make the request + response = await client.get_group(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetGroup_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_group_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_group_sync.py new file mode 100644 index 0000000..3b6ff29 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_group_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetGroup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetGroup_sync] +from google.cloud import vmmigration_v1 + + +def sample_get_group(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetGroupRequest( + name="name_value", + ) + + # Make the request + response = client.get_group(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetGroup_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_migrating_vm_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_migrating_vm_async.py new file mode 100644 index 0000000..d6f0f91 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_migrating_vm_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetMigratingVm +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetMigratingVm_async] +from google.cloud import vmmigration_v1 + + +async def sample_get_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetMigratingVmRequest( + name="name_value", + ) + + # Make the request + response = await client.get_migrating_vm(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetMigratingVm_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_migrating_vm_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_migrating_vm_sync.py new file mode 100644 index 0000000..e5cf3d0 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_migrating_vm_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetMigratingVm +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetMigratingVm_sync] +from google.cloud import vmmigration_v1 + + +def sample_get_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetMigratingVmRequest( + name="name_value", + ) + + # Make the request + response = client.get_migrating_vm(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetMigratingVm_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_source_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_source_async.py new file mode 100644 index 0000000..95a1829 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_source_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSource +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetSource_async] +from google.cloud import vmmigration_v1 + + +async def sample_get_source(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetSourceRequest( + name="name_value", + ) + + # Make the request + response = await client.get_source(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetSource_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_source_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_source_sync.py new file mode 100644 index 0000000..d757e63 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_source_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSource +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetSource_sync] +from google.cloud import vmmigration_v1 + + +def sample_get_source(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetSourceRequest( + name="name_value", + ) + + # Make the request + response = client.get_source(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetSource_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_target_project_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_target_project_async.py new file mode 100644 index 0000000..2f889b8 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_target_project_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTargetProject +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetTargetProject_async] +from google.cloud import vmmigration_v1 + + +async def sample_get_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetTargetProjectRequest( + name="name_value", + ) + + # Make the request + response = await client.get_target_project(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetTargetProject_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_target_project_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_target_project_sync.py new file mode 100644 index 0000000..14b05e6 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_target_project_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTargetProject +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetTargetProject_sync] +from google.cloud import vmmigration_v1 + + +def sample_get_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetTargetProjectRequest( + name="name_value", + ) + + # Make the request + response = client.get_target_project(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetTargetProject_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_utilization_report_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_utilization_report_async.py new file mode 100644 index 0000000..b70210a --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_utilization_report_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetUtilizationReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetUtilizationReport_async] +from google.cloud import vmmigration_v1 + + +async def sample_get_utilization_report(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetUtilizationReportRequest( + name="name_value", + ) + + # Make the request + response = await client.get_utilization_report(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetUtilizationReport_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_utilization_report_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_utilization_report_sync.py new file mode 100644 index 0000000..12d21fd --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_get_utilization_report_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetUtilizationReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_GetUtilizationReport_sync] +from google.cloud import vmmigration_v1 + + +def sample_get_utilization_report(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.GetUtilizationReportRequest( + name="name_value", + ) + + # Make the request + response = client.get_utilization_report(request=request) + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_GetUtilizationReport_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_clone_jobs_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_clone_jobs_async.py new file mode 100644 index 0000000..19fc954 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_clone_jobs_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCloneJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListCloneJobs_async] +from google.cloud import vmmigration_v1 + + +async def sample_list_clone_jobs(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListCloneJobsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_clone_jobs(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListCloneJobs_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_clone_jobs_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_clone_jobs_sync.py new file mode 100644 index 0000000..129c461 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_clone_jobs_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCloneJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListCloneJobs_sync] +from google.cloud import vmmigration_v1 + + +def sample_list_clone_jobs(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListCloneJobsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_clone_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListCloneJobs_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_cutover_jobs_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_cutover_jobs_async.py new file mode 100644 index 0000000..92e3fd0 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_cutover_jobs_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCutoverJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListCutoverJobs_async] +from google.cloud import vmmigration_v1 + + +async def sample_list_cutover_jobs(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListCutoverJobsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_cutover_jobs(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListCutoverJobs_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_cutover_jobs_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_cutover_jobs_sync.py new file mode 100644 index 0000000..7dd681a --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_cutover_jobs_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCutoverJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListCutoverJobs_sync] +from google.cloud import vmmigration_v1 + + +def sample_list_cutover_jobs(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListCutoverJobsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_cutover_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListCutoverJobs_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_datacenter_connectors_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_datacenter_connectors_async.py new file mode 100644 index 0000000..741d5ab --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_datacenter_connectors_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListDatacenterConnectors +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListDatacenterConnectors_async] +from google.cloud import vmmigration_v1 + + +async def sample_list_datacenter_connectors(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListDatacenterConnectorsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_datacenter_connectors(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListDatacenterConnectors_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_datacenter_connectors_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_datacenter_connectors_sync.py new file mode 100644 index 0000000..75f6a4b --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_datacenter_connectors_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListDatacenterConnectors +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListDatacenterConnectors_sync] +from google.cloud import vmmigration_v1 + + +def sample_list_datacenter_connectors(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListDatacenterConnectorsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_datacenter_connectors(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListDatacenterConnectors_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_groups_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_groups_async.py new file mode 100644 index 0000000..5b0f6be --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_groups_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListGroups +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListGroups_async] +from google.cloud import vmmigration_v1 + + +async def sample_list_groups(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListGroupsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_groups(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListGroups_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_groups_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_groups_sync.py new file mode 100644 index 0000000..887a5e5 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_groups_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListGroups +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListGroups_sync] +from google.cloud import vmmigration_v1 + + +def sample_list_groups(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListGroupsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_groups(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListGroups_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_migrating_vms_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_migrating_vms_async.py new file mode 100644 index 0000000..73c5a5f --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_migrating_vms_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListMigratingVms +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListMigratingVms_async] +from google.cloud import vmmigration_v1 + + +async def sample_list_migrating_vms(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListMigratingVmsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_migrating_vms(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListMigratingVms_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_migrating_vms_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_migrating_vms_sync.py new file mode 100644 index 0000000..0d665c6 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_migrating_vms_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListMigratingVms +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListMigratingVms_sync] +from google.cloud import vmmigration_v1 + + +def sample_list_migrating_vms(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListMigratingVmsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_migrating_vms(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListMigratingVms_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_sources_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_sources_async.py new file mode 100644 index 0000000..7c03f2a --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_sources_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSources +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListSources_async] +from google.cloud import vmmigration_v1 + + +async def sample_list_sources(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListSourcesRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_sources(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListSources_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_sources_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_sources_sync.py new file mode 100644 index 0000000..deccf14 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_sources_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSources +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListSources_sync] +from google.cloud import vmmigration_v1 + + +def sample_list_sources(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListSourcesRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_sources(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListSources_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_target_projects_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_target_projects_async.py new file mode 100644 index 0000000..f3789a2 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_target_projects_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTargetProjects +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListTargetProjects_async] +from google.cloud import vmmigration_v1 + + +async def sample_list_target_projects(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListTargetProjectsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_target_projects(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListTargetProjects_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_target_projects_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_target_projects_sync.py new file mode 100644 index 0000000..c8fd613 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_target_projects_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTargetProjects +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListTargetProjects_sync] +from google.cloud import vmmigration_v1 + + +def sample_list_target_projects(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListTargetProjectsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_target_projects(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListTargetProjects_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_utilization_reports_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_utilization_reports_async.py new file mode 100644 index 0000000..babed04 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_utilization_reports_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListUtilizationReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListUtilizationReports_async] +from google.cloud import vmmigration_v1 + + +async def sample_list_utilization_reports(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListUtilizationReportsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_utilization_reports(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListUtilizationReports_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_utilization_reports_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_utilization_reports_sync.py new file mode 100644 index 0000000..30bde23 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_list_utilization_reports_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListUtilizationReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ListUtilizationReports_sync] +from google.cloud import vmmigration_v1 + + +def sample_list_utilization_reports(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ListUtilizationReportsRequest( + parent="parent_value", + page_token="page_token_value", + ) + + # Make the request + page_result = client.list_utilization_reports(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ListUtilizationReports_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_pause_migration_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_pause_migration_async.py new file mode 100644 index 0000000..6d84d8b --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_pause_migration_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PauseMigration +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_PauseMigration_async] +from google.cloud import vmmigration_v1 + + +async def sample_pause_migration(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.PauseMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.pause_migration(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_PauseMigration_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_pause_migration_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_pause_migration_sync.py new file mode 100644 index 0000000..0936312 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_pause_migration_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PauseMigration +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_PauseMigration_sync] +from google.cloud import vmmigration_v1 + + +def sample_pause_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.PauseMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.pause_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_PauseMigration_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_remove_group_migration_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_remove_group_migration_async.py new file mode 100644 index 0000000..06d9fc0 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_remove_group_migration_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RemoveGroupMigration +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_RemoveGroupMigration_async] +from google.cloud import vmmigration_v1 + + +async def sample_remove_group_migration(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.RemoveGroupMigrationRequest( + group="group_value", + ) + + # Make the request + operation = client.remove_group_migration(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_RemoveGroupMigration_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_remove_group_migration_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_remove_group_migration_sync.py new file mode 100644 index 0000000..84313d4 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_remove_group_migration_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RemoveGroupMigration +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_RemoveGroupMigration_sync] +from google.cloud import vmmigration_v1 + + +def sample_remove_group_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.RemoveGroupMigrationRequest( + group="group_value", + ) + + # Make the request + operation = client.remove_group_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_RemoveGroupMigration_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_resume_migration_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_resume_migration_async.py new file mode 100644 index 0000000..3d8d7d2 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_resume_migration_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ResumeMigration +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ResumeMigration_async] +from google.cloud import vmmigration_v1 + + +async def sample_resume_migration(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.ResumeMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.resume_migration(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ResumeMigration_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_resume_migration_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_resume_migration_sync.py new file mode 100644 index 0000000..3bab73c --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_resume_migration_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ResumeMigration +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_ResumeMigration_sync] +from google.cloud import vmmigration_v1 + + +def sample_resume_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.ResumeMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.resume_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_ResumeMigration_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_start_migration_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_start_migration_async.py new file mode 100644 index 0000000..83993c4 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_start_migration_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for StartMigration +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_StartMigration_async] +from google.cloud import vmmigration_v1 + + +async def sample_start_migration(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.StartMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.start_migration(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_StartMigration_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_start_migration_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_start_migration_sync.py new file mode 100644 index 0000000..ee82900 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_start_migration_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for StartMigration +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_StartMigration_sync] +from google.cloud import vmmigration_v1 + + +def sample_start_migration(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.StartMigrationRequest( + migrating_vm="migrating_vm_value", + ) + + # Make the request + operation = client.start_migration(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_StartMigration_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_group_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_group_async.py new file mode 100644 index 0000000..4bd6921 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_group_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateGroup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_UpdateGroup_async] +from google.cloud import vmmigration_v1 + + +async def sample_update_group(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateGroupRequest( + ) + + # Make the request + operation = client.update_group(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_UpdateGroup_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_group_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_group_sync.py new file mode 100644 index 0000000..23c1587 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_group_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateGroup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_UpdateGroup_sync] +from google.cloud import vmmigration_v1 + + +def sample_update_group(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateGroupRequest( + ) + + # Make the request + operation = client.update_group(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_UpdateGroup_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_migrating_vm_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_migrating_vm_async.py new file mode 100644 index 0000000..27a39b2 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_migrating_vm_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateMigratingVm +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_UpdateMigratingVm_async] +from google.cloud import vmmigration_v1 + + +async def sample_update_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateMigratingVmRequest( + ) + + # Make the request + operation = client.update_migrating_vm(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_UpdateMigratingVm_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_migrating_vm_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_migrating_vm_sync.py new file mode 100644 index 0000000..d686ad1 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_migrating_vm_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateMigratingVm +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_UpdateMigratingVm_sync] +from google.cloud import vmmigration_v1 + + +def sample_update_migrating_vm(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateMigratingVmRequest( + ) + + # Make the request + operation = client.update_migrating_vm(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_UpdateMigratingVm_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_source_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_source_async.py new file mode 100644 index 0000000..84c6b97 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_source_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateSource +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_UpdateSource_async] +from google.cloud import vmmigration_v1 + + +async def sample_update_source(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateSourceRequest( + ) + + # Make the request + operation = client.update_source(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_UpdateSource_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_source_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_source_sync.py new file mode 100644 index 0000000..af9632c --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_source_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateSource +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_UpdateSource_sync] +from google.cloud import vmmigration_v1 + + +def sample_update_source(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateSourceRequest( + ) + + # Make the request + operation = client.update_source(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_UpdateSource_sync] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_target_project_async.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_target_project_async.py new file mode 100644 index 0000000..9a8b105 --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_target_project_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateTargetProject +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_UpdateTargetProject_async] +from google.cloud import vmmigration_v1 + + +async def sample_update_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationAsyncClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateTargetProjectRequest( + ) + + # Make the request + operation = client.update_target_project(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_UpdateTargetProject_async] diff --git a/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_target_project_sync.py b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_target_project_sync.py new file mode 100644 index 0000000..a11fe6b --- /dev/null +++ b/samples/generated_samples/vmmigration_generated_vmmigration_v1_vm_migration_update_target_project_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateTargetProject +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-vm-migration + + +# [START vmmigration_generated_vmmigration_v1_VmMigration_UpdateTargetProject_sync] +from google.cloud import vmmigration_v1 + + +def sample_update_target_project(): + # Create a client + client = vmmigration_v1.VmMigrationClient() + + # Initialize request argument(s) + request = vmmigration_v1.UpdateTargetProjectRequest( + ) + + # Make the request + operation = client.update_target_project(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END vmmigration_generated_vmmigration_v1_VmMigration_UpdateTargetProject_sync] diff --git a/setup.py b/setup.py index 69abbe3..dc1443e 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ name = "google-cloud-vm-migration" description = "Cloud VM Migration API client library" -version = "1.0.0" +version = "1.1.0" url = "https://github.com/googleapis/python-vm-migration" release_status = "Development Status :: 5 - Production/Stable" dependencies = [ diff --git a/tests/unit/gapic/vmmigration_v1/test_vm_migration.py b/tests/unit/gapic/vmmigration_v1/test_vm_migration.py index 7abddc1..c7e2ecd 100644 --- a/tests/unit/gapic/vmmigration_v1/test_vm_migration.py +++ b/tests/unit/gapic/vmmigration_v1/test_vm_migration.py @@ -29,6 +29,7 @@ from google.api_core import gapic_v1 from google.api_core import grpc_helpers from google.api_core import grpc_helpers_async +from google.api_core import operation from google.api_core import operation_async # type: ignore from google.api_core import operations_v1 from google.api_core import path_template @@ -393,6 +394,83 @@ def test_vm_migration_client_mtls_env_auto( ) +@pytest.mark.parametrize("client_class", [VmMigrationClient, VmMigrationAsyncClient]) +@mock.patch.object( + VmMigrationClient, "DEFAULT_ENDPOINT", modify_default_endpoint(VmMigrationClient) +) +@mock.patch.object( + VmMigrationAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(VmMigrationAsyncClient), +) +def test_vm_migration_client_get_mtls_endpoint_and_cert_source(client_class): + mock_client_cert_source = mock.Mock() + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "true". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source == mock_client_cert_source + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "false". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + mock_client_cert_source = mock.Mock() + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert doesn't exist. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert exists. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_client_cert_source, + ): + ( + api_endpoint, + cert_source, + ) = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source == mock_client_cert_source + + @pytest.mark.parametrize( "client_class,transport_class,transport_name", [ @@ -425,21 +503,23 @@ def test_vm_migration_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ - (VmMigrationClient, transports.VmMigrationGrpcTransport, "grpc"), + (VmMigrationClient, transports.VmMigrationGrpcTransport, "grpc", grpc_helpers), ( VmMigrationAsyncClient, transports.VmMigrationGrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_vm_migration_client_client_options_credentials_file( - client_class, transport_class, transport_name + client_class, transport_class, transport_name, grpc_helpers ): # Check the case credentials file is provided. options = client_options.ClientOptions(credentials_file="credentials.json") + with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -473,6 +553,67 @@ def test_vm_migration_client_client_options_from_dict(): ) +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + (VmMigrationClient, transports.VmMigrationGrpcTransport, "grpc", grpc_helpers), + ( + VmMigrationAsyncClient, + transports.VmMigrationGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_vm_migration_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "vmmigration.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=None, + default_host="vmmigration.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize("request_type", [vmmigration.ListSourcesRequest, dict,]) def test_list_sources(request_type, transport: str = "grpc"): client = VmMigrationClient( @@ -10899,6 +11040,23 @@ def test_credentials_transport_error(): transport=transport, ) + # It is an error to provide an api_key and a transport instance. + transport = transports.VmMigrationGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = VmMigrationClient(client_options=options, transport=transport,) + + # It is an error to provide an api_key and a credential. + options = mock.Mock() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = VmMigrationClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + # It is an error to provide scopes and a transport instance. transport = transports.VmMigrationGrpcTransport( credentials=ga_credentials.AnonymousCredentials(), @@ -11720,3 +11878,33 @@ def test_client_ctx(): with client: pass close.assert_called() + + +@pytest.mark.parametrize( + "client_class,transport_class", + [ + (VmMigrationClient, transports.VmMigrationGrpcTransport), + (VmMigrationAsyncClient, transports.VmMigrationGrpcAsyncIOTransport), + ], +) +def test_api_key_credentials(client_class, transport_class): + with mock.patch.object( + google.auth._default, "get_api_key_credentials", create=True + ) as get_api_key_credentials: + mock_cred = mock.Mock() + get_api_key_credentials.return_value = mock_cred + options = client_options.ClientOptions() + options.api_key = "api_key" + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options) + patched.assert_called_once_with( + credentials=mock_cred, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + )