From d7737effbf3f117d3e4ac6bf4417e7059e896885 Mon Sep 17 00:00:00 2001 From: sophia Date: Fri, 5 Nov 2021 14:23:29 -0500 Subject: [PATCH] Add id to box --- .../server/proto/vagrant_server/server.pb.go | 52 +++++++++++-------- .../server/proto/vagrant_server/server.proto | 10 +++- .../proto/vagrant_server/server_pb.rb | 4 +- 3 files changed, 42 insertions(+), 24 deletions(-) diff --git a/internal/server/proto/vagrant_server/server.pb.go b/internal/server/proto/vagrant_server/server.pb.go index e9961bf6a..885059d7d 100644 --- a/internal/server/proto/vagrant_server/server.pb.go +++ b/internal/server/proto/vagrant_server/server.pb.go @@ -930,8 +930,8 @@ type Box struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The box name. This is the logical name used when adding the box. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Internal ID of the box + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // This is the provider that this box is built for. Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` // The version of this box. @@ -945,8 +945,10 @@ type Box struct { // This is the URL to the version info and other metadata for this // box. MetadataUrl string `protobuf:"bytes,6,opt,name=metadata_url,json=metadataUrl,proto3" json:"metadata_url,omitempty"` + // The box name. This is the logical name used when adding the box. + Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"` // Tracks the last automatic update for the box - LastUpdate *timestamp.Timestamp `protobuf:"bytes,7,opt,name=last_update,json=lastUpdate,proto3" json:"last_update,omitempty"` + LastUpdate *timestamp.Timestamp `protobuf:"bytes,8,opt,name=last_update,json=lastUpdate,proto3" json:"last_update,omitempty"` } func (x *Box) Reset() { @@ -981,9 +983,9 @@ func (*Box) Descriptor() ([]byte, []int) { return file_proto_vagrant_server_server_proto_rawDescGZIP(), []int{4} } -func (x *Box) GetName() string { +func (x *Box) GetId() string { if x != nil { - return x.Name + return x.Id } return "" } @@ -1023,6 +1025,13 @@ func (x *Box) GetMetadataUrl() string { return "" } +func (x *Box) GetName() string { + if x != nil { + return x.Name + } + return "" +} + func (x *Box) GetLastUpdate() *timestamp.Timestamp { if x != nil { return x.LastUpdate @@ -11634,22 +11643,23 @@ var file_proto_vagrant_server_server_proto_rawDesc = []byte{ 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x4a, 0x6f, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0xcc, - 0x02, 0x0a, 0x03, 0x42, 0x6f, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x40, - 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, - 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x42, 0x6f, 0x78, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x75, 0x72, 0x6c, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x55, 0x72, 0x6c, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x63, 0x65, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0xdc, + 0x02, 0x0a, 0x03, 0x42, 0x6f, 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, + 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x40, 0x0a, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x68, + 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x76, 0x61, 0x67, 0x72, 0x61, 0x6e, 0x74, + 0x2e, 0x42, 0x6f, 0x78, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x55, 0x72, 0x6c, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, diff --git a/internal/server/proto/vagrant_server/server.proto b/internal/server/proto/vagrant_server/server.proto index e675afdc4..103ba76ad 100644 --- a/internal/server/proto/vagrant_server/server.proto +++ b/internal/server/proto/vagrant_server/server.proto @@ -264,8 +264,8 @@ message Project { } message Box { - // The box name. This is the logical name used when adding the box. - string name = 1; + // Internal ID of the box + string id = 1; // This is the provider that this box is built for. string provider = 2; @@ -284,6 +284,12 @@ message Box { // This is the URL to the version info and other metadata for this // box. string metadata_url = 6; + + // The box name. This is the logical name used when adding the box. + string name = 7; + + // Tracks the last automatic update for the box + google.protobuf.Timestamp last_update = 8; } message Target { diff --git a/lib/vagrant/protobufs/proto/vagrant_server/server_pb.rb b/lib/vagrant/protobufs/proto/vagrant_server/server_pb.rb index b3e044a18..28efa77bd 100644 --- a/lib/vagrant/protobufs/proto/vagrant_server/server_pb.rb +++ b/lib/vagrant/protobufs/proto/vagrant_server/server_pb.rb @@ -45,12 +45,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do optional :data_source, :message, 101, "hashicorp.vagrant.Job.DataSource" end add_message "hashicorp.vagrant.Box" do - optional :name, :string, 1 + optional :id, :string, 1 optional :provider, :string, 2 optional :version, :string, 3 optional :directory, :string, 4 map :metadata, :string, :string, 5 optional :metadata_url, :string, 6 + optional :name, :string, 7 + optional :last_update, :message, 8, "google.protobuf.Timestamp" end add_message "hashicorp.vagrant.Target" do optional :resource_id, :string, 1