/*
	Copyright The containerd Authors.

	Licensed 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";

package containerd.services.mounts.v1;

import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "github.com/containerd/containerd/api/types/mount.proto";

option go_package = "github.com/containerd/containerd/api/services/mounts/v1;mounts";

// Mounts service manages mounts
service Mounts {
	rpc Activate(ActivateRequest) returns (ActivateResponse);
	rpc Deactivate(DeactivateRequest) returns (google.protobuf.Empty);
	rpc Info(InfoRequest) returns (InfoResponse);
	rpc Update(UpdateRequest) returns (UpdateResponse);
	rpc List(ListRequest) returns (stream ListMessage);
}

message ActivateRequest {
	string name = 1;

	repeated containerd.types.Mount mounts = 2;

	map<string, string> labels = 3;

	bool temporary = 4;

}

message ActivateResponse {
	containerd.types.ActivationInfo info = 1;
}

message DeactivateRequest {
	string name = 1;
}

message InfoRequest {
	string name = 1;
}

message InfoResponse {
	containerd.types.ActivationInfo info = 1;
}

message UpdateRequest {
	containerd.types.ActivationInfo info = 1;

	google.protobuf.FieldMask update_mask = 2;
}

message UpdateResponse {
	containerd.types.ActivationInfo info = 1;
}

message ListRequest {
	repeated string filters = 1;
}

message ListMessage {
	containerd.types.ActivationInfo info = 1;
}
