Beispiel #1
0
 /// <summary>Snippet for UpdateServiceLevelObjective</summary>
 public void UpdateServiceLevelObjective()
 {
     // Snippet: UpdateServiceLevelObjective(ServiceLevelObjective,CallSettings)
     // Create client
     ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.Create();
     // Initialize request argument(s)
     ServiceLevelObjective serviceLevelObjective = new ServiceLevelObjective();
     // Make the request
     ServiceLevelObjective response = serviceMonitoringServiceClient.UpdateServiceLevelObjective(serviceLevelObjective);
     // End snippet
 }
Beispiel #2
0
 /// <summary>Snippet for GetServiceLevelObjective</summary>
 public void GetServiceLevelObjective()
 {
     // Snippet: GetServiceLevelObjective(ServiceLevelObjectiveName,CallSettings)
     // Create client
     ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.Create();
     // Initialize request argument(s)
     ServiceLevelObjectiveName name = new ServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
     // Make the request
     ServiceLevelObjective response = serviceMonitoringServiceClient.GetServiceLevelObjective(name);
     // End snippet
 }
Beispiel #3
0
 /// <summary>Snippet for CreateServiceLevelObjective</summary>
 public void CreateServiceLevelObjective()
 {
     // Snippet: CreateServiceLevelObjective(ServiceName,ServiceLevelObjective,CallSettings)
     // Create client
     ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.Create();
     // Initialize request argument(s)
     ServiceName           parent = new ServiceName("[PROJECT]", "[SERVICE]");
     ServiceLevelObjective serviceLevelObjective = new ServiceLevelObjective();
     // Make the request
     ServiceLevelObjective response = serviceMonitoringServiceClient.CreateServiceLevelObjective(parent, serviceLevelObjective);
     // End snippet
 }
Beispiel #4
0
 /// <summary>Snippet for CreateService</summary>
 public void CreateService()
 {
     // Snippet: CreateService(ProjectName,Service,CallSettings)
     // Create client
     ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.Create();
     // Initialize request argument(s)
     ProjectName parent  = new ProjectName("[PROJECT]");
     Service     service = new Service();
     // Make the request
     Service response = serviceMonitoringServiceClient.CreateService(parent, service);
     // End snippet
 }
Beispiel #5
0
        /// <summary>Snippet for DeleteService</summary>
        public void DeleteService()
        {
            // Snippet: DeleteService(ServiceName,CallSettings)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.Create();
            // Initialize request argument(s)
            ServiceName name = new ServiceName("[PROJECT]", "[SERVICE]");

            // Make the request
            serviceMonitoringServiceClient.DeleteService(name);
            // End snippet
        }
Beispiel #6
0
        /// <summary>Snippet for GetServiceAsync</summary>
        public async Task GetServiceAsync()
        {
            // Snippet: GetServiceAsync(ServiceName,CallSettings)
            // Additional: GetServiceAsync(ServiceName,CancellationToken)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = await ServiceMonitoringServiceClient.CreateAsync();

            // Initialize request argument(s)
            ServiceName name = new ServiceName("[PROJECT]", "[SERVICE]");
            // Make the request
            Service response = await serviceMonitoringServiceClient.GetServiceAsync(name);

            // End snippet
        }
Beispiel #7
0
 /// <summary>Snippet for GetService</summary>
 public void GetService_RequestObject()
 {
     // Snippet: GetService(GetServiceRequest,CallSettings)
     // Create client
     ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.Create();
     // Initialize request argument(s)
     GetServiceRequest request = new GetServiceRequest
     {
         ServiceName = new ServiceName("[PROJECT]", "[SERVICE]"),
     };
     // Make the request
     Service response = serviceMonitoringServiceClient.GetService(request);
     // End snippet
 }
Beispiel #8
0
        /// <summary>Snippet for DeleteServiceLevelObjectiveAsync</summary>
        public async Task DeleteServiceLevelObjectiveAsync()
        {
            // Snippet: DeleteServiceLevelObjectiveAsync(ServiceLevelObjectiveName,CallSettings)
            // Additional: DeleteServiceLevelObjectiveAsync(ServiceLevelObjectiveName,CancellationToken)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = await ServiceMonitoringServiceClient.CreateAsync();

            // Initialize request argument(s)
            ServiceLevelObjectiveName name = new ServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
            // Make the request
            await serviceMonitoringServiceClient.DeleteServiceLevelObjectiveAsync(name);

            // End snippet
        }
Beispiel #9
0
 /// <summary>Snippet for UpdateServiceLevelObjective</summary>
 public void UpdateServiceLevelObjective_RequestObject()
 {
     // Snippet: UpdateServiceLevelObjective(UpdateServiceLevelObjectiveRequest,CallSettings)
     // Create client
     ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.Create();
     // Initialize request argument(s)
     UpdateServiceLevelObjectiveRequest request = new UpdateServiceLevelObjectiveRequest
     {
         ServiceLevelObjective = new ServiceLevelObjective(),
     };
     // Make the request
     ServiceLevelObjective response = serviceMonitoringServiceClient.UpdateServiceLevelObjective(request);
     // End snippet
 }
Beispiel #10
0
        /// <summary>Snippet for UpdateServiceLevelObjectiveAsync</summary>
        public async Task UpdateServiceLevelObjectiveAsync()
        {
            // Snippet: UpdateServiceLevelObjectiveAsync(ServiceLevelObjective,CallSettings)
            // Additional: UpdateServiceLevelObjectiveAsync(ServiceLevelObjective,CancellationToken)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = await ServiceMonitoringServiceClient.CreateAsync();

            // Initialize request argument(s)
            ServiceLevelObjective serviceLevelObjective = new ServiceLevelObjective();
            // Make the request
            ServiceLevelObjective response = await serviceMonitoringServiceClient.UpdateServiceLevelObjectiveAsync(serviceLevelObjective);

            // End snippet
        }
Beispiel #11
0
        /// <summary>Snippet for DeleteServiceLevelObjective</summary>
        public void DeleteServiceLevelObjective_RequestObject()
        {
            // Snippet: DeleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest,CallSettings)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.Create();
            // Initialize request argument(s)
            DeleteServiceLevelObjectiveRequest request = new DeleteServiceLevelObjectiveRequest
            {
                ServiceLevelObjectiveName = new ServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]"),
            };

            // Make the request
            serviceMonitoringServiceClient.DeleteServiceLevelObjective(request);
            // End snippet
        }
Beispiel #12
0
 /// <summary>Snippet for CreateService</summary>
 public void CreateService_RequestObject()
 {
     // Snippet: CreateService(CreateServiceRequest,CallSettings)
     // Create client
     ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.Create();
     // Initialize request argument(s)
     CreateServiceRequest request = new CreateServiceRequest
     {
         ParentAsProjectName = new ProjectName("[PROJECT]"),
         Service             = new Service(),
     };
     // Make the request
     Service response = serviceMonitoringServiceClient.CreateService(request);
     // End snippet
 }
Beispiel #13
0
        /// <summary>Snippet for CreateServiceAsync</summary>
        public async Task CreateServiceAsync()
        {
            // Snippet: CreateServiceAsync(ProjectName,Service,CallSettings)
            // Additional: CreateServiceAsync(ProjectName,Service,CancellationToken)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = await ServiceMonitoringServiceClient.CreateAsync();

            // Initialize request argument(s)
            ProjectName parent  = new ProjectName("[PROJECT]");
            Service     service = new Service();
            // Make the request
            Service response = await serviceMonitoringServiceClient.CreateServiceAsync(parent, service);

            // End snippet
        }
Beispiel #14
0
        /// <summary>Snippet for CreateServiceLevelObjectiveAsync</summary>
        public async Task CreateServiceLevelObjectiveAsync()
        {
            // Snippet: CreateServiceLevelObjectiveAsync(ServiceName,ServiceLevelObjective,CallSettings)
            // Additional: CreateServiceLevelObjectiveAsync(ServiceName,ServiceLevelObjective,CancellationToken)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = await ServiceMonitoringServiceClient.CreateAsync();

            // Initialize request argument(s)
            ServiceName           parent = new ServiceName("[PROJECT]", "[SERVICE]");
            ServiceLevelObjective serviceLevelObjective = new ServiceLevelObjective();
            // Make the request
            ServiceLevelObjective response = await serviceMonitoringServiceClient.CreateServiceLevelObjectiveAsync(parent, serviceLevelObjective);

            // End snippet
        }
Beispiel #15
0
        /// <summary>Snippet for ListServiceLevelObjectivesAsync</summary>
        public async Task ListServiceLevelObjectivesAsync_RequestObject()
        {
            // Snippet: ListServiceLevelObjectivesAsync(ListServiceLevelObjectivesRequest,CallSettings)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = await ServiceMonitoringServiceClient.CreateAsync();

            // Initialize request argument(s)
            ListServiceLevelObjectivesRequest request = new ListServiceLevelObjectivesRequest
            {
                ParentAsServiceName = new ServiceName("[PROJECT]", "[SERVICE]"),
            };
            // Make the request
            PagedAsyncEnumerable <ListServiceLevelObjectivesResponse, ServiceLevelObjective> response =
                serviceMonitoringServiceClient.ListServiceLevelObjectivesAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((ServiceLevelObjective 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((ListServiceLevelObjectivesResponse page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (ServiceLevelObjective 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 <ServiceLevelObjective> 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 (ServiceLevelObjective item in singlePage)
            {
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
Beispiel #16
0
        /// <summary>Snippet for ListServices</summary>
        public void ListServices_RequestObject()
        {
            // Snippet: ListServices(ListServicesRequest,CallSettings)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.Create();
            // Initialize request argument(s)
            ListServicesRequest request = new ListServicesRequest
            {
                ParentAsProjectName = new ProjectName("[PROJECT]"),
            };
            // Make the request
            PagedEnumerable <ListServicesResponse, Service> response =
                serviceMonitoringServiceClient.ListServices(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (Service 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 (ListServicesResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Service 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 <Service> 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 (Service item in singlePage)
            {
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
Beispiel #17
0
        /// <summary>Snippet for GetServiceLevelObjectiveAsync</summary>
        public async Task GetServiceLevelObjectiveAsync_RequestObject()
        {
            // Snippet: GetServiceLevelObjectiveAsync(GetServiceLevelObjectiveRequest,CallSettings)
            // Additional: GetServiceLevelObjectiveAsync(GetServiceLevelObjectiveRequest,CancellationToken)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = await ServiceMonitoringServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetServiceLevelObjectiveRequest request = new GetServiceLevelObjectiveRequest
            {
                ServiceLevelObjectiveName = new ServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]"),
            };
            // Make the request
            ServiceLevelObjective response = await serviceMonitoringServiceClient.GetServiceLevelObjectiveAsync(request);

            // End snippet
        }
Beispiel #18
0
        /// <summary>Snippet for UpdateServiceAsync</summary>
        public async Task UpdateServiceAsync_RequestObject()
        {
            // Snippet: UpdateServiceAsync(UpdateServiceRequest,CallSettings)
            // Additional: UpdateServiceAsync(UpdateServiceRequest,CancellationToken)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = await ServiceMonitoringServiceClient.CreateAsync();

            // Initialize request argument(s)
            UpdateServiceRequest request = new UpdateServiceRequest
            {
                Service = new Service(),
            };
            // Make the request
            Service response = await serviceMonitoringServiceClient.UpdateServiceAsync(request);

            // End snippet
        }
Beispiel #19
0
        /// <summary>Snippet for DeleteServiceAsync</summary>
        public async Task DeleteServiceAsync_RequestObject()
        {
            // Snippet: DeleteServiceAsync(DeleteServiceRequest,CallSettings)
            // Additional: DeleteServiceAsync(DeleteServiceRequest,CancellationToken)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = await ServiceMonitoringServiceClient.CreateAsync();

            // Initialize request argument(s)
            DeleteServiceRequest request = new DeleteServiceRequest
            {
                ServiceName = new ServiceName("[PROJECT]", "[SERVICE]"),
            };
            // Make the request
            await serviceMonitoringServiceClient.DeleteServiceAsync(request);

            // End snippet
        }
Beispiel #20
0
        /// <summary>Snippet for CreateServiceAsync</summary>
        public async Task CreateServiceAsync_RequestObject()
        {
            // Snippet: CreateServiceAsync(CreateServiceRequest,CallSettings)
            // Additional: CreateServiceAsync(CreateServiceRequest,CancellationToken)
            // Create client
            ServiceMonitoringServiceClient serviceMonitoringServiceClient = await ServiceMonitoringServiceClient.CreateAsync();

            // Initialize request argument(s)
            CreateServiceRequest request = new CreateServiceRequest
            {
                ParentAsProjectName = new ProjectName("[PROJECT]"),
                Service             = new Service(),
            };
            // Make the request
            Service response = await serviceMonitoringServiceClient.CreateServiceAsync(request);

            // End snippet
        }