Skip to content

Commit

Permalink
Merge pull request #584 from GoogleCloudPlatform/monitoring_regions
Browse files Browse the repository at this point in the history
Fix region tags
  • Loading branch information
waprin authored Mar 27, 2017
2 parents 792b24a + d80d598 commit 824adf3
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ void createMetricDescriptor(String type) throws IOException {
* @param name Name of metric descriptor to delete
*/
void deleteMetricDescriptor(String name) throws IOException {
// [START monitoring_delete_metric]
String projectId = System.getProperty("projectId");
final MetricServiceClient client = MetricServiceClient.create();
MetricDescriptorName metricName = MetricDescriptorName.create(projectId, name);
client.deleteMetricDescriptor(metricName);
System.out.println("Deleted descriptor " + name);
// [END monitoring_delete_metric]
}

/**
Expand Down Expand Up @@ -447,15 +449,15 @@ void listMonitoredResources() throws IOException {
for (MonitoredResourceDescriptor d : descriptors) {
System.out.println(d.getType());
}
// [START monitoring_list_resources]
// [END monitoring_list_resources]
}

/**
* Gets full information for a monitored resource.
* @param The resource type
*/
void describeMonitoredResources(String type) throws IOException {
// [START monitoring_list_resources]
// [START monitoring_get_descriptor]
// Your Google Cloud Platform project ID
String projectId = System.getProperty("projectId");

Expand All @@ -465,8 +467,7 @@ void describeMonitoredResources(String type) throws IOException {

System.out.println("Printing monitored resource descriptor: ");
System.out.println(response);

// [END monitoring_list_resources]
// [END monitoring_get_descriptor]
}


Expand Down

0 comments on commit 824adf3

Please sign in to comment.