use of com.google.cloud.logging.v2.MetricsClient in project gapic-generator-java by googleapis.
the class SyncDeleteLogMetric method syncDeleteLogMetric.
public static void syncDeleteLogMetric() throws Exception {
// It may require modifications to work in your environment.
try (MetricsClient metricsClient = MetricsClient.create()) {
DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder().setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()).build();
metricsClient.deleteLogMetric(request);
}
}
use of com.google.cloud.logging.v2.MetricsClient in project gapic-generator-java by googleapis.
the class SyncDeleteLogMetricLogmetricname method syncDeleteLogMetricLogmetricname.
public static void syncDeleteLogMetricLogmetricname() throws Exception {
// It may require modifications to work in your environment.
try (MetricsClient metricsClient = MetricsClient.create()) {
LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
metricsClient.deleteLogMetric(metricName);
}
}
use of com.google.cloud.logging.v2.MetricsClient in project gapic-generator-java by googleapis.
the class AsyncGetLogMetric method asyncGetLogMetric.
public static void asyncGetLogMetric() throws Exception {
// It may require modifications to work in your environment.
try (MetricsClient metricsClient = MetricsClient.create()) {
GetLogMetricRequest request = GetLogMetricRequest.newBuilder().setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()).build();
ApiFuture<LogMetric> future = metricsClient.getLogMetricCallable().futureCall(request);
// Do something.
LogMetric response = future.get();
}
}
use of com.google.cloud.logging.v2.MetricsClient in project gapic-generator-java by googleapis.
the class SyncGetLogMetricLogmetricname method syncGetLogMetricLogmetricname.
public static void syncGetLogMetricLogmetricname() throws Exception {
// It may require modifications to work in your environment.
try (MetricsClient metricsClient = MetricsClient.create()) {
LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
LogMetric response = metricsClient.getLogMetric(metricName);
}
}
use of com.google.cloud.logging.v2.MetricsClient in project gapic-generator-java by googleapis.
the class AsyncUpdateLogMetric method asyncUpdateLogMetric.
public static void asyncUpdateLogMetric() throws Exception {
// It may require modifications to work in your environment.
try (MetricsClient metricsClient = MetricsClient.create()) {
UpdateLogMetricRequest request = UpdateLogMetricRequest.newBuilder().setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()).setMetric(LogMetric.newBuilder().build()).build();
ApiFuture<LogMetric> future = metricsClient.updateLogMetricCallable().futureCall(request);
// Do something.
LogMetric response = future.get();
}
}
Aggregations