protected override void ProcessRecord() { AmazonAutoScaling client = base.GetClient(); Amazon.AutoScaling.Model.DeleteLaunchConfigurationRequest request = new Amazon.AutoScaling.Model.DeleteLaunchConfigurationRequest(); request.LaunchConfigurationName = this._LaunchConfigurationName; Amazon.AutoScaling.Model.DeleteLaunchConfigurationResponse response = client.DeleteLaunchConfiguration(request); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.AutoScaling.Model.DeleteLaunchConfigurationRequest(); if (cmdletContext.LaunchConfigurationName != null) { request.LaunchConfigurationName = cmdletContext.LaunchConfigurationName; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// Initiates the asynchronous execution of the DeleteLaunchConfiguration operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteLaunchConfiguration operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<DeleteLaunchConfigurationResponse> DeleteLaunchConfigurationAsync(DeleteLaunchConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteLaunchConfigurationRequestMarshaller(); var unmarshaller = DeleteLaunchConfigurationResponseUnmarshaller.Instance; return InvokeAsync<DeleteLaunchConfigurationRequest,DeleteLaunchConfigurationResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal DeleteLaunchConfigurationResponse DeleteLaunchConfiguration(DeleteLaunchConfigurationRequest request) { var marshaller = new DeleteLaunchConfigurationRequestMarshaller(); var unmarshaller = DeleteLaunchConfigurationResponseUnmarshaller.Instance; return Invoke<DeleteLaunchConfigurationRequest,DeleteLaunchConfigurationResponse>(request, marshaller, unmarshaller); }
IAsyncResult invokeDeleteLaunchConfiguration(DeleteLaunchConfigurationRequest deleteLaunchConfigurationRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteLaunchConfigurationRequestMarshaller().Marshall(deleteLaunchConfigurationRequest); var unmarshaller = DeleteLaunchConfigurationResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DeleteLaunchConfiguration operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.DeleteLaunchConfiguration"/> /// </summary> /// /// <param name="deleteLaunchConfigurationRequest">Container for the necessary parameters to execute the DeleteLaunchConfiguration operation on /// AmazonAutoScaling.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public IAsyncResult BeginDeleteLaunchConfiguration(DeleteLaunchConfigurationRequest deleteLaunchConfigurationRequest, AsyncCallback callback, object state) { return invokeDeleteLaunchConfiguration(deleteLaunchConfigurationRequest, callback, state, false); }
/// <summary> /// <para> Deletes the specified LaunchConfiguration. </para> <para> The specified launch configuration must not be attached to an Auto Scaling /// group. When this call completes, the launch configuration is no longer available for use. </para> /// </summary> /// /// <param name="deleteLaunchConfigurationRequest">Container for the necessary parameters to execute the DeleteLaunchConfiguration service /// method on AmazonAutoScaling.</param> /// /// <exception cref="ResourceInUseException"/> public DeleteLaunchConfigurationResponse DeleteLaunchConfiguration(DeleteLaunchConfigurationRequest deleteLaunchConfigurationRequest) { IAsyncResult asyncResult = invokeDeleteLaunchConfiguration(deleteLaunchConfigurationRequest, null, null, true); return EndDeleteLaunchConfiguration(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DeleteLaunchConfiguration operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.DeleteLaunchConfiguration"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteLaunchConfiguration operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<DeleteLaunchConfigurationResponse> DeleteLaunchConfigurationAsync(DeleteLaunchConfigurationRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteLaunchConfigurationRequestMarshaller(); var unmarshaller = DeleteLaunchConfigurationResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteLaunchConfigurationRequest, DeleteLaunchConfigurationResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> Deletes the specified LaunchConfiguration. </para> <para> The specified launch configuration must not be attached to an Auto Scaling /// group. When this call completes, the launch configuration is no longer available for use. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteLaunchConfiguration service /// method on AmazonAutoScaling.</param> /// /// <exception cref="T:Amazon.AutoScaling.Model.ResourceInUseException" /> public DeleteLaunchConfigurationResponse DeleteLaunchConfiguration(DeleteLaunchConfigurationRequest request) { var task = DeleteLaunchConfigurationAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the DeleteLaunchConfiguration operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteLaunchConfiguration operation on AmazonAutoScalingClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteLaunchConfiguration /// operation.</returns> public IAsyncResult BeginDeleteLaunchConfiguration(DeleteLaunchConfigurationRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteLaunchConfigurationRequestMarshaller(); var unmarshaller = DeleteLaunchConfigurationResponseUnmarshaller.Instance; return BeginInvoke<DeleteLaunchConfigurationRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Event handler for "Delete Launch Configuration" context menu click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mnuDeleteLc(object sender, EventArgs e) { if (vm.SelectedLaunchConfiguration == null || vm.SelectedLaunchConfiguration.LaunchConfiguration.LaunchConfigurationName == null) { MessageBox.Show(Window.GetWindow(this), "Please select a Launch Configuration.", "Make Selection", MessageBoxButton.OK); return; } if (MessageBox.Show(Window.GetWindow(this), string.Concat("Do you want to delete the Launch Configuration: ", vm.SelectedLaunchConfiguration.LaunchConfiguration.LaunchConfigurationName, "?"), "Confirmation", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { vm.IsBusy = true; vm.BusyContent = "Deleting Launch Configuration"; AmazonAutoScalingClient client = GetAutoScaleClient(); DeleteLaunchConfigurationRequest req = new DeleteLaunchConfigurationRequest(); req.LaunchConfigurationName = vm.SelectedLaunchConfiguration.LaunchConfiguration.LaunchConfigurationName; IAsyncResult result = client.BeginDeleteLaunchConfiguration(req, DeleteLaunchConfigCallback, vm.SelectedLaunchConfiguration.LaunchConfiguration.LaunchConfigurationName); } }
/// <summary> /// <para> Deletes the specified LaunchConfiguration. </para> <para> The specified launch configuration must not be attached to an Auto Scaling /// group. When this call completes, the launch configuration is no longer available for use. </para> /// </summary> /// /// <param name="deleteLaunchConfigurationRequest">Container for the necessary parameters to execute the DeleteLaunchConfiguration service /// method on AmazonAutoScaling.</param> /// /// <exception cref="ResourceInUseException"/> public DeleteLaunchConfigurationResponse DeleteLaunchConfiguration(DeleteLaunchConfigurationRequest deleteLaunchConfigurationRequest) { IRequest<DeleteLaunchConfigurationRequest> request = new DeleteLaunchConfigurationRequestMarshaller().Marshall(deleteLaunchConfigurationRequest); DeleteLaunchConfigurationResponse response = Invoke<DeleteLaunchConfigurationRequest, DeleteLaunchConfigurationResponse> (request, this.signer, DeleteLaunchConfigurationResponseUnmarshaller.GetInstance()); return response; }
internal DeleteLaunchConfigurationResponse DeleteLaunchConfiguration(DeleteLaunchConfigurationRequest request) { var task = DeleteLaunchConfigurationAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.AutoScaling.Model.DeleteLaunchConfigurationResponse CallAWSServiceOperation(IAmazonAutoScaling client, Amazon.AutoScaling.Model.DeleteLaunchConfigurationRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Auto Scaling", "DeleteLaunchConfiguration"); try { #if DESKTOP return(client.DeleteLaunchConfiguration(request)); #elif CORECLR return(client.DeleteLaunchConfigurationAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
/// <summary> /// Initiates the asynchronous execution of the DeleteLaunchConfiguration operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.DeleteLaunchConfiguration"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteLaunchConfiguration operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public async Task<DeleteLaunchConfigurationResponse> DeleteLaunchConfigurationAsync(DeleteLaunchConfigurationRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteLaunchConfigurationRequestMarshaller(); var unmarshaller = DeleteLaunchConfigurationResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteLaunchConfigurationRequest, DeleteLaunchConfigurationResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }