diff --git a/api/services/mounts/v1/doc.go b/api/services/mounts/v1/doc.go new file mode 100644 index 0000000000..ece9d01b4b --- /dev/null +++ b/api/services/mounts/v1/doc.go @@ -0,0 +1,17 @@ +/* + 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. +*/ + +package mounts diff --git a/api/services/mounts/v1/mounts.proto b/api/services/mounts/v1/mounts.proto new file mode 100644 index 0000000000..0e78467633 --- /dev/null +++ b/api/services/mounts/v1/mounts.proto @@ -0,0 +1,78 @@ +/* + 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 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; +} diff --git a/api/types/mount.proto b/api/types/mount.proto index 54e0a0cddf..2f3b0b6229 100644 --- a/api/types/mount.proto +++ b/api/types/mount.proto @@ -18,6 +18,8 @@ syntax = "proto3"; package containerd.types; +import "google/protobuf/timestamp.proto"; + option go_package = "github.com/containerd/containerd/api/types;types"; // Mount describes mounts for a container. @@ -41,3 +43,23 @@ message Mount { // Options specifies zero or more fstab style mount options. repeated string options = 4; } + +message ActiveMount { + Mount mount = 1; + + google.protobuf.Timestamp mounted_at = 2; + + string mount_point = 3; + + map data = 4; +} + +message ActivationInfo { + string name = 1; + + repeated ActiveMount active = 2; + + repeated Mount system = 3; + + map labels = 4; +}