ListApplications() public method

Lists the applications registered with the applicable IAM user or AWS account.
/// The next token was specified in an invalid format. ///
public ListApplications ( ) : ListApplicationsResponse
return Amazon.CodeDeploy.Model.ListApplicationsResponse
示例#1
0
        public static void DeleteStack(RegionEndpoint awsEndpoint, string stackName)
        {
            var codeDeployClient = new AmazonCodeDeployClient(awsEndpoint);
            var apps = codeDeployClient.ListApplications().Applications.Where(name => name.StartsWith("HelloWorld"));
            foreach (var app in apps) {
                codeDeployClient.DeleteApplication(new DeleteApplicationRequest {ApplicationName = app});
            }

            var cloudFormationClient = new AmazonCloudFormationClient(awsEndpoint);
            try
            {
                cloudFormationClient.DeleteStack(new DeleteStackRequest { StackName = stackName });
                var testStackStatus = StackStatus.DELETE_IN_PROGRESS;
                while (testStackStatus == StackStatus.DELETE_IN_PROGRESS)
                {
                    Thread.Sleep(TimeSpan.FromSeconds(10));
                    var stacksStatus =
                        cloudFormationClient.DescribeStacks(new DescribeStacksRequest { StackName = stackName });
                    testStackStatus = stacksStatus.Stacks.First(s => s.StackName == stackName).StackStatus;
                }
            }
            catch (AmazonCloudFormationException)
            {
            }
        }