forked from release-engineering/pubtools-pulplib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunit.yaml
More file actions
238 lines (197 loc) · 4.61 KB
/
unit.yaml
File metadata and controls
238 lines (197 loc) · 4.61 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
title: pulp2-unit
description: >-
Schema for a Pulp 2.x unit, as returned by content search API.
$schema: http://json-schema.org/draft-07/schema#
definitions:
# ISO units (generic file)
iso:
type: object
properties:
# Type of the unit, e.g. "iso", "rpm", "srpm", "erratum" ...
_content_type_id:
const: iso
# Filename (actually path)
name:
type: string
# SHA256 checksum
checksum:
type: string
pattern: "^[a-f0-9]{64}$"
# Size in bytes
size:
# Ideally would be 'integer', but some old units have been stored
# as non-integers, e.g.
# RHEL4-U5-ia64-source-disc2.iso => 512251904.0
type: number
repository_memberships:
type: array
items:
type: string
required:
- _content_type_id
- name
- checksum
- size
# RPM units
rpm:
type: object
properties:
# Type of the unit
_content_type_id:
enum:
- rpm
- srpm
# ENVR components
name:
type: string
epoch:
type: string
version:
type: string
release:
type: string
# Architecture
arch:
type: string
# Filename of the rpm
filename:
anyOf:
- type: string
- type: "null"
# source rpm filename
sourcerpm:
anyOf:
- type: string
- type: "null"
# Short ID of key used to sign this RPM
signing_key:
anyOf:
- type: string
- type: "null"
# Checksums in key/value pairs (key=algorithm, value=hex string).
# All checksums are optional.
checksums:
type: object
properties:
md5:
type: string
pattern: "^[a-f0-9]{32}$"
sha1:
type: string
pattern: "^[a-f0-9]{40}$"
sha256:
type: string
pattern: "^[a-f0-9]{64}$"
# SHA256 checksum.
# This duplicates checksums.sha256 above; the difference is that this field
# is a part of the unit key, so it's both mandatory & indexed.
# Also, though the original intent was probably to support multiple checksum
# types in this field, it is nowadays forced to sha256, see:
# https://github.com/pulp/pulp_rpm/blob/69759d0fb9a16c0a47b1f49c78f6712e650912e1/plugins/pulp_rpm/plugins/importers/yum/upload.py#L436
checksum:
type: string
pattern: "^[a-f0-9]{64}$"
repository_memberships:
type: array
items:
type: string
requires:
type: array
items:
type: object
provides:
type: array
items:
type: object
required:
- _content_type_id
- name
- version
- release
- arch
# modulemd units
modulemd:
type: object
properties:
# Type of the unit
_content_type_id:
const: modulemd
# NSVCA components
name:
type: string
stream:
type: string
version:
type: integer
context:
type: string
arch:
type: string
repository_memberships:
type: array
items:
type: string
artifacts:
type: array
items:
type: string
profiles:
type: object
dependencies:
type: array
items:
type: object
required:
- _content_type_id
- name
- stream
- version
- context
- arch
# modulemd_defaults units
modulemd_defaults:
type: object
properties:
# Type of the unit
_content_type_id:
const: modulemd_defaults
name:
type: string
repo_id:
type: string
stream:
type: string
profiles:
type: object
repository_memberships:
type: array
items:
type: string
required:
- _content_type_id
- name
- repo_id
# Schema for any unknown type of unit
unknown:
type: object
properties:
# Type of the unit. Since this is the catch-all schema for unknown unit types,
# this must be a type not included in one of the other schemas.
_content_type_id:
allOf:
- type: string
- not:
enum:
- iso
- rpm
- srpm
- modulemd
- modulemd_defaults
required:
- _content_type_id
anyOf:
- $ref: "#/definitions/iso"
- $ref: "#/definitions/rpm"
- $ref: "#/definitions/modulemd"
- $ref: "#/definitions/modulemd_defaults"
- $ref: "#/definitions/unknown"