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

snapshot/v1beta1/VolumeSnapshotContent.cue raw

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