Beispiel #1
0
        /// <summary>Snippet for DeleteMetricDescriptor</summary>
        public void DeleteMetricDescriptor()
        {
            // Snippet: DeleteMetricDescriptor(MetricDescriptorName,CallSettings)
            // Create client
            MetricServiceClient metricServiceClient = MetricServiceClient.Create();
            // Initialize request argument(s)
            MetricDescriptorName name = new MetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");

            // Make the request
            metricServiceClient.DeleteMetricDescriptor(name);
            // End snippet
        }
Beispiel #2
0
        // [END monitoring_create_metric]


        // [START monitoring_delete_metric]
        public static object DeleteMetric(string projectId, string metricType)
        {
            // Create client.
            MetricServiceClient metricServiceClient = MetricServiceClient.Create();
            // Initialize request argument(s).
            MetricDescriptorName name = new MetricDescriptorName(projectId, metricType);

            // Make the request.
            metricServiceClient.DeleteMetricDescriptor(name);
            Console.WriteLine($"Done deleting metric descriptor: {name}");
            return(0);
        }
Beispiel #3
0
        /// <summary>Snippet for DeleteMetricDescriptor</summary>
        public void DeleteMetricDescriptor_RequestObject()
        {
            // Snippet: DeleteMetricDescriptor(DeleteMetricDescriptorRequest,CallSettings)
            // Create client
            MetricServiceClient metricServiceClient = MetricServiceClient.Create();
            // Initialize request argument(s)
            DeleteMetricDescriptorRequest request = new DeleteMetricDescriptorRequest
            {
                MetricDescriptorName = new MetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]"),
            };

            // Make the request
            metricServiceClient.DeleteMetricDescriptor(request);
            // End snippet
        }