cue.dev/x/crd/k8s.io/storage@v0.1.0

snapshot/v1/VolumeSnapshotContent.cue raw

  1package v1
  2
  3import "time"
  4
  5// VolumeSnapshotContent represents the actual "on-disk" snapshot
  6// object in the
  7// underlying storage system
  8#VolumeSnapshotContent: {
  9	_embeddedResource
 10
 11	// APIVersion defines the versioned schema of this representation
 12	// of an object.
 13	// Servers should convert recognized schemas to the latest
 14	// internal value, and
 15	// may reject unrecognized values.
 16	// More info:
 17	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
 18	"apiVersion"?: string
 19
 20	// Kind is a string value representing the REST resource this
 21	// object represents.
 22	// Servers may infer this from the endpoint the client submits
 23	// requests to.
 24	// Cannot be updated.
 25	// In CamelCase.
 26	// More info:
 27	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
 28	"kind"?: string
 29	"metadata"?: {}
 30
 31	// spec defines properties of a VolumeSnapshotContent created by
 32	// the underlying storage system.
 33	// Required.
 34	"spec"!: {
 35		// deletionPolicy determines whether this VolumeSnapshotContent
 36		// and its physical snapshot on
 37		// the underlying storage system should be deleted when its bound
 38		// VolumeSnapshot is deleted.
 39		// Supported values are "Retain" and "Delete".
 40		// "Retain" means that the VolumeSnapshotContent and its physical
 41		// snapshot on underlying storage system are kept.
 42		// "Delete" means that the VolumeSnapshotContent and its physical
 43		// snapshot on underlying storage system are deleted.
 44		// For dynamically provisioned snapshots, this field will
 45		// automatically be filled in by the
 46		// CSI snapshotter sidecar with the "DeletionPolicy" field defined
 47		// in the corresponding
 48		// VolumeSnapshotClass.
 49		// For pre-existing snapshots, users MUST specify this field when
 50		// creating the
 51		// VolumeSnapshotContent object.
 52		// Required.
 53		"deletionPolicy"!: "Delete" | "Retain"
 54
 55		// driver is the name of the CSI driver used to create the
 56		// physical snapshot on
 57		// the underlying storage system.
 58		// This MUST be the same as the name returned by the CSI
 59		// GetPluginName() call for
 60		// that driver.
 61		// Required.
 62		"driver"!: string
 63
 64		// source specifies whether the snapshot is (or should be)
 65		// dynamically provisioned
 66		// or already exists, and just requires a Kubernetes object
 67		// representation.
 68		// This field is immutable after creation.
 69		// Required.
 70		"source"!: {
 71			// snapshotHandle specifies the CSI "snapshot_id" of a
 72			// pre-existing snapshot on
 73			// the underlying storage system for which a Kubernetes object
 74			// representation
 75			// was (or should be) created.
 76			// This field is immutable.
 77			"snapshotHandle"?: string
 78
 79			// volumeHandle specifies the CSI "volume_id" of the volume from
 80			// which a snapshot
 81			// should be dynamically taken from.
 82			// This field is immutable.
 83			"volumeHandle"?: string
 84		}
 85
 86		// SourceVolumeMode is the mode of the volume whose snapshot is
 87		// taken.
 88		// Can be either “Filesystem” or “Block”.
 89		// If not specified, it indicates the source volume's mode is
 90		// unknown.
 91		// This field is immutable.
 92		// This field is an alpha field.
 93		"sourceVolumeMode"?: string
 94
 95		// name of the VolumeSnapshotClass from which this snapshot was
 96		// (or will be)
 97		// created.
 98		// Note that after provisioning, the VolumeSnapshotClass may be
 99		// deleted or
100		// recreated with different set of values, and as such, should not
101		// be referenced
102		// post-snapshot creation.
103		"volumeSnapshotClassName"?: string
104
105		// volumeSnapshotRef specifies the VolumeSnapshot object to which
106		// this
107		// VolumeSnapshotContent object is bound.
108		// VolumeSnapshot.Spec.VolumeSnapshotContentName field must
109		// reference to
110		// this VolumeSnapshotContent's name for the bidirectional binding
111		// to be valid.
112		// For a pre-existing VolumeSnapshotContent object, name and
113		// namespace of the
114		// VolumeSnapshot object MUST be provided for binding to happen.
115		// This field is immutable after creation.
116		// Required.
117		"volumeSnapshotRef"!: {
118			// API version of the referent.
119			"apiVersion"?: string
120
121			// If referring to a piece of an object instead of an entire
122			// object, this string
123			// should contain a valid JSON/Go field access statement, such as
124			// desiredState.manifest.containers[2].
125			// For example, if the object reference is to a container within a
126			// pod, this would take on a value like:
127			// "spec.containers{name}" (where "name" refers to the name of the
128			// container that triggered
129			// the event) or if no container name is specified
130			// "spec.containers[2]" (container with
131			// index 2 in this pod). This syntax is chosen only to have some
132			// well-defined way of
133			// referencing a part of an object.
134			// TODO: this design is not final and this field is subject to
135			// change in the future.
136			"fieldPath"?: string
137
138			// Kind of the referent.
139			// More info:
140			// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
141			"kind"?: string
142
143			// Name of the referent.
144			// More info:
145			// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
146			"name"?: string
147
148			// Namespace of the referent.
149			// More info:
150			// https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
151			"namespace"?: string
152
153			// Specific resourceVersion to which this reference is made, if
154			// any.
155			// More info:
156			// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
157			"resourceVersion"?: string
158
159			// UID of the referent.
160			// More info:
161			// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
162			"uid"?: string
163		}
164	}
165
166	// status represents the current information of a snapshot.
167	"status"?: {
168		// creationTime is the timestamp when the point-in-time snapshot
169		// is taken
170		// by the underlying storage system.
171		// In dynamic snapshot creation case, this field will be filled in
172		// by the
173		// CSI snapshotter sidecar with the "creation_time" value returned
174		// from CSI
175		// "CreateSnapshot" gRPC call.
176		// For a pre-existing snapshot, this field will be filled with the
177		// "creation_time"
178		// value returned from the CSI "ListSnapshots" gRPC call if the
179		// driver supports it.
180		// If not specified, it indicates the creation time is unknown.
181		// The format of this field is a Unix nanoseconds time encoded as
182		// an int64.
183		// On Unix, the command `date +%s%N` returns the current time in
184		// nanoseconds
185		// since 1970-01-01 00:00:00 UTC.
186		"creationTime"?: int64 & int
187
188		// error is the last observed error during snapshot creation, if
189		// any.
190		// Upon success after retry, this error field will be cleared.
191		"error"?: {
192			// message is a string detailing the encountered error during
193			// snapshot
194			// creation if specified.
195			// NOTE: message may be logged, and it should not contain
196			// sensitive
197			// information.
198			"message"?: string
199
200			// time is the timestamp when the error was encountered.
201			"time"?: time.Time
202		}
203
204		// readyToUse indicates if a snapshot is ready to be used to
205		// restore a volume.
206		// In dynamic snapshot creation case, this field will be filled in
207		// by the
208		// CSI snapshotter sidecar with the "ready_to_use" value returned
209		// from CSI
210		// "CreateSnapshot" gRPC call.
211		// For a pre-existing snapshot, this field will be filled with the
212		// "ready_to_use"
213		// value returned from the CSI "ListSnapshots" gRPC call if the
214		// driver supports it,
215		// otherwise, this field will be set to "True".
216		// If not specified, it means the readiness of a snapshot is
217		// unknown.
218		"readyToUse"?: bool
219
220		// restoreSize represents the complete size of the snapshot in
221		// bytes.
222		// In dynamic snapshot creation case, this field will be filled in
223		// by the
224		// CSI snapshotter sidecar with the "size_bytes" value returned
225		// from CSI
226		// "CreateSnapshot" gRPC call.
227		// For a pre-existing snapshot, this field will be filled with the
228		// "size_bytes"
229		// value returned from the CSI "ListSnapshots" gRPC call if the
230		// driver supports it.
231		// When restoring a volume from this snapshot, the size of the
232		// volume MUST NOT
233		// be smaller than the restoreSize if it is specified, otherwise
234		// the restoration will fail.
235		// If not specified, it indicates that the size is unknown.
236		"restoreSize"?: int64 & int & >=0
237
238		// snapshotHandle is the CSI "snapshot_id" of a snapshot on the
239		// underlying storage system.
240		// If not specified, it indicates that dynamic snapshot creation
241		// has either failed
242		// or it is still in progress.
243		"snapshotHandle"?: string
244
245		// VolumeGroupSnapshotHandle is the CSI "group_snapshot_id" of a
246		// group snapshot
247		// on the underlying storage system.
248		"volumeGroupSnapshotHandle"?: string
249	}
250
251	_embeddedResource: {
252		"apiVersion"!: string
253		"kind"!:       string
254		"metadata"?: {
255			...
256		}
257	}
258	apiVersion: "snapshot.storage.k8s.io/v1"
259	kind:       "VolumeSnapshotContent"
260	metadata!: {
261		"name"!:      string
262		"namespace"?: string
263		"labels"?: {
264			[string]: string
265		}
266		"annotations"?: {
267			[string]: string
268		}
269		...
270	}
271}