예제 #1
0
        // Tags
        // queryTagsByTenantId
        private static void ListScalingTagInfosByTenantId(AsClient asClient)
        {
            var listScalingTagInfosByTenantIdRequest = new ListScalingTagInfosByTenantIdRequest
            {
                ResourceType = ListScalingTagInfosByTenantIdRequest.ResourceTypeEnum.SCALING_GROUP_TAG
            };

            try
            {
                var listScalingTagInfosByTenantIdResponse =
                    asClient.ListScalingTagInfosByTenantId(listScalingTagInfosByTenantIdRequest);
                Console.WriteLine(listScalingTagInfosByTenantIdResponse.Tags);
            }
            catch (RequestTimeoutException requestTimeoutException)
            {
                Console.WriteLine(requestTimeoutException.ErrorMessage);
            }
            catch (ServiceResponseException clientRequestException)
            {
                Console.WriteLine(clientRequestException.HttpStatusCode);
                Console.WriteLine(clientRequestException.ErrorCode);
                Console.WriteLine(clientRequestException.ErrorMsg);
            }
            catch (ConnectionException connectionException)
            {
                Console.WriteLine(connectionException.ErrorMessage);
            }
        }
예제 #2
0
        /// <summary>
        /// 查询标签
        /// </summary>
        public ListScalingTagInfosByTenantIdResponse ListScalingTagInfosByTenantId(ListScalingTagInfosByTenantIdRequest listScalingTagInfosByTenantIdRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("resource_type", listScalingTagInfosByTenantIdRequest.ResourceType.ToString());
            string      urlPath  = HttpUtils.AddUrlPath("/autoscaling-api/v1/{project_id}/{resource_type}/tags", urlParam);
            SdkRequest  request  = HttpUtils.InitSdkRequest(urlPath, listScalingTagInfosByTenantIdRequest);
            SdkResponse response = DoHttpRequest("GET", request);

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