Update file content of an existing custom dashboard
What does this MR do?
As part of #34525 (closed), this MR creates an endpoint Projects::PerformanceMonitoring::DashboardsController#update
that will allow a user to update a custom monitoring dashboard. This creates a commit to the project's repository with the updated dashboard file.
The url is constructed as a PUT /*namespace_id/:project_id/-/performance_monitoring/dashboards/:file_name
. The file_name
is the name of the dashboard file that will be updated (located in .gitlab/dashboards/
), e.g. prom_alerts.yml
.
Required parameters:
-
file_content
the JSON content of the dashboard to replace the existing file -
branch
string with the name of the branch for the commit -
commit_message
string with commit message
The file_content
must be a hash that represents a valid dashboard as defined in the documentation here. Validation of this dashboard is already provided by PerformanceMonitoring::PrometheusDashboard
.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Closes #34525 (closed)