@@ -1142,3 +1142,164 @@ type Fields struct {
1142
1142
// The exact format is defined in k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal
1143
1143
Map map [string ]Fields `json:",inline" protobuf:"bytes,1,rep,name=map"`
1144
1144
}
1145
+
1146
+ // TODO: Table does not generate to protobuf because of the interface{} - fix protobuf
1147
+ // generation to support a meta type that can accept any valid JSON. This can be introduced
1148
+ // in a v1 because clients a) receive an error if they try to access proto today, and b)
1149
+ // once introduced they would be able to gracefully switch over to using it.
1150
+
1151
+ // Table is a tabular representation of a set of API resources. The server transforms the
1152
+ // object into a set of preferred columns for quickly reviewing the objects.
1153
+ // +protobuf=false
1154
+ // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1155
+ type Table struct {
1156
+ TypeMeta `json:",inline"`
1157
+ // Standard list metadata.
1158
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
1159
+ // +optional
1160
+ ListMeta `json:"metadata,omitempty"`
1161
+
1162
+ // columnDefinitions describes each column in the returned items array. The number of cells per row
1163
+ // will always match the number of column definitions.
1164
+ ColumnDefinitions []TableColumnDefinition `json:"columnDefinitions"`
1165
+ // rows is the list of items in the table.
1166
+ Rows []TableRow `json:"rows"`
1167
+ }
1168
+
1169
+ // TableColumnDefinition contains information about a column returned in the Table.
1170
+ // +protobuf=false
1171
+ type TableColumnDefinition struct {
1172
+ // name is a human readable name for the column.
1173
+ Name string `json:"name"`
1174
+ // type is an OpenAPI type definition for this column, such as number, integer, string, or
1175
+ // array.
1176
+ // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.
1177
+ Type string `json:"type"`
1178
+ // format is an optional OpenAPI type modifier for this column. A format modifies the type and
1179
+ // imposes additional rules, like date or time formatting for a string. The 'name' format is applied
1180
+ // to the primary identifier column which has type 'string' to assist in clients identifying column
1181
+ // is the resource name.
1182
+ // See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.
1183
+ Format string `json:"format"`
1184
+ // description is a human readable description of this column.
1185
+ Description string `json:"description"`
1186
+ // priority is an integer defining the relative importance of this column compared to others. Lower
1187
+ // numbers are considered higher priority. Columns that may be omitted in limited space scenarios
1188
+ // should be given a higher priority.
1189
+ Priority int32 `json:"priority"`
1190
+ }
1191
+
1192
+ // TableRow is an individual row in a table.
1193
+ // +protobuf=false
1194
+ type TableRow struct {
1195
+ // cells will be as wide as the column definitions array and may contain strings, numbers (float64 or
1196
+ // int64), booleans, simple maps, lists, or null. See the type field of the column definition for a
1197
+ // more detailed description.
1198
+ Cells []interface {} `json:"cells"`
1199
+ // conditions describe additional status of a row that are relevant for a human user. These conditions
1200
+ // apply to the row, not to the object, and will be specific to table output. The only defined
1201
+ // condition type is 'Completed', for a row that indicates a resource that has run to completion and
1202
+ // can be given less visual priority.
1203
+ // +optional
1204
+ Conditions []TableRowCondition `json:"conditions,omitempty"`
1205
+ // This field contains the requested additional information about each object based on the includeObject
1206
+ // policy when requesting the Table. If "None", this field is empty, if "Object" this will be the
1207
+ // default serialization of the object for the current API version, and if "Metadata" (the default) will
1208
+ // contain the object metadata. Check the returned kind and apiVersion of the object before parsing.
1209
+ // The media type of the object will always match the enclosing list - if this as a JSON table, these
1210
+ // will be JSON encoded objects.
1211
+ // +optional
1212
+ Object runtime.RawExtension `json:"object,omitempty"`
1213
+ }
1214
+
1215
+ // TableRowCondition allows a row to be marked with additional information.
1216
+ // +protobuf=false
1217
+ type TableRowCondition struct {
1218
+ // Type of row condition. The only defined value is 'Completed' indicating that the
1219
+ // object this row represents has reached a completed state and may be given less visual
1220
+ // priority than other rows. Clients are not required to honor any conditions but should
1221
+ // be consistent where possible about handling the conditions.
1222
+ Type RowConditionType `json:"type"`
1223
+ // Status of the condition, one of True, False, Unknown.
1224
+ Status ConditionStatus `json:"status"`
1225
+ // (brief) machine readable reason for the condition's last transition.
1226
+ // +optional
1227
+ Reason string `json:"reason,omitempty"`
1228
+ // Human readable message indicating details about last transition.
1229
+ // +optional
1230
+ Message string `json:"message,omitempty"`
1231
+ }
1232
+
1233
+ type RowConditionType string
1234
+
1235
+ // These are valid conditions of a row. This list is not exhaustive and new conditions may be
1236
+ // included by other resources.
1237
+ const (
1238
+ // RowCompleted means the underlying resource has reached completion and may be given less
1239
+ // visual priority than other resources.
1240
+ RowCompleted RowConditionType = "Completed"
1241
+ )
1242
+
1243
+ type ConditionStatus string
1244
+
1245
+ // These are valid condition statuses. "ConditionTrue" means a resource is in the condition.
1246
+ // "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes
1247
+ // can't decide if a resource is in the condition or not. In the future, we could add other
1248
+ // intermediate conditions, e.g. ConditionDegraded.
1249
+ const (
1250
+ ConditionTrue ConditionStatus = "True"
1251
+ ConditionFalse ConditionStatus = "False"
1252
+ ConditionUnknown ConditionStatus = "Unknown"
1253
+ )
1254
+
1255
+ // IncludeObjectPolicy controls which portion of the object is returned with a Table.
1256
+ type IncludeObjectPolicy string
1257
+
1258
+ const (
1259
+ // IncludeNone returns no object.
1260
+ IncludeNone IncludeObjectPolicy = "None"
1261
+ // IncludeMetadata serializes the object containing only its metadata field.
1262
+ IncludeMetadata IncludeObjectPolicy = "Metadata"
1263
+ // IncludeObject contains the full object.
1264
+ IncludeObject IncludeObjectPolicy = "Object"
1265
+ )
1266
+
1267
+ // TableOptions are used when a Table is requested by the caller.
1268
+ // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1269
+ type TableOptions struct {
1270
+ TypeMeta `json:",inline"`
1271
+
1272
+ // NoHeaders is only exposed for internal callers. It is not included in our OpenAPI definitions
1273
+ // and may be removed as a field in a future release.
1274
+ NoHeaders bool `json:"-"`
1275
+
1276
+ // includeObject decides whether to include each object along with its columnar information.
1277
+ // Specifying "None" will return no object, specifying "Object" will return the full object contents, and
1278
+ // specifying "Metadata" (the default) will return the object's metadata in the PartialObjectMetadata kind
1279
+ // in version v1beta1 of the meta.k8s.io API group.
1280
+ IncludeObject IncludeObjectPolicy `json:"includeObject,omitempty" protobuf:"bytes,1,opt,name=includeObject,casttype=IncludeObjectPolicy"`
1281
+ }
1282
+
1283
+ // PartialObjectMetadata is a generic representation of any object with ObjectMeta. It allows clients
1284
+ // to get access to a particular ObjectMeta schema without knowing the details of the version.
1285
+ // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1286
+ type PartialObjectMetadata struct {
1287
+ TypeMeta `json:",inline"`
1288
+ // Standard object's metadata.
1289
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
1290
+ // +optional
1291
+ ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
1292
+ }
1293
+
1294
+ // PartialObjectMetadataList contains a list of objects containing only their metadata
1295
+ // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1296
+ type PartialObjectMetadataList struct {
1297
+ TypeMeta `json:",inline"`
1298
+ // Standard list metadata.
1299
+ // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
1300
+ // +optional
1301
+ ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
1302
+
1303
+ // items contains each of the included items.
1304
+ Items []* PartialObjectMetadata `json:"items" protobuf:"bytes,2,rep,name=items"`
1305
+ }
0 commit comments