/// <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 CreateBackupAsync</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 CreateBackupResourceNamesAsync()
        {
            // Create client
            BigtableTableAdminClient bigtableTableAdminClient = await BigtableTableAdminClient.CreateAsync();

            // Initialize request argument(s)
            ClusterName parent   = ClusterName.FromProjectInstanceCluster("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
            string      backupId = "";
            Backup      backup   = new Backup();
            // Make the request
            Operation <Backup, CreateBackupMetadata> response = await bigtableTableAdminClient.CreateBackupAsync(parent, backupId, backup);

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

            // Retrieve the operation result
            Backup 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 <Backup, CreateBackupMetadata> retrievedResponse = await bigtableTableAdminClient.PollOnceCreateBackupAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Backup retrievedResult = retrievedResponse.Result;
            }
        }
コード例 #3
0
        /// <summary>Snippet for SnapshotTableAsync</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 SnapshotTableRequestObjectAsync()
        {
            // Create client
            BigtableTableAdminClient bigtableTableAdminClient = await BigtableTableAdminClient.CreateAsync();

            // Initialize request argument(s)
            SnapshotTableRequest request = new SnapshotTableRequest
            {
                TableName            = TableName.FromProjectInstanceTable("[PROJECT]", "[INSTANCE]", "[TABLE]"),
                ClusterAsClusterName = ClusterName.FromProjectInstanceCluster("[PROJECT]", "[INSTANCE]", "[CLUSTER]"),
                SnapshotId           = "",
                Ttl         = new Duration(),
                Description = "",
            };
            // Make the request
            Operation <Snapshot, SnapshotTableMetadata> response = await bigtableTableAdminClient.SnapshotTableAsync(request);

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

            // Retrieve the operation result
            Snapshot 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 <Snapshot, SnapshotTableMetadata> retrievedResponse = await bigtableTableAdminClient.PollOnceSnapshotTableAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Snapshot retrievedResult = retrievedResponse.Result;
            }
        }
コード例 #4
0
        /// <summary>Snippet for CreateBackup</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void CreateBackupRequestObject()
        {
            // Create client
            BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.Create();
            // Initialize request argument(s)
            CreateBackupRequest request = new CreateBackupRequest
            {
                ParentAsClusterName = ClusterName.FromProjectInstanceCluster("[PROJECT]", "[INSTANCE]", "[CLUSTER]"),
                BackupId            = "",
                Backup = new Backup(),
            };
            // Make the request
            Operation <Backup, CreateBackupMetadata> response = bigtableTableAdminClient.CreateBackup(request);

            // Poll until the returned long-running operation is complete
            Operation <Backup, CreateBackupMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Backup 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 <Backup, CreateBackupMetadata> retrievedResponse = bigtableTableAdminClient.PollOnceCreateBackup(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Backup retrievedResult = retrievedResponse.Result;
            }
        }
        /// <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;
            }
        }
コード例 #6
0
        /// <summary>Snippet for SnapshotTable</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void SnapshotTableResourceNames()
        {
            // Create client
            BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.Create();
            // Initialize request argument(s)
            TableName   name        = TableName.FromProjectInstanceTable("[PROJECT]", "[INSTANCE]", "[TABLE]");
            ClusterName cluster     = ClusterName.FromProjectInstanceCluster("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
            string      snapshotId  = "";
            string      description = "";
            // Make the request
            Operation <Snapshot, SnapshotTableMetadata> response = bigtableTableAdminClient.SnapshotTable(name, cluster, snapshotId, description);

            // Poll until the returned long-running operation is complete
            Operation <Snapshot, SnapshotTableMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Snapshot 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 <Snapshot, SnapshotTableMetadata> retrievedResponse = bigtableTableAdminClient.PollOnceSnapshotTable(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Snapshot retrievedResult = retrievedResponse.Result;
            }
        }
コード例 #7
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);
        }
コード例 #8
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (ClusterName != null ? ClusterName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Address != null ? Address.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Roles != null ? Roles.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #9
0
        /// <summary>Snippet for DeleteCluster</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void DeleteClusterResourceNames()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
            // Initialize request argument(s)
            ClusterName name = ClusterName.FromProjectInstanceCluster("[PROJECT]", "[INSTANCE]", "[CLUSTER]");

            // Make the request
            bigtableInstanceAdminClient.DeleteCluster(name);
        }
 /// <summary>Snippet for GetCluster</summary>
 public void GetCluster()
 {
     // Snippet: GetCluster(ClusterName,CallSettings)
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     ClusterName name = new ClusterName("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
     // Make the request
     Cluster response = bigtableInstanceAdminClient.GetCluster(name);
     // End snippet
 }
コード例 #11
0
 public override int GetHashCode() {
   int hash = 1;
   if (ClusterName.Length != 0) hash ^= ClusterName.GetHashCode();
   hash ^= endpoints_.GetHashCode();
   hash ^= NamedEndpoints.GetHashCode();
   if (policy_ != null) hash ^= Policy.GetHashCode();
   if (_unknownFields != null) {
     hash ^= _unknownFields.GetHashCode();
   }
   return hash;
 }
 /// <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 GetClusterRequestObject()
 {
     // Create client
     BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.Create();
     // Initialize request argument(s)
     GetClusterRequest request = new GetClusterRequest
     {
         ClusterName = ClusterName.FromProjectInstanceCluster("[PROJECT]", "[INSTANCE]", "[CLUSTER]"),
     };
     // Make the request
     Cluster response = bigtableInstanceAdminClient.GetCluster(request);
 }
コード例 #13
0
        /// <summary>Snippet for DeleteClusterAsync</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 DeleteClusterRequestObjectAsync()
        {
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync();

            // Initialize request argument(s)
            DeleteClusterRequest request = new DeleteClusterRequest
            {
                ClusterName = ClusterName.FromProjectInstanceCluster("[PROJECT]", "[INSTANCE]", "[CLUSTER]"),
            };
            // Make the request
            await bigtableInstanceAdminClient.DeleteClusterAsync(request);
        }
コード例 #14
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Type != global::Envoy.Data.Cluster.V3Alpha.OutlierEjectionType.Consecutive5Xx)
            {
                hash ^= Type.GetHashCode();
            }
            if (timestamp_ != null)
            {
                hash ^= Timestamp.GetHashCode();
            }
            if (secsSinceLastAction_ != null)
            {
                hash ^= SecsSinceLastAction.GetHashCode();
            }
            if (ClusterName.Length != 0)
            {
                hash ^= ClusterName.GetHashCode();
            }
            if (UpstreamUrl.Length != 0)
            {
                hash ^= UpstreamUrl.GetHashCode();
            }
            if (Action != global::Envoy.Data.Cluster.V3Alpha.Action.Eject)
            {
                hash ^= Action.GetHashCode();
            }
            if (NumEjections != 0)
            {
                hash ^= NumEjections.GetHashCode();
            }
            if (Enforced != false)
            {
                hash ^= Enforced.GetHashCode();
            }
            if (eventCase_ == EventOneofCase.EjectSuccessRateEvent)
            {
                hash ^= EjectSuccessRateEvent.GetHashCode();
            }
            if (eventCase_ == EventOneofCase.EjectConsecutiveEvent)
            {
                hash ^= EjectConsecutiveEvent.GetHashCode();
            }
            hash ^= (int)eventCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        /// <summary>Snippet for DeleteClusterAsync</summary>
        public async Task DeleteClusterAsync()
        {
            // Snippet: DeleteClusterAsync(ClusterName,CallSettings)
            // Additional: DeleteClusterAsync(ClusterName,CancellationToken)
            // Create client
            BigtableInstanceAdminClient bigtableInstanceAdminClient = await BigtableInstanceAdminClient.CreateAsync();

            // Initialize request argument(s)
            ClusterName name = new ClusterName("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
            // Make the request
            await bigtableInstanceAdminClient.DeleteClusterAsync(name);

            // End snippet
        }
コード例 #16
0
        /// <summary>Snippet for ListBackupsAsync</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 ListBackupsRequestObjectAsync()
        {
            // Create client
            BigtableTableAdminClient bigtableTableAdminClient = await BigtableTableAdminClient.CreateAsync();

            // Initialize request argument(s)
            ListBackupsRequest request = new ListBackupsRequest
            {
                ParentAsClusterName = ClusterName.FromProjectInstanceCluster("[PROJECT]", "[INSTANCE]", "[CLUSTER]"),
                Filter  = "",
                OrderBy = "",
            };
            // Make the request
            PagedAsyncEnumerable <ListBackupsResponse, Backup> response = bigtableTableAdminClient.ListBackupsAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Backup item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((ListBackupsResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Backup item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int           pageSize   = 10;
            Page <Backup> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Backup item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
        }
        /// <summary>Snippet for ListSnapshots</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void ListSnapshotsRequestObject()
        {
            // Create client
            BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.Create();
            // Initialize request argument(s)
            ListSnapshotsRequest request = new ListSnapshotsRequest
            {
                ParentAsClusterName = ClusterName.FromProjectInstanceCluster("[PROJECT]", "[INSTANCE]", "[CLUSTER]"),
            };
            // Make the request
            PagedEnumerable <ListSnapshotsResponse, Snapshot> response = bigtableTableAdminClient.ListSnapshots(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (Snapshot item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (ListSnapshotsResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Snapshot item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            }

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int             pageSize   = 10;
            Page <Snapshot> singlePage = response.ReadPage(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Snapshot item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
        }
コード例 #18
0
        /// <summary>Snippet for ListSnapshotsAsync</summary>
        public async Task ListSnapshotsAsync()
        {
            // Snippet: ListSnapshotsAsync(ClusterName,string,int?,CallSettings)
            // Create client
            BigtableTableAdminClient bigtableTableAdminClient = await BigtableTableAdminClient.CreateAsync();

            // Initialize request argument(s)
            ClusterName parent = new ClusterName("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
            // Make the request
            PagedAsyncEnumerable <ListSnapshotsResponse, Snapshot> response =
                bigtableTableAdminClient.ListSnapshotsAsync(parent);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((Snapshot item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((ListSnapshotsResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Snapshot item in page)
                {
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int             pageSize   = 10;
            Page <Snapshot> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (Snapshot item in singlePage)
            {
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
コード例 #19
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ClusterName.Length != 0)
            {
                hash ^= ClusterName.GetHashCode();
            }
            hash ^= upstreamLocalityStats_.GetHashCode();
            if (TotalDroppedRequests != 0UL)
            {
                hash ^= TotalDroppedRequests.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #20
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (serviceSpecifierCase_ == ServiceSpecifierOneofCase.ClusterName)
            {
                hash ^= ClusterName.GetHashCode();
            }
            if (serviceSpecifierCase_ == ServiceSpecifierOneofCase.GrpcService)
            {
                hash ^= GrpcService.GetHashCode();
            }
            hash ^= (int)serviceSpecifierCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }