api

package
v0.0.0-...-7d3b672 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 18 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} services.BlueprintProjectPairs "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} api.ScopeRefDoc "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 aha.ApiClientAbstract,
) (*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} ScopeRes @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/sonarqube/connections/{connectionId}/scopes/{scopeId} [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 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} []ScopeRes @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 []*plugin.BlueprintScopeV200, syncPolicy *plugin.BlueprintSyncPolicy) (plugin.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

Proxy proxy api request to upstream sonarqube @Summary proxy api request to upstream sonarqube @Description Proxy HTTP GET request to the sonarqube behind this connection. @Tags plugins/sonarqube @Param connectionId path int false "connection ID" @Param path path string false "API Path" @Success 200 {object} interface{} "Success" @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/sonarqube/connections/{connectionId}/proxy/rest/{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 ScopeReq 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 scope for users @Summary list all available scope for users @Description list all available scope for users @Tags plugins/sonarqube @Accept application/json @Param connectionId path int false "connection 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/sonarqube/connections/{connectionId}/remote-scopes [GET]

func SearchRemoteScopes

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

SearchRemoteScopes use the Search API and only return project @Summary use the Search API and only return project @Description use the Search API and only return project @Tags plugins/sonarqube @Accept application/json @Param connectionId path int false "connection ID" @Param search query string false "search keyword" @Param page query int false "page number" @Param pageSize query int false "page size per page" @Success 200 {object} api.SearchRemoteScopesOutput @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @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 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 ScopeRes

type ScopeRes struct {
	models.SonarqubeProject
}

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 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