Octopus maintenance variable

Hello,
we would like to use in build step script a variable describing if the Octopus server is in Maintenance mode. I was not able to find it in variable list.

Does it exist? If not, is there another way to do it? Will you introduce it?

Thanks
Martin

Hi Martin,

Thanks for getting in touch! I do not believe we have a specific system variable available for this. When the Octopus server is in maintenance mode you are unable to create new tasks, meaning any script to determine whether the server is in maintenance mode could not be run from the Octopus server.

If you are perhaps trying to execute this against another Octopus server instance, you will be able to retrieve this data via the API.

http://OctopusServer/api/serverstatus

Returns something like this.

{
IsDatabaseEncrypted: false,
IsUpgradeAvailable: false,
MaximumAvailableVersion: null,
MaximumAvailableVersionCoveredByLicense: null,
MaintenanceExpires: "1/1/0001",
IsInMaintenanceMode: false,
IsMajorMinorUpgrade: false,
Links: {
Self: "/api/serverstatus",
Health: "/api/serverstatus/health",
RecentLogs: "/api/serverstatus/logs{?skip,take,includeDetail}",
SystemInfo: "/api/serverstatus/system-info",
SystemReport: "/api/serverstatus/system-report",
BuiltInFeedStats: "/api/serverstatus/nuget",
GCCollect: "/api/serverstatus/gc-collect"
}
}

You can use this call to see the value of IsInMaintenanceMode.

I hope this helps. :slight_smile:

Let me know if you have any further questions.

Best regards,
Daniel

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.