api

package
v0.0.0-...-1fa52ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: Apache-2.0, BSD-2-Clause, ISC, + 1 more Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateScopeConfig

func CreateScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

CreateScopeConfig create scope config for Zentao @Summary create scope config for Zentao @Description create scope config for Zentao @Tags plugins/zentao @Accept application/json @Param connectionId path int true "connectionId" @Param scopeConfig body models.ZentaoScopeConfig true "scope config" @Success 200 {object} models.ZentaoScopeConfig @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/zentao/connections/{connectionId}/scope-configs [POST]

func DeleteConnection

func DeleteConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

@Summary delete a zentao connection @Description Delete a zentao connection @Tags plugins/zentao @Success 200 {object} models.ZentaoConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 409 {object} services.BlueprintProjectPairs "References exist to this connection" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/zentao/connections/{connectionId} [DELETE]

func DeleteProjectScope

func DeleteProjectScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

DeleteProjectScope 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/zentao @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} api.ScopeRefDoc "References exist to this scope" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/zentao/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/zentao @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/zentao/connections/{connectionId}/scope-configs/{id} [DELETE]

func GetConnection

func GetConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

@Summary get zentao connection detail @Description Get zentao connection detail @Tags plugins/zentao @Success 200 {object} models.ZentaoConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/zentao/connections/{connectionId} [GET]

func GetProjectScope

func GetProjectScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

GetProjectScope get one project @Summary get one project @Description get one project @Tags plugins/zentao @Param connectionId path int true "connection ID" @Param scopeId path int true "scope ID" @Success 200 {object} ProjectScopeRes @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/zentao/connections/{connectionId}/scopes/{scopeId} [GET]

func GetProjectScopeList

func GetProjectScopeList(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

GetProjectScopeList 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} []ProjectScopeRes @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scopes [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/zentao @Param id path int true "id" @Param connectionId path int true "connectionId" @Success 200 {object} models.ZentaoScopeConfig @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/zentao/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/zentao @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.ZentaoScopeConfig @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/zentao/connections/{connectionId}/scope-configs [GET]

func GetScopeLatestSyncState

func GetScopeLatestSyncState(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

GetScopeLatestSyncState get one zentao project's latest sync state @Summary get one zentao project's latest sync state @Description get one zentao project's latest sync state @Tags plugins/zentao @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/zentao/connections/{connectionId}/scopes/{scopeId}/latest-sync-state [GET]

func Init

func Init(br context.BasicRes, p plugin.PluginMeta)

func ListConnections

func ListConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

@Summary get all zentao connections @Description Get all zentao connections @Tags plugins/zentao @Success 200 {object} []models.ZentaoConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/zentao/connections [GET]

func MakeDataSourcePipelinePlanV200

func MakeDataSourcePipelinePlanV200(
	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 zentao connection @Description Patch zentao connection @Tags plugins/zentao @Param body body models.ZentaoConnection true "json body" @Success 200 {object} models.ZentaoConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/zentao/connections/{connectionId} [PATCH]

func PostConnections

func PostConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

@Summary create zentao connection @Description Create zentao connection @Tags plugins/zentao @Param body body models.ZentaoConnection true "json body" @Success 200 {object} models.ZentaoConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/zentao/connections [POST]

func Proxy

Proxy is a proxy to Zentao API @Summary Proxy to Zentao API @Description Proxy to Zentao API @Tags plugins/zentao @Param connectionId path int true "connection ID" @Param path path string true "path to Zentao API" @Router /plugins/zentao/connections/{connectionId}/proxy/{path} [GET]

func PutProjectScope

func PutProjectScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

PutProjectScope create or update zentao projects @Summary create or update zentao projects @Description Create or update zentao projects @Tags plugins/zentao @Accept application/json @Param connectionId path int true "connection ID" @Param scope body ProjectScopeReq true "json" @Success 200 {object} []models.ZentaoProject @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/zentao/connections/{connectionId}/scopes [PUT]

func RemoteScopes

RemoteScopes list all available scope for users @Summary list all available scope for users @Description list all available scope for users @Tags plugins/zentao @Accept application/json @Param connectionId path int false "connection ID" @Param groupId query string false "group ID" @Param pageToken query string false "page Token" @Success 200 {object} api.RemoteScopesOutput @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/zentao/connections/{connectionId}/remote-scopes [GET]

func TestConnection

func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

TestConnection test zentao connection @Summary test zentao connection @Description Test zentao Connection @Tags plugins/zentao @Param body body models.ZentaoConn true "json body" @Success 200 {object} ZentaoTestConnResponse "Success" @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/zentao/test [POST]

func TestExistingConnection

func TestExistingConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

TestExistingConnection test zentao connection options @Summary test zentao connection @Description Test zentao Connection @Tags plugins/zentao @Param connectionId path int true "connection ID" @Success 200 {object} ZentaoTestConnResponse "Success" @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/zentao/connections/{connectionId}/test [POST]

func UpdateProjectScope

func UpdateProjectScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

UpdateProjectScope patch to zentao project @Summary patch to zentao project @Description patch to zentao project @Tags plugins/zentao @Accept application/json @Param connectionId path int true "connection ID" @Param scopeId path int true "scope ID" @Param scope body models.ZentaoProject true "json" @Success 200 {object} models.ZentaoProject @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/zentao/connections/{connectionId}/scopes/{scopeId} [PATCH]

func UpdateScopeConfig

func UpdateScopeConfig(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error)

UpdateScopeConfig update scope config for Zentao @Summary update scope config for Zentao @Description update scope config for Zentao @Tags plugins/zentao @Accept application/json @Param id path int true "id" @Param connectionId path int true "connectionId" @Param scopeConfig body models.ZentaoScopeConfig true "scope config" @Success 200 {object} models.ZentaoScopeConfig @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/zentao/connections/{connectionId}/scope-configs/{id} [PATCH]

Types

type MixScopes

type MixScopes struct {
	ZentaoProduct *models.ZentaoProduct `json:"product"`
	ZentaoProject *models.ZentaoProject `json:"project"`
}

type ProjectResponse

type ProjectResponse struct {
	Limit  int                    `json:"limit"`
	Page   int                    `json:"page"`
	Total  int                    `json:"total"`
	Values []models.ZentaoProject `json:"projects"`
}

type ProjectScopeReq

type ProjectScopeReq api.ScopeReq[models.ZentaoProject]

type ZentaoTestConnResponse

type ZentaoTestConnResponse struct {
	shared.ApiBody
	Connection *models.ZentaoConn
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL