cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

  • Copyright 2019-2020 VMware, Inc.
  • All Rights Reserved.

* 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.

Index

Constants

This section is empty.

Variables

View Source
var AviClientInstance *utils.AviRestClientPool

Functions

func ConfigureSeGroupLabels

func ConfigureSeGroupLabels(client *clients.AviClient, seGroup *models.ServiceEngineGroup) error

ConfigureSeGroupLabels configures labels on the SeGroup if not present already

func DeConfigureSeGroupLabels

func DeConfigureSeGroupLabels()

DeConfigureSeGroupLabels deconfigures labels on the SeGroup.

func ExtractPattern

func ExtractPattern(word string, pattern string) (string, error)

func ExtractUuid

func ExtractUuid(word, pattern string) string

func ExtractUuidWithoutHash

func ExtractUuidWithoutHash(word, pattern string) string

func FetchNodeNetworks

func FetchNodeNetworks(segMgmtNetwork string, client *clients.AviClient, returnErr *error, nodeNetworkMap map[string]lib.NodeNetworkMap) bool

func FindCIDROverlapping

func FindCIDROverlapping(networks []models.Network, ipNet akov1beta1.AviInfraSettingVipNetwork) (bool, models.Network)

func GetAviSeGroup

func GetAviSeGroup(client *clients.AviClient, segName string) (*models.ServiceEngineGroup, error)

func GetCMSEGManagementNetwork

func GetCMSEGManagementNetwork(client *clients.AviClient) string

func GetControllerClusterUUID

func GetControllerClusterUUID() string

GetControllerClusterUUID returns the value in controllerClusterUUID variable.

func IsAviClusterActive

func IsAviClusterActive(client *clients.AviClient) bool

func PopulateVipNetworkwithUUID

func PopulateVipNetworkwithUUID(segMgmtNetwork string, client *clients.AviClient, vipNetworks []akov1beta1.AviInfraSettingVipNetwork) ([]akov1beta1.AviInfraSettingVipNetwork, error)

This is called for Vcenter cloud only

func SetControllerClusterUUID

func SetControllerClusterUUID(clientPool *utils.AviRestClientPool) error

SetControllerClusterUUID sets the controller cluster's UUID value which is fetched from /api/cluster. If the variable controllerClusterUUID is already set, no API call will be made.

func SharedAVIClients

func SharedAVIClients(tenant string) *utils.AviRestClientPool

This class is in control of AKC. It uses utils from the common project.

func ValidateUserInput

func ValidateUserInput(client *clients.AviClient, isGateway bool) (bool, error)

Types

type AviCache

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

func NewAviCache

func NewAviCache() *AviCache

func (*AviCache) AviCacheAdd

func (c *AviCache) AviCacheAdd(k interface{}, val interface{})

func (*AviCache) AviCacheAddPool

func (c *AviCache) AviCacheAddPool(k NamespaceName) *AviPoolCache

func (*AviCache) AviCacheAddVS

func (c *AviCache) AviCacheAddVS(k NamespaceName) *AviVsCache

func (*AviCache) AviCacheDelete

func (c *AviCache) AviCacheDelete(k interface{})

func (*AviCache) AviCacheGet

func (c *AviCache) AviCacheGet(k interface{}) (interface{}, bool)

func (*AviCache) AviCacheGetAllChildVSForParent

func (c *AviCache) AviCacheGetAllChildVSForParent(parentVsKey NamespaceName) []string

func (*AviCache) AviCacheGetAllParentVSKeys

func (c *AviCache) AviCacheGetAllParentVSKeys() []NamespaceName

func (*AviCache) AviCacheGetKeyByUuid

func (c *AviCache) AviCacheGetKeyByUuid(uuid string) (interface{}, bool)

func (*AviCache) AviCacheGetNameByUuid

func (c *AviCache) AviCacheGetNameByUuid(uuid string) (interface{}, bool)

func (*AviCache) AviGetAllKeys

func (c *AviCache) AviGetAllKeys() []NamespaceName

func (*AviCache) ShallowCopy

func (c *AviCache) ShallowCopy() map[interface{}]interface{}

type AviCloudPropertyCache

type AviCloudPropertyCache struct {
	Name      string
	VType     string
	IPAMType  string
	NSIpamDNS []string
}

type AviClusterRuntimeCache

type AviClusterRuntimeCache struct {
	Name    string
	UpSince string
}

type AviDSCache

type AviDSCache struct {
	Name             string
	Tenant           string
	Uuid             string
	PoolGroups       []string
	LastModified     string
	InvalidData      bool
	CloudConfigCksum uint32
	HasReference     bool
}

type AviHTTPPolicyCache

type AviHTTPPolicyCache struct {
	Name             string
	Tenant           string
	Uuid             string
	CloudConfigCksum string
	PoolGroups       []string
	Pools            []string
	LastModified     string
	InvalidData      bool
	HasReference     bool
}

type AviL4PolicyCache

type AviL4PolicyCache struct {
	Name             string
	Tenant           string
	Uuid             string
	CloudConfigCksum uint32
	Pools            []string
	LastModified     string
	HasReference     bool
}

type AviObjCache

type AviObjCache struct {
	PgCache            *AviCache
	DSCache            *AviCache
	PoolCache          *AviCache
	CloudKeyCache      *AviCache
	HTTPPolicyCache    *AviCache
	L4PolicyCache      *AviCache
	SSLKeyCache        *AviCache
	PKIProfileCache    *AviCache
	VSVIPCache         *AviCache
	VrfCache           *AviCache
	VsCacheMeta        *AviCache
	VsCacheLocal       *AviCache
	ClusterStatusCache *AviCache
}

func NewAviObjCache

func NewAviObjCache() *AviObjCache

func SharedAviObjCache

func SharedAviObjCache() *AviObjCache

func (*AviObjCache) AviCacheRefresh

func (c *AviObjCache) AviCacheRefresh(client *clients.AviClient, cloud string)

func (*AviObjCache) AviCloudPropertiesPopulate

func (c *AviObjCache) AviCloudPropertiesPopulate(client *clients.AviClient, cloudName string) error

func (*AviObjCache) AviClusterStatusPopulate

func (c *AviObjCache) AviClusterStatusPopulate(client *clients.AviClient) error

func (*AviObjCache) AviDNSPropertyPopulate

func (c *AviObjCache) AviDNSPropertyPopulate(client *clients.AviClient, cloudUUID string) []string

func (*AviObjCache) AviIPAMPropertyPopulate

func (c *AviObjCache) AviIPAMPropertyPopulate(client *clients.AviClient, ipamRef string) string

func (*AviObjCache) AviObjCachePopulate

func (c *AviObjCache) AviObjCachePopulate(client []*clients.AviClient, version string, cloud string, tenant string) ([]NamespaceName, []NamespaceName, error)

func (*AviObjCache) AviObjOneVSCachePopulate

func (c *AviObjCache) AviObjOneVSCachePopulate(client *clients.AviClient, cloud string, vsName, tenant string) error

func (*AviObjCache) AviObjVSCachePopulate

func (c *AviObjCache) AviObjVSCachePopulate(client *clients.AviClient, cloud string, vsCacheCopy *[]NamespaceName, overrideUri ...NextPage) error

func (*AviObjCache) AviObjVrfCachePopulate

func (c *AviObjCache) AviObjVrfCachePopulate(client *clients.AviClient, cloud string) error

func (*AviObjCache) AviPGPoolCachePopulate

func (c *AviObjCache) AviPGPoolCachePopulate(client *clients.AviClient, cloud string, pgName string, tenant string) []NamespaceName

func (*AviObjCache) AviPopulateAllDSs

func (c *AviObjCache) AviPopulateAllDSs(client *clients.AviClient, cloud string, DsData *[]AviDSCache, nextPage ...NextPage) (*[]AviDSCache, int, error)

func (*AviObjCache) AviPopulateAllHttpPolicySets

func (c *AviObjCache) AviPopulateAllHttpPolicySets(client *clients.AviClient, cloud string, httpPolicyData *[]AviHTTPPolicyCache, nextPage ...NextPage) (*[]AviHTTPPolicyCache, int, error)

func (*AviObjCache) AviPopulateAllL4PolicySets

func (c *AviObjCache) AviPopulateAllL4PolicySets(client *clients.AviClient, cloud string, l4PolicyData *[]AviL4PolicyCache, nextPage ...NextPage) (*[]AviL4PolicyCache, int, error)

func (*AviObjCache) AviPopulateAllPGs

func (c *AviObjCache) AviPopulateAllPGs(client *clients.AviClient, cloud string, pgData *[]AviPGCache, overrideUri ...NextPage) (*[]AviPGCache, int, error)

func (*AviObjCache) AviPopulateAllPkiPRofiles

func (c *AviObjCache) AviPopulateAllPkiPRofiles(client *clients.AviClient, pkiData *[]AviPkiProfileCache, tenant string, overrideUri ...NextPage) (*[]AviPkiProfileCache, int, error)

func (*AviObjCache) AviPopulateAllPools

func (c *AviObjCache) AviPopulateAllPools(client *clients.AviClient, cloud string, poolData *[]AviPoolCache, tenant string, overrideUri ...NextPage) (*[]AviPoolCache, int, error)

func (*AviObjCache) AviPopulateAllSSLKeys

func (c *AviObjCache) AviPopulateAllSSLKeys(client *clients.AviClient, cloud string, SslData *[]AviSSLCache, nextPage ...NextPage) (*[]AviSSLCache, int, error)

func (*AviObjCache) AviPopulateAllVSVips

func (c *AviObjCache) AviPopulateAllVSVips(client *clients.AviClient, cloud string, vsVipData *[]AviVSVIPCache, tenant string, nextPage ...NextPage) (*[]AviVSVIPCache, error)

func (*AviObjCache) AviPopulateOnePGCache

func (c *AviObjCache) AviPopulateOnePGCache(client *clients.AviClient,
	cloud string, objName string) error

func (*AviObjCache) AviPopulateOnePKICache

func (c *AviObjCache) AviPopulateOnePKICache(client *clients.AviClient,
	cloud string, objName string) error

func (*AviObjCache) AviPopulateOnePoolCache

func (c *AviObjCache) AviPopulateOnePoolCache(client *clients.AviClient,
	cloud string, objName string) error

func (*AviObjCache) AviPopulateOneSSLCache

func (c *AviObjCache) AviPopulateOneSSLCache(client *clients.AviClient,
	cloud string, objName string) error

func (*AviObjCache) AviPopulateOneVsDSCache

func (c *AviObjCache) AviPopulateOneVsDSCache(client *clients.AviClient,
	cloud string, objName string) error

func (*AviObjCache) AviPopulateOneVsHttpPolCache

func (c *AviObjCache) AviPopulateOneVsHttpPolCache(client *clients.AviClient,
	cloud string, objName string) error

func (*AviObjCache) AviPopulateOneVsL4PolCache

func (c *AviObjCache) AviPopulateOneVsL4PolCache(client *clients.AviClient,
	cloud string, objName string) error

func (*AviObjCache) AviPopulateOneVsVipCache

func (c *AviObjCache) AviPopulateOneVsVipCache(client *clients.AviClient,
	cloud string, objName string) error

func (*AviObjCache) AviRefreshObjectCache

func (c *AviObjCache) AviRefreshObjectCache(client []*clients.AviClient, cloud string, tenant string)

func (*AviObjCache) DeleteUnmarked

func (c *AviObjCache) DeleteUnmarked(childCollection []string)

DeleteUnmarked : Adds non referenced cached objects to a Dummy VS, which would be used later to delete these objects from AVI Controller

func (*AviObjCache) MarkReference

func (c *AviObjCache) MarkReference(vsCacheObj *AviVsCache)

MarkReference : check objects referred by a VS and mark they they have reference so that they are not deleted during clean up stage

func (*AviObjCache) PopulateDSDataToCache

func (c *AviObjCache) PopulateDSDataToCache(client *clients.AviClient, cloud, tenant string, overrideUri ...NextPage)

func (*AviObjCache) PopulateHttpPolicySetToCache

func (c *AviObjCache) PopulateHttpPolicySetToCache(client *clients.AviClient, cloud string, overrideUri ...NextPage)

func (*AviObjCache) PopulateL4PolicySetToCache

func (c *AviObjCache) PopulateL4PolicySetToCache(client *clients.AviClient, cloud string, overrideUri ...NextPage)

func (*AviObjCache) PopulatePgDataToCache

func (c *AviObjCache) PopulatePgDataToCache(client *clients.AviClient, cloud, tenant string)

func (*AviObjCache) PopulatePkiProfilesToCache

func (c *AviObjCache) PopulatePkiProfilesToCache(client *clients.AviClient, tenant string, overrideUri ...NextPage)

func (*AviObjCache) PopulatePoolsToCache

func (c *AviObjCache) PopulatePoolsToCache(client *clients.AviClient, cloud, tenant string, overrideUri ...NextPage)

func (*AviObjCache) PopulateSSLKeyToCache

func (c *AviObjCache) PopulateSSLKeyToCache(client *clients.AviClient, cloud string, overrideUri ...NextPage)

func (*AviObjCache) PopulateVsMetaCache

func (c *AviObjCache) PopulateVsMetaCache()

func (*AviObjCache) PopulateVsVipDataToCache

func (c *AviObjCache) PopulateVsVipDataToCache(client *clients.AviClient, cloud, tenant string)

type AviPGCache

type AviPGCache struct {
	Name             string
	Tenant           string
	Uuid             string
	Members          []string // Collection of pools referred by this PG.
	CloudConfigCksum string
	LastModified     string
	InvalidData      bool
	HasReference     bool
}

type AviPkiProfileCache

type AviPkiProfileCache struct {
	Name             string
	Tenant           string
	Uuid             string
	CloudConfigCksum uint32
	LastModified     string
	InvalidData      bool
	HasReference     bool
}

type AviPoolCache

type AviPoolCache struct {
	Name                 string
	Tenant               string
	Uuid                 string
	CloudConfigCksum     string
	ServiceMetadataObj   lib.ServiceMetadataObj
	PkiProfileCollection NamespaceName
	LastModified         string
	InvalidData          bool
	HasReference         bool
}

type AviSSLCache

type AviSSLCache struct {
	Name             string
	Tenant           string
	Uuid             string
	CloudConfigCksum uint32
	LastModified     string
	InvalidData      bool
	Cert             string
	HasCARef         bool
	CACertUUID       string
	HasReference     bool
}

type AviVSVIPCache

type AviVSVIPCache struct {
	Name             string
	Tenant           string
	Uuid             string
	FQDNs            []string
	CloudConfigCksum string
	LastModified     string
	InvalidData      bool
	V6IPs            []string
	Vips             []string
	Fips             []string
	NetworkNames     []string
	HasReference     bool
}

type AviVrfCache

type AviVrfCache struct {
	Name             string
	Uuid             string
	CloudConfigCksum uint32
}

type AviVsCache

type AviVsCache struct {
	Name                 string
	Tenant               string
	Uuid                 string
	CloudConfigCksum     string
	PGKeyCollection      []NamespaceName
	VSVipKeyCollection   []NamespaceName
	PoolKeyCollection    []NamespaceName
	DSKeyCollection      []NamespaceName
	HTTPKeyCollection    []NamespaceName
	SSLKeyCertCollection []NamespaceName
	L4PolicyCollection   []NamespaceName
	SNIChildCollection   []string
	ParentVSRef          NamespaceName
	PassthroughParentRef NamespaceName
	PassthroughChildRef  NamespaceName
	ServiceMetadataObj   lib.ServiceMetadataObj
	LastModified         string
	EnableRhi            bool
	InvalidData          bool
	VSCacheLock          sync.RWMutex
}

func (*AviVsCache) AddToDSKeyCollection

func (v *AviVsCache) AddToDSKeyCollection(k NamespaceName)

func (*AviVsCache) AddToHTTPKeyCollection

func (v *AviVsCache) AddToHTTPKeyCollection(k NamespaceName)

func (*AviVsCache) AddToL4PolicyCollection

func (v *AviVsCache) AddToL4PolicyCollection(k NamespaceName)

func (*AviVsCache) AddToPGKeyCollection

func (v *AviVsCache) AddToPGKeyCollection(k NamespaceName)

func (*AviVsCache) AddToPoolKeyCollection

func (v *AviVsCache) AddToPoolKeyCollection(k NamespaceName)

func (*AviVsCache) AddToSNIChildCollection

func (v *AviVsCache) AddToSNIChildCollection(k string)

func (*AviVsCache) AddToSSLKeyCertCollection

func (v *AviVsCache) AddToSSLKeyCertCollection(k NamespaceName)

func (*AviVsCache) AddToVSVipKeyCollection

func (v *AviVsCache) AddToVSVipKeyCollection(k NamespaceName)

func (*AviVsCache) GetVSCopy

func (v *AviVsCache) GetVSCopy() (*AviVsCache, bool)

func (*AviVsCache) RemoveFromDSKeyCollection

func (v *AviVsCache) RemoveFromDSKeyCollection(k NamespaceName)

func (*AviVsCache) RemoveFromHTTPKeyCollection

func (v *AviVsCache) RemoveFromHTTPKeyCollection(k NamespaceName)

func (*AviVsCache) RemoveFromL4PolicyCollection

func (v *AviVsCache) RemoveFromL4PolicyCollection(k NamespaceName)

func (*AviVsCache) RemoveFromPGKeyCollection

func (v *AviVsCache) RemoveFromPGKeyCollection(k NamespaceName)

func (*AviVsCache) RemoveFromPoolKeyCollection

func (v *AviVsCache) RemoveFromPoolKeyCollection(k NamespaceName)

func (*AviVsCache) RemoveFromSNIChildCollection

func (v *AviVsCache) RemoveFromSNIChildCollection(k string)

func (*AviVsCache) RemoveFromSSLKeyCertCollection

func (v *AviVsCache) RemoveFromSSLKeyCertCollection(k NamespaceName)

func (*AviVsCache) RemoveFromVSVipKeyCollection

func (v *AviVsCache) RemoveFromVSVipKeyCollection(k NamespaceName)

func (*AviVsCache) ReplaceSNIChildCollection

func (v *AviVsCache) ReplaceSNIChildCollection(k []string)

func (*AviVsCache) SetPGKeyCollection

func (v *AviVsCache) SetPGKeyCollection(keyCollection []NamespaceName)

type NamespaceName

type NamespaceName struct {
	Namespace string
	Name      string
}

func RemoveNamespaceName

func RemoveNamespaceName(s []NamespaceName, r NamespaceName) []NamespaceName

type NextPage

type NextPage struct {
	NextURI    string
	Collection interface{}
}

Jump to

Keyboard shortcuts

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