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: 21 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 pagerduty connection @Description Delete Pagerduty connection @Tags plugins/pagerduty @Success 200 {object} models.PagerDutyConnection @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/pagerduty/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/pagerduty @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/pagerduty/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 pagerduty connection @Description Get Pagerduty connection @Tags plugins/pagerduty @Success 200 {object} models.PagerDutyConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/pagerduty/connections/{connectionId} [GET]

func GetQueryFromPageData

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

func GetScope

GetScope get one PagerDuty service @Summary get one PagerDuty service @Description get one PagerDuty service @Tags plugins/pagerduty @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/pagerduty/connections/{connectionId}/scopes/{serviceId} [GET]

func GetScopeList

GetScopeList get PagerDuty repos @Summary get PagerDuty repos @Description get PagerDuty repos @Tags plugins/pagerduty @Param connectionId path int true "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/pagerduty/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 pagerduty connections @Description List Pagerduty connections @Tags plugins/pagerduty @Success 200 {object} models.PagerDutyConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/pagerduty/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)

@Summary patch pagerduty connection @Description Patch Pagerduty connection @Tags plugins/pagerduty @Param body body models.PagerDutyConnection true "json body" @Success 200 {object} models.PagerDutyConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/pagerduty/connections/{connectionId} [PATCH]

func PostConnections

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

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

func PutScope

PutScope create or update pagerduty service @Summary create or update pagerduty service @Description Create or update pagerduty service @Tags plugins/pagerduty @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/pagerduty/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/pagerduty @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/pagerduty/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/pagerduty @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/pagerduty/connections/{connectionId}/search-remote-scopes [GET]

func TestConnection

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

@Summary test pagerduty connection @Description Test Pagerduty Connection @Tags plugins/pagerduty @Param body body models.PagerDutyConn 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/pagerduty/test [POST]

func UpdateScope

UpdateScope patch to pagerduty service @Summary patch to pagerduty service @Description patch to pagerduty service @Tags plugins/pagerduty @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/pagerduty/connections/{connectionId}/scopes/{serviceId} [PATCH]

Types

type PageData

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

func DecodeFromPageToken

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

type PagerDutyTaskOptions

type PagerDutyTaskOptions tasks.PagerDutyOptions

type RemoteScopesChild

type RemoteScopesChild struct {
	Type     string      `json:"type"`
	ParentId *string     `json:"parentId"`
	Id       string      `json:"id"`
	Name     string      `json:"name"`
	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[any]
}

type SearchRemoteScopesOutput

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

type ServiceResponse

type ServiceResponse struct {
	Offset   int           `json:"offset"`
	Limit    int           `json:"limit"`
	More     bool          `json:"more"`
	Total    int           `json:"total"`
	Services []raw.Service `json:"services"`
}

Jump to

Keyboard shortcuts

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