/** * * * <pre> * Documentation that is included with notifications and incidents related to * this policy. Best practice is for the documentation to include information * to help responders understand, mitigate, escalate, and correct the * underlying problems detected by the alerting policy. Notification channels * that have limited capacity might not show this documentation. * </pre> * * <code>.google.monitoring.v3.AlertPolicy.Documentation documentation = 13;</code> */ public com.google.monitoring.v3.AlertPolicy.DocumentationOrBuilder getDocumentationOrBuilder() { return getDocumentation(); }
output.writeMessage(13, getDocumentation());
size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getDocumentation());
mergeDocumentation(other.getDocumentation());
if (hasDocumentation()) { hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER; hash = (53 * hash) + getDocumentation().hashCode();
result = result && (hasDocumentation() == other.hasDocumentation()); if (hasDocumentation()) { result = result && getDocumentation().equals(other.getDocumentation());
private static void listAlertPolicies(String projectId) throws IOException { try (AlertPolicyServiceClient client = AlertPolicyServiceClient.create()) { ListAlertPoliciesPagedResponse response = client.listAlertPolicies(ProjectName.of(projectId)); System.out.println("Alert Policies:"); for (AlertPolicy policy : response.iterateAll()) { System.out.println( String.format("\nPolicy %s\nalert-id: %s", policy.getDisplayName(), policy.getName())); int channels = policy.getNotificationChannelsCount(); if (channels > 0) { System.out.println("notification-channels:"); for (int i = 0; i < channels; i++) { System.out.println("\t" + policy.getNotificationChannels(i)); } } if (policy.hasDocumentation() && policy.getDocumentation().getContent() != null) { System.out.println(policy.getDocumentation().getContent()); } } } } // [END monitoring_alert_list_policies]