datamodel

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InternalStorageKind represents ucp credential storage type for internal credential type
	InternalStorageKind = "Internal"
	// AzureCredentialKind represents ucp credential kind for azure credentials.
	AzureCredentialKind = "ServicePrincipal"
	// AWSCredentialKind represents ucp credential kind for aws credentials.
	AWSCredentialKind = "AccessKey"
)
View Source
const (
	// OperationProcess is the operation type for processing a tracked resource.
	OperationProcess = "PROCESS"
	// ResourceType is the resource type for a generic resource.
	ResourceType = "System.Resources/resources"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSCredential

type AWSCredential struct {
	v1.BaseResource

	Properties *AWSCredentialResourceProperties `json:"properties,omitempty"`
}

Credential represents UCP Credential.

func (*AWSCredential) ResourceTypeName

func (c *AWSCredential) ResourceTypeName() string

ResourceTypeName gives the type of ucp resource.

type AWSCredentialProperties

type AWSCredentialProperties struct {
	// AccessKeyID contains aws access key for iam.
	AccessKeyID string `json:"accessKeyId"`
	// SecretAccessKey contains secret access key for iam.
	SecretAccessKey string `json:"secretAccessKey,omitempty"`
}

AWSCredentialProperties contains ucp AWS credential properties.

type AWSCredentialResourceProperties

type AWSCredentialResourceProperties struct {
	// Kind is the kind of aws credential resource.
	Kind string `json:"kind,omitempty"`
	// AWSCredential is the aws iam credentials.
	AWSCredential *AWSCredentialProperties `json:"awsCredential,omitempty"`
	// Storage contains the properties of the storage associated with the kind.
	Storage *CredentialStorageProperties `json:"storage,omitempty"`
}

AWS Credential Properties represents UCP Credential Properties.

type AWSResource

type AWSResource struct {
}

AWSResource represents any AWS Resource. AWSResource is not a tracked resource, so it does not implement ResourceDataModel. However need to implement the methods to satisfy the interface.

func (*AWSResource) GetBaseResource

func (a *AWSResource) GetBaseResource() *v1.BaseResource

GetBaseResource is not implemented for AWS proxy resource.

func (*AWSResource) GetSystemData

func (a *AWSResource) GetSystemData() *v1.SystemData

GetSystemData is not implemented for AWS proxy resource.

func (*AWSResource) ProvisioningState

func (a *AWSResource) ProvisioningState() v1.ProvisioningState

ProvisioningState is not implemented for AWS proxy resource.

func (*AWSResource) ResourceTypeName

func (a *AWSResource) ResourceTypeName() string

ResourceTypeName returns the resource type name.

func (*AWSResource) SetProvisioningState

func (a *AWSResource) SetProvisioningState(state v1.ProvisioningState)

SetProvisioningState is not implemented for AWS proxy resource.

func (*AWSResource) UpdateMetadata

func (a *AWSResource) UpdateMetadata(ctx *v1.ARMRequestContext, oldResource *v1.BaseResource)

UpdateMetadata is not implemented for AWS proxy resource.

type AzureCredential

type AzureCredential struct {
	v1.BaseResource

	Properties *AzureCredentialResourceProperties `json:"properties,omitempty"`
}

Credential represents UCP Credential.

func (*AzureCredential) ResourceTypeName

func (c *AzureCredential) ResourceTypeName() string

ResourceTypeName gives the type of ucp resource.

type AzureCredentialProperties

type AzureCredentialProperties struct {
	// TenantID represents the tenantId of azure service principal.
	TenantID string `json:"tenantId"`
	// ClientID represents the clientId of azure service principal.
	ClientID string `json:"clientId"`
	// ClientSecret represents the client secret of service principal.
	ClientSecret string `json:"clientSecret,omitempty"`
}

AzureCredentialProperties contains ucp Azure credential properties.

type AzureCredentialResourceProperties

type AzureCredentialResourceProperties struct {
	// Kind is the kind of azure credential resource.
	Kind string `json:"kind,omitempty"`
	// AzureCredential is the azure service principal credentials.
	AzureCredential *AzureCredentialProperties `json:"azureCredential,omitempty"`
	// Storage contains the properties of the storage associated with the kind.
	Storage *CredentialStorageProperties `json:"storage,omitempty"`
}

Azure Credential Properties represents UCP Credential Properties.

type CredentialStorageProperties

type CredentialStorageProperties struct {
	// Kind represents ucp credential storage kind.
	Kind string `json:"kind"`
	// InternalCredential represents ucp internal credential storage properties.
	InternalCredential *InternalCredentialStorageProperties `json:"internalCredential,omitempty"`
}

CredentialStorageProperties contains ucp credential storage properties.

type GenericResource

type GenericResource struct {
	v1.BaseResource

	// Properties stores the properties of the resource being tracked.
	Properties GenericResourceProperties `json:"properties"`
}

GenericResource represents a stored "tracked resource" within a UCP resource group.

This type is used to store tracked resources within UCP regardless of the actual resource type. You can think of it as a "meta-resource". The top level fields like "ID", "Name", and "Type" reflect the GenericResource entry itself. The actual resource data is stored in the "Properties" field.

GenericResource are returned through the resource list APIs, but don't support PUT or DELETE operations directly. The resource ID, Name, and Type of the GenericResource are an implementation detail and are never exposed to users.

func GenericResourceFromID added in v0.29.0

func GenericResourceFromID(originalID resources.ID, trackingID resources.ID) *GenericResource

GenericResourceFromID creates a new GenericResource from the given original resource ID and tracking ID.

func (*GenericResource) ResourceTypeName

func (r *GenericResource) ResourceTypeName() string

ResourceTypeName gives the type of ucp resource.

type GenericResourceProperties

type GenericResourceProperties struct {
	// ID is the fully qualified resource ID for the resource.
	ID string `json:"id"`
	// Name is the resource name.
	Name string `json:"name"`
	// Type is the resource type.
	Type string `json:"type"`

	// APIVersion is the version of the API that can be used to query the resource.
	APIVersion string `json:"apiVersion"`

	// OperationID is the last operation that updated this entry. This is used when an operation
	// is enqueued as a way to force a different Etag to be returned. This data doesn't need to be
	// read or used, it's just acting as a "salt" for the Etag.
	OperationID string `json:"operationId"`
}

GenericResourceProperties stores the properties of the resource being tracked.

Right now we only track the basic identifiers. This is enough for UCP to remebmer which resources exist, but not to act as a cache. We may want to add more fields in the future as we support additional scenarios.

type InternalCredentialStorageProperties

type InternalCredentialStorageProperties struct {
	// SecretName is the name of secret stored in ucp for the crendentials.
	SecretName string `json:"secretName"`
}

InternalCredentialStorageProperties contains ucp internal credential storage properties.

type Plane

type Plane struct {
	v1.BaseResource

	// Properties is the properties of the resource.
	Properties PlaneProperties `json:"properties"`
}

Plane represents UCP Plane.

func (*Plane) LookupResourceProvider

func (plane *Plane) LookupResourceProvider(key string) string

LookupResourceProvider checks if the input provider is in the list of configured providers.

func (Plane) ResourceTypeName

func (p Plane) ResourceTypeName() string

ResourceTypeName returns the type of the Plane as a string.

type PlaneKind

type PlaneKind string

type PlaneProperties

type PlaneProperties struct {
	Kind              PlaneKind
	URL               *string
	ResourceProviders map[string]*string
}

type ResourceGroup

type ResourceGroup struct {
	v1.BaseResource
}

ResourceGroup represents UCP ResourceGroup.

func (ResourceGroup) ResourceTypeName

func (p ResourceGroup) ResourceTypeName() string

ResourceTypeName returns a string representing the resource type name of the ResourceGroup object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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