| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| syntax = "proto3"; |
| |
| import "mesos/csi/types.proto"; |
| |
| package mesos.csi.state; |
| |
| // NOTE: The keywords 'REQUIRED' and 'OPTIONAL' are to be interpreted as |
| // described in the CSI specification: |
| // https://github.com/container-storage-interface/spec/blob/master/spec.md#required-vs-optional // NOLINT |
| |
| // Represents the state of a provisioned volume with respect to a node. |
| message VolumeState { |
| enum State { |
| UNKNOWN = 0; |
| CREATED = 1; // The volume is provisioned but not published. |
| NODE_READY = 2; // The volume is made available on the node. |
| VOL_READY = 8; // The volume is made publishable on the node. |
| PUBLISHED = 3; // The volume is published on the node. |
| CONTROLLER_PUBLISH = 4; // `ControllerPublishVolume` is being called. |
| CONTROLLER_UNPUBLISH = 5; // `ControllerUnpublishVolume` is being called. |
| NODE_STAGE = 9; // `NodeStageVolume` is being called. |
| NODE_UNSTAGE = 10; // `NodeUnstageVolume` is being called. |
| NODE_PUBLISH = 6; // `NodePublishVolume` is being called. |
| NODE_UNPUBLISH = 7; // `NodeUnpublishVolume` is being called. |
| } |
| |
| // The state of the volume. This is a REQUIRED field. |
| State state = 1; |
| |
| // The capability used to publish the volume. This is a REQUIRED field. |
| types.VolumeCapability volume_capability = 2; |
| |
| // The parameters used when creating the volume. This is an OPTIONAL field. |
| map<string, string> parameters = 6; |
| |
| // Attributes of the volume to be used on the node. This field MUST match the |
| // `volume_context` field of the `Volume` returned by `CreateVolume`. This is |
| // an OPTIONAL field. |
| map<string, string> volume_context = 3; |
| |
| // If the plugin has the `PUBLISH_UNPUBLISH_VOLUME` controller capability, |
| // this field MUST be set to the `publish_context` field returned by |
| // `ControllerPublishVolume`. Otherwise, this field MUST remain unset. This is |
| // an OPTIONAL field. |
| map<string, string> publish_context = 4; |
| |
| // This field is used to check if the node has been rebooted since the volume |
| // is made publishable on the node. It MUST be set to the boot ID of the node |
| // when the volume is transitioned to `VOL_READY`, and SHOULD be cleared when |
| // the volume is transitioned to `NODE_READY`. This is an OPTIONAL field. |
| string boot_id = 5; |
| |
| // This field is used to check if the volume has been used by a container and |
| // hence needs cleanup. If set, the resource provider MUST transition the |
| // volume to `PUBLISHED` state during recovery. |
| bool node_publish_required = 7; |
| } |