constants

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The directory of the Microsoft Azure Linux VM Agent (waagent).
	WaAgentDirectory = "/var/lib/waagent"

	// dataDir is where we store the downloaded files, logs and state for
	// the extension handler
	DataDir = WaAgentDirectory + "/run-command-handler"

	// Directory used for copying the Run Command script file to be able to RunAs a different user.
	// It needs to copied because of permission restrictions. RunAsUser does not have permission to execute under /var/lib/waagent and its subdirectories.
	// %s needs to be replaced by '<RunAsUser>' (RunAs username)
	RunAsDir = "/home/%s/waagent/run-command-handler-runas"

	// ConfigSequenceNumberEnvName environment variable should be set by VMAgent to sequence number
	ConfigSequenceNumberEnvName = "ConfigSequenceNumber"

	// ConfigExtensionNameEnvName environment variable should be set by VMAgent to extension name
	ConfigExtensionNameEnvName = "ConfigExtensionName"

	ConfigFileExtension = ".settings"

	MrSeqFileExtension = ".mrseq"

	StatusFileDirectory = "status"

	ExtensionEventsDirectory = "events"

	StatusFileExtension = ".status"

	// The directory where the immediate run command status that have reached the terminal status are stored.
	ImmediateStatusFileDirectory = "status"

	// General failed exit code when extension provisioning fails due to service errors.
	FailedExitCodeGeneral = -1

	// The output directory for logs of immediate run command
	ImmediateRCOutputDirectory = "/var/log/azure/run-command-handler/ImmediateRunCommandService.log"

	// Download folder to use for standard managed run command
	DownloadFolder = "download/"

	// Download folder to use for immediate run command
	ImmediateDownloadFolder = "immediateDownload/"

	// Name of the run command extension
	RunCommandExtensionName     = "Microsoft.CPlat.Core.RunCommandHandlerLinux"
	RunCommandTestExtensionName = "Microsoft.Azure.Extensions.Edp.RunCommandHandlerLinuxTest"

	// List of problematic RCV2 versions that delete the mrseq files
	ProductionVersionThatDeletesMrSeqFiles = "1.3.17"
	FirstTestVersionThatDeletesMrSeqFiles  = "1.8.0"
	SecondTestVersionThatDeletesMrSeqFiles = "1.9.0"

	// The current version of the extension. This value is provided by the agent for all commands.
	// See more in: https://github.com/Azure/azure-vmextension-publishing/wiki/2.0-Partner-Guide-Handler-Design-Details#236-summary
	ExtensionVersionEnvName = "AZURE_GUEST_AGENT_EXTENSION_VERSION"

	// This is the version the extension is updating from
	// See more in: https://github.com/Azure/azure-vmextension-publishing/wiki/2.0-Partner-Guide-Handler-Design-Details#236-summary
	ExtensionVersionUpdatingFromEnvName = "AZURE_GUEST_AGENT_UPDATING_FROM_VERSION"

	// The path of the extension in the VM with full name. This value is provided by the agent for all commands.
	// See more in: https://github.com/Azure/azure-vmextension-publishing/wiki/2.0-Partner-Guide-Handler-Design-Details#236-summary
	ExtensionPathEnvName = "AZURE_GUEST_AGENT_EXTENSION_PATH"

	// The name of the immediate run command service
	ImmediateRunCommandHandlerName = "runCommandService"

	// The time to wait between each poll of the goal states
	PolingIntervalInSeconds = 1

	// The name of the file that contains the immediate goal states that reached the terminal status
	ImmediateGoalStatesInTerminalStatusFileName = "immediateGoalStatesInTerminalStatusFile.status"
)
View Source
const (
	// Exit codes
	ExitCode_Okay = 0

	// User errors (-100s):
	ExitCode_ScriptBlobDownloadFailed  = -100
	ExitCode_BlobCreateOrReplaceFailed = -101
	ExitCode_RunAsLookupUserFailed     = -102

	// Service Errors (-200s):
	ExitCode_CreateDataDirectoryFailed                    = -200
	ExitCode_RemoveDataDirectoryFailed                    = -201
	ExitCode_GetHandlerSettingsFailed                     = -202
	ExitCode_SaveScriptFailed                             = -203
	ExitCode_CommandExecutionFailed                       = -204
	ExitCode_OpenStdOutFileFailed                         = -205
	ExitCode_OpenStdErrFileFailed                         = -206
	ExitCode_IncorrectRunAsScriptPath                     = -207
	ExitCode_RunAsIncorrectScriptPath                     = -208
	ExitCode_RunAsOpenSourceScriptFileFailed              = -209
	ExitCode_RunAsCreateRunAsScriptFileFailed             = -210
	ExitCode_RunAsCopySourceScriptToRunAsScriptFileFailed = -211
	ExitCode_RunAsLookupUserUidFailed                     = -212
	ExitCode_RunAsScriptFileChangeOwnerFailed             = -213
	ExitCode_RunAsScriptFileChangePermissionsFailed       = -214
	ExitCode_DownloadArtifactFailed                       = -215
	ExitCode_UpgradeInstalledServiceFailed                = -216
	ExitCode_InstallServiceFailed                         = -217
	ExitCode_UninstallInstalledServiceFailed              = -218
	ExitCode_DisableInstalledServiceFailed                = -219
	ExitCode_CopyStateForUpdateFailed                     = -220
	ExitCode_SkippedImmediateGoalState                    = -221
	ExitCode_ImmediateTaskTimeout                         = -222
	ExitCode_ImmediateTaskFailed                          = -223
	ExitCode_CouldNotRehydrateMrSeq                       = -224
)
View Source
const ETagHeaderName = "ETag"
View Source
const IfNoneMatchHeaderName = "if-none-match"
View Source
const PutImmediateStatusFormatString = "%s/immediateStatus"

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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