-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathsnapshots.go
46 lines (38 loc) · 2.1 KB
/
snapshots.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package api
import (
"time"
)
type SnapshotResponse struct {
UUID string `json:"uuid"`
CreatedAt time.Time `json:"created_at"` // Datetime the snapshot was created
RepositoryPath string `json:"repository_path"` // Path to repository snapshot contents
ContentCounts map[string]int64 `json:"content_counts"` // Count of each content type
AddedCounts map[string]int64 `json:"added_counts"` // Count of each content type
RemovedCounts map[string]int64 `json:"removed_counts"` // Count of each content type
URL string `json:"url"` // URL to the snapshot's content
RepositoryName string `json:"repository_name"` // Name of repository the snapshot belongs to
RepositoryUUID string `json:"repository_uuid"` // UUID of the repository the snapshot belongs to
PublicationHref string `json:"-" swaggerignore:"true"` // Publication href of the snapshot in pulp
}
type ListSnapshotByDateRequest struct {
RepositoryUUIDS []string `json:"repository_uuids" validate:"required"` // Repository UUIDs to find snapshots for
Date time.Time `json:"date" validate:"required"` // Exact date to search by.
}
type ListSnapshotByDateResponse struct {
Data []SnapshotForDate `json:"data"` // Requested Data
}
type SnapshotForDate struct {
RepositoryUUID string `json:"repository_uuid"` // Repository uuid for associated snapshot
IsAfter bool `json:"is_after"` // Is the snapshot after the specified date
Match *SnapshotResponse `json:"match,omitempty"` // This is the snapshot (if found)
}
type SnapshotCollectionResponse struct {
Data []SnapshotResponse `json:"data"` // Requested Data
Meta ResponseMetadata `json:"meta"` // Metadata about the request
Links Links `json:"links"` // Links to other pages of results
}
func (r *SnapshotCollectionResponse) SetMetadata(meta ResponseMetadata, links Links) {
r.Meta = meta
r.Links = links
}
type RepositoryConfigurationFile string