/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ListInstancesResponse response = new ListInstancesResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Instances", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <InstanceSummary, InstanceSummaryUnmarshaller>(InstanceSummaryUnmarshaller.Instance);
                    response.Instances = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("NextToken", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.NextToken = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Пример #2
0
        public static ListInstancesResponse Unmarshall(UnmarshallerContext context)
        {
            ListInstancesResponse listInstancesResponse = new ListInstancesResponse();

            listInstancesResponse.HttpResponse = context.HttpResponse;
            listInstancesResponse.RequestId    = context.StringValue("ListInstances.RequestId");

            ListInstancesResponse.ListInstances_Data data = new ListInstancesResponse.ListInstances_Data();
            data.MaxResults = context.IntegerValue("ListInstances.Data.MaxResults");
            data.NextToken  = context.StringValue("ListInstances.Data.NextToken");

            List <ListInstancesResponse.ListInstances_Data.ListInstances_InstanceVO> data_instances = new List <ListInstancesResponse.ListInstances_Data.ListInstances_InstanceVO>();

            for (int i = 0; i < context.Length("ListInstances.Data.Instances.Length"); i++)
            {
                ListInstancesResponse.ListInstances_Data.ListInstances_InstanceVO instanceVO = new ListInstancesResponse.ListInstances_Data.ListInstances_InstanceVO();
                instanceVO.InstanceId        = context.StringValue("ListInstances.Data.Instances[" + i + "].InstanceId");
                instanceVO.InstanceName      = context.StringValue("ListInstances.Data.Instances[" + i + "].InstanceName");
                instanceVO.InstanceType      = context.StringValue("ListInstances.Data.Instances[" + i + "].InstanceType");
                instanceVO.Status            = context.StringValue("ListInstances.Data.Instances[" + i + "].Status");
                instanceVO.OrderType         = context.StringValue("ListInstances.Data.Instances[" + i + "].OrderType");
                instanceVO.OrderCreateTime   = context.LongValue("ListInstances.Data.Instances[" + i + "].OrderCreateTime");
                instanceVO.ExpireTime        = context.LongValue("ListInstances.Data.Instances[" + i + "].ExpireTime");
                instanceVO.AutoRenewInstance = context.BooleanValue("ListInstances.Data.Instances[" + i + "].AutoRenewInstance");
                instanceVO.SupportEIP        = context.BooleanValue("ListInstances.Data.Instances[" + i + "].SupportEIP");
                instanceVO.PrivateEndpoint   = context.StringValue("ListInstances.Data.Instances[" + i + "].PrivateEndpoint");
                instanceVO.PublicEndpoint    = context.StringValue("ListInstances.Data.Instances[" + i + "].PublicEndpoint");

                data_instances.Add(instanceVO);
            }
            data.Instances             = data_instances;
            listInstancesResponse.Data = data;

            return(listInstancesResponse);
        }
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonConnectConfig config = new AmazonConnectConfig();

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

            ListInstancesResponse resp = new ListInstancesResponse();

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

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

                foreach (var obj in resp.InstanceSummaryList)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Пример #4
0
        public static ListInstancesResponse Unmarshall(UnmarshallerContext context)
        {
            ListInstancesResponse listInstancesResponse = new ListInstancesResponse();

            listInstancesResponse.HttpResponse   = context.HttpResponse;
            listInstancesResponse.RequestId      = context.StringValue("ListInstances.RequestId");
            listInstancesResponse.Success        = context.BooleanValue("ListInstances.Success");
            listInstancesResponse.Code           = context.StringValue("ListInstances.Code");
            listInstancesResponse.Message        = context.StringValue("ListInstances.Message");
            listInstancesResponse.HttpStatusCode = context.IntegerValue("ListInstances.HttpStatusCode");

            List <ListInstancesResponse.ListInstances_Instance> listInstancesResponse_instances = new List <ListInstancesResponse.ListInstances_Instance>();

            for (int i = 0; i < context.Length("ListInstances.Instances.Length"); i++)
            {
                ListInstancesResponse.ListInstances_Instance instance = new ListInstancesResponse.ListInstances_Instance();
                instance.InstanceId                = context.StringValue("ListInstances.Instances[" + i + "].InstanceId");
                instance.InstanceName              = context.StringValue("ListInstances.Instances[" + i + "].InstanceName");
                instance.InstanceDescription       = context.StringValue("ListInstances.Instances[" + i + "].InstanceDescription");
                instance.MaxConcurrentConversation = context.IntegerValue("ListInstances.Instances[" + i + "].MaxConcurrentConversation");
                instance.Owner                = context.StringValue("ListInstances.Instances[" + i + "].Owner");
                instance.CreationTime         = context.LongValue("ListInstances.Instances[" + i + "].CreationTime");
                instance.CallCenterInstanceId = context.StringValue("ListInstances.Instances[" + i + "].CallCenterInstanceId");
                instance.IsTemplateContainer  = context.BooleanValue("ListInstances.Instances[" + i + "].IsTemplateContainer");

                listInstancesResponse_instances.Add(instance);
            }
            listInstancesResponse.Instances = listInstancesResponse_instances;

            return(listInstancesResponse);
        }
Пример #5
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonElasticMapReduceConfig config = new AmazonElasticMapReduceConfig();

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

            ListInstancesResponse resp = new ListInstancesResponse();

            do
            {
                ListInstancesRequest req = new ListInstancesRequest
                {
                    Marker = resp.Marker
                };

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

                foreach (var obj in resp.Instances)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.Marker));
        }
        public static ListInstancesResponse Unmarshall(UnmarshallerContext _ctx)
        {
            ListInstancesResponse listInstancesResponse = new ListInstancesResponse();

            listInstancesResponse.HttpResponse = _ctx.HttpResponse;
            listInstancesResponse.RequestId    = _ctx.StringValue("ListInstances.RequestId");
            listInstancesResponse.Success      = _ctx.BooleanValue("ListInstances.Success");
            listInstancesResponse.ErrorMessage = _ctx.StringValue("ListInstances.ErrorMessage");
            listInstancesResponse.ErrorCode    = _ctx.StringValue("ListInstances.ErrorCode");
            listInstancesResponse.TotalCount   = _ctx.LongValue("ListInstances.TotalCount");

            List <ListInstancesResponse.ListInstances_Instance> listInstancesResponse_instanceList = new List <ListInstancesResponse.ListInstances_Instance>();

            for (int i = 0; i < _ctx.Length("ListInstances.InstanceList.Length"); i++)
            {
                ListInstancesResponse.ListInstances_Instance instance = new ListInstancesResponse.ListInstances_Instance();
                instance.InstanceId       = _ctx.StringValue("ListInstances.InstanceList[" + i + "].InstanceId");
                instance.InstanceType     = _ctx.StringValue("ListInstances.InstanceList[" + i + "].InstanceType");
                instance.EnvType          = _ctx.StringValue("ListInstances.InstanceList[" + i + "].EnvType");
                instance.Host             = _ctx.StringValue("ListInstances.InstanceList[" + i + "].Host");
                instance.Port             = _ctx.IntegerValue("ListInstances.InstanceList[" + i + "].Port");
                instance.Sid              = _ctx.StringValue("ListInstances.InstanceList[" + i + "].Sid");
                instance.InstanceAlias    = _ctx.StringValue("ListInstances.InstanceList[" + i + "].InstanceAlias");
                instance.DataLinkName     = _ctx.StringValue("ListInstances.InstanceList[" + i + "].DataLinkName");
                instance.DbaNickName      = _ctx.StringValue("ListInstances.InstanceList[" + i + "].DbaNickName");
                instance.SafeRuleId       = _ctx.StringValue("ListInstances.InstanceList[" + i + "].SafeRuleId");
                instance.QueryTimeout     = _ctx.IntegerValue("ListInstances.InstanceList[" + i + "].QueryTimeout");
                instance.ExportTimeout    = _ctx.IntegerValue("ListInstances.InstanceList[" + i + "].ExportTimeout");
                instance.State            = _ctx.StringValue("ListInstances.InstanceList[" + i + "].State");
                instance.DbaId            = _ctx.StringValue("ListInstances.InstanceList[" + i + "].DbaId");
                instance.DdlOnline        = _ctx.IntegerValue("ListInstances.InstanceList[" + i + "].DdlOnline");
                instance.UseDsql          = _ctx.IntegerValue("ListInstances.InstanceList[" + i + "].UseDsql");
                instance.EcsInstanceId    = _ctx.StringValue("ListInstances.InstanceList[" + i + "].EcsInstanceId");
                instance.VpcId            = _ctx.StringValue("ListInstances.InstanceList[" + i + "].VpcId");
                instance.EcsRegion        = _ctx.StringValue("ListInstances.InstanceList[" + i + "].EcsRegion");
                instance.DatabaseUser     = _ctx.StringValue("ListInstances.InstanceList[" + i + "].DatabaseUser");
                instance.DatabasePassword = _ctx.StringValue("ListInstances.InstanceList[" + i + "].DatabasePassword");
                instance.InstanceSource   = _ctx.StringValue("ListInstances.InstanceList[" + i + "].InstanceSource");

                List <string> instance_ownerIdList = new List <string>();
                for (int j = 0; j < _ctx.Length("ListInstances.InstanceList[" + i + "].OwnerIdList.Length"); j++)
                {
                    instance_ownerIdList.Add(_ctx.StringValue("ListInstances.InstanceList[" + i + "].OwnerIdList[" + j + "]"));
                }
                instance.OwnerIdList = instance_ownerIdList;

                List <string> instance_ownerNameList = new List <string>();
                for (int j = 0; j < _ctx.Length("ListInstances.InstanceList[" + i + "].OwnerNameList.Length"); j++)
                {
                    instance_ownerNameList.Add(_ctx.StringValue("ListInstances.InstanceList[" + i + "].OwnerNameList[" + j + "]"));
                }
                instance.OwnerNameList = instance_ownerNameList;

                listInstancesResponse_instanceList.Add(instance);
            }
            listInstancesResponse.InstanceList = listInstancesResponse_instanceList;

            return(listInstancesResponse);
        }
Пример #7
0
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ListInstancesResponse response = new ListInstancesResponse();

            context.Read();

            UnmarshallResult(context, response);
            return(response);
        }
 /// <summary>Snippet for ListInstances</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void ListInstances()
 {
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     string parent = "projects/[PROJECT]";
     // Make the request
     ListInstancesResponse response = bigtableInstanceAdminClient.ListInstances(parent);
 }
Пример #9
0
 /// <summary>Snippet for ListInstances</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void ListInstancesResourceNames()
 {
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     ProjectName parent = ProjectName.FromProject("[PROJECT]");
     // Make the request
     ListInstancesResponse response = bigtableInstanceAdminClient.ListInstances(parent);
 }
        /// <summary>Snippet for ListInstancesAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task ListInstancesAsync()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync();

            // Initialize request argument(s)
            string parent = "projects/[PROJECT]";
            // Make the request
            ListInstancesResponse response = await bigtableInstanceAdminClient.ListInstancesAsync(parent);
        }
Пример #11
0
        /// <summary>Snippet for ListInstancesAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task ListInstancesResourceNamesAsync()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync();

            // Initialize request argument(s)
            ProjectName parent = ProjectName.FromProject("[PROJECT]");
            // Make the request
            ListInstancesResponse response = await bigtableInstanceAdminClient.ListInstancesAsync(parent);
        }
        public static ListInstancesResponse Unmarshall(UnmarshallerContext _ctx)
        {
            ListInstancesResponse listInstancesResponse = new ListInstancesResponse();

            listInstancesResponse.HttpResponse   = _ctx.HttpResponse;
            listInstancesResponse.Success        = _ctx.BooleanValue("ListInstances.Success");
            listInstancesResponse.HttpStatusCode = _ctx.IntegerValue("ListInstances.HttpStatusCode");
            listInstancesResponse.ErrorCode      = _ctx.StringValue("ListInstances.ErrorCode");
            listInstancesResponse.ErrorMessage   = _ctx.StringValue("ListInstances.ErrorMessage");
            listInstancesResponse.RequestId      = _ctx.StringValue("ListInstances.RequestId");

            ListInstancesResponse.ListInstances_Data data = new ListInstancesResponse.ListInstances_Data();
            data.PageNumber = _ctx.IntegerValue("ListInstances.Data.PageNumber");
            data.PageSize   = _ctx.IntegerValue("ListInstances.Data.PageSize");
            data.TotalCount = _ctx.IntegerValue("ListInstances.Data.TotalCount");

            List <ListInstancesResponse.ListInstances_Data.ListInstances_Instance> data_instances = new List <ListInstancesResponse.ListInstances_Data.ListInstances_Instance>();

            for (int i = 0; i < _ctx.Length("ListInstances.Data.Instances.Length"); i++)
            {
                ListInstancesResponse.ListInstances_Data.ListInstances_Instance instance = new ListInstancesResponse.ListInstances_Data.ListInstances_Instance();
                instance.NodeId            = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].NodeId");
                instance.InstanceId        = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].InstanceId");
                instance.DagId             = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].DagId");
                instance.DagType           = _ctx.StringValue("ListInstances.Data.Instances[" + i + "].DagType");
                instance.Status            = _ctx.StringValue("ListInstances.Data.Instances[" + i + "].Status");
                instance.Bizdate           = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].Bizdate");
                instance.CycTime           = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].CycTime");
                instance.CreateTime        = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].CreateTime");
                instance.ModifyTime        = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].ModifyTime");
                instance.NodeName          = _ctx.StringValue("ListInstances.Data.Instances[" + i + "].NodeName");
                instance.BeginWaitTimeTime = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].BeginWaitTimeTime");
                instance.BeginWaitResTime  = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].BeginWaitResTime");
                instance.BeginRunningTime  = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].BeginRunningTime");
                instance.ParamValues       = _ctx.StringValue("ListInstances.Data.Instances[" + i + "].ParamValues");
                instance.FinishTime        = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].FinishTime");
                instance.Priority          = _ctx.IntegerValue("ListInstances.Data.Instances[" + i + "].Priority");
                instance.BaselineId        = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].BaselineId");
                instance.Repeatability     = _ctx.BooleanValue("ListInstances.Data.Instances[" + i + "].Repeatability");
                instance.RepeatInterval    = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].RepeatInterval");
                instance.Connection        = _ctx.StringValue("ListInstances.Data.Instances[" + i + "].Connection");
                instance.DqcType           = _ctx.IntegerValue("ListInstances.Data.Instances[" + i + "].DqcType");
                instance.DqcDescription    = _ctx.StringValue("ListInstances.Data.Instances[" + i + "].DqcDescription");
                instance.ErrorMessage      = _ctx.StringValue("ListInstances.Data.Instances[" + i + "].ErrorMessage");
                instance.RelatedFlowId     = _ctx.LongValue("ListInstances.Data.Instances[" + i + "].RelatedFlowId");
                instance.TaskType          = _ctx.StringValue("ListInstances.Data.Instances[" + i + "].TaskType");
                instance.TaskRerunTime     = _ctx.IntegerValue("ListInstances.Data.Instances[" + i + "].TaskRerunTime");

                data_instances.Add(instance);
            }
            data.Instances             = data_instances;
            listInstancesResponse.Data = data;

            return(listInstancesResponse);
        }
 /// <summary>Snippet for ListInstances</summary>
 public void ListInstances()
 {
     // Snippet: ListInstances(ProjectName,CallSettings)
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     ProjectName parent = new ProjectName("[PROJECT]");
     // Make the request
     ListInstancesResponse response = bigtableInstanceAdminClient.ListInstances(parent);
     // End snippet
 }
Пример #14
0
        public static ListInstancesResponse Unmarshall(UnmarshallerContext _ctx)
        {
            ListInstancesResponse listInstancesResponse = new ListInstancesResponse();

            listInstancesResponse.HttpResponse   = _ctx.HttpResponse;
            listInstancesResponse.Code           = _ctx.StringValue("ListInstances.Code");
            listInstancesResponse.HttpStatusCode = _ctx.IntegerValue("ListInstances.HttpStatusCode");
            listInstancesResponse.Message        = _ctx.StringValue("ListInstances.Message");
            listInstancesResponse.RequestId      = _ctx.StringValue("ListInstances.RequestId");
            listInstancesResponse.Success        = _ctx.BooleanValue("ListInstances.Success");

            List <ListInstancesResponse.ListInstances_Instance> listInstancesResponse_instances = new List <ListInstancesResponse.ListInstances_Instance>();

            for (int i = 0; i < _ctx.Length("ListInstances.Instances.Length"); i++)
            {
                ListInstancesResponse.ListInstances_Instance instance = new ListInstancesResponse.ListInstances_Instance();
                instance.CallCenterInstanceId      = _ctx.StringValue("ListInstances.Instances[" + i + "].CallCenterInstanceId");
                instance.CreationTime              = _ctx.LongValue("ListInstances.Instances[" + i + "].CreationTime");
                instance.InstanceDescription       = _ctx.StringValue("ListInstances.Instances[" + i + "].InstanceDescription");
                instance.InstanceId                = _ctx.StringValue("ListInstances.Instances[" + i + "].InstanceId");
                instance.InstanceName              = _ctx.StringValue("ListInstances.Instances[" + i + "].InstanceName");
                instance.IsTemplateContainer       = _ctx.BooleanValue("ListInstances.Instances[" + i + "].IsTemplateContainer");
                instance.MaxConcurrentConversation = _ctx.IntegerValue("ListInstances.Instances[" + i + "].MaxConcurrentConversation");
                instance.OwnerName       = _ctx.StringValue("ListInstances.Instances[" + i + "].OwnerName");
                instance.CreatorId       = _ctx.LongValue("ListInstances.Instances[" + i + "].CreatorId");
                instance.CreatorName     = _ctx.StringValue("ListInstances.Instances[" + i + "].CreatorName");
                instance.NluServiceType  = _ctx.StringValue("ListInstances.Instances[" + i + "].NluServiceType");
                instance.Owner           = _ctx.StringValue("ListInstances.Instances[" + i + "].Owner");
                instance.ResourceGroupId = _ctx.StringValue("ListInstances.Instances[" + i + "].ResourceGroupId");

                ListInstancesResponse.ListInstances_Instance.ListInstances_NluProfile nluProfile = new ListInstancesResponse.ListInstances_Instance.ListInstances_NluProfile();
                nluProfile.AccessKey = _ctx.StringValue("ListInstances.Instances[" + i + "].NluProfile.AccessKey");
                nluProfile.Endpoint  = _ctx.StringValue("ListInstances.Instances[" + i + "].NluProfile.Endpoint");
                nluProfile.SecretKey = _ctx.StringValue("ListInstances.Instances[" + i + "].NluProfile.SecretKey");
                instance.NluProfile  = nluProfile;

                List <ListInstancesResponse.ListInstances_Instance.ListInstances_ResourceTag> instance_resourceTags = new List <ListInstancesResponse.ListInstances_Instance.ListInstances_ResourceTag>();
                for (int j = 0; j < _ctx.Length("ListInstances.Instances[" + i + "].ResourceTags.Length"); j++)
                {
                    ListInstancesResponse.ListInstances_Instance.ListInstances_ResourceTag resourceTag = new ListInstancesResponse.ListInstances_Instance.ListInstances_ResourceTag();
                    resourceTag.Key    = _ctx.StringValue("ListInstances.Instances[" + i + "].ResourceTags[" + j + "].Key");
                    resourceTag._Value = _ctx.StringValue("ListInstances.Instances[" + i + "].ResourceTags[" + j + "].Value");

                    instance_resourceTags.Add(resourceTag);
                }
                instance.ResourceTags = instance_resourceTags;

                listInstancesResponse_instances.Add(instance);
            }
            listInstancesResponse.Instances = listInstancesResponse_instances;

            return(listInstancesResponse);
        }
Пример #15
0
        public void JwtAccessToken_RestClient()
        {
            // See: https://developers.google.com/identity/protocols/oauth2/service-account#jwt-auth

            BigtableAdminService service = new BigtableAdminService(new BaseClientService.Initializer
            {
                HttpClientInitializer = Helper.GetServiceCredential().CreateScoped()
            });

            ListInstancesResponse response = service.Projects.Instances.List($"projects/{Helper.GetProjectId()}").Execute();

            Assert.NotNull(response);
        }
 /// <summary>Snippet for ListInstances</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void ListInstancesRequestObject()
 {
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     ListInstancesRequest request = new ListInstancesRequest
     {
         ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
         PageToken           = "",
     };
     // Make the request
     ListInstancesResponse response = bigtableInstanceAdminClient.ListInstances(request);
 }
 /// <summary>Snippet for ListInstances</summary>
 public void ListInstances_RequestObject()
 {
     // Snippet: ListInstances(ListInstancesRequest,CallSettings)
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     ListInstancesRequest request = new ListInstancesRequest
     {
         ParentAsProjectName = new ProjectName("[PROJECT]"),
     };
     // Make the request
     ListInstancesResponse response = bigtableInstanceAdminClient.ListInstances(request);
     // End snippet
 }
        /// <summary>Snippet for ListInstancesAsync</summary>
        public async Task ListInstancesAsync()
        {
            // Snippet: ListInstancesAsync(ProjectName,CallSettings)
            // Additional: ListInstancesAsync(ProjectName,CancellationToken)
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync();

            // Initialize request argument(s)
            ProjectName parent = new ProjectName("[PROJECT]");
            // Make the request
            ListInstancesResponse response = await bigtableInstanceAdminClient.ListInstancesAsync(parent);

            // End snippet
        }
Пример #19
0
        private static void UnmarshallResult(JsonUnmarshallerContext context, ListInstancesResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("Instances", targetDepth))
                {
                    context.Read();

                    if (context.CurrentTokenType == JsonToken.Null)
                    {
                        response.Instances = null;
                        continue;
                    }
                    response.Instances = new List <Instance>();
                    InstanceUnmarshaller unmarshaller = InstanceUnmarshaller.GetInstance();
                    while (context.Read())
                    {
                        JsonToken token = context.CurrentTokenType;
                        if (token == JsonToken.ArrayStart)
                        {
                            continue;
                        }
                        if (token == JsonToken.ArrayEnd)
                        {
                            break;
                        }
                        response.Instances.Add(unmarshaller.Unmarshall(context));
                    }
                    continue;
                }

                if (context.TestExpression("Marker", targetDepth))
                {
                    context.Read();
                    response.Marker = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return;
                }
            }

            return;
        }
        public void JwtAccessToken_RestClient(bool useJwtAccessWithScopes, string[] scopes)
        {
            // See: https://developers.google.com/identity/protocols/oauth2/service-account#jwt-auth

            GoogleCredential credential = useJwtAccessWithScopes
                ? Helper.GetServiceCredentialWithJwtFlag().CreateScoped(scopes)
                : Helper.GetServiceCredential().CreateScoped(scopes);

            BigtableAdminService service = new BigtableAdminService(new BaseClientService.Initializer
            {
                HttpClientInitializer = credential
            });

            ListInstancesResponse response = service.Projects.Instances.List($"projects/{Helper.GetProjectId()}").Execute();

            Assert.NotNull(response);
        }
Пример #21
0
        public static ListInstancesResponse Unmarshall(UnmarshallerContext context)
        {
            ListInstancesResponse listInstancesResponse = new ListInstancesResponse();

            listInstancesResponse.HttpResponse   = context.HttpResponse;
            listInstancesResponse.Success        = context.BooleanValue("ListInstances.Success");
            listInstancesResponse.HttpStatusCode = context.IntegerValue("ListInstances.HttpStatusCode");
            listInstancesResponse.ErrorCode      = context.StringValue("ListInstances.ErrorCode");
            listInstancesResponse.ErrorMessage   = context.StringValue("ListInstances.ErrorMessage");
            listInstancesResponse.RequestId      = context.StringValue("ListInstances.RequestId");

            ListInstancesResponse.ListInstances_Data data = new ListInstancesResponse.ListInstances_Data();
            data.PageNumber = context.IntegerValue("ListInstances.Data.PageNumber");
            data.PageSize   = context.IntegerValue("ListInstances.Data.PageSize");
            data.TotalCount = context.IntegerValue("ListInstances.Data.TotalCount");

            List <ListInstancesResponse.ListInstances_Data.ListInstances_InstancesItem> data_instances = new List <ListInstancesResponse.ListInstances_Data.ListInstances_InstancesItem>();

            for (int i = 0; i < context.Length("ListInstances.Data.Instances.Length"); i++)
            {
                ListInstancesResponse.ListInstances_Data.ListInstances_InstancesItem instancesItem = new ListInstancesResponse.ListInstances_Data.ListInstances_InstancesItem();
                instancesItem.NodeId            = context.IntegerValue("ListInstances.Data.Instances[" + i + "].NodeId");
                instancesItem.InstanceId        = context.LongValue("ListInstances.Data.Instances[" + i + "].InstanceId");
                instancesItem.DagId             = context.IntegerValue("ListInstances.Data.Instances[" + i + "].DagId");
                instancesItem.DagType           = context.StringValue("ListInstances.Data.Instances[" + i + "].DagType");
                instancesItem.Status            = context.StringValue("ListInstances.Data.Instances[" + i + "].Status");
                instancesItem.Bizdate           = context.LongValue("ListInstances.Data.Instances[" + i + "].Bizdate");
                instancesItem.CycTime           = context.LongValue("ListInstances.Data.Instances[" + i + "].CycTime");
                instancesItem.CreateTime        = context.LongValue("ListInstances.Data.Instances[" + i + "].CreateTime");
                instancesItem.ModifyTime        = context.LongValue("ListInstances.Data.Instances[" + i + "].ModifyTime");
                instancesItem.NodeName          = context.StringValue("ListInstances.Data.Instances[" + i + "].NodeName");
                instancesItem.BeginWaitTimeTime = context.LongValue("ListInstances.Data.Instances[" + i + "].BeginWaitTimeTime");
                instancesItem.BeginWaitResTime  = context.LongValue("ListInstances.Data.Instances[" + i + "].BeginWaitResTime");
                instancesItem.BeginRunningTime  = context.LongValue("ListInstances.Data.Instances[" + i + "].BeginRunningTime");
                instancesItem.ParamValues       = context.StringValue("ListInstances.Data.Instances[" + i + "].ParamValues");
                instancesItem.FinishTime        = context.LongValue("ListInstances.Data.Instances[" + i + "].FinishTime");

                data_instances.Add(instancesItem);
            }
            data.Instances             = data_instances;
            listInstancesResponse.Data = data;

            return(listInstancesResponse);
        }
Пример #22
0
        /// <summary>
        /// 查询实例列表
        /// </summary>
        public static void ListInstance(DdsClient client)
        {
            ListInstancesRequest req = new ListInstancesRequest
            {
                Id = "04ada470884e4c2190face9a624c1608in10"
            };

            try
            {
                ListInstancesResponse resp = client.ListInstances(req);
                Console.WriteLine(resp.TotalCount);
                foreach (var instance in resp.Instances)
                {
                    Console.WriteLine(instance.Id);
                    Console.WriteLine(instance.Datastore.Version);
                    foreach (var group in instance.Groups)
                    {
                        Console.WriteLine(group.Id);
                        foreach (var node in group.Nodes)
                        {
                            Console.WriteLine(node.Id);
                        }
                    }
                }
                Console.WriteLine("List Instance Success!");
            }
            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);
            }
        }
Пример #23
0
        public static object ListInstances()
        {
            // [START bigtable_create_bigtableInstanceAdminClient]
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();

            // [END bigtable_create_bigtableInstanceAdminClient]

            Console.WriteLine($"Listing Instances in the project {projectId}");
            // [START bigtable_list_instances]
            // Lists instances in the project.
            // Initialize request argument(s).
            ListInstancesRequest listInstancesRequest = new ListInstancesRequest
            {
                ParentAsProjectName = new ProjectName(projectId)
            };

            try
            {
                // Make a request.
                Console.WriteLine("Waiting for operation to complete...");
                ListInstancesResponse instances = bigtableInstanceAdminClient.ListInstances(listInstancesRequest);
                // [END bigtable_list_instances]
                Console.WriteLine(new string('-', 50));
                Console.WriteLine($"{"Instance Count:",-30}{instances.Instances.Count} instances in project {projectId}");
                foreach (Instance inst in instances.Instances)
                {
                    PrintInstanceInfo(inst);
                }
                // [START bigtable_list_instances]
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Exception while requesting information about instances in {projectId} project");
                Console.WriteLine(ex.Message);
                return(-1);
            }
            Console.WriteLine(new string('-', 50));
            // [END bigtable_list_instances]
            return(0);
        }
Пример #24
0
        public static ListInstancesResponse Unmarshall(UnmarshallerContext _ctx)
        {
            ListInstancesResponse listInstancesResponse = new ListInstancesResponse();

            listInstancesResponse.HttpResponse = _ctx.HttpResponse;
            listInstancesResponse.RequestId    = _ctx.StringValue("ListInstances.RequestId");
            listInstancesResponse.TotalCount   = _ctx.IntegerValue("ListInstances.TotalCount");
            listInstancesResponse.PageNumber   = _ctx.IntegerValue("ListInstances.PageNumber");
            listInstancesResponse.PageSize     = _ctx.IntegerValue("ListInstances.PageSize");

            List <ListInstancesResponse.ListInstances_Instance> listInstancesResponse_instances = new List <ListInstancesResponse.ListInstances_Instance>();

            for (int i = 0; i < _ctx.Length("ListInstances.Instances.Length"); i++)
            {
                ListInstancesResponse.ListInstances_Instance instance = new ListInstancesResponse.ListInstances_Instance();
                instance.InstanceId     = _ctx.StringValue("ListInstances.Instances[" + i + "].InstanceId");
                instance.Name           = _ctx.StringValue("ListInstances.Instances[" + i + "].Name");
                instance.Description    = _ctx.StringValue("ListInstances.Instances[" + i + "].Description");
                instance.Status         = _ctx.StringValue("ListInstances.Instances[" + i + "].Status");
                instance.Concurrency    = _ctx.LongValue("ListInstances.Instances[" + i + "].Concurrency");
                instance.ModifyTime     = _ctx.LongValue("ListInstances.Instances[" + i + "].ModifyTime");
                instance.ModifyUserName = _ctx.StringValue("ListInstances.Instances[" + i + "].ModifyUserName");
                instance.NluServiceType = _ctx.StringValue("ListInstances.Instances[" + i + "].NluServiceType");

                List <string> instance_applicableOperations = new List <string>();
                for (int j = 0; j < _ctx.Length("ListInstances.Instances[" + i + "].ApplicableOperations.Length"); j++)
                {
                    instance_applicableOperations.Add(_ctx.StringValue("ListInstances.Instances[" + i + "].ApplicableOperations[" + j + "]"));
                }
                instance.ApplicableOperations = instance_applicableOperations;

                listInstancesResponse_instances.Add(instance);
            }
            listInstancesResponse.Instances = listInstancesResponse_instances;

            return(listInstancesResponse);
        }