generated.proto 9.0 KB

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