/** * Gets a single metric descriptor. This method does not require a Stackdriver account. * * <p>Sample code: * * <pre><code> * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) { * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]"); * MetricDescriptor response = metricServiceClient.getMetricDescriptor(name); * } * </code></pre> * * @param name The metric descriptor on which to execute the request. The format is * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. An example value of * `{metric_id}` is `"compute.googleapis.com/instance/disk/read_bytes_count"`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final MetricDescriptor getMetricDescriptor(MetricDescriptorName name) { GetMetricDescriptorRequest request = GetMetricDescriptorRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return getMetricDescriptor(request); }
/** * Gets a single metric descriptor. This method does not require a Stackdriver account. * * <p>Sample code: * * <pre><code> * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) { * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]"); * MetricDescriptor response = metricServiceClient.getMetricDescriptor(name.toString()); * } * </code></pre> * * @param name The metric descriptor on which to execute the request. The format is * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. An example value of * `{metric_id}` is `"compute.googleapis.com/instance/disk/read_bytes_count"`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final MetricDescriptor getMetricDescriptor(String name) { GetMetricDescriptorRequest request = GetMetricDescriptorRequest.newBuilder().setName(name).build(); return getMetricDescriptor(request); }
/** * Gets a single metric descriptor. This method does not require a Stackdriver account. * * <p>Sample code: * * <pre><code> * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) { * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]"); * MetricDescriptor response = metricServiceClient.getMetricDescriptor(name); * } * </code></pre> * * @param name The metric descriptor on which to execute the request. The format is * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. An example value of * `{metric_id}` is `"compute.googleapis.com/instance/disk/read_bytes_count"`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final MetricDescriptor getMetricDescriptor(MetricDescriptorName name) { GetMetricDescriptorRequest request = GetMetricDescriptorRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); return getMetricDescriptor(request); }
/** * Gets a single metric descriptor. This method does not require a Stackdriver account. * * <p>Sample code: * * <pre><code> * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) { * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]"); * MetricDescriptor response = metricServiceClient.getMetricDescriptor(name.toString()); * } * </code></pre> * * @param name The metric descriptor on which to execute the request. The format is * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. An example value of * `{metric_id}` is `"compute.googleapis.com/instance/disk/read_bytes_count"`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final MetricDescriptor getMetricDescriptor(String name) { GetMetricDescriptorRequest request = GetMetricDescriptorRequest.newBuilder().setName(name).build(); return getMetricDescriptor(request); }