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

Function TestExistingConnection

backend/plugins/gitlab/api/connection_api.go:108–118  ·  view source on GitHub ↗

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

(input *plugin.ApiResourceInput)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

GetMergedConnectionMethod · 0.80
testConnectionFunction · 0.70
ConvertMethod · 0.45

Tested by

no test coverage detected