diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_export_monitoringdashboardbasic.golden b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_export_monitoringdashboardbasic.golden index b0ed8ee54e6..bbe56ec3d1f 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_export_monitoringdashboardbasic.golden +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_export_monitoringdashboardbasic.golden @@ -27,14 +27,13 @@ spec: - title: Widget 3 xyChart: dataSets: - - plotType: STACKED_BAR + - plotType: LINE timeSeriesQuery: timeSeriesFilter: aggregation: perSeriesAligner: ALIGN_RATE filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" unitOverride: "1" - timeshiftDuration: "" yAxis: label: y1Axis scale: LINEAR diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml index 81e1f8d473b..2899418d31f 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_generated_object_monitoringdashboardbasic.golden.yaml @@ -36,14 +36,13 @@ spec: - title: Widget 3 xyChart: dataSets: - - plotType: STACKED_BAR + - plotType: LINE timeSeriesQuery: timeSeriesFilter: aggregation: perSeriesAligner: ALIGN_RATE filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" unitOverride: "1" - timeshiftDuration: 0s yAxis: label: y1Axis scale: LINEAR diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log index a81a02ff3ac..c669dd807f5 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/_http.log @@ -52,7 +52,7 @@ x-goog-request-params: parent=projects%2F${projectId} } } ], - "timeshiftDuration": "0s", + "timeshiftDuration": "100s", "yAxis": { "label": "y1Axis", "scale": 1 @@ -70,7 +70,7 @@ x-goog-request-params: parent=projects%2F${projectId} "xyChart": { "dataSets": [ { - "plotType": 3, + "plotType": 1, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { @@ -82,7 +82,7 @@ x-goog-request-params: parent=projects%2F${projectId} } } ], - "timeshiftDuration": "0s", + "timeshiftDuration": "60s", "yAxis": { "label": "y1Axis", "scale": 1 @@ -141,7 +141,7 @@ X-Xss-Protection: 0 } } ], - "timeshiftDuration": "0s", + "timeshiftDuration": "100s", "yAxis": { "label": "y1Axis", "scale": "LINEAR" @@ -160,7 +160,7 @@ X-Xss-Protection: 0 "xyChart": { "dataSets": [ { - "plotType": "STACKED_BAR", + "plotType": "LINE", "targetAxis": "Y1", "timeSeriesQuery": { "timeSeriesFilter": { @@ -173,7 +173,7 @@ X-Xss-Protection: 0 } } ], - "timeshiftDuration": "0s", + "timeshiftDuration": "60s", "yAxis": { "label": "y1Axis", "scale": "LINEAR" @@ -240,7 +240,7 @@ X-Xss-Protection: 0 } } ], - "timeshiftDuration": "0s", + "timeshiftDuration": "100s", "yAxis": { "label": "y1Axis", "scale": "LINEAR" @@ -259,7 +259,7 @@ X-Xss-Protection: 0 "xyChart": { "dataSets": [ { - "plotType": "STACKED_BAR", + "plotType": "LINE", "targetAxis": "Y1", "timeSeriesQuery": { "timeSeriesFilter": { @@ -272,7 +272,7 @@ X-Xss-Protection: 0 } } ], - "timeshiftDuration": "0s", + "timeshiftDuration": "60s", "yAxis": { "label": "y1Axis", "scale": "LINEAR" @@ -345,7 +345,7 @@ x-goog-request-params: dashboard.name=projects%2F${projectId}%2Fdashboards%2Fmon "xyChart": { "dataSets": [ { - "plotType": 3, + "plotType": 1, "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { @@ -357,7 +357,6 @@ x-goog-request-params: dashboard.name=projects%2F${projectId}%2Fdashboards%2Fmon } } ], - "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", "scale": 1 @@ -432,7 +431,7 @@ X-Xss-Protection: 0 "xyChart": { "dataSets": [ { - "plotType": "STACKED_BAR", + "plotType": "LINE", "targetAxis": "Y1", "timeSeriesQuery": { "timeSeriesFilter": { @@ -445,7 +444,6 @@ X-Xss-Protection: 0 } } ], - "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", "scale": "LINEAR" @@ -528,7 +526,7 @@ X-Xss-Protection: 0 "xyChart": { "dataSets": [ { - "plotType": "STACKED_BAR", + "plotType": "LINE", "targetAxis": "Y1", "timeSeriesQuery": { "timeSeriesFilter": { @@ -541,7 +539,6 @@ X-Xss-Protection: 0 } } ], - "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", "scale": "LINEAR" diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/create.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/create.yaml index 812543a9eb8..c3f07e130f5 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/create.yaml @@ -32,7 +32,7 @@ spec: perSeriesAligner: "ALIGN_RATE" unitOverride: "1" plotType: LINE - timeshiftDuration: 0s + timeshiftDuration: 100s yAxis: label: y1Axis scale: LINEAR @@ -48,8 +48,8 @@ spec: aggregation: perSeriesAligner: ALIGN_RATE unitOverride: "1" - plotType: "STACKED_BAR" - timeshiftDuration: 0s + plotType: "LINE" + timeshiftDuration: 60s yAxis: label: y1Axis scale: LINEAR diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/update.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/update.yaml index 6b5d4d9b646..85e5ca13e94 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardbasic/update.yaml @@ -48,8 +48,7 @@ spec: aggregation: perSeriesAligner: ALIGN_RATE unitOverride: "1" - plotType: "STACKED_BAR" - timeshiftDuration: 0s + plotType: "LINE" yAxis: label: y1Axis scale: LINEAR diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardfull/_generated_export_monitoringdashboardfull.golden b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardfull/_generated_export_monitoringdashboardfull.golden new file mode 100644 index 00000000000..61b4f8f4653 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardfull/_generated_export_monitoringdashboardfull.golden @@ -0,0 +1,47 @@ +apiVersion: monitoring.cnrm.cloud.google.com/v1beta1 +kind: MonitoringDashboard +metadata: + name: monitoringdashboard-${uniqueId} +spec: + columnLayout: + columns: + - weight: 2 + widgets: + - title: Widget 1 + xyChart: + dataSets: + - plotType: LINE + timeSeriesQuery: + timeSeriesFilter: + aggregation: + perSeriesAligner: ALIGN_RATE + filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" + unitOverride: "1" + timeshiftDuration: 600.5s + yAxis: + label: y1Axis + scale: LINEAR + - text: + content: Widget 2 + format: MARKDOWN + - title: Widget 3 + xyChart: + dataSets: + - plotType: STACKED_BAR + timeSeriesQuery: + timeSeriesFilter: + aggregation: + perSeriesAligner: ALIGN_RATE + filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" + unitOverride: "1" + yAxis: + label: y1Axis + scale: LINEAR + - logsPanel: + filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" + resourceNames: + - external: projects/${projectId} + kind: Project + title: Widget 4 + displayName: monitoringdashboard-full + projectRef: {} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardfull/_generated_object_monitoringdashboardfull.golden.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardfull/_generated_object_monitoringdashboardfull.golden.yaml new file mode 100644 index 00000000000..9cb3af5e1b8 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardfull/_generated_object_monitoringdashboardfull.golden.yaml @@ -0,0 +1,66 @@ +apiVersion: monitoring.cnrm.cloud.google.com/v1beta1 +kind: MonitoringDashboard +metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 2 + labels: + cnrm-test: "true" + name: monitoringdashboard-${uniqueId} + namespace: ${uniqueId} +spec: + columnLayout: + columns: + - weight: 2 + widgets: + - title: Widget 1 + xyChart: + dataSets: + - plotType: LINE + timeSeriesQuery: + timeSeriesFilter: + aggregation: + perSeriesAligner: ALIGN_RATE + filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" + unitOverride: "1" + timeshiftDuration: 600.5s + yAxis: + label: y1Axis + scale: LINEAR + - text: + content: Widget 2 + format: MARKDOWN + - title: Widget 3 + xyChart: + dataSets: + - plotType: STACKED_BAR + timeSeriesQuery: + timeSeriesFilter: + aggregation: + perSeriesAligner: ALIGN_RATE + filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" + unitOverride: "1" + yAxis: + label: y1Axis + scale: LINEAR + - logsPanel: + filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" + resourceNames: + - external: projects/${projectId} + title: Widget 4 + displayName: monitoringdashboard-full + projectRef: + external: ${projectId} + resourceID: monitoringdashboard-${uniqueId} +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + etag: abcdef123456 + observedGeneration: 2 diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardfull/_http.log b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardfull/_http.log new file mode 100644 index 00000000000..04691b8a383 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardfull/_http.log @@ -0,0 +1,315 @@ +GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "message": "Requested entity was not found.", + "status": "NOT_FOUND" + } +} + +--- + +POST https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards?%24alt=json%3Benum-encoding%3Dint +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: parent=projects%2F${projectId} + +{ + "columnLayout": { + "columns": [ + { + "weight": "2", + "widgets": [ + { + "title": "Widget 1", + "xyChart": { + "dataSets": [ + { + "plotType": 1, + "timeSeriesQuery": { + "timeSeriesFilter": { + "aggregation": { + "perSeriesAligner": 2 + }, + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" + }, + "unitOverride": "1" + } + } + ], + "timeshiftDuration": "600.500s", + "yAxis": { + "label": "y1Axis", + "scale": 1 + } + } + }, + { + "text": { + "content": "Widget 2", + "format": 1 + } + }, + { + "title": "Widget 3", + "xyChart": { + "dataSets": [ + { + "plotType": 3, + "timeSeriesQuery": { + "timeSeriesFilter": { + "aggregation": { + "perSeriesAligner": 2 + }, + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" + }, + "unitOverride": "1" + } + } + ], + "yAxis": { + "label": "y1Axis", + "scale": 1 + } + } + }, + { + "logsPanel": { + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"", + "resourceNames": [ + "projects/${projectId}" + ] + }, + "title": "Widget 4" + } + ] + } + ] + }, + "displayName": "monitoringdashboard-full", + "name": "projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}" +} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "columnLayout": { + "columns": [ + { + "weight": "2", + "widgets": [ + { + "title": "Widget 1", + "xyChart": { + "dataSets": [ + { + "plotType": "LINE", + "targetAxis": "Y1", + "timeSeriesQuery": { + "timeSeriesFilter": { + "aggregation": { + "perSeriesAligner": "ALIGN_RATE" + }, + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" + }, + "unitOverride": "1" + } + } + ], + "timeshiftDuration": "600.500s", + "yAxis": { + "label": "y1Axis", + "scale": "LINEAR" + } + } + }, + { + "text": { + "content": "Widget 2", + "format": "MARKDOWN", + "style": {} + } + }, + { + "title": "Widget 3", + "xyChart": { + "dataSets": [ + { + "plotType": "STACKED_BAR", + "targetAxis": "Y1", + "timeSeriesQuery": { + "timeSeriesFilter": { + "aggregation": { + "perSeriesAligner": "ALIGN_RATE" + }, + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" + }, + "unitOverride": "1" + } + } + ], + "yAxis": { + "label": "y1Axis", + "scale": "LINEAR" + } + } + }, + { + "logsPanel": { + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"", + "resourceNames": [ + "projects/${projectId}" + ] + }, + "title": "Widget 4" + } + ] + } + ] + }, + "displayName": "monitoringdashboard-full", + "etag": "abcdef0123A=", + "name": "projects/${projectNumber}/dashboards/monitoringdashboard-${uniqueId}" +} + +--- + +GET https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "columnLayout": { + "columns": [ + { + "weight": "2", + "widgets": [ + { + "title": "Widget 1", + "xyChart": { + "dataSets": [ + { + "plotType": "LINE", + "targetAxis": "Y1", + "timeSeriesQuery": { + "timeSeriesFilter": { + "aggregation": { + "perSeriesAligner": "ALIGN_RATE" + }, + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" + }, + "unitOverride": "1" + } + } + ], + "timeshiftDuration": "600.500s", + "yAxis": { + "label": "y1Axis", + "scale": "LINEAR" + } + } + }, + { + "text": { + "content": "Widget 2", + "format": "MARKDOWN", + "style": {} + } + }, + { + "title": "Widget 3", + "xyChart": { + "dataSets": [ + { + "plotType": "STACKED_BAR", + "targetAxis": "Y1", + "timeSeriesQuery": { + "timeSeriesFilter": { + "aggregation": { + "perSeriesAligner": "ALIGN_RATE" + }, + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" + }, + "unitOverride": "1" + } + } + ], + "yAxis": { + "label": "y1Axis", + "scale": "LINEAR" + } + } + }, + { + "logsPanel": { + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"", + "resourceNames": [ + "projects/${projectId}" + ] + }, + "title": "Widget 4" + } + ] + } + ] + }, + "displayName": "monitoringdashboard-full", + "etag": "abcdef0123A=", + "name": "projects/${projectNumber}/dashboards/monitoringdashboard-${uniqueId}" +} + +--- + +DELETE https://monitoring.googleapis.com/v1/projects/${projectId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +Content-Type: application/json +User-Agent: kcc/controller-manager +x-goog-request-params: name=projects%2F${projectId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardfull/create.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardfull/create.yaml new file mode 100644 index 00000000000..57d88c03baa --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardfull/create.yaml @@ -0,0 +1,59 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: monitoring.cnrm.cloud.google.com/v1beta1 +kind: MonitoringDashboard +metadata: + name: monitoringdashboard-${uniqueId} +spec: + displayName: "monitoringdashboard-full" + columnLayout: + columns: + - weight: 2 + widgets: + - title: "Widget 1" + xyChart: + dataSets: + - timeSeriesQuery: + timeSeriesFilter: + filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" + aggregation: + perSeriesAligner: "ALIGN_RATE" + unitOverride: "1" + plotType: LINE + timeshiftDuration: 600.500s + yAxis: + label: y1Axis + scale: LINEAR + - text: + content: "Widget 2" + format: "MARKDOWN" + - title: "Widget 3" + xyChart: + dataSets: + - timeSeriesQuery: + timeSeriesFilter: + filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" + aggregation: + perSeriesAligner: ALIGN_RATE + unitOverride: "1" + plotType: "STACKED_BAR" + yAxis: + label: y1Axis + scale: LINEAR + - title: "Widget 4" + logsPanel: + filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" + resourceNames: + - external: "projects/${projectId}" diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_export_monitoringdashboardrefs.golden b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_export_monitoringdashboardrefs.golden index a1e65b03cfa..7d9b1fe9514 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_export_monitoringdashboardrefs.golden +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_export_monitoringdashboardrefs.golden @@ -34,7 +34,6 @@ spec: perSeriesAligner: ALIGN_RATE filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" unitOverride: "1" - timeshiftDuration: "" yAxis: label: y1Axis scale: LINEAR diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml index f3ebe5fcc7a..e660abbb046 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_generated_object_monitoringdashboardrefs.golden.yaml @@ -3,6 +3,7 @@ kind: MonitoringDashboard metadata: annotations: cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/state-into-spec: merge finalizers: - cnrm.cloud.google.com/finalizer - cnrm.cloud.google.com/deletion-defender @@ -43,7 +44,6 @@ spec: perSeriesAligner: ALIGN_RATE filter: metric.type="agent.googleapis.com/nginx/connections/accepted_count" unitOverride: "1" - timeshiftDuration: 0s yAxis: label: y1Axis scale: LINEAR diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log index 7d05004891c..903843e5e02 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/_http.log @@ -15,6 +15,13 @@ X-Xss-Protection: 0 { "error": { "code": 403, + "errors": [ + { + "domain": "global", + "message": "The caller does not have permission", + "reason": "forbidden" + } + ], "message": "The caller does not have permission", "status": "PERMISSION_DENIED" } @@ -74,22 +81,26 @@ X-Xss-Protection: 0 { "done": true, "metadata": { - "@type": "type.googleapis.com/google.cloud.resourcemanager.v3.CreateProjectMetadata" + "@type": "type.googleapis.com/google.cloudresourcemanager.v1.ProjectCreationStatus", + "gettable": true, + "ready": true }, "name": "operations/${operationID}", "response": { - "@type": "type.googleapis.com/google.cloud.resourcemanager.v3.Project", + "@type": "type.googleapis.com/google.cloudresourcemanager.v1.Project", "createTime": "2024-04-01T12:34:56.123456Z", - "displayName": "A monitored project", - "etag": "abcdef0123A=", "labels": { "cnrm-test": "true", "managed-by-cnrm": "true" }, - "name": "projects/${projectNumber}", - "parent": "folders/${testFolderId}", + "lifecycleState": "ACTIVE", + "name": "A monitored project", + "parent": { + "id": "${testFolderId}", + "type": "folder" + }, "projectId": "other${uniqueId}", - "state": "ACTIVE" + "projectNumber": "${projectNumber}" } } @@ -150,10 +161,9 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 404 Not Found Cache-Control: private @@ -176,27 +186,26 @@ X-Xss-Protection: 0 --- -POST https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards?%24alt=json%3Benum-encoding%3Dint +POST https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: parent=projects%2Fother${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 { "columnLayout": { "columns": [ { - "weight": "2", + "weight": 2, "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": 1, + "plotType": "LINE", "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": 2 + "perSeriesAligner": "ALIGN_RATE" }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -207,14 +216,14 @@ x-goog-request-params: parent=projects%2Fother${uniqueId} "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": 1 + "scale": "LINEAR" } } }, { "text": { "content": "Widget 2", - "format": 1 + "format": "MARKDOWN" } }, { @@ -222,11 +231,11 @@ x-goog-request-params: parent=projects%2Fother${uniqueId} "xyChart": { "dataSets": [ { - "plotType": 3, + "plotType": "STACKED_BAR", "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": 2 + "perSeriesAligner": "ALIGN_RATE" }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -234,10 +243,9 @@ x-goog-request-params: parent=projects%2Fother${uniqueId} } } ], - "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": 1 + "scale": "LINEAR" } } }, @@ -325,7 +333,6 @@ X-Xss-Protection: 0 } } ], - "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", "scale": "LINEAR" @@ -352,10 +359,9 @@ X-Xss-Protection: 0 --- -GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 200 OK Cache-Control: private @@ -424,7 +430,6 @@ X-Xss-Protection: 0 } } ], - "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", "scale": "LINEAR" @@ -451,27 +456,26 @@ X-Xss-Protection: 0 --- -PATCH https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +PATCH https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: dashboard.name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 { "columnLayout": { "columns": [ { - "weight": "2", + "weight": 2, "widgets": [ { "title": "Widget 1", "xyChart": { "dataSets": [ { - "plotType": 1, + "plotType": "LINE", "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": 2 + "perSeriesAligner": "ALIGN_RATE" }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -479,17 +483,18 @@ x-goog-request-params: dashboard.name=projects%2Fother${uniqueId}%2Fdashboards%2 } } ], + "thresholds": [], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", - "scale": 1 + "scale": "LINEAR" } } }, { "text": { "content": "Widget 2", - "format": 1 + "format": "MARKDOWN" } }, { @@ -497,11 +502,11 @@ x-goog-request-params: dashboard.name=projects%2Fother${uniqueId}%2Fdashboards%2 "xyChart": { "dataSets": [ { - "plotType": 3, + "plotType": "STACKED_BAR", "timeSeriesQuery": { "timeSeriesFilter": { "aggregation": { - "perSeriesAligner": 2 + "perSeriesAligner": "ALIGN_RATE" }, "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" }, @@ -509,10 +514,10 @@ x-goog-request-params: dashboard.name=projects%2Fother${uniqueId}%2Fdashboards%2 } } ], - "timeshiftDuration": "0s", + "thresholds": [], "yAxis": { "label": "y1Axis", - "scale": 1 + "scale": "LINEAR" } } }, @@ -527,7 +532,8 @@ x-goog-request-params: dashboard.name=projects%2Fother${uniqueId}%2Fdashboards%2 ] }, "displayName": "monitoringdashboard updated", - "name": "projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}" + "etag": "abcdef0123A=", + "name": "projects/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}" } 200 OK @@ -597,6 +603,68 @@ X-Xss-Protection: 0 } } ], + "yAxis": { + "label": "y1Axis", + "scale": "LINEAR" + } + } + }, + { + "logsPanel": { + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" + }, + "title": "Widget 4" + } + ] + } + ] + }, + "displayName": "monitoringdashboard updated", + "etag": "abcdef0123A=", + "name": "projects/${projectNumber}/dashboards/monitoringdashboard-${uniqueId}" +} + +--- + +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "columnLayout": { + "columns": [ + { + "weight": "2", + "widgets": [ + { + "title": "Widget 1", + "xyChart": { + "dataSets": [ + { + "plotType": "LINE", + "targetAxis": "Y1", + "timeSeriesQuery": { + "timeSeriesFilter": { + "aggregation": { + "perSeriesAligner": "ALIGN_RATE" + }, + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" + }, + "unitOverride": "1" + } + } + ], "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", @@ -604,6 +672,37 @@ X-Xss-Protection: 0 } } }, + { + "text": { + "content": "Widget 2", + "format": "MARKDOWN", + "style": {} + } + }, + { + "title": "Widget 3", + "xyChart": { + "dataSets": [ + { + "plotType": "STACKED_BAR", + "targetAxis": "Y1", + "timeSeriesQuery": { + "timeSeriesFilter": { + "aggregation": { + "perSeriesAligner": "ALIGN_RATE" + }, + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" + }, + "unitOverride": "1" + } + } + ], + "yAxis": { + "label": "y1Axis", + "scale": "LINEAR" + } + } + }, { "logsPanel": { "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" @@ -637,6 +736,100 @@ X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0 +{ + "columnLayout": { + "columns": [ + { + "weight": "2", + "widgets": [ + { + "title": "Widget 1", + "xyChart": { + "dataSets": [ + { + "plotType": 1, + "targetAxis": 1, + "timeSeriesQuery": { + "timeSeriesFilter": { + "aggregation": { + "perSeriesAligner": 2 + }, + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" + }, + "unitOverride": "1" + } + } + ], + "timeshiftDuration": "0s", + "yAxis": { + "label": "y1Axis", + "scale": 1 + } + } + }, + { + "text": { + "content": "Widget 2", + "format": 1, + "style": {} + } + }, + { + "title": "Widget 3", + "xyChart": { + "dataSets": [ + { + "plotType": 3, + "targetAxis": 1, + "timeSeriesQuery": { + "timeSeriesFilter": { + "aggregation": { + "perSeriesAligner": 2 + }, + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" + }, + "unitOverride": "1" + } + } + ], + "yAxis": { + "label": "y1Axis", + "scale": 1 + } + } + }, + { + "logsPanel": { + "filter": "metric.type=\"agent.googleapis.com/nginx/connections/accepted_count\"" + }, + "title": "Widget 4" + } + ] + } + ] + }, + "displayName": "monitoringdashboard updated", + "etag": "abcdef0123A=", + "name": "projects/${projectNumber}/dashboards/monitoringdashboard-${uniqueId}" +} + +--- + +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +200 OK +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + { "columnLayout": { "columns": [ @@ -693,7 +886,6 @@ X-Xss-Protection: 0 } } ], - "timeshiftDuration": "0s", "yAxis": { "label": "y1Axis", "scale": "LINEAR" @@ -717,10 +909,9 @@ X-Xss-Protection: 0 --- -DELETE https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?%24alt=json%3Benum-encoding%3Dint +DELETE https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json Content-Type: application/json -User-Agent: kcc/controller-manager -x-goog-request-params: name=projects%2Fother${uniqueId}%2Fdashboards%2Fmonitoringdashboard-${uniqueId} +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 200 OK Cache-Control: private @@ -737,6 +928,31 @@ X-Xss-Protection: 0 --- +GET https://monitoring.googleapis.com/v1/projects/other${uniqueId}/dashboards/monitoringdashboard-${uniqueId}?alt=json +Content-Type: application/json +User-Agent: kcc/controller-manager DeclarativeClientLib/0.0.1 + +404 Not Found +Cache-Control: private +Content-Type: application/json; charset=UTF-8 +Server: ESF +Vary: Origin +Vary: X-Origin +Vary: Referer +X-Content-Type-Options: nosniff +X-Frame-Options: SAMEORIGIN +X-Xss-Protection: 0 + +{ + "error": { + "code": 404, + "message": "Requested entity was not found.", + "status": "NOT_FOUND" + } +} + +--- + GET https://cloudresourcemanager.googleapis.com/v1/projects/other${uniqueId}?alt=json&prettyPrint=false User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/create.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/create.yaml index 1f03f8670b5..d680d314815 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/create.yaml @@ -51,7 +51,6 @@ spec: perSeriesAligner: ALIGN_RATE unitOverride: "1" plotType: "STACKED_BAR" - timeshiftDuration: 0s yAxis: label: y1Axis scale: LINEAR diff --git a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/update.yaml b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/update.yaml index cde1f5c1e91..0ac5db79d32 100644 --- a/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/monitoring/v1beta1/monitoringdashboard/monitoringdashboardrefs/update.yaml @@ -51,7 +51,6 @@ spec: perSeriesAligner: ALIGN_RATE unitOverride: "1" plotType: "STACKED_BAR" - timeshiftDuration: 0s yAxis: label: y1Axis scale: LINEAR