diff options
Diffstat (limited to 'app/graphql/mutations/alert_management/prometheus_integration/reset_token.rb')
-rw-r--r-- | app/graphql/mutations/alert_management/prometheus_integration/reset_token.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/graphql/mutations/alert_management/prometheus_integration/reset_token.rb b/app/graphql/mutations/alert_management/prometheus_integration/reset_token.rb new file mode 100644 index 00000000000..745ac51f6e3 --- /dev/null +++ b/app/graphql/mutations/alert_management/prometheus_integration/reset_token.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Mutations + module AlertManagement + module PrometheusIntegration + class ResetToken < PrometheusIntegrationBase + graphql_name 'PrometheusIntegrationResetToken' + + argument :id, Types::GlobalIDType[::PrometheusService], + required: true, + description: "The id of the integration to mutate" + + def resolve(id:) + integration = authorized_find!(id: id) + + result = ::Projects::Operations::UpdateService.new( + integration.project, + current_user, + token_attributes + ).execute + + response integration, result + end + end + end + end +end |