Amazon.CloudFormation.Util.AmazonCloudFormationUtil.SignalWaitCondition C# (CSharp) Метод

SignalWaitCondition() публичный статический Метод

This method will signal to the CloudFormation the status of a wait condition.
public static SignalWaitCondition ( string presignedURL, string status, string reason, string uniqueId, string data ) : void
presignedURL string The URL returned from the creation of a WaitHandle in a CloudFormation Stack
status string SUCCESS or FAILURE for the status of a stack
reason string The reason for the status
uniqueId string A unique identifier for the signal. Using Guid.NewGuid().ToString()can be used for this.
data string Data to be passed back for later use in the template.
Результат void
        public static void SignalWaitCondition(string presignedURL, string status, string reason, string uniqueId, string data)
        {
            string requestBody = string.Format(CultureInfo.InvariantCulture, 
                "{{" +
                  "\"Status\" : \"{0}\"," +
                  "\"Reason\" : \"{1}\"," +
                  "\"UniqueId\" : \"{2}\"," +
                  "\"Data\" : \"{3}\"" +
                "}}", status, reason, uniqueId, data);

            Uri uri = new Uri(presignedURL);
            AWSSDKUtils.ForceCanonicalPathAndQuery(uri);
            HttpWebRequest httpRequest = WebRequest.Create(uri) as HttpWebRequest;
            httpRequest.Method = "PUT";
            httpRequest.ContentType = "";
            httpRequest.ContentLength = requestBody.Length;

            using (var stream = new StreamWriter(httpRequest.GetRequestStream()))
            {
                stream.Write(requestBody);
            }

            var response = httpRequest.GetResponse();
            response.Close();
        }
    }
AmazonCloudFormationUtil