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

snapshot/v1beta1/VolumeSnapshotContent.cue raw

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