MCPcopy
hub / github.com/apache/devlake / TestExistingConnection

Function TestExistingConnection

backend/plugins/argocd/api/connection_api.go:105–115  ·  view source on GitHub ↗

TestExistingConnection test argocd connection @Summary test argocd connection @Description Test ArgoCD Connection @Tags plugins/argocd @Param connectionId path int true "connection ID" @Success 200 {object} ArgocdTestConnResponse "Success" @Failure 400 {string} errcode.Error "Bad Request" @Failure

(input *plugin.ApiResourceInput)

Source from the content-addressed store, hash-verified

103// @Failure 500 {string} errcode.Error "Internal Error"
104// @Router /plugins/argocd/connections/{connectionId}/test [POST]
105func TestExistingConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) {
106 connection, err := dsHelper.ConnApi.GetMergedConnection(input)
107 if err != nil {
108 return nil, errors.Convert(err)
109 }
110 if result, err := testConnection(context.TODO(), connection.ArgocdConn); err != nil {
111 return nil, plugin.WrapTestConnectionErrResp(basicRes, err)
112 } else {
113 return &plugin.ApiResourceOutput{Body: result, Status: http.StatusOK}, nil
114 }
115}
116
117// @Summary create argocd connection
118// @Description Create ArgoCD connection

Callers

nothing calls this directly

Calls 3

GetMergedConnectionMethod · 0.80
testConnectionFunction · 0.70
ConvertMethod · 0.45

Tested by

no test coverage detected