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

snapshot/v1/VolumeSnapshotContent.cue raw

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