blob: 40a7640518119440d1a0d91254665b80b31559a5 [file] [log] [blame]
Matteo Scandoloa4285862020-12-01 18:10:10 -08001/*
2Copyright The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17
18// This file was autogenerated by go-to-protobuf. Do not edit it manually!
19
20syntax = 'proto2';
21
22package k8s.io.api.storage.v1alpha1;
23
24import "k8s.io/api/core/v1/generated.proto";
25import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
26import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
27import "k8s.io/apimachinery/pkg/runtime/generated.proto";
28import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
29
30// Package-wide variables from generator "generated".
31option go_package = "v1alpha1";
32
33// CSIStorageCapacity stores the result of one CSI GetCapacity call.
34// For a given StorageClass, this describes the available capacity in a
35// particular topology segment. This can be used when considering where to
36// instantiate new PersistentVolumes.
37//
38// For example this can express things like:
39// - StorageClass "standard" has "1234 GiB" available in "topology.kubernetes.io/zone=us-east1"
40// - StorageClass "localssd" has "10 GiB" available in "kubernetes.io/hostname=knode-abc123"
41//
42// The following three cases all imply that no capacity is available for
43// a certain combination:
44// - no object exists with suitable topology and storage class name
45// - such an object exists, but the capacity is unset
46// - such an object exists, but the capacity is zero
47//
48// The producer of these objects can decide which approach is more suitable.
49//
50// This is an alpha feature and only available when the CSIStorageCapacity feature is enabled.
51message CSIStorageCapacity {
52 // Standard object's metadata. The name has no particular meaning. It must be
53 // be a DNS subdomain (dots allowed, 253 characters). To ensure that
54 // there are no conflicts with other CSI drivers on the cluster, the recommendation
55 // is to use csisc-<uuid>, a generated name, or a reverse-domain name which ends
56 // with the unique CSI driver name.
57 //
58 // Objects are namespaced.
59 //
60 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
61 // +optional
62 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
63
64 // NodeTopology defines which nodes have access to the storage
65 // for which capacity was reported. If not set, the storage is
66 // not accessible from any node in the cluster. If empty, the
67 // storage is accessible from all nodes. This field is
68 // immutable.
69 //
70 // +optional
71 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector nodeTopology = 2;
72
73 // The name of the StorageClass that the reported capacity applies to.
74 // It must meet the same requirements as the name of a StorageClass
75 // object (non-empty, DNS subdomain). If that object no longer exists,
76 // the CSIStorageCapacity object is obsolete and should be removed by its
77 // creator.
78 // This field is immutable.
79 optional string storageClassName = 3;
80
81 // Capacity is the value reported by the CSI driver in its GetCapacityResponse
82 // for a GetCapacityRequest with topology and parameters that match the
83 // previous fields.
84 //
85 // The semantic is currently (CSI spec 1.2) defined as:
86 // The available capacity, in bytes, of the storage that can be used
87 // to provision volumes. If not set, that information is currently
88 // unavailable and treated like zero capacity.
89 //
90 // +optional
91 optional k8s.io.apimachinery.pkg.api.resource.Quantity capacity = 4;
92}
93
94// CSIStorageCapacityList is a collection of CSIStorageCapacity objects.
95message CSIStorageCapacityList {
96 // Standard list metadata
97 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
98 // +optional
99 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
100
101 // Items is the list of CSIStorageCapacity objects.
102 // +listType=map
103 // +listMapKey=name
104 repeated CSIStorageCapacity items = 2;
105}
106
107// VolumeAttachment captures the intent to attach or detach the specified volume
108// to/from the specified node.
109//
110// VolumeAttachment objects are non-namespaced.
111message VolumeAttachment {
112 // Standard object metadata.
113 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
114 // +optional
115 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
116
117 // Specification of the desired attach/detach volume behavior.
118 // Populated by the Kubernetes system.
119 optional VolumeAttachmentSpec spec = 2;
120
121 // Status of the VolumeAttachment request.
122 // Populated by the entity completing the attach or detach
123 // operation, i.e. the external-attacher.
124 // +optional
125 optional VolumeAttachmentStatus status = 3;
126}
127
128// VolumeAttachmentList is a collection of VolumeAttachment objects.
129message VolumeAttachmentList {
130 // Standard list metadata
131 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
132 // +optional
133 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
134
135 // Items is the list of VolumeAttachments
136 repeated VolumeAttachment items = 2;
137}
138
139// VolumeAttachmentSource represents a volume that should be attached.
140// Right now only PersistenVolumes can be attached via external attacher,
141// in future we may allow also inline volumes in pods.
142// Exactly one member can be set.
143message VolumeAttachmentSource {
144 // Name of the persistent volume to attach.
145 // +optional
146 optional string persistentVolumeName = 1;
147
148 // inlineVolumeSpec contains all the information necessary to attach
149 // a persistent volume defined by a pod's inline VolumeSource. This field
150 // is populated only for the CSIMigration feature. It contains
151 // translated fields from a pod's inline VolumeSource to a
152 // PersistentVolumeSpec. This field is alpha-level and is only
153 // honored by servers that enabled the CSIMigration feature.
154 // +optional
155 optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
156}
157
158// VolumeAttachmentSpec is the specification of a VolumeAttachment request.
159message VolumeAttachmentSpec {
160 // Attacher indicates the name of the volume driver that MUST handle this
161 // request. This is the name returned by GetPluginName().
162 optional string attacher = 1;
163
164 // Source represents the volume that should be attached.
165 optional VolumeAttachmentSource source = 2;
166
167 // The node that the volume should be attached to.
168 optional string nodeName = 3;
169}
170
171// VolumeAttachmentStatus is the status of a VolumeAttachment request.
172message VolumeAttachmentStatus {
173 // Indicates the volume is successfully attached.
174 // This field must only be set by the entity completing the attach
175 // operation, i.e. the external-attacher.
176 optional bool attached = 1;
177
178 // Upon successful attach, this field is populated with any
179 // information returned by the attach operation that must be passed
180 // into subsequent WaitForAttach or Mount calls.
181 // This field must only be set by the entity completing the attach
182 // operation, i.e. the external-attacher.
183 // +optional
184 map<string, string> attachmentMetadata = 2;
185
186 // The last error encountered during attach operation, if any.
187 // This field must only be set by the entity completing the attach
188 // operation, i.e. the external-attacher.
189 // +optional
190 optional VolumeError attachError = 3;
191
192 // The last error encountered during detach operation, if any.
193 // This field must only be set by the entity completing the detach
194 // operation, i.e. the external-attacher.
195 // +optional
196 optional VolumeError detachError = 4;
197}
198
199// VolumeError captures an error encountered during a volume operation.
200message VolumeError {
201 // Time the error was encountered.
202 // +optional
203 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
204
205 // String detailing the error encountered during Attach or Detach operation.
206 // This string maybe logged, so it should not contain sensitive
207 // information.
208 // +optional
209 optional string message = 2;
210}
211