Updates a specified layer.
internal UpdateLayerResponse UpdateLayer(UpdateLayerRequest request) { var marshaller = new UpdateLayerRequestMarshaller(); var unmarshaller = UpdateLayerResponseUnmarshaller.Instance; return Invoke<UpdateLayerRequest,UpdateLayerResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the UpdateLayer operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateLayer 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<UpdateLayerResponse> UpdateLayerAsync(UpdateLayerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateLayerRequestMarshaller(); var unmarshaller = UpdateLayerResponseUnmarshaller.Instance; return InvokeAsync<UpdateLayerRequest,UpdateLayerResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal UpdateLayerResponse UpdateLayer(UpdateLayerRequest request) { var task = UpdateLayerAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para>Updates a specified layer.</para> <para> <b>Required Permissions</b> : To use this action, an IAM user must have a Manage permissions /// level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see <a href="http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html">Managing User Permissions</a> .</para> /// </summary> /// /// <param name="updateLayerRequest">Container for the necessary parameters to execute the UpdateLayer service method on AmazonOpsWorks.</param> /// /// <exception cref="T:Amazon.OpsWorks.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.OpsWorks.Model.ValidationException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<UpdateLayerResponse> UpdateLayerAsync(UpdateLayerRequest updateLayerRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateLayerRequestMarshaller(); var unmarshaller = UpdateLayerResponseUnmarshaller.GetInstance(); return Invoke<IRequest, UpdateLayerRequest, UpdateLayerResponse>(updateLayerRequest, marshaller, unmarshaller, signer, cancellationToken); }
IAsyncResult invokeUpdateLayer(UpdateLayerRequest updateLayerRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new UpdateLayerRequestMarshaller().Marshall(updateLayerRequest); var unmarshaller = UpdateLayerResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the UpdateLayer operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateLayer operation on AmazonOpsWorksClient.</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 EndUpdateLayer /// operation.</returns> public IAsyncResult BeginUpdateLayer(UpdateLayerRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateLayerRequestMarshaller(); var unmarshaller = UpdateLayerResponseUnmarshaller.Instance; return BeginInvoke<UpdateLayerRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para>Updates a specified layer.</para> <para> <b>Required Permissions</b> : To use this action, an IAM user must have a Manage permissions /// level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see <a /// href="http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html" >Managing User Permissions</a> .</para> /// </summary> /// /// <param name="updateLayerRequest">Container for the necessary parameters to execute the UpdateLayer service method on AmazonOpsWorks.</param> /// /// <exception cref="ResourceNotFoundException"/> /// <exception cref="ValidationException"/> public UpdateLayerResponse UpdateLayer(UpdateLayerRequest updateLayerRequest) { IAsyncResult asyncResult = invokeUpdateLayer(updateLayerRequest, null, null, true); return EndUpdateLayer(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the UpdateLayer operation. /// <seealso cref="Amazon.OpsWorks.IAmazonOpsWorks.UpdateLayer"/> /// </summary> /// /// <param name="updateLayerRequest">Container for the necessary parameters to execute the UpdateLayer operation on AmazonOpsWorks.</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 BeginUpdateLayer(UpdateLayerRequest updateLayerRequest, AsyncCallback callback, object state) { return invokeUpdateLayer(updateLayerRequest, callback, state, false); }
IAsyncResult invokeUpdateLayer(UpdateLayerRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new UpdateLayerRequestMarshaller(); var unmarshaller = UpdateLayerResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the UpdateLayer operation. /// <seealso cref="Amazon.OpsWorks.IAmazonOpsWorks.UpdateLayer"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateLayer 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<UpdateLayerResponse> UpdateLayerAsync(UpdateLayerRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateLayerRequestMarshaller(); var unmarshaller = UpdateLayerResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, UpdateLayerRequest, UpdateLayerResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para>Updates a specified layer.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateLayer service method on AmazonOpsWorks.</param> /// /// <exception cref="T:Amazon.OpsWorks.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.OpsWorks.Model.ValidationException" /> public UpdateLayerResponse UpdateLayer(UpdateLayerRequest request) { var task = UpdateLayerAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.OpsWorks.Model.UpdateLayerResponse CallAWSServiceOperation(IAmazonOpsWorks client, Amazon.OpsWorks.Model.UpdateLayerRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS OpsWorks", "UpdateLayer"); try { #if DESKTOP return(client.UpdateLayer(request)); #elif CORECLR return(client.UpdateLayerAsync(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; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.OpsWorks.Model.UpdateLayerRequest(); if (cmdletContext.Attribute != null) { request.Attributes = cmdletContext.Attribute; } if (cmdletContext.AutoAssignElasticIp != null) { request.AutoAssignElasticIps = cmdletContext.AutoAssignElasticIp.Value; } if (cmdletContext.AutoAssignPublicIp != null) { request.AutoAssignPublicIps = cmdletContext.AutoAssignPublicIp.Value; } // populate CloudWatchLogsConfiguration var requestCloudWatchLogsConfigurationIsNull = true; request.CloudWatchLogsConfiguration = new Amazon.OpsWorks.Model.CloudWatchLogsConfiguration(); System.Boolean?requestCloudWatchLogsConfiguration_cloudWatchLogsConfiguration_Enabled = null; if (cmdletContext.CloudWatchLogsConfiguration_Enabled != null) { requestCloudWatchLogsConfiguration_cloudWatchLogsConfiguration_Enabled = cmdletContext.CloudWatchLogsConfiguration_Enabled.Value; } if (requestCloudWatchLogsConfiguration_cloudWatchLogsConfiguration_Enabled != null) { request.CloudWatchLogsConfiguration.Enabled = requestCloudWatchLogsConfiguration_cloudWatchLogsConfiguration_Enabled.Value; requestCloudWatchLogsConfigurationIsNull = false; } List <Amazon.OpsWorks.Model.CloudWatchLogsLogStream> requestCloudWatchLogsConfiguration_cloudWatchLogsConfiguration_LogStream = null; if (cmdletContext.CloudWatchLogsConfiguration_LogStream != null) { requestCloudWatchLogsConfiguration_cloudWatchLogsConfiguration_LogStream = cmdletContext.CloudWatchLogsConfiguration_LogStream; } if (requestCloudWatchLogsConfiguration_cloudWatchLogsConfiguration_LogStream != null) { request.CloudWatchLogsConfiguration.LogStreams = requestCloudWatchLogsConfiguration_cloudWatchLogsConfiguration_LogStream; requestCloudWatchLogsConfigurationIsNull = false; } // determine if request.CloudWatchLogsConfiguration should be set to null if (requestCloudWatchLogsConfigurationIsNull) { request.CloudWatchLogsConfiguration = null; } if (cmdletContext.CustomInstanceProfileArn != null) { request.CustomInstanceProfileArn = cmdletContext.CustomInstanceProfileArn; } if (cmdletContext.CustomJson != null) { request.CustomJson = cmdletContext.CustomJson; } // populate CustomRecipes var requestCustomRecipesIsNull = true; request.CustomRecipes = new Amazon.OpsWorks.Model.Recipes(); List <System.String> requestCustomRecipes_customRecipes_Configure = null; if (cmdletContext.CustomRecipes_Configure != null) { requestCustomRecipes_customRecipes_Configure = cmdletContext.CustomRecipes_Configure; } if (requestCustomRecipes_customRecipes_Configure != null) { request.CustomRecipes.Configure = requestCustomRecipes_customRecipes_Configure; requestCustomRecipesIsNull = false; } List <System.String> requestCustomRecipes_customRecipes_Deploy = null; if (cmdletContext.CustomRecipes_Deploy != null) { requestCustomRecipes_customRecipes_Deploy = cmdletContext.CustomRecipes_Deploy; } if (requestCustomRecipes_customRecipes_Deploy != null) { request.CustomRecipes.Deploy = requestCustomRecipes_customRecipes_Deploy; requestCustomRecipesIsNull = false; } List <System.String> requestCustomRecipes_customRecipes_Setup = null; if (cmdletContext.CustomRecipes_Setup != null) { requestCustomRecipes_customRecipes_Setup = cmdletContext.CustomRecipes_Setup; } if (requestCustomRecipes_customRecipes_Setup != null) { request.CustomRecipes.Setup = requestCustomRecipes_customRecipes_Setup; requestCustomRecipesIsNull = false; } List <System.String> requestCustomRecipes_customRecipes_Shutdown = null; if (cmdletContext.CustomRecipes_Shutdown != null) { requestCustomRecipes_customRecipes_Shutdown = cmdletContext.CustomRecipes_Shutdown; } if (requestCustomRecipes_customRecipes_Shutdown != null) { request.CustomRecipes.Shutdown = requestCustomRecipes_customRecipes_Shutdown; requestCustomRecipesIsNull = false; } List <System.String> requestCustomRecipes_customRecipes_Undeploy = null; if (cmdletContext.CustomRecipes_Undeploy != null) { requestCustomRecipes_customRecipes_Undeploy = cmdletContext.CustomRecipes_Undeploy; } if (requestCustomRecipes_customRecipes_Undeploy != null) { request.CustomRecipes.Undeploy = requestCustomRecipes_customRecipes_Undeploy; requestCustomRecipesIsNull = false; } // determine if request.CustomRecipes should be set to null if (requestCustomRecipesIsNull) { request.CustomRecipes = null; } if (cmdletContext.CustomSecurityGroupId != null) { request.CustomSecurityGroupIds = cmdletContext.CustomSecurityGroupId; } if (cmdletContext.EnableAutoHealing != null) { request.EnableAutoHealing = cmdletContext.EnableAutoHealing.Value; } if (cmdletContext.InstallUpdatesOnBoot != null) { request.InstallUpdatesOnBoot = cmdletContext.InstallUpdatesOnBoot.Value; } if (cmdletContext.LayerId != null) { request.LayerId = cmdletContext.LayerId; } // populate LifecycleEventConfiguration var requestLifecycleEventConfigurationIsNull = true; request.LifecycleEventConfiguration = new Amazon.OpsWorks.Model.LifecycleEventConfiguration(); Amazon.OpsWorks.Model.ShutdownEventConfiguration requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown = null; // populate Shutdown var requestLifecycleEventConfiguration_lifecycleEventConfiguration_ShutdownIsNull = true; requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown = new Amazon.OpsWorks.Model.ShutdownEventConfiguration(); System.Boolean?requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown_shutdown_DelayUntilElbConnectionsDrained = null; if (cmdletContext.Shutdown_DelayUntilElbConnectionsDrained != null) { requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown_shutdown_DelayUntilElbConnectionsDrained = cmdletContext.Shutdown_DelayUntilElbConnectionsDrained.Value; } if (requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown_shutdown_DelayUntilElbConnectionsDrained != null) { requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown.DelayUntilElbConnectionsDrained = requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown_shutdown_DelayUntilElbConnectionsDrained.Value; requestLifecycleEventConfiguration_lifecycleEventConfiguration_ShutdownIsNull = false; } System.Int32?requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown_shutdown_ExecutionTimeout = null; if (cmdletContext.Shutdown_ExecutionTimeout != null) { requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown_shutdown_ExecutionTimeout = cmdletContext.Shutdown_ExecutionTimeout.Value; } if (requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown_shutdown_ExecutionTimeout != null) { requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown.ExecutionTimeout = requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown_shutdown_ExecutionTimeout.Value; requestLifecycleEventConfiguration_lifecycleEventConfiguration_ShutdownIsNull = false; } // determine if requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown should be set to null if (requestLifecycleEventConfiguration_lifecycleEventConfiguration_ShutdownIsNull) { requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown = null; } if (requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown != null) { request.LifecycleEventConfiguration.Shutdown = requestLifecycleEventConfiguration_lifecycleEventConfiguration_Shutdown; requestLifecycleEventConfigurationIsNull = false; } // determine if request.LifecycleEventConfiguration should be set to null if (requestLifecycleEventConfigurationIsNull) { request.LifecycleEventConfiguration = null; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } if (cmdletContext.Package != null) { request.Packages = cmdletContext.Package; } if (cmdletContext.Shortname != null) { request.Shortname = cmdletContext.Shortname; } if (cmdletContext.UseEbsOptimizedInstance != null) { request.UseEbsOptimizedInstances = cmdletContext.UseEbsOptimizedInstance.Value; } if (cmdletContext.VolumeConfiguration != null) { request.VolumeConfigurations = cmdletContext.VolumeConfiguration; } 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); }