-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Alert Configuration API (#21)
- Loading branch information
Showing
20 changed files
with
1,764 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
deploy/crds/knappek_v1alpha1_mongodbatlasalertconfiguration_cr.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: knappek.com/v1alpha1 | ||
kind: MongoDBAtlasAlertConfiguration | ||
metadata: | ||
name: example-mongodbatlasalertconfiguration | ||
spec: | ||
# Add fields here | ||
projectName: "example-project" | ||
eventTypeName: "OUTSIDE_METRIC_THRESHOLD" | ||
enabled: true | ||
notifications: | ||
- typeName: "GROUP" | ||
intervalMin: 5 | ||
delayMin: 0 | ||
smsEnabled: false | ||
emailEnabled: true | ||
metricThreshold: | ||
metricName: "QUERY_TARGETING_SCANNED_OBJECTS_PER_RETURNED" | ||
mode: "AVERAGE" | ||
operator: "GREATER_THAN" | ||
threshold: 500.0 | ||
units: "RAW" |
221 changes: 221 additions & 0 deletions
221
deploy/crds/knappek_v1alpha1_mongodbatlasalertconfiguration_crd.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,221 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: mongodbatlasalertconfigurations.knappek.com | ||
spec: | ||
additionalPrinterColumns: | ||
- JSONPath: .status.id | ||
description: The ID of the Alert Configuration | ||
name: ID | ||
type: string | ||
- JSONPath: .spec.projectName | ||
description: The MongoDB Atlas Project to which the Alert Configuration is applied | ||
name: Project Name | ||
type: string | ||
- JSONPath: .status.enabled | ||
description: Whether the Alert Configuration is enabled or disabled | ||
name: Enabled | ||
type: string | ||
- JSONPath: .metadata.creationTimestamp | ||
name: Age | ||
type: date | ||
group: knappek.com | ||
names: | ||
categories: | ||
- all | ||
- mongodbatlas | ||
kind: MongoDBAtlasAlertConfiguration | ||
listKind: MongoDBAtlasAlertConfigurationList | ||
plural: mongodbatlasalertconfigurations | ||
shortNames: | ||
- maalertconfig | ||
singular: mongodbatlasalertconfiguration | ||
scope: Namespaced | ||
subresources: | ||
status: {} | ||
validation: | ||
openAPIV3Schema: | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
enabled: | ||
type: boolean | ||
eventTypeName: | ||
type: string | ||
matchers: | ||
items: | ||
properties: | ||
fieldName: | ||
type: string | ||
operator: | ||
type: string | ||
value: | ||
type: string | ||
type: object | ||
type: array | ||
metricThreshold: | ||
properties: | ||
metricName: | ||
type: string | ||
mode: | ||
type: string | ||
operator: | ||
type: string | ||
threshold: | ||
format: double | ||
type: number | ||
units: | ||
type: string | ||
type: object | ||
notifications: | ||
items: | ||
properties: | ||
apiToken: | ||
type: string | ||
channelName: | ||
type: string | ||
delayMin: | ||
format: int64 | ||
type: integer | ||
emailAddress: | ||
type: string | ||
emailEnabled: | ||
type: boolean | ||
flowName: | ||
type: string | ||
flowdockApiToken: | ||
type: string | ||
intervalMin: | ||
format: int64 | ||
type: integer | ||
mobileNumber: | ||
type: string | ||
notificationToken: | ||
type: string | ||
opsGenieApiKey: | ||
type: string | ||
orgName: | ||
type: string | ||
roomName: | ||
type: string | ||
serviceKey: | ||
type: string | ||
smsEnabled: | ||
type: boolean | ||
teamId: | ||
type: string | ||
typeName: | ||
type: string | ||
username: | ||
type: string | ||
victorOpsApiKey: | ||
type: string | ||
victorOpsRoutingKey: | ||
type: string | ||
type: object | ||
type: array | ||
projectName: | ||
type: string | ||
required: | ||
- projectName | ||
type: object | ||
status: | ||
properties: | ||
enabled: | ||
type: boolean | ||
eventTypeName: | ||
type: string | ||
groupID: | ||
type: string | ||
id: | ||
type: string | ||
matchers: | ||
items: | ||
properties: | ||
fieldName: | ||
type: string | ||
operator: | ||
type: string | ||
value: | ||
type: string | ||
type: object | ||
type: array | ||
metricThreshold: | ||
properties: | ||
metricName: | ||
type: string | ||
mode: | ||
type: string | ||
operator: | ||
type: string | ||
threshold: | ||
format: double | ||
type: number | ||
units: | ||
type: string | ||
type: object | ||
notifications: | ||
items: | ||
properties: | ||
apiToken: | ||
type: string | ||
channelName: | ||
type: string | ||
delayMin: | ||
format: int64 | ||
type: integer | ||
emailAddress: | ||
type: string | ||
emailEnabled: | ||
type: boolean | ||
flowName: | ||
type: string | ||
flowdockApiToken: | ||
type: string | ||
intervalMin: | ||
format: int64 | ||
type: integer | ||
mobileNumber: | ||
type: string | ||
notificationToken: | ||
type: string | ||
opsGenieApiKey: | ||
type: string | ||
orgName: | ||
type: string | ||
roomName: | ||
type: string | ||
serviceKey: | ||
type: string | ||
smsEnabled: | ||
type: boolean | ||
teamId: | ||
type: string | ||
typeName: | ||
type: string | ||
username: | ||
type: string | ||
victorOpsApiKey: | ||
type: string | ||
victorOpsRoutingKey: | ||
type: string | ||
type: object | ||
type: array | ||
type: object | ||
version: v1alpha1 | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,5 +52,6 @@ rules: | |
- '*' | ||
- mongodbatlasclusters | ||
- mongodbatlasdatabaseusers | ||
- mongodbatlasalertconfigurations | ||
verbs: | ||
- '*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.