dataaccess

package
v0.10.36 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AccountNotVerifiedWarningMsgTemplate = `` /* 453-byte string literal not displayed */

	NextStepVerifyAccountMsgTemplate = `` /* 369-byte string literal not displayed */

	AwsCloudFormationGuideURL = "https://youtu.be/Mu-4jppldwk"
	AwsGcpTerraformScriptsURL = "https://github.com/omnistrate-oss/account-setup"
	AwsGcpTerraformGuideURL   = "https://youtu.be/eKktc4QKgaA"
)
View Source
const (
	DomainNotVerifiedWarningMsgTemplate = `` /* 247-byte string literal not displayed */

	NextStepVerifyDomainMsgTemplate = `` /* 211-byte string literal not displayed */

)
View Source
const (
	NextStepsAfterBuildMsgTemplate = `` /* 170-byte string literal not displayed */

)

Variables

View Source
var (
	ErrEnvironmentNotFound = errors.New("environment not found")
)

Functions

func AskVerifyAccountIfAny

func AskVerifyAccountIfAny(ctx context.Context)

func AskVerifyDomainIfAny

func AskVerifyDomainIfAny(ctx context.Context)

func CheckIfContainerImageAccessible

func CheckIfContainerImageAccessible(ctx context.Context, token string, imageRegistry, image string, userName, password *string) (res *openapiclient.CheckIfContainerImageAccessibleResult, err error)

func CreateAccount

func CreateAccount(ctx context.Context, token string, accountConfig openapiclient.CreateAccountConfigRequest2) (string, error)

func CreateDomain

func CreateDomain(ctx context.Context, token, name, description, environmentType, customDomain string) error

func CreateResourceInstance added in v0.9.129

func CreateResourceInstance(ctx context.Context, token string,
	serviceProviderId string, serviceKey string, serviceAPIVersion string, serviceEnvironmentKey string, serviceModelKey string, productTierKey string, resourceKey string,
	request openapiclientfleet.FleetCreateResourceInstanceRequest2) (res *openapiclientfleet.CreateResourceInstanceResponseBody, err error)

func CreateServiceEnvironment

func CreateServiceEnvironment(ctx context.Context,
	token string,
	name, description, serviceID string,
	visibility, environmentType string,
	sourceEnvID *string,
	deploymentConfigID string,
	autoApproveSubscription bool,
	serviceAuthPublicKey *string,
) (string, error)

func CreateServicesOrchestration added in v0.10.3

func CreateServicesOrchestration(
	ctx context.Context,
	token string,
	orchestrationCreateDSL string,
) (
	res *openapiclientfleet.CreateResourceInstanceResponseBody,
	err error,
)

func CreateUpgradePath

func CreateUpgradePath(ctx context.Context, token, serviceID, productTierID, sourceVersion, targetVersion string, scheduledDate *string, instanceIDs []string, notifyCustomer bool) (string, error)

func DeleteAccount

func DeleteAccount(ctx context.Context, token, accountConfigID string) error

func DeleteDomain

func DeleteDomain(ctx context.Context, token, environmentType string) error

func DeleteHelmChart

func DeleteHelmChart(ctx context.Context, token, chartName, chartVersion string) (err error)

func DeleteProductTier

func DeleteProductTier(ctx context.Context, token, serviceID, productTierID string) (err error)

func DeleteResourceInstance added in v0.9.129

func DeleteResourceInstance(ctx context.Context, token, serviceID, environmentID, resourceID, instanceID string) (err error)

func DeleteService

func DeleteService(ctx context.Context, token, serviceID string) error

func DeleteServiceEnvironment

func DeleteServiceEnvironment(ctx context.Context, token, serviceID, serviceEnvironmentID string) error

func DeleteServicesOrchestration added in v0.10.3

func DeleteServicesOrchestration(ctx context.Context, token, id string) (err error)

func DescribeHelmChart

func DescribeHelmChart(ctx context.Context, token, chartName, chartVersion string) (helmPackage *openapiclient.HelmPackage, err error)

func DescribeLatestVersion added in v0.10.16

func DescribeLatestVersion(ctx context.Context, token, serviceID, productTierID string) (*openapiclient.TierVersionSet, error)

func DescribePendingChanges

func DescribePendingChanges(ctx context.Context, token, serviceID, serviceAPIID, productTierID string) (*openapiclientv1.DescribePendingChangesResult, error)

func DescribeProductTier

func DescribeProductTier(ctx context.Context, token, serviceID, productTierID string) (productTier *openapiclientv1.DescribeProductTierResult, err error)

func DescribeResource

func DescribeResource(ctx context.Context, token, serviceID, resourceID string, productTierID, productTierVersion *string) (resp *openapiclient.DescribeResourceResult, err error)

func DescribeResourceInstance

func DescribeResourceInstance(ctx context.Context, token string, serviceID, environmentID, instanceID string) (resp *openapiclientfleet.ResourceInstance, err error)

func DescribeService

func DescribeService(ctx context.Context, token, serviceID string) (*openapiclient.DescribeServiceResult, error)

func DescribeServiceEnvironment

func DescribeServiceEnvironment(ctx context.Context, token, serviceID, serviceEnvironmentID string) (*openapiclientv1.DescribeServiceEnvironmentResult, error)

func DescribeServiceModel

func DescribeServiceModel(ctx context.Context, token, serviceID, serviceModelID string) (serviceModel *openapiclient.DescribeServiceModelResult, err error)

func DescribeServiceOffering

func DescribeServiceOffering(ctx context.Context, token, serviceID, productTierID, productTierVersion string) (res *openapiclientfleet.InventoryDescribeServiceOfferingResult, err error)

func DescribeServiceOfferingResource

func DescribeServiceOfferingResource(ctx context.Context, token, serviceID, resourceID, instanceID, productTierID, productTierVersion string) (res *openapiclientfleet.InventoryDescribeServiceOfferingResourceResult, err error)

func DescribeServicesOrchestration added in v0.10.3

func DescribeServicesOrchestration(ctx context.Context, token string, id string) (resp *openapiclientfleet.FleetDescribeServicesOrchestrationResult, err error)

func DescribeSubscription

func DescribeSubscription(ctx context.Context, token string, serviceID, environmentID, instanceID string) (resp *openapiclientfleet.FleetDescribeSubscriptionResult, err error)

func DescribeUpgradePath

func DescribeUpgradePath(ctx context.Context, token, serviceID, productTierID, upgradePathID string) (*openapiclientfleet.UpgradePath, error)

func DescribeUser

func DescribeUser(ctx context.Context, token string) (*openapiclient.DescribeUserResult, error)

func DescribeVersionSet

func DescribeVersionSet(ctx context.Context, token, serviceID, productTierID, version string) (*openapiclient.TierVersionSet, error)

func DisableServiceModelFeature

func DisableServiceModelFeature(ctx context.Context, token, serviceID, serviceModelID, featureName string) (err error)

func EnableServiceModelFeature

func EnableServiceModelFeature(ctx context.Context, token, serviceID, serviceModelID, featureName string, featureConfiguration map[string]any) (err error)

func FindEnvironment

func FindEnvironment(ctx context.Context, token, serviceID, environmentType string) (*openapiclientv1.DescribeServiceEnvironmentResult, error)

func FindLatestVersion

func FindLatestVersion(ctx context.Context, token, serviceID, productTierID string) (string, error)

func FindPreferredVersion

func FindPreferredVersion(ctx context.Context, token, serviceID, productTierID string) (string, error)

func FleetCreateCustomNetwork added in v0.9.113

func FleetCreateCustomNetwork(
	ctx context.Context, token string, cloudProviderName string, cloudProviderRegion string, cidr string, name *string) (
	customNetwork *openapiclientfleet.FleetCustomNetwork, err error)

func FleetDeleteCustomNetwork added in v0.9.113

func FleetDeleteCustomNetwork(
	ctx context.Context, token string, customNetworkId string) (
	err error)

func FleetDescribeCustomNetwork added in v0.9.110

func FleetDescribeCustomNetwork(
	ctx context.Context, token string, id string) (
	customNetwork *openapiclientfleet.FleetCustomNetwork, err error)

func FleetListCustomNetworks added in v0.9.110

func FleetListCustomNetworks(
	ctx context.Context, token string, cloudProviderName *string, cloudProviderRegion *string) (
	customNetworks *openapiclientfleet.FleetListCustomNetworksResult, err error)

func FleetUpdateCustomNetwork added in v0.10.11

func FleetUpdateCustomNetwork(
	ctx context.Context, token string, id string, updatedName *string) (
	customNetwork *openapiclientfleet.FleetCustomNetwork, err error)

func GetCloudProviderByName

func GetCloudProviderByName(ctx context.Context, token string, cloudProvider string) (string, error)

func GetDefaultDeploymentConfigID

func GetDefaultDeploymentConfigID(ctx context.Context, token string) (string, error)

func GetInstanceDeploymentEntity added in v0.10.21

func GetInstanceDeploymentEntity(ctx context.Context, token string, instanceID string, deploymentType string, deploymentName string) (output string, err error)

func ListAccounts

func ListAccounts(ctx context.Context, token string, cloudProvider string) (*openapiclient.ListAccountConfigResult, error)

func ListEligibleInstancesPerUpgrade

func ListEligibleInstancesPerUpgrade(ctx context.Context, token, serviceID, productTierID, upgradePathID string) ([]openapiclientfleet.InstanceUpgrade, error)

func ListHelmChartInstallations

func ListHelmChartInstallations(ctx context.Context, token string, hostClusterID string) (helmPackageInstallations *openapiclientfleet.ListHelmPackageInstallationsResult, err error)

func ListHelmCharts

func ListHelmCharts(ctx context.Context, token string) (helmPackages *openapiclient.ListHelmPackagesResult, err error)

func ListServiceEnvironments

func ListServiceEnvironments(ctx context.Context, token, serviceID string) (*openapiclientv1.ListServiceEnvironmentsResult, error)

func ListServiceOfferings

func ListServiceOfferings(ctx context.Context, token, orgID string) (inventory *openapiclientfleet.InventoryListServiceOfferingsResult, err error)

func ListServices

func ListServices(ctx context.Context, token string) (*openapiclient.ListServiceResult, error)

func ListServicesOrchestration added in v0.10.3

func ListServicesOrchestration(ctx context.Context, token string, environmentType string) (resp []openapiclientfleet.FleetDescribeServicesOrchestrationResult, err error)

func ListVersions added in v0.10.17

func ListVersions(ctx context.Context, token, serviceID, productTierID string) (*openapiclient.ListTierVersionSetsResult, error)

func LoginWithIdentityProvider

func LoginWithIdentityProvider(ctx context.Context, deviceCode, identityProviderName string) (string, error)

func LoginWithPassword

func LoginWithPassword(ctx context.Context, email string, pass string) (string, error)

func ManageLifecycle added in v0.10.30

func ManageLifecycle(ctx context.Context, token, serviceID, productTierID, upgradePathID string, action model.UpgradeMaintenanceAction) (*openapiclientfleet.UpgradePath, error)

func ManageLifecycleWithPayload added in v0.10.36

func ManageLifecycleWithPayload(ctx context.Context, token, serviceID, productTierID, upgradePathID string, action model.UpgradeMaintenanceAction, actionPayload map[string]interface{}) (*openapiclientfleet.UpgradePath, error)

func ModifyServicesOrchestration added in v0.10.5

func ModifyServicesOrchestration(
	ctx context.Context,
	token string,
	id string,
	orchestrationModifyDSL string,
) (
	err error,
)

func PatchInstanceDeploymentEntity added in v0.10.21

func PatchInstanceDeploymentEntity(ctx context.Context, token string, instanceID string, deploymentType string, deploymentName string, patchedFilePath string, deploymentAction string) (err error)

func PauseInstanceDeploymentEntity added in v0.10.21

func PauseInstanceDeploymentEntity(ctx context.Context, token string, instanceID string, deploymentType string, deploymentName string) (err error)

func PrintAccountNotVerifiedWarning

func PrintAccountNotVerifiedWarning(account *openapiclient.DescribeAccountConfigResult)

func PrintDomainNotVerifiedWarningMsg

func PrintDomainNotVerifiedWarningMsg(domain, clusterEndpoint string)

func PrintNextStepVerifyAccountMsg

func PrintNextStepVerifyAccountMsg(account *openapiclient.DescribeAccountConfigResult)

func PrintNextStepVerifyDomainMsg

func PrintNextStepVerifyDomainMsg(clusterEndpoint string)

func PrintNextStepsAfterBuildMsg

func PrintNextStepsAfterBuildMsg()

func PromoteServiceEnvironment

func PromoteServiceEnvironment(ctx context.Context, token, serviceID, serviceEnvironmentID string) error

func PromoteServiceEnvironmentStatus

func PromoteServiceEnvironmentStatus(ctx context.Context, token, serviceID, serviceEnvironmentID string) (resp []openapiclientv1.EnvironmentPromotionStatus, err error)

func ReleaseServicePlan

func ReleaseServicePlan(ctx context.Context, token, serviceID, serviceAPIID, productTierID string, versionSetName *string, isPreferred bool) error

func RestartResourceInstance

func RestartResourceInstance(ctx context.Context, token string, serviceID, environmentID, resourceID, instanceID string) (err error)

func ResumeInstanceDeploymentEntity added in v0.10.21

func ResumeInstanceDeploymentEntity(ctx context.Context, token string, instanceID string, deploymentType string, deploymentName string, deploymentAction string) (err error)

func SaveHelmChart

func SaveHelmChart(
	ctx context.Context,
	token string,
	chartName string,
	chartVersion string,
	namespace string,
	repoName string,
	repoURL string,
	values map[string]any,
) (
	helmPackage openapiclient.HelmPackage,
	err error,
)

func SearchInventory

func SearchInventory(ctx context.Context, token, query string) (*openapiclientfleet.SearchInventoryResult, error)

func SetDefaultServicePlan

func SetDefaultServicePlan(ctx context.Context, token, serviceID, productTierID, version string) (*openapiclient.TierVersionSet, error)

func StartResourceInstance

func StartResourceInstance(ctx context.Context, token string, serviceID, environmentID, resourceID, instanceID string) (err error)

func StopResourceInstance

func StopResourceInstance(ctx context.Context, token string, serviceID, environmentID, resourceID, instanceID string) (err error)

func UpdateResourceInstance

func UpdateResourceInstance(ctx context.Context, token string,
	serviceID, environmentID, instanceID string,
	resourceId string, requestParameters map[string]any) (err error)

func UpdateResourceInstanceDebugMode added in v0.10.35

func UpdateResourceInstanceDebugMode(ctx context.Context, token string, serviceID, environmentID, instanceID string, enable bool) (err error)

Types

type InspectAZItem added in v0.10.34

type InspectAZItem struct {
	Name string
	VMs  []InspectVMItem
}

InspectAZItem represents an availability zone

type InspectPVCItem added in v0.10.34

type InspectPVCItem struct {
	Name         string
	Size         string
	Status       string
	PVName       string
	StorageClass string
	AccessModes  []string
}

InspectPVCItem represents a persistent volume claim

type InspectPVItem added in v0.10.34

type InspectPVItem struct {
	Name         string
	Size         string
	Status       string
	StorageClass string
	AccessModes  []string
	VolumeType   string
	PVCName      string
	PVCNamespace string
}

InspectPVItem represents a persistent volume

type InspectPodItem added in v0.10.34

type InspectPodItem struct {
	Name      string
	Status    string
	NodeName  string
	Namespace string
	PVCs      []InspectPVCItem // PVCs attached to this pod
	Labels    map[string]string
	Resources ResourceRequirements
}

InspectPodItem represents a pod

type InspectStorageClassItem added in v0.10.34

type InspectStorageClassItem struct {
	Name        string
	Provisioner string
	Parameters  map[string]string
	PVs         []InspectPVItem
}

InspectStorageClassItem represents a storage class

type InspectVMItem added in v0.10.34

type InspectVMItem struct {
	Name         string
	InstanceType string
	VCPUs        int
	MemoryGB     float64
	Pods         []InspectPodItem
}

InspectVMItem represents a node in the cluster

type InspectWorkloadItem added in v0.10.34

type InspectWorkloadItem struct {
	Type string // StatefulSet or Deployment
	Name string
	AZs  map[string][]InspectPodItem
}

InspectWorkloadItem represents a workload (StatefulSet or Deployment)

type K8sClientConfig added in v0.10.34

type K8sClientConfig struct {
	Kubeconfig  string
	KubeContext string
}

K8sClientConfig contains configuration for the K8s client

type K8sInspectClient added in v0.10.34

type K8sInspectClient interface {
	// GetClusterData returns detailed information about workloads, AZs, and storage in a namespace
	GetClusterData(ctx context.Context, namespace string) ([]InspectWorkloadItem, []InspectAZItem, []InspectStorageClassItem, error)

	// GetSampleData returns sample data for demonstration purposes
	GetSampleData(instanceID string) ([]InspectWorkloadItem, []InspectAZItem, []InspectStorageClassItem)
}

K8sInspectClient provides methods for retrieving inspect data

func NewK8sInspectClient added in v0.10.34

func NewK8sInspectClient(config K8sClientConfig) K8sInspectClient

NewK8sInspectClient creates a new K8s inspection client

type K8sInspectClientImpl added in v0.10.34

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

K8sInspectClientImpl is the Kubernetes implementation of K8sInspectClient

func (*K8sInspectClientImpl) GetClusterData added in v0.10.34

GetClusterData fetches real data from a Kubernetes cluster

func (*K8sInspectClientImpl) GetSampleData added in v0.10.34

GetSampleData returns sample data for demonstration

type LeveledLogger added in v0.10.2

type LeveledLogger struct {
	retryablehttp.LeveledLogger
}

Used to transform the retryablehttp logger to a zerolog logger

func NewLeveledLogger added in v0.10.2

func NewLeveledLogger() *LeveledLogger

func (*LeveledLogger) Debug added in v0.10.2

func (l *LeveledLogger) Debug(msg string, keysAndValues ...interface{})

func (*LeveledLogger) Error added in v0.10.2

func (l *LeveledLogger) Error(msg string, keysAndValues ...interface{})

func (*LeveledLogger) Info added in v0.10.2

func (l *LeveledLogger) Info(msg string, keysAndValues ...interface{})

func (*LeveledLogger) Warn added in v0.10.2

func (l *LeveledLogger) Warn(msg string, keysAndValues ...interface{})

type ResourceList added in v0.10.34

type ResourceList map[string]string

ResourceList is a mapping of resource names to resource quantities

type ResourceRequirements added in v0.10.34

type ResourceRequirements struct {
	Limits   ResourceList
	Requests ResourceList
}

ResourceRequirements contains resource requirements for a container

Jump to

Keyboard shortcuts

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