diff --git a/cli/cmd/serve.go b/cli/cmd/serve.go index f3aa6c0c7..84667ba87 100644 --- a/cli/cmd/serve.go +++ b/cli/cmd/serve.go @@ -26,6 +26,7 @@ import ( containersv1 "github.com/docker/compose-cli/protos/containers/v1" contextsv1 "github.com/docker/compose-cli/protos/contexts/v1" streamsv1 "github.com/docker/compose-cli/protos/streams/v1" + volumesv1 "github.com/docker/compose-cli/protos/volumes/v1" "github.com/docker/compose-cli/server" "github.com/docker/compose-cli/server/proxy" ) @@ -64,8 +65,9 @@ func runServe(ctx context.Context, opts serveOpts) error { p := proxy.New(ctx) containersv1.RegisterContainersServer(s, p) - streamsv1.RegisterStreamingServer(s, p) contextsv1.RegisterContextsServer(s, p.ContextsProxy()) + streamsv1.RegisterStreamingServer(s, p) + volumesv1.RegisterVolumesServer(s, p) go func() { <-ctx.Done() diff --git a/protos/volumes/v1/volumes.pb.go b/protos/volumes/v1/volumes.pb.go index 476b89ceb..0a5991361 100644 --- a/protos/volumes/v1/volumes.pb.go +++ b/protos/volumes/v1/volumes.pb.go @@ -1,5 +1,5 @@ // -// Copyright 2020 Docker, Inc. +// Copyright 2020 Docker Compose CLI authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ package v1 import ( context "context" proto "github.com/golang/protobuf/proto" - any "github.com/golang/protobuf/ptypes/any" + _ "github.com/golang/protobuf/ptypes/any" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -100,18 +100,68 @@ func (x *Volume) GetDescription() string { return "" } +type AciVolumeCreateOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StorageAccount string `protobuf:"bytes,1,opt,name=storage_account,json=storageAccount,proto3" json:"storage_account,omitempty"` +} + +func (x *AciVolumeCreateOptions) Reset() { + *x = AciVolumeCreateOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AciVolumeCreateOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AciVolumeCreateOptions) ProtoMessage() {} + +func (x *AciVolumeCreateOptions) ProtoReflect() protoreflect.Message { + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AciVolumeCreateOptions.ProtoReflect.Descriptor instead. +func (*AciVolumeCreateOptions) Descriptor() ([]byte, []int) { + return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{1} +} + +func (x *AciVolumeCreateOptions) GetStorageAccount() string { + if x != nil { + return x.StorageAccount + } + return "" +} + type VolumesCreateRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Options []*any.Any `protobuf:"bytes,1,rep,name=options,proto3" json:"options,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Types that are assignable to Options: + // *VolumesCreateRequest_AciOption + Options isVolumesCreateRequest_Options `protobuf_oneof:"options"` } func (x *VolumesCreateRequest) Reset() { *x = VolumesCreateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_volumes_v1_volumes_proto_msgTypes[1] + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -124,7 +174,7 @@ func (x *VolumesCreateRequest) String() string { func (*VolumesCreateRequest) ProtoMessage() {} func (x *VolumesCreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_volumes_v1_volumes_proto_msgTypes[1] + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -137,16 +187,40 @@ func (x *VolumesCreateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumesCreateRequest.ProtoReflect.Descriptor instead. func (*VolumesCreateRequest) Descriptor() ([]byte, []int) { - return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{1} + return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{2} } -func (x *VolumesCreateRequest) GetOptions() []*any.Any { +func (x *VolumesCreateRequest) GetName() string { if x != nil { - return x.Options + return x.Name + } + return "" +} + +func (m *VolumesCreateRequest) GetOptions() isVolumesCreateRequest_Options { + if m != nil { + return m.Options } return nil } +func (x *VolumesCreateRequest) GetAciOption() *AciVolumeCreateOptions { + if x, ok := x.GetOptions().(*VolumesCreateRequest_AciOption); ok { + return x.AciOption + } + return nil +} + +type isVolumesCreateRequest_Options interface { + isVolumesCreateRequest_Options() +} + +type VolumesCreateRequest_AciOption struct { + AciOption *AciVolumeCreateOptions `protobuf:"bytes,2,opt,name=aci_option,json=aciOption,proto3,oneof"` +} + +func (*VolumesCreateRequest_AciOption) isVolumesCreateRequest_Options() {} + type VolumesCreateResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -158,7 +232,7 @@ type VolumesCreateResponse struct { func (x *VolumesCreateResponse) Reset() { *x = VolumesCreateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_volumes_v1_volumes_proto_msgTypes[2] + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -171,7 +245,7 @@ func (x *VolumesCreateResponse) String() string { func (*VolumesCreateResponse) ProtoMessage() {} func (x *VolumesCreateResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_volumes_v1_volumes_proto_msgTypes[2] + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -184,7 +258,7 @@ func (x *VolumesCreateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumesCreateResponse.ProtoReflect.Descriptor instead. func (*VolumesCreateResponse) Descriptor() ([]byte, []int) { - return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{2} + return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{3} } func (x *VolumesCreateResponse) GetVolume() *Volume { @@ -203,7 +277,7 @@ type VolumesListRequest struct { func (x *VolumesListRequest) Reset() { *x = VolumesListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_volumes_v1_volumes_proto_msgTypes[3] + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -216,7 +290,7 @@ func (x *VolumesListRequest) String() string { func (*VolumesListRequest) ProtoMessage() {} func (x *VolumesListRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_volumes_v1_volumes_proto_msgTypes[3] + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -229,7 +303,7 @@ func (x *VolumesListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumesListRequest.ProtoReflect.Descriptor instead. func (*VolumesListRequest) Descriptor() ([]byte, []int) { - return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{3} + return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{4} } type VolumesListResponse struct { @@ -243,7 +317,7 @@ type VolumesListResponse struct { func (x *VolumesListResponse) Reset() { *x = VolumesListResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_volumes_v1_volumes_proto_msgTypes[4] + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -256,7 +330,7 @@ func (x *VolumesListResponse) String() string { func (*VolumesListResponse) ProtoMessage() {} func (x *VolumesListResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_volumes_v1_volumes_proto_msgTypes[4] + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -269,7 +343,7 @@ func (x *VolumesListResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumesListResponse.ProtoReflect.Descriptor instead. func (*VolumesListResponse) Descriptor() ([]byte, []int) { - return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{4} + return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{5} } func (x *VolumesListResponse) GetVolumes() []*Volume { @@ -284,14 +358,13 @@ type VolumesDeleteRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Options []*any.Any `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *VolumesDeleteRequest) Reset() { *x = VolumesDeleteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_volumes_v1_volumes_proto_msgTypes[5] + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -304,7 +377,7 @@ func (x *VolumesDeleteRequest) String() string { func (*VolumesDeleteRequest) ProtoMessage() {} func (x *VolumesDeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_volumes_v1_volumes_proto_msgTypes[5] + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -317,7 +390,7 @@ func (x *VolumesDeleteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumesDeleteRequest.ProtoReflect.Descriptor instead. func (*VolumesDeleteRequest) Descriptor() ([]byte, []int) { - return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{5} + return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{6} } func (x *VolumesDeleteRequest) GetId() string { @@ -327,13 +400,6 @@ func (x *VolumesDeleteRequest) GetId() string { return "" } -func (x *VolumesDeleteRequest) GetOptions() []*any.Any { - if x != nil { - return x.Options - } - return nil -} - type VolumesDeleteResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -343,7 +409,7 @@ type VolumesDeleteResponse struct { func (x *VolumesDeleteResponse) Reset() { *x = VolumesDeleteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_volumes_v1_volumes_proto_msgTypes[6] + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -356,7 +422,7 @@ func (x *VolumesDeleteResponse) String() string { func (*VolumesDeleteResponse) ProtoMessage() {} func (x *VolumesDeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_volumes_v1_volumes_proto_msgTypes[6] + mi := &file_protos_volumes_v1_volumes_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -369,7 +435,7 @@ func (x *VolumesDeleteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VolumesDeleteResponse.ProtoReflect.Descriptor instead. func (*VolumesDeleteResponse) Descriptor() ([]byte, []int) { - return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{6} + return file_protos_volumes_v1_volumes_proto_rawDescGZIP(), []int{7} } var File_protos_volumes_v1_volumes_proto protoreflect.FileDescriptor @@ -384,60 +450,66 @@ var file_protos_volumes_v1_volumes_proto_rawDesc = []byte{ 0x0a, 0x06, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x46, 0x0a, 0x14, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0x59, 0x0a, 0x15, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x76, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x22, 0x14, 0x0a, - 0x12, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x59, 0x0a, 0x13, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x76, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x07, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x22, 0x56, - 0x0a, 0x14, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0x8b, 0x03, 0x0a, 0x07, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x80, 0x01, 0x0a, 0x0d, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x36, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, - 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7a, - 0x0a, 0x0b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x34, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x0d, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x36, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x41, 0x0a, 0x16, 0x41, 0x63, + 0x69, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x90, 0x01, + 0x0a, 0x14, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x59, 0x0a, 0x0a, 0x61, 0x63, + 0x69, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, + 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x63, 0x69, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x09, 0x61, 0x63, 0x69, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x22, 0x59, 0x0a, 0x15, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x76, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x52, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x59, 0x0a, 0x13, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x52, 0x07, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x22, 0x26, 0x0a, 0x14, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, - 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x34, 0x5a, - 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x6b, - 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2f, 0x76, 0x31, - 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8b, 0x03, + 0x0a, 0x07, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x80, 0x01, 0x0a, 0x0d, 0x56, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x36, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7a, 0x0a, 0x0b, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x34, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x35, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x0d, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x36, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x76, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x34, 0x5a, 0x32, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, + 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -452,33 +524,32 @@ func file_protos_volumes_v1_volumes_proto_rawDescGZIP() []byte { return file_protos_volumes_v1_volumes_proto_rawDescData } -var file_protos_volumes_v1_volumes_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_protos_volumes_v1_volumes_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_protos_volumes_v1_volumes_proto_goTypes = []interface{}{ - (*Volume)(nil), // 0: com.docker.api.protos.volumes.v1.Volume - (*VolumesCreateRequest)(nil), // 1: com.docker.api.protos.volumes.v1.VolumesCreateRequest - (*VolumesCreateResponse)(nil), // 2: com.docker.api.protos.volumes.v1.VolumesCreateResponse - (*VolumesListRequest)(nil), // 3: com.docker.api.protos.volumes.v1.VolumesListRequest - (*VolumesListResponse)(nil), // 4: com.docker.api.protos.volumes.v1.VolumesListResponse - (*VolumesDeleteRequest)(nil), // 5: com.docker.api.protos.volumes.v1.VolumesDeleteRequest - (*VolumesDeleteResponse)(nil), // 6: com.docker.api.protos.volumes.v1.VolumesDeleteResponse - (*any.Any)(nil), // 7: google.protobuf.Any + (*Volume)(nil), // 0: com.docker.api.protos.volumes.v1.Volume + (*AciVolumeCreateOptions)(nil), // 1: com.docker.api.protos.volumes.v1.AciVolumeCreateOptions + (*VolumesCreateRequest)(nil), // 2: com.docker.api.protos.volumes.v1.VolumesCreateRequest + (*VolumesCreateResponse)(nil), // 3: com.docker.api.protos.volumes.v1.VolumesCreateResponse + (*VolumesListRequest)(nil), // 4: com.docker.api.protos.volumes.v1.VolumesListRequest + (*VolumesListResponse)(nil), // 5: com.docker.api.protos.volumes.v1.VolumesListResponse + (*VolumesDeleteRequest)(nil), // 6: com.docker.api.protos.volumes.v1.VolumesDeleteRequest + (*VolumesDeleteResponse)(nil), // 7: com.docker.api.protos.volumes.v1.VolumesDeleteResponse } var file_protos_volumes_v1_volumes_proto_depIdxs = []int32{ - 7, // 0: com.docker.api.protos.volumes.v1.VolumesCreateRequest.options:type_name -> google.protobuf.Any + 1, // 0: com.docker.api.protos.volumes.v1.VolumesCreateRequest.aci_option:type_name -> com.docker.api.protos.volumes.v1.AciVolumeCreateOptions 0, // 1: com.docker.api.protos.volumes.v1.VolumesCreateResponse.volume:type_name -> com.docker.api.protos.volumes.v1.Volume 0, // 2: com.docker.api.protos.volumes.v1.VolumesListResponse.volumes:type_name -> com.docker.api.protos.volumes.v1.Volume - 7, // 3: com.docker.api.protos.volumes.v1.VolumesDeleteRequest.options:type_name -> google.protobuf.Any - 1, // 4: com.docker.api.protos.volumes.v1.Volumes.VolumesCreate:input_type -> com.docker.api.protos.volumes.v1.VolumesCreateRequest - 3, // 5: com.docker.api.protos.volumes.v1.Volumes.VolumesList:input_type -> com.docker.api.protos.volumes.v1.VolumesListRequest - 5, // 6: com.docker.api.protos.volumes.v1.Volumes.VolumesDelete:input_type -> com.docker.api.protos.volumes.v1.VolumesDeleteRequest - 2, // 7: com.docker.api.protos.volumes.v1.Volumes.VolumesCreate:output_type -> com.docker.api.protos.volumes.v1.VolumesCreateResponse - 4, // 8: com.docker.api.protos.volumes.v1.Volumes.VolumesList:output_type -> com.docker.api.protos.volumes.v1.VolumesListResponse - 6, // 9: com.docker.api.protos.volumes.v1.Volumes.VolumesDelete:output_type -> com.docker.api.protos.volumes.v1.VolumesDeleteResponse - 7, // [7:10] is the sub-list for method output_type - 4, // [4:7] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 2, // 3: com.docker.api.protos.volumes.v1.Volumes.VolumesCreate:input_type -> com.docker.api.protos.volumes.v1.VolumesCreateRequest + 4, // 4: com.docker.api.protos.volumes.v1.Volumes.VolumesList:input_type -> com.docker.api.protos.volumes.v1.VolumesListRequest + 6, // 5: com.docker.api.protos.volumes.v1.Volumes.VolumesDelete:input_type -> com.docker.api.protos.volumes.v1.VolumesDeleteRequest + 3, // 6: com.docker.api.protos.volumes.v1.Volumes.VolumesCreate:output_type -> com.docker.api.protos.volumes.v1.VolumesCreateResponse + 5, // 7: com.docker.api.protos.volumes.v1.Volumes.VolumesList:output_type -> com.docker.api.protos.volumes.v1.VolumesListResponse + 7, // 8: com.docker.api.protos.volumes.v1.Volumes.VolumesDelete:output_type -> com.docker.api.protos.volumes.v1.VolumesDeleteResponse + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_protos_volumes_v1_volumes_proto_init() } @@ -500,7 +571,7 @@ func file_protos_volumes_v1_volumes_proto_init() { } } file_protos_volumes_v1_volumes_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumesCreateRequest); i { + switch v := v.(*AciVolumeCreateOptions); i { case 0: return &v.state case 1: @@ -512,7 +583,7 @@ func file_protos_volumes_v1_volumes_proto_init() { } } file_protos_volumes_v1_volumes_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumesCreateResponse); i { + switch v := v.(*VolumesCreateRequest); i { case 0: return &v.state case 1: @@ -524,7 +595,7 @@ func file_protos_volumes_v1_volumes_proto_init() { } } file_protos_volumes_v1_volumes_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumesListRequest); i { + switch v := v.(*VolumesCreateResponse); i { case 0: return &v.state case 1: @@ -536,7 +607,7 @@ func file_protos_volumes_v1_volumes_proto_init() { } } file_protos_volumes_v1_volumes_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumesListResponse); i { + switch v := v.(*VolumesListRequest); i { case 0: return &v.state case 1: @@ -548,7 +619,7 @@ func file_protos_volumes_v1_volumes_proto_init() { } } file_protos_volumes_v1_volumes_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VolumesDeleteRequest); i { + switch v := v.(*VolumesListResponse); i { case 0: return &v.state case 1: @@ -560,6 +631,18 @@ func file_protos_volumes_v1_volumes_proto_init() { } } file_protos_volumes_v1_volumes_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VolumesDeleteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_volumes_v1_volumes_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*VolumesDeleteResponse); i { case 0: return &v.state @@ -572,13 +655,16 @@ func file_protos_volumes_v1_volumes_proto_init() { } } } + file_protos_volumes_v1_volumes_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*VolumesCreateRequest_AciOption)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protos_volumes_v1_volumes_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/protos/volumes/v1/volumes.proto b/protos/volumes/v1/volumes.proto index 912ff0d54..4383131e2 100644 --- a/protos/volumes/v1/volumes.proto +++ b/protos/volumes/v1/volumes.proto @@ -1,5 +1,5 @@ // -// Copyright 2020 Docker, Inc. +// Copyright 2020 Docker Compose CLI authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -32,8 +32,15 @@ message Volume { string description = 2; } +message AciVolumeCreateOptions { + string storage_account = 1; +} + message VolumesCreateRequest { - repeated google.protobuf.Any options = 1; + string name = 1; + oneof options { + AciVolumeCreateOptions aci_option = 2; + } } message VolumesCreateResponse { @@ -49,7 +56,6 @@ message VolumesListResponse { message VolumesDeleteRequest { string id = 1; - repeated google.protobuf.Any options = 2; } message VolumesDeleteResponse { diff --git a/server/metrics.go b/server/metrics.go index 83ee48847..a1f871b4e 100644 --- a/server/metrics.go +++ b/server/metrics.go @@ -36,9 +36,12 @@ var ( "/com.docker.api.protos.containers.v1.Containers/Kill": "kill", "/com.docker.api.protos.containers.v1.Containers/Inspect": "inspect", "/com.docker.api.protos.containers.v1.Containers/Logs": "logs", - "/com.docker.api.protos.streams.v1.Streaming/NewStream": "", + "/com.docker.api.protos.streams.v1.Streaming/NewStream": "streaming", "/com.docker.api.protos.context.v1.Contexts/List": "context ls", "/com.docker.api.protos.context.v1.Contexts/SetCurrent": "context use", + "/com.docker.api.protos.volumes.v1.Volumes/VolumesList": "volume ls", + "/com.docker.api.protos.volumes.v1.Volumes/VolumesDelete": "volume rm", + "/com.docker.api.protos.volumes.v1.Volumes/VolumesCreate": "volume create", } ) diff --git a/server/metrics_test.go b/server/metrics_test.go index 9f9e886fd..659634c3f 100644 --- a/server/metrics_test.go +++ b/server/metrics_test.go @@ -36,6 +36,7 @@ import ( containersv1 "github.com/docker/compose-cli/protos/containers/v1" contextsv1 "github.com/docker/compose-cli/protos/contexts/v1" streamsv1 "github.com/docker/compose-cli/protos/streams/v1" + volumesv1 "github.com/docker/compose-cli/protos/volumes/v1" "github.com/docker/compose-cli/server/proxy" ) @@ -104,6 +105,7 @@ func setupServer() *grpc.Server { p := proxy.New(ctx) containersv1.RegisterContainersServer(s, p) streamsv1.RegisterStreamingServer(s, p) + volumesv1.RegisterVolumesServer(s, p) contextsv1.RegisterContextsServer(s, p.ContextsProxy()) return s } diff --git a/server/proxy/volumes.go b/server/proxy/volumes.go index 65fcbc78e..0d2ce4efc 100644 --- a/server/proxy/volumes.go +++ b/server/proxy/volumes.go @@ -1,15 +1,41 @@ +/* + Copyright 2020 Docker Compose CLI 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 proxy import ( "context" + "github.com/docker/compose-cli/aci" "github.com/docker/compose-cli/api/volumes" volumesv1 "github.com/docker/compose-cli/protos/volumes/v1" ) // VolumesCreate creates a volume. func (p *proxy) VolumesCreate(ctx context.Context, req *volumesv1.VolumesCreateRequest) (*volumesv1.VolumesCreateResponse, error) { - v, err := Client(ctx).VolumeService().Create(ctx, req.Options) + storageAccount := "" + aciReq := req.GetAciOption() + if aciReq != nil { + storageAccount = aciReq.StorageAccount + } + aciOpts := aci.VolumeCreateOptions{ + Account: storageAccount, + } + + v, err := Client(ctx).VolumeService().Create(ctx, req.Name, aciOpts) if err != nil { return &volumesv1.VolumesCreateResponse{}, err } @@ -33,7 +59,7 @@ func (p *proxy) VolumesList(ctx context.Context, req *volumesv1.VolumesListReque // VolumesDelete deletes a volume. func (p *proxy) VolumesDelete(ctx context.Context, req *volumesv1.VolumesDeleteRequest) (*volumesv1.VolumesDeleteResponse, error) { - err := Client(ctx).VolumeService().Delete(ctx, req.Id, req.Options) + err := Client(ctx).VolumeService().Delete(ctx, req.Id, nil) return &volumesv1.VolumesDeleteResponse{}, err }