api

package
v0.9.265 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

View Source
const (
	AliasNameInvalid = "the alias name of %s must match " + RegularAliasName

	FunctionCodeInvalid       = "the code of function is invalidate"
	VersionInvalid            = "the version of function must match " + RegularVersion
	QualifierInvalid          = "the qualifier is not the function's version or alias"
	PaginateInvalid           = "the pagination must greater than 0"
	EventSourceTypeNotSupport = "the event source type: %s not support"
)
View Source
const (
	InvocationTypeEvent           InvocationType = "Event"
	InvocationTypeRequestResponse InvocationType = "RequestResponse"
	InvocationTypeDryRun          InvocationType = "DryRun"
	// 同步调用函数最大超时时间
	DefaultMaxFunctionTimeout = 300

	LogTypeTail LogType = "Tail"
	LogTypeNone LogType = "None"

	SourceTypeDuerOS  SourceType = "dueros"
	SourceTypeDuEdge  SourceType = "duedge"
	SourceTypeHTTP    SourceType = "cfc-http-trigger/v1/CFCAPI"
	SourceTypeCrontab SourceType = "cfc-crontab-trigger/v1/"
	SourceTypeCDN     SourceType = "cdn"

	TriggerTypeHTTP             TriggerType = "cfc-http-trigger"
	TriggerTypeGeneric          TriggerType = "generic"
	TypeEventSourceDatahubTopic             = "datahub_topic"
	TypeEventSourceBms                      = "bms"

	StartingPositionTriHorizon  = "TRIM_HORIZON"
	StartingPositionLatest      = "LATEST"
	StartingPositionAtTimeStamp = "AT_TIMESTAMP"

	DatahubTopicStartPointLatest = int64(-1)
	DatahubTopicStartPointOldest = int64(-2)
)
View Source
const (
	RegularFunctionName = `^[a-zA-Z0-9-_:]+|\$LATEST$`
	RegularAliasName    = `^[a-zA-Z0-9-_]+$`
	RegularFunctionBRN  = `^(brn:(bce[a-zA-Z-]*):cfc:)([a-z]{2,5}[0-9]*:)([0-9a-z]{32}:)(function:)([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?$`
	RegularVersion      = `^\$LATEST|([0-9]+)$`

	RegularFlowName      = `^[a-zA-Z_]{1}[a-zA-Z0-9_-]{0,63}$`
	RegularExecutionName = `^[a-zA-Z_0-9]{1}[a-zA-Z0-9_-]{0,63}$`
	FlowType             = "FDL"

	// Layer and Service validation patterns
	RegularLayerName   = `^[a-zA-Z0-9-_]+$`
	RegularServiceName = `^[a-zA-Z0-9-_]+$`

	MemoryBase = 128
)

Variables

View Source
var (
	URIIllegal      = errors.New("invalid request uri")
	MethodIllegal   = errors.New("invalid request method")
	InvalidArgument = errors.New("invalid arguments")
	ParseJsonError  = errors.New("could not parse payload into json")
)

Functions

func DeleteAlias

func DeleteAlias(cli bce.Client, args *DeleteAliasArgs) error

func DeleteEventSource added in v0.9.88

func DeleteEventSource(cli bce.Client, args *DeleteEventSourceArgs) error

func DeleteFlow added in v0.9.145

func DeleteFlow(cli bce.Client, flowName string) error

func DeleteFunction

func DeleteFunction(cli bce.Client, args *DeleteFunctionArgs) error

func DeleteLayer added in v0.9.233

func DeleteLayer(cli bce.Client, args *DeleteLayerArgs) error

func DeleteLayerVersion added in v0.9.233

func DeleteLayerVersion(cli bce.Client, args *DeleteLayerVersionArgs) error

func DeleteReservedConcurrentExecutions

func DeleteReservedConcurrentExecutions(cli bce.Client, args *DeleteReservedConcurrentExecutionsArgs) error

func DeleteService added in v0.9.233

func DeleteService(cli bce.Client, args *DeleteServiceArgs) error

func DeleteTrigger

func DeleteTrigger(cli bce.Client, args *DeleteTriggerArgs) error

func SetReservedConcurrentExecutions

func SetReservedConcurrentExecutions(cli bce.Client, args *ReservedConcurrentExecutionsArgs) error

Types

type Alias

type Alias struct {
	AliasBrn        string    `json:"AliasBrn"`
	AliasArn        string    `json:"AliasArn"`
	FunctionName    string    `json:"FunctionName"`
	FunctionVersion string    `json:"FunctionVersion"`
	Name            string    `json:"Name"`
	Description     string    `json:"Description"`
	Uid             string    `json:"Uid"`
	UpdatedAt       time.Time `json:"UpdatedAt"`
	CreatedAt       time.Time `json:"CreatedAt"`
}

type AsyncInvokeConfig added in v0.9.233

type AsyncInvokeConfig struct {
	MaxRetryIntervalInSeconds *int64             `json:"MaxRetryIntervalInSeconds"` // 消息最大保留时间
	MaxRetryAttempts          *int               `json:"MaxRetryAttempts"`          // 最大失败重试次数
	OnSuccess                 *DestinationConfig `json:"OnSuccess"`                 // 异步调用成功触发目标服务
	OnFailure                 *DestinationConfig `json:"OnFailure"`                 // 异步调用失败触发目标服务
}

type BosEventType

type BosEventType string
const (
	BosEventTypePutObject               BosEventType = "PutObject"
	BosEventTypePostObject              BosEventType = "PostObject"
	BosEventTypeAppendObject            BosEventType = "AppendObject"
	BosEventTypeCopyObject              BosEventType = "CopyObject"
	BosEventTypeCompleteMultipartObject BosEventType = "CompleteMultipartUpload"
)

type BosTriggerData

type BosTriggerData struct {
	Resource  string
	Status    string
	EventType []BosEventType
	Name      string
}

type CDNEventType

type CDNEventType string
const (
	CDNEventTypeCachedObjectsBlocked   CDNEventType = "CachedObjectsBlocked"
	CDNEventTypeCachedObjectsPushed    CDNEventType = "CachedObjectsPushed"
	CDNEventTypeCachedObjectsRefreshed CDNEventType = "CachedObjectsRefreshed"
	CDNEventTypeCdnDomainCreated       CDNEventType = "CdnDomainCreated"
	CDNEventTypeCdnDomainDeleted       CDNEventType = "CdnDomainDeleted"
	CDNEventTypeLogFileCreated         CDNEventType = "LogFileCreated"
	CDNEventTypeCdnDomainStarted       CDNEventType = "CdnDomainStarted"
	CDNEventTypeCdnDomainStopped       CDNEventType = "CdnDomainStopped"
)

type CDNTriggerData

type CDNTriggerData struct {
	EventType CDNEventType
	Domains   []string
	Remark    string
	Status    string
}

type CFCEdgeTriggerData added in v0.9.7

type CFCEdgeTriggerData struct {
	Domain    string
	EventType string
	Path      string
}

type CFSConfig added in v0.9.233

type CFSConfig struct {
	FsName     *string `json:"FsName"`     // 文件系统名称
	FsId       *string `json:"FsId"`       // 文件系统id
	SubnetID   *string `json:"SubnetID"`   // 子网ID
	Domain     *string `json:"Domain"`     // 挂载域名
	RemotePath *string `json:"RemotePath"` // CFS侧挂载路径
	LocalPath  *string `json:"LocalPath"`  // 本地目标路径
	Ovip       *string `json:"Ovip"`       // domain对应的外部虚拟ip
	VpcId      *string `json:"VpcId"`      // VPC Id
}

type CodeFile

type CodeFile struct {
	Publish   bool
	DryRun    bool
	ZipFile   []byte
	BosBucket string
	BosObject string
}

type CodeStorage

type CodeStorage struct {
	Location       string `json:"Location"`
	RepositoryType string `json:"RepositoryType"`
}

type CreateAliasArgs

type CreateAliasArgs struct {
	FunctionName    string
	FunctionVersion string
	Name            string
	Description     string
}

func (CreateAliasArgs) Validate

func (args CreateAliasArgs) Validate() error

type CreateAliasResult

type CreateAliasResult Alias

func CreateAlias

func CreateAlias(cli bce.Client, args *CreateAliasArgs) (*CreateAliasResult, error)

type CreateEventSourceArgs added in v0.9.88

type CreateEventSourceArgs FuncEventSource

func (CreateEventSourceArgs) Validate added in v0.9.88

func (args CreateEventSourceArgs) Validate() error

type CreateEventSourceResult added in v0.9.88

type CreateEventSourceResult FuncEventSource

func CreateEventSource added in v0.9.88

func CreateEventSource(cli bce.Client, args *CreateEventSourceArgs) (*CreateEventSourceResult, error)

CreateEventSource

type CreateFunctionArgs

type CreateFunctionArgs struct {
	Code               *CodeFile
	Publish            bool
	FunctionName       string
	Handler            string
	Runtime            string
	MemorySize         int
	Timeout            int
	Description        string
	Environment        *Environment
	VpcConfig          *VpcConfig
	LogType            string
	LogBosDir          string
	BlsLogSet          string
	ServiceName        string
	Region             string
	Version            string
	VersionDesc        string
	DeadLetterTopic    string
	LayerList          []*LayerSample `json:"Layers,omitempty"`
	PodConcurrentQuota int
	AsyncInvokeConfig  *AsyncInvokeConfig
	CFSConfig          *CFSConfig
	SourceTag          string
}

func (CreateFunctionArgs) Validate

func (args CreateFunctionArgs) Validate() error

type CreateFunctionByBlueprintArgs added in v0.9.147

type CreateFunctionByBlueprintArgs struct {
	BlueprintID  string
	ServiceName  string
	FunctionName string
	Environment  *Environment
}

func (CreateFunctionByBlueprintArgs) Validate added in v0.9.147

func (args CreateFunctionByBlueprintArgs) Validate() error

type CreateFunctionResult

type CreateFunctionResult Function

func CreateFunction

func CreateFunction(cli bce.Client, args *CreateFunctionArgs) (*CreateFunctionResult, error)

func CreateFunctionByBlueprint added in v0.9.147

func CreateFunctionByBlueprint(cli bce.Client, args *CreateFunctionByBlueprintArgs) (*CreateFunctionResult, error)

type CreateServiceArgs added in v0.9.233

type CreateServiceArgs struct {
	ServiceName string  `json:"ServiceName"`
	ServiceDesc *string `json:"ServiceDesc,omitempty"`
	ServiceConf string  `json:"ServiceConf,omitempty"`
	Region      string  `json:"Region,omitempty"`
}

func (CreateServiceArgs) Validate added in v0.9.233

func (args CreateServiceArgs) Validate() error

Service validation

type CreateServiceResult added in v0.9.233

type CreateServiceResult Service

func CreateService added in v0.9.233

func CreateService(cli bce.Client, args *CreateServiceArgs) (*CreateServiceResult, error)

type CreateTriggerArgs

type CreateTriggerArgs struct {
	Target string
	Source SourceType
	Data   interface{}
}

func (CreateTriggerArgs) Validate

func (args CreateTriggerArgs) Validate() error

type CreateTriggerResult

type CreateTriggerResult struct {
	Relation *RelationInfo
}

func CreateTrigger

func CreateTrigger(cli bce.Client, args *CreateTriggerArgs) (*CreateTriggerResult, error)

type CreateUpdateFlowArgs added in v0.9.145

type CreateUpdateFlowArgs struct {
	Name        string `json:"name"`
	Type        string `json:"type"` // 当前只支持 "FDL"
	Definition  string `json:"definition"`
	Description string `json:"description"`
}

func (CreateUpdateFlowArgs) Validate added in v0.9.145

func (args CreateUpdateFlowArgs) Validate() error

type CrontabTriggerData

type CrontabTriggerData struct {
	Brn                string
	Enabled            string
	Input              string
	Name               string
	ScheduleExpression string
}

type DatahubConfig added in v0.9.88

type DatahubConfig struct {
	MetaHostEndpoint string `json:"MetaHostEndpoint,omitempty"` // MetaHost endpoint
	MetaHostPort     int    `json:"MetaHostPort,omitempty"`     // MetaHost port
	ClusterName      string `json:"ClusterName,omitempty"`      // 集群名
	PipeName         string `json:"PipeName,omitempty"`         // pipe名
	PipeletNum       uint32 `json:"PipeletNum,omitempty"`       // 订阅PipiletNum
	StartPoint       int64  `json:"StartPoint,omitempty"`       // 起始订阅点  正常情况下id为正整数, 2个特殊的点 -1: 表示pipelet内的最新一条消息;-2: 表示pipelet内最旧的一条消息
	AclName          string `json:"ACLName,omitempty"`          // ACL name
	AclPassword      string `json:"ACLPassword,omitempty"`      // ACL passwd
}

type DeleteAliasArgs

type DeleteAliasArgs struct {
	FunctionName string
	AliasName    string
}

func (DeleteAliasArgs) Validate

func (args DeleteAliasArgs) Validate() error

type DeleteEventSourceArgs added in v0.9.88

type DeleteEventSourceArgs struct {
	UUID string
}

func (DeleteEventSourceArgs) Validate added in v0.9.88

func (args DeleteEventSourceArgs) Validate() error

type DeleteFunctionArgs

type DeleteFunctionArgs struct {
	FunctionName string
	Qualifier    string
}

func (DeleteFunctionArgs) Validate

func (args DeleteFunctionArgs) Validate() error

type DeleteLayerArgs added in v0.9.233

type DeleteLayerArgs struct {
	LayerName string
}

func (DeleteLayerArgs) Validate added in v0.9.233

func (args DeleteLayerArgs) Validate() error

DeleteLayerArgs validation

type DeleteLayerVersionArgs added in v0.9.233

type DeleteLayerVersionArgs struct {
	LayerName     string
	VersionNumber string
}

func (DeleteLayerVersionArgs) Validate added in v0.9.233

func (args DeleteLayerVersionArgs) Validate() error

DeleteLayerVersionArgs validation

type DeleteReservedConcurrentExecutionsArgs

type DeleteReservedConcurrentExecutionsArgs struct {
	FunctionName string
}

func (DeleteReservedConcurrentExecutionsArgs) Validate

type DeleteServiceArgs added in v0.9.233

type DeleteServiceArgs struct {
	ServiceName string `json:"ServiceName"`
}

func (DeleteServiceArgs) Validate added in v0.9.233

func (args DeleteServiceArgs) Validate() error

type DeleteServiceResult added in v0.9.233

type DeleteServiceResult Service

type DeleteTriggerArgs

type DeleteTriggerArgs struct {
	RelationId string
	Target     string
	Source     SourceType
}

func (DeleteTriggerArgs) Validate

func (args DeleteTriggerArgs) Validate() error

type Destination added in v0.9.233

type Destination struct {
	Destination string `json:"destination,omitempty"`
}

type DestinationConfig added in v0.9.233

type DestinationConfig struct {
	Type        string `json:"Type"`        // 触发目标服务类型,kafka of cfc
	Destination string `json:"Destination"` // 目标服务,topic or 函数brn
}

type Environment

type Environment struct {
	Variables map[string]string
}

type Execution added in v0.9.145

type Execution struct {
	Name           string `json:"name"`
	Status         string `json:"status"`
	FlowName       string `json:"flowName"`
	FlowDefinition string `json:"flowDefinition"`
	Input          string `json:"input"`
	Output         string `json:"output"`
	StartedTime    int64  `json:"startedTime"`
	StoppedTime    int64  `json:"stoppedTime"`
}

func DescribeExecution added in v0.9.145

func DescribeExecution(cli bce.Client, flowName, executionName string) (*Execution, error)

func StartExecution added in v0.9.145

func StartExecution(cli bce.Client, args *StartExecutionArgs) (*Execution, error)

func StopExecution added in v0.9.145

func StopExecution(cli bce.Client, flowName, executionName string) (*Execution, error)

type ExecutionEvent added in v0.9.145

type ExecutionEvent struct {
	CostTime    int64  `json:"costTime"`
	EventDetail string `json:"eventDetail"`
	EventId     string `json:"eventId"`
	ExecutionId string `json:"executionId"`
	StateName   string `json:"stateName"`
	Time        int64  `json:"time"`
	Type        string `json:"type"`
}

type Flow added in v0.9.145

type Flow struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Definition  string `json:"definition"`
	Description string `json:"description"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
}

func CreateFlow added in v0.9.145

func CreateFlow(cli bce.Client, args *CreateUpdateFlowArgs) (*Flow, error)

func DescribeFlow added in v0.9.145

func DescribeFlow(cli bce.Client, flowName string) (*Flow, error)

func UpdateFlow added in v0.9.145

func UpdateFlow(cli bce.Client, args *CreateUpdateFlowArgs) (*Flow, error)

type FuncEventSource added in v0.9.88

type FuncEventSource struct {
	Uuid                      string     `json:"UUID"`
	BatchSize                 int        //  一次最多消费多少条消息
	Enabled                   *bool      `json:"Enabled,omitempty"` //是否开启消息触发器
	FunctionBrn               string     //  绑定的function brn
	EventSourceBrn            string     //  百度消息触发器bms kafka的topic名;Datahub触发器的配置唯一标识符,无需用户传入,服务端自动生成
	FunctionArn               string     //  兼容aws,与FunctionBrn相同
	EventSourceArn            string     //  兼容aws,与EventSourceBrn相同
	Type                      string     `json:"Type,omitempty"`                      // 类型 bms/datahub_topic
	FunctionName              string     `json:"FunctionName,omitempty"`              // 函数brn或者函数名
	StartingPosition          string     `json:"StartingPosition,omitempty"`          // 百度消息触发器bms kalfka topic 起始位置
	StartingPositionTimestamp *time.Time `json:"StartingPositionTimestamp,omitempty"` // 百度消息触发器bms kalfka topic 起始时间
	StateTransitionReason     string     // 状态变更原因
	DatahubConfig                        // Datahub触发器相关配置

	State                string    `json:"State"`                  // 消息触发器状态,开启或关闭,与aws兼容
	LastProcessingResult string    `json:"LastProcessingResult"`   // 最新一次触发器的执行结果
	LastModified         time.Time `json:"LastModified,omitempty"` // 上次修改时间
}

EventSource

type Function

type Function struct {
	Uid                string             `json:"Uid"`
	Description        string             `json:"Description"`
	FunctionBrn        string             `json:"FunctionBrn"`
	Region             string             `json:"Region"`
	Timeout            int                `json:"Timeout"`
	VersionDesc        string             `json:"VersionDesc"`
	UpdatedAt          time.Time          `json:"UpdatedAt"`
	LastModified       time.Time          `json:"LastModified"`
	BlueprintTag       string             `json:"BlueprintTag"`
	CodeSha256         string             `json:"CodeSha256"`
	CodeSize           int32              `json:"CodeSize"`
	FunctionArn        string             `json:"FunctionArn"`
	FunctionName       string             `json:"FunctionName"`
	ServiceName        string             `json:"ServiceName"`
	Handler            string             `json:"Handler"`
	Version            string             `json:"Version"`
	Runtime            string             `json:"Runtime"`
	MemorySize         int                `json:"MemorySize"`
	Environment        *Environment       `json:"Environment"`
	CommitID           string             `json:"CommitID"`
	CodeID             string             `json:"CodeID"`
	Role               string             `json:"Role"`
	VpcConfig          *VpcConfig         `json:"VpcConfig"`
	LogType            string             `json:"LogType"`
	LogBosDir          string             `json:"LogBosDir"`
	BlsLogSet          string             `json:"BlsLogSet"`
	SourceTag          string             `json:"SourceTag"`
	DeadLetterTopic    string             `json:"DeadLetterTopic"`
	LayerList          []*LayerSample     `json:"Layers"`
	PodConcurrentQuota int                `json:"PodConcurrentQuota"`
	AsyncInvokeConfig  *AsyncInvokeConfig `json:"AsyncInvokeConfig"`
	CFSConfig          *CFSConfig         `json:"CFSConfig"`
}

type FunctionInfo

type FunctionInfo struct {
	Code          *CodeStorage `json:"Code"`
	Publish       bool         `json:"Publish"`
	Configuration *Function    `json:"Configuration"`
}

functionInfo

type GetAliasArgs

type GetAliasArgs struct {
	FunctionName string
	AliasName    string
}

func (GetAliasArgs) Validate

func (args GetAliasArgs) Validate() error

type GetAliasResult

type GetAliasResult Alias

func GetAlias

func GetAlias(cli bce.Client, args *GetAliasArgs) (*GetAliasResult, error)

type GetEventSourceArgs added in v0.9.88

type GetEventSourceArgs struct {
	UUID string
}

func (GetEventSourceArgs) Validate added in v0.9.88

func (args GetEventSourceArgs) Validate() error

type GetEventSourceResult added in v0.9.88

type GetEventSourceResult FuncEventSource

func GetEventSource added in v0.9.88

func GetEventSource(cli bce.Client, args *GetEventSourceArgs) (*GetEventSourceResult, error)

GetEventSource

type GetExecutionHistoryArgs added in v0.9.145

type GetExecutionHistoryArgs struct {
	FlowName      string `json:"name"`
	ExecutionName string `json:"type"`
	Limit         int    `json:"limit"`
}

func (GetExecutionHistoryArgs) Validate added in v0.9.145

func (args GetExecutionHistoryArgs) Validate() error

type GetExecutionHistoryResult added in v0.9.145

type GetExecutionHistoryResult struct {
	Events []*ExecutionEvent `json:"events"`
}

func GetExecutionHistory added in v0.9.145

func GetExecutionHistory(cli bce.Client, args *GetExecutionHistoryArgs) (*GetExecutionHistoryResult, error)

type GetFunctionArgs

type GetFunctionArgs struct {
	FunctionName string
	Qualifier    string
}

func (GetFunctionArgs) Validate

func (args GetFunctionArgs) Validate() error

type GetFunctionConfigurationArgs

type GetFunctionConfigurationArgs struct {
	FunctionName string
	Qualifier    string
}

func (GetFunctionConfigurationArgs) Validate

func (args GetFunctionConfigurationArgs) Validate() error

type GetFunctionConfigurationResult

type GetFunctionConfigurationResult Function

type GetFunctionResult

type GetFunctionResult struct {
	Code          CodeStorage
	Configuration Function
}

func GetFunction

func GetFunction(cli bce.Client, args *GetFunctionArgs) (*GetFunctionResult, error)

type GetLayerVersionArgs added in v0.9.233

type GetLayerVersionArgs struct {
	Brn           string
	LayerName     string
	VersionNumber string
	// contains filtered or unexported fields
}

func (GetLayerVersionArgs) Validate added in v0.9.233

func (args GetLayerVersionArgs) Validate() error

GetLayerVersionArgs validation

type GetLayerVersionOutput added in v0.9.233

type GetLayerVersionOutput struct {
	CompatibleRuntimes []string                   `json:"CompatibleRuntimes,omitempty"`
	Content            *LayerVersionContentOutput `json:"Content,omitempty"`
	CreatedDate        string                     `json:"CreatedDate,omitempty"`
	Description        string                     `json:"Description,omitempty"`
	LayerBrn           string                     `json:"LayerBrn,omitempty"`
	LayerVersionBrn    string                     `json:"LayerVersionBrn,omitempty"`
	LicenseInfo        string                     `json:"LicenseInfo,omitempty"`
	Version            int64                      `json:"Version,omitempty"`
}

func GetLayerVersion added in v0.9.233

func GetLayerVersion(cli bce.Client, args *GetLayerVersionArgs) (*GetLayerVersionOutput, error)

func GetLayerVersionByBrn added in v0.9.233

func GetLayerVersionByBrn(cli bce.Client, args *GetLayerVersionArgs) (*GetLayerVersionOutput, error)

type GetServiceArgs added in v0.9.233

type GetServiceArgs struct {
	ServiceName string `json:"ServiceName"`
}

func (GetServiceArgs) Validate added in v0.9.233

func (args GetServiceArgs) Validate() error

type GetServiceResult added in v0.9.233

type GetServiceResult Service

func GetService added in v0.9.233

func GetService(cli bce.Client, args *GetServiceArgs) (*GetServiceResult, error)

type GetWorkflowResult added in v0.9.145

type GetWorkflowResult struct {
	Code          CodeStorage
	Configuration Function
}

type HTTPMethod

type HTTPMethod = string
const (
	GET     HTTPMethod = "GET"
	PUT     HTTPMethod = "PUT"
	POST    HTTPMethod = "POST"
	DELETE  HTTPMethod = "DELETE"
	HEAD    HTTPMethod = "HEAD"
	OPTIONS HTTPMethod = "OPTIONS"
)

type HttpTriggerData

type HttpTriggerData struct {
	ResourcePath string
	Method       string
	AuthType     string
}

type InvocationType

type InvocationType string

type InvocationsArgs

type InvocationsArgs struct {
	FunctionName   string
	InvocationType InvocationType
	LogType        LogType
	Qualifier      string
	Payload        interface{}
	RequestId      string
}

func (InvocationsArgs) Validate

func (args InvocationsArgs) Validate() error

type InvocationsResult

type InvocationsResult struct {
	Payload       string
	FunctionError string
	LogResult     string
}

func Invocations

func Invocations(cli bce.Client, args *InvocationsArgs) (*InvocationsResult, error)

type LayerSample added in v0.9.233

type LayerSample struct {
	Brn         string                     `json:"Brn,omitempty"`
	CodeSize    int64                      `json:"CodeSize,omitempty"`
	Description string                     `json:"Description,omitempty"`
	Version     int64                      `json:"Version,omitempty"`
	LayerName   string                     `json:"LayerName,omitempty"`
	Content     *LayerVersionContentOutput `json:"Content,omitempty"`
}

type LayerVersionContentInput added in v0.9.233

type LayerVersionContentInput struct {
	BosBucket string `json:"BosBucket,omitempty"`
	BosObject string `json:"BosObject,omitempty"`
	ZipFile   string `json:"ZipFile,omitempty"`
}

type LayerVersionContentOutput added in v0.9.233

type LayerVersionContentOutput struct {
	CodeSha256 string `json:"CodeSha256,omitempty"`
	CodeSize   int64  `json:"CodeSize,omitempty"`
	Location   string `json:"Location,omitempty"`
}

type LayerVersionsListItem added in v0.9.233

type LayerVersionsListItem struct {
	CompatibleRuntimes []string `json:"CompatibleRuntimes,omitempty"`
	CreatedDate        string   `json:"CreatedDate,omitempty"`
	Description        string   `json:"Description,omitempty"`
	LayerVersionBrn    string   `json:"LayerVersionBrn,omitempty"`
	LicenseInfo        string   `json:"LicenseInfo,omitempty"`
	Version            int64    `json:"Version,omitempty"`
}

type LayersListItem added in v0.9.233

type LayersListItem struct {
	LatestMatchingVersion *LayerVersionsListItem `json:"LatestMatchingVersion,omitempty"`
	LayerBrn              string                 `json:"LayerBrn,omitempty"`
	LayerName             string                 `json:"LayerName,omitempty"`
}

type ListAliasesArgs

type ListAliasesArgs struct {
	FunctionName    string
	FunctionVersion string
	Marker          int
	MaxItems        int
}

func (ListAliasesArgs) Validate

func (args ListAliasesArgs) Validate() error

type ListAliasesResult

type ListAliasesResult struct {
	Aliases    []*Alias
	NextMarker string
}

func ListAliases

func ListAliases(cli bce.Client, args *ListAliasesArgs) (*ListAliasesResult, error)

type ListCondition added in v0.9.233

type ListCondition struct {
	PageNo   int64 `json:"PageNo,omitempty"`
	PageSize int64 `json:"PageSize,omitempty"`
	Marker   int64 `json:"Marker,omitempty"`
	MaxItems int64 `json:"MaxItems,omitempty"`
}

type ListEventSourceArgs added in v0.9.88

type ListEventSourceArgs struct {
	FunctionName string
	Marker       int
	MaxItems     int
}

func (ListEventSourceArgs) Validate added in v0.9.88

func (args ListEventSourceArgs) Validate() error

type ListEventSourceResult added in v0.9.88

type ListEventSourceResult struct {
	EventSourceMappings []FuncEventSource
}

func ListEventSource added in v0.9.88

func ListEventSource(cli bce.Client, args *ListEventSourceArgs) (*ListEventSourceResult, error)

ListEventSource

type ListExecutionsResult added in v0.9.145

type ListExecutionsResult struct {
	Total      int         `json:"total"`
	Executions []Execution `json:"executions"`
}

func ListExecutions added in v0.9.145

func ListExecutions(cli bce.Client, flowName string) (*ListExecutionsResult, error)

type ListFlowResult added in v0.9.145

type ListFlowResult struct {
	Flows []*struct {
		Name             string `json:"name"`
		Type             string `json:"type"`
		LastModifiedTime string `json:"lastModifiedTime"`
		Description      string `json:"description"`
		Definition       string `json:"definition"`
		CreatedTime      string `json:"createdTime"`
	} `json:"flows"`
}

func ListFlow added in v0.9.145

func ListFlow(cli bce.Client) (*ListFlowResult, error)

type ListFunctionsArgs

type ListFunctionsArgs struct {
	FunctionVersion string
	Marker          int
	MaxItems        int
}

func (ListFunctionsArgs) Validate

func (args ListFunctionsArgs) Validate() error

type ListFunctionsResult

type ListFunctionsResult struct {
	Functions  []*Function
	NextMarker string
}

func ListFunctions

func ListFunctions(cli bce.Client, args *ListFunctionsArgs) (*ListFunctionsResult, error)

type ListLayerInput added in v0.9.234

type ListLayerInput struct {
	CompatibleRuntime string `json:"CompatibleRuntime,omitempty"`
	*ListCondition
}

func (ListLayerInput) Validate added in v0.9.234

func (args ListLayerInput) Validate() error

ListLayerVersionsInput validation

type ListLayerVersionsInput added in v0.9.233

type ListLayerVersionsInput struct {
	CompatibleRuntime string `json:"CompatibleRuntime,omitempty"`
	LayerName         string `json:"LayerName" valid:"required"`
	*ListCondition
}

func (ListLayerVersionsInput) Validate added in v0.9.233

func (args ListLayerVersionsInput) Validate() error

type ListLayerVersionsOutput added in v0.9.234

type ListLayerVersionsOutput struct {
	LayerVersions []*LayerVersionsListItem
	NextMarker    string
	Total         int64
	PageNo        int64 `json:"pageNo"`
	PageSize      int64 `json:"pageSize"`
}

func ListLayerVersions added in v0.9.234

func ListLayerVersions(cli bce.Client, args *ListLayerVersionsInput) (*ListLayerVersionsOutput, error)

type ListLayersOutput added in v0.9.233

type ListLayersOutput struct {
	Layers     []*LayersListItem `json:"Layers,omitempty"`
	NextMarker string            `json:"NextMarker,omitempty"`
	Total      int64             `json:"Total,omitempty"`
	PageNo     int64             `json:"PageNo"`
	PageSize   int64             `json:"PageSize"`
}

func ListLayers added in v0.9.233

func ListLayers(cli bce.Client, args *ListLayerInput) (*ListLayersOutput, error)

type ListServicesResult added in v0.9.233

type ListServicesResult struct {
	Services []*Service `json:"Services"`
}

func ListServices added in v0.9.233

func ListServices(cli bce.Client) (*ListServicesResult, error)

type ListTriggersArgs

type ListTriggersArgs struct {
	FunctionBrn string
	ScopeType   string
}

func (ListTriggersArgs) Validate

func (args ListTriggersArgs) Validate() error

type ListTriggersResult

type ListTriggersResult struct {
	Relation []*RelationInfo
}

func ListTriggers

func ListTriggers(cli bce.Client, args *ListTriggersArgs) (*ListTriggersResult, error)

type ListVersionsByFunctionArgs

type ListVersionsByFunctionArgs struct {
	FunctionName string
	Marker       int
	MaxItems     int
}

func (ListVersionsByFunctionArgs) Validate

func (args ListVersionsByFunctionArgs) Validate() error

type ListVersionsByFunctionResult

type ListVersionsByFunctionResult struct {
	Versions   []*Function
	NextMarker string
}

type LogType

type LogType string

type Operation

type Operation struct {
	HTTPMethod HTTPMethod
	HTTPUri    string
}

type PublishLayerVersionInput added in v0.9.233

type PublishLayerVersionInput struct {
	CompatibleRuntimes []string                  `json:"CompatibleRuntimes,omitempty"`
	Content            *LayerVersionContentInput `json:"Content" valid:"required"`
	Description        string                    `json:"Description,omitempty" valid:"optional,runelength(0|256)"`
	LayerName          string                    `json:"LayerName" valid:"required,matches(^[a-zA-Z0-9-_]+$),runelength(0|140)"`
	LicenseInfo        string                    `json:"LicenseInfo,omitempty" valid:"optional,runelength(0|512)"`
	SourceTag          string                    `json:"SourceTag,omitempty" valid:"optional,runelength(0|128)"`
	Version            int64                     `json:"Version,omitempty" valid:"optional"`
}

func (PublishLayerVersionInput) Validate added in v0.9.233

func (args PublishLayerVersionInput) Validate() error

type PublishLayerVersionOutput added in v0.9.233

type PublishLayerVersionOutput struct {
	CompatibleRuntimes []string                   `json:"CompatibleRuntimes,omitempty"`
	Content            *LayerVersionContentOutput `json:"Content,omitempty"`
	CreatedDate        string                     `json:"CreatedDate,omitempty"`
	Description        string                     `json:"Description,omitempty"`
	LayerBrn           string                     `json:"LayerBrn,omitempty"`
	LayerVersionBrn    string                     `json:"LayerVersionBrn,omitempty"`
	LicenseInfo        string                     `json:"LicenseInfo,omitempty"`
	Version            int64                      `json:"Version,omitempty"`
}

func PublishLayerVersion added in v0.9.233

func PublishLayerVersion(cli bce.Client, args *PublishLayerVersionInput) (*PublishLayerVersionOutput, error)

type PublishVersionArgs

type PublishVersionArgs struct {
	FunctionName string
	Description  string
	CodeSha256   string
}

func (PublishVersionArgs) Validate

func (args PublishVersionArgs) Validate() error

type PublishVersionResult

type PublishVersionResult Function

func PublishVersion

func PublishVersion(cli bce.Client, args *PublishVersionArgs) (*PublishVersionResult, error)

type RelationInfo

type RelationInfo struct {
	RelationId string      `json:"RelationId"`
	Sid        string      `json:"Sid"`
	Source     SourceType  `json:"Source"`
	Target     string      `json:"Target"`
	Data       interface{} `json:"Data"`
}

type ReservedConcurrentExecutionsArgs

type ReservedConcurrentExecutionsArgs struct {
	FunctionName                 string
	ReservedConcurrentExecutions int
}

func (ReservedConcurrentExecutionsArgs) Validate

func (args ReservedConcurrentExecutionsArgs) Validate() error

type Service added in v0.9.233

type Service struct {
	Uid           string                 `json:"Uid,omitempty"`
	ServiceName   string                 `json:"ServiceName" valid:"optional,matches(^[a-zA-Z0-9-_]+$),runelength(1|50)"`
	ServiceDesc   *string                `json:"ServiceDesc,omitempty"`
	ServiceConf   string                 `json:"ServiceConf,omitempty"`
	ServiceConfig map[string]interface{} `json:"ServiceConfig,omitempty"`
	Region        string                 `json:"Region,omitempty"`
	Status        int                    `json:"Status,omitempty"`
	UpdatedAt     time.Time              `json:"UpdatedAt,omitempty"`
	CreatedAt     time.Time              `json:"CreatedAt,omitempty"`
}

type ServiceWithFun added in v0.9.233

type ServiceWithFun struct {
	Service
	FuncCount int `json:"FuncCount,omitempty"`
}

ServiceWithFun represents a service with function count information

type SourceType

type SourceType string

type StartExecutionArgs added in v0.9.145

type StartExecutionArgs struct {
	FlowName      string `json:"flowName,omitempty"`      // flowName
	ExecutionName string `json:"executionName,omitempty"` // executionName
	Input         string `json:"input,omitempty"`         // input
}

func (StartExecutionArgs) Validate added in v0.9.145

func (args StartExecutionArgs) Validate() error

type TriggerType

type TriggerType string

type UpdateAliasArgs

type UpdateAliasArgs struct {
	FunctionName    string
	AliasName       string
	FunctionVersion string
	Description     string
}

func (UpdateAliasArgs) Validate

func (args UpdateAliasArgs) Validate() error

type UpdateAliasResult

type UpdateAliasResult Alias

func UpdateAlias

func UpdateAlias(cli bce.Client, args *UpdateAliasArgs) (*UpdateAliasResult, error)

type UpdateEventSourceArgs added in v0.9.88

type UpdateEventSourceArgs struct {
	UUID            string
	FuncEventSource FuncEventSource
}

func (UpdateEventSourceArgs) Validate added in v0.9.88

func (args UpdateEventSourceArgs) Validate() error

type UpdateEventSourceResult added in v0.9.88

type UpdateEventSourceResult FuncEventSource

func UpdateEventSource added in v0.9.88

func UpdateEventSource(cli bce.Client, args *UpdateEventSourceArgs) (*UpdateEventSourceResult, error)

UpdateEventSource

type UpdateFunctionCodeArgs

type UpdateFunctionCodeArgs struct {
	FunctionName string
	ZipFile      []byte
	Publish      bool
	DryRun       bool
	BosBucket    string
	BosObject    string
}

func (UpdateFunctionCodeArgs) Validate

func (args UpdateFunctionCodeArgs) Validate() error

type UpdateFunctionCodeResult

type UpdateFunctionCodeResult Function

type UpdateFunctionConfigurationArgs

type UpdateFunctionConfigurationArgs struct {
	FunctionName string
	Timeout      int `json:"Timeout,omitempty"`
	MemorySize   int `json:"MemorySize,omitempty"`
	Description  string
	Handler      string
	Runtime      string
	Environment  *Environment
	VpcConfig    *VpcConfig
	LogType      string
	LogBosDir    string
}

func (UpdateFunctionConfigurationArgs) Validate

func (args UpdateFunctionConfigurationArgs) Validate() error

type UpdateFunctionConfigurationResult

type UpdateFunctionConfigurationResult Function

type UpdateServiceArgs added in v0.9.233

type UpdateServiceArgs struct {
	ServiceName string  `json:"ServiceName"`
	ServiceDesc *string `json:"ServiceDesc,omitempty"`
	ServiceConf string  `json:"ServiceConf,omitempty"`
	Region      string  `json:"Region,omitempty"`
}

func (UpdateServiceArgs) Validate added in v0.9.233

func (args UpdateServiceArgs) Validate() error

type UpdateServiceResult added in v0.9.233

type UpdateServiceResult Service

func UpdateService added in v0.9.233

func UpdateService(cli bce.Client, args *UpdateServiceArgs) (*UpdateServiceResult, error)

type UpdateTriggerArgs

type UpdateTriggerArgs struct {
	RelationId string
	Target     string
	Source     SourceType
	Data       interface{}
}

func (UpdateTriggerArgs) Validate

func (args UpdateTriggerArgs) Validate() error

type UpdateTriggerResult

type UpdateTriggerResult struct {
	Relation *RelationInfo
}

func UpdateTrigger

func UpdateTrigger(cli bce.Client, args *UpdateTriggerArgs) (*UpdateTriggerResult, error)

type Validator

type Validator interface {
	Validate() error
}

type VpcConfig

type VpcConfig struct {
	VpcId            string
	SubnetIds        []string
	SecurityGroupIds []string
}

Jump to

Keyboard shortcuts

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