Skip to content

Commit

Permalink
refactor(api): create new state reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
adamtagscherer committed Dec 12, 2023
1 parent bde5865 commit c80df58
Show file tree
Hide file tree
Showing 9 changed files with 224 additions and 222 deletions.
14 changes: 7 additions & 7 deletions api/models/assetscanstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@ var assetScanStatusReasonMapping = map[AssetScanStatusState][]AssetScanStatusRea
AssetScanStatusReasonCreated,
},
AssetScanStatusStateScheduled: {
AssetScanStatusReasonScheduled,
AssetScanStatusReasonProvisioning,
},
AssetScanStatusStateReadyToScan: {
AssetScanStatusReasonOutOfVMClarity,
AssetScanStatusReasonReadyToScan,
AssetScanStatusReasonUnSupervised,
AssetScanStatusReasonResourcesReady,
},
AssetScanStatusStateInProgress: {
AssetScanStatusReasonInProgress,
AssetScanStatusReasonScannerIsRunning,
},
AssetScanStatusStateAborted: {
AssetScanStatusReasonAborted,
AssetScanStatusReasonCancellation,
},
AssetScanStatusStateFailed: {
AssetScanStatusReasonFailed,
AssetScanStatusReasonError,
AssetScanStatusReasonAbortTimedOut,
},
AssetScanStatusStateDone: {
AssetScanStatusReasonDone,
AssetScanStatusReasonSuccess,
},
}

Expand Down
62 changes: 31 additions & 31 deletions api/models/models.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2451,38 +2451,38 @@ components:
description: |
Machine readable reason for state transition.
| State | Reason | Description |
| ----------- | -------------- | -------------------------------------------- |
| Pending | Created | AssetScan has been created |
| Scheduled | Scheduled | Moved to scheduled state |
| ReadyToScan | OutOfVMClarity | Started without VMClarity orchestration |
| ReadyToScan | ReadyToScan | Scans are ready to be started |
| InProgress | InProgress | Scans are running on the target |
| Aborted | Aborted | Scans have been aborted |
| Failed | Failed | At least one scan failed on target |
| Failed | AbortTimedOut | AssetScan was in Aborted state for too long |
| Done | Done | Scan finished successfully |
| State | Reason | Description |
| ----------- | ---------------- | ------------------------------------------------------------------------------------------ |
| Pending | Created | Scan is pending as it has been newly created |
| Scheduled | Provisioning | Scan is scheduled as Asset resources are being provisioned |
| ReadyToScan | UnSupervised | Scan is created manually without the involvement of the Orchestrator (e.g. CI/CD scenario) |
| ReadyToScan | ResourcesReady | Scan is ready to scan as Asset resources have been provisioned |
| InProgress | ScannerIsRunning | Scan is in progress as Scanner is still performing scanning on Asset resources |
| Aborted | Cancellation | Scans have been aborted |
| Failed | Error | Scan has failed to one or more errors reported by the Scanner |
| Failed | AbortTimedOut | Scan has failed due to being in Aborted state for too long |
| Done | Success | Scan has finished successfully |
type: string
enum:
- Created
- Scheduled
- OutOfVMClarity
- ReadyToScan
- InProgress
- Aborted
- Failed
- Provisioning
- UnSupervised
- ResourcesReady
- ScannerIsRunning
- Cancellation
- Error
- AbortTimedOut
- Done
- Success
x-enum-varnames:
- AssetScanStatusReasonCreated
- AssetScanStatusReasonScheduled
- AssetScanStatusReasonOutOfVMClarity
- AssetScanStatusReasonReadyToScan
- AssetScanStatusReasonInProgress
- AssetScanStatusReasonAborted
- AssetScanStatusReasonFailed
- AssetScanStatusReasonProvisioning
- AssetScanStatusReasonUnSupervised
- AssetScanStatusReasonResourcesReady
- AssetScanStatusReasonScannerIsRunning
- AssetScanStatusReasonCancellation
- AssetScanStatusReasonError
- AssetScanStatusReasonAbortTimedOut
- AssetScanStatusReasonDone
- AssetScanStatusReasonSuccess
message:
description: Human readable message.
type: string
Expand Down
Loading

0 comments on commit c80df58

Please sign in to comment.