|
402 | 402 | "outputs": [],
|
403 | 403 | "source": [
|
404 | 404 | "logging_client = MetricsServiceV2Client(credentials=creds)\n",
|
405 |
| - "parent = logging_client.project_path(PROJECT_ID)\n", |
| 405 | + "parent = logging_client.common_project_path(PROJECT_ID)\n", |
406 | 406 | "\n",
|
407 |
| - "for element in logging_client.list_log_metrics(parent):\n", |
408 |
| - " metric_path = logging_client.metric_path(PROJECT_ID, element.name)\n", |
409 |
| - " logging_client.delete_log_metric(metric_path)\n", |
| 407 | + "for element in logging_client.list_log_metrics({'parent': parent}):\n", |
| 408 | + " metric_path = logging_client.log_metric_path(PROJECT_ID, element.name)\n", |
| 409 | + " logging_client.delete_log_metric({'metric_name': metric_path})\n", |
410 | 410 | " print(\"Deleted metric: \", metric_path)"
|
411 | 411 | ]
|
412 | 412 | },
|
|
419 | 419 | "display_name = 'AI Platform Prediction and Locust'\n",
|
420 | 420 | "dashboard_service_client = DashboardsServiceClient(credentials=creds)\n",
|
421 | 421 | "parent = 'projects/{}'.format(PROJECT_ID)\n",
|
422 |
| - "for dashboard in dashboard_service_client.list_dashboards(parent):\n", |
| 422 | + "for dashboard in dashboard_service_client.list_dashboards({'parent': parent}):\n", |
423 | 423 | " if dashboard.display_name == display_name:\n",
|
424 |
| - " dashboard_service_client.delete_dashboard(dashboard.name)\n", |
| 424 | + " dashboard_service_client.delete_dashboard({'name': dashboard.name})\n", |
425 | 425 | " print(\"Deleted dashboard:\", dashboard.name)"
|
426 | 426 | ]
|
427 | 427 | },
|
|
0 commit comments