| 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 |
AllowWatchBookmarks bool |
| 45 |
// resourceVersion sets a constraint on what resource versions a request may be served from. |
| 46 |
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for |
| 47 |
// details. |
| 48 |
ResourceVersion string |
| 49 |
// resourceVersionMatch determines how resourceVersion is applied to list calls. |
| 50 |
// It is highly recommended that resourceVersionMatch be set for list calls where |
| 51 |
// resourceVersion is set. |
| 52 |
// See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for |
| 53 |
// details. |
| 54 |
ResourceVersionMatch metav1.ResourceVersionMatch |
| 55 |
|
| 56 |
// Timeout for the list/watch call. |
| 57 |
TimeoutSeconds *int64 |
| 58 |
// Limit specifies the maximum number of results to return from the server. The server may |
| 59 |
// not support this field on all resource types, but if it does and more results remain it |
| 60 |
// will set the continue field on the returned list object. |
| 61 |
Limit int64 |
| 62 |
// Continue is a token returned by the server that lets a client retrieve chunks of results |
| 63 |
// from the server by specifying limit. The server may reject requests for continuation tokens |
| 64 |
// it does not recognize and will return a 410 error if the token can no longer be used because |
| 65 |
// it has expired. |
| 66 |
Continue string |
| 67 |
|
| 68 |
// `sendInitialEvents=true` may be set together with `watch=true`. |
| 69 |
// In that case, the watch stream will begin with synthetic events to |
| 70 |
// produce the current state of objects in the collection. Once all such |
| 71 |
// events have been sent, a synthetic "Bookmark" event will be sent. |
| 72 |
// The bookmark will report the ResourceVersion (RV) corresponding to the |
| 73 |
// set of objects, and be marked with `"k8s.io/initial-events-end": "true"` annotation. |
| 74 |
// Afterwards, the watch stream will proceed as usual, sending watch events |
| 75 |
// corresponding to changes (subsequent to the RV) to objects watched. |
| 76 |
// |
| 77 |
// When `sendInitialEvents` option is set, we require `resourceVersionMatch` |
| 78 |
// option to also be set. The semantic of the watch request is as following: |
| 79 |
// - `resourceVersionMatch` = NotOlderThan |
| 80 |
// is interpreted as "data at least as new as the provided `resourceVersion`" |
| 81 |
// and the bookmark event is send when the state is synced |
| 82 |
// to a `resourceVersion` at least as fresh as the one provided by the ListOptions. |
| 83 |
// If `resourceVersion` is unset, this is interpreted as "consistent read" and the |
| 84 |
// bookmark event is send when the state is synced at least to the moment |
| 85 |
// when request started being processed. |
| 86 |
// - `resourceVersionMatch` set to any other value or unset |
| 87 |
// Invalid error is returned. |
| 88 |
// |
| 89 |
// Defaults to true if `resourceVersion=""` or `resourceVersion="0"` (for backward |
| 90 |
// compatibility reasons) and to false otherwise. |
| 91 |
SendInitialEvents *bool |
| 92 |
} |
| 93 |
|
| 94 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 95 |
|
| 96 |
// List holds a list of objects, which may not be known by the server. |
| 97 |
type List struct { |
| 98 |
metav1.TypeMeta |
| 99 |
// +optional |
| 100 |
metav1.ListMeta |
| 101 |
|
| 102 |
Items []runtime.Object |
| 103 |
} |