1 /* 2 Copyright 2017 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package internalversion 18 19 import ( 20 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 21 "k8s.io/apimachinery/pkg/fields" 22 "k8s.io/apimachinery/pkg/labels" 23 "k8s.io/apimachinery/pkg/runtime" 24 ) 25 26 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 27 28 // ListOptions is the query options to a standard REST list call. 29 type ListOptions struct { 30 metav1.TypeMeta 31 32 // A selector based on labels 33 LabelSelector labels.Selector 34 // A selector based on fields 35 FieldSelector fields.Selector 36 // If true, watch for changes to this list 37 Watch bool 38 // allowWatchBookmarks requests watch events with type "BOOKMARK". 39 // Servers that do not implement bookmarks may ignore this flag and 40 // bookmarks are sent at the server's discretion. Clients should not 41 // assume bookmarks are returned at any specific interval, nor may they 42 // assume the server will send any BOOKMARK event during a session. 43 // If this is not a watch, this field is ignored. 44 // If the feature gate WatchBookmarks is not enabled in apiserver, 45 // this field is ignored. 46 AllowWatchBookmarks bool 47 // resourceVersion sets a constraint on what resource versions a request may be served from. 48 // See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for 49 // details. 50 ResourceVersion string 51 // resourceVersionMatch determines how resourceVersion is applied to list calls. 52 // It is highly recommended that resourceVersionMatch be set for list calls where 53 // resourceVersion is set. 54 // See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for 55 // details. 56 ResourceVersionMatch metav1.ResourceVersionMatch 57 58 // Timeout for the list/watch call. 59 TimeoutSeconds *int64 60 // Limit specifies the maximum number of results to return from the server. The server may 61 // not support this field on all resource types, but if it does and more results remain it 62 // will set the continue field on the returned list object. 63 Limit int64 64 // Continue is a token returned by the server that lets a client retrieve chunks of results 65 // from the server by specifying limit. The server may reject requests for continuation tokens 66 // it does not recognize and will return a 410 error if the token can no longer be used because 67 // it has expired. 68 Continue string 69 70 // `sendInitialEvents=true` may be set together with `watch=true`. 71 // In that case, the watch stream will begin with synthetic events to 72 // produce the current state of objects in the collection. Once all such 73 // events have been sent, a synthetic "Bookmark" event will be sent. 74 // The bookmark will report the ResourceVersion (RV) corresponding to the 75 // set of objects, and be marked with `"k8s.io/initial-events-end": "true"` annotation. 76 // Afterwards, the watch stream will proceed as usual, sending watch events 77 // corresponding to changes (subsequent to the RV) to objects watched. 78 // 79 // When `sendInitialEvents` option is set, we require `resourceVersionMatch` 80 // option to also be set. The semantic of the watch request is as following: 81 // - `resourceVersionMatch` = NotOlderThan 82 // is interpreted as "data at least as new as the provided `resourceVersion`" 83 // and the bookmark event is send when the state is synced 84 // to a `resourceVersion` at least as fresh as the one provided by the ListOptions. 85 // If `resourceVersion` is unset, this is interpreted as "consistent read" and the 86 // bookmark event is send when the state is synced at least to the moment 87 // when request started being processed. 88 // - `resourceVersionMatch` set to any other value or unset 89 // Invalid error is returned. 90 // 91 // Defaults to true if `resourceVersion=""` or `resourceVersion="0"` (for backward 92 // compatibility reasons) and to false otherwise. 93 SendInitialEvents *bool 94 } 95 96 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 97 98 // List holds a list of objects, which may not be known by the server. 99 type List struct { 100 metav1.TypeMeta 101 // +optional 102 metav1.ListMeta 103 104 Items []runtime.Object 105 } 106