DescribeSubnets() приватный Метод

private DescribeSubnets ( ) : DescribeSubnetsResponse
Результат DescribeSubnetsResponse
Пример #1
0
        public static void ReadFlowLogs(string accountNumber, RegionEndpoint regionEndPoint, int durationType, IDatabase db)
        {
            Log.InfoFormat("Start reading flowlogs and writing traffic data to redis ({0})", regionEndPoint.SystemName);
            IAmazonEC2 ec2 = new Amazon.EC2.AmazonEC2Client(regionEndPoint);

            try
            {
                ec2.DescribeSubnets();
            }
            catch (Exception ex)
            {
                Log.InfoFormat("Unable to read subnets: {0}", ex.Message);
                return;
            }

            var dataKey = Common.GetDataKey(accountNumber, regionEndPoint);

            db.SetAdd("TST", dataKey);
            db.StringSet(string.Format("LATESTTST-{0}-{1}", accountNumber, regionEndPoint.SystemName), dataKey);

            var subnetResponse = ec2.DescribeSubnets();
            var vgResponse     = ec2.DescribeVpnGateways();
            var igResponse     = ec2.DescribeInternetGateways();

            try
            {
                FlowLogManager.ReadES(db, dataKey, durationType, subnetResponse.Subnets, vgResponse.VpnGateways, igResponse.InternetGateways);
                Log.InfoFormat("End reading flowlogs and writing traffic data to redis ({0})", regionEndPoint.SystemName);
            }
            catch (Exception ex)
            {
                Log.ErrorFormat("Error reading flowlogs and writing traffic data to redis ({0}): {1}", regionEndPoint.SystemName, ex.Message);
            }
        }