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

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

            ListDatastoresResponse resp = new ListDatastoresResponse();

            do
            {
                ListDatastoresRequest req = new ListDatastoresRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

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

                foreach (var obj in resp.DatastoreSummaries)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Beispiel #2
0
        /// <summary>
        /// 查询指定实例类型的数据库版本信息
        /// </summary>
        public async Task <ListDatastoresResponse> ListDatastoresAsync(ListDatastoresRequest listDatastoresRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("datastore_name", listDatastoresRequest.DatastoreName.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/datastores/{datastore_name}/versions", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", listDatastoresRequest);
            HttpResponseMessage response = await DoHttpRequestAsync("GET", request);

            return(JsonUtils.DeSerialize <ListDatastoresResponse>(response));
        }