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: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteConnection

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

DeleteConnection delete a sonarqube connection @Summary delete a sonarqube connection @Description Delete a sonarqube connection @Tags plugins/sonarqube @Param connectionId path int false "connection ID" @Success 200 {object} models.SonarqubeConnection @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/sonarqube/connections/{connectionId} [DELETE]

func DeleteScope

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/sonarqube @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/sonarqube/connections/{connectionId}/scopes/{scopeId} [DELETE]

func GetApiProject

func GetApiProject(
	projectKey string,
	apiClient plugin.ApiClient,
) (*models.SonarqubeApiProject, errors.Error)

func GetConnection

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

GetConnection get sonarqube connection detail @Summary get sonarqube connection detail @Description Get sonarqube connection detail @Tags plugins/sonarqube @Param connectionId path int false "connection ID" @Success 200 {object} models.SonarqubeConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/sonarqube/connections/{connectionId} [GET]

func GetScope

GetScope get one Sonarqube project @Summary get one Sonarqube project @Description get one Sonarqube project @Tags plugins/sonarqube @Param connectionId path int false "connection ID" @Param scopeId path string false "project key" @Success 200 {object} ScopeDetail @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/sonarqube/connections/{connectionId}/scopes/{scopeId} [GET]

func GetScopeLatestSyncState

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

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

func GetScopeList

GetScopeList get Sonarqube projects @Summary get Sonarqube projects @Description get Sonarqube projects @Tags plugins/sonarqube @Param connectionId path int false "connection ID" @Param searchTerm query string false "search term for scope name" @Param pageSize query int false "page size, default 50" @Param page query int false "page size, default 1" @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/sonarqube/connections/{connectionId}/scopes [GET]

func Init

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

func ListConnections

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

ListConnections get all sonarqube connections @Summary get all sonarqube connections @Description Get all sonarqube connections @Tags plugins/sonarqube @Success 200 {object} []models.SonarqubeConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/sonarqube/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)

PatchConnection patch sonarqube connection @Summary patch sonarqube connection @Description Patch sonarqube connection @Tags plugins/sonarqube @Param body body models.SonarqubeConnection true "json body" @Param connectionId path int false "connection ID" @Success 200 {object} models.SonarqubeConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/sonarqube/connections/{connectionId} [PATCH]

func PostConnections

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

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

func Proxy

@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" @Tags plugins/sonarqube @Router /plugins/sonarqube/connections/{connectionId}/proxy/{path} [GET]

func PutScope

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

func RemoteScopes

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.SonarqubeProject] @Tags plugins/sonarqube @Router /plugins/sonarqube/connections/{connectionId}/remote-scopes [GET]

func SearchRemoteScopes

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

SearchRemoteScopes searches scopes on the remote server @Summary searches scopes on the remote server @Description searches scopes 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.SonarqubeProject] "the parentIds are always null" @Tags plugins/sonarqube @Router /plugins/sonarqube/connections/{connectionId}/search-remote-scopes [GET]

func TestConnection

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

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

func TestExistingConnection

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

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

func UpdateScope

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

Types

type SonarqubeBlueprintSetting

type SonarqubeBlueprintSetting []struct {
	Version     string `json:"version"`
	Connections []struct {
		Plugin       string `json:"plugin"`
		ConnectionID int    `json:"connectionId"`
		Scope        []struct {
			Options struct {
				ProjectKey string `json:"projectKey"`
			} `json:"options"`
			Entities []string `json:"entities"`
		} `json:"scopes"`
	} `json:"connections"`
}

type SonarqubePipelinePlan

type SonarqubePipelinePlan [][]struct {
	Plugin   string   `json:"plugin"`
	Subtasks []string `json:"subtasks"`
	Options  struct {
		ProjectKey   string `json:"projectKey"`
		ConnectionID int    `json:"connectionId"`
	} `json:"options"`
}

type SonarqubeRemotePagination

type SonarqubeRemotePagination struct {
	Page     int `json:"p"`
	PageSize int `json:"ps"`
}

type SonarqubeTestConnResponse

type SonarqubeTestConnResponse struct {
	shared.ApiBody
	Connection *models.SonarqubeConn
}

Jump to

Keyboard shortcuts

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