/// <summary> /// Moves an instance and its attached persistent disks from one zone to another. /// Documentation https://developers.google.com/compute/beta/reference/projects/moveInstance /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated compute service.</param> /// <param name="project">Project ID for this request.</param> /// <param name="body">A valid compute beta body.</param> /// <returns>OperationResponse</returns> public static Operation MoveInstance(computeService service, string project, InstanceMoveRequest body) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } if (project == null) { throw new ArgumentNullException(project); } // Make the request. return(service.Projects.MoveInstance(body, project).Execute()); } catch (Exception ex) { throw new Exception("Request Projects.MoveInstance failed.", ex); } }
/// <summary> /// Moves an instance and its attached persistent disks from one zone to another. /// Documentation https://developers.google.com/compute/v1/reference/projects/moveInstance /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated Compute service.</param> /// <param name="project">Project ID for this request.</param> /// <param name="body">A valid Compute v1 body.</param> /// <param name="optional">Optional paramaters.</param> /// <returns>OperationResponse</returns> public static Operation MoveInstance(ComputeService service, string project, InstanceMoveRequest body, ProjectsMoveInstanceOptionalParms optional = null) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } if (project == null) { throw new ArgumentNullException(project); } // Building the initial request. var request = service.Projects.MoveInstance(body, project); // Applying optional parameters to the request. request = (ProjectsResource.MoveInstanceRequest)SampleHelpers.ApplyOptionalParms(request, optional); // Requesting data. return(request.Execute()); } catch (Exception ex) { throw new Exception("Request Projects.MoveInstance failed.", ex); } }
/// <summary>Snippet for MoveInstance</summary> public void MoveInstance() { // Snippet: MoveInstance(string, InstanceMoveRequest, CallSettings) // Create client ProjectsClient projectsClient = ProjectsClient.Create(); // Initialize request argument(s) string project = ""; InstanceMoveRequest instanceMoveRequestResource = new InstanceMoveRequest(); // Make the request Operation response = projectsClient.MoveInstance(project, instanceMoveRequestResource); // End snippet }
/// <summary>Snippet for MoveInstanceAsync</summary> public async Task MoveInstanceAsync() { // Snippet: MoveInstanceAsync(string, InstanceMoveRequest, CallSettings) // Additional: MoveInstanceAsync(string, InstanceMoveRequest, CancellationToken) // Create client ProjectsClient projectsClient = await ProjectsClient.CreateAsync(); // Initialize request argument(s) string project = ""; InstanceMoveRequest instanceMoveRequestResource = new InstanceMoveRequest(); // Make the request Operation response = await projectsClient.MoveInstanceAsync(project, instanceMoveRequestResource); // End snippet }