nificlient

package
v0.7.3-release Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: Apache-2.0 Imports: 12 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"
	// ConnectNodeAction states that the NiFi node is connecting to the NiFi Cluster
	CONNECTING_STATUS = "CONNECTING"
	// ConnectStatus states that the NiFi node is connected to the NiFi Cluster
	CONNECTED_STATUS = "CONNECTED"
	// DisconnectNodeAction states that the NiFi node is disconnecting from NiFi Cluster
	DISCONNECTING_STATUS = "DISCONNECTING"
	// DisconnectStatus states that the NiFi node is disconnected from NiFi Cluster
	DISCONNECTED_STATUS = "DISCONNECTED"
	// OffloadNodeAction states that the NiFi node is offloading data to NiFi Cluster
	OFFLOADING_STATUS = "OFFLOADING"
	// OffloadStatus states that the NiFi node offloaded data to NiFi Cluster
	OFFLOADED_STATUS = "OFFLOADED"
	// RemoveNodeAction states that the NiFi node is removing from NiFi Cluster
	REMOVING_STATUS = "REMOVING"
	// RemoveStatus states that the NiFi node is removed from NiFi Cluster
	REMOVED_STATUS = "REMOVED"
)

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

This section is empty.

Types

type NifiClient

type NifiClient interface {
	// Access func
	CreateAccessTokenUsingBasicAuth(username, password string, nodeId int32) (*string, error)

	// System func
	DescribeCluster() (*nigoapi.ClusterEntity, error)
	DescribeClusterFromNodeId(nodeId int32) (*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

	// Reportingtask func
	GetReportingTask(id string) (*nigoapi.ReportingTaskEntity, error)
	CreateReportingTask(entity nigoapi.ReportingTaskEntity) (*nigoapi.ReportingTaskEntity, error)
	UpdateReportingTask(entity nigoapi.ReportingTaskEntity) (*nigoapi.ReportingTaskEntity, error)
	UpdateRunStatusReportingTask(id string, entity nigoapi.ReportingTaskRunStatusEntity) (*nigoapi.ReportingTaskEntity, error)
	RemoveReportingTask(entity nigoapi.ReportingTaskEntity) error

	// ControllerConfig func
	GetControllerConfig() (*nigoapi.ControllerConfigurationEntity, error)
	UpdateControllerConfig(entity nigoapi.ControllerConfigurationEntity) (*nigoapi.ControllerConfigurationEntity, error)

	Build() error
}

NiFiClient is the exported interface for NiFi operations

func New

func NewFromConfig

func NewFromConfig(opts *clientconfig.NifiConfig) (NifiClient, error)

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

Directories

Path Synopsis
tls

Jump to

Keyboard shortcuts

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