services

package
v0.0.0-...-8bfe3b3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAgentKVOperationStore    = "STORE"
	UserAgentKVOperationRetrieve = "RETRIEVE"
	UserAgentKVOperationDelete   = "DELETE"
)

UserAgent key value store operations.

View Source
const ChownPath = "chown"

ChownPath is the path and the name of the chown endpoint.

View Source
const PropCollectionUpdatePath = "prop-collection-update"

PropCollectionUpdatePath is the path and the name of the prop-collection-update endpoint.

View Source
const SetTagPath = "set-tag"

SetTagPath is the path and the name of the set-tag endpoint.

View Source
const (
	UploadCloudKeysPath = "upload-cloud-keys"
)

API Path definitions.

Variables

View Source
var (
	// TagTypeNotUniquePerObject contains not unique tag-types per object
	TagTypeNotUniquePerObject = map[string]bool{
		"label": true,
	}
	// TagTypeAuthorizedOnAddressGroup contains authorized on address group tag-types
	TagTypeAuthorizedOnAddressGroup = map[string]bool{
		"label": true,
	}
)

Functions

func ContrailPlugins

func ContrailPlugins(
	sv Service,
	itd InTransactionDoer,
	mg baseservices.MetadataGetter,
	idToFQName IDToFQNameService,
) []apiserver.APIPlugin

ContrailPlugins returns plugins specific to Contrail.

func RESTUploadCloudKeys

func RESTUploadCloudKeys(c echo.Context) error

RESTUploadCloudKeys handles an /upload-cloud-keys REST request.

func UploadCloudKeys

func UploadCloudKeys(request *UploadCloudKeysBody, keyDefaults *KeyFileDefaults) error

UploadCloudKeys stores specified cloud secrets

Types

type ChownPlugin

type ChownPlugin struct {
	Service           Service
	InTransactionDoer InTransactionDoer
	MetadataGetter    baseservices.MetadataGetter
}

ChownPlugin provides chown HTTP endpoint and GRPC service.

func (*ChownPlugin) Chown

func (p *ChownPlugin) Chown(ctx context.Context, request *ChownRequest) (*types.Empty, error)

Chown handles chown request.

func (*ChownPlugin) RESTChown

func (p *ChownPlugin) RESTChown(c echo.Context) error

RESTChown handles chown request.

func (*ChownPlugin) RegisterGRPCAPI

func (p *ChownPlugin) RegisterGRPCAPI(r apiserver.GRPCRouter)

RegisterGRPCAPI registers the chown GRPC service.

func (*ChownPlugin) RegisterHTTPAPI

func (p *ChownPlugin) RegisterHTTPAPI(r apiserver.HTTPRouter)

RegisterHTTPAPI registers the chown endpoint.

type FQNameToIDService

type FQNameToIDService interface {
	FQNameToID(context.Context, *FQNameToIDRequest) (*FQNameToIDResponse, error)
}

FQNameToIDService interface.

type IDToFQNameService

type IDToFQNameService interface {
	IDToFQName(context.Context, *IDToFQNameRequest) (*IDToFQNameResponse, error)
}

IDToFQNameService interface.

type KeyFileDefaults

type KeyFileDefaults struct {
	KeyHomeDir             string
	SecretKeyFileName      string
	AccessKeyFileName      string
	SubscriptionIDFileName string
	ClientIDFileName       string
	ClientSecretFileName   string
	TenantIDFileName       string
	AccountFileName        string
}

KeyFileDefaults defines data format for various cloud secret file

func NewKeyFileDefaults

func NewKeyFileDefaults() (defaults *KeyFileDefaults)

NewKeyFileDefaults returns defaults for various cloud secret files.

func (*KeyFileDefaults) GetAWSAccessPath

func (defaults *KeyFileDefaults) GetAWSAccessPath() string

GetAWSAccessPath determines the aws access key path

func (*KeyFileDefaults) GetAWSSecretPath

func (defaults *KeyFileDefaults) GetAWSSecretPath() string

GetAWSSecretPath determines the aws secret key path

func (*KeyFileDefaults) GetAzureClientIDPath

func (defaults *KeyFileDefaults) GetAzureClientIDPath() string

GetAzureClientIDPath determines the azure client id path

func (*KeyFileDefaults) GetAzureClientSecretPath

func (defaults *KeyFileDefaults) GetAzureClientSecretPath() string

GetAzureClientSecretPath determines the azure client secret path

func (*KeyFileDefaults) GetAzureSubscriptionIDPath

func (defaults *KeyFileDefaults) GetAzureSubscriptionIDPath() string

GetAzureSubscriptionIDPath determines the azure subscription id path

func (*KeyFileDefaults) GetAzureTenantIDPath

func (defaults *KeyFileDefaults) GetAzureTenantIDPath() string

GetAzureTenantIDPath determines the azure tenant id path

func (*KeyFileDefaults) GetGoogleAccountPath

func (defaults *KeyFileDefaults) GetGoogleAccountPath() string

GetGoogleAccountPath determines the google account path

type PropCollectionUpdatePlugin

type PropCollectionUpdatePlugin struct {
	Service           Service
	InTransactionDoer InTransactionDoer
	IDToFQNameService IDToFQNameService
}

PropCollectionUpdatePlugin provides prop-collection-update HTTP endpoint and GRPC service.

func (*PropCollectionUpdatePlugin) PropCollectionUpdate

func (p *PropCollectionUpdatePlugin) PropCollectionUpdate(
	ctx context.Context, request *PropCollectionUpdateRequest,
) (*types.Empty, error)

PropCollectionUpdate handles a prop-collection-update grpc request.

func (*PropCollectionUpdatePlugin) RESTPropCollectionUpdate

func (p *PropCollectionUpdatePlugin) RESTPropCollectionUpdate(c echo.Context) error

RESTPropCollectionUpdate handles a prop-collection-update request.

func (*PropCollectionUpdatePlugin) RegisterGRPCAPI

func (p *PropCollectionUpdatePlugin) RegisterGRPCAPI(r apiserver.GRPCRouter)

RegisterGRPCAPI registers the prop-collection-update GRPC service.

func (*PropCollectionUpdatePlugin) RegisterHTTPAPI

func (p *PropCollectionUpdatePlugin) RegisterHTTPAPI(r apiserver.HTTPRouter)

RegisterHTTPAPI registers the prop-collection-update endpoint.

type QuotaCheckerCounter

type QuotaCheckerCounter struct {
	SimpleQuotaCounter
}

QuotaCheckerCounter implements counting logic for specific resources.

type QuotaCheckerLimitGetter

type QuotaCheckerLimitGetter struct {
	SimpleQuotaLimitGetter
}

QuotaCheckerLimitGetter implements quota limit retrieval for specific resources.

type SetTagPlugin

type SetTagPlugin struct {
	Service           Service
	InTransactionDoer InTransactionDoer
	MetadataGetter    baseservices.MetadataGetter
}

SetTagPlugin provides set-tag HTTP endpoint and GRPC service.

func (*SetTagPlugin) RESTSetTag

func (p *SetTagPlugin) RESTSetTag(c echo.Context) error

RESTSetTag handles set-tag request.

func (*SetTagPlugin) RegisterGRPCAPI

func (p *SetTagPlugin) RegisterGRPCAPI(r apiserver.GRPCRouter)

RegisterGRPCAPI registers the set-tag GRPC service.

func (*SetTagPlugin) RegisterHTTPAPI

func (p *SetTagPlugin) RegisterHTTPAPI(r apiserver.HTTPRouter)

RegisterHTTPAPI registers the set-tag endpoint.

func (*SetTagPlugin) SetTag

func (p *SetTagPlugin) SetTag(ctx context.Context, setTag *SetTagRequest) (*types.Empty, error)

SetTag allows setting tags based on SetTagRequest.

type TagLocator

type TagLocator interface {
	GetUUID() string
	GetFQName() []string
	GetPerms2() *models.PermType2
	GetParentType() string
	Kind() string
}

TagLocator is an object that references a tag and helps determining tag scope.

type UploadCloudKeysBody

type UploadCloudKeysBody struct {
	// CloudProviderUUID is the UUID of the cloud provider who provided keys
	CloudProviderUUID string `json:"cloud_provider_uuid"`
	// AWSSecretKey is the secret key to created on API Server host.
	AWSSecretKey string `json:"aws_secret_key"`
	// AWSAccessKey is the access key to created on API Server host.
	AWSAccessKey string `json:"aws_access_key"`
	// AzureSubscriptionID is the subscription id to created on API Server host.
	AzureSubscriptionID string `json:"azure_subscription_id"`
	// AzureClientID is the client id to created on API Server host.
	AzureClientID string `json:"azure_client_id"`
	// AzureClientSecret is the client secret to created on API Server host.
	AzureClientSecret string `json:"azure_client_secret"`
	// AzureTenantID is the tenant id to created on API Server host.
	AzureTenantID string `json:"azure_tenant_id"`
	// GoogleAccountJson is the account file to created on API Server host.
	GoogleAccount string `json:"google_account_json"`
}

UploadCloudKeysBody defines data format for /upload-cloud-keys endpoint.

type UploadCloudKeysPlugin

type UploadCloudKeysPlugin struct{}

UploadCloudKeysPlugin allows storing cloud secrets through an HTTP API.

func (UploadCloudKeysPlugin) RegisterGRPCAPI

func (UploadCloudKeysPlugin) RegisterGRPCAPI(r apiserver.GRPCRouter)

RegisterGRPCAPI does nothing, as the API is HTTP-only.

func (UploadCloudKeysPlugin) RegisterHTTPAPI

func (UploadCloudKeysPlugin) RegisterHTTPAPI(r apiserver.HTTPRouter)

RegisterHTTPAPI registers the upload-cloud-keys endpoint.

Jump to

Keyboard shortcuts

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