Documentation ¶
Index ¶
- Constants
- func CreateScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func DeleteConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func DeleteScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func DeleteScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func GetApiProject(op *tasks.GitlabOptions, apiClient plugin.ApiClient) (*models.GitlabApiProject, errors.Error)
- func GetConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func GetScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func GetScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func GetScopeConfigList(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func GetScopeLatestSyncState(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func GetScopeList(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func Init(br context.BasicRes, p plugin.PluginMeta)
- func ListConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func MakePipelinePlanV200(subtaskMetas []plugin.SubTaskMeta, connectionId uint64, ...) (coreModels.PipelinePlan, []plugin.Scope, errors.Error)
- func PatchConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func PatchScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func PatchScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func PostConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func Proxy(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func PutScopes(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func RemoteScopes(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func SearchRemoteScopes(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- func TestExistingConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
- type GitlabRemotePagination
- type GitlabTaskOptions
- type GitlabTestConnResponse
- type PutScopesReqBody
- type ScopeDetail
Constants ¶
const USERS_PREFIX = "user:"
Variables ¶
This section is empty.
Functions ¶
func CreateScopeConfig ¶
func CreateScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
CreateScopeConfig create scope config for Gitlab @Summary create scope config for Gitlab @Description create scope config for Gitlab @Tags plugins/gitlab @Accept application/json @Param connectionId path int true "connectionId" @Param scopeConfig body models.GitlabScopeConfig true "scope config" @Success 200 {object} models.GitlabScopeConfig @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scope-configs [POST]
func DeleteConnection ¶
func DeleteConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
@Summary delete a gitlab connection @Description Delete a gitlab connection @Tags plugins/gitlab @Success 200 {object} models.GitlabConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 409 {object} srvhelper.DsRefs "References exist to this connection" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/gitlab/connections/{connectionId} [DELETE]
func DeleteScope ¶
func DeleteScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
DeleteScope delete plugin data associated with the scope and optionally the scope itself @Summary delete plugin data associated with the scope and optionally the scope itself @Description delete data associated with plugin scope @Tags plugins/gitlab @Param connectionId path int true "connection ID" @Param scopeId path int true "scope ID" @Param delete_data_only query bool false "Only delete the scope data, not the scope itself" @Success 200 @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 409 {object} srvhelper.DsRefs "References exist to this scope" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scopes/{scopeId} [DELETE]
func DeleteScopeConfig ¶
func DeleteScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
DeleteScopeConfig delete a scope config @Summary delete a scope config @Description delete a scope config @Tags plugins/gitlab @Param id path int true "id" @Param connectionId path int true "connectionId" @Success 200 @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scope-configs/{id} [DELETE]
func GetApiProject ¶
func GetApiProject( op *tasks.GitlabOptions, apiClient plugin.ApiClient, ) (*models.GitlabApiProject, errors.Error)
func GetConnection ¶
func GetConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
@Summary get gitlab connection detail @Description Get gitlab connection detail @Tags plugins/gitlab @Success 200 {object} models.GitlabConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/gitlab/connections/{connectionId} [GET]
func GetScope ¶
func GetScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
GetScope get one Gitlab project @Summary get one Gitlab project @Description get one Gitlab project @Tags plugins/gitlab @Param connectionId path int false "connection ID" @Param scopeId path int false "project ID" @Param pageSize query int false "page size, default 50" @Param page query int false "page size, default 1" @Success 200 {object} ScopeDetail @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scopes/{scopeId} [GET]
func GetScopeConfig ¶
func GetScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
GetScopeConfig return one scope config @Summary return one scope config @Description return one scope config @Tags plugins/gitlab @Param id path int true "id" @Param connectionId path int true "connectionId" @Success 200 {object} models.GitlabScopeConfig @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scope-configs/{id} [GET]
func GetScopeConfigList ¶
func GetScopeConfigList(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
GetScopeConfigList return all scope configs @Summary return all scope configs @Description return all scope configs @Tags plugins/gitlab @Param connectionId path int true "connectionId" @Param pageSize query int false "page size, default 50" @Param page query int false "page size, default 1" @Success 200 {object} []models.GitlabScopeConfig @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scope-configs [GET]
func GetScopeLatestSyncState ¶
func GetScopeLatestSyncState(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
GetScopeLatestSyncState get one GitLab repo's latest sync state @Summary get one GitLab repo's latest sync state @Description get one GitLab repo's latest sync state @Tags plugins/gitlab @Param connectionId path int true "connection ID" @Param scopeId path int true "scope ID" @Success 200 {object} []models.LatestSyncState @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scopes/{scopeId}/latest-sync-state [GET]
func GetScopeList ¶
func GetScopeList(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
GetScopeList get Gitlab projects @Summary get Gitlab projects @Description get Gitlab projects @Tags plugins/gitlab @Param connectionId path int false "connection ID" @Param searchTerm query string false "search term for scope name" @Param blueprints query bool false "also return blueprints using these scopes as part of the payload" @Success 200 {object} []ScopeDetail @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scopes/ [GET]
func ListConnections ¶
func ListConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
@Summary get all gitlab connections @Description Get all gitlab connections @Tags plugins/gitlab @Success 200 {object} []models.GitlabConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/gitlab/connections [GET]
func MakePipelinePlanV200 ¶
func MakePipelinePlanV200( subtaskMetas []plugin.SubTaskMeta, connectionId uint64, bpScopes []*coreModels.BlueprintScope, ) (coreModels.PipelinePlan, []plugin.Scope, errors.Error)
func PatchConnection ¶
func PatchConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
@Summary patch gitlab connection @Description Patch gitlab connection @Tags plugins/gitlab @Param body body models.GitlabConnection true "json body" @Success 200 {object} models.GitlabConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/gitlab/connections/{connectionId} [PATCH]
func PatchScope ¶
func PatchScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
PatchScope patch to gitlab project @Summary patch to gitlab project @Description patch to gitlab project @Tags plugins/gitlab @Accept application/json @Param connectionId path int false "connection ID" @Param scopeId path int false "project ID" @Param scope body models.GitlabProject true "json" @Success 200 {object} models.GitlabProject @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scopes/{scopeId} [PATCH]
func PatchScopeConfig ¶
func PatchScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
PatchScopeConfig update scope config for Gitlab @Summary update scope config for Gitlab @Description update scope config for Gitlab @Tags plugins/gitlab @Accept application/json @Param id path int true "id" @Param connectionId path int true "connectionId" @Param scopeConfig body models.GitlabScopeConfig true "scope config" @Success 200 {object} models.GitlabScopeConfig @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scope-configs/{id} [PATCH]
func PostConnections ¶
func PostConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
@Summary create gitlab connection @Description Create gitlab connection @Tags plugins/gitlab @Param body body models.GitlabConnection true "json body" @Success 200 {object} models.GitlabConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/gitlab/connections [POST]
func Proxy ¶
func Proxy(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
@Summary Remote server API proxy @Description Forward API requests to the specified remote server @Param connectionId path int true "connection ID" @Param path path string true "path to a API endpoint" @Router /plugins/gitlab/connections/{connectionId}/proxy/{path} [GET] @Tags plugins/gitlab
func PutScopes ¶
func PutScopes(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
PutScopes create or update gitlab project @Summary create or update gitlab project @Description Create or update gitlab project @Tags plugins/gitlab @Accept application/json @Param connectionId path int false "connection ID" @Param scope body PutScopesReqBody true "json" @Success 200 {object} []models.GitlabProject @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scopes [PUT]
func RemoteScopes ¶
func RemoteScopes(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
RemoteScopes list all available scopes on the remote server @Summary list all available scopes on the remote server @Description list all available scopes on the remote server @Accept application/json @Param connectionId path int false "connection ID" @Param groupId query string false "group ID" @Param pageToken query string false "page Token" @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Success 200 {object} dsmodels.DsRemoteApiScopeList[models.GitlabProject] @Tags plugins/gitlab @Router /plugins/gitlab/connections/{connectionId}/remote-scopes [GET]
func SearchRemoteScopes ¶
func SearchRemoteScopes(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
SearchRemoteScopes searches projects on the remote server @Summary searches projects on the remote server @Description searches projects on the remote server @Accept application/json @Param connectionId path int false "connection ID" @Param search query string false "search" @Param page query int false "page number" @Param pageSize query int false "page size per page" @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Success 200 {object} dsmodels.DsRemoteApiScopeList[models.GitlabProject] "the parentIds are always null" @Tags plugins/gitlab @Router /plugins/gitlab/connections/{connectionId}/search-remote-scopes [GET]
func TestConnection ¶
func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
TestConnection test gitlab connection @Summary test gitlab connection @Description Test gitlab Connection @Tags plugins/gitlab @Param body body models.GitlabConn true "json body" @Success 200 {object} GitlabTestConnResponse "Success" @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/gitlab/test [POST]
func TestExistingConnection ¶
func TestExistingConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)
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 500 {string} errcode.Error "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/test [POST]
Types ¶
type GitlabRemotePagination ¶
type GitlabRemotePagination struct { Page int `json:"page" mapstructure:"page"` PerPage int `json:"per_page" mapstructure:"per_page"` Step string `json:"step" mapstructure:"step"` }
func (GitlabRemotePagination) ToQuery ¶
func (p GitlabRemotePagination) ToQuery() url.Values
type GitlabTaskOptions ¶
type GitlabTaskOptions tasks.GitlabOptions
type GitlabTestConnResponse ¶
type GitlabTestConnResponse struct { shared.ApiBody Connection *models.GitlabConn }
type PutScopesReqBody ¶
type PutScopesReqBody api.PutScopesReqBody[models.GitlabProject]
type ScopeDetail ¶
type ScopeDetail api.ScopeDetail[models.GitlabProject, models.GitlabScopeConfig]