Class CloudStatistics
- All Implemented Interfaces:
ExtensionPoint,Action,ModelObject,Saveable,org.kohsuke.stapler.StaplerProxy
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classListen to ongoing provisioning activities.static classNested classes/interfaces inherited from class hudson.model.ManagementLink
ManagementLink.CategoryNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intThe number of completed records to be stored.Fields inherited from class hudson.model.ManagementLink
LIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattach(ProvisioningActivity activity, ProvisioningActivity.Phase phase, PhaseExecutionAttachment attachment) Attach information to activity's phase execution.static CloudStatisticsget()Get the singleton instance.getActivity(String hashString) Get "active" activity, missing activity will be logged.getActivityFor(TrackedItem item) getApi()Exposes provisioning activity data through the standard Jenkins remote API (/manage/cloud-stats/api/jsonand/manage/cloud-stats/api/xml).Name of the category for this management link.getIndex()Get activities that was not completed yet.Get activity that is suspected to be completed already.getUrl(ProvisioningActivity activity, PhaseExecution phaseExecution, PhaseExecutionAttachment attachment) voidsave()Methods inherited from class hudson.model.ManagementLink
all, getBadge, getCategory, getRequiresConfirmation, getRequiresPOST
-
Field Details
-
ARCHIVE_RECORDS
public static int ARCHIVE_RECORDSThe number of completed records to be stored.
-
-
Constructor Details
-
CloudStatistics
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public CloudStatistics()
-
-
Method Details
-
get
Get the singleton instance. -
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction- Specified by:
getIconFileNamein classManagementLink
-
getRequiredPermission
- Overrides:
getRequiredPermissionin classManagementLink
-
getTarget
- Specified by:
getTargetin interfaceorg.kohsuke.stapler.StaplerProxy
-
getNotCompletedActivities
Get activities that was not completed yet. -
getUrlName
- Specified by:
getUrlNamein interfaceAction- Specified by:
getUrlNamein classManagementLink
-
getDescription
- Overrides:
getDescriptionin classManagementLink
-
getCategoryName
Name of the category for this management link. Exists so that plugins with core dependency pre-dating the version when this was introduced can define a category.TODO when the core version is >2.226 change this to override
getCategory()instead- Overrides:
getCategoryNamein classManagementLink- Returns:
- name of the desired category, one of the enum values of Category, e.g.
STATUS. - Since:
- 2.226 of Jenkins core
-
getActivities
-
getApi
Exposes provisioning activity data through the standard Jenkins remote API (/manage/cloud-stats/api/jsonand/manage/cloud-stats/api/xml).Permission model: Access is enforced by
getTarget(), which checksJenkins.SYSTEM_READbefore Stapler dispatches any route under this object — including both the HTML management pages and this API endpoint.SYSTEM_READis therefore the single, consistent gate for everything this class serves.Stack-trace exposure: The exported data includes
PhaseExecutionAttachment.ExceptionAttachment.getText()(full exception stack traces). This is intentional and not a new exposure: the identical text is already rendered as HTML at/manage/cloud-stats/activity/{fingerprint}/phase/{phase}/attachment/exception/(seeExceptionAttachment/_index.jelly) for any caller who holdsSYSTEM_READ. Requiring a stronger permission for the API endpoint but not for the HTML page would be inconsistent — the same data would remain accessible by simply navigating the UI. Organisations that considerSYSTEM_READtoo broad for this data should tighten that permission grant rather than split the access model between UI and API. -
getPotentiallyCompletedActivityFor
@CheckForNull public ProvisioningActivity getPotentiallyCompletedActivityFor(ProvisioningActivity.Id id) Get activity that is suspected to be completed already.- Returns:
- The activity or null if rotated already.
-
getActivityFor
Get "active" activity, missing activity will be logged. -
getActivityFor
-
getIndex
-
getActivity
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public ProvisioningActivity getActivity(@NonNull String hashString) -
getUrl
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @CheckForNull public String getUrl(@NonNull ProvisioningActivity activity, @NonNull PhaseExecution phaseExecution, @NonNull PhaseExecutionAttachment attachment) -
attach
public void attach(@NonNull ProvisioningActivity activity, @NonNull ProvisioningActivity.Phase phase, @NonNull PhaseExecutionAttachment attachment) Attach information to activity's phase execution. -
save
- Specified by:
savein interfaceSaveable- Throws:
IOException
-