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

Documentation

Index

Constants

View Source
const RemoteScopesPerPage int = 100
View Source
const TypeScope string = "scope"

Variables

This section is empty.

Functions

func DeleteConnection

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

@Summary delete opsgenie connection @Description Delete Opsgenie connection @Tags plugins/opsgenie @Success 200 {object} models.OpsgenieConnection @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/opsgenie/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/opsgenie @Param connectionId path int true "connection ID" @Param serviceId path int true "service 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/opsgenie/connections/{connectionId}/scopes/{serviceId} [DELETE]

func EncodeToPageToken

func EncodeToPageToken(pageData *PageData) (string, errors.Error)

func GetConnection

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

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

func GetQueryFromPageData

func GetQueryFromPageData(pageData *PageData) (url.Values, errors.Error)

func GetScope

GetScope get one Opsgenie service @Summary get one Opsgenie service @Description get one Opsgenie service @Tags plugins/opsgenie @Param connectionId path int true "connection ID" @Param serviceId path int true "service ID" @Param blueprints query bool false "also return blueprints using this scope 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/opsgenie/connections/{connectionId}/scopes/{serviceId} [GET]

func GetScopeLatestSyncState

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

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

func GetScopeList

GetScopeList get Opsgenie repos @Summary get Opsgenie repos @Description get Opsgenie repos @Tags plugins/opsgenie @Param connectionId path int true "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} []ScopeRes @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/opsgenie/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)

@Summary list opsgenie connections @Description List Opsgenie connections @Tags plugins/opsgenie @Success 200 {object} models.OpsgenieConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/opsgenie/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 opsgenie connection @Description Patch Opsgenie connection @Tags plugins/opsgenie @Param body body models.OpsgenieConnection true "json body" @Success 200 {object} models.OpsgenieConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/opsgenie/connections/{connectionId} [PATCH]

func PostConnections

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

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

func PutScope

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

func RemoteScopes

RemoteScopes list all available scopes (services) for this connection @Summary list all available scopes (services) for this connection @Description list all available scopes (services) for this connection @Tags plugins/opsgenie @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} RemoteScopesOutput @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/opsgenie/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/opsgenie @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" @Success 200 {object} SearchRemoteScopesOutput @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/opsgenie/connections/{connectionId}/search-remote-scopes [GET]

func TestConnection

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

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

func TestExistingConnection

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

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

func UpdateScope

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

Types

type OpsgenieTaskOptions

type OpsgenieTaskOptions tasks.OpsgenieOptions

type PageData

type PageData struct {
	Page    int `json:"page"`
	PerPage int `json:"per_page"`
}

func DecodeFromPageToken

func DecodeFromPageToken(pageToken string) (*PageData, errors.Error)

type RemoteScopesChild

type RemoteScopesChild struct {
	Type     string      `json:"type"`
	ParentId *string     `json:"parentId"`
	Id       string      `json:"id"`
	Name     string      `json:"name"`
	FullName string      `json:"fullName"`
	Data     interface{} `json:"data"`
}

type RemoteScopesOutput

type RemoteScopesOutput struct {
	Children      []RemoteScopesChild `json:"children"`
	NextPageToken string              `json:"nextPageToken"`
}

type ScopeReq

type ScopeReq api.ScopeReq[models.Service]

type ScopeRes

type ScopeRes struct {
	models.Service
	api.ScopeResDoc[models.Service]
}

type SearchRemoteScopesOutput

type SearchRemoteScopesOutput struct {
	Children []RemoteScopesChild `json:"children"`
	Page     int                 `json:"page"`
	PageSize int                 `json:"pageSize"`
}

type ServiceResponse

type ServiceResponse struct {
	TotalCount int           `json:"totalCount"`
	Data       []raw.Service `json:"data"`
}

Jump to

Keyboard shortcuts

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