Documentation
¶
Index ¶
- Constants
- Variables
- func AreSlicesEqual(slice1, slice2 []string) bool
- func AssignComponentsToTargets(ctx context.Context, components []model.ComponentSpec, ...) (map[string]string, error)
- func CatalogHook(context context.Context, baseUrl string, user string, password string, ...) error
- func CollectStringMap(col map[string]string, prefix string) map[string]string
- func ConstructSummaryId(name string, guid string) string
- func ContainsString(names []string, name string) bool
- func ConvertObjectNameToReference(name string) string
- func ConvertReferenceToObjectName(name string) string
- func CreateInstance(context context.Context, baseUrl string, instance string, user string, ...) error
- func CreateSymphonyDeployment(ctx context.Context, instance model.InstanceState, ...) (model.DeploymentSpec, error)
- func CreateSymphonyDeploymentFromTarget(ctx context.Context, target model.TargetState, namespace string) (model.DeploymentSpec, error)
- func CreateTarget(context context.Context, baseUrl string, target string, user string, ...) error
- func DeleteCatalog(context context.Context, baseUrl string, catalog string, user string, ...) error
- func DeleteInstance(context context.Context, baseUrl string, instance string, user string, ...) error
- func DeleteSolution(context context.Context, baseUrl string, solution string, user string, ...) error
- func DeleteTarget(context context.Context, baseUrl string, target string, user string, ...) error
- func DetermineObjectTerminalStatus(objectMeta model.ObjectMeta, status model.DeployableStatus) bool
- func EvaluateDeployment(context utils.EvaluationContext) (model.DeploymentSpec, error)
- func FilterIncompleteDelete(ctx context.Context, apiclient *ApiClient, namespace string, ...) []string
- func FilterIncompleteDeploymentUsingSummary(ctx context.Context, apiclient *ApiClient, namespace string, ...) ([]ObjectInfo, []FailedDeployment)
- func FormatAsString(val interface{}) string
- func FormatObject(obj interface{}, isArray bool, path string, format string) ([]byte, error)
- func GenerateKeyLockName(strs ...string) string
- func GetABatchForSite(context context.Context, baseUrl string, site string, user string, ...) (model.SyncPackage, error)
- func GetActivation(context context.Context, baseUrl string, activation string, user string, ...) (model.ActivationState, error)
- func GetApiClient() (*apiClient, error)
- func GetCampaign(context context.Context, baseUrl string, campaign string, user string, ...) (model.CampaignState, error)
- func GetCatalog(context context.Context, baseUrl string, catalog string, user string, ...) (model.CatalogState, error)
- func GetCatalogs(context context.Context, baseUrl string, user string, password string, ...) ([]model.CatalogState, error)
- func GetCatalogsWithFilter(context context.Context, baseUrl string, user string, password string, ...) ([]model.CatalogState, error)
- func GetInstance(context context.Context, baseUrl string, instance string, user string, ...) (model.InstanceState, error)
- func GetInstances(context context.Context, baseUrl string, user string, password string, ...) ([]model.InstanceState, error)
- func GetInstancesForAllNamespaces(context context.Context, baseUrl string, user string, password string) ([]model.InstanceState, error)
- func GetNamespaceFromContext(localContext interface{}) string
- func GetParentApiClient(baseUrl string) (*apiClient, error)
- func GetSites(context context.Context, baseUrl string, user string, password string) ([]model.SiteState, error)
- func GetSolution(context context.Context, baseUrl string, solution string, user string, ...) (model.SolutionState, error)
- func GetSolutions(context context.Context, baseUrl string, user string, password string, ...) ([]model.SolutionState, error)
- func GetSolutionsForAllNamespaces(context context.Context, baseUrl string, user string, password string) ([]model.SolutionState, error)
- func GetString(col map[string]string, key string) (string, error)
- func GetSummary(context context.Context, baseUrl string, user string, password string, ...) (model.SummaryResult, error)
- func GetSymphonyAPIAddressBase() string
- func GetTarget(context context.Context, baseUrl string, target string, user string, ...) (model.TargetState, error)
- func GetTargetRuntimeKey(guid string) string
- func GetTargets(context context.Context, baseUrl string, user string, password string, ...) ([]model.TargetState, error)
- func GetTargetsForAllNamespaces(context context.Context, baseUrl string, user string, password string) ([]model.TargetState, error)
- func IsNotFound(err error) bool
- func JsonParseProperty(properties interface{}, fieldPath string) (any, bool)
- func JsonPathQuery(obj interface{}, jsonPath string) (interface{}, error)
- func MatchTargets(instance model.InstanceState, targets []model.TargetState) []model.TargetState
- func MergeCollection(cols ...map[string]string) map[string]string
- func NewApiClient(ctx context.Context, baseUrl string, opts ...ApiClientOption) (*apiClient, error)
- func ParseValue(v string) (interface{}, error)
- func ProjectValue(val string, name string) string
- func PublishActivationEvent(context context.Context, baseUrl string, user string, password string, ...) error
- func QueueJob(context context.Context, baseUrl string, user string, password string, ...) error
- func ReadInt32(col map[string]string, key string, defaultVal int32) int32
- func ReadString(col map[string]string, key string, defaultVal string) string
- func ReadStringFromMapCompat(col map[string]interface{}, key string, defaultVal string) string
- func ReadStringWithOverrides(col1 map[string]string, col2 map[string]string, key string, defaultVal string) string
- func Reconcile(context context.Context, baseUrl string, user string, password string, ...) (model.SummarySpec, error)
- func ReportActivationStatus(context context.Context, baseUrl string, name string, user string, ...) error
- func ReportCatalogs(context context.Context, baseUrl string, user string, password string, ...) error
- func SendVisualizationPacket(context context.Context, baseUrl string, user string, password string, ...) error
- func ShouldUseSATokens() bool
- func ShouldUseUserCreds() bool
- func SyncStageStatus(context context.Context, baseUrl string, user string, password string, ...) error
- func ToCOAError(apiErr APIError) v1alpha2.COAError
- func UpdateSite(context context.Context, baseUrl string, site string, user string, ...) error
- func UpsertCatalog(context context.Context, baseUrl string, catalog string, user string, ...) error
- func UpsertSolution(context context.Context, baseUrl string, solution string, user string, ...) error
- type APIError
- type ApiClient
- type ApiClientOption
- type BinaryNode
- type Dispatcher
- type ExpressionParser
- type FailedDeployment
- type FunctionNode
- type IdentifierNode
- type IntNode
- type Node
- type NullNode
- type NumberNode
- type ObjectInfo
- type Parser
- type Rule
- type RuleResult
- type Schema
- type SchemaResult
- type SummaryGetter
- type Token
- type TokenProvider
- type UnaryNode
Constants ¶
View Source
const ( Must = "must" Prefer = "prefer" Reject = "reject" Any = "any" )
Variables ¶
View Source
var (
SymphonyAPIAddressBase = "http://symphony-service:8080/v1alpha2/"
)
Functions ¶
func AreSlicesEqual ¶
func AssignComponentsToTargets ¶
func AssignComponentsToTargets(ctx context.Context, components []model.ComponentSpec, targets map[string]model.TargetState) (map[string]string, error)
func CatalogHook ¶
func CollectStringMap ¶
func ConstructSummaryId ¶
func ContainsString ¶
func CreateInstance ¶
func CreateSymphonyDeployment ¶
func CreateSymphonyDeployment(ctx context.Context, instance model.InstanceState, solution model.SolutionState, targets []model.TargetState, devices []model.DeviceState, namespace string) (model.DeploymentSpec, error)
func CreateSymphonyDeploymentFromTarget ¶
func CreateSymphonyDeploymentFromTarget(ctx context.Context, target model.TargetState, namespace string) (model.DeploymentSpec, error)
func CreateTarget ¶
func DeleteCatalog ¶
func DeleteInstance ¶
func DeleteSolution ¶
func DeleteTarget ¶
func DetermineObjectTerminalStatus ¶
func DetermineObjectTerminalStatus(objectMeta model.ObjectMeta, status model.DeployableStatus) bool
func EvaluateDeployment ¶
func EvaluateDeployment(context utils.EvaluationContext) (model.DeploymentSpec, error)
func FilterIncompleteDelete ¶
func FilterIncompleteDeploymentUsingSummary ¶
func FilterIncompleteDeploymentUsingSummary(ctx context.Context, apiclient *ApiClient, namespace string, objects []ObjectInfo, isInstance bool, username string, password string) ([]ObjectInfo, []FailedDeployment)
func FormatAsString ¶
func FormatAsString(val interface{}) string
func FormatObject ¶
func GenerateKeyLockName ¶
func GetABatchForSite ¶
func GetActivation ¶
func GetApiClient ¶
func GetApiClient() (*apiClient, error)
func GetCampaign ¶
func GetCatalog ¶
func GetCatalogs ¶
func GetCatalogsWithFilter ¶
func GetInstance ¶
func GetInstances ¶
func GetNamespaceFromContext ¶
func GetNamespaceFromContext(localContext interface{}) string
func GetParentApiClient ¶
func GetSolution ¶
func GetSolutions ¶
func GetSummary ¶
func GetSymphonyAPIAddressBase ¶
func GetSymphonyAPIAddressBase() string
func GetTargetRuntimeKey ¶
Add target-runtime prefix to notify the object is a target.
func GetTargets ¶
func IsNotFound ¶
func JsonParseProperty ¶
func JsonPathQuery ¶
func MatchTargets ¶
func MatchTargets(instance model.InstanceState, targets []model.TargetState) []model.TargetState
func NewApiClient ¶
func NewApiClient(ctx context.Context, baseUrl string, opts ...ApiClientOption) (*apiClient, error)
func ProjectValue ¶
TODO: This should not be used anymore
func PublishActivationEvent ¶
func ReadStringFromMapCompat ¶
func ReadStringWithOverrides ¶
func ReportActivationStatus ¶
func ReportCatalogs ¶
func SendVisualizationPacket ¶
func ShouldUseSATokens ¶
func ShouldUseSATokens() bool
func ShouldUseUserCreds ¶
func ShouldUseUserCreds() bool
func SyncStageStatus ¶
func ToCOAError ¶
func UpdateSite ¶
func UpsertCatalog ¶
Types ¶
type APIError ¶
We shouldn't use specific error types APIError represents an error that includes a SummarySpec in its message field.
func (APIError) IsRetriableErr ¶
type ApiClient ¶
type ApiClient interface { SummaryGetter Dispatcher GetInstancesForAllNamespaces(ctx context.Context, user string, password string) ([]model.InstanceState, error) GetInstances(ctx context.Context, namespace string, user string, password string) ([]model.InstanceState, error) GetInstance(ctx context.Context, instance string, namespace string, user string, password string) (model.InstanceState, error) CreateInstance(ctx context.Context, instance string, payload []byte, namespace string, user string, password string) error DeleteInstance(ctx context.Context, instance string, namespace string, user string, password string) error DeleteTarget(ctx context.Context, target string, namespace string, user string, password string) error GetSolutions(ctx context.Context, namespace string, user string, password string) ([]model.SolutionState, error) GetSolution(ctx context.Context, solution string, namespace string, user string, password string) (model.SolutionState, error) CreateSolution(ctx context.Context, solution string, payload []byte, namespace string, user string, password string) error DeleteSolution(ctx context.Context, solution string, namespace string, user string, password string) error GetTargetsForAllNamespaces(ctx context.Context, user string, password string) ([]model.TargetState, error) GetTarget(ctx context.Context, target string, namespace string, user string, password string) (model.TargetState, error) GetTargets(ctx context.Context, namespace string, user string, password string) ([]model.TargetState, error) CreateTarget(ctx context.Context, target string, payload []byte, namespace string, user string, password string) error Reconcile(ctx context.Context, deployment model.DeploymentSpec, isDelete bool, namespace string, user string, password string) (model.SummarySpec, error) CatalogHook(ctx context.Context, payload []byte, user string, password string) error PublishActivationEvent(ctx context.Context, event v1alpha2.ActivationData, user string, password string) error GetActivation(ctx context.Context, activation string, namespace string, user string, password string) (model.ActivationState, error) GetCatalog(ctx context.Context, catalog string, namespace string, user string, password string) (model.CatalogState, error) UpsertCatalog(ctx context.Context, catalog string, payload []byte, user string, password string) error DeleteCatalog(ctx context.Context, catalog string, user string, password string) error UpsertSolution(ctx context.Context, solution string, payload []byte, namespace string, user string, password string) error GetSites(ctx context.Context, user string, password string) ([]model.SiteState, error) GetCatalogs(ctx context.Context, namespace string, user string, password string) ([]model.CatalogState, error) GetCatalogsWithFilter(ctx context.Context, namespace string, filterType string, filterValue string, user string, password string) ([]model.CatalogState, error) UpdateSite(ctx context.Context, site string, payload []byte, user string, password string) error GetABatchForSite(ctx context.Context, site string, user string, password string) (model.SyncPackage, error) SyncStageStatus(ctx context.Context, status model.StageStatus, user string, password string) error SendVisualizationPacket(ctx context.Context, payload []byte, user string, password string) error ReportCatalogs(ctx context.Context, instance string, components []model.ComponentSpec, user string, password string) error CreateSolutionContainer(ctx context.Context, instanceContainer string, payload []byte, namespace string, user string, password string) error DeleteSolutionContainer(ctx context.Context, instanceContainer string, namespace string, user string, password string) error GetSolutionContainer(ctx context.Context, instanceContainer string, namespace string, user string, password string) (model.SolutionContainerState, error) CreateCatalogContainer(ctx context.Context, instanceContainer string, payload []byte, namespace string, user string, password string) error DeleteCatalogContainer(ctx context.Context, instanceContainer string, namespace string, user string, password string) error GetCatalogContainer(ctx context.Context, instanceContainer string, namespace string, user string, password string) (model.CatalogContainerState, error) CreateCampaignContainer(ctx context.Context, instanceContainer string, payload []byte, namespace string, user string, password string) error DeleteCampaignContainer(ctx context.Context, instanceContainer string, namespace string, user string, password string) error GetCampaignContainer(ctx context.Context, instanceContainer string, namespace string, user string, password string) (model.CampaignContainerState, error) GetParsedCatalogProperties(ctx context.Context, name string, namespace string, user string, password string) (map[string]interface{}, error) }
type ApiClientOption ¶
type ApiClientOption func(*apiClient)
func WithCertAuth ¶
func WithCertAuth(caCertPath string) ApiClientOption
func WithServiceAccountToken ¶
func WithServiceAccountToken() ApiClientOption
func WithUserPassword ¶
func WithUserPassword(ctx context.Context) ApiClientOption
type BinaryNode ¶
func (*BinaryNode) Eval ¶
func (n *BinaryNode) Eval(context utils.EvaluationContext) (interface{}, error)
type Dispatcher ¶
type ExpressionParser ¶
type ExpressionParser struct {
// contains filtered or unexported fields
}
func (*ExpressionParser) Eval ¶
func (p *ExpressionParser) Eval(context utils.EvaluationContext) (interface{}, error)
type FailedDeployment ¶
func FilterIncompleteDeploymentUsingStatus ¶
func FilterIncompleteDeploymentUsingStatus(ctx context.Context, apiclient *ApiClient, namespace string, objectNames []string, isInstance bool, username string, password string) ([]string, []FailedDeployment)
Once status report is enabled in standalone mode, we need to use object status rather than summary to check the deployment status
type FunctionNode ¶
func (*FunctionNode) Eval ¶
func (n *FunctionNode) Eval(context utils.EvaluationContext) (interface{}, error)
type IdentifierNode ¶
type IdentifierNode struct {
Value string
}
func (*IdentifierNode) Eval ¶
func (n *IdentifierNode) Eval(context utils.EvaluationContext) (interface{}, error)
type Node ¶
type Node interface {
Eval(context utils.EvaluationContext) (interface{}, error)
}
type NumberNode ¶
type NumberNode struct {
Value float64
}
func (*NumberNode) Eval ¶
func (n *NumberNode) Eval(context utils.EvaluationContext) (interface{}, error)
type RuleResult ¶
type Schema ¶
func (*Schema) CheckProperties ¶
func (s *Schema) CheckProperties(ctx context.Context, properties map[string]interface{}, evaluationContext *coa_utils.EvaluationContext) (SchemaResult, error)
type SchemaResult ¶
type SchemaResult struct { Valid bool `json:"valid"` Errors map[string]RuleResult `json:"errors,omitempty"` }
func (*SchemaResult) ToErrorMessages ¶
func (s *SchemaResult) ToErrorMessages() string
type SummaryGetter ¶
type TokenProvider ¶
Click to show internal directories.
Click to hide internal directories.