controlhub

package
v0.0.0-...-ec16f60 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	DefaultBaseUrl              = "http://localhost:18631"
	AllLabel                    = "all"
	JobRunnerApp                = "jobrunner-app"
	TimeSeriesApp               = "timeseries-app"
	DefaultPingFrequency        = 5000
	DefaultStatusEventsInterval = 60000
)
View Source
const (
	VALIDATE_PIPELINE                 = 1000
	SAVE_PIPELINE                     = 1001
	SAVE_RULES_PIPELINE               = 1002
	START_PIPELINE                    = 1003
	STOP_PIPELINE                     = 1004
	RESET_OFFSET_PIPELINE             = 1005
	DELETE_PIPELINE                   = 1006
	DELETE_HISTORY_PIPELINE           = 1007
	PING_FREQUENCY_ADJUSTMENT         = 1008
	STOP_DELETE_PIPELINE              = 1009
	SSO_DISCONNECTED_MODE_CREDENTIALS = 1010
	SYNC_ACL                          = 1011
	STATUS_PIPELINE                   = 2000
	SDC_INFO_EVENT                    = 2001
	STATUS_MULTIPLE_PIPELINES         = 2002
	SDC_PROCESS_METRICS_EVENT         = 2003
	ACK_EVENT                         = 5000

	ACK_EVENT_SUCCESS = "SUCCESS"
	ACK_EVENT_ERROR   = "ERROR"
	ACK_EVENT_IGNORE  = "IGNORE"
)
View Source
const (
	RegistrationUrlPath    = "/security/public-rest/v1/components/registration"
	LoginUrlPath           = "/security/public-rest/v1/authentication/login"
	CreateComponentUrlPath = "/security/rest/v1/organization/%s/components"
	EdgeComponentType      = "dc-edge"
	FullAuthTokenProp      = "fullAuthToken"
	PostRequest            = "POST"
	PutRequest             = "PUT"
)
View Source
const (
	MessagingUrlPath = "/messaging/rest/v1/events"
)

Variables

This section is empty.

Functions

func EnableControlHub

func EnableControlHub(
	controlHubUrl string,
	controlHubUser string,
	controlHubPassword string,
	controlHubUserToken string,
) (string, error)

func RegisterWithControlHub

func RegisterWithControlHub(
	schConfig Config,
	buildInfo *common.BuildInfo,
	runtimeInfo *common.RuntimeInfo,
)

Types

type AckEvent

type AckEvent struct {
	AckEventStatus string `json:"ackEventStatus"`
	Message        string `json:"message"`
}

type Attributes

type Attributes struct {
	BaseHttpUrl     string `json:"baseHttpUrl"`
	Sdc2GoGoVersion string `json:"sdc2goGoVersion"`
	Sdc2GoGoOS      string `json:"sdc2goGoOS"`
	Sdc2GoGoArch    string `json:"sdc2goGoArch"`
	Sdc2GoBuildDate string `json:"sdc2goBuildDate"`
	Sdc2GoRepoSha   string `json:"sdc2goRepoSha"`
	Sdc2GoVersion   string `json:"sdc2goVersion"`
}

type ClientEvent

type ClientEvent struct {
	EventId      string   `json:"eventId"`
	Destinations []string `json:"destinations"`
	RequiresAck  bool     `json:"requiresAck"`
	IsAckEvent   bool     `json:"ackEvent"`
	EventTypeId  int      `json:"eventTypeId"`
	Payload      string   `json:"payload"`
	OrgId        string   `json:"orgId"`
}

type Config

type Config struct {
	Enabled                bool     `toml:"enabled"`
	BaseUrl                string   `toml:"base-url"`
	AppAuthToken           string   `toml:"app-auth-token"`
	JobLabels              []string `toml:"job-labels"`
	EventsRecipient        string   `toml:"events-recipient"`
	ProcessEventsRecipient []string `toml:"process-events-recipients"`
	PingFrequency          int      `toml:"ping-frequency"`
	StatusEventsInterval   int      `toml:"status-events-interval"`
}

func NewConfig

func NewConfig() Config

NewConfig returns a new Config with default settings.

type MessageEventHandler

type MessageEventHandler struct {
	// contains filtered or unexported fields
}

func NewMessageEventHandler

func NewMessageEventHandler(
	schConfig Config,
	buildInfo *common.BuildInfo,
	runtimeInfo *common.RuntimeInfo,
	pipelineStoreTask store.PipelineStoreTask,
	manager manager.Manager,
) *MessageEventHandler

func (*MessageEventHandler) Init

func (m *MessageEventHandler) Init()

func (*MessageEventHandler) SendEvent

func (m *MessageEventHandler) SendEvent(sendInfoEvent bool) error

func (*MessageEventHandler) Shutdown

func (m *MessageEventHandler) Shutdown()

type PipelineBaseEvent

type PipelineBaseEvent struct {
	Name string `json:"name"`
	Rev  string `json:"rev"`
	User string `json:"user"`
}

type PipelineConfigurationAndRules

type PipelineConfigurationAndRules struct {
	PipelineConfig string `json:"pipelineConfig"`
	PipelineRules  string `json:"pipelineRules"`
}

type PipelineSaveEvent

type PipelineSaveEvent struct {
	Name                          string                        `json:"name"`
	Rev                           string                        `json:"rev"`
	User                          string                        `json:"user"`
	PipelineConfigurationAndRules PipelineConfigurationAndRules `json:"pipelineConfigurationAndRules"`
	Description                   string                        `json:"description"`
	Offset                        string                        `json:"offset"`
	OffsetProtocolVersion         float64                       `json:"offsetProtocolVersion"`
	Acl                           interface{}                   `json:"acl"`
}

type PipelineStatusEvent

type PipelineStatusEvent struct {
	Name                  string      `json:"name"`
	Title                 string      `json:"title"`
	Rev                   string      `json:"rev"`
	TimeStamp             int64       `json:"timeStamp"`
	IsRemote              bool        `json:"remote"`
	PipelineStatus        string      `json:"pipelineStatus"`
	Message               string      `json:"message"`
	WorkerInfos           interface{} `json:"workerInfos"`
	ValidationStatus      interface{} `json:"validationStatus"`
	Issues                string      `json:"issues"`
	IsClusterMode         bool        `json:"clusterMode"`
	Offset                string      `json:"offset"`
	OffsetProtocolVersion float64     `json:"offsetProtocolVersion"`
	Acl                   interface{} `json:"acl"`
	RunnerCount           float64     `json:"runnerCount"`
}

type PipelineStatusEvents

type PipelineStatusEvents struct {
	PipelineStatusEventList []*PipelineStatusEvent `json:"pipelineStatusEventList"`
}

type RegistrationData

type RegistrationData struct {
	AuthToken   string     `json:"authToken"`
	ComponentId string     `json:"componentId"`
	Attributes  Attributes `json:"attributes"`
}

type SDCInfoEvent

type SDCInfoEvent struct {
	EdgeId        string            `json:"sdcId"`
	HttpUrl       string            `json:"httpUrl"`
	GoVersion     string            `json:"javaVersion"`
	EdgeBuildInfo *common.BuildInfo `json:"sdcBuildInfo"`
	Labels        []string          `json:"labels"`
	Edge          bool              `json:"edge"`
	TotalMemory   uint64            `json:"totalMemory"`
}

type SDCProcessMetricsEvent

type SDCProcessMetricsEvent struct {
	Timestamp  int64   `json:"timestamp"`
	SdcId      string  `json:"sdcId"`
	CpuLoad    float64 `json:"cpuLoad"`
	UsedMemory uint64  `json:"usedMemory"`
}

type ServerEvent

type ServerEvent struct {
	EventId      string `json:"eventId"`
	From         string `json:"from"`
	RequiresAck  bool   `json:"requiresAck"`
	IsAckEvent   bool   `json:"isAckEvent"`
	EventTypeId  int    `json:"eventTypeId"`
	Payload      string `json:"payload"`
	ReceivedTime int64  `json:"receivedTime"`
	OrgId        string `json:"orgId"`
}

Jump to

Keyboard shortcuts

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