2019-07-09 03:40:59 +02:00
|
|
|
// Copyright Project Harbor Authors
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package retention
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
2019-07-15 07:13:05 +02:00
|
|
|
// const definitions
|
|
|
|
const (
|
|
|
|
ExecutionStatusInProgress string = "InProgress"
|
|
|
|
ExecutionStatusSucceed string = "Succeed"
|
|
|
|
ExecutionStatusFailed string = "Failed"
|
|
|
|
ExecutionStatusStopped string = "Stopped"
|
|
|
|
|
|
|
|
TaskStatusPending string = "Pending"
|
|
|
|
TaskStatusInProgress string = "InProgress"
|
|
|
|
TaskStatusSucceed string = "Succeed"
|
|
|
|
TaskStatusFailed string = "Failed"
|
|
|
|
TaskStatusStopped string = "Stopped"
|
|
|
|
|
|
|
|
CandidateKindImage string = "image"
|
|
|
|
CandidateKindChart string = "chart"
|
|
|
|
)
|
|
|
|
|
2019-07-09 13:00:35 +02:00
|
|
|
// Execution of retention
|
2019-07-09 03:40:59 +02:00
|
|
|
type Execution struct {
|
2019-07-15 07:13:05 +02:00
|
|
|
ID int64 `json:"id"`
|
2019-07-09 09:29:19 +02:00
|
|
|
PolicyID int64 `json:"policy_id"`
|
2019-07-09 03:40:59 +02:00
|
|
|
StartTime time.Time `json:"start_time"`
|
2019-07-09 09:29:19 +02:00
|
|
|
EndTime time.Time `json:"end_time,omitempty"`
|
2019-07-09 03:40:59 +02:00
|
|
|
Status string `json:"status"`
|
|
|
|
}
|
|
|
|
|
2019-07-15 07:13:05 +02:00
|
|
|
// Task of retention
|
|
|
|
type Task struct {
|
|
|
|
ID int64 `json:"id"`
|
|
|
|
ExecutionID int64 `json:"execution_id"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
StartTime time.Time `json:"start_time"`
|
|
|
|
EndTime time.Time `json:"end_time"`
|
2019-07-09 09:12:09 +02:00
|
|
|
}
|
|
|
|
|
2019-07-09 13:00:35 +02:00
|
|
|
// History of retention
|
2019-07-09 03:40:59 +02:00
|
|
|
type History struct {
|
2019-07-16 09:56:53 +02:00
|
|
|
ExecutionID int64 `json:"execution_id"`
|
2019-07-09 03:40:59 +02:00
|
|
|
Rule struct {
|
2019-07-09 09:29:19 +02:00
|
|
|
ID int `json:"id"`
|
2019-07-09 03:40:59 +02:00
|
|
|
DisplayText string `json:"display_text"`
|
|
|
|
} `json:"rule_id"`
|
|
|
|
// full path: :ns/:repo:tag
|
|
|
|
Artifact string `json:"tag"`
|
|
|
|
Timestamp time.Time `json:"timestamp"`
|
|
|
|
}
|