/// <summary>Snippet for AggregatedList</summary> public void AggregatedList() { // Snippet: AggregatedList(string, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) string project = ""; // Make the request TargetPoolAggregatedList response = targetPoolsClient.AggregatedList(project); // End snippet }
/// <summary>Snippet for Get</summary> public void Get() { // Snippet: Get(string, string, string, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; string targetPool = ""; // Make the request TargetPool response = targetPoolsClient.Get(project, region, targetPool); // End snippet }
/// <summary>Snippet for Insert</summary> public void Insert() { // Snippet: Insert(string, string, TargetPool, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; TargetPool targetPoolResource = new TargetPool(); // Make the request Operation response = targetPoolsClient.Insert(project, region, targetPoolResource); // End snippet }
/// <summary>Snippet for List</summary> public void ListRequestObject() { // Snippet: List(ListTargetPoolsRequest, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) ListTargetPoolsRequest request = new ListTargetPoolsRequest { Region = "", OrderBy = "", Project = "", Filter = "", ReturnPartialSuccess = false, }; // Make the request PagedEnumerable <TargetPoolList, TargetPool> response = targetPoolsClient.List(request); // Iterate over all response items, lazily performing RPCs as required foreach (TargetPool 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 (TargetPoolList page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (TargetPool 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 <TargetPool> 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 (TargetPool 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; // End snippet }
/// <summary>Snippet for GetHealth</summary> public void GetHealth() { // Snippet: GetHealth(string, string, string, InstanceReference, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; string targetPool = ""; InstanceReference instanceReferenceResource = new InstanceReference(); // Make the request TargetPoolInstanceHealth response = targetPoolsClient.GetHealth(project, region, targetPool, instanceReferenceResource); // End snippet }
/// <summary>Snippet for RemoveInstance</summary> public void RemoveInstance() { // Snippet: RemoveInstance(string, string, string, TargetPoolsRemoveInstanceRequest, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; string targetPool = ""; TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(); // Make the request Operation response = targetPoolsClient.RemoveInstance(project, region, targetPool, targetPoolsRemoveInstanceRequestResource); // End snippet }
/// <summary>Snippet for SetBackup</summary> public void SetBackup() { // Snippet: SetBackup(string, string, string, TargetReference, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; string targetPool = ""; TargetReference targetReferenceResource = new TargetReference(); // Make the request Operation response = targetPoolsClient.SetBackup(project, region, targetPool, targetReferenceResource); // End snippet }
/// <summary>Snippet for Get</summary> public void GetRequestObject() { // Snippet: Get(GetTargetPoolRequest, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) GetTargetPoolRequest request = new GetTargetPoolRequest { TargetPool = "", Region = "", Project = "", }; // Make the request TargetPool response = targetPoolsClient.Get(request); // End snippet }
/// <summary>Snippet for Delete</summary> public void DeleteRequestObject() { // Snippet: Delete(DeleteTargetPoolRequest, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) DeleteTargetPoolRequest request = new DeleteTargetPoolRequest { RequestId = "", TargetPool = "", Region = "", Project = "", }; // Make the request Operation response = targetPoolsClient.Delete(request); // End snippet }
/// <summary>Snippet for Insert</summary> public void InsertRequestObject() { // Snippet: Insert(InsertTargetPoolRequest, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) InsertTargetPoolRequest request = new InsertTargetPoolRequest { RequestId = "", TargetPoolResource = new TargetPool(), Region = "", Project = "", }; // Make the request Operation response = targetPoolsClient.Insert(request); // End snippet }
/// <summary>Snippet for GetHealth</summary> public void GetHealthRequestObject() { // Snippet: GetHealth(GetHealthTargetPoolRequest, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) GetHealthTargetPoolRequest request = new GetHealthTargetPoolRequest { TargetPool = "", Region = "", Project = "", InstanceReferenceResource = new InstanceReference(), }; // Make the request TargetPoolInstanceHealth response = targetPoolsClient.GetHealth(request); // End snippet }
/// <summary>Snippet for RemoveInstance</summary> public void RemoveInstanceRequestObject() { // Snippet: RemoveInstance(RemoveInstanceTargetPoolRequest, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) RemoveInstanceTargetPoolRequest request = new RemoveInstanceTargetPoolRequest { TargetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(), RequestId = "", TargetPool = "", Region = "", Project = "", }; // Make the request Operation response = targetPoolsClient.RemoveInstance(request); // End snippet }
/// <summary>Snippet for AddHealthCheck</summary> public void AddHealthCheckRequestObject() { // Snippet: AddHealthCheck(AddHealthCheckTargetPoolRequest, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) AddHealthCheckTargetPoolRequest request = new AddHealthCheckTargetPoolRequest { RequestId = "", TargetPool = "", Region = "", Project = "", TargetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(), }; // Make the request Operation response = targetPoolsClient.AddHealthCheck(request); // End snippet }
/// <summary>Snippet for AggregatedList</summary> public void AggregatedList() { // Snippet: AggregatedList(string, string, int?, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) string project = ""; // Make the request PagedEnumerable <TargetPoolAggregatedList, KeyValuePair <string, TargetPoolsScopedList> > response = targetPoolsClient.AggregatedList(project); // Iterate over all response items, lazily performing RPCs as required foreach (KeyValuePair <string, TargetPoolsScopedList> 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 (TargetPoolAggregatedList page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (KeyValuePair <string, TargetPoolsScopedList> 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 <KeyValuePair <string, TargetPoolsScopedList> > 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 (KeyValuePair <string, TargetPoolsScopedList> 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; // End snippet }
/// <summary>Snippet for SetBackup</summary> public void SetBackupRequestObject() { // Snippet: SetBackup(SetBackupTargetPoolRequest, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) SetBackupTargetPoolRequest request = new SetBackupTargetPoolRequest { RequestId = "", TargetPool = "", Region = "", FailoverRatio = 0F, Project = "", TargetReferenceResource = new TargetReference(), }; // Make the request Operation response = targetPoolsClient.SetBackup(request); // End snippet }
/// <summary>Snippet for AggregatedList</summary> public void AggregatedListRequestObject() { // Snippet: AggregatedList(AggregatedListTargetPoolsRequest, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) AggregatedListTargetPoolsRequest request = new AggregatedListTargetPoolsRequest { PageToken = "", MaxResults = 0U, OrderBy = "", Project = "", Filter = "", IncludeAllScopes = false, ReturnPartialSuccess = false, }; // Make the request TargetPoolAggregatedList response = targetPoolsClient.AggregatedList(request); // End snippet }
/// <summary>Snippet for List</summary> public void ListRequestObject() { // Snippet: List(ListTargetPoolsRequest, CallSettings) // Create client TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create(); // Initialize request argument(s) ListTargetPoolsRequest request = new ListTargetPoolsRequest { PageToken = "", MaxResults = 0U, Region = "", OrderBy = "", Project = "", Filter = "", ReturnPartialSuccess = false, }; // Make the request TargetPoolList response = targetPoolsClient.List(request); // End snippet }