syntax = "proto3"; package kentik.alerting.public.v202505; option go_package = "github.com/kentik/api-schema-public/gen/go/kentik/alerting/public/v202505"; import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "protoc-gen-openapiv2/options/annotations.proto"; import "kentik/core/v202303/annotations.proto"; import "kentik/alerting/types/v202303/types.proto"; import "kentik/alerting/types/v202506/pagination.proto"; import "kentik/alerting/types/v202506/sorting.proto"; import "kentik/alerting/public/v202505/common.proto"; import "kentik/alerting/public/v202505/policy_filters.proto"; import "kentik/alerting/public/v202505/policy_nms.proto"; import "kentik/alerting/public/v202505/policy_event.proto"; import "kentik/alerting/public/v202505/policy_flow.proto"; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { info: { title: "Alerting Policies API" version: "v202505" contact: { name: "Kentik API Engineering" url: "https://github.com/kentik/api-schema-public" } description: "# Overview\n" "The Alerting Policies API provides programmatic access to Kentik's configuration of the policies that define how, when, and to whom alerts are triggered." } external_docs: { url: "https://kb.kentik.com/docs/alerting" description: "Kentik Alerts documentation" } schemes: HTTPS consumes: "application/json" produces: "application/json" security_definitions: { security: { key: "email" value: { type: TYPE_API_KEY in: IN_HEADER name: "X-CH-Auth-Email" } } security: { key: "token" value: { type: TYPE_API_KEY in: IN_HEADER name: "X-CH-Auth-API-Token" } } } security: { security_requirement: { key: "email" value: {} } security_requirement: { key: "token" value: {} } } }; service PolicyService { option (google.api.default_host) = "grpc.api.kentik.com"; option (kentik.core.v202303.visibility) = SERVICE_VISIBILITY_PUBLIC; option (kentik.core.v202303.service_scope) = "admin.alerting"; rpc Get(PolicyServiceGetRequest) returns (PolicyServiceGetResponse) { option (kentik.core.v202303.method_scope) = "admin.alerting:read"; option (google.api.http) = { get: "/v202505/policies/{policy_type}/{id}" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { operation_id: "Get" summary: "Get Policy" description: "Returns an alerting policy." }; } rpc List(PolicyServiceListRequest) returns (PolicyServiceListResponse) { option (kentik.core.v202303.method_scope) = "admin.alerting:read"; option (google.api.http) = { post: "/v202505/policies/list" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { operation_id: "List" summary: "List Policies" description: "Returns a list of alerting policies." }; } rpc Disable(PolicyServiceDisableRequest) returns (PolicyServiceDisableResponse) { option (kentik.core.v202303.method_scope) = "admin.alerting:write"; option (google.api.http) = { post: "/v202505/policies/{policy_type}/{id}/disable" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { operation_id: "Disable" summary: "Disable Policy" description: "Disables an alerting policy." }; } rpc Enable(PolicyServiceEnableRequest) returns (PolicyServiceEnableResponse) { option (kentik.core.v202303.method_scope) = "admin.alerting:write"; option (google.api.http) = { post: "/v202505/policies/{policy_type}/{id}/enable" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { operation_id: "Enable" summary: "Enable Policy" description: "Enables an alerting policy." }; } } message PolicyServiceGetRequest { PolicyType policy_type = 1[ (google.api.field_behavior) = REQUIRED, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The type of policy to get." } ]; string id = 2[ (google.api.field_behavior) = REQUIRED, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The ID of the policy to get." } ]; } message PolicyServiceGetResponse { Policy policy = 1[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The alerting policy that was retrieved." } ]; } message PolicyServiceListRequest { kentik.alerting.types.v202506.PaginationConfig pagination = 1[ (google.api.field_behavior) = OPTIONAL, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The pagination configuration for the list request." } ]; kentik.alerting.types.v202506.SortingConfig sorting = 2[ (google.api.field_behavior) = OPTIONAL, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The sorting configuration for the list request." } ]; PolicyListFilters filters = 3[ (google.api.field_behavior) = OPTIONAL, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The policy filters for the list request." } ]; } message PolicyListFilters { repeated Source sources = 1[ (google.api.field_behavior) = OPTIONAL, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The source policies to list." } ]; reserved 2; // PolicyTypes filter placeholder here for future repeated string user_ids = 3[ (google.api.field_behavior) = OPTIONAL, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The IDs of the users who created the policies to filter by." } ]; kentik.alerting.types.v202303.TimeRange created_at = 4[ (google.api.field_behavior) = OPTIONAL, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The time range for the created time of the policies." } ]; kentik.alerting.types.v202303.TimeRange modified_at = 5[ (google.api.field_behavior) = OPTIONAL, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The time range for the modified time of the policies." } ]; } message PolicyServiceListResponse { kentik.alerting.types.v202506.PaginationInfo pagination = 1[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The pagination information for the list response." } ]; repeated Policy policies = 2[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The alerting policies that were found matching the filters." } ]; } message PolicyServiceDisableRequest { PolicyType policy_type = 1[ (google.api.field_behavior) = REQUIRED, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The type of policy to disable." } ]; string id = 2[ (google.api.field_behavior) = REQUIRED, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The ID of the policy to disable." } ]; } message PolicyServiceDisableResponse { Policy policy = 1[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The alerting policy after being disabled." } ]; } message PolicyServiceEnableRequest { PolicyType policy_type = 1[ (google.api.field_behavior) = REQUIRED, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The type of policy to enable." } ]; string id = 2[ (google.api.field_behavior) = REQUIRED, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The ID of the policy to enable." } ]; } message PolicyServiceEnableResponse { Policy policy = 1[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The alerting policy after being enabled." } ]; } message Policy { Source source = 1[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The source (type and ID) of the alerting policy." } ]; google.protobuf.Timestamp created_at = 2[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The time when the policy was created." } ]; google.protobuf.Timestamp modified_at = 3[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The time when the policy was last modified." } ]; string created_by = 4[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The user who created the policy." } ]; string modified_by = 5[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The user who last modified the policy." } ]; string name = 6[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The name of the policy." } ]; string description = 7[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The description of the policy." } ]; optional bool enabled = 8[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "Whether the policy is enabled." } ]; // provide annotation for default value repeated PolicyLevel levels = 10[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The policy levels configuration." } ]; // in future labels will be supported oneof settings { FlowPolicySettings flow = 11[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "Flow policy settings." } ]; NmsPolicySettings nms = 12[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "NMS policy settings." } ]; EventPolicySettings event = 13[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "Event policy settings." } ]; } bool has_errors = 14[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "Whether the policy has errors in the run-time." } ]; PolicyErrorInfo last_error = 15[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "Information about the last error that occurred with the policy." } ]; google.protobuf.Timestamp expire_date = 16[ (google.api.field_behavior) = OUTPUT_ONLY, (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "Indicates when the policy that was made from a query should expire and become disabled." } ]; message PolicyErrorInfo { google.protobuf.Timestamp timestamp = 1[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The timestamp when the error occurred." } ]; string description = 2[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The description of the error." } ]; } message PolicyLevel { kentik.alerting.types.v202303.Severity severity = 1[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The severity of the policy level. When level conditions are met, the alert is triggered at this severity." } ]; string description = 2[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The description of the policy level." } ]; bool ack_required = 3[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "Whether acknowledgment is required for alerts that match this policy level." } ]; oneof settings { NmsPolicyLevelSettings nms = 4[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "NMS policy level settings." } ]; FlowPolicyLevelSettings flow = 5[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "Flow policy level settings." } ]; EventPolicyLevelSettings event = 6[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "Event policy level settings." } ]; } repeated NotificationChannelAssociation notifications = 7[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "The notification channel associations for this policy level. When the alert is triggered at this level, the channels are used to send the alert notification." } ]; } }