Skip to content

Commit

Permalink
feat: [CDS-104468]: add withCredentials option to gitops agent get api (
Browse files Browse the repository at this point in the history
  • Loading branch information
ashinsabu3 authored Nov 26, 2024
1 parent eafa38f commit 84c5294
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion harness/nextgen/api_agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ package nextgen
import (
"context"
"fmt"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"

"github.com/antihax/optional"
)

// Linger please
Expand Down Expand Up @@ -341,6 +342,7 @@ Get agents.
* @param "PageSize" (optional.Int32) -
* @param "PageIndex" (optional.Int32) -
* @param "Scope" (optional.String) -
* @param "WithCredentials" (optional.Bool) - Applicable when trying to retrieve an agent. Set to true to include the credentials for the agent in the response. (Private key may not be included in response if agent is already connected to harness). NOTE: Setting this to true requires the user to have edit permissions on Agent.
@return V1Agent
*/

Expand All @@ -354,6 +356,7 @@ type AgentsApiAgentServiceForServerGetOpts struct {
PageSize optional.Int32
PageIndex optional.Int32
Scope optional.String
WithCredentials optional.Bool
}

func (a *AgentsApiService) AgentServiceForServerGet(ctx context.Context, identifier string, accountIdentifier string, localVarOptionals *AgentsApiAgentServiceForServerGetOpts) (V1Agent, *http.Response, error) {
Expand Down Expand Up @@ -402,6 +405,9 @@ func (a *AgentsApiService) AgentServiceForServerGet(ctx context.Context, identif
if localVarOptionals != nil && localVarOptionals.Scope.IsSet() {
localVarQueryParams.Add("scope", parameterToString(localVarOptionals.Scope.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.WithCredentials.IsSet() {
localVarQueryParams.Add("withCredentials", parameterToString(localVarOptionals.WithCredentials.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}

Expand Down
1 change: 1 addition & 0 deletions harness/nextgen/docs/AgentsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Name | Type | Description | Notes
**pageSize** | **optional.Int32**| |
**pageIndex** | **optional.Int32**| |
**scope** | **optional.String**| | [default to AGENT_SCOPE_UNSET]
**withCredentials** | **optional.Bool**| Applicable when trying to retrieve an agent. Set to true to include the credentials for the agent in the response. (Private key may not be included in response if agent is already connected to harness). NOTE: Setting this to true requires the user to have edit permissions on Agent. |

### Return type

Expand Down

0 comments on commit 84c5294

Please sign in to comment.