diff options
Diffstat (limited to 'qa/qa/resource/clusters/agent_token.rb')
-rw-r--r-- | qa/qa/resource/clusters/agent_token.rb | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/qa/qa/resource/clusters/agent_token.rb b/qa/qa/resource/clusters/agent_token.rb index c1cf5c2f37b..cbd2964c31d 100644 --- a/qa/qa/resource/clusters/agent_token.rb +++ b/qa/qa/resource/clusters/agent_token.rb @@ -5,7 +5,7 @@ module QA module Clusters class AgentToken < QA::Resource::Base attribute :id - attribute :secret + attribute :token attribute :agent do QA::Resource::Clusters::Agent.fabricate_via_api! end @@ -20,26 +20,19 @@ module QA end def api_get_path - "gid://gitlab/Clusters::AgentToken/#{id}" + "/projects/#{agent.project.id}/cluster_agents/#{agent.id}/tokens/#{id}" end def api_post_path - "/graphql" + "/projects/#{agent.project.id}/cluster_agents/#{agent.id}/tokens" end def api_post_body - <<~GQL - mutation createToken { - clusterAgentTokenCreate(input: { clusterAgentId: "gid://gitlab/Clusters::Agent/#{agent.id}" name: "token-#{agent.id}" }) { - secret # This is the value you need to use on the next step - token { - createdAt - id - } - errors - } + { + id: agent.project.id, + agent_id: agent.id, + name: agent.name } - GQL end end end |