resources

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindFederation = "Federation"
	//KindController    = "Controller"
	KindAccount       = "Account"
	KindRealm         = "Realm"
	KindUser          = "User"
	KindSecurityGroup = "SecurityGroup"
	KindACL           = "ACL"
	KindRole          = "Role"
	KindTenant        = "Tenant"
	KindProject       = "Project"
	KindWorkflow      = "Workflow"
	KindOperation     = "Operation"
	KindNetwork       = "Network"
	KindVRF           = "VRF"
	KindNode          = "Node"
	KindRoutingTable  = "RoutingTable"
)
View Source
const (
	DefaultSecurityGroupID      = "all-tenants"
	DefaultSecurityGroupTenants = ".*"
	DefaultRoleID               = "admin"
	DefaultRolePermissions      = ".*"
	DefaultACLID                = "all-nodes"
	DefaultACLMMIDs             = ".*"
	DefaultProjectID            = "default"
	DefaultTenantID             = "default"
	DefaultNetID                = "default"
	DefaultNetworkCIDR          = "10.248.0.0/16"
	DefaultSubnetID             = "subnet-248"
	DefaultSubnetCIDR           = "10.248.0.0/24"
)
View Source
const (
	RatingA = "A"
	RatingB = "B"
	RatingC = "C"
	RatingD = "D"
	RatingE = "E"
)
View Source
const APIVersion = "v1"
View Source
const IPAMRequestedIPv4Unavailable = "unavailable"

Variables

This section is empty.

Functions

func CheckAccountRMSTrafficLimits

func CheckAccountRMSTrafficLimits(ctx context.Context, accountID string) error

func CheckUserEmail

func CheckUserEmail(realm, userEmail string) bool

func DecodeUserToken

func DecodeUserToken(userToken string) (*iam.User, error)

func DecodeWorkflow

func DecodeWorkflow(wfWebhookToken string) (*workflow.Workflow, error)

func DeleteACL

func DeleteACL(ctx context.Context, a *iam.ACL) error

func DeleteAccount

func DeleteAccount(ctx context.Context, a *account.Account) error

func DeleteFederation

func DeleteFederation(ctx context.Context, fed *controller.Federation) error

func DeleteFederationController

func DeleteFederationController(ctx context.Context, fedID string, controllerID string) error

func DeleteNetwork

func DeleteNetwork(ctx context.Context, n *network.Network) error

func DeleteNetworkPolicy

func DeleteNetworkPolicy(ctx context.Context, v *network.VRF) (*network.Policy, error)

func DeleteNode

func DeleteNode(ctx context.Context, n *network.Node) error

func DeleteOperation

func DeleteOperation(ctx context.Context, o *operation.Operation) error

func DeleteProject

func DeleteProject(ctx context.Context, p *project.Project) error

func DeleteRole

func DeleteRole(ctx context.Context, r *iam.Role) error

func DeleteSecurityGroup

func DeleteSecurityGroup(ctx context.Context, sg *iam.SecurityGroup) error

func DeleteTenant

func DeleteTenant(ctx context.Context, t *tenant.Tenant) error

func DeleteUser

func DeleteUser(ctx context.Context, u *iam.User) error

func DeleteVRF

func DeleteVRF(ctx context.Context, v *network.VRF) error

func DeleteWorkflow

func DeleteWorkflow(ctx context.Context, wf *workflow.Workflow) error

func DisableAccount

func DisableAccount(ctx context.Context, accountID string) (*account.Account, error)

func DisableUser

func DisableUser(ctx context.Context, u *iam.User) (*iam.User, error)

func EnableAccount

func EnableAccount(ctx context.Context, accountID string) (*account.Account, error)

func EnableUser

func EnableUser(ctx context.Context, u *iam.User) (*iam.User, error)

func EncodeAccountToken

func EncodeAccountToken(accountID string) string

func EncodeUserToken

func EncodeUserToken(realm, userEmail string) (string, error)

func GetControllerCapabilities

func GetControllerCapabilities() (*controller.Capabilities, error)

func GetControllerID

func GetControllerID() (string, error)

func GetFederation

func GetFederation(ctx context.Context, fedID string) (*controller.Federation, error)

func GetFederationController

func GetFederationController(ctx context.Context, fedID string, controllerID string) (*controller.Controller, error)

func GetNetworkPolicy

func GetNetworkPolicy(ctx context.Context, v *network.VRF) (*network.Policy, error)

func GetNodeFailProbability

func GetNodeFailProbability(ctx context.Context, n *network.Node) (float32, error)

func GetNodeNetworkEndpoint

func GetNodeNetworkEndpoint(ctx context.Context, e *network.Endpoint) (*network.NetworkEndpoint, error)

func GetWorkflowFailProbability

func GetWorkflowFailProbability(ctx context.Context, wf *workflow.Workflow) (float32, error)

func ListACLs

func ListACLs(ctx context.Context, a *account.Account) (*iam.ACLs, error)

func ListAccounts

func ListAccounts(ctx context.Context) (*account.Accounts, error)

func ListFederationControllers

func ListFederationControllers(ctx context.Context, fedID string) (*controller.Controllers, error)

func ListNetworks

func ListNetworks(ctx context.Context, t *tenant.Tenant) (*network.Networks, error)

func ListNodeMMIDs

func ListNodeMMIDs(accountID string) (*network.MMIDs, error)

func ListNodes

func ListNodes(ctx context.Context, v *network.VRF) (*network.Nodes, error)

func ListOperations

func ListOperations(ctx context.Context, wf *workflow.Workflow) (*operation.Operations, error)

func ListProjects

func ListProjects(ctx context.Context, accountID string) (*project.Projects, error)

func ListRoles

func ListRoles(ctx context.Context, a *account.Account) (*iam.Roles, error)

func ListSecurityGroups

func ListSecurityGroups(ctx context.Context, a *account.Account) (*iam.SecurityGroups, error)

func ListTenants

func ListTenants(ctx context.Context, a *account.Account) (*tenant.Tenants, error)

func ListUsers

func ListUsers(ctx context.Context, a *account.Account) (*iam.Users, error)

func ListVRFs

func ListVRFs(ctx context.Context, n *network.Network) (*network.VRFs, error)

func ListWorkflows

func ListWorkflows(ctx context.Context, p *project.Project) (*workflow.Workflows, error)

func NetworkHistoryDailyIndex

func NetworkHistoryDailyIndex(day int) string

func NetworkHistoryHourlyIndex

func NetworkHistoryHourlyIndex(hour int) string

func NetworkHistoryMonthlyIndex

func NetworkHistoryMonthlyIndex(year int, month time.Month) string

func RegisterEndpoint

func RegisterNode

func RegisterNode(ctx context.Context, n *network.Node) (*network.Node, error)

func RemoveEndpoint

func RemoveEndpoint(ctx context.Context, n *network.Node, e *network.NetworkEndpoint) (*network.Node, error)

func ResetNodeNetworkTraffic

func ResetNodeNetworkTraffic(ctx context.Context, n *network.Node) (*network.Node, error)

func SetACL

func SetACL(ctx context.Context, a *iam.ACL) (*iam.ACL, error)

func SetAccount

func SetAccount(ctx context.Context, a *account.Account) (*account.Account, error)

func SetAccountLimits

func SetAccountLimits(ctx context.Context, accountID string, l *account.Limits) (*account.Account, error)

func SetAccountTraffic

func SetAccountTraffic(ctx context.Context, n *network.Node, ms bool) error

func SetAccountType

func SetAccountType(ctx context.Context, accountID string, t string) (*account.Account, error)

func SetFederation

func SetFederation(ctx context.Context, fed *controller.Federation) (*controller.Federation, error)

func SetNetwork

func SetNetwork(ctx context.Context, n *network.Network) (*network.Network, error)

func SetNetworkPolicy

func SetNetworkPolicy(ctx context.Context, v *network.VRF) (*network.Policy, error)

func SetNodeDown

func SetNodeDown(ctx context.Context, n *network.Node) (*network.Node, error)

func SetNodeEventMetrics

func SetNodeEventMetrics(ctx context.Context, n *network.Node, er events.EventResult, timestamp int64) error

func SetNodeMetrics

func SetNodeMetrics(ctx context.Context, n *network.Node) error

func SetNodeUp

func SetNodeUp(ctx context.Context, n *network.Node) (*network.Node, error)

func SetOperation

func SetOperation(ctx context.Context, o *operation.Operation) error

func SetProject

func SetProject(ctx context.Context, p *project.Project) (*project.Project, error)

func SetRole

func SetRole(ctx context.Context, r *iam.Role) (*iam.Role, error)

func SetSecurityGroup

func SetSecurityGroup(ctx context.Context, sg *iam.SecurityGroup) (*iam.SecurityGroup, error)

func SetTenant

func SetTenant(ctx context.Context, t *tenant.Tenant) (*tenant.Tenant, error)

func SetUser

func SetUser(ctx context.Context, u *iam.User) (*iam.User, error)

func SetUserCredentialsPassword

func SetUserCredentialsPassword(ctx context.Context, u *iam.User) (*iam.User, error)

func SetUserCredentialsTOTP

func SetUserCredentialsTOTP(ctx context.Context, u *iam.User) (*iam.User, error)

func SetUserMetrics

func SetUserMetrics(ctx context.Context, u *iam.User, er events.EventResult, timestamp int64, userActivity string) error

func SetUserPasswordReset

func SetUserPasswordReset(ctx context.Context, u *iam.User) error

func SetVRF

func SetVRF(ctx context.Context, v *network.VRF) (*network.VRF, error)

func SetWorkflow

func SetWorkflow(ctx context.Context, wf *workflow.Workflow) (*workflow.Workflow, error)

func SetWorkflowEventMetrics

func SetWorkflowEventMetrics(ctx context.Context, wf *workflow.Workflow, er events.EventResult, timestamp int64) error

func UpdateAccountUsage

func UpdateAccountUsage(accountID string) error

func ValidAccount

func ValidAccount(ctx context.Context, accountID string) (bool, error)

Types

type ACLSpec

type ACLSpec struct {
	iam.ACL
}

type AccountSpec

type AccountSpec struct {
	account.Account
}

AccountSpec is the account specfication

type ESDocRef

type ESDocRef struct {
	Index string `json:"index,omitempty"`
	ObjID string `json:"objId,omitempty"`
}

type EndpointSpec

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

type FederationSpec

type FederationSpec struct {
	controller.Federation
}

type KVStoreRef

type KVStoreRef struct {
	ObjSet string `json:"objSet,omitempty"`
	ObjKey string `json:"objKey,omitempty"`
}

type Metadata

type Metadata struct {
	Name         string    `json:"name"`
	Realm        string    `json:"realm"`
	LastModified time.Time `json:"lastModified,omitempty"`
}

type NFID

type NFID string

func GetNFID

func GetNFID(nf *network.Filter) NFID

func (NFID) String

func (nfID NFID) String() string

type NetworkSpec

type NetworkSpec struct {
	network.Network
}

type NodeSpec

type NodeSpec struct {
	network.Node
}

type OperationSpec

type OperationSpec struct {
	operation.Operation
}

type ProjectSpec

type ProjectSpec struct {
	project.Project
}

type RTID

type RTID string

func GetRTID

func GetRTID(opts *routing.RoutingTableOpts) RTID

type RTSpec

type RTSpec struct {
	routing.RoutingTable
}

type RealmSpec

type RealmSpec struct {
	AccountID string `json:"accountId"`
}

type Ref

type Ref struct {
	NxDB KVStoreRef `json:"nxdb"`
	NxES ESDocRef   `json:"nxes"`
	// contains filtered or unexported fields
}

type Resource

type Resource struct {
	APIVersion string      `json:"apiVersion"`
	Kind       string      `json:"kind"`
	Metadata   Metadata    `json:"metadata"`
	Ref        Ref         `json:"ref"`
	Spec       interface{} `json:"spec"`
}

func GetACL

func GetACL(ctx context.Context, a *iam.ACL) (*Resource, error)

func GetAccount

func GetAccount(ctx context.Context, accountID string) (*Resource, error)

func GetNetwork

func GetNetwork(ctx context.Context, n *network.Network) (*Resource, error)

func GetNode

func GetNode(ctx context.Context, n *network.Node) (*Resource, error)

func GetOperation

func GetOperation(ctx context.Context, o *operation.Operation) (*Resource, error)

func GetProject

func GetProject(ctx context.Context, p *project.Project) (*Resource, error)

func GetRole

func GetRole(ctx context.Context, r *iam.Role) (*Resource, error)

func GetSecurityGroup

func GetSecurityGroup(ctx context.Context, sg *iam.SecurityGroup) (*Resource, error)

func GetTenant

func GetTenant(ctx context.Context, t *tenant.Tenant) (*Resource, error)

func GetUser

func GetUser(ctx context.Context, u *iam.User) (*Resource, error)

func GetVRF

func GetVRF(ctx context.Context, v *network.VRF) (*Resource, error)

func GetWorkflow

func GetWorkflow(ctx context.Context, wf *workflow.Workflow) (*Resource, error)

func New

func New(name, realm, objSet string, kind string) *Resource

func (*Resource) Delete

func (r *Resource) Delete(ctx context.Context) error

func (*Resource) Get

func (r *Resource) Get(ctx context.Context) error

func (*Resource) ImportFile

func (r *Resource) ImportFile(jsonFile, kind, realm string) error

func (*Resource) Lock

func (r *Resource) Lock()

func (*Resource) Set

func (r *Resource) Set(ctx context.Context) error

func (*Resource) Unlock

func (r *Resource) Unlock()

type Resources

type Resources []Resource

func (*Resources) List

func (rl *Resources) List(ctx context.Context, realm string, objSet string, kind string) error

type RoleSpec

type RoleSpec struct {
	iam.Role
}

type SecurityGroupSpec

type SecurityGroupSpec struct {
	iam.SecurityGroup
}

type TenantSpec

type TenantSpec struct {
	tenant.Tenant
}

type UserSpec

type UserSpec struct {
	iam.User
}

type VRFSpec

type VRFSpec struct {
	network.VRF
}

type WorkflowSpec

type WorkflowSpec struct {
	workflow.Workflow
}

Jump to

Keyboard shortcuts

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