Container for the parameters to the GetTemplate operation.

Returns the template body for a specified stack name. You can get the template for running or deleted stacks.

For deleted stacks, GetTemplate returns the template for up to 90 days after the stack has been deleted.

NOTE: If the template does not exist, a ValidationError is returned.

Inheritance: Amazon.Runtime.AmazonWebServiceRequest
コード例 #1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CloudFormation.Model.GetTemplateRequest();

            if (cmdletContext.ChangeSetName != null)
            {
                request.ChangeSetName = cmdletContext.ChangeSetName;
            }
            if (cmdletContext.StackName != null)
            {
                request.StackName = cmdletContext.StackName;
            }
            if (cmdletContext.TemplateStage != null)
            {
                request.TemplateStage = cmdletContext.TemplateStage;
            }

            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);
        }
コード例 #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetTemplate operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetTemplate 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<GetTemplateResponse> GetTemplateAsync(GetTemplateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetTemplateRequestMarshaller();
            var unmarshaller = GetTemplateResponseUnmarshaller.Instance;

            return InvokeAsync<GetTemplateRequest,GetTemplateResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
コード例 #3
0
        internal GetTemplateResponse GetTemplate(GetTemplateRequest request)
        {
            var marshaller = new GetTemplateRequestMarshaller();
            var unmarshaller = GetTemplateResponseUnmarshaller.Instance;

            return Invoke<GetTemplateRequest,GetTemplateResponse>(request, marshaller, unmarshaller);
        }
コード例 #4
0
 IAsyncResult invokeGetTemplate(GetTemplateRequest getTemplateRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new GetTemplateRequestMarshaller().Marshall(getTemplateRequest);
     var unmarshaller = GetTemplateResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
コード例 #5
0
 /// <summary>
 /// Initiates the asynchronous execution of the GetTemplate operation.
 /// <seealso cref="Amazon.CloudFormation.IAmazonCloudFormation.GetTemplate"/>
 /// </summary>
 /// 
 /// <param name="getTemplateRequest">Container for the necessary parameters to execute the GetTemplate operation on
 ///          AmazonCloudFormation.</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 EndGetTemplate
 ///         operation.</returns>
 public IAsyncResult BeginGetTemplate(GetTemplateRequest getTemplateRequest, AsyncCallback callback, object state)
 {
     return invokeGetTemplate(getTemplateRequest, callback, state, false);
 }
コード例 #6
0
 /// <summary>
 /// <para>Returns the template body for a specified stack. You can get the template for running or deleted stacks.</para> <para>For deleted
 /// stacks, GetTemplate returns the template for up to 90 days after the stack has been deleted.</para> <para><b>NOTE:</b> If the template does
 /// not exist, a ValidationError is returned. </para>
 /// </summary>
 /// 
 /// <param name="getTemplateRequest">Container for the necessary parameters to execute the GetTemplate service method on
 ///          AmazonCloudFormation.</param>
 /// 
 /// <returns>The response from the GetTemplate service method, as returned by AmazonCloudFormation.</returns>
 /// 
 public GetTemplateResponse GetTemplate(GetTemplateRequest getTemplateRequest)
 {
     IAsyncResult asyncResult = invokeGetTemplate(getTemplateRequest, null, null, true);
     return EndGetTemplate(asyncResult);
 }
コード例 #7
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetTemplate operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetTemplate operation on AmazonCloudFormationClient.</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 EndGetTemplate
        ///         operation.</returns>
        public IAsyncResult BeginGetTemplate(GetTemplateRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new GetTemplateRequestMarshaller();
            var unmarshaller = GetTemplateResponseUnmarshaller.Instance;

            return BeginInvoke<GetTemplateRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
コード例 #8
0
        /// <summary>
        /// <para>Returns the template body for a specified stack. You can get the template for running or deleted stacks.</para> <para>For deleted
        /// stacks, GetTemplate returns the template for up to 90 days after the stack has been deleted.</para> <para><b>NOTE:</b> If the template does
        /// not exist, a ValidationError is returned. </para>
        /// </summary>
        /// 
        /// <param name="getTemplateRequest">Container for the necessary parameters to execute the GetTemplate service method on
        /// AmazonCloudFormation.</param>
        /// 
        /// <returns>The response from the GetTemplate service method, as returned by AmazonCloudFormation.</returns>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<GetTemplateResponse> GetTemplateAsync(GetTemplateRequest getTemplateRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetTemplateRequestMarshaller();
            var unmarshaller = GetTemplateResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, GetTemplateRequest, GetTemplateResponse>(getTemplateRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
コード例 #9
0
		internal GetTemplateResponse GetTemplate(GetTemplateRequest request)
        {
            var task = GetTemplateAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
コード例 #10
0
		internal GetTemplateResponse GetTemplate(GetTemplateRequest request)
        {
            var task = GetTemplateAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
コード例 #11
0
  /// <summary>
  /// <para>Returns the template body for a specified stack name. You can get the template for running or deleted stacks.</para> <para>For deleted
  /// stacks, GetTemplate returns the template for up to 90 days after the stack has been deleted. </para> <para><b>NOTE:</b> If the template does
  /// not exist, a ValidationError is returned. </para>
  /// </summary>
  /// 
  /// <param name="getTemplateRequest">Container for the necessary parameters to execute the GetTemplate service method on
  ///           AmazonCloudFormation.</param>
  /// 
  /// <returns>The response from the GetTemplate service method, as returned by AmazonCloudFormation.</returns>
  /// 
 public GetTemplateResponse GetTemplate(GetTemplateRequest getTemplateRequest) 
 {           
     IRequest<GetTemplateRequest> request = new GetTemplateRequestMarshaller().Marshall(getTemplateRequest);
     GetTemplateResponse response = Invoke<GetTemplateRequest, GetTemplateResponse> (request, this.signer, GetTemplateResponseUnmarshaller.GetInstance());
     return response;
 }
コード例 #12
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetTemplate operation.
        /// <seealso cref="Amazon.CloudFormation.IAmazonCloudFormation.GetTemplate"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetTemplate 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<GetTemplateResponse> GetTemplateAsync(GetTemplateRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetTemplateRequestMarshaller();
            var unmarshaller = GetTemplateResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, GetTemplateRequest, GetTemplateResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
コード例 #13
0
 private Amazon.CloudFormation.Model.GetTemplateResponse CallAWSServiceOperation(IAmazonCloudFormation client, Amazon.CloudFormation.Model.GetTemplateRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS CloudFormation", "GetTemplate");
     try
     {
         #if DESKTOP
         return(client.GetTemplate(request));
         #elif CORECLR
         return(client.GetTemplateAsync(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;
     }
 }