instance

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InstanceStatus      InstanceStatusType
	InstanceTierVersion string
)
View Source
var Cmd = &cobra.Command{
	Use:          "instance [operation] [flags]",
	Short:        "Manage Instance Deployments for your service",
	Long:         `This command helps you manage the deployment of your service instances.`,
	Run:          run,
	SilenceUsage: true,
}
View Source
var InstanceID string
View Source
var SubscriptionID string

Functions

func DisplayWorkflowResourceDataWithSpinners added in v1.0.31

func DisplayWorkflowResourceDataWithSpinners(ctx context.Context, token, instanceID, actionType string, targetRegion ...string) error

DisplayWorkflowResourceDataWithSpinners renders deployment workflow progress for each resource.

func FetchEndpointsForInstance added in v1.6.8

func FetchEndpointsForInstance(ctx context.Context, token, serviceID, environmentID, instanceID string) (map[string]ResourceEndpoints, error)

FetchEndpointsForInstance fetches endpoint information for a known instance.

func PrintEndpointsForInstance added in v1.6.8

func PrintEndpointsForInstance(ctx context.Context, token, serviceID, environmentID, instanceID string) error

PrintEndpointsForInstance prints endpoint information grouped by resource.

func PrintResourceEndpoints added in v1.6.8

func PrintResourceEndpoints(resourceEndpoints map[string]ResourceEndpoints)

PrintResourceEndpoints renders endpoint information grouped by resource.

Types

type AdoptionConfig added in v0.13.37

type AdoptionConfig struct {
	ResourceAdoptionConfiguration map[string]ResourceAdoptionConfig `yaml:"resourceAdoptionConfiguration"`
}

AdoptionConfig represents the YAML configuration structure for resource adoption

type BreakpointListItem added in v1.2.12

type BreakpointListItem struct {
	Key        string `json:"key" table:"Key"`
	ID         string `json:"id" table:"ID"`
	Status     string `json:"status" table:"Status"`
	Conditions string `json:"conditions,omitempty" table:"Conditions"`
}

type DebugData added in v0.14.3

type DebugData struct {
	InstanceID        string                        `json:"instanceId"`
	PlanDAG           *PlanDAG                      `json:"planDag,omitempty"`
	ServiceID         string                        `json:"serviceId,omitempty"`
	EnvironmentID     string                        `json:"environmentId,omitempty"`
	Token             string                        `json:"-"`
	ResourceDebugInfo map[string]*ResourceDebugInfo `json:"resourceDebugInfo,omitempty"`
}

type DeploymentParametersOutput added in v0.14.57

type DeploymentParametersOutput struct {
	ServiceName  string          `json:"serviceName"`
	PlanName     string          `json:"planName"`
	Version      string          `json:"version"`
	ResourceName string          `json:"resourceName"`
	Parameters   []ParameterInfo `json:"parameters"`
}

type DeploymentType

type DeploymentType string
const (
	TerraformDeploymentType DeploymentType = "terraform"
)

type EndpointTableRow added in v0.14.12

type EndpointTableRow struct {
	ResourceName string `json:"resource_name"`
	EndpointType string `json:"endpoint_type"`
	EndpointName string `json:"endpoint_name"`
	URL          string `json:"url"`
	Status       string `json:"status,omitempty"`
	NetworkType  string `json:"network_type,omitempty"`
	Ports        string `json:"ports,omitempty"`
}

EndpointTableRow represents a single row in the table output

type FileInfo

type FileInfo struct {
	FilesContents   map[string]string `json:"filesContents,omitempty"`
	Name            string            `json:"name,omitempty"`
	InstanceID      string            `json:"instanceID,omitempty"`
	ResourceVersion string            `json:"resourceVersion,omitempty"`
}

type HelmAdoptionConfig added in v0.13.37

type HelmAdoptionConfig struct {
	ChartRepoURL         string             `yaml:"chartRepoURL"`
	BasicAuthCredential  *string            `yaml:"password,omitempty"`
	ReleaseName          string             `yaml:"releaseName"`
	ReleaseNamespace     string             `yaml:"releaseNamespace"`
	RuntimeConfiguration *HelmRuntimeConfig `yaml:"runtimeConfiguration,omitempty"`
	Username             *string            `yaml:"username,omitempty"`
}

HelmAdoptionConfig represents the Helm adoption configuration

type HelmData added in v0.14.3

type HelmData struct {
	ChartRepoName string                 `json:"chartRepoName"`
	ChartRepoURL  string                 `json:"chartRepoURL"`
	ChartVersion  string                 `json:"chartVersion"`
	ChartValues   map[string]interface{} `json:"chartValues"`
	InstallLog    string                 `json:"installLog"`
	Namespace     string                 `json:"namespace"`
	ReleaseName   string                 `json:"releaseName"`
}

type HelmLogsOutput added in v1.0.28

type HelmLogsOutput struct {
	InstanceID string             `json:"instanceId"`
	Resources  []HelmLogsResource `json:"resources"`
}

type HelmLogsResource added in v1.0.28

type HelmLogsResource struct {
	ResourceID  string `json:"resourceId"`
	ResourceKey string `json:"resourceKey"`
	InstallLog  string `json:"installLog"`
	Namespace   string `json:"namespace,omitempty"`
	ReleaseName string `json:"releaseName,omitempty"`
}

type HelmRuntimeConfig added in v0.13.37

type HelmRuntimeConfig struct {
	DisableHooks         bool  `yaml:"disableHooks"`
	Recreate             bool  `yaml:"recreate"`
	ResetThenReuseValues bool  `yaml:"resetThenReuseValues"`
	ResetValues          bool  `yaml:"resetValues"`
	ReuseValues          bool  `yaml:"reuseValues"`
	SkipCRDs             bool  `yaml:"skipCRDs"`
	TimeoutNanos         int64 `yaml:"timeoutNanos"`
	UpgradeCRDs          bool  `yaml:"upgradeCRDs"`
	Wait                 bool  `yaml:"wait"`
	WaitForJobs          bool  `yaml:"waitForJobs"`
}

HelmRuntimeConfig represents the Helm runtime configuration

type HelmValuesOutput added in v1.0.28

type HelmValuesOutput struct {
	InstanceID string               `json:"instanceId"`
	Resources  []HelmValuesResource `json:"resources"`
}

type HelmValuesResource added in v1.0.28

type HelmValuesResource struct {
	ResourceID    string                 `json:"resourceId"`
	ResourceKey   string                 `json:"resourceKey"`
	ChartRepoName string                 `json:"chartRepoName,omitempty"`
	ChartRepoURL  string                 `json:"chartRepoURL,omitempty"`
	ChartVersion  string                 `json:"chartVersion,omitempty"`
	ChartValues   map[string]interface{} `json:"chartValues"`
	Namespace     string                 `json:"namespace,omitempty"`
	ReleaseName   string                 `json:"releaseName,omitempty"`
}

type InstanceDeploymentStatus added in v0.14.61

type InstanceDeploymentStatus struct {
	InstanceID               string                     `json:"instanceId"`
	ServiceID                string                     `json:"serviceId"`
	EnvironmentID            string                     `json:"environmentId"`
	Status                   string                     `json:"status"`
	ProductTierID            string                     `json:"productTierId"`
	TierVersion              string                     `json:"tierVersion"`
	CreationTime             string                     `json:"creationTime,omitempty"`
	LastModifiedTime         string                     `json:"lastModifiedTime,omitempty"`
	ResourceDeploymentStatus []ResourceDeploymentStatus `json:"resourceDeploymentStatus"`
	AppliedFilters           map[string]interface{}     `json:"appliedFilters,omitempty"`
	FilteringStats           map[string]interface{}     `json:"filteringStats,omitempty"`
}

InstanceDeploymentStatus represents a compact view of instance deployment status

type InstanceStatusType

type InstanceStatusType string
const (
	InstanceStatusRunning   InstanceStatusType = "RUNNING"
	InstanceStatusStopped   InstanceStatusType = "STOPPED"
	InstanceStatusFailed    InstanceStatusType = "FAILED"
	InstanceStatusCancelled InstanceStatusType = "CANCELLED"
	InstanceStatusUnknown   InstanceStatusType = "UNKNOWN"
)

type ParameterInfo added in v0.14.57

type ParameterInfo struct {
	Key          string   `json:"key"`
	DisplayName  string   `json:"displayName"`
	Description  string   `json:"description"`
	Type         string   `json:"type"`
	Required     bool     `json:"required"`
	Modifiable   bool     `json:"modifiable"`
	IsList       bool     `json:"isList"`
	DefaultValue *string  `json:"defaultValue,omitempty"`
	Options      []string `json:"options,omitempty"`
	Regex        *string  `json:"regex,omitempty"`
	Custom       bool     `json:"custom"`
	API          string   `json:"api"`
}

type PlanDAG added in v1.1.1

type PlanDAG struct {
	Nodes            map[string]PlanDAGNode      `json:"nodes"`
	Edges            []PlanDAGEdge               `json:"edges"`
	Levels           [][]string                  `json:"levels"`
	Errors           []string                    `json:"errors,omitempty"`
	HasCycle         bool                        `json:"hasCycle"`
	WorkflowID       string                      `json:"workflowId,omitempty"`
	ProgressByID     map[string]ResourceProgress `json:"progressById,omitempty"`
	ProgressByKey    map[string]ResourceProgress `json:"progressByKey,omitempty"`
	ProgressByName   map[string]ResourceProgress `json:"progressByName,omitempty"`
	BreakpointByID   map[string]string           `json:"breakpointById,omitempty"`
	BreakpointByKey  map[string]string           `json:"breakpointByKey,omitempty"`
	BreakpointByName map[string]string           `json:"breakpointByName,omitempty"`
	ProgressLoading  bool                        `json:"-"`
	SpinnerTick      int                         `json:"-"`
	// Per-resource workflow step summaries keyed by resource key
	WorkflowStepsByKey map[string]*ResourceWorkflowSteps `json:"workflowStepsByKey,omitempty"`
}

type PlanDAGEdge added in v1.1.1

type PlanDAGEdge struct {
	From string `json:"from"`
	To   string `json:"to"`
}

type PlanDAGNode added in v1.1.1

type PlanDAGNode struct {
	ID   string `json:"id"`
	Key  string `json:"key,omitempty"`
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
}

type ProgressReader added in v1.0.15

type ProgressReader struct {
	io.Reader
	Total      int64
	Downloaded int64
	Spinner    *utils.Spinner
	LastUpdate time.Time
}

Progress reader wrapper to track download progress

func (*ProgressReader) Read added in v1.0.15

func (pr *ProgressReader) Read(p []byte) (int, error)

type ResourceAdoptionConfig added in v0.13.37

type ResourceAdoptionConfig struct {
	HelmAdoptionConfiguration *HelmAdoptionConfig `yaml:"helmAdoptionConfiguration,omitempty"`
}

ResourceAdoptionConfig represents the configuration for adopting a single resource

type ResourceDebugInfo added in v1.2.19

type ResourceDebugInfo struct {
	ResourceID   string `json:"resourceId"`
	ResourceKey  string `json:"resourceKey"`
	ResourceType string `json:"resourceType"`

	// Helm-specific data (populated for helm resources)
	Helm *HelmData `json:"helm,omitempty"`

	// Terraform-specific data (populated for terraform resources)
	TerraformProgress         *TerraformProgressData  `json:"terraformProgress,omitempty"`
	TerraformHistory          []TerraformHistoryEntry `json:"terraformHistory,omitempty"`
	TerraformFiles            map[string]string       `json:"terraformFiles,omitempty"`
	TerraformLogs             map[string]string       `json:"terraformLogs,omitempty"`
	TerraformPlanPreview      map[string]string       `json:"terraformPlanPreview,omitempty"`
	TerraformPlanPreviewError map[string]string       `json:"terraformPlanPreviewError,omitempty"`
}

ResourceDebugInfo holds all debug information for a specific resource in the plan DAG.

type ResourceDeploymentStatus added in v0.14.61

type ResourceDeploymentStatus struct {
	ResourceID       string                 `json:"resourceId,omitempty"`
	ResourceName     string                 `json:"resourceName,omitempty"`
	Version          string                 `json:"version,omitempty"`
	LatestVersion    string                 `json:"latestVersion,omitempty"`
	PodStatus        map[string]string      `json:"podStatus,omitempty"`
	DeploymentErrors string                 `json:"deploymentErrors,omitempty"`
	DeploymentType   string                 `json:"deploymentType,omitempty"`
	AdditionalInfo   map[string]interface{} `json:"additionalInfo,omitempty"`
}

ResourceDeploymentStatus represents compact deployment status for a single resource

type ResourceEndpoints added in v0.14.12

type ResourceEndpoints struct {
	ClusterEndpoint     string                                        `json:"cluster_endpoint"`
	ClusterPorts        []int64                                       `json:"cluster_ports,omitempty"`
	AdditionalEndpoints map[string]openapiclientfleet.ClusterEndpoint `json:"additional_endpoints"`
}

ResourceEndpoints represents the endpoints for a resource

type ResourceProgress added in v1.1.1

type ResourceProgress struct {
	Percent        int    `json:"percent"`
	Status         string `json:"status,omitempty"`
	CompletedSteps int    `json:"completedSteps,omitempty"`
	TotalSteps     int    `json:"totalSteps,omitempty"`
}

type ResourceWorkflowSteps added in v1.2.4

type ResourceWorkflowSteps struct {
	Steps []WorkflowStepInfo `json:"steps"`
}

ResourceWorkflowSteps holds the ordered list of workflow steps for a resource.

type SnapshotDetail added in v1.0.30

type SnapshotDetail struct {
	SnapshotID       string `json:"snapshotId"`
	Status           string `json:"status"`
	Region           string `json:"region"`
	SnapshotType     string `json:"snapshotType"`
	Progress         string `json:"progress"`
	CreatedAt        string `json:"createdAt"`
	CompletedAt      string `json:"completedAt"`
	SourceInstanceID string `json:"sourceInstanceId"`
	ProductTierID    string `json:"productTierId"`
	ProductTierVer   string `json:"productTierVersion"`
	Encrypted        bool   `json:"encrypted"`
}

type TerraformData added in v0.14.3

type TerraformData struct {
	Files map[string]string `json:"files"`
	Logs  map[string]string `json:"logs"`
}

type TerraformFileEntry added in v1.1.1

type TerraformFileEntry struct {
	Path     string
	RelPath  string
	Name     string
	IsDir    bool
	Depth    int
	Expanded bool
	Children []*TerraformFileEntry
}

TerraformFileEntry represents a file or directory in the terraform executor pod

type TerraformFileTree added in v1.1.1

type TerraformFileTree struct {
	PodName   string
	Namespace string
	BasePath  string
	Root      *TerraformFileEntry
	Flat      []*TerraformFileEntry // flattened visible entries for rendering
	// contains filtered or unexported fields
}

TerraformFileTree holds the fetched file tree and metadata for the executor pod

type TerraformFilesOutput added in v1.0.28

type TerraformFilesOutput struct {
	InstanceID string                   `json:"instanceId"`
	Resources  []TerraformFilesResource `json:"resources"`
}

type TerraformFilesResource added in v1.0.28

type TerraformFilesResource struct {
	ResourceID  string            `json:"resourceId"`
	ResourceKey string            `json:"resourceKey"`
	Files       map[string]string `json:"files"`
}

type TerraformHistoryEntry added in v1.1.1

type TerraformHistoryEntry struct {
	Operation   string `json:"operation"`
	Status      string `json:"status"`
	StartedAt   string `json:"startedAt"`
	CompletedAt string `json:"completedAt"`
	OperationID string `json:"operationId"`
	Error       string `json:"error,omitempty"`
}

TerraformHistoryEntry is a single entry from the tf-state configmap history

type TerraformOutputsOutput added in v1.0.28

type TerraformOutputsOutput struct {
	InstanceID string                     `json:"instanceId"`
	Resources  []TerraformOutputsResource `json:"resources"`
}

type TerraformOutputsResource added in v1.0.28

type TerraformOutputsResource struct {
	ResourceID  string            `json:"resourceId"`
	ResourceKey string            `json:"resourceKey"`
	Logs        map[string]string `json:"logs"`
}

type TerraformProgressData added in v1.1.1

type TerraformProgressData struct {
	TerraformName       string                    `json:"terraformName"`
	InstanceID          string                    `json:"instanceID"`
	ResourceID          string                    `json:"resourceID"`
	ResourceVersion     string                    `json:"resourceVersion"`
	OperationID         string                    `json:"operationID"`
	Status              string                    `json:"status"`
	StartedAt           string                    `json:"startedAt"`
	CompletedAt         string                    `json:"completedAt"`
	TotalResources      int                       `json:"totalResources"`
	InProgressResources int                       `json:"inProgressResources"`
	FailedResources     int                       `json:"failedResources"`
	Resources           []TerraformResourceDetail `json:"resources"`
	PlannedResources    []string                  `json:"plannedResources"`
}

TerraformProgressData holds the parsed progress from a terraform-progress configmap

type TerraformResourceDetail added in v1.1.1

type TerraformResourceDetail struct {
	Address  string `json:"address"`
	Type     string `json:"type"`
	Name     string `json:"name"`
	Mode     string `json:"mode"`
	Provider string `json:"provider"`
	State    string `json:"state"`
}

TerraformResourceDetail is a single resource in the terraform progress

type TerraformResponse

type TerraformResponse struct {
	SyncState string   `json:"syncState,omitempty"`
	Files     FileInfo `json:"files,omitempty"`
	SyncError string   `json:"syncError,omitempty"`
}

Define structs to match the JSON structure

type TerraformStateData added in v1.3.1

type TerraformStateData struct {
	Progress      *TerraformProgressData
	History       []TerraformHistoryEntry
	PlanPreviews  map[string]string // plan preview JSON keyed by operation ID
	PreviewErrors map[string]string // plan preview errors keyed by operation ID
}

TerraformStateData holds all data extracted from a tf-state configmap: progress, history, and plan previews. This avoids needing a second configmap lookup via terraformDataForResource which can fail in some environments.

type WorkflowStepInfo added in v1.2.4

type WorkflowStepInfo struct {
	Name         string                  `json:"name"`
	DisplayName  string                  `json:"displayName,omitempty"` // overridden display name (e.g. "Waiting for dependencies" for Bootstrap)
	Status       string                  `json:"status"`                // "success", "in-progress", "failed", "pending"
	StartTime    string                  `json:"startTime,omitempty"`
	EndTime      string                  `json:"endTime,omitempty"`
	Events       []dataaccess.DebugEvent `json:"events,omitempty"`
	DepTimelines []depTimeline           `json:"depTimelines,omitempty"` // populated for bootstrap steps only
}

WorkflowStepInfo holds step-level summary with timing and events.

Jump to

Keyboard shortcuts

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