summaryrefslogtreecommitdiff
path: root/lib/api/internal/kubernetes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/internal/kubernetes.rb')
-rw-r--r--lib/api/internal/kubernetes.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/api/internal/kubernetes.rb b/lib/api/internal/kubernetes.rb
index 7af5c2ad2ee..d1ad3c1feb1 100644
--- a/lib/api/internal/kubernetes.rb
+++ b/lib/api/internal/kubernetes.rb
@@ -100,6 +100,23 @@ module API
end
end
+ namespace 'kubernetes/agent_configuration' do
+ desc 'POST agent configuration' do
+ detail 'Store configuration for an agent'
+ end
+ params do
+ requires :agent_id, type: Integer, desc: 'ID of the configured Agent'
+ requires :agent_config, type: JSON, desc: 'Configuration for the Agent'
+ end
+ post '/' do
+ agent = Clusters::Agent.find(params[:agent_id])
+
+ Clusters::Agents::RefreshAuthorizationService.new(agent, config: params[:agent_config]).execute
+
+ no_content!
+ end
+ end
+
namespace 'kubernetes/usage_metrics' do
desc 'POST usage metrics' do
detail 'Updates usage metrics for agent'