From a737469fb31d59cbfe3773a1d26f633ed267fb46 Mon Sep 17 00:00:00 2001 From: Campion Fellin Date: Mon, 12 Mar 2018 15:04:13 -0700 Subject: [PATCH] Fix client instantiation [(#1396)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1396) --- samples/snippets/v3/api-client/custom_metric.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/snippets/v3/api-client/custom_metric.py b/samples/snippets/v3/api-client/custom_metric.py index 20f7722c..6cf83980 100644 --- a/samples/snippets/v3/api-client/custom_metric.py +++ b/samples/snippets/v3/api-client/custom_metric.py @@ -34,7 +34,7 @@ import random import time -import list_resources +import googleapiclient.discovery def format_rfc3339(datetime_instance=None): @@ -173,7 +173,7 @@ def main(project_id): METRIC_KIND = "GAUGE" project_resource = "projects/{0}".format(project_id) - client = list_resources.get_client() + client = googleapiclient.discovery.build('monitoring', 'v3') create_custom_metric(client, project_resource, CUSTOM_METRIC_TYPE, METRIC_KIND) custom_metric = None