datamodel

package
v0.36.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 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"
	// AzureServicePrincipalCredentialKind represents ucp credential kind for Azure service principal credentials.
	AzureServicePrincipalCredentialKind = "ServicePrincipal"
	// AzureWorkloadIdentityCredentialKind represents ucp credential kind for Azure workload identity credentials.
	AzureWorkloadIdentityCredentialKind = "WorkloadIdentity"
	// AWSAccessKeyCredentialKind represents ucp credential kind for aws access key credentials.
	AWSAccessKeyCredentialKind = "AccessKey"
	// AWSIRSACredentialKind represents ucp credential kind for aws irsa credentials.
	AWSIRSACredentialKind = "IRSA"
)
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 AWSAccessKeyCredentialProperties added in v0.36.0

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

AWSAccessKeyCredentialProperties contains ucp AWS access key credential properties.

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 {
	// Kind is the kind of AWS credential.
	Kind string `json:"kind,omitempty"`
	// AccessKeyCredential represents the access key credential properties.
	AccessKeyCredential *AWSAccessKeyCredentialProperties `json:"accesskey,omitempty"`
	// IRSACredential represents the irsa credential properties.
	IRSACredential *AWSIRSACredentialProperties `json:"irsa,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 AWSIRSACredentialProperties added in v0.36.0

type AWSIRSACredentialProperties struct {
	// RoleARN contains aws role arn for irsa.
	RoleARN string `json:"roleARN"`
}

AWSIRSACredentialProperties contains ucp AWS IRSA credential properties.

type AWSPlane added in v0.34.0

type AWSPlane struct {
	v1.BaseResource

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

AWSPlane is the representation of an AWS plane.

func (AWSPlane) ResourceTypeName added in v0.34.0

func (p AWSPlane) ResourceTypeName() string

ResourceTypeName returns the type of the Plane as a string.

type AWSPlaneProperties added in v0.34.0

type AWSPlaneProperties struct {
}

AwsPlaneProperties is the properties of an AWS plane.

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 {
	// Kind is the kind of Azure credential.
	Kind string `json:"kind,omitempty"`
	// ServicePrincipal represents the service principal properties.
	ServicePrincipal *AzureServicePrincipalCredentialProperties `json:"servicePrincipal,omitempty"`
	// WorkloadIdentity represents the workload identity properties.
	WorkloadIdentity *AzureWorkloadIdentityCredentialProperties `json:"workloadIdentity,omitempty"`
}

type AzureCredentialResourceProperties

type AzureCredentialResourceProperties struct {
	// Kind is the kind of Azure credential resource.
	Kind string `json:"kind,omitempty"`
	// AzureCredential is the Azure 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 AzurePlane added in v0.34.0

type AzurePlane struct {
	v1.BaseResource

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

AzurePlane is the representation of an Azure plane.

func (AzurePlane) ResourceTypeName added in v0.34.0

func (p AzurePlane) ResourceTypeName() string

ResourceTypeName returns the type of the Plane as a string.

type AzurePlaneProperties added in v0.34.0

type AzurePlaneProperties struct {
	URL string
}

AzurePlaneProperties is the properties of an Azure plane.

type AzureServicePrincipalCredentialProperties added in v0.35.0

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

AzureServicePrincipalCredentialProperties contains ucp Azure service principal credential properties.

type AzureWorkloadIdentityCredentialProperties added in v0.35.0

type AzureWorkloadIdentityCredentialProperties struct {
	// TenantID represents the tenantId of azure workload identity credential.
	TenantID string `json:"tenantId"`
	// ClientID represents the clientId of azure service principal credential.
	ClientID string `json:"clientId"`
}

AzureWorkloadIdentityCredentialProperties contains ucp Azure workload identity 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 GenericPlane added in v0.34.0

type GenericPlane struct {
	v1.BaseResource

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

GenericPlane is the representation used for serializing planes when queried generically.

func (GenericPlane) ResourceTypeName added in v0.34.0

func (p GenericPlane) ResourceTypeName() string

ResourceTypeName returns the type of the Plane as a string.

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 RadiusPlane added in v0.34.0

type RadiusPlane struct {
	v1.BaseResource

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

RadiusPlane is the representation of a Radius plane.

func (RadiusPlane) LookupResourceProvider added in v0.34.0

func (plane RadiusPlane) LookupResourceProvider(key string) string

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

func (RadiusPlane) ResourceTypeName added in v0.34.0

func (p RadiusPlane) ResourceTypeName() string

ResourceTypeName returns the type of the Plane as a string.

type RadiusPlaneProperties added in v0.34.0

type RadiusPlaneProperties struct {

	// ResourceProviders is a map of the support resource providers.
	ResourceProviders map[string]string `json:"resourceProviders"`
}

RadiusPlaneProperties is the properties of a Radius plane.

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