コード例 #1
0
        public void securityGroupCreateDelete()
        {
            netClient.Core.APIClient.Instance.InitWebClient();
            netClient.Core.APIClient.Instance.Authenticate(this.authUserName, this.authPassword, this.accountID);
            string sgID = string.Empty;

            try
            {
                sgID = SecurityGroup.create(this.awsUSEastCloudID, Guid.NewGuid().ToString().Substring(0, 10));
                Assert.IsNotNull(sgID);
                Assert.IsTrue(sgID.Length > 0);

                bool isDeleted = SecurityGroup.destroy(this.awsUSEastCloudID, sgID);
                Assert.IsTrue(isDeleted);
                sgID = string.Empty;
            }
            finally
            {
                if (!string.IsNullOrWhiteSpace(sgID))
                {
                    SecurityGroup.destroy(this.cloudID, sgID);
                }
            }
            netClient.Core.APIClient.Instance.InitWebClient();
        }