Class MaintenanceLink
java.lang.Object
hudson.model.ManagementLink
com.sap.prd.jenkins.plugins.agent_maintenance.MaintenanceLink
- All Implemented Interfaces:
ExtensionPoint
,Action
,ModelObject
Link on manage Jenkins page to list all maintenance windows of all agents.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.ManagementLink
ManagementLink.Category
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class hudson.model.ManagementLink
LIST
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
deleteMaintenance
(String id, String computerName) Delete given maintenance window.String[]
deleteMultiple
(net.sf.json.JSONObject json) Delete selected maintenance windows.void
doAdd
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Add a maintenance window to a list of machines.doAutoCompleteLabel
(String value) doCheckLabel
(String value) List of actions.getBadge()
getError()
The message of the last error that occured.UI method to fetch status about maintenance windows.boolean
hasError()
Methods inherited from class hudson.model.ManagementLink
all, getCategory, getCategoryName, getRequiresConfirmation, getRequiresPOST
-
Constructor Details
-
MaintenanceLink
public MaintenanceLink()
-
-
Method Details
-
getDescription
- Overrides:
getDescription
in classManagementLink
-
getDisplayName
-
getIconFileName
- Specified by:
getIconFileName
in interfaceAction
- Specified by:
getIconFileName
in classManagementLink
-
getUrlName
- Specified by:
getUrlName
in interfaceAction
- Specified by:
getUrlName
in classManagementLink
-
getRequiredPermission
- Overrides:
getRequiredPermission
in classManagementLink
-
getAgents
List of actions.- Returns:
- List of actions
-
getError
The message of the last error that occured.- Returns:
- error message
-
hasError
public boolean hasError() -
getBadge
- Overrides:
getBadge
in classManagementLink
-
deleteMaintenance
@JavaScriptMethod public boolean deleteMaintenance(String id, String computerName) throws IOException, javax.servlet.ServletException Delete given maintenance window.- Parameters:
id
- The id of the maintenance to deletecomputerName
- The name of the computer to which the maintenance belongs- Throws:
IOException
javax.servlet.ServletException
-
deleteMultiple
@JavaScriptMethod public String[] deleteMultiple(net.sf.json.JSONObject json) throws IOException, javax.servlet.ServletException Delete selected maintenance windows.- Parameters:
json
- An json with maintenance ids to delete and corresponding computer names- Throws:
IOException
javax.servlet.ServletException
-
getMaintenanceStatus
UI method to fetch status about maintenance windows.- Returns:
- A Map containing for each maintenance window whether it is active or not.
-
doCheckLabel
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public FormValidation doCheckLabel(@QueryParameter String value) -
doAutoCompleteLabel
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public AutoCompletionCandidates doAutoCompleteLabel(@QueryParameter String value) -
doAdd
@POST public void doAdd(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException Add a maintenance window to a list of machines.- Parameters:
req
- StaplerRequestrsp
- StaplerResponse- Throws:
IOException
- when saving xml failedjavax.servlet.ServletException
- when reading the form failed
-
getMaintenanceWindowClass
-