armotypes

package
v1.0.62 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CostumerGuidQuery   = "costumerGUID"
	ClusterNameQuery    = "cluster"
	DatacenterNameQuery = "datacenter"
	NamespaceQuery      = "namespace"
	ProjectQuery        = "project"
	WlidQuery           = "wlid"
	SidQuery            = "sid"
)
View Source
const (
	AttributeCluster   = "cluster"
	AttributeNamespace = "namespace"
)

attributes

Variables

Functions

func DigestAttributesDesignator

func DigestAttributesDesignator(attributes map[string]string) (string, string, map[string]string)

func DigestPortalDesignator

func DigestPortalDesignator(designator *PortalDesignator) (string, string, map[string]string)

DigestPortalDesignator - get cluster namespace and labels from designator

Types

type DesignatorType

type DesignatorType string
const (
	DesignatorAttributes DesignatorType = "Attributes"
	/*
		WorkloadID format.
		k8s format: wlid://cluster-<cluster>/namespace-<namespace>/<kind>-<name>
		native format: wlid://datacenter-<datacenter>/project-<project>/native-<name>
	*/
	DesignatorWlid DesignatorType = "Wlid"
	/*
		Wild card - subset of wlid. e.g.
		1. Include cluster:
			wlid://cluster-<cluster>/
		2. Include cluster and namespace (filter out all other namespaces):
			wlid://cluster-<cluster>/namespace-<namespace>/
	*/
	DesignatorWildWlid      DesignatorType = "WildWlid"
	DesignatorWlidContainer DesignatorType = "WlidContainer"
	DesignatorWlidProcess   DesignatorType = "WlidProcess"
	DesignatorSid           DesignatorType = "Sid" // secret id
)

Supported designators

type EnforcmentsRule

type EnforcmentsRule struct {
	MonitoredObject          []string `json:"monitoredObject"`
	MonitoredObjectExistence []string `json:"objectExistence"`
	MonitoredObjectEvent     []string `json:"event"`
	Action                   []string `json:"action"`
}

type ExecutionPolicy

type ExecutionPolicy struct {
	PortalBase                `json:",inline"`
	Designators               []PortalDesignator `json:"designators"`
	PolicyType                string             `json:"policyType"`
	CreationTime              string             `json:"creation_time"`
	ExecutionEnforcmentsRules []EnforcmentsRule  `json:"enforcementRules"`
}

type PortalBase

type PortalBase struct {
	GUID       string                 `json:"guid"`
	Name       string                 `json:"name"`
	Attributes map[string]interface{} `json:"attributes,omitempty"` // could be string
}

PortalBase holds basic items data from portal BE

func MockPortalBase

func MockPortalBase(customerGUID, name string, attributes map[string]interface{}) *PortalBase

type PortalDesignator

type PortalDesignator struct {
	DesignatorType DesignatorType    `json:"designatorType"`
	WLID           string            `json:"wlid"`
	WildWLID       string            `json:"wildwlid"`
	SID            string            `json:"sid"`
	Attributes     map[string]string `json:"attributes"`
}

PortalDesignator represented single designation options

Jump to

Keyboard shortcuts

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