コード例 #1
0
ファイル: AWSSubnet.cs プロジェクト: Trov/Document.AWS
        public AWSSubnet(Amazon.EC2.Model.Subnet subnet)
        {
            Name = "Unnamed";
            if (subnet != null)
            {
                foreach (var tag in subnet.Tags.Where(tag => tag.Key == "Name"))
                {
                    Name = tag.Value;
                }

                SubnetId  = subnet.SubnetId;
                CidrBlock = subnet.CidrBlock;
            }
        }
コード例 #2
0
        private void SaveSubnetToDB(Amazon.RegionEndpoint regionEndpoint, Amazon.EC2.Model.Subnet subnet)
        {
            try
            {
                var client   = new AmazonDynamoDBClient(regionEndpoint);
                var table    = Table.LoadTable(client, "Subnet");
                var jsonData = JsonConvert.SerializeObject(subnet);

                table.PutItem(Document.FromJson(jsonData));
            }
            catch (Amazon.DynamoDBv2.Model.ResourceNotFoundException e)
            {
                Console.WriteLine("No Subnets found in {0}", regionEndpoint);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
コード例 #3
0
 public CreateSubnetResult WithSubnet(Amazon.EC2.Model.Subnet subnet)
 {
     this.subnetField = subnet;
     return(this);
 }
コード例 #4
0
ファイル: CreateSubnetResult.cs プロジェクト: pusp/o2platform
 public CreateSubnetResult WithSubnet(Amazon.EC2.Model.Subnet subnet)
 {
     this.subnetField = subnet;
     return this;
 }