/// <summary>Snippet for CreateClusterAsync</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 CreateClusterResourceNamesAsync()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync();

            // Initialize request argument(s)
            InstanceName parent    = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
            string       clusterId = "";
            Cluster      cluster   = new Cluster();
            // Make the request
            Operation <Cluster, CreateClusterMetadata> response = await bigtableInstanceAdminClient.CreateClusterAsync(parent, clusterId, cluster);

            // Poll until the returned long-running operation is complete
            Operation <Cluster, CreateClusterMetadata> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Cluster result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Cluster, CreateClusterMetadata> retrievedResponse = await bigtableInstanceAdminClient.PollOnceCreateClusterAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Cluster retrievedResult = retrievedResponse.Result;
            }
        }
        /// <summary>Snippet for UpdateAppProfile</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void UpdateAppProfile()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
            // Initialize request argument(s)
            AppProfile appProfile = new AppProfile();
            FieldMask  updateMask = new FieldMask();
            // Make the request
            Operation <AppProfile, UpdateAppProfileMetadata> response = bigtableInstanceAdminClient.UpdateAppProfile(appProfile, updateMask);

            // Poll until the returned long-running operation is complete
            Operation <AppProfile, UpdateAppProfileMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            AppProfile result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <AppProfile, UpdateAppProfileMetadata> retrievedResponse = bigtableInstanceAdminClient.PollOnceUpdateAppProfile(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                AppProfile retrievedResult = retrievedResponse.Result;
            }
        }
        public static object GetInstance(string instanceId)
        {
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();

            Console.WriteLine("Getting information about an instance");
            // [START bigtable_get_instance]
            // Initialize request argument(s).
            GetInstanceRequest request = new GetInstanceRequest
            {
                InstanceName = new InstanceName(projectId, instanceId)
            };

            try
            {
                // Make Request.
                Console.WriteLine("Waiting for operation to complete...");
                Instance respond = bigtableInstanceAdminClient.GetInstance(request);
                // [END bigtable_get_instance]
                PrintInstanceInfo(respond);
                // [START bigtable_get_instance]
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Exception retreiving {instanceId} instance");
                Console.WriteLine(ex.Message);
            }
            // [END bigtable_get_instance]
            return(0);
        }
        /// <summary>Snippet for UpdateCluster</summary>
        public void UpdateCluster()
        {
            // Snippet: UpdateCluster(ClusterName,LocationName,int,StorageType,CallSettings)
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
            // Initialize request argument(s)
            ClusterName  name               = new ClusterName("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
            LocationName location           = new LocationName("[PROJECT]", "[LOCATION]");
            int          serveNodes         = 0;
            StorageType  defaultStorageType = StorageType.Unspecified;
            // Make the request
            Operation <Cluster, UpdateClusterMetadata> response =
                bigtableInstanceAdminClient.UpdateCluster(name, location, serveNodes, defaultStorageType);

            // Poll until the returned long-running operation is complete
            Operation <Cluster, UpdateClusterMetadata> completedResponse =
                response.PollUntilCompleted();
            // Retrieve the operation result
            Cluster result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Cluster, UpdateClusterMetadata> retrievedResponse =
                bigtableInstanceAdminClient.PollOnceUpdateCluster(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Cluster retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        /// <summary>Snippet for UpdateCluster</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void UpdateClusterRequestObject()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
            // Initialize request argument(s)
            Cluster request = new Cluster
            {
                ClusterName            = ClusterName.FromProjectInstanceCluster("[PROJECT]", "[INSTANCE]", "[CLUSTER]"),
                LocationAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
                State              = Cluster.Types.State.NotKnown,
                ServeNodes         = 0,
                DefaultStorageType = StorageType.Unspecified,
                EncryptionConfig   = new Cluster.Types.EncryptionConfig(),
            };
            // Make the request
            Operation <Cluster, UpdateClusterMetadata> response = bigtableInstanceAdminClient.UpdateCluster(request);

            // Poll until the returned long-running operation is complete
            Operation <Cluster, UpdateClusterMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Cluster result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Cluster, UpdateClusterMetadata> retrievedResponse = bigtableInstanceAdminClient.PollOnceUpdateCluster(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Cluster retrievedResult = retrievedResponse.Result;
            }
        }
Example #6
0
        private async Task InitBigtableInstanceAndTable()
        {
            if (EmulatorChannel == null)
            {
                InstanceAdminClient = BigtableInstanceAdminClient.Create();
                TableAdminClient    = BigtableTableAdminClient.Create();
                TableClient         = BigtableClient.Create();

                try
                {
                    await InstanceAdminClient.GetInstanceAsync(InstanceName);
                }
                catch (RpcException e) when(e.Status.StatusCode == StatusCode.NotFound)
                {
                    Assert.True(false, $"The Bigtable instance for testing does not exist: {InstanceName}");
                }
            }
            else
            {
                TableAdminClient = BigtableTableAdminClient.Create(EmulatorChannel);
                TableClient      = BigtableClient.Create(BigtableClient.ClientCreationSettings.FromEndpointTarget(EmulatorChannel.Target));
            }

            TableName = await CreateTable();
        }
        /// <summary>Snippet for CreateInstance</summary>
        public void CreateInstance()
        {
            // Snippet: CreateInstance(ProjectName,string,Instance,IDictionary<string, Cluster>,CallSettings)
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
            // Initialize request argument(s)
            ProjectName parent     = new ProjectName("[PROJECT]");
            string      instanceId = "";
            Instance    instance   = new Instance();
            IDictionary <string, Cluster> clusters = new Dictionary <string, Cluster>();
            // Make the request
            Operation <Instance, CreateInstanceMetadata> response =
                bigtableInstanceAdminClient.CreateInstance(parent, instanceId, instance, clusters);

            // Poll until the returned long-running operation is complete
            Operation <Instance, CreateInstanceMetadata> completedResponse =
                response.PollUntilCompleted();
            // Retrieve the operation result
            Instance result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Instance, CreateInstanceMetadata> retrievedResponse =
                bigtableInstanceAdminClient.PollOnceCreateInstance(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Instance retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        public static object ListClusters(string instanceId)
        {
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();

            Console.WriteLine($"Listing clusters on instance {instanceId}");
            // [START bigtable_list_clusters]
            // Lists clusters in the instance.
            // Initialize request argument(s)
            ListClustersRequest listClustersRequest = new ListClustersRequest
            {
                ParentAsInstanceName = new InstanceName(projectId, instanceId)
            };

            try
            {
                // Make a request.
                Console.WriteLine("Waiting for operation to complete...");
                ListClustersResponse response = bigtableInstanceAdminClient.ListClusters(listClustersRequest);
                // [END bigtable_list_clusters]
                Console.WriteLine($"{"Cluster count:",-30}{response.Clusters.Count} clusters on instance {instanceId}\n");
                foreach (Cluster clstr in response.Clusters)
                {
                    PrintClusterInfo(clstr);
                }
                // [START bigtable_list_clusters]
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Exception while requesting information about clusters in {instanceId} instance");
                Console.WriteLine(ex.Message);
            }
            // [END bigtable_list_clusters]

            return(0);
        }
        /// <summary>Snippet for CreateCluster</summary>
        public void CreateCluster()
        {
            // Snippet: CreateCluster(InstanceName,string,Cluster,CallSettings)
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
            // Initialize request argument(s)
            InstanceName parent    = new InstanceName("[PROJECT]", "[INSTANCE]");
            string       clusterId = "";
            Cluster      cluster   = new Cluster();
            // Make the request
            Operation <Cluster, CreateClusterMetadata> response =
                bigtableInstanceAdminClient.CreateCluster(parent, clusterId, cluster);

            // Poll until the returned long-running operation is complete
            Operation <Cluster, CreateClusterMetadata> completedResponse =
                response.PollUntilCompleted();
            // Retrieve the operation result
            Cluster result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Cluster, CreateClusterMetadata> retrievedResponse =
                bigtableInstanceAdminClient.PollOnceCreateCluster(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Cluster retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        /// <summary>Snippet for CreateInstanceAsync</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 CreateInstanceAsync()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync();

            // Initialize request argument(s)
            string   parent     = "projects/[PROJECT]";
            string   instanceId = "";
            Instance instance   = new Instance();
            IDictionary <string, Cluster> clusters = new Dictionary <string, Cluster> {
                { "", new Cluster() },
            };
            // Make the request
            Operation <Instance, CreateInstanceMetadata> response = await bigtableInstanceAdminClient.CreateInstanceAsync(parent, instanceId, instance, clusters);

            // Poll until the returned long-running operation is complete
            Operation <Instance, CreateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Instance result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Instance, CreateInstanceMetadata> retrievedResponse = await bigtableInstanceAdminClient.PollOnceCreateInstanceAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Instance retrievedResult = retrievedResponse.Result;
            }
        }
Example #11
0
        private async Task InitBigtableInstanceAndTable()
        {
            if (EmulatorCallInvoker == null)
            {
                InstanceAdminClient = BigtableInstanceAdminClient.Create();
                TableAdminClient    = BigtableTableAdminClient.Create();
                TableClient         = BigtableClient.Create();

                try
                {
                    await InstanceAdminClient.GetInstanceAsync(InstanceName);
                }
                catch (RpcException e) when(e.Status.StatusCode == StatusCode.NotFound)
                {
                    Assert.True(false, $"The Bigtable instance for testing does not exist: {InstanceName}");
                }
            }
            else
            {
                TableAdminClient = new BigtableTableAdminClientBuilder {
                    CallInvoker = EmulatorCallInvoker
                }.Build();
                TableClient = new BigtableClientBuilder {
                    CallInvoker = EmulatorCallInvoker
                }.Build();
            }

            TableName = await CreateTable();
        }
        public static object DeleteInstance(string instanceId)
        {
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();

            Console.WriteLine("Print list of instances in the project");
            ListInstances();

            Console.WriteLine("Deleting Instance");
            // [START bigtable_delete_instance]
            // Deletes an instance from the project.
            // Initialize request argument(s).
            DeleteInstanceRequest request = new DeleteInstanceRequest
            {
                InstanceName = new InstanceName(projectId, instanceId)
            };

            try
            {
                // Make request.
                Console.WriteLine("Waiting for operation to complete...");
                bigtableInstanceAdminClient.DeleteInstance(request);
                // [END bigtable_delete_instance]
                Console.WriteLine($"Instance {instanceId} deleted successfuly");
                Console.WriteLine("Print list of instances in the project after instance is deleted");
                ListInstances();
                // [START bigtable_delete_instance]
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Exception while deleting {instanceId} instance");
                Console.WriteLine(ex.Message);
            }
            // [END bigtable_delete_instance]
            return(0);
        }
Example #13
0
        /// <summary>Snippet for CreateInstanceAsync</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 CreateInstanceRequestObjectAsync()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync();

            // Initialize request argument(s)
            CreateInstanceRequest request = new CreateInstanceRequest
            {
                ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
                InstanceId          = "",
                Instance            = new Instance(),
                Clusters            = { { "", new Cluster() }, },
            };
            // Make the request
            Operation <Instance, CreateInstanceMetadata> response = await bigtableInstanceAdminClient.CreateInstanceAsync(request);

            // Poll until the returned long-running operation is complete
            Operation <Instance, CreateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Instance result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Instance, CreateInstanceMetadata> retrievedResponse = await bigtableInstanceAdminClient.PollOnceCreateInstanceAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Instance retrievedResult = retrievedResponse.Result;
            }
        }
        /// <summary>Snippet for PartialUpdateInstanceAsync</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 PartialUpdateInstanceRequestObjectAsync()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync();

            // Initialize request argument(s)
            PartialUpdateInstanceRequest request = new PartialUpdateInstanceRequest
            {
                Instance   = new Instance(),
                UpdateMask = new FieldMask(),
            };
            // Make the request
            Operation <Instance, UpdateInstanceMetadata> response = await bigtableInstanceAdminClient.PartialUpdateInstanceAsync(request);

            // Poll until the returned long-running operation is complete
            Operation <Instance, UpdateInstanceMetadata> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Instance result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Instance, UpdateInstanceMetadata> retrievedResponse = await bigtableInstanceAdminClient.PollOncePartialUpdateInstanceAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Instance retrievedResult = retrievedResponse.Result;
            }
        }
        /// <summary>Snippet for CreateCluster</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void CreateClusterRequestObject()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
            // Initialize request argument(s)
            CreateClusterRequest request = new CreateClusterRequest
            {
                ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
                ClusterId            = "",
                Cluster = new Cluster(),
            };
            // Make the request
            Operation <Cluster, CreateClusterMetadata> response = bigtableInstanceAdminClient.CreateCluster(request);

            // Poll until the returned long-running operation is complete
            Operation <Cluster, CreateClusterMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Cluster result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Cluster, CreateClusterMetadata> retrievedResponse = bigtableInstanceAdminClient.PollOnceCreateCluster(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Cluster retrievedResult = retrievedResponse.Result;
            }
        }
Example #16
0
        private async Task InitBigtableInstanceAndTable()
        {
            if (EmulatorChannel == null)
            {
                InstanceAdminClient = BigtableInstanceAdminClient.Create();
                TableAdminClient    = BigtableTableAdminClient.Create();
                TableClient         = BigtableClient.Create();

                try
                {
                    await InstanceAdminClient.GetInstanceAsync(InstanceName);
                }
                catch (RpcException e) when(e.Status.StatusCode == StatusCode.NotFound)
                {
                    Assert.True(false, $"The Bigtable instance for testing does not exist: {InstanceName}");
                }
            }
            else
            {
                TableAdminClient = BigtableTableAdminClient.Create(EmulatorChannel);
                TableClient      = BigtableClient.Create(EmulatorChannel);
            }

            TableName = new TableName(ProjectName.ProjectId, InstanceName.InstanceId, "default-table");
            await CreateTable(TableName);
        }
Example #17
0
        public static object CreateCluster(string instanceId)
        {
            // [START bigtable_create_bigtableInstanceAdminClient]
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();

            // [END bigtable_create_bigtableInstanceAdminClient]

            Console.WriteLine("Print current instance information");
            GetInstance(instanceId);

            // Please refer to the link below for the full list of availabel locations:
            // https://cloud.google.com/bigtable/docs/locations
            string zone2 = "us-east1-d";

            Console.WriteLine("Creating cluster");
            // [START bigtable_create_cluster]
            // Create an additional cluster with cluster id "ssd-cluster2" with 3 nodes and location us-east1-d.
            // Additional cluster can only be created in PRODUCTION type instance.
            // Additional cluster must have same storage type as existing cluster.
            // Please read about routing_policy for more information on mutli cluster instances.
            // https://cloud.google.com/bigtable/docs/reference/admin/rpc/google.bigtable.admin.v2#google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny
            // Cluster to be created within the instance.
            Cluster myCluster2 = new Cluster
            {
                DefaultStorageType     = StorageType.Ssd,
                LocationAsLocationName = new LocationName(projectId, zone2),
                ServeNodes             = 3
            };
            // Initialize request argument(s).
            CreateClusterRequest request = new CreateClusterRequest
            {
                ParentAsInstanceName = new InstanceName(projectId, instanceId),
                ClusterId            = "ssd-cluster2",
                Cluster = myCluster2
            };

            try
            {
                // Make the request
                Console.WriteLine("Waiting for operation to complete...");
                Operation <Cluster, CreateClusterMetadata> response = bigtableInstanceAdminClient.CreateCluster(request);
                // Poll until the returned long-running operation is complete
                Operation <Cluster, CreateClusterMetadata> completedResponse = response.PollUntilCompleted();

                // [END bigtable_create_cluster]
                Console.WriteLine($"Cluster {request.ClusterId} was created successfully in instance {instanceId}");
                Console.WriteLine("Print intance information after cluster is created");
                GetInstance(instanceId);
                // [START bigtable_create_cluster]
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Exception creating additional cluster {request.ClusterId} in instance {instanceId}");
                Console.WriteLine(ex.Message);
            }
            // [END bigtable_create_cluster]

            return(0);
        }
Example #18
0
 /// <summary>Snippet for GetAppProfile</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetAppProfile()
 {
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     string name = "projects/[PROJECT]/instances/[INSTANCE]/appProfiles/[APP_PROFILE]";
     // Make the request
     AppProfile response = bigtableInstanceAdminClient.GetAppProfile(name);
 }
 /// <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);
 }
 /// <summary>Snippet for GetCluster</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCluster()
 {
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     string name = "projects/[PROJECT]/instances/[INSTANCE]/clusters/[CLUSTER]";
     // Make the request
     Cluster response = bigtableInstanceAdminClient.GetCluster(name);
 }
Example #21
0
 /// <summary>Snippet for GetIamPolicy</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetIamPolicyResourceNames()
 {
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
     // Make the request
     Policy response = bigtableInstanceAdminClient.GetIamPolicy(resource);
 }
 /// <summary>Snippet for GetIamPolicy</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetIamPolicy()
 {
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     string resource = "a/wildcard/resource";
     // Make the request
     Policy response = bigtableInstanceAdminClient.GetIamPolicy(resource);
 }
Example #23
0
 /// <summary>Snippet for GetAppProfile</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetAppProfileResourceNames()
 {
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     AppProfileName name = AppProfileName.FromProjectInstanceAppProfile("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
     // Make the request
     AppProfile response = bigtableInstanceAdminClient.GetAppProfile(name);
 }
Example #24
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);
 }
Example #25
0
 /// <summary>Snippet for ListClusters</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void ListClustersResourceNames()
 {
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
     // Make the request
     ListClustersResponse response = bigtableInstanceAdminClient.ListClusters(parent);
 }
Example #26
0
        /// <summary>Snippet for DeleteInstance</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void DeleteInstance()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
            // Initialize request argument(s)
            string name = "projects/[PROJECT]/instances/[INSTANCE]";

            // Make the request
            bigtableInstanceAdminClient.DeleteInstance(name);
        }
Example #27
0
        /// <summary>Snippet for GetClusterAsync</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 GetClusterResourceNamesAsync()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync();

            // Initialize request argument(s)
            ClusterName name = ClusterName.FromProjectInstanceCluster("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
            // Make the request
            Cluster response = await bigtableInstanceAdminClient.GetClusterAsync(name);
        }
Example #28
0
        /// <summary>Snippet for DeleteAppProfileAsync</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 DeleteAppProfileAsync()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync();

            // Initialize request argument(s)
            string name = "projects/[PROJECT]/instances/[INSTANCE]/appProfiles/[APP_PROFILE]";
            // Make the request
            await bigtableInstanceAdminClient.DeleteAppProfileAsync(name);
        }
Example #29
0
        /// <summary>Snippet for GetIamPolicyAsync</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 GetIamPolicyAsync()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync();

            // Initialize request argument(s)
            string resource = "a/wildcard/resource";
            // Make the request
            Policy response = await bigtableInstanceAdminClient.GetIamPolicyAsync(resource);
        }
Example #30
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);
        }