Skip to content

Update file content of an existing custom dashboard

Kirstie Cook requested to merge 34525-update-custom-dashboard into master

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

Availability and Testing

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)

Edited by 🤖 GitLab Bot 🤖

Merge request reports