public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonRDSConfig config = new AmazonRDSConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonRDSClient client = new AmazonRDSClient(creds, config);

            DescribeDBSecurityGroupsResponse resp = new DescribeDBSecurityGroupsResponse();

            do
            {
                DescribeDBSecurityGroupsRequest req = new DescribeDBSecurityGroupsRequest
                {
                    Marker = resp.Marker
                    ,
                    MaxRecords = maxItems
                };

                resp = client.DescribeDBSecurityGroups(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.DBSecurityGroups)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.Marker));
        }
        /// <summary>
        /// <para> Returns a list of DBSecurityGroup descriptions. If a DBSecurityGroupName is specified, the list will contain only the descriptions of
        /// the specified DBSecurityGroup. </para> <para>For an overview of CIDR ranges, go to the Wikipedia Tutorial. </para>
        /// </summary>
        ///
        /// <param name="describeDBSecurityGroupsRequest">Container for the necessary parameters to execute the DescribeDBSecurityGroups service method
        ///           on AmazonRDS.</param>
        ///
        /// <returns>The response from the DescribeDBSecurityGroups service method, as returned by AmazonRDS.</returns>
        ///
        /// <exception cref="DBSecurityGroupNotFoundException"/>
        public DescribeDBSecurityGroupsResponse DescribeDBSecurityGroups(DescribeDBSecurityGroupsRequest describeDBSecurityGroupsRequest)
        {
            IRequest <DescribeDBSecurityGroupsRequest> request  = new DescribeDBSecurityGroupsRequestMarshaller().Marshall(describeDBSecurityGroupsRequest);
            DescribeDBSecurityGroupsResponse           response = Invoke <DescribeDBSecurityGroupsRequest, DescribeDBSecurityGroupsResponse> (request, this.signer, DescribeDBSecurityGroupsResponseUnmarshaller.GetInstance());

            return(response);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 查询实例安全组信息
        /// </summary>
        /// <param name="req"><see cref="DescribeDBSecurityGroupsRequest"/></param>
        /// <returns><see cref="DescribeDBSecurityGroupsResponse"/></returns>
        public DescribeDBSecurityGroupsResponse DescribeDBSecurityGroupsSync(DescribeDBSecurityGroupsRequest req)
        {
            JsonResponseModel <DescribeDBSecurityGroupsResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "DescribeDBSecurityGroups");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <DescribeDBSecurityGroupsResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
Exemplo n.º 4
0
        private static IDictionary <string, string> ConvertDescribeDBSecurityGroups(DescribeDBSecurityGroupsRequest request)
        {
            IDictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Action"] = "DescribeDBSecurityGroups";
            if (request.IsSetDBSecurityGroupName())
            {
                dictionary["DBSecurityGroupName"] = request.DBSecurityGroupName;
            }
            if (request.IsSetMaxRecords())
            {
                dictionary["MaxRecords"] = request.MaxRecords.ToString();
            }
            if (request.IsSetMarker())
            {
                dictionary["Marker"] = request.Marker;
            }
            return(dictionary);
        }
Exemplo n.º 5
0
 public DescribeDBSecurityGroupsResponse DescribeDBSecurityGroups(DescribeDBSecurityGroupsRequest request)
 {
     return(this.Invoke <DescribeDBSecurityGroupsResponse>(ConvertDescribeDBSecurityGroups(request)));
 }