Container for the parameters to the CloneStack operation. Creates a clone of a specified stack. For more information, see Clone a Stack. By default, all parameters are set to the values used by the parent stack.

Required Permissions: To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.

Inheritance: AmazonOpsWorksRequest
コード例 #1
0
        internal CloneStackResponse CloneStack(CloneStackRequest request)
        {
            var marshaller = new CloneStackRequestMarshaller();
            var unmarshaller = CloneStackResponseUnmarshaller.Instance;

            return Invoke<CloneStackRequest,CloneStackResponse>(request, marshaller, unmarshaller);
        }
コード例 #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the CloneStack operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CloneStack 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<CloneStackResponse> CloneStackAsync(CloneStackRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CloneStackRequestMarshaller();
            var unmarshaller = CloneStackResponseUnmarshaller.Instance;

            return InvokeAsync<CloneStackRequest,CloneStackResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
コード例 #3
0
		internal CloneStackResponse CloneStack(CloneStackRequest request)
        {
            var task = CloneStackAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
コード例 #4
0
        /// <summary>
        /// <para>Creates a clone of a specified stack. For more information, see <a href="http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-cloning.html">Clone a Stack</a> .</para> <para> <b>Required
        /// Permissions</b> : To use this action, an IAM user must have 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="cloneStackRequest">Container for the necessary parameters to execute the CloneStack service method on AmazonOpsWorks.</param>
        /// 
        /// <returns>The response from the CloneStack service method, as returned by AmazonOpsWorks.</returns>
        /// 
        /// <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<CloneStackResponse> CloneStackAsync(CloneStackRequest cloneStackRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CloneStackRequestMarshaller();
            var unmarshaller = CloneStackResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, CloneStackRequest, CloneStackResponse>(cloneStackRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
コード例 #5
0
 IAsyncResult invokeCloneStack(CloneStackRequest cloneStackRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new CloneStackRequestMarshaller().Marshall(cloneStackRequest);
     var unmarshaller = CloneStackResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
コード例 #6
0
        /// <summary>
        /// Initiates the asynchronous execution of the CloneStack operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CloneStack 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 EndCloneStack
        ///         operation.</returns>
        public IAsyncResult BeginCloneStack(CloneStackRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CloneStackRequestMarshaller();
            var unmarshaller = CloneStackResponseUnmarshaller.Instance;

            return BeginInvoke<CloneStackRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
コード例 #7
0
 /// <summary>
 /// <para>Creates a clone of a specified stack. For more information, see <a
 /// href="http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-cloning.html" >Clone a Stack</a> .</para> <para> <b>Required
 /// Permissions</b> : To use this action, an IAM user must have 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="cloneStackRequest">Container for the necessary parameters to execute the CloneStack service method on AmazonOpsWorks.</param>
 /// 
 /// <returns>The response from the CloneStack service method, as returned by AmazonOpsWorks.</returns>
 /// 
 /// <exception cref="ResourceNotFoundException"/>
 /// <exception cref="ValidationException"/>
 public CloneStackResponse CloneStack(CloneStackRequest cloneStackRequest)
 {
     IAsyncResult asyncResult = invokeCloneStack(cloneStackRequest, null, null, true);
     return EndCloneStack(asyncResult);
 }
コード例 #8
0
 /// <summary>
 /// Initiates the asynchronous execution of the CloneStack operation.
 /// <seealso cref="Amazon.OpsWorks.IAmazonOpsWorks.CloneStack"/>
 /// </summary>
 /// 
 /// <param name="cloneStackRequest">Container for the necessary parameters to execute the CloneStack 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>
 /// 
 /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCloneStack
 ///         operation.</returns>
 public IAsyncResult BeginCloneStack(CloneStackRequest cloneStackRequest, AsyncCallback callback, object state)
 {
     return invokeCloneStack(cloneStackRequest, callback, state, false);
 }
コード例 #9
0
        IAsyncResult invokeCloneStack(CloneStackRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new CloneStackRequestMarshaller();
            var unmarshaller = CloneStackResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }
コード例 #10
0
        /// <summary>
        /// Initiates the asynchronous execution of the CloneStack operation.
        /// <seealso cref="Amazon.OpsWorks.IAmazonOpsWorks.CloneStack"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CloneStack 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<CloneStackResponse> CloneStackAsync(CloneStackRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CloneStackRequestMarshaller();
            var unmarshaller = CloneStackResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, CloneStackRequest, CloneStackResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
コード例 #11
0
        /// <summary>
        /// <para>Creates a clone of a specified stack. For more information, see <a href="http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-cloning.html">Clone a Stack</a> .</para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CloneStack service method on AmazonOpsWorks.</param>
        /// 
        /// <returns>The response from the CloneStack service method, as returned by AmazonOpsWorks.</returns>
        /// 
        /// <exception cref="T:Amazon.OpsWorks.Model.ResourceNotFoundException" />
        /// <exception cref="T:Amazon.OpsWorks.Model.ValidationException" />
		public CloneStackResponse CloneStack(CloneStackRequest request)
        {
            var task = CloneStackAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
コード例 #12
0
 private Amazon.OpsWorks.Model.CloneStackResponse CallAWSServiceOperation(IAmazonOpsWorks client, Amazon.OpsWorks.Model.CloneStackRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS OpsWorks", "CloneStack");
     try
     {
         #if DESKTOP
         return(client.CloneStack(request));
         #elif CORECLR
         return(client.CloneStackAsync(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;
     }
 }
コード例 #13
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.OpsWorks.Model.CloneStackRequest();

            if (cmdletContext.AgentVersion != null)
            {
                request.AgentVersion = cmdletContext.AgentVersion;
            }
            if (cmdletContext.Attribute != null)
            {
                request.Attributes = cmdletContext.Attribute;
            }

            // populate ChefConfiguration
            var requestChefConfigurationIsNull = true;

            request.ChefConfiguration = new Amazon.OpsWorks.Model.ChefConfiguration();
            System.String requestChefConfiguration_chefConfiguration_BerkshelfVersion = null;
            if (cmdletContext.ChefConfiguration_BerkshelfVersion != null)
            {
                requestChefConfiguration_chefConfiguration_BerkshelfVersion = cmdletContext.ChefConfiguration_BerkshelfVersion;
            }
            if (requestChefConfiguration_chefConfiguration_BerkshelfVersion != null)
            {
                request.ChefConfiguration.BerkshelfVersion = requestChefConfiguration_chefConfiguration_BerkshelfVersion;
                requestChefConfigurationIsNull             = false;
            }
            System.Boolean?requestChefConfiguration_chefConfiguration_ManageBerkshelf = null;
            if (cmdletContext.ChefConfiguration_ManageBerkshelf != null)
            {
                requestChefConfiguration_chefConfiguration_ManageBerkshelf = cmdletContext.ChefConfiguration_ManageBerkshelf.Value;
            }
            if (requestChefConfiguration_chefConfiguration_ManageBerkshelf != null)
            {
                request.ChefConfiguration.ManageBerkshelf = requestChefConfiguration_chefConfiguration_ManageBerkshelf.Value;
                requestChefConfigurationIsNull            = false;
            }
            // determine if request.ChefConfiguration should be set to null
            if (requestChefConfigurationIsNull)
            {
                request.ChefConfiguration = null;
            }
            if (cmdletContext.CloneAppId != null)
            {
                request.CloneAppIds = cmdletContext.CloneAppId;
            }
            if (cmdletContext.ClonePermission != null)
            {
                request.ClonePermissions = cmdletContext.ClonePermission.Value;
            }

            // populate ConfigurationManager
            var requestConfigurationManagerIsNull = true;

            request.ConfigurationManager = new Amazon.OpsWorks.Model.StackConfigurationManager();
            System.String requestConfigurationManager_configurationManager_Name = null;
            if (cmdletContext.ConfigurationManager_Name != null)
            {
                requestConfigurationManager_configurationManager_Name = cmdletContext.ConfigurationManager_Name;
            }
            if (requestConfigurationManager_configurationManager_Name != null)
            {
                request.ConfigurationManager.Name = requestConfigurationManager_configurationManager_Name;
                requestConfigurationManagerIsNull = false;
            }
            System.String requestConfigurationManager_configurationManager_Version = null;
            if (cmdletContext.ConfigurationManager_Version != null)
            {
                requestConfigurationManager_configurationManager_Version = cmdletContext.ConfigurationManager_Version;
            }
            if (requestConfigurationManager_configurationManager_Version != null)
            {
                request.ConfigurationManager.Version = requestConfigurationManager_configurationManager_Version;
                requestConfigurationManagerIsNull    = false;
            }
            // determine if request.ConfigurationManager should be set to null
            if (requestConfigurationManagerIsNull)
            {
                request.ConfigurationManager = null;
            }

            // populate CustomCookbooksSource
            var requestCustomCookbooksSourceIsNull = true;

            request.CustomCookbooksSource = new Amazon.OpsWorks.Model.Source();
            System.String requestCustomCookbooksSource_customCookbooksSource_Password = null;
            if (cmdletContext.CustomCookbooksSource_Password != null)
            {
                requestCustomCookbooksSource_customCookbooksSource_Password = cmdletContext.CustomCookbooksSource_Password;
            }
            if (requestCustomCookbooksSource_customCookbooksSource_Password != null)
            {
                request.CustomCookbooksSource.Password = requestCustomCookbooksSource_customCookbooksSource_Password;
                requestCustomCookbooksSourceIsNull     = false;
            }
            System.String requestCustomCookbooksSource_customCookbooksSource_Revision = null;
            if (cmdletContext.CustomCookbooksSource_Revision != null)
            {
                requestCustomCookbooksSource_customCookbooksSource_Revision = cmdletContext.CustomCookbooksSource_Revision;
            }
            if (requestCustomCookbooksSource_customCookbooksSource_Revision != null)
            {
                request.CustomCookbooksSource.Revision = requestCustomCookbooksSource_customCookbooksSource_Revision;
                requestCustomCookbooksSourceIsNull     = false;
            }
            System.String requestCustomCookbooksSource_customCookbooksSource_SshKey = null;
            if (cmdletContext.CustomCookbooksSource_SshKey != null)
            {
                requestCustomCookbooksSource_customCookbooksSource_SshKey = cmdletContext.CustomCookbooksSource_SshKey;
            }
            if (requestCustomCookbooksSource_customCookbooksSource_SshKey != null)
            {
                request.CustomCookbooksSource.SshKey = requestCustomCookbooksSource_customCookbooksSource_SshKey;
                requestCustomCookbooksSourceIsNull   = false;
            }
            Amazon.OpsWorks.SourceType requestCustomCookbooksSource_customCookbooksSource_Type = null;
            if (cmdletContext.CustomCookbooksSource_Type != null)
            {
                requestCustomCookbooksSource_customCookbooksSource_Type = cmdletContext.CustomCookbooksSource_Type;
            }
            if (requestCustomCookbooksSource_customCookbooksSource_Type != null)
            {
                request.CustomCookbooksSource.Type = requestCustomCookbooksSource_customCookbooksSource_Type;
                requestCustomCookbooksSourceIsNull = false;
            }
            System.String requestCustomCookbooksSource_customCookbooksSource_Url = null;
            if (cmdletContext.CustomCookbooksSource_Url != null)
            {
                requestCustomCookbooksSource_customCookbooksSource_Url = cmdletContext.CustomCookbooksSource_Url;
            }
            if (requestCustomCookbooksSource_customCookbooksSource_Url != null)
            {
                request.CustomCookbooksSource.Url  = requestCustomCookbooksSource_customCookbooksSource_Url;
                requestCustomCookbooksSourceIsNull = false;
            }
            System.String requestCustomCookbooksSource_customCookbooksSource_Username = null;
            if (cmdletContext.CustomCookbooksSource_Username != null)
            {
                requestCustomCookbooksSource_customCookbooksSource_Username = cmdletContext.CustomCookbooksSource_Username;
            }
            if (requestCustomCookbooksSource_customCookbooksSource_Username != null)
            {
                request.CustomCookbooksSource.Username = requestCustomCookbooksSource_customCookbooksSource_Username;
                requestCustomCookbooksSourceIsNull     = false;
            }
            // determine if request.CustomCookbooksSource should be set to null
            if (requestCustomCookbooksSourceIsNull)
            {
                request.CustomCookbooksSource = null;
            }
            if (cmdletContext.CustomJson != null)
            {
                request.CustomJson = cmdletContext.CustomJson;
            }
            if (cmdletContext.DefaultAvailabilityZone != null)
            {
                request.DefaultAvailabilityZone = cmdletContext.DefaultAvailabilityZone;
            }
            if (cmdletContext.DefaultInstanceProfileArn != null)
            {
                request.DefaultInstanceProfileArn = cmdletContext.DefaultInstanceProfileArn;
            }
            if (cmdletContext.DefaultOs != null)
            {
                request.DefaultOs = cmdletContext.DefaultOs;
            }
            if (cmdletContext.DefaultRootDeviceType != null)
            {
                request.DefaultRootDeviceType = cmdletContext.DefaultRootDeviceType;
            }
            if (cmdletContext.DefaultSshKeyName != null)
            {
                request.DefaultSshKeyName = cmdletContext.DefaultSshKeyName;
            }
            if (cmdletContext.DefaultSubnetId != null)
            {
                request.DefaultSubnetId = cmdletContext.DefaultSubnetId;
            }
            if (cmdletContext.HostnameTheme != null)
            {
                request.HostnameTheme = cmdletContext.HostnameTheme;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.StackRegion != null)
            {
                request.Region = cmdletContext.StackRegion;
            }
            if (cmdletContext.ServiceRoleArn != null)
            {
                request.ServiceRoleArn = cmdletContext.ServiceRoleArn;
            }
            if (cmdletContext.SourceStackId != null)
            {
                request.SourceStackId = cmdletContext.SourceStackId;
            }
            if (cmdletContext.UseCustomCookbook != null)
            {
                request.UseCustomCookbooks = cmdletContext.UseCustomCookbook.Value;
            }
            if (cmdletContext.UseOpsworksSecurityGroup != null)
            {
                request.UseOpsworksSecurityGroups = cmdletContext.UseOpsworksSecurityGroup.Value;
            }
            if (cmdletContext.VpcId != null)
            {
                request.VpcId = cmdletContext.VpcId;
            }

            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);
        }