public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.SimpleSystemsManagement.Model.RegisterPatchBaselineForPatchGroupRequest(); if (cmdletContext.BaselineId != null) { request.BaselineId = cmdletContext.BaselineId; } if (cmdletContext.PatchGroup != null) { request.PatchGroup = cmdletContext.PatchGroup; } 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 RegisterPatchBaselineForPatchGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RegisterPatchBaselineForPatchGroup operation on AmazonSimpleSystemsManagementClient.</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 EndRegisterPatchBaselineForPatchGroup /// operation.</returns> public IAsyncResult BeginRegisterPatchBaselineForPatchGroup(RegisterPatchBaselineForPatchGroupRequest request, AsyncCallback callback, object state) { var marshaller = new RegisterPatchBaselineForPatchGroupRequestMarshaller(); var unmarshaller = RegisterPatchBaselineForPatchGroupResponseUnmarshaller.Instance; return BeginInvoke<RegisterPatchBaselineForPatchGroupRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Registers a patch baseline for a patch group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RegisterPatchBaselineForPatchGroup service method.</param> /// /// <returns>The response from the RegisterPatchBaselineForPatchGroup service method, as returned by SimpleSystemsManagement.</returns> /// <exception cref="Amazon.SimpleSystemsManagement.Model.AlreadyExistsException"> /// Error returned if an attempt is made to register a patch group with a patch baseline /// that is already registered with a different patch baseline. /// </exception> /// <exception cref="Amazon.SimpleSystemsManagement.Model.DoesNotExistException"> /// Error returned when the ID specified for a resource (e.g. a Maintenance Window) doesn’t /// exist. /// </exception> /// <exception cref="Amazon.SimpleSystemsManagement.Model.InternalServerErrorException"> /// An error occurred on the server side. /// </exception> /// <exception cref="Amazon.SimpleSystemsManagement.Model.InvalidResourceIdException"> /// The resource ID is not valid. Verify that you entered the correct ID and try again. /// </exception> /// <exception cref="Amazon.SimpleSystemsManagement.Model.ResourceLimitExceededException"> /// Error returned when the caller has exceeded the default resource limits (e.g. too /// many Maintenance Windows have been created). /// </exception> public RegisterPatchBaselineForPatchGroupResponse RegisterPatchBaselineForPatchGroup(RegisterPatchBaselineForPatchGroupRequest request) { var marshaller = new RegisterPatchBaselineForPatchGroupRequestMarshaller(); var unmarshaller = RegisterPatchBaselineForPatchGroupResponseUnmarshaller.Instance; return Invoke<RegisterPatchBaselineForPatchGroupRequest,RegisterPatchBaselineForPatchGroupResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the RegisterPatchBaselineForPatchGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RegisterPatchBaselineForPatchGroup 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<RegisterPatchBaselineForPatchGroupResponse> RegisterPatchBaselineForPatchGroupAsync(RegisterPatchBaselineForPatchGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RegisterPatchBaselineForPatchGroupRequestMarshaller(); var unmarshaller = RegisterPatchBaselineForPatchGroupResponseUnmarshaller.Instance; return InvokeAsync<RegisterPatchBaselineForPatchGroupRequest,RegisterPatchBaselineForPatchGroupResponse>(request, marshaller, unmarshaller, cancellationToken); }
private Amazon.SimpleSystemsManagement.Model.RegisterPatchBaselineForPatchGroupResponse CallAWSServiceOperation(IAmazonSimpleSystemsManagement client, Amazon.SimpleSystemsManagement.Model.RegisterPatchBaselineForPatchGroupRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Systems Manager", "RegisterPatchBaselineForPatchGroup"); try { #if DESKTOP return(client.RegisterPatchBaselineForPatchGroup(request)); #elif CORECLR return(client.RegisterPatchBaselineForPatchGroupAsync(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; } }