storage

package
v0.0.0-...-89602ce Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package storage defines the storage interfaces and implementations for the configurator service. All interactions between the service and the backing data layer will be brokered through the storage interface.

Index

Constants

View Source
const InternalNetworkID = "network_magma_internal"

InternalNetworkID is the ID of the network under which all non-tenant entities are organized under.

Variables

View Source
var (
	ACL_Permission_name = map[int32]string{
		0: "NO_PERM",
		1: "READ",
		2: "WRITE",
		3: "OWN",
	}
	ACL_Permission_value = map[string]int32{
		"NO_PERM": 0,
		"READ":    1,
		"WRITE":   2,
		"OWN":     3,
	}
)

Enum value maps for ACL_Permission.

View Source
var (
	ACL_Wildcard_name = map[int32]string{
		0: "NO_WILDCARD",
		1: "WILDCARD_ALL",
	}
	ACL_Wildcard_value = map[string]int32{
		"NO_WILDCARD":  0,
		"WILDCARD_ALL": 1,
	}
)

Enum value maps for ACL_Wildcard.

View Source
var File_storage_proto protoreflect.FileDescriptor
View Source
var FullEntityLoadCriteria = EntityLoadCriteria{
	LoadMetadata:       true,
	LoadConfig:         true,
	LoadAssocsToThis:   true,
	LoadAssocsFromThis: true,
	LoadPermissions:    true,
}

FullEntityLoadCriteria is an EntityLoadCriteria which loads everything

View Source
var FullNetworkLoadCriteria = NetworkLoadCriteria{LoadMetadata: true, LoadConfigs: true}

FullNetworkLoadCriteria is a utility variable to specify a full network load

Functions

func CommitLogOnError

func CommitLogOnError(store ConfiguratorStorage)

CommitLogOnError calls Commit on the provided ConfiguratorStorage and logs if Commit resulted in an error.

func RollbackLogOnError

func RollbackLogOnError(store ConfiguratorStorage)

RollbackLogOnError calls Rollback on the provided ConfiguratorStorage and logs if Rollback resulted in an error.

Types

type ACL

type ACL struct {

	// A unique system-generated identifier for this ACL.
	ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	// An ACL can apply to one or more networks.
	//
	// Types that are assignable to Scope:
	//	*ACL_ScopeNetworkIDs
	//	*ACL_ScopeWildcard
	Scope      isACL_Scope    `protobuf_oneof:"scope"`
	Permission ACL_Permission `` /* 128-byte string literal not displayed */
	// An ACL can define access permissions to a specific type of entity, or
	// all entities.
	//
	// Types that are assignable to Type:
	//	*ACL_EntityType
	//	*ACL_TypeWildcard
	Type isACL_Type `protobuf_oneof:"type"`
	// An ACL can optionally define access permissions to specific entity IDs
	// If empty, the ACL will apply to all entities of the specified type.
	IDFilter []string `protobuf:"bytes,40,rep,name=IDFilter,proto3" json:"IDFilter,omitempty"`
	Version  uint64   `protobuf:"varint,50,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

ACL (Access Control List) defines a specific permission for an entity on access to other entities.

func (*ACL) Descriptor deprecated

func (*ACL) Descriptor() ([]byte, []int)

Deprecated: Use ACL.ProtoReflect.Descriptor instead.

func (*ACL) GetEntityType

func (x *ACL) GetEntityType() string

func (*ACL) GetID

func (x *ACL) GetID() string

func (*ACL) GetIDFilter

func (x *ACL) GetIDFilter() []string

func (*ACL) GetPermission

func (x *ACL) GetPermission() ACL_Permission

func (*ACL) GetScope

func (m *ACL) GetScope() isACL_Scope

func (*ACL) GetScopeNetworkIDs

func (x *ACL) GetScopeNetworkIDs() *ACL_NetworkIDs

func (*ACL) GetScopeWildcard

func (x *ACL) GetScopeWildcard() ACL_Wildcard

func (*ACL) GetType

func (m *ACL) GetType() isACL_Type

func (*ACL) GetTypeWildcard

func (x *ACL) GetTypeWildcard() ACL_Wildcard

func (*ACL) GetVersion

func (x *ACL) GetVersion() uint64

func (*ACL) ProtoMessage

func (*ACL) ProtoMessage()

func (*ACL) ProtoReflect

func (x *ACL) ProtoReflect() protoreflect.Message

func (*ACL) Reset

func (x *ACL) Reset()

func (*ACL) String

func (x *ACL) String() string

type ACL_EntityType

type ACL_EntityType struct {
	EntityType string `protobuf:"bytes,30,opt,name=entity_type,json=entityType,proto3,oneof"`
}

type ACL_NetworkIDs

type ACL_NetworkIDs struct {
	IDs []string `protobuf:"bytes,1,rep,name=IDs,proto3" json:"IDs,omitempty"`
	// contains filtered or unexported fields
}

func (*ACL_NetworkIDs) Descriptor deprecated

func (*ACL_NetworkIDs) Descriptor() ([]byte, []int)

Deprecated: Use ACL_NetworkIDs.ProtoReflect.Descriptor instead.

func (*ACL_NetworkIDs) GetIDs

func (x *ACL_NetworkIDs) GetIDs() []string

func (*ACL_NetworkIDs) ProtoMessage

func (*ACL_NetworkIDs) ProtoMessage()

func (*ACL_NetworkIDs) ProtoReflect

func (x *ACL_NetworkIDs) ProtoReflect() protoreflect.Message

func (*ACL_NetworkIDs) Reset

func (x *ACL_NetworkIDs) Reset()

func (*ACL_NetworkIDs) String

func (x *ACL_NetworkIDs) String() string

type ACL_Permission

type ACL_Permission int32

OWN grants READ and WRITE

const (
	ACL_NO_PERM ACL_Permission = 0
	ACL_READ    ACL_Permission = 1
	ACL_WRITE   ACL_Permission = 2
	ACL_OWN     ACL_Permission = 3
)

func (ACL_Permission) Descriptor

func (ACL_Permission) Enum

func (x ACL_Permission) Enum() *ACL_Permission

func (ACL_Permission) EnumDescriptor deprecated

func (ACL_Permission) EnumDescriptor() ([]byte, []int)

Deprecated: Use ACL_Permission.Descriptor instead.

func (ACL_Permission) Number

func (ACL_Permission) String

func (x ACL_Permission) String() string

func (ACL_Permission) Type

type ACL_ScopeNetworkIDs

type ACL_ScopeNetworkIDs struct {
	ScopeNetworkIDs *ACL_NetworkIDs `protobuf:"bytes,10,opt,name=scope_networkIDs,json=scopeNetworkIDs,proto3,oneof"`
}

type ACL_ScopeWildcard

type ACL_ScopeWildcard struct {
	ScopeWildcard ACL_Wildcard `` /* 127-byte string literal not displayed */
}

type ACL_TypeWildcard

type ACL_TypeWildcard struct {
	TypeWildcard ACL_Wildcard `protobuf:"varint,31,opt,name=type_wildcard,json=typeWildcard,proto3,enum=magma.orc8r.configurator.storage.ACL_Wildcard,oneof"`
}

type ACL_Wildcard

type ACL_Wildcard int32
const (
	ACL_NO_WILDCARD  ACL_Wildcard = 0
	ACL_WILDCARD_ALL ACL_Wildcard = 1
)

func (ACL_Wildcard) Descriptor

func (ACL_Wildcard) Enum

func (x ACL_Wildcard) Enum() *ACL_Wildcard

func (ACL_Wildcard) EnumDescriptor deprecated

func (ACL_Wildcard) EnumDescriptor() ([]byte, []int)

Deprecated: Use ACL_Wildcard.Descriptor instead.

func (ACL_Wildcard) Number

func (ACL_Wildcard) String

func (x ACL_Wildcard) String() string

func (ACL_Wildcard) Type

type ConfiguratorStorage

type ConfiguratorStorage interface {

	// Commit commits the underlying transaction
	Commit() error

	// Rollback rolls back the underlying transaction
	Rollback() error

	// LoadNetworks returns a set of networks corresponding to the provided
	// load criteria. Any networks which aren't found are excluded from the
	// returned value.
	LoadNetworks(filter NetworkLoadFilter, loadCriteria NetworkLoadCriteria) (NetworkLoadResult, error)

	// LoadAllNetworks returns all networks registered
	LoadAllNetworks(loadCriteria NetworkLoadCriteria) ([]Network, error)

	// CreateNetwork creates a new network. The created network is returned.
	CreateNetwork(network Network) (Network, error)

	// UpdateNetworks updates a set of networks.
	UpdateNetworks(updates []NetworkUpdateCriteria) error

	// LoadEntities returns a set of entities corresponding to the provided
	// load criteria. Any entities which aren't found are excluded from the
	// returned value.
	LoadEntities(networkID string, filter EntityLoadFilter, loadCriteria EntityLoadCriteria) (EntityLoadResult, error)

	// CreateEntity creates a new entity. The created entity is returned
	// with system-generated fields filled in.
	CreateEntity(networkID string, entity NetworkEntity) (NetworkEntity, error)

	// UpdateEntity updates an entity.
	// The updates to the specified entity will be returned as a NetworkEntity
	// object. Apart from identity fields, only fields which were updated will
	// be filled out, with system-generated IDs included.
	UpdateEntity(networkID string, update EntityUpdateCriteria) (NetworkEntity, error)

	// LoadGraphForEntity returns the full DAG which contains the requested
	// entity. The load criteria fields on associations are ignored, and the
	// returned entities will always have both association fields filled out.
	LoadGraphForEntity(networkID string, entityID EntityID, loadCriteria EntityLoadCriteria) (EntityGraph, error)
}

ConfiguratorStorage is the interface for the configurator service's access to its data storage layer. Each ConfiguratorStorage instance is tied to a transaction within which all function calls operate.

type ConfiguratorStorageFactory

type ConfiguratorStorageFactory interface {
	// InitializeServiceStorage should be called on service start to initialize
	// the tables that configurator storage implementations will depend on.
	InitializeServiceStorage() error

	// StartTransaction returns a ConfiguratorStorage implementation bound to
	// a transaction. Transaction options can be optionally provided.
	StartTransaction(ctx context.Context, opts *storage.TxOptions) (ConfiguratorStorage, error)
}

ConfiguratorStorageFactory creates ConfiguratorStorage implementations bound to transactions.

func NewSQLConfiguratorStorageFactory

func NewSQLConfiguratorStorageFactory(db *sql.DB, generator storage.IDGenerator, sqlBuilder sqorc.StatementBuilder) ConfiguratorStorageFactory

NewSQLConfiguratorStorageFactory returns a ConfiguratorStorageFactory implementation backed by a SQL database.

type EntityAssociationsToSet

type EntityAssociationsToSet struct {
	AssociationsToSet []*EntityID `protobuf:"bytes,1,rep,name=associations_to_set,json=associationsToSet,proto3" json:"associations_to_set,omitempty"`
	// contains filtered or unexported fields
}

func (*EntityAssociationsToSet) Descriptor deprecated

func (*EntityAssociationsToSet) Descriptor() ([]byte, []int)

Deprecated: Use EntityAssociationsToSet.ProtoReflect.Descriptor instead.

func (*EntityAssociationsToSet) GetAssociationsToSet

func (x *EntityAssociationsToSet) GetAssociationsToSet() []*EntityID

func (*EntityAssociationsToSet) ProtoMessage

func (*EntityAssociationsToSet) ProtoMessage()

func (*EntityAssociationsToSet) ProtoReflect

func (x *EntityAssociationsToSet) ProtoReflect() protoreflect.Message

func (*EntityAssociationsToSet) Reset

func (x *EntityAssociationsToSet) Reset()

func (*EntityAssociationsToSet) String

func (x *EntityAssociationsToSet) String() string

type EntityGraph

type EntityGraph struct {

	// All nodes in the graph
	Entities []*NetworkEntity `protobuf:"bytes,1,rep,name=entities,proto3" json:"entities,omitempty"`
	// All nodes in the graph which don't have any edges terminating at them.
	RootEntities []*EntityID `protobuf:"bytes,2,rep,name=root_entities,json=rootEntities,proto3" json:"root_entities,omitempty"`
	// All edges in the graph.
	Edges []*GraphEdge `protobuf:"bytes,3,rep,name=edges,proto3" json:"edges,omitempty"`
	// contains filtered or unexported fields
}

EntityGraph represents a DAG of associated network entities.

func (*EntityGraph) Descriptor deprecated

func (*EntityGraph) Descriptor() ([]byte, []int)

Deprecated: Use EntityGraph.ProtoReflect.Descriptor instead.

func (*EntityGraph) GetEdges

func (x *EntityGraph) GetEdges() []*GraphEdge

func (*EntityGraph) GetEntities

func (x *EntityGraph) GetEntities() []*NetworkEntity

func (*EntityGraph) GetRootEntities

func (x *EntityGraph) GetRootEntities() []*EntityID

func (*EntityGraph) ProtoMessage

func (*EntityGraph) ProtoMessage()

func (*EntityGraph) ProtoReflect

func (x *EntityGraph) ProtoReflect() protoreflect.Message

func (*EntityGraph) Reset

func (x *EntityGraph) Reset()

func (*EntityGraph) String

func (x *EntityGraph) String() string

type EntityID

type EntityID struct {
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Key  string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*EntityID) Descriptor deprecated

func (*EntityID) Descriptor() ([]byte, []int)

Deprecated: Use EntityID.ProtoReflect.Descriptor instead.

func (*EntityID) FromTypeAndKey

func (m *EntityID) FromTypeAndKey(tk storage.TypeAndKey) *EntityID

func (*EntityID) GetKey

func (x *EntityID) GetKey() string

func (*EntityID) GetType

func (x *EntityID) GetType() string

func (*EntityID) ProtoMessage

func (*EntityID) ProtoMessage()

func (*EntityID) ProtoReflect

func (x *EntityID) ProtoReflect() protoreflect.Message

func (*EntityID) Reset

func (x *EntityID) Reset()

func (*EntityID) String

func (x *EntityID) String() string

func (*EntityID) ToTypeAndKey

func (m *EntityID) ToTypeAndKey() storage.TypeAndKey

type EntityLoadCriteria

type EntityLoadCriteria struct {

	// Set LoadMetadata to true to load the metadata fields (name, description)
	LoadMetadata       bool `protobuf:"varint,1,opt,name=load_metadata,json=loadMetadata,proto3" json:"load_metadata,omitempty"`
	LoadConfig         bool `protobuf:"varint,2,opt,name=load_config,json=loadConfig,proto3" json:"load_config,omitempty"`
	LoadAssocsToThis   bool `protobuf:"varint,3,opt,name=load_assocs_to_this,json=loadAssocsToThis,proto3" json:"load_assocs_to_this,omitempty"`
	LoadAssocsFromThis bool `protobuf:"varint,4,opt,name=load_assocs_from_this,json=loadAssocsFromThis,proto3" json:"load_assocs_from_this,omitempty"`
	LoadPermissions    bool `protobuf:"varint,5,opt,name=load_permissions,json=loadPermissions,proto3" json:"load_permissions,omitempty"`
	// contains filtered or unexported fields
}

EntityLoadCriteria specifies how much of an entity to load

func (*EntityLoadCriteria) Descriptor deprecated

func (*EntityLoadCriteria) Descriptor() ([]byte, []int)

Deprecated: Use EntityLoadCriteria.ProtoReflect.Descriptor instead.

func (*EntityLoadCriteria) GetLoadAssocsFromThis

func (x *EntityLoadCriteria) GetLoadAssocsFromThis() bool

func (*EntityLoadCriteria) GetLoadAssocsToThis

func (x *EntityLoadCriteria) GetLoadAssocsToThis() bool

func (*EntityLoadCriteria) GetLoadConfig

func (x *EntityLoadCriteria) GetLoadConfig() bool

func (*EntityLoadCriteria) GetLoadMetadata

func (x *EntityLoadCriteria) GetLoadMetadata() bool

func (*EntityLoadCriteria) GetLoadPermissions

func (x *EntityLoadCriteria) GetLoadPermissions() bool

func (*EntityLoadCriteria) ProtoMessage

func (*EntityLoadCriteria) ProtoMessage()

func (*EntityLoadCriteria) ProtoReflect

func (x *EntityLoadCriteria) ProtoReflect() protoreflect.Message

func (*EntityLoadCriteria) Reset

func (x *EntityLoadCriteria) Reset()

func (*EntityLoadCriteria) String

func (x *EntityLoadCriteria) String() string

type EntityLoadFilter

type EntityLoadFilter struct {

	// If TypeFilter is provided, the query will return all entities matching
	// the given type.
	TypeFilter *wrappers.StringValue `protobuf:"bytes,1,opt,name=type_filter,json=typeFilter,proto3" json:"type_filter,omitempty"`
	// If KeyFilter is provided, the query will return all entities matching the
	// given ID.
	KeyFilter *wrappers.StringValue `protobuf:"bytes,2,opt,name=key_filter,json=keyFilter,proto3" json:"key_filter,omitempty"`
	// If IDs is provided, the query will return all entities matching the
	// provided TypeAndKeys. TypeFilter and KeyFilter are ignored if IDs is
	// provided.
	IDs []*EntityID `protobuf:"bytes,3,rep,name=IDs,proto3" json:"IDs,omitempty"`
	// Internal-only
	GraphID *wrappers.StringValue `protobuf:"bytes,4,opt,name=graphID,proto3" json:"graphID,omitempty"`
	// If PhysicalID is provided, the query will return all entities matching
	// the provided ID. All other fields are ignored if this is set.
	PhysicalID *wrappers.StringValue `protobuf:"bytes,5,opt,name=physicalID,proto3" json:"physicalID,omitempty"`
	// contains filtered or unexported fields
}

EntityLoadFilter specifies which entities to load from storage

func (*EntityLoadFilter) Descriptor deprecated

func (*EntityLoadFilter) Descriptor() ([]byte, []int)

Deprecated: Use EntityLoadFilter.ProtoReflect.Descriptor instead.

func (*EntityLoadFilter) GetGraphID

func (x *EntityLoadFilter) GetGraphID() *wrappers.StringValue

func (*EntityLoadFilter) GetIDs

func (x *EntityLoadFilter) GetIDs() []*EntityID

func (*EntityLoadFilter) GetKeyFilter

func (x *EntityLoadFilter) GetKeyFilter() *wrappers.StringValue

func (*EntityLoadFilter) GetPhysicalID

func (x *EntityLoadFilter) GetPhysicalID() *wrappers.StringValue

func (*EntityLoadFilter) GetTypeFilter

func (x *EntityLoadFilter) GetTypeFilter() *wrappers.StringValue

func (*EntityLoadFilter) IsLoadAllEntities

func (m *EntityLoadFilter) IsLoadAllEntities() bool

IsLoadAllEntities return true if the EntityLoadFilter is specifying to load all entities in a network, false if there are any filter conditions.

func (*EntityLoadFilter) ProtoMessage

func (*EntityLoadFilter) ProtoMessage()

func (*EntityLoadFilter) ProtoReflect

func (x *EntityLoadFilter) ProtoReflect() protoreflect.Message

func (*EntityLoadFilter) Reset

func (x *EntityLoadFilter) Reset()

func (*EntityLoadFilter) String

func (x *EntityLoadFilter) String() string

type EntityLoadResult

type EntityLoadResult struct {
	Entities         []*NetworkEntity `protobuf:"bytes,1,rep,name=entities,proto3" json:"entities,omitempty"`
	EntitiesNotFound []*EntityID      `protobuf:"bytes,2,rep,name=entities_not_found,json=entitiesNotFound,proto3" json:"entities_not_found,omitempty"`
	// contains filtered or unexported fields
}

func (*EntityLoadResult) Descriptor deprecated

func (*EntityLoadResult) Descriptor() ([]byte, []int)

Deprecated: Use EntityLoadResult.ProtoReflect.Descriptor instead.

func (*EntityLoadResult) GetEntities

func (x *EntityLoadResult) GetEntities() []*NetworkEntity

func (*EntityLoadResult) GetEntitiesNotFound

func (x *EntityLoadResult) GetEntitiesNotFound() []*EntityID

func (*EntityLoadResult) ProtoMessage

func (*EntityLoadResult) ProtoMessage()

func (*EntityLoadResult) ProtoReflect

func (x *EntityLoadResult) ProtoReflect() protoreflect.Message

func (*EntityLoadResult) Reset

func (x *EntityLoadResult) Reset()

func (*EntityLoadResult) String

func (x *EntityLoadResult) String() string

type EntityUpdateCriteria

type EntityUpdateCriteria struct {

	// (Type, Key) of the entity to update
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Key  string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// Set DeleteEntity to true to mark the entity for deletion
	DeleteEntity   bool                  `protobuf:"varint,10,opt,name=delete_entity,json=deleteEntity,proto3" json:"delete_entity,omitempty"`
	NewName        *wrappers.StringValue `protobuf:"bytes,20,opt,name=new_name,json=newName,proto3" json:"new_name,omitempty"`
	NewDescription *wrappers.StringValue `protobuf:"bytes,21,opt,name=new_description,json=newDescription,proto3" json:"new_description,omitempty"`
	NewPhysicalID  *wrappers.StringValue `protobuf:"bytes,22,opt,name=new_physicalID,json=newPhysicalID,proto3" json:"new_physicalID,omitempty"`
	// A nil value here indicates no update.
	NewConfig *wrappers.BytesValue `protobuf:"bytes,23,opt,name=new_config,json=newConfig,proto3" json:"new_config,omitempty"`
	// Wrap the repeated field in a message because a nil struct and a struct
	// with an empty associations list mean different things.
	AssociationsToSet    *EntityAssociationsToSet `protobuf:"bytes,30,opt,name=associations_to_set,json=associationsToSet,proto3" json:"associations_to_set,omitempty"`
	AssociationsToAdd    []*EntityID              `protobuf:"bytes,31,rep,name=associations_to_add,json=associationsToAdd,proto3" json:"associations_to_add,omitempty"`
	AssociationsToDelete []*EntityID              `protobuf:"bytes,32,rep,name=associations_to_delete,json=associationsToDelete,proto3" json:"associations_to_delete,omitempty"`
	// New ACLs to add. ACL IDs are ignored and generated by the system.
	PermissionsToCreate []*ACL   `protobuf:"bytes,40,rep,name=permissions_to_create,json=permissionsToCreate,proto3" json:"permissions_to_create,omitempty"`
	PermissionsToUpdate []*ACL   `protobuf:"bytes,41,rep,name=permissions_to_update,json=permissionsToUpdate,proto3" json:"permissions_to_update,omitempty"`
	PermissionsToDelete []string `protobuf:"bytes,42,rep,name=permissions_to_delete,json=permissionsToDelete,proto3" json:"permissions_to_delete,omitempty"`
	// contains filtered or unexported fields
}

EntityUpdateCriteria specifies a patch operation on a network entity.

func (*EntityUpdateCriteria) Descriptor deprecated

func (*EntityUpdateCriteria) Descriptor() ([]byte, []int)

Deprecated: Use EntityUpdateCriteria.ProtoReflect.Descriptor instead.

func (*EntityUpdateCriteria) GetAssociationsToAdd

func (x *EntityUpdateCriteria) GetAssociationsToAdd() []*EntityID

func (*EntityUpdateCriteria) GetAssociationsToDelete

func (x *EntityUpdateCriteria) GetAssociationsToDelete() []*EntityID

func (*EntityUpdateCriteria) GetAssociationsToSet

func (x *EntityUpdateCriteria) GetAssociationsToSet() *EntityAssociationsToSet

func (*EntityUpdateCriteria) GetDeleteEntity

func (x *EntityUpdateCriteria) GetDeleteEntity() bool

func (*EntityUpdateCriteria) GetID

func (m *EntityUpdateCriteria) GetID() *EntityID

func (*EntityUpdateCriteria) GetKey

func (x *EntityUpdateCriteria) GetKey() string

func (*EntityUpdateCriteria) GetNewConfig

func (x *EntityUpdateCriteria) GetNewConfig() *wrappers.BytesValue

func (*EntityUpdateCriteria) GetNewDescription

func (x *EntityUpdateCriteria) GetNewDescription() *wrappers.StringValue

func (*EntityUpdateCriteria) GetNewName

func (x *EntityUpdateCriteria) GetNewName() *wrappers.StringValue

func (*EntityUpdateCriteria) GetNewPhysicalID

func (x *EntityUpdateCriteria) GetNewPhysicalID() *wrappers.StringValue

func (*EntityUpdateCriteria) GetPermissionsToCreate

func (x *EntityUpdateCriteria) GetPermissionsToCreate() []*ACL

func (*EntityUpdateCriteria) GetPermissionsToDelete

func (x *EntityUpdateCriteria) GetPermissionsToDelete() []string

func (*EntityUpdateCriteria) GetPermissionsToUpdate

func (x *EntityUpdateCriteria) GetPermissionsToUpdate() []*ACL

func (*EntityUpdateCriteria) GetType

func (x *EntityUpdateCriteria) GetType() string

func (*EntityUpdateCriteria) GetTypeAndKey

func (m *EntityUpdateCriteria) GetTypeAndKey() storage.TypeAndKey

func (*EntityUpdateCriteria) ProtoMessage

func (*EntityUpdateCriteria) ProtoMessage()

func (*EntityUpdateCriteria) ProtoReflect

func (x *EntityUpdateCriteria) ProtoReflect() protoreflect.Message

func (*EntityUpdateCriteria) Reset

func (x *EntityUpdateCriteria) Reset()

func (*EntityUpdateCriteria) String

func (x *EntityUpdateCriteria) String() string

type GraphEdge

type GraphEdge struct {
	To   *EntityID `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"`
	From *EntityID `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`
	// contains filtered or unexported fields
}

GraphEdge represents a directed edge within a graph

func (*GraphEdge) Descriptor deprecated

func (*GraphEdge) Descriptor() ([]byte, []int)

Deprecated: Use GraphEdge.ProtoReflect.Descriptor instead.

func (*GraphEdge) GetFrom

func (x *GraphEdge) GetFrom() *EntityID

func (*GraphEdge) GetTo

func (x *GraphEdge) GetTo() *EntityID

func (*GraphEdge) ProtoMessage

func (*GraphEdge) ProtoMessage()

func (*GraphEdge) ProtoReflect

func (x *GraphEdge) ProtoReflect() protoreflect.Message

func (*GraphEdge) Reset

func (x *GraphEdge) Reset()

func (*GraphEdge) String

func (x *GraphEdge) String() string

func (*GraphEdge) ToString

func (m *GraphEdge) ToString() string

type Network

type Network struct {
	ID          string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Type        string `protobuf:"bytes,2,opt,name=Type,proto3" json:"Type,omitempty"`
	Name        string `protobuf:"bytes,10,opt,name=name,proto3" json:"name,omitempty"`
	Description string `protobuf:"bytes,11,opt,name=description,proto3" json:"description,omitempty"`
	// Configs maps between a type value and a serialized representation of the
	// configuration value. The type value will point to the Serde
	// implementation which can deserialize the associated value.
	Configs map[string][]byte `` /* 156-byte string literal not displayed */
	Version uint64            `protobuf:"varint,30,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

A network represents a tenant. Networks can be configured in a hierarchical manner - network-level configurations are assumed to apply across multiple entities within the network.

func (*Network) Descriptor deprecated

func (*Network) Descriptor() ([]byte, []int)

Deprecated: Use Network.ProtoReflect.Descriptor instead.

func (*Network) GetConfigs

func (x *Network) GetConfigs() map[string][]byte

func (*Network) GetDescription

func (x *Network) GetDescription() string

func (*Network) GetID

func (x *Network) GetID() string

func (*Network) GetName

func (x *Network) GetName() string

func (*Network) GetType

func (x *Network) GetType() string

func (*Network) GetVersion

func (x *Network) GetVersion() uint64

func (*Network) ProtoMessage

func (*Network) ProtoMessage()

func (*Network) ProtoReflect

func (x *Network) ProtoReflect() protoreflect.Message

func (*Network) Reset

func (x *Network) Reset()

func (*Network) String

func (x *Network) String() string

type NetworkEntity

type NetworkEntity struct {
	NetworkID string `protobuf:"bytes,1,opt,name=networkID,proto3" json:"networkID,omitempty"`
	// (Type, Key) forms a unique identifier for the network entity within its
	// network.
	Type        string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Key         string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
	Name        string `protobuf:"bytes,10,opt,name=name,proto3" json:"name,omitempty"`
	Description string `protobuf:"bytes,11,opt,name=description,proto3" json:"description,omitempty"`
	// PhysicalID will be non-empty if the entity corresponds to a physical
	// asset.
	PhysicalID string `protobuf:"bytes,20,opt,name=physicalID,proto3" json:"physicalID,omitempty"`
	// Serialized view of the entity's configuration. The value of the Type
	// field will determine the Serde implementation for this value.
	Config []byte `protobuf:"bytes,30,opt,name=config,proto3" json:"config,omitempty"`
	// GraphID is a mostly-internal field to designate the DAG that this
	// network entity belongs to. This field is system-generated and will be
	// ignored if set during entity creation.
	GraphID string `protobuf:"bytes,40,opt,name=graphID,proto3" json:"graphID,omitempty"`
	// Associations are the directed edges originating from this entity.
	Associations []*EntityID `protobuf:"bytes,50,rep,name=associations,proto3" json:"associations,omitempty"`
	// ParentAssociations are the directed edges ending at this entity.
	// This is a read-only field and will be ignored if set during entity
	// creation.
	ParentAssociations []*EntityID `protobuf:"bytes,51,rep,name=parent_associations,json=parentAssociations,proto3" json:"parent_associations,omitempty"`
	// Permissions defines the access control for this entity.
	Permissions []*ACL `protobuf:"bytes,60,rep,name=permissions,proto3" json:"permissions,omitempty"`
	Version     uint64 `protobuf:"varint,70,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

NetworkEntity is the storage representation of a logical component of a network. Networks are partitioned into DAGs of entities.

func (*NetworkEntity) Descriptor deprecated

func (*NetworkEntity) Descriptor() ([]byte, []int)

Deprecated: Use NetworkEntity.ProtoReflect.Descriptor instead.

func (*NetworkEntity) GetAssociations

func (x *NetworkEntity) GetAssociations() []*EntityID

func (*NetworkEntity) GetConfig

func (x *NetworkEntity) GetConfig() []byte

func (*NetworkEntity) GetDescription

func (x *NetworkEntity) GetDescription() string

func (NetworkEntity) GetGraphEdges

func (m NetworkEntity) GetGraphEdges() []*GraphEdge

func (*NetworkEntity) GetGraphID

func (x *NetworkEntity) GetGraphID() string

func (*NetworkEntity) GetID

func (m *NetworkEntity) GetID() *EntityID

func (*NetworkEntity) GetKey

func (x *NetworkEntity) GetKey() string

func (*NetworkEntity) GetName

func (x *NetworkEntity) GetName() string

func (*NetworkEntity) GetNetworkID

func (x *NetworkEntity) GetNetworkID() string

func (*NetworkEntity) GetParentAssociations

func (x *NetworkEntity) GetParentAssociations() []*EntityID

func (*NetworkEntity) GetPermissions

func (x *NetworkEntity) GetPermissions() []*ACL

func (*NetworkEntity) GetPhysicalID

func (x *NetworkEntity) GetPhysicalID() string

func (*NetworkEntity) GetType

func (x *NetworkEntity) GetType() string

func (*NetworkEntity) GetTypeAndKey

func (m *NetworkEntity) GetTypeAndKey() storage.TypeAndKey

func (*NetworkEntity) GetVersion

func (x *NetworkEntity) GetVersion() uint64

func (*NetworkEntity) ProtoMessage

func (*NetworkEntity) ProtoMessage()

func (*NetworkEntity) ProtoReflect

func (x *NetworkEntity) ProtoReflect() protoreflect.Message

func (*NetworkEntity) Reset

func (x *NetworkEntity) Reset()

func (*NetworkEntity) String

func (x *NetworkEntity) String() string

type NetworkLoadCriteria

type NetworkLoadCriteria struct {

	// Set LoadMetadata to true to load metadata fields (name, description)
	LoadMetadata bool `protobuf:"varint,1,opt,name=load_metadata,json=loadMetadata,proto3" json:"load_metadata,omitempty"`
	LoadConfigs  bool `protobuf:"varint,2,opt,name=load_configs,json=loadConfigs,proto3" json:"load_configs,omitempty"`
	// contains filtered or unexported fields
}

NetworkLoadCriteria specifies how much of a network to load

func (*NetworkLoadCriteria) Descriptor deprecated

func (*NetworkLoadCriteria) Descriptor() ([]byte, []int)

Deprecated: Use NetworkLoadCriteria.ProtoReflect.Descriptor instead.

func (*NetworkLoadCriteria) GetLoadConfigs

func (x *NetworkLoadCriteria) GetLoadConfigs() bool

func (*NetworkLoadCriteria) GetLoadMetadata

func (x *NetworkLoadCriteria) GetLoadMetadata() bool

func (*NetworkLoadCriteria) ProtoMessage

func (*NetworkLoadCriteria) ProtoMessage()

func (*NetworkLoadCriteria) ProtoReflect

func (x *NetworkLoadCriteria) ProtoReflect() protoreflect.Message

func (*NetworkLoadCriteria) Reset

func (x *NetworkLoadCriteria) Reset()

func (*NetworkLoadCriteria) String

func (x *NetworkLoadCriteria) String() string

type NetworkLoadFilter

type NetworkLoadFilter struct {

	// If IDs is provided, the query will return all entities matching the
	// provided ids. TypeFilter is ignored if IDs is
	// provided.
	Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
	// If TypeFilter is provided, the query will return all entities matching
	// the given type.
	TypeFilter *wrappers.StringValue `protobuf:"bytes,2,opt,name=type_filter,json=typeFilter,proto3" json:"type_filter,omitempty"`
	// contains filtered or unexported fields
}

func (*NetworkLoadFilter) Descriptor deprecated

func (*NetworkLoadFilter) Descriptor() ([]byte, []int)

Deprecated: Use NetworkLoadFilter.ProtoReflect.Descriptor instead.

func (*NetworkLoadFilter) GetIds

func (x *NetworkLoadFilter) GetIds() []string

func (*NetworkLoadFilter) GetTypeFilter

func (x *NetworkLoadFilter) GetTypeFilter() *wrappers.StringValue

func (*NetworkLoadFilter) ProtoMessage

func (*NetworkLoadFilter) ProtoMessage()

func (*NetworkLoadFilter) ProtoReflect

func (x *NetworkLoadFilter) ProtoReflect() protoreflect.Message

func (*NetworkLoadFilter) Reset

func (x *NetworkLoadFilter) Reset()

func (*NetworkLoadFilter) String

func (x *NetworkLoadFilter) String() string

type NetworkLoadResult

type NetworkLoadResult struct {
	Networks           []*Network `protobuf:"bytes,1,rep,name=networks,proto3" json:"networks,omitempty"`
	NetworkIDsNotFound []string   `protobuf:"bytes,2,rep,name=networkIDs_not_found,json=networkIDsNotFound,proto3" json:"networkIDs_not_found,omitempty"`
	// contains filtered or unexported fields
}

func (*NetworkLoadResult) Descriptor deprecated

func (*NetworkLoadResult) Descriptor() ([]byte, []int)

Deprecated: Use NetworkLoadResult.ProtoReflect.Descriptor instead.

func (*NetworkLoadResult) GetNetworkIDsNotFound

func (x *NetworkLoadResult) GetNetworkIDsNotFound() []string

func (*NetworkLoadResult) GetNetworks

func (x *NetworkLoadResult) GetNetworks() []*Network

func (*NetworkLoadResult) ProtoMessage

func (*NetworkLoadResult) ProtoMessage()

func (*NetworkLoadResult) ProtoReflect

func (x *NetworkLoadResult) ProtoReflect() protoreflect.Message

func (*NetworkLoadResult) Reset

func (x *NetworkLoadResult) Reset()

func (*NetworkLoadResult) String

func (x *NetworkLoadResult) String() string

type NetworkUpdateCriteria

type NetworkUpdateCriteria struct {

	// ID of the network to update
	ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	// Set DeleteNetwork to true to delete the network
	DeleteNetwork bool `protobuf:"varint,10,opt,name=delete_network,json=deleteNetwork,proto3" json:"delete_network,omitempty"`
	// Set NewName, NewDescription, or NewType to nil to indicate that no update is
	// desired. To clear the value of name or description, set these fields to
	// a wrapper to an empty string.
	NewName        *wrappers.StringValue `protobuf:"bytes,20,opt,name=new_name,json=newName,proto3" json:"new_name,omitempty"`
	NewDescription *wrappers.StringValue `protobuf:"bytes,21,opt,name=new_description,json=newDescription,proto3" json:"new_description,omitempty"`
	NewType        *wrappers.StringValue `protobuf:"bytes,22,opt,name=new_type,json=newType,proto3" json:"new_type,omitempty"`
	// New config values to add or existing ones to update
	ConfigsToAddOrUpdate map[string][]byte `` /* 216-byte string literal not displayed */
	// Config values to delete
	ConfigsToDelete []string `protobuf:"bytes,31,rep,name=configs_to_delete,json=configsToDelete,proto3" json:"configs_to_delete,omitempty"`
	// contains filtered or unexported fields
}

NetworkUpdateCriteria specifies how to update a network

func (*NetworkUpdateCriteria) Descriptor deprecated

func (*NetworkUpdateCriteria) Descriptor() ([]byte, []int)

Deprecated: Use NetworkUpdateCriteria.ProtoReflect.Descriptor instead.

func (*NetworkUpdateCriteria) GetConfigsToAddOrUpdate

func (x *NetworkUpdateCriteria) GetConfigsToAddOrUpdate() map[string][]byte

func (*NetworkUpdateCriteria) GetConfigsToDelete

func (x *NetworkUpdateCriteria) GetConfigsToDelete() []string

func (*NetworkUpdateCriteria) GetDeleteNetwork

func (x *NetworkUpdateCriteria) GetDeleteNetwork() bool

func (*NetworkUpdateCriteria) GetID

func (x *NetworkUpdateCriteria) GetID() string

func (*NetworkUpdateCriteria) GetNewDescription

func (x *NetworkUpdateCriteria) GetNewDescription() *wrappers.StringValue

func (*NetworkUpdateCriteria) GetNewName

func (x *NetworkUpdateCriteria) GetNewName() *wrappers.StringValue

func (*NetworkUpdateCriteria) GetNewType

func (x *NetworkUpdateCriteria) GetNewType() *wrappers.StringValue

func (*NetworkUpdateCriteria) ProtoMessage

func (*NetworkUpdateCriteria) ProtoMessage()

func (*NetworkUpdateCriteria) ProtoReflect

func (x *NetworkUpdateCriteria) ProtoReflect() protoreflect.Message

func (*NetworkUpdateCriteria) Reset

func (x *NetworkUpdateCriteria) Reset()

func (*NetworkUpdateCriteria) String

func (x *NetworkUpdateCriteria) String() string

Jump to

Keyboard shortcuts

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