nificlient

package
v0.4.2-alpha-release Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright 2020 Orange SA

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.package apis

Index

Constants

View Source
const (
	PRIMARY_NODE        = "Primary Node"
	CLUSTER_COORDINATOR = "Cluster Coordinator"
)

Variables

View Source
var ErrNifiClusterNodeNotFound = errors.New("The target node id doesn't exist in the cluster")
View Source
var ErrNifiClusterNotReturned200 = errors.New("non 200 response from NiFi cluster")
View Source
var ErrNifiClusterNotReturned201 = errors.New("non 201 response from NiFi cluster")
View Source
var ErrNifiClusterReturned404 = errors.New("404 response from NiFi cluster")
View Source
var ErrNoNodeClientsAvailable = errors.New("Cannot create a node client to perform actions")
View Source
var ErrNodeNotConnected = errors.New("The targeted node id disconnected")

Functions

func UseSSL

func UseSSL(cluster *v1alpha1.NifiCluster) bool

Types

type NifiClient

type NifiClient interface {
	// System func
	DescribeCluster() (*nigoapi.ClusterEntity, error)
	DisconnectClusterNode(nId int32) (*nigoapi.NodeEntity, error)
	ConnectClusterNode(nId int32) (*nigoapi.NodeEntity, error)
	OffloadClusterNode(nId int32) (*nigoapi.NodeEntity, error)
	RemoveClusterNode(nId int32) error
	GetClusterNode(nId int32) (*nigoapi.NodeEntity, error)
	RemoveClusterNodeFromClusterNodeId(nId string) error

	// Registry client func
	GetRegistryClient(id string) (*nigoapi.RegistryClientEntity, error)
	CreateRegistryClient(entity nigoapi.RegistryClientEntity) (*nigoapi.RegistryClientEntity, error)
	UpdateRegistryClient(entity nigoapi.RegistryClientEntity) (*nigoapi.RegistryClientEntity, error)
	RemoveRegistryClient(entity nigoapi.RegistryClientEntity) error

	// Flow client func
	GetFlow(id string) (*nigoapi.ProcessGroupFlowEntity, error)
	UpdateFlowControllerServices(entity nigoapi.ActivateControllerServicesEntity) (*nigoapi.ActivateControllerServicesEntity, error)
	UpdateFlowProcessGroup(entity nigoapi.ScheduleComponentsEntity) (*nigoapi.ScheduleComponentsEntity, error)
	GetFlowControllerServices(id string) (*nigoapi.ControllerServicesEntity, error)

	// Drop request func
	GetDropRequest(connectionId, id string) (*nigoapi.DropRequestEntity, error)
	CreateDropRequest(connectionId string) (*nigoapi.DropRequestEntity, error)

	// Process Group func
	GetProcessGroup(id string) (*nigoapi.ProcessGroupEntity, error)
	CreateProcessGroup(entity nigoapi.ProcessGroupEntity, pgParentId string) (*nigoapi.ProcessGroupEntity, error)
	UpdateProcessGroup(entity nigoapi.ProcessGroupEntity) (*nigoapi.ProcessGroupEntity, error)
	RemoveProcessGroup(entity nigoapi.ProcessGroupEntity) error

	// Version func
	CreateVersionUpdateRequest(pgId string, entity nigoapi.VersionControlInformationEntity) (*nigoapi.VersionedFlowUpdateRequestEntity, error)
	GetVersionUpdateRequest(id string) (*nigoapi.VersionedFlowUpdateRequestEntity, error)
	CreateVersionRevertRequest(pgId string, entity nigoapi.VersionControlInformationEntity) (*nigoapi.VersionedFlowUpdateRequestEntity, error)
	GetVersionRevertRequest(id string) (*nigoapi.VersionedFlowUpdateRequestEntity, error)

	// Snippet func
	CreateSnippet(entity nigoapi.SnippetEntity) (*nigoapi.SnippetEntity, error)
	UpdateSnippet(entity nigoapi.SnippetEntity) (*nigoapi.SnippetEntity, error)

	// Processor func
	UpdateProcessor(entity nigoapi.ProcessorEntity) (*nigoapi.ProcessorEntity, error)
	UpdateProcessorRunStatus(id string, entity nigoapi.ProcessorRunStatusEntity) (*nigoapi.ProcessorEntity, error)

	// Input port func
	UpdateInputPortRunStatus(id string, entity nigoapi.PortRunStatusEntity) (*nigoapi.ProcessorEntity, error)

	// Parameter context func
	GetParameterContext(id string) (*nigoapi.ParameterContextEntity, error)
	CreateParameterContext(entity nigoapi.ParameterContextEntity) (*nigoapi.ParameterContextEntity, error)
	RemoveParameterContext(entity nigoapi.ParameterContextEntity) error
	CreateParameterContextUpdateRequest(contextId string, entity nigoapi.ParameterContextEntity) (*nigoapi.ParameterContextUpdateRequestEntity, error)
	GetParameterContextUpdateRequest(contextId, id string) (*nigoapi.ParameterContextUpdateRequestEntity, error)

	// User groups func
	GetUserGroups() ([]nigoapi.UserGroupEntity, error)
	GetUserGroup(id string) (*nigoapi.UserGroupEntity, error)
	CreateUserGroup(entity nigoapi.UserGroupEntity) (*nigoapi.UserGroupEntity, error)
	UpdateUserGroup(entity nigoapi.UserGroupEntity) (*nigoapi.UserGroupEntity, error)
	RemoveUserGroup(entity nigoapi.UserGroupEntity) error

	// User func
	GetUsers() ([]nigoapi.UserEntity, error)
	GetUser(id string) (*nigoapi.UserEntity, error)
	CreateUser(entity nigoapi.UserEntity) (*nigoapi.UserEntity, error)
	UpdateUser(entity nigoapi.UserEntity) (*nigoapi.UserEntity, error)
	RemoveUser(entity nigoapi.UserEntity) error

	// Policies func
	GetAccessPolicy(action, resource string) (*nigoapi.AccessPolicyEntity, error)
	CreateAccessPolicy(entity nigoapi.AccessPolicyEntity) (*nigoapi.AccessPolicyEntity, error)
	UpdateAccessPolicy(entity nigoapi.AccessPolicyEntity) (*nigoapi.AccessPolicyEntity, error)
	RemoveAccessPolicy(entity nigoapi.AccessPolicyEntity) error

	Build() error
}

NiFiClient is the exported interface for NiFi operations

func New

func New(opts *NifiConfig) NifiClient

func NewFromCluster

func NewFromCluster(k8sclient client.Client, cluster *v1alpha1.NifiCluster) (NifiClient, error)

NewFromCluster is a convenient wrapper around New() and ClusterConfig()

type NifiConfig

type NifiConfig struct {
	NodesURI  map[int32]string
	NifiURI   string
	UseSSL    bool
	TLSConfig *tls.Config

	OperationTimeout int64
	// contains filtered or unexported fields
}

NifiConfig are the options to creating a new ClusterAdmin client

func ClusterConfig

func ClusterConfig(client client.Client, cluster *v1alpha1.NifiCluster) (*NifiConfig, error)

ClusterConfig creates connection options from a NifiCluster CR

Jump to

Keyboard shortcuts

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