agent

package
v1.1.34 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: Apache-2.0 Imports: 37 Imported by: 22

Documentation

Index

Constants

View Source
const (
	AgentRunning   = "running"
	AgentStopped   = "stopped"
	AgentFailed    = "failed"
	AgentUnhealthy = "unhealthy"
)

AgentStatus - status for Agent resource

Variables

View Source
var (
	ErrDeletingService             = errors.Newf(1161, "error deleting API Service %s in Amplify Central")
	ErrDeletingServiceInstanceItem = errors.Newf(1162, "error deleting API Service Instance %s in Amplify Central")
	ErrUnableToGetAPIV1Resources   = errors.Newf(1163, "error retrieving API Service resource instances for %s")
)

Errors hit when validating Amplify Central connectivity

View Source
var AgentResourceType string

AgentResourceType - Holds the type for agent resource in Central

Functions

func AddUpdateAgentDetails

func AddUpdateAgentDetails(key, value string)

AddUpdateAgentDetails - Adds a new or Updates an existing key on the agent details sub resource

func ApplyResourceToConfig

func ApplyResourceToConfig(cfg interface{}) error

ApplyResourceToConfig - applies the resources to agent configs Uses reflection to get the IResourceConfigCallback interface on the config struct or struct variable. Makes call to ApplyResources method with dataplane and agent resources from API server

func GetAPICache

func GetAPICache() cache.Cache

GetAPICache - Returns the cache

func GetAgentResource

func GetAgentResource() *apiV1.ResourceInstance

GetAgentResource - Returns Agent resource

func GetAttributeOnPublishedAPI

func GetAttributeOnPublishedAPI(externalAPIID string, attrName string) string

GetAttributeOnPublishedAPI - DEPRECATED Returns the value on published proxy

func GetAttributeOnPublishedAPIByID

func GetAttributeOnPublishedAPIByID(externalAPIID string, attrName string) string

GetAttributeOnPublishedAPIByID - Returns the value on published proxy

func GetAttributeOnPublishedAPIByName

func GetAttributeOnPublishedAPIByName(apiName string, attrName string) string

GetAttributeOnPublishedAPIByName - Returns the value on published proxy

func GetAttributeOnPublishedAPIByPrimaryKey

func GetAttributeOnPublishedAPIByPrimaryKey(primaryKey string, attrName string) string

GetAttributeOnPublishedAPIByPrimaryKey - Returns the value on published proxy

func GetAuthProviderRegistry

func GetAuthProviderRegistry() oauth.ProviderRegistry

GetAuthProviderRegistry - Returns the auth provider registry

func GetCacheManager

func GetCacheManager() agentcache.Manager

GetCacheManager - Returns the cache

func GetCentralAuthToken

func GetCentralAuthToken() (string, error)

GetCentralAuthToken - Returns the Auth token from AxwayID to make API call to Central

func GetCentralClient

func GetCentralClient() apic.Client

GetCentralClient - Returns the APIC Client

func GetCentralConfig

func GetCentralConfig() config.CentralConfig

GetCentralConfig - Returns the APIC Client

func GetDetailFromAgentResource

func GetDetailFromAgentResource(key string) string

GetDetailFromAgentResource - gets the value of an agent detail from the resource

func GetOwnerOnPublishedAPIByID

func GetOwnerOnPublishedAPIByID(externalAPIID string) *apiV1.Owner

GetOwnerOnPublishedAPIByID - Returns the owner spec of the published proxy

func GetOwnerOnPublishedAPIByName

func GetOwnerOnPublishedAPIByName(apiName string) *apiV1.Owner

GetOwnerOnPublishedAPIByName - Returns the owner spec of the published proxy

func GetOwnerOnPublishedAPIByPrimaryKey

func GetOwnerOnPublishedAPIByPrimaryKey(primaryKey string) *apiV1.Owner

GetOwnerOnPublishedAPIByPrimaryKey - Returns the owner spec of the published proxy

func GetTeamByID

func GetTeamByID(id string) *definitions.PlatformTeam

GetTeamByID - Returns the PlatformTeam associated with the id

func GetTeamByName

func GetTeamByName(name string) *definitions.PlatformTeam

GetTeamByName - Returns the PlatformTeam associated with the name

func Initialize

func Initialize(centralCfg config.CentralConfig) error

Initialize - Initializes the agent

func InitializeForTest

func InitializeForTest(apicClient apic.Client)

InitializeForTest - Initialize for test

func InitializeProfiling

func InitializeProfiling(cpuProfile, memProfile string)

InitializeProfiling - setup the CPU and Memory profiling if options given

func InitializeWithAgentFeatures

func InitializeWithAgentFeatures(centralCfg config.CentralConfig, agentFeaturesCfg config.AgentFeaturesConfig) error

InitializeWithAgentFeatures - Initializes the agent with agent features

func IsAPIPublished

func IsAPIPublished(externalAPIID string) bool

IsAPIPublished - DEPRECATED Returns true if the API Service is already published

func IsAPIPublishedByID

func IsAPIPublishedByID(externalAPIID string) bool

IsAPIPublishedByID - Returns true if the API Service is already published

func IsAPIPublishedByPrimaryKey

func IsAPIPublishedByPrimaryKey(primaryKey string) bool

IsAPIPublishedByPrimaryKey - Returns true if the API Service is already published

func NewAPIKeyAccessRequestBuilder

func NewAPIKeyAccessRequestBuilder() provisioning.AccessRequestBuilder

NewAPIKeyAccessRequestBuilder - called by the agents

func NewAPIKeyCredentialRequestBuilder

func NewAPIKeyCredentialRequestBuilder(options ...func(*crdBuilderOptions)) provisioning.CredentialRequestBuilder

NewAPIKeyCredentialRequestBuilder - add api key base properties for provisioning schema

func NewAccessRequestBuilder

func NewAccessRequestBuilder() provisioning.AccessRequestBuilder

NewAccessRequestBuilder - called by the agents to build and register a new access request definition

func NewCredentialRequestBuilder

func NewCredentialRequestBuilder(options ...func(*crdBuilderOptions)) provisioning.CredentialRequestBuilder

NewCredentialRequestBuilder - called by the agents to build and register a new credential reqest definition

func NewOAuthCredentialRequestBuilder

func NewOAuthCredentialRequestBuilder(options ...func(*crdBuilderOptions)) provisioning.CredentialRequestBuilder

NewOAuthCredentialRequestBuilder - add oauth base properties for provisioning schema

func OnAgentResourceChange

func OnAgentResourceChange(agentResourceChangeHandler ConfigChangeHandler)

OnAgentResourceChange - Registers handler for resource change event

func OnConfigChange

func OnConfigChange(configChangeHandler ConfigChangeHandler)

OnConfigChange - Registers handler for config change event

func PublishAPI

func PublishAPI(serviceBody apic.ServiceBody) error

PublishAPI - Publishes the API

func RegisterAPIValidator

func RegisterAPIValidator(apiValidator APIValidator)

RegisterAPIValidator - Registers callback for validating the API on gateway

func RegisterDeleteServiceValidator

func RegisterDeleteServiceValidator(validator interface{})

RegisterDeleteServiceValidator - DEPRECATED Registers callback for validating if the service should be deleted

func RegisterProvisioner

func RegisterProvisioner(provisioner provisioning.Provisioning)

RegisterProvisioner - allow the agent to register a provisioner

func RegisterResourceEventHandler

func RegisterResourceEventHandler(name string, resourceEventHandler handler.Handler)

RegisterResourceEventHandler - Registers handler for resource events

func RemovePublishedAPIAgentDetail

func RemovePublishedAPIAgentDetail(externalAPIID, detailKey string) error

RemovePublishedAPIAgentDetail -

func StartAgentStatusUpdate

func StartAgentStatusUpdate()

StartAgentStatusUpdate - starts 2 separate jobs that runs the periodic status updates and immediate status updates

func UnregisterResourceEventHandler

func UnregisterResourceEventHandler(name string)

UnregisterResourceEventHandler - removes the specified resource event handler

func UpdateStatus

func UpdateStatus(status, description string)

UpdateStatus - Updates the agent state

func UpdateStatusWithContext

func UpdateStatusWithContext(ctx context.Context, status, prevStatus, description string)

UpdateStatusWithContext - Updates the agent state providing a context

func UpdateStatusWithPrevious

func UpdateStatusWithPrevious(status, prevStatus, description string)

UpdateStatusWithPrevious - Updates the agent state providing a previous state

func WithCRDForIDP

func WithCRDForIDP(p oauth.Provider, scopes []string) func(c *crdBuilderOptions)

WithCRDForIDP - set the schema properties using the provider metadata

func WithCRDName

func WithCRDName(name string) func(c *crdBuilderOptions)

WithCRDName - set another name for the CRD

func WithCRDOAuthPublicKey

func WithCRDOAuthPublicKey() func(c *crdBuilderOptions)

WithCRDOAuthPublicKey - set that the Oauth cred is key based

func WithCRDOAuthSecret

func WithCRDOAuthSecret() func(c *crdBuilderOptions)

WithCRDOAuthSecret - set that the Oauth cred is secret based

func WithCRDProvisionSchemaProperty

func WithCRDProvisionSchemaProperty(prop provisioning.PropertyBuilder) func(c *crdBuilderOptions)

WithCRDProvisionSchemaProperty - add more provisioning properties

func WithCRDRequestSchemaProperty

func WithCRDRequestSchemaProperty(prop provisioning.PropertyBuilder) func(c *crdBuilderOptions)

WithCRDRequestSchemaProperty - add more request properties

Types

type APIValidator

type APIValidator func(apiID, stageName string) bool

APIValidator - Callback for validating the API

type ConfigChangeHandler

type ConfigChangeHandler func()

ConfigChangeHandler - Callback for Config change event

func GetConfigChangeHandler

func GetConfigChangeHandler() ConfigChangeHandler

GetConfigChangeHandler - returns registered config change handler

type EventSync

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

EventSync struct for syncing events from central

func NewEventSync

func NewEventSync() (*EventSync, error)

NewEventSync creates an EventSync

func (*EventSync) SyncCache

func (es *EventSync) SyncCache() error

SyncCache initializes agent cache and starts the agent in stream or poll mode

type PublishAPIFunc

type PublishAPIFunc func(serviceBody apic.ServiceBody) error

PublishAPIFunc definition for the PublishAPI func

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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