Set up Unified Maintenance

This document provides instructions on how to set up and use Unified Maintenance. It explains how to enable the Unified Maintenance API, query it directly, and how to manage maintenance event logs that are automatically sent to Cloud Logging.

Enable the Unified Maintenance API

To query the Unified Maintenance API directly, you need to enable the API in your Google Cloud project. If you want to view maintenance activities for App Hub applications, enable the API in the management project.

When you enable the API, you can view your Unified Maintenance events in the Unified Maintenance section of Hub.

Enable the Maintenance API:

Roles required to enable APIs

To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

gcloud services enable maintenance.googleapis.com

Receive maintenance activity logs in Cloud Logging

The Unified Maintenance service sends maintenance logs automatically (independent of whether the Unified Maintenance API is enabled or not). If you have been granted one of the basic roles (Viewer, Editor, or Owner) in Cloud Logging for your project, you have the necessary permissions to access Unified Maintenance logs.

To learn more about the required permissions, see Access control with IAM.

You cannot deactivate Unified Maintenance, but you can opt out of storing logs. To opt out, see Turn off maintenance logs.

To monitor the resource usage of Unified Maintenance logs in your projects, you can create a metric-threshold alerting policy. For more information, see Create metric-threshold alerting policies in the Google Cloud Observability documentation.

What's next