예제 #1
0
        /// <summary>Snippet for UpdateAsync</summary>
        public async Task UpdateAsync()
        {
            // Snippet: UpdateAsync(string, string, string, BackendService, CallSettings)
            // Additional: UpdateAsync(string, string, string, BackendService, CancellationToken)
            // Create client
            RegionBackendServicesClient regionBackendServicesClient = await RegionBackendServicesClient.CreateAsync();

            // Initialize request argument(s)
            string         project                = "";
            string         region                 = "";
            string         backendService         = "";
            BackendService backendServiceResource = new BackendService();
            // Make the request
            lro::Operation <Operation, Operation> response = await regionBackendServicesClient.UpdateAsync(project, region, backendService, backendServiceResource);

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

            // Retrieve the operation result
            Operation 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
            lro::Operation <Operation, Operation> retrievedResponse = await regionBackendServicesClient.PollOnceUpdateAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
예제 #2
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListRegionBackendServicesRequest, CallSettings)
            // Create client
            RegionBackendServicesClient regionBackendServicesClient = await RegionBackendServicesClient.CreateAsync();

            // Initialize request argument(s)
            ListRegionBackendServicesRequest request = new ListRegionBackendServicesRequest
            {
                Region  = "",
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedAsyncEnumerable <BackendServiceList, BackendService> response = regionBackendServicesClient.ListAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((BackendService 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((BackendServiceList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (BackendService 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 <BackendService> 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 (BackendService 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 ListAsync</summary>
        public async Task ListAsync()
        {
            // Snippet: ListAsync(string, string, CallSettings)
            // Additional: ListAsync(string, string, CancellationToken)
            // Create client
            RegionBackendServicesClient regionBackendServicesClient = await RegionBackendServicesClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            string region  = "";
            // Make the request
            BackendServiceList response = await regionBackendServicesClient.ListAsync(project, region);

            // End snippet
        }
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertAsync()
        {
            // Snippet: InsertAsync(string, string, BackendService, CallSettings)
            // Additional: InsertAsync(string, string, BackendService, CancellationToken)
            // Create client
            RegionBackendServicesClient regionBackendServicesClient = await RegionBackendServicesClient.CreateAsync();

            // Initialize request argument(s)
            string         project = "";
            string         region  = "";
            BackendService backendServiceResource = new BackendService();
            // Make the request
            Operation response = await regionBackendServicesClient.InsertAsync(project, region, backendServiceResource);

            // End snippet
        }
예제 #5
0
        /// <summary>Snippet for GetHealthAsync</summary>
        public async Task GetHealthAsync()
        {
            // Snippet: GetHealthAsync(string, string, string, ResourceGroupReference, CallSettings)
            // Additional: GetHealthAsync(string, string, string, ResourceGroupReference, CancellationToken)
            // Create client
            RegionBackendServicesClient regionBackendServicesClient = await RegionBackendServicesClient.CreateAsync();

            // Initialize request argument(s)
            string project        = "";
            string region         = "";
            string backendService = "";
            ResourceGroupReference resourceGroupReferenceResource = new ResourceGroupReference();
            // Make the request
            BackendServiceGroupHealth response = await regionBackendServicesClient.GetHealthAsync(project, region, backendService, resourceGroupReferenceResource);

            // End snippet
        }
예제 #6
0
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetRegionBackendServiceRequest, CallSettings)
            // Additional: GetAsync(GetRegionBackendServiceRequest, CancellationToken)
            // Create client
            RegionBackendServicesClient regionBackendServicesClient = await RegionBackendServicesClient.CreateAsync();

            // Initialize request argument(s)
            GetRegionBackendServiceRequest request = new GetRegionBackendServiceRequest
            {
                Region         = "",
                Project        = "",
                BackendService = "",
            };
            // Make the request
            BackendService response = await regionBackendServicesClient.GetAsync(request);

            // End snippet
        }
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertRequestObjectAsync()
        {
            // Snippet: InsertAsync(InsertRegionBackendServiceRequest, CallSettings)
            // Additional: InsertAsync(InsertRegionBackendServiceRequest, CancellationToken)
            // Create client
            RegionBackendServicesClient regionBackendServicesClient = await RegionBackendServicesClient.CreateAsync();

            // Initialize request argument(s)
            InsertRegionBackendServiceRequest request = new InsertRegionBackendServiceRequest
            {
                RequestId = "",
                Region    = "",
                Project   = "",
                BackendServiceResource = new BackendService(),
            };
            // Make the request
            Operation response = await regionBackendServicesClient.InsertAsync(request);

            // End snippet
        }
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListRegionBackendServicesRequest, CallSettings)
            // Additional: ListAsync(ListRegionBackendServicesRequest, CancellationToken)
            // Create client
            RegionBackendServicesClient regionBackendServicesClient = await RegionBackendServicesClient.CreateAsync();

            // Initialize request argument(s)
            ListRegionBackendServicesRequest request = new ListRegionBackendServicesRequest
            {
                PageToken            = "",
                MaxResults           = 0U,
                Region               = "",
                OrderBy              = "",
                Project              = "",
                Filter               = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            BackendServiceList response = await regionBackendServicesClient.ListAsync(request);

            // End snippet
        }
예제 #9
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeleteRegionBackendServiceRequest, CallSettings)
            // Additional: DeleteAsync(DeleteRegionBackendServiceRequest, CancellationToken)
            // Create client
            RegionBackendServicesClient regionBackendServicesClient = await RegionBackendServicesClient.CreateAsync();

            // Initialize request argument(s)
            DeleteRegionBackendServiceRequest request = new DeleteRegionBackendServiceRequest
            {
                RequestId      = "",
                Region         = "",
                Project        = "",
                BackendService = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = await regionBackendServicesClient.DeleteAsync(request);

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

            // Retrieve the operation result
            Operation 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
            lro::Operation <Operation, Operation> retrievedResponse = await regionBackendServicesClient.PollOnceDeleteAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }