From 325fd62d567b2795329c031169bfcae21a1c31aa Mon Sep 17 00:00:00 2001 From: Gerrit Date: Wed, 25 Sep 2024 15:01:45 +0200 Subject: [PATCH 1/8] Extend API by machine reservations. --- .github/workflows/build.yml | 14 +- Makefile | 4 +- go.mod | 2 +- pkg/apis/v1/cluster_grpc.pb.go | 37 +- pkg/apis/v1/info_grpc.pb.go | 31 +- pkg/apis/v1/ip_grpc.pb.go | 37 +- pkg/apis/v1/machine_grpc.pb.go | 37 +- pkg/apis/v1/machine_reservation.pb.go | 786 ++++++++++++++++++ pkg/apis/v1/machine_reservation_grpc.pb.go | 233 ++++++ pkg/apis/v1/network_traffic_grpc.pb.go | 31 +- pkg/apis/v1/pod_grpc.pb.go | 37 +- pkg/apis/v1/postgres_grpc.pb.go | 37 +- pkg/apis/v1/product_option_grpc.pb.go | 31 +- pkg/apis/v1/s3_grpc.pb.go | 31 +- pkg/apis/v1/volume_grpc.pb.go | 37 +- proto/Makefile | 4 +- proto/buf.gen.yaml | 2 +- proto/buf.yaml | 6 +- .../api/v1/machine_reservation.proto | 66 ++ test/mocks/v1/ClusterServiceClient.go | 2 +- test/mocks/v1/ClusterServiceServer.go | 2 +- test/mocks/v1/IPServiceClient.go | 2 +- test/mocks/v1/IPServiceServer.go | 2 +- test/mocks/v1/InfoServiceClient.go | 2 +- test/mocks/v1/InfoServiceServer.go | 2 +- .../v1/MachineReservationServiceClient.go | 180 ++++ .../v1/MachineReservationServiceServer.go | 149 ++++ test/mocks/v1/MachineServiceClient.go | 2 +- test/mocks/v1/MachineServiceServer.go | 2 +- test/mocks/v1/NetworkTrafficServiceClient.go | 2 +- test/mocks/v1/NetworkTrafficServiceServer.go | 2 +- test/mocks/v1/PodServiceClient.go | 2 +- test/mocks/v1/PodServiceServer.go | 2 +- test/mocks/v1/PostgresServiceClient.go | 2 +- test/mocks/v1/PostgresServiceServer.go | 2 +- test/mocks/v1/ProductOptionServiceClient.go | 2 +- test/mocks/v1/ProductOptionServiceServer.go | 2 +- test/mocks/v1/S3ServiceClient.go | 2 +- test/mocks/v1/S3ServiceServer.go | 2 +- test/mocks/v1/UnsafeClusterServiceServer.go | 2 +- test/mocks/v1/UnsafeIPServiceServer.go | 2 +- test/mocks/v1/UnsafeInfoServiceServer.go | 2 +- .../UnsafeMachineReservationServiceServer.go | 29 + test/mocks/v1/UnsafeMachineServiceServer.go | 2 +- .../v1/UnsafeNetworkTrafficServiceServer.go | 2 +- test/mocks/v1/UnsafePodServiceServer.go | 2 +- test/mocks/v1/UnsafePostgresServiceServer.go | 2 +- .../v1/UnsafeProductOptionServiceServer.go | 2 +- test/mocks/v1/UnsafeS3ServiceServer.go | 2 +- test/mocks/v1/UnsafeVolumeServiceServer.go | 2 +- test/mocks/v1/VolumeServiceClient.go | 2 +- test/mocks/v1/VolumeServiceServer.go | 2 +- 52 files changed, 1734 insertions(+), 147 deletions(-) create mode 100644 pkg/apis/v1/machine_reservation.pb.go create mode 100644 pkg/apis/v1/machine_reservation_grpc.pb.go create mode 100644 proto/metalstack/io/accounting/api/v1/machine_reservation.proto create mode 100644 test/mocks/v1/MachineReservationServiceClient.go create mode 100644 test/mocks/v1/MachineReservationServiceServer.go create mode 100644 test/mocks/v1/UnsafeMachineReservationServiceServer.go diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f68e5af..3914508 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,15 +16,15 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - name: Set up Go 1.22 - uses: actions/setup-go@v5 - with: - go-version: "1.22" - id: go - - name: Check out code into the Go module directory uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + cache: false + - name: setup buf uses: bufbuild/buf-setup-action@v1 @@ -35,4 +35,4 @@ jobs: - uses: release-drafter/release-drafter@v6 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index 23db974..a5b2153 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ proto: .PHONY: mocks mocks: rm -rf test/mocks - docker run --rm --user $$(id -u):$$(id -g) -w /work -v ${PWD}:/work vektra/mockery:v2.43.2 --keeptree --all --dir pkg/apis --output test/mocks + docker run --rm --user $$(id -u):$$(id -g) -w /work -v ${PWD}:/work vektra/mockery:v2.46.0 --keeptree --all --dir pkg/apis --output test/mocks .PHONY: test test: @@ -17,4 +17,4 @@ test: .PHONY: check-diff check-diff: - git diff --exit-code \ No newline at end of file + git diff --exit-code diff --git a/go.mod b/go.mod index 91e793d..e16daad 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/fi-ts/accounting-go -go 1.22 +go 1.23 require ( github.com/stretchr/testify v1.9.0 diff --git a/pkg/apis/v1/cluster_grpc.pb.go b/pkg/apis/v1/cluster_grpc.pb.go index fd72ed2..61c03cc 100644 --- a/pkg/apis/v1/cluster_grpc.pb.go +++ b/pkg/apis/v1/cluster_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: metalstack/io/accounting/api/v1/cluster.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ClusterService_Added_FullMethodName = "/metalstack.io.accounting.api.v1.ClusterService/Added" @@ -44,8 +44,9 @@ func NewClusterServiceClient(cc grpc.ClientConnInterface) ClusterServiceClient { } func (c *clusterServiceClient) Added(ctx context.Context, in *ClusterReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, ClusterService_Added_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ClusterService_Added_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -53,8 +54,9 @@ func (c *clusterServiceClient) Added(ctx context.Context, in *ClusterReport, opt } func (c *clusterServiceClient) Modified(ctx context.Context, in *ClusterReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, ClusterService_Modified_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ClusterService_Modified_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -62,8 +64,9 @@ func (c *clusterServiceClient) Modified(ctx context.Context, in *ClusterReport, } func (c *clusterServiceClient) Deleted(ctx context.Context, in *ClusterReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, ClusterService_Deleted_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ClusterService_Deleted_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -71,8 +74,9 @@ func (c *clusterServiceClient) Deleted(ctx context.Context, in *ClusterReport, o } func (c *clusterServiceClient) Usage(ctx context.Context, in *ClusterUsageRequest, opts ...grpc.CallOption) (*ClusterUsageResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ClusterUsageResponse) - err := c.cc.Invoke(ctx, ClusterService_Usage_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ClusterService_Usage_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -81,7 +85,7 @@ func (c *clusterServiceClient) Usage(ctx context.Context, in *ClusterUsageReques // ClusterServiceServer is the server API for ClusterService service. // All implementations should embed UnimplementedClusterServiceServer -// for forward compatibility +// for forward compatibility. type ClusterServiceServer interface { Added(context.Context, *ClusterReport) (*Empty, error) Modified(context.Context, *ClusterReport) (*Empty, error) @@ -89,9 +93,12 @@ type ClusterServiceServer interface { Usage(context.Context, *ClusterUsageRequest) (*ClusterUsageResponse, error) } -// UnimplementedClusterServiceServer should be embedded to have forward compatible implementations. -type UnimplementedClusterServiceServer struct { -} +// UnimplementedClusterServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedClusterServiceServer struct{} func (UnimplementedClusterServiceServer) Added(context.Context, *ClusterReport) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Added not implemented") @@ -105,6 +112,7 @@ func (UnimplementedClusterServiceServer) Deleted(context.Context, *ClusterReport func (UnimplementedClusterServiceServer) Usage(context.Context, *ClusterUsageRequest) (*ClusterUsageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented") } +func (UnimplementedClusterServiceServer) testEmbeddedByValue() {} // UnsafeClusterServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ClusterServiceServer will @@ -114,6 +122,13 @@ type UnsafeClusterServiceServer interface { } func RegisterClusterServiceServer(s grpc.ServiceRegistrar, srv ClusterServiceServer) { + // If the following call pancis, it indicates UnimplementedClusterServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ClusterService_ServiceDesc, srv) } diff --git a/pkg/apis/v1/info_grpc.pb.go b/pkg/apis/v1/info_grpc.pb.go index ef68ede..592be25 100644 --- a/pkg/apis/v1/info_grpc.pb.go +++ b/pkg/apis/v1/info_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: metalstack/io/accounting/api/v1/info.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( InfoService_Projects_FullMethodName = "/metalstack.io.accounting.api.v1.InfoService/Projects" @@ -40,8 +40,9 @@ func NewInfoServiceClient(cc grpc.ClientConnInterface) InfoServiceClient { } func (c *infoServiceClient) Projects(ctx context.Context, in *ProjectInfoRequest, opts ...grpc.CallOption) (*ProjectInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ProjectInfoResponse) - err := c.cc.Invoke(ctx, InfoService_Projects_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, InfoService_Projects_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -49,8 +50,9 @@ func (c *infoServiceClient) Projects(ctx context.Context, in *ProjectInfoRequest } func (c *infoServiceClient) Tenants(ctx context.Context, in *TenantInfoRequest, opts ...grpc.CallOption) (*TenantInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TenantInfoResponse) - err := c.cc.Invoke(ctx, InfoService_Tenants_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, InfoService_Tenants_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -59,15 +61,18 @@ func (c *infoServiceClient) Tenants(ctx context.Context, in *TenantInfoRequest, // InfoServiceServer is the server API for InfoService service. // All implementations should embed UnimplementedInfoServiceServer -// for forward compatibility +// for forward compatibility. type InfoServiceServer interface { Projects(context.Context, *ProjectInfoRequest) (*ProjectInfoResponse, error) Tenants(context.Context, *TenantInfoRequest) (*TenantInfoResponse, error) } -// UnimplementedInfoServiceServer should be embedded to have forward compatible implementations. -type UnimplementedInfoServiceServer struct { -} +// UnimplementedInfoServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedInfoServiceServer struct{} func (UnimplementedInfoServiceServer) Projects(context.Context, *ProjectInfoRequest) (*ProjectInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Projects not implemented") @@ -75,6 +80,7 @@ func (UnimplementedInfoServiceServer) Projects(context.Context, *ProjectInfoRequ func (UnimplementedInfoServiceServer) Tenants(context.Context, *TenantInfoRequest) (*TenantInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Tenants not implemented") } +func (UnimplementedInfoServiceServer) testEmbeddedByValue() {} // UnsafeInfoServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to InfoServiceServer will @@ -84,6 +90,13 @@ type UnsafeInfoServiceServer interface { } func RegisterInfoServiceServer(s grpc.ServiceRegistrar, srv InfoServiceServer) { + // If the following call pancis, it indicates UnimplementedInfoServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&InfoService_ServiceDesc, srv) } diff --git a/pkg/apis/v1/ip_grpc.pb.go b/pkg/apis/v1/ip_grpc.pb.go index 3d73f9b..1cde987 100644 --- a/pkg/apis/v1/ip_grpc.pb.go +++ b/pkg/apis/v1/ip_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: metalstack/io/accounting/api/v1/ip.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( IPService_Added_FullMethodName = "/metalstack.io.accounting.api.v1.IPService/Added" @@ -44,8 +44,9 @@ func NewIPServiceClient(cc grpc.ClientConnInterface) IPServiceClient { } func (c *iPServiceClient) Added(ctx context.Context, in *IPReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, IPService_Added_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, IPService_Added_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -53,8 +54,9 @@ func (c *iPServiceClient) Added(ctx context.Context, in *IPReport, opts ...grpc. } func (c *iPServiceClient) Modified(ctx context.Context, in *IPReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, IPService_Modified_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, IPService_Modified_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -62,8 +64,9 @@ func (c *iPServiceClient) Modified(ctx context.Context, in *IPReport, opts ...gr } func (c *iPServiceClient) Deleted(ctx context.Context, in *IPReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, IPService_Deleted_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, IPService_Deleted_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -71,8 +74,9 @@ func (c *iPServiceClient) Deleted(ctx context.Context, in *IPReport, opts ...grp } func (c *iPServiceClient) Usage(ctx context.Context, in *IPUsageRequest, opts ...grpc.CallOption) (*IPUsageResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(IPUsageResponse) - err := c.cc.Invoke(ctx, IPService_Usage_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, IPService_Usage_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -81,7 +85,7 @@ func (c *iPServiceClient) Usage(ctx context.Context, in *IPUsageRequest, opts .. // IPServiceServer is the server API for IPService service. // All implementations should embed UnimplementedIPServiceServer -// for forward compatibility +// for forward compatibility. type IPServiceServer interface { Added(context.Context, *IPReport) (*Empty, error) Modified(context.Context, *IPReport) (*Empty, error) @@ -89,9 +93,12 @@ type IPServiceServer interface { Usage(context.Context, *IPUsageRequest) (*IPUsageResponse, error) } -// UnimplementedIPServiceServer should be embedded to have forward compatible implementations. -type UnimplementedIPServiceServer struct { -} +// UnimplementedIPServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedIPServiceServer struct{} func (UnimplementedIPServiceServer) Added(context.Context, *IPReport) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Added not implemented") @@ -105,6 +112,7 @@ func (UnimplementedIPServiceServer) Deleted(context.Context, *IPReport) (*Empty, func (UnimplementedIPServiceServer) Usage(context.Context, *IPUsageRequest) (*IPUsageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented") } +func (UnimplementedIPServiceServer) testEmbeddedByValue() {} // UnsafeIPServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to IPServiceServer will @@ -114,6 +122,13 @@ type UnsafeIPServiceServer interface { } func RegisterIPServiceServer(s grpc.ServiceRegistrar, srv IPServiceServer) { + // If the following call pancis, it indicates UnimplementedIPServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&IPService_ServiceDesc, srv) } diff --git a/pkg/apis/v1/machine_grpc.pb.go b/pkg/apis/v1/machine_grpc.pb.go index 41dc022..c7b9b79 100644 --- a/pkg/apis/v1/machine_grpc.pb.go +++ b/pkg/apis/v1/machine_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: metalstack/io/accounting/api/v1/machine.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( MachineService_Added_FullMethodName = "/metalstack.io.accounting.api.v1.MachineService/Added" @@ -44,8 +44,9 @@ func NewMachineServiceClient(cc grpc.ClientConnInterface) MachineServiceClient { } func (c *machineServiceClient) Added(ctx context.Context, in *MachineReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, MachineService_Added_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, MachineService_Added_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -53,8 +54,9 @@ func (c *machineServiceClient) Added(ctx context.Context, in *MachineReport, opt } func (c *machineServiceClient) Modified(ctx context.Context, in *MachineReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, MachineService_Modified_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, MachineService_Modified_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -62,8 +64,9 @@ func (c *machineServiceClient) Modified(ctx context.Context, in *MachineReport, } func (c *machineServiceClient) Deleted(ctx context.Context, in *MachineReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, MachineService_Deleted_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, MachineService_Deleted_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -71,8 +74,9 @@ func (c *machineServiceClient) Deleted(ctx context.Context, in *MachineReport, o } func (c *machineServiceClient) Usage(ctx context.Context, in *MachineUsageRequest, opts ...grpc.CallOption) (*MachineUsageResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MachineUsageResponse) - err := c.cc.Invoke(ctx, MachineService_Usage_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, MachineService_Usage_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -81,7 +85,7 @@ func (c *machineServiceClient) Usage(ctx context.Context, in *MachineUsageReques // MachineServiceServer is the server API for MachineService service. // All implementations should embed UnimplementedMachineServiceServer -// for forward compatibility +// for forward compatibility. type MachineServiceServer interface { Added(context.Context, *MachineReport) (*Empty, error) Modified(context.Context, *MachineReport) (*Empty, error) @@ -89,9 +93,12 @@ type MachineServiceServer interface { Usage(context.Context, *MachineUsageRequest) (*MachineUsageResponse, error) } -// UnimplementedMachineServiceServer should be embedded to have forward compatible implementations. -type UnimplementedMachineServiceServer struct { -} +// UnimplementedMachineServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMachineServiceServer struct{} func (UnimplementedMachineServiceServer) Added(context.Context, *MachineReport) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Added not implemented") @@ -105,6 +112,7 @@ func (UnimplementedMachineServiceServer) Deleted(context.Context, *MachineReport func (UnimplementedMachineServiceServer) Usage(context.Context, *MachineUsageRequest) (*MachineUsageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented") } +func (UnimplementedMachineServiceServer) testEmbeddedByValue() {} // UnsafeMachineServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MachineServiceServer will @@ -114,6 +122,13 @@ type UnsafeMachineServiceServer interface { } func RegisterMachineServiceServer(s grpc.ServiceRegistrar, srv MachineServiceServer) { + // If the following call pancis, it indicates UnimplementedMachineServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&MachineService_ServiceDesc, srv) } diff --git a/pkg/apis/v1/machine_reservation.pb.go b/pkg/apis/v1/machine_reservation.pb.go new file mode 100644 index 0000000..6ccf948 --- /dev/null +++ b/pkg/apis/v1/machine_reservation.pb.go @@ -0,0 +1,786 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc (unknown) +// source: metalstack/io/accounting/api/v1/machine_reservation.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MachineReservationReport struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Partition string `protobuf:"bytes,1,opt,name=partition,proto3" json:"partition,omitempty"` + Tenant string `protobuf:"bytes,2,opt,name=tenant,proto3" json:"tenant,omitempty"` + Projectid string `protobuf:"bytes,3,opt,name=projectid,proto3" json:"projectid,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Projectname string `protobuf:"bytes,6,opt,name=projectname,proto3" json:"projectname,omitempty"` + Start *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=start,proto3" json:"start,omitempty"` + End *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=end,proto3" json:"end,omitempty"` + Id string `protobuf:"bytes,9,opt,name=id,proto3" json:"id,omitempty"` + Sizeid string `protobuf:"bytes,10,opt,name=sizeid,proto3" json:"sizeid,omitempty"` + Amount int32 `protobuf:"varint,11,opt,name=amount,proto3" json:"amount,omitempty"` + UsedAmount int32 `protobuf:"varint,12,opt,name=used_amount,json=usedAmount,proto3" json:"used_amount,omitempty"` + UnusedAmount int32 `protobuf:"varint,13,opt,name=unused_amount,json=unusedAmount,proto3" json:"unused_amount,omitempty"` + Labels map[string]string `protobuf:"bytes,14,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *MachineReservationReport) Reset() { + *x = MachineReservationReport{} + if protoimpl.UnsafeEnabled { + mi := &file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MachineReservationReport) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineReservationReport) ProtoMessage() {} + +func (x *MachineReservationReport) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[0] + 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 MachineReservationReport.ProtoReflect.Descriptor instead. +func (*MachineReservationReport) Descriptor() ([]byte, []int) { + return file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescGZIP(), []int{0} +} + +func (x *MachineReservationReport) GetPartition() string { + if x != nil { + return x.Partition + } + return "" +} + +func (x *MachineReservationReport) GetTenant() string { + if x != nil { + return x.Tenant + } + return "" +} + +func (x *MachineReservationReport) GetProjectid() string { + if x != nil { + return x.Projectid + } + return "" +} + +func (x *MachineReservationReport) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *MachineReservationReport) GetProjectname() string { + if x != nil { + return x.Projectname + } + return "" +} + +func (x *MachineReservationReport) GetStart() *timestamppb.Timestamp { + if x != nil { + return x.Start + } + return nil +} + +func (x *MachineReservationReport) GetEnd() *timestamppb.Timestamp { + if x != nil { + return x.End + } + return nil +} + +func (x *MachineReservationReport) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *MachineReservationReport) GetSizeid() string { + if x != nil { + return x.Sizeid + } + return "" +} + +func (x *MachineReservationReport) GetAmount() int32 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *MachineReservationReport) GetUsedAmount() int32 { + if x != nil { + return x.UsedAmount + } + return 0 +} + +func (x *MachineReservationReport) GetUnusedAmount() int32 { + if x != nil { + return x.UnusedAmount + } + return 0 +} + +func (x *MachineReservationReport) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +type MachineReservationUsageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Query *UsageQuery `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + Sizeid *string `protobuf:"bytes,2,opt,name=sizeid,proto3,oneof" json:"sizeid,omitempty"` + Partition *string `protobuf:"bytes,3,opt,name=partition,proto3,oneof" json:"partition,omitempty"` +} + +func (x *MachineReservationUsageRequest) Reset() { + *x = MachineReservationUsageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MachineReservationUsageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineReservationUsageRequest) ProtoMessage() {} + +func (x *MachineReservationUsageRequest) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_io_accounting_api_v1_machine_reservation_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 MachineReservationUsageRequest.ProtoReflect.Descriptor instead. +func (*MachineReservationUsageRequest) Descriptor() ([]byte, []int) { + return file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescGZIP(), []int{1} +} + +func (x *MachineReservationUsageRequest) GetQuery() *UsageQuery { + if x != nil { + return x.Query + } + return nil +} + +func (x *MachineReservationUsageRequest) GetSizeid() string { + if x != nil && x.Sizeid != nil { + return *x.Sizeid + } + return "" +} + +func (x *MachineReservationUsageRequest) GetPartition() string { + if x != nil && x.Partition != nil { + return *x.Partition + } + return "" +} + +type MachineReservationUsageResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + From *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + To *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` + Usage []*MachineReservationUsage `protobuf:"bytes,3,rep,name=usage,proto3" json:"usage,omitempty"` + AccumulatedUsage *MachineReservationUsageAccumuluated `protobuf:"bytes,4,opt,name=accumulated_usage,json=accumulatedUsage,proto3" json:"accumulated_usage,omitempty"` +} + +func (x *MachineReservationUsageResponse) Reset() { + *x = MachineReservationUsageResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MachineReservationUsageResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineReservationUsageResponse) ProtoMessage() {} + +func (x *MachineReservationUsageResponse) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[2] + 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 MachineReservationUsageResponse.ProtoReflect.Descriptor instead. +func (*MachineReservationUsageResponse) Descriptor() ([]byte, []int) { + return file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescGZIP(), []int{2} +} + +func (x *MachineReservationUsageResponse) GetFrom() *timestamppb.Timestamp { + if x != nil { + return x.From + } + return nil +} + +func (x *MachineReservationUsageResponse) GetTo() *timestamppb.Timestamp { + if x != nil { + return x.To + } + return nil +} + +func (x *MachineReservationUsageResponse) GetUsage() []*MachineReservationUsage { + if x != nil { + return x.Usage + } + return nil +} + +func (x *MachineReservationUsageResponse) GetAccumulatedUsage() *MachineReservationUsageAccumuluated { + if x != nil { + return x.AccumulatedUsage + } + return nil +} + +type MachineReservationUsage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Partition string `protobuf:"bytes,1,opt,name=partition,proto3" json:"partition,omitempty"` + Tenant string `protobuf:"bytes,2,opt,name=tenant,proto3" json:"tenant,omitempty"` + Projectid string `protobuf:"bytes,3,opt,name=projectid,proto3" json:"projectid,omitempty"` + Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` + Sizeid string `protobuf:"bytes,5,opt,name=sizeid,proto3" json:"sizeid,omitempty"` + Start *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=start,proto3" json:"start,omitempty"` + End *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=end,proto3" json:"end,omitempty"` + ReservationSeconds string `protobuf:"bytes,8,opt,name=reservation_seconds,json=reservationSeconds,proto3" json:"reservation_seconds,omitempty"` + Average string `protobuf:"bytes,9,opt,name=average,proto3" json:"average,omitempty"` + Projectname string `protobuf:"bytes,10,opt,name=projectname,proto3" json:"projectname,omitempty"` + Tenantname string `protobuf:"bytes,11,opt,name=tenantname,proto3" json:"tenantname,omitempty"` + Contractnumber string `protobuf:"bytes,12,opt,name=contractnumber,proto3" json:"contractnumber,omitempty"` + Debtorid string `protobuf:"bytes,13,opt,name=debtorid,proto3" json:"debtorid,omitempty"` +} + +func (x *MachineReservationUsage) Reset() { + *x = MachineReservationUsage{} + if protoimpl.UnsafeEnabled { + mi := &file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MachineReservationUsage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineReservationUsage) ProtoMessage() {} + +func (x *MachineReservationUsage) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[3] + 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 MachineReservationUsage.ProtoReflect.Descriptor instead. +func (*MachineReservationUsage) Descriptor() ([]byte, []int) { + return file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescGZIP(), []int{3} +} + +func (x *MachineReservationUsage) GetPartition() string { + if x != nil { + return x.Partition + } + return "" +} + +func (x *MachineReservationUsage) GetTenant() string { + if x != nil { + return x.Tenant + } + return "" +} + +func (x *MachineReservationUsage) GetProjectid() string { + if x != nil { + return x.Projectid + } + return "" +} + +func (x *MachineReservationUsage) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *MachineReservationUsage) GetSizeid() string { + if x != nil { + return x.Sizeid + } + return "" +} + +func (x *MachineReservationUsage) GetStart() *timestamppb.Timestamp { + if x != nil { + return x.Start + } + return nil +} + +func (x *MachineReservationUsage) GetEnd() *timestamppb.Timestamp { + if x != nil { + return x.End + } + return nil +} + +func (x *MachineReservationUsage) GetReservationSeconds() string { + if x != nil { + return x.ReservationSeconds + } + return "" +} + +func (x *MachineReservationUsage) GetAverage() string { + if x != nil { + return x.Average + } + return "" +} + +func (x *MachineReservationUsage) GetProjectname() string { + if x != nil { + return x.Projectname + } + return "" +} + +func (x *MachineReservationUsage) GetTenantname() string { + if x != nil { + return x.Tenantname + } + return "" +} + +func (x *MachineReservationUsage) GetContractnumber() string { + if x != nil { + return x.Contractnumber + } + return "" +} + +func (x *MachineReservationUsage) GetDebtorid() string { + if x != nil { + return x.Debtorid + } + return "" +} + +type MachineReservationUsageAccumuluated struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Lifetime *durationpb.Duration `protobuf:"bytes,1,opt,name=lifetime,proto3" json:"lifetime,omitempty"` +} + +func (x *MachineReservationUsageAccumuluated) Reset() { + *x = MachineReservationUsageAccumuluated{} + if protoimpl.UnsafeEnabled { + mi := &file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MachineReservationUsageAccumuluated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MachineReservationUsageAccumuluated) ProtoMessage() {} + +func (x *MachineReservationUsageAccumuluated) ProtoReflect() protoreflect.Message { + mi := &file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[4] + 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 MachineReservationUsageAccumuluated.ProtoReflect.Descriptor instead. +func (*MachineReservationUsageAccumuluated) Descriptor() ([]byte, []int) { + return file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescGZIP(), []int{4} +} + +func (x *MachineReservationUsageAccumuluated) GetLifetime() *durationpb.Duration { + if x != nil { + return x.Lifetime + } + return nil +} + +var File_metalstack_io_accounting_api_v1_machine_reservation_proto protoreflect.FileDescriptor + +var file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDesc = []byte{ + 0x0a, 0x39, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x69, 0x6f, 0x2f, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x6d, 0x65, 0x74, + 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x6d, + 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x69, 0x6f, 0x2f, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xca, 0x04, 0x0a, 0x18, + 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x72, + 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x1c, + 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 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, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x18, 0x07, 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, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x03, 0x65, 0x6e, + 0x64, 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, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x7a, 0x65, + 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, + 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x64, + 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x75, + 0x73, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x6e, 0x75, + 0x73, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x75, 0x6e, 0x75, 0x73, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x5d, + 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x45, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, + 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbc, 0x01, 0x0a, 0x1e, 0x4d, 0x61, 0x63, + 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6d, 0x65, 0x74, + 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, + 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1b, + 0x0a, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, + 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x09, + 0x0a, 0x07, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc0, 0x02, 0x0a, 0x1f, 0x4d, 0x61, 0x63, 0x68, + 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x66, + 0x72, 0x6f, 0x6d, 0x18, 0x01, 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, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x2a, 0x0a, 0x02, 0x74, + 0x6f, 0x18, 0x02, 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, 0x02, 0x74, 0x6f, 0x12, 0x4e, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, + 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, + 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, + 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x71, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x75, 0x6d, + 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, + 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, 0x63, 0x75, + 0x6d, 0x75, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x64, 0x52, 0x10, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, + 0x6c, 0x61, 0x74, 0x65, 0x64, 0x55, 0x73, 0x61, 0x67, 0x65, 0x22, 0xc6, 0x03, 0x0a, 0x17, 0x4d, + 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, + 0x7a, 0x65, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, + 0x69, 0x64, 0x12, 0x30, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x06, 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, 0x05, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x07, 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, 0x03, 0x65, + 0x6e, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x12, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1e, 0x0a, 0x0a, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x62, 0x74, 0x6f, + 0x72, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x62, 0x74, 0x6f, + 0x72, 0x69, 0x64, 0x22, 0x5c, 0x0a, 0x23, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, + 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, + 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x6c, 0x69, + 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, + 0x65, 0x32, 0xf1, 0x03, 0x0a, 0x19, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x6a, 0x0a, 0x05, 0x41, 0x64, 0x64, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, + 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, + 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, + 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6d, 0x0a, 0x08, 0x4d, + 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, + 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, + 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6c, 0x0a, 0x07, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, + 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x8a, 0x01, 0x0a, 0x05, 0x55, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x3f, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, + 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, + 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0d, 0x5a, 0x0b, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, + 0x73, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescOnce sync.Once + file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescData = file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDesc +) + +func file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescGZIP() []byte { + file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescOnce.Do(func() { + file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescData = protoimpl.X.CompressGZIP(file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescData) + }) + return file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescData +} + +var file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_metalstack_io_accounting_api_v1_machine_reservation_proto_goTypes = []any{ + (*MachineReservationReport)(nil), // 0: metalstack.io.accounting.api.v1.MachineReservationReport + (*MachineReservationUsageRequest)(nil), // 1: metalstack.io.accounting.api.v1.MachineReservationUsageRequest + (*MachineReservationUsageResponse)(nil), // 2: metalstack.io.accounting.api.v1.MachineReservationUsageResponse + (*MachineReservationUsage)(nil), // 3: metalstack.io.accounting.api.v1.MachineReservationUsage + (*MachineReservationUsageAccumuluated)(nil), // 4: metalstack.io.accounting.api.v1.MachineReservationUsageAccumuluated + nil, // 5: metalstack.io.accounting.api.v1.MachineReservationReport.LabelsEntry + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp + (*UsageQuery)(nil), // 7: metalstack.io.accounting.api.v1.UsageQuery + (*durationpb.Duration)(nil), // 8: google.protobuf.Duration + (*Empty)(nil), // 9: metalstack.io.accounting.api.v1.Empty +} +var file_metalstack_io_accounting_api_v1_machine_reservation_proto_depIdxs = []int32{ + 6, // 0: metalstack.io.accounting.api.v1.MachineReservationReport.timestamp:type_name -> google.protobuf.Timestamp + 6, // 1: metalstack.io.accounting.api.v1.MachineReservationReport.start:type_name -> google.protobuf.Timestamp + 6, // 2: metalstack.io.accounting.api.v1.MachineReservationReport.end:type_name -> google.protobuf.Timestamp + 5, // 3: metalstack.io.accounting.api.v1.MachineReservationReport.labels:type_name -> metalstack.io.accounting.api.v1.MachineReservationReport.LabelsEntry + 7, // 4: metalstack.io.accounting.api.v1.MachineReservationUsageRequest.query:type_name -> metalstack.io.accounting.api.v1.UsageQuery + 6, // 5: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.from:type_name -> google.protobuf.Timestamp + 6, // 6: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.to:type_name -> google.protobuf.Timestamp + 3, // 7: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.usage:type_name -> metalstack.io.accounting.api.v1.MachineReservationUsage + 4, // 8: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.accumulated_usage:type_name -> metalstack.io.accounting.api.v1.MachineReservationUsageAccumuluated + 6, // 9: metalstack.io.accounting.api.v1.MachineReservationUsage.start:type_name -> google.protobuf.Timestamp + 6, // 10: metalstack.io.accounting.api.v1.MachineReservationUsage.end:type_name -> google.protobuf.Timestamp + 8, // 11: metalstack.io.accounting.api.v1.MachineReservationUsageAccumuluated.lifetime:type_name -> google.protobuf.Duration + 0, // 12: metalstack.io.accounting.api.v1.MachineReservationService.Added:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport + 0, // 13: metalstack.io.accounting.api.v1.MachineReservationService.Modified:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport + 0, // 14: metalstack.io.accounting.api.v1.MachineReservationService.Deleted:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport + 1, // 15: metalstack.io.accounting.api.v1.MachineReservationService.Usage:input_type -> metalstack.io.accounting.api.v1.MachineReservationUsageRequest + 9, // 16: metalstack.io.accounting.api.v1.MachineReservationService.Added:output_type -> metalstack.io.accounting.api.v1.Empty + 9, // 17: metalstack.io.accounting.api.v1.MachineReservationService.Modified:output_type -> metalstack.io.accounting.api.v1.Empty + 9, // 18: metalstack.io.accounting.api.v1.MachineReservationService.Deleted:output_type -> metalstack.io.accounting.api.v1.Empty + 2, // 19: metalstack.io.accounting.api.v1.MachineReservationService.Usage:output_type -> metalstack.io.accounting.api.v1.MachineReservationUsageResponse + 16, // [16:20] is the sub-list for method output_type + 12, // [12:16] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_metalstack_io_accounting_api_v1_machine_reservation_proto_init() } +func file_metalstack_io_accounting_api_v1_machine_reservation_proto_init() { + if File_metalstack_io_accounting_api_v1_machine_reservation_proto != nil { + return + } + file_metalstack_io_accounting_api_v1_common_proto_init() + if !protoimpl.UnsafeEnabled { + file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*MachineReservationReport); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*MachineReservationUsageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*MachineReservationUsageResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*MachineReservationUsage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*MachineReservationUsageAccumuluated); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes[1].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_metalstack_io_accounting_api_v1_machine_reservation_proto_goTypes, + DependencyIndexes: file_metalstack_io_accounting_api_v1_machine_reservation_proto_depIdxs, + MessageInfos: file_metalstack_io_accounting_api_v1_machine_reservation_proto_msgTypes, + }.Build() + File_metalstack_io_accounting_api_v1_machine_reservation_proto = out.File + file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDesc = nil + file_metalstack_io_accounting_api_v1_machine_reservation_proto_goTypes = nil + file_metalstack_io_accounting_api_v1_machine_reservation_proto_depIdxs = nil +} diff --git a/pkg/apis/v1/machine_reservation_grpc.pb.go b/pkg/apis/v1/machine_reservation_grpc.pb.go new file mode 100644 index 0000000..3d27c3b --- /dev/null +++ b/pkg/apis/v1/machine_reservation_grpc.pb.go @@ -0,0 +1,233 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: metalstack/io/accounting/api/v1/machine_reservation.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + MachineReservationService_Added_FullMethodName = "/metalstack.io.accounting.api.v1.MachineReservationService/Added" + MachineReservationService_Modified_FullMethodName = "/metalstack.io.accounting.api.v1.MachineReservationService/Modified" + MachineReservationService_Deleted_FullMethodName = "/metalstack.io.accounting.api.v1.MachineReservationService/Deleted" + MachineReservationService_Usage_FullMethodName = "/metalstack.io.accounting.api.v1.MachineReservationService/Usage" +) + +// MachineReservationServiceClient is the client API for MachineReservationService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MachineReservationServiceClient interface { + Added(ctx context.Context, in *MachineReservationReport, opts ...grpc.CallOption) (*Empty, error) + Modified(ctx context.Context, in *MachineReservationReport, opts ...grpc.CallOption) (*Empty, error) + Deleted(ctx context.Context, in *MachineReservationReport, opts ...grpc.CallOption) (*Empty, error) + Usage(ctx context.Context, in *MachineReservationUsageRequest, opts ...grpc.CallOption) (*MachineReservationUsageResponse, error) +} + +type machineReservationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMachineReservationServiceClient(cc grpc.ClientConnInterface) MachineReservationServiceClient { + return &machineReservationServiceClient{cc} +} + +func (c *machineReservationServiceClient) Added(ctx context.Context, in *MachineReservationReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, MachineReservationService_Added_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *machineReservationServiceClient) Modified(ctx context.Context, in *MachineReservationReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, MachineReservationService_Modified_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *machineReservationServiceClient) Deleted(ctx context.Context, in *MachineReservationReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, MachineReservationService_Deleted_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *machineReservationServiceClient) Usage(ctx context.Context, in *MachineReservationUsageRequest, opts ...grpc.CallOption) (*MachineReservationUsageResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MachineReservationUsageResponse) + err := c.cc.Invoke(ctx, MachineReservationService_Usage_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MachineReservationServiceServer is the server API for MachineReservationService service. +// All implementations should embed UnimplementedMachineReservationServiceServer +// for forward compatibility. +type MachineReservationServiceServer interface { + Added(context.Context, *MachineReservationReport) (*Empty, error) + Modified(context.Context, *MachineReservationReport) (*Empty, error) + Deleted(context.Context, *MachineReservationReport) (*Empty, error) + Usage(context.Context, *MachineReservationUsageRequest) (*MachineReservationUsageResponse, error) +} + +// UnimplementedMachineReservationServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMachineReservationServiceServer struct{} + +func (UnimplementedMachineReservationServiceServer) Added(context.Context, *MachineReservationReport) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Added not implemented") +} +func (UnimplementedMachineReservationServiceServer) Modified(context.Context, *MachineReservationReport) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Modified not implemented") +} +func (UnimplementedMachineReservationServiceServer) Deleted(context.Context, *MachineReservationReport) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deleted not implemented") +} +func (UnimplementedMachineReservationServiceServer) Usage(context.Context, *MachineReservationUsageRequest) (*MachineReservationUsageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented") +} +func (UnimplementedMachineReservationServiceServer) testEmbeddedByValue() {} + +// UnsafeMachineReservationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MachineReservationServiceServer will +// result in compilation errors. +type UnsafeMachineReservationServiceServer interface { + mustEmbedUnimplementedMachineReservationServiceServer() +} + +func RegisterMachineReservationServiceServer(s grpc.ServiceRegistrar, srv MachineReservationServiceServer) { + // If the following call pancis, it indicates UnimplementedMachineReservationServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&MachineReservationService_ServiceDesc, srv) +} + +func _MachineReservationService_Added_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MachineReservationReport) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MachineReservationServiceServer).Added(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MachineReservationService_Added_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MachineReservationServiceServer).Added(ctx, req.(*MachineReservationReport)) + } + return interceptor(ctx, in, info, handler) +} + +func _MachineReservationService_Modified_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MachineReservationReport) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MachineReservationServiceServer).Modified(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MachineReservationService_Modified_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MachineReservationServiceServer).Modified(ctx, req.(*MachineReservationReport)) + } + return interceptor(ctx, in, info, handler) +} + +func _MachineReservationService_Deleted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MachineReservationReport) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MachineReservationServiceServer).Deleted(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MachineReservationService_Deleted_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MachineReservationServiceServer).Deleted(ctx, req.(*MachineReservationReport)) + } + return interceptor(ctx, in, info, handler) +} + +func _MachineReservationService_Usage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MachineReservationUsageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MachineReservationServiceServer).Usage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MachineReservationService_Usage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MachineReservationServiceServer).Usage(ctx, req.(*MachineReservationUsageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// MachineReservationService_ServiceDesc is the grpc.ServiceDesc for MachineReservationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MachineReservationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "metalstack.io.accounting.api.v1.MachineReservationService", + HandlerType: (*MachineReservationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Added", + Handler: _MachineReservationService_Added_Handler, + }, + { + MethodName: "Modified", + Handler: _MachineReservationService_Modified_Handler, + }, + { + MethodName: "Deleted", + Handler: _MachineReservationService_Deleted_Handler, + }, + { + MethodName: "Usage", + Handler: _MachineReservationService_Usage_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "metalstack/io/accounting/api/v1/machine_reservation.proto", +} diff --git a/pkg/apis/v1/network_traffic_grpc.pb.go b/pkg/apis/v1/network_traffic_grpc.pb.go index 16a9549..ceeefee 100644 --- a/pkg/apis/v1/network_traffic_grpc.pb.go +++ b/pkg/apis/v1/network_traffic_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: metalstack/io/accounting/api/v1/network_traffic.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( NetworkTrafficService_Modified_FullMethodName = "/metalstack.io.accounting.api.v1.NetworkTrafficService/Modified" @@ -40,8 +40,9 @@ func NewNetworkTrafficServiceClient(cc grpc.ClientConnInterface) NetworkTrafficS } func (c *networkTrafficServiceClient) Modified(ctx context.Context, in *NetworkTrafficReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, NetworkTrafficService_Modified_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, NetworkTrafficService_Modified_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -49,8 +50,9 @@ func (c *networkTrafficServiceClient) Modified(ctx context.Context, in *NetworkT } func (c *networkTrafficServiceClient) Usage(ctx context.Context, in *NetworkUsageRequest, opts ...grpc.CallOption) (*NetworkUsageResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(NetworkUsageResponse) - err := c.cc.Invoke(ctx, NetworkTrafficService_Usage_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, NetworkTrafficService_Usage_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -59,15 +61,18 @@ func (c *networkTrafficServiceClient) Usage(ctx context.Context, in *NetworkUsag // NetworkTrafficServiceServer is the server API for NetworkTrafficService service. // All implementations should embed UnimplementedNetworkTrafficServiceServer -// for forward compatibility +// for forward compatibility. type NetworkTrafficServiceServer interface { Modified(context.Context, *NetworkTrafficReport) (*Empty, error) Usage(context.Context, *NetworkUsageRequest) (*NetworkUsageResponse, error) } -// UnimplementedNetworkTrafficServiceServer should be embedded to have forward compatible implementations. -type UnimplementedNetworkTrafficServiceServer struct { -} +// UnimplementedNetworkTrafficServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedNetworkTrafficServiceServer struct{} func (UnimplementedNetworkTrafficServiceServer) Modified(context.Context, *NetworkTrafficReport) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Modified not implemented") @@ -75,6 +80,7 @@ func (UnimplementedNetworkTrafficServiceServer) Modified(context.Context, *Netwo func (UnimplementedNetworkTrafficServiceServer) Usage(context.Context, *NetworkUsageRequest) (*NetworkUsageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented") } +func (UnimplementedNetworkTrafficServiceServer) testEmbeddedByValue() {} // UnsafeNetworkTrafficServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to NetworkTrafficServiceServer will @@ -84,6 +90,13 @@ type UnsafeNetworkTrafficServiceServer interface { } func RegisterNetworkTrafficServiceServer(s grpc.ServiceRegistrar, srv NetworkTrafficServiceServer) { + // If the following call pancis, it indicates UnimplementedNetworkTrafficServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&NetworkTrafficService_ServiceDesc, srv) } diff --git a/pkg/apis/v1/pod_grpc.pb.go b/pkg/apis/v1/pod_grpc.pb.go index f0013e1..034b715 100644 --- a/pkg/apis/v1/pod_grpc.pb.go +++ b/pkg/apis/v1/pod_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: metalstack/io/accounting/api/v1/pod.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( PodService_Added_FullMethodName = "/metalstack.io.accounting.api.v1.PodService/Added" @@ -44,8 +44,9 @@ func NewPodServiceClient(cc grpc.ClientConnInterface) PodServiceClient { } func (c *podServiceClient) Added(ctx context.Context, in *PodReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, PodService_Added_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PodService_Added_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -53,8 +54,9 @@ func (c *podServiceClient) Added(ctx context.Context, in *PodReport, opts ...grp } func (c *podServiceClient) Modified(ctx context.Context, in *PodReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, PodService_Modified_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PodService_Modified_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -62,8 +64,9 @@ func (c *podServiceClient) Modified(ctx context.Context, in *PodReport, opts ... } func (c *podServiceClient) Deleted(ctx context.Context, in *PodReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, PodService_Deleted_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PodService_Deleted_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -71,8 +74,9 @@ func (c *podServiceClient) Deleted(ctx context.Context, in *PodReport, opts ...g } func (c *podServiceClient) Usage(ctx context.Context, in *ContainerUsageRequest, opts ...grpc.CallOption) (*ContainerUsageResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ContainerUsageResponse) - err := c.cc.Invoke(ctx, PodService_Usage_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PodService_Usage_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -81,7 +85,7 @@ func (c *podServiceClient) Usage(ctx context.Context, in *ContainerUsageRequest, // PodServiceServer is the server API for PodService service. // All implementations should embed UnimplementedPodServiceServer -// for forward compatibility +// for forward compatibility. type PodServiceServer interface { Added(context.Context, *PodReport) (*Empty, error) Modified(context.Context, *PodReport) (*Empty, error) @@ -89,9 +93,12 @@ type PodServiceServer interface { Usage(context.Context, *ContainerUsageRequest) (*ContainerUsageResponse, error) } -// UnimplementedPodServiceServer should be embedded to have forward compatible implementations. -type UnimplementedPodServiceServer struct { -} +// UnimplementedPodServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedPodServiceServer struct{} func (UnimplementedPodServiceServer) Added(context.Context, *PodReport) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Added not implemented") @@ -105,6 +112,7 @@ func (UnimplementedPodServiceServer) Deleted(context.Context, *PodReport) (*Empt func (UnimplementedPodServiceServer) Usage(context.Context, *ContainerUsageRequest) (*ContainerUsageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented") } +func (UnimplementedPodServiceServer) testEmbeddedByValue() {} // UnsafePodServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to PodServiceServer will @@ -114,6 +122,13 @@ type UnsafePodServiceServer interface { } func RegisterPodServiceServer(s grpc.ServiceRegistrar, srv PodServiceServer) { + // If the following call pancis, it indicates UnimplementedPodServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&PodService_ServiceDesc, srv) } diff --git a/pkg/apis/v1/postgres_grpc.pb.go b/pkg/apis/v1/postgres_grpc.pb.go index 5597429..f4a8a89 100644 --- a/pkg/apis/v1/postgres_grpc.pb.go +++ b/pkg/apis/v1/postgres_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: metalstack/io/accounting/api/v1/postgres.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( PostgresService_Added_FullMethodName = "/metalstack.io.accounting.api.v1.PostgresService/Added" @@ -44,8 +44,9 @@ func NewPostgresServiceClient(cc grpc.ClientConnInterface) PostgresServiceClient } func (c *postgresServiceClient) Added(ctx context.Context, in *PostgresReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, PostgresService_Added_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PostgresService_Added_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -53,8 +54,9 @@ func (c *postgresServiceClient) Added(ctx context.Context, in *PostgresReport, o } func (c *postgresServiceClient) Modified(ctx context.Context, in *PostgresReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, PostgresService_Modified_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PostgresService_Modified_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -62,8 +64,9 @@ func (c *postgresServiceClient) Modified(ctx context.Context, in *PostgresReport } func (c *postgresServiceClient) Deleted(ctx context.Context, in *PostgresReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, PostgresService_Deleted_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PostgresService_Deleted_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -71,8 +74,9 @@ func (c *postgresServiceClient) Deleted(ctx context.Context, in *PostgresReport, } func (c *postgresServiceClient) Usage(ctx context.Context, in *PostgresUsageRequest, opts ...grpc.CallOption) (*PostgresUsageResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PostgresUsageResponse) - err := c.cc.Invoke(ctx, PostgresService_Usage_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, PostgresService_Usage_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -81,7 +85,7 @@ func (c *postgresServiceClient) Usage(ctx context.Context, in *PostgresUsageRequ // PostgresServiceServer is the server API for PostgresService service. // All implementations should embed UnimplementedPostgresServiceServer -// for forward compatibility +// for forward compatibility. type PostgresServiceServer interface { Added(context.Context, *PostgresReport) (*Empty, error) Modified(context.Context, *PostgresReport) (*Empty, error) @@ -89,9 +93,12 @@ type PostgresServiceServer interface { Usage(context.Context, *PostgresUsageRequest) (*PostgresUsageResponse, error) } -// UnimplementedPostgresServiceServer should be embedded to have forward compatible implementations. -type UnimplementedPostgresServiceServer struct { -} +// UnimplementedPostgresServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedPostgresServiceServer struct{} func (UnimplementedPostgresServiceServer) Added(context.Context, *PostgresReport) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Added not implemented") @@ -105,6 +112,7 @@ func (UnimplementedPostgresServiceServer) Deleted(context.Context, *PostgresRepo func (UnimplementedPostgresServiceServer) Usage(context.Context, *PostgresUsageRequest) (*PostgresUsageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented") } +func (UnimplementedPostgresServiceServer) testEmbeddedByValue() {} // UnsafePostgresServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to PostgresServiceServer will @@ -114,6 +122,13 @@ type UnsafePostgresServiceServer interface { } func RegisterPostgresServiceServer(s grpc.ServiceRegistrar, srv PostgresServiceServer) { + // If the following call pancis, it indicates UnimplementedPostgresServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&PostgresService_ServiceDesc, srv) } diff --git a/pkg/apis/v1/product_option_grpc.pb.go b/pkg/apis/v1/product_option_grpc.pb.go index 6fc5b09..7dfeeee 100644 --- a/pkg/apis/v1/product_option_grpc.pb.go +++ b/pkg/apis/v1/product_option_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: metalstack/io/accounting/api/v1/product_option.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ProductOptionService_Modified_FullMethodName = "/metalstack.io.accounting.api.v1.ProductOptionService/Modified" @@ -40,8 +40,9 @@ func NewProductOptionServiceClient(cc grpc.ClientConnInterface) ProductOptionSer } func (c *productOptionServiceClient) Modified(ctx context.Context, in *ProductOptionReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, ProductOptionService_Modified_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ProductOptionService_Modified_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -49,8 +50,9 @@ func (c *productOptionServiceClient) Modified(ctx context.Context, in *ProductOp } func (c *productOptionServiceClient) Usage(ctx context.Context, in *ProductOptionUsageRequest, opts ...grpc.CallOption) (*ProductOptionUsageResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ProductOptionUsageResponse) - err := c.cc.Invoke(ctx, ProductOptionService_Usage_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, ProductOptionService_Usage_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -59,15 +61,18 @@ func (c *productOptionServiceClient) Usage(ctx context.Context, in *ProductOptio // ProductOptionServiceServer is the server API for ProductOptionService service. // All implementations should embed UnimplementedProductOptionServiceServer -// for forward compatibility +// for forward compatibility. type ProductOptionServiceServer interface { Modified(context.Context, *ProductOptionReport) (*Empty, error) Usage(context.Context, *ProductOptionUsageRequest) (*ProductOptionUsageResponse, error) } -// UnimplementedProductOptionServiceServer should be embedded to have forward compatible implementations. -type UnimplementedProductOptionServiceServer struct { -} +// UnimplementedProductOptionServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedProductOptionServiceServer struct{} func (UnimplementedProductOptionServiceServer) Modified(context.Context, *ProductOptionReport) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Modified not implemented") @@ -75,6 +80,7 @@ func (UnimplementedProductOptionServiceServer) Modified(context.Context, *Produc func (UnimplementedProductOptionServiceServer) Usage(context.Context, *ProductOptionUsageRequest) (*ProductOptionUsageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented") } +func (UnimplementedProductOptionServiceServer) testEmbeddedByValue() {} // UnsafeProductOptionServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ProductOptionServiceServer will @@ -84,6 +90,13 @@ type UnsafeProductOptionServiceServer interface { } func RegisterProductOptionServiceServer(s grpc.ServiceRegistrar, srv ProductOptionServiceServer) { + // If the following call pancis, it indicates UnimplementedProductOptionServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ProductOptionService_ServiceDesc, srv) } diff --git a/pkg/apis/v1/s3_grpc.pb.go b/pkg/apis/v1/s3_grpc.pb.go index ad1635a..5ac3205 100644 --- a/pkg/apis/v1/s3_grpc.pb.go +++ b/pkg/apis/v1/s3_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: metalstack/io/accounting/api/v1/s3.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( S3Service_BucketStats_FullMethodName = "/metalstack.io.accounting.api.v1.S3Service/BucketStats" @@ -40,8 +40,9 @@ func NewS3ServiceClient(cc grpc.ClientConnInterface) S3ServiceClient { } func (c *s3ServiceClient) BucketStats(ctx context.Context, in *S3BucketReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, S3Service_BucketStats_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, S3Service_BucketStats_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -49,8 +50,9 @@ func (c *s3ServiceClient) BucketStats(ctx context.Context, in *S3BucketReport, o } func (c *s3ServiceClient) Usage(ctx context.Context, in *S3UsageRequest, opts ...grpc.CallOption) (*S3UsageResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(S3UsageResponse) - err := c.cc.Invoke(ctx, S3Service_Usage_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, S3Service_Usage_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -59,15 +61,18 @@ func (c *s3ServiceClient) Usage(ctx context.Context, in *S3UsageRequest, opts .. // S3ServiceServer is the server API for S3Service service. // All implementations should embed UnimplementedS3ServiceServer -// for forward compatibility +// for forward compatibility. type S3ServiceServer interface { BucketStats(context.Context, *S3BucketReport) (*Empty, error) Usage(context.Context, *S3UsageRequest) (*S3UsageResponse, error) } -// UnimplementedS3ServiceServer should be embedded to have forward compatible implementations. -type UnimplementedS3ServiceServer struct { -} +// UnimplementedS3ServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedS3ServiceServer struct{} func (UnimplementedS3ServiceServer) BucketStats(context.Context, *S3BucketReport) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method BucketStats not implemented") @@ -75,6 +80,7 @@ func (UnimplementedS3ServiceServer) BucketStats(context.Context, *S3BucketReport func (UnimplementedS3ServiceServer) Usage(context.Context, *S3UsageRequest) (*S3UsageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented") } +func (UnimplementedS3ServiceServer) testEmbeddedByValue() {} // UnsafeS3ServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to S3ServiceServer will @@ -84,6 +90,13 @@ type UnsafeS3ServiceServer interface { } func RegisterS3ServiceServer(s grpc.ServiceRegistrar, srv S3ServiceServer) { + // If the following call pancis, it indicates UnimplementedS3ServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&S3Service_ServiceDesc, srv) } diff --git a/pkg/apis/v1/volume_grpc.pb.go b/pkg/apis/v1/volume_grpc.pb.go index c8d4723..9aa6350 100644 --- a/pkg/apis/v1/volume_grpc.pb.go +++ b/pkg/apis/v1/volume_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: metalstack/io/accounting/api/v1/volume.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( VolumeService_Added_FullMethodName = "/metalstack.io.accounting.api.v1.VolumeService/Added" @@ -44,8 +44,9 @@ func NewVolumeServiceClient(cc grpc.ClientConnInterface) VolumeServiceClient { } func (c *volumeServiceClient) Added(ctx context.Context, in *VolumeReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, VolumeService_Added_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, VolumeService_Added_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -53,8 +54,9 @@ func (c *volumeServiceClient) Added(ctx context.Context, in *VolumeReport, opts } func (c *volumeServiceClient) Modified(ctx context.Context, in *VolumeReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, VolumeService_Modified_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, VolumeService_Modified_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -62,8 +64,9 @@ func (c *volumeServiceClient) Modified(ctx context.Context, in *VolumeReport, op } func (c *volumeServiceClient) Deleted(ctx context.Context, in *VolumeReport, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Empty) - err := c.cc.Invoke(ctx, VolumeService_Deleted_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, VolumeService_Deleted_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -71,8 +74,9 @@ func (c *volumeServiceClient) Deleted(ctx context.Context, in *VolumeReport, opt } func (c *volumeServiceClient) Usage(ctx context.Context, in *VolumeUsageRequest, opts ...grpc.CallOption) (*VolumeUsageResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(VolumeUsageResponse) - err := c.cc.Invoke(ctx, VolumeService_Usage_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, VolumeService_Usage_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -81,7 +85,7 @@ func (c *volumeServiceClient) Usage(ctx context.Context, in *VolumeUsageRequest, // VolumeServiceServer is the server API for VolumeService service. // All implementations should embed UnimplementedVolumeServiceServer -// for forward compatibility +// for forward compatibility. type VolumeServiceServer interface { Added(context.Context, *VolumeReport) (*Empty, error) Modified(context.Context, *VolumeReport) (*Empty, error) @@ -89,9 +93,12 @@ type VolumeServiceServer interface { Usage(context.Context, *VolumeUsageRequest) (*VolumeUsageResponse, error) } -// UnimplementedVolumeServiceServer should be embedded to have forward compatible implementations. -type UnimplementedVolumeServiceServer struct { -} +// UnimplementedVolumeServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedVolumeServiceServer struct{} func (UnimplementedVolumeServiceServer) Added(context.Context, *VolumeReport) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Added not implemented") @@ -105,6 +112,7 @@ func (UnimplementedVolumeServiceServer) Deleted(context.Context, *VolumeReport) func (UnimplementedVolumeServiceServer) Usage(context.Context, *VolumeUsageRequest) (*VolumeUsageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented") } +func (UnimplementedVolumeServiceServer) testEmbeddedByValue() {} // UnsafeVolumeServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to VolumeServiceServer will @@ -114,6 +122,13 @@ type UnsafeVolumeServiceServer interface { } func RegisterVolumeServiceServer(s grpc.ServiceRegistrar, srv VolumeServiceServer) { + // If the following call pancis, it indicates UnimplementedVolumeServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&VolumeService_ServiceDesc, srv) } diff --git a/proto/Makefile b/proto/Makefile index afd9993..4e471da 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -1,5 +1,5 @@ MAKEFLAGS += --no-print-directory -BUF_VERSION := 1.32.2 +BUF_VERSION := 1.42.0 _buf: docker run --rm \ @@ -16,4 +16,4 @@ protolint: .PHONY: protoc protoc: protolint - @$(MAKE) _buf CMD="generate -v" \ No newline at end of file + @$(MAKE) _buf CMD="generate -v" diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index 2edda28..b8acedc 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -2,6 +2,6 @@ version: v2 plugins: - remote: buf.build/protocolbuffers/go:v1.34.2 out: ../ - - remote: buf.build/grpc/go:v1.3.0 + - remote: buf.build/grpc/go:v1.5.1 out: ../ opt: require_unimplemented_servers=false diff --git a/proto/buf.yaml b/proto/buf.yaml index ed6eea6..5794dd5 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -1,10 +1,12 @@ version: v2 lint: use: - - DEFAULT + - STANDARD + - PACKAGE_NO_IMPORT_CYCLE + - RPC_NO_CLIENT_STREAMING except: - FIELD_NOT_REQUIRED - - PACKAGE_NO_IMPORT_CYCLE + - COMMENTS - RPC_REQUEST_RESPONSE_UNIQUE - RPC_REQUEST_STANDARD_NAME - RPC_RESPONSE_STANDARD_NAME diff --git a/proto/metalstack/io/accounting/api/v1/machine_reservation.proto b/proto/metalstack/io/accounting/api/v1/machine_reservation.proto new file mode 100644 index 0000000..5829eea --- /dev/null +++ b/proto/metalstack/io/accounting/api/v1/machine_reservation.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; + +package metalstack.io.accounting.api.v1; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "metalstack/io/accounting/api/v1/common.proto"; + +option go_package = "pkg/apis/v1"; + +service MachineReservationService { + rpc Added(MachineReservationReport) returns (Empty); + rpc Modified(MachineReservationReport) returns (Empty); + rpc Deleted(MachineReservationReport) returns (Empty); + + rpc Usage(MachineReservationUsageRequest) returns (MachineReservationUsageResponse); +} + +message MachineReservationReport { + string partition = 1; + string tenant = 2; + string projectid = 3; + google.protobuf.Timestamp timestamp = 5; + string projectname = 6; + google.protobuf.Timestamp start = 7; + google.protobuf.Timestamp end = 8; + string id = 9; + string sizeid = 10; + int32 amount = 11; + int32 used_amount = 12; + int32 unused_amount = 13; + map labels = 14; +} + +message MachineReservationUsageRequest { + UsageQuery query = 1; + optional string sizeid = 2; + optional string partition = 3; +} + +message MachineReservationUsageResponse { + google.protobuf.Timestamp from = 1; + google.protobuf.Timestamp to = 2; + repeated MachineReservationUsage usage = 3; + MachineReservationUsageAccumuluated accumulated_usage = 4; +} + +message MachineReservationUsage { + string partition = 1; + string tenant = 2; + string projectid = 3; + string id = 4; + string sizeid = 5; + google.protobuf.Timestamp start = 6; + google.protobuf.Timestamp end = 7; + string reservation_seconds = 8; + string average = 9; + string projectname = 10; + string tenantname = 11; + string contractnumber = 12; + string debtorid = 13; +} + +message MachineReservationUsageAccumuluated { + google.protobuf.Duration lifetime = 1; +} diff --git a/test/mocks/v1/ClusterServiceClient.go b/test/mocks/v1/ClusterServiceClient.go index 688ea7c..2feb35f 100644 --- a/test/mocks/v1/ClusterServiceClient.go +++ b/test/mocks/v1/ClusterServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/ClusterServiceServer.go b/test/mocks/v1/ClusterServiceServer.go index b615440..afc40da 100644 --- a/test/mocks/v1/ClusterServiceServer.go +++ b/test/mocks/v1/ClusterServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/IPServiceClient.go b/test/mocks/v1/IPServiceClient.go index cad19e8..8b320b8 100644 --- a/test/mocks/v1/IPServiceClient.go +++ b/test/mocks/v1/IPServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/IPServiceServer.go b/test/mocks/v1/IPServiceServer.go index a8415e7..596e958 100644 --- a/test/mocks/v1/IPServiceServer.go +++ b/test/mocks/v1/IPServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/InfoServiceClient.go b/test/mocks/v1/InfoServiceClient.go index ce10e9c..f0f36ca 100644 --- a/test/mocks/v1/InfoServiceClient.go +++ b/test/mocks/v1/InfoServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/InfoServiceServer.go b/test/mocks/v1/InfoServiceServer.go index 82060cd..d8a6df9 100644 --- a/test/mocks/v1/InfoServiceServer.go +++ b/test/mocks/v1/InfoServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/MachineReservationServiceClient.go b/test/mocks/v1/MachineReservationServiceClient.go new file mode 100644 index 0000000..5bc7b23 --- /dev/null +++ b/test/mocks/v1/MachineReservationServiceClient.go @@ -0,0 +1,180 @@ +// Code generated by mockery v2.46.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + grpc "google.golang.org/grpc" + + mock "github.com/stretchr/testify/mock" + + v1 "github.com/fi-ts/accounting-go/pkg/apis/v1" +) + +// MachineReservationServiceClient is an autogenerated mock type for the MachineReservationServiceClient type +type MachineReservationServiceClient struct { + mock.Mock +} + +// Added provides a mock function with given fields: ctx, in, opts +func (_m *MachineReservationServiceClient) Added(ctx context.Context, in *v1.MachineReservationReport, opts ...grpc.CallOption) (*v1.Empty, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Added") + } + + var r0 *v1.Empty + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationReport, ...grpc.CallOption) (*v1.Empty, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationReport, ...grpc.CallOption) *v1.Empty); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.Empty) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.MachineReservationReport, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Deleted provides a mock function with given fields: ctx, in, opts +func (_m *MachineReservationServiceClient) Deleted(ctx context.Context, in *v1.MachineReservationReport, opts ...grpc.CallOption) (*v1.Empty, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Deleted") + } + + var r0 *v1.Empty + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationReport, ...grpc.CallOption) (*v1.Empty, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationReport, ...grpc.CallOption) *v1.Empty); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.Empty) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.MachineReservationReport, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Modified provides a mock function with given fields: ctx, in, opts +func (_m *MachineReservationServiceClient) Modified(ctx context.Context, in *v1.MachineReservationReport, opts ...grpc.CallOption) (*v1.Empty, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Modified") + } + + var r0 *v1.Empty + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationReport, ...grpc.CallOption) (*v1.Empty, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationReport, ...grpc.CallOption) *v1.Empty); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.Empty) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.MachineReservationReport, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Usage provides a mock function with given fields: ctx, in, opts +func (_m *MachineReservationServiceClient) Usage(ctx context.Context, in *v1.MachineReservationUsageRequest, opts ...grpc.CallOption) (*v1.MachineReservationUsageResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Usage") + } + + var r0 *v1.MachineReservationUsageResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationUsageRequest, ...grpc.CallOption) (*v1.MachineReservationUsageResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationUsageRequest, ...grpc.CallOption) *v1.MachineReservationUsageResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.MachineReservationUsageResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.MachineReservationUsageRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewMachineReservationServiceClient creates a new instance of MachineReservationServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMachineReservationServiceClient(t interface { + mock.TestingT + Cleanup(func()) +}) *MachineReservationServiceClient { + mock := &MachineReservationServiceClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/test/mocks/v1/MachineReservationServiceServer.go b/test/mocks/v1/MachineReservationServiceServer.go new file mode 100644 index 0000000..3fd8c78 --- /dev/null +++ b/test/mocks/v1/MachineReservationServiceServer.go @@ -0,0 +1,149 @@ +// Code generated by mockery v2.46.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + v1 "github.com/fi-ts/accounting-go/pkg/apis/v1" + mock "github.com/stretchr/testify/mock" +) + +// MachineReservationServiceServer is an autogenerated mock type for the MachineReservationServiceServer type +type MachineReservationServiceServer struct { + mock.Mock +} + +// Added provides a mock function with given fields: _a0, _a1 +func (_m *MachineReservationServiceServer) Added(_a0 context.Context, _a1 *v1.MachineReservationReport) (*v1.Empty, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Added") + } + + var r0 *v1.Empty + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationReport) (*v1.Empty, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationReport) *v1.Empty); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.Empty) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.MachineReservationReport) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Deleted provides a mock function with given fields: _a0, _a1 +func (_m *MachineReservationServiceServer) Deleted(_a0 context.Context, _a1 *v1.MachineReservationReport) (*v1.Empty, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Deleted") + } + + var r0 *v1.Empty + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationReport) (*v1.Empty, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationReport) *v1.Empty); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.Empty) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.MachineReservationReport) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Modified provides a mock function with given fields: _a0, _a1 +func (_m *MachineReservationServiceServer) Modified(_a0 context.Context, _a1 *v1.MachineReservationReport) (*v1.Empty, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Modified") + } + + var r0 *v1.Empty + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationReport) (*v1.Empty, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationReport) *v1.Empty); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.Empty) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.MachineReservationReport) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Usage provides a mock function with given fields: _a0, _a1 +func (_m *MachineReservationServiceServer) Usage(_a0 context.Context, _a1 *v1.MachineReservationUsageRequest) (*v1.MachineReservationUsageResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Usage") + } + + var r0 *v1.MachineReservationUsageResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationUsageRequest) (*v1.MachineReservationUsageResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.MachineReservationUsageRequest) *v1.MachineReservationUsageResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.MachineReservationUsageResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.MachineReservationUsageRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewMachineReservationServiceServer creates a new instance of MachineReservationServiceServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMachineReservationServiceServer(t interface { + mock.TestingT + Cleanup(func()) +}) *MachineReservationServiceServer { + mock := &MachineReservationServiceServer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/test/mocks/v1/MachineServiceClient.go b/test/mocks/v1/MachineServiceClient.go index e75bbb4..b1825fa 100644 --- a/test/mocks/v1/MachineServiceClient.go +++ b/test/mocks/v1/MachineServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/MachineServiceServer.go b/test/mocks/v1/MachineServiceServer.go index 049b681..e90e056 100644 --- a/test/mocks/v1/MachineServiceServer.go +++ b/test/mocks/v1/MachineServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/NetworkTrafficServiceClient.go b/test/mocks/v1/NetworkTrafficServiceClient.go index 3b713ed..8783edd 100644 --- a/test/mocks/v1/NetworkTrafficServiceClient.go +++ b/test/mocks/v1/NetworkTrafficServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/NetworkTrafficServiceServer.go b/test/mocks/v1/NetworkTrafficServiceServer.go index 9148f3b..369cf7e 100644 --- a/test/mocks/v1/NetworkTrafficServiceServer.go +++ b/test/mocks/v1/NetworkTrafficServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/PodServiceClient.go b/test/mocks/v1/PodServiceClient.go index 60b2223..5077ea8 100644 --- a/test/mocks/v1/PodServiceClient.go +++ b/test/mocks/v1/PodServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/PodServiceServer.go b/test/mocks/v1/PodServiceServer.go index 9d48094..ad75525 100644 --- a/test/mocks/v1/PodServiceServer.go +++ b/test/mocks/v1/PodServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/PostgresServiceClient.go b/test/mocks/v1/PostgresServiceClient.go index 2f9274f..30b219c 100644 --- a/test/mocks/v1/PostgresServiceClient.go +++ b/test/mocks/v1/PostgresServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/PostgresServiceServer.go b/test/mocks/v1/PostgresServiceServer.go index 4f3c4d8..aeb3c88 100644 --- a/test/mocks/v1/PostgresServiceServer.go +++ b/test/mocks/v1/PostgresServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/ProductOptionServiceClient.go b/test/mocks/v1/ProductOptionServiceClient.go index fa6296a..3efec39 100644 --- a/test/mocks/v1/ProductOptionServiceClient.go +++ b/test/mocks/v1/ProductOptionServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/ProductOptionServiceServer.go b/test/mocks/v1/ProductOptionServiceServer.go index cf44b91..efa098f 100644 --- a/test/mocks/v1/ProductOptionServiceServer.go +++ b/test/mocks/v1/ProductOptionServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/S3ServiceClient.go b/test/mocks/v1/S3ServiceClient.go index fe0675b..b044305 100644 --- a/test/mocks/v1/S3ServiceClient.go +++ b/test/mocks/v1/S3ServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/S3ServiceServer.go b/test/mocks/v1/S3ServiceServer.go index 2369704..059e81b 100644 --- a/test/mocks/v1/S3ServiceServer.go +++ b/test/mocks/v1/S3ServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeClusterServiceServer.go b/test/mocks/v1/UnsafeClusterServiceServer.go index 9f83ac0..b2beafb 100644 --- a/test/mocks/v1/UnsafeClusterServiceServer.go +++ b/test/mocks/v1/UnsafeClusterServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeIPServiceServer.go b/test/mocks/v1/UnsafeIPServiceServer.go index 3eaa601..73a7086 100644 --- a/test/mocks/v1/UnsafeIPServiceServer.go +++ b/test/mocks/v1/UnsafeIPServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeInfoServiceServer.go b/test/mocks/v1/UnsafeInfoServiceServer.go index 437340d..a397ed3 100644 --- a/test/mocks/v1/UnsafeInfoServiceServer.go +++ b/test/mocks/v1/UnsafeInfoServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeMachineReservationServiceServer.go b/test/mocks/v1/UnsafeMachineReservationServiceServer.go new file mode 100644 index 0000000..c8b9da2 --- /dev/null +++ b/test/mocks/v1/UnsafeMachineReservationServiceServer.go @@ -0,0 +1,29 @@ +// Code generated by mockery v2.46.0. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// UnsafeMachineReservationServiceServer is an autogenerated mock type for the UnsafeMachineReservationServiceServer type +type UnsafeMachineReservationServiceServer struct { + mock.Mock +} + +// mustEmbedUnimplementedMachineReservationServiceServer provides a mock function with given fields: +func (_m *UnsafeMachineReservationServiceServer) mustEmbedUnimplementedMachineReservationServiceServer() { + _m.Called() +} + +// NewUnsafeMachineReservationServiceServer creates a new instance of UnsafeMachineReservationServiceServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewUnsafeMachineReservationServiceServer(t interface { + mock.TestingT + Cleanup(func()) +}) *UnsafeMachineReservationServiceServer { + mock := &UnsafeMachineReservationServiceServer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/test/mocks/v1/UnsafeMachineServiceServer.go b/test/mocks/v1/UnsafeMachineServiceServer.go index 391f81a..16c532e 100644 --- a/test/mocks/v1/UnsafeMachineServiceServer.go +++ b/test/mocks/v1/UnsafeMachineServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeNetworkTrafficServiceServer.go b/test/mocks/v1/UnsafeNetworkTrafficServiceServer.go index c3e4439..33f1ce6 100644 --- a/test/mocks/v1/UnsafeNetworkTrafficServiceServer.go +++ b/test/mocks/v1/UnsafeNetworkTrafficServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafePodServiceServer.go b/test/mocks/v1/UnsafePodServiceServer.go index 346883d..331859f 100644 --- a/test/mocks/v1/UnsafePodServiceServer.go +++ b/test/mocks/v1/UnsafePodServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafePostgresServiceServer.go b/test/mocks/v1/UnsafePostgresServiceServer.go index e0f1c8f..9ff1833 100644 --- a/test/mocks/v1/UnsafePostgresServiceServer.go +++ b/test/mocks/v1/UnsafePostgresServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeProductOptionServiceServer.go b/test/mocks/v1/UnsafeProductOptionServiceServer.go index 87dd28b..4e93589 100644 --- a/test/mocks/v1/UnsafeProductOptionServiceServer.go +++ b/test/mocks/v1/UnsafeProductOptionServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeS3ServiceServer.go b/test/mocks/v1/UnsafeS3ServiceServer.go index aaa8a07..02c6f4e 100644 --- a/test/mocks/v1/UnsafeS3ServiceServer.go +++ b/test/mocks/v1/UnsafeS3ServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeVolumeServiceServer.go b/test/mocks/v1/UnsafeVolumeServiceServer.go index e087457..60cc2a5 100644 --- a/test/mocks/v1/UnsafeVolumeServiceServer.go +++ b/test/mocks/v1/UnsafeVolumeServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/VolumeServiceClient.go b/test/mocks/v1/VolumeServiceClient.go index 9230098..b473940 100644 --- a/test/mocks/v1/VolumeServiceClient.go +++ b/test/mocks/v1/VolumeServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/VolumeServiceServer.go b/test/mocks/v1/VolumeServiceServer.go index 4c56fe7..b1bdce0 100644 --- a/test/mocks/v1/VolumeServiceServer.go +++ b/test/mocks/v1/VolumeServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks From 7c906b0ebde16fc835c4427d256beab307b0be40 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Thu, 26 Sep 2024 08:47:45 +0200 Subject: [PATCH 2/8] Remove start and end fields. --- pkg/apis/v1/machine_reservation.pb.go | 152 ++++++------------ .../api/v1/machine_reservation.proto | 28 ++-- 2 files changed, 64 insertions(+), 116 deletions(-) diff --git a/pkg/apis/v1/machine_reservation.pb.go b/pkg/apis/v1/machine_reservation.pb.go index 6ccf948..8474b28 100644 --- a/pkg/apis/v1/machine_reservation.pb.go +++ b/pkg/apis/v1/machine_reservation.pb.go @@ -32,14 +32,12 @@ type MachineReservationReport struct { Projectid string `protobuf:"bytes,3,opt,name=projectid,proto3" json:"projectid,omitempty"` Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Projectname string `protobuf:"bytes,6,opt,name=projectname,proto3" json:"projectname,omitempty"` - Start *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=start,proto3" json:"start,omitempty"` - End *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=end,proto3" json:"end,omitempty"` - Id string `protobuf:"bytes,9,opt,name=id,proto3" json:"id,omitempty"` - Sizeid string `protobuf:"bytes,10,opt,name=sizeid,proto3" json:"sizeid,omitempty"` - Amount int32 `protobuf:"varint,11,opt,name=amount,proto3" json:"amount,omitempty"` - UsedAmount int32 `protobuf:"varint,12,opt,name=used_amount,json=usedAmount,proto3" json:"used_amount,omitempty"` - UnusedAmount int32 `protobuf:"varint,13,opt,name=unused_amount,json=unusedAmount,proto3" json:"unused_amount,omitempty"` - Labels map[string]string `protobuf:"bytes,14,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Id string `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"` + Sizeid string `protobuf:"bytes,8,opt,name=sizeid,proto3" json:"sizeid,omitempty"` + Amount int32 `protobuf:"varint,9,opt,name=amount,proto3" json:"amount,omitempty"` + UsedAmount int32 `protobuf:"varint,10,opt,name=used_amount,json=usedAmount,proto3" json:"used_amount,omitempty"` + UnusedAmount int32 `protobuf:"varint,11,opt,name=unused_amount,json=unusedAmount,proto3" json:"unused_amount,omitempty"` + Labels map[string]string `protobuf:"bytes,12,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *MachineReservationReport) Reset() { @@ -109,20 +107,6 @@ func (x *MachineReservationReport) GetProjectname() string { return "" } -func (x *MachineReservationReport) GetStart() *timestamppb.Timestamp { - if x != nil { - return x.Start - } - return nil -} - -func (x *MachineReservationReport) GetEnd() *timestamppb.Timestamp { - if x != nil { - return x.End - } - return nil -} - func (x *MachineReservationReport) GetId() string { if x != nil { return x.Id @@ -304,19 +288,17 @@ type MachineReservationUsage struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Partition string `protobuf:"bytes,1,opt,name=partition,proto3" json:"partition,omitempty"` - Tenant string `protobuf:"bytes,2,opt,name=tenant,proto3" json:"tenant,omitempty"` - Projectid string `protobuf:"bytes,3,opt,name=projectid,proto3" json:"projectid,omitempty"` - Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` - Sizeid string `protobuf:"bytes,5,opt,name=sizeid,proto3" json:"sizeid,omitempty"` - Start *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=start,proto3" json:"start,omitempty"` - End *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=end,proto3" json:"end,omitempty"` - ReservationSeconds string `protobuf:"bytes,8,opt,name=reservation_seconds,json=reservationSeconds,proto3" json:"reservation_seconds,omitempty"` - Average string `protobuf:"bytes,9,opt,name=average,proto3" json:"average,omitempty"` - Projectname string `protobuf:"bytes,10,opt,name=projectname,proto3" json:"projectname,omitempty"` - Tenantname string `protobuf:"bytes,11,opt,name=tenantname,proto3" json:"tenantname,omitempty"` - Contractnumber string `protobuf:"bytes,12,opt,name=contractnumber,proto3" json:"contractnumber,omitempty"` - Debtorid string `protobuf:"bytes,13,opt,name=debtorid,proto3" json:"debtorid,omitempty"` + Partition string `protobuf:"bytes,1,opt,name=partition,proto3" json:"partition,omitempty"` + Tenant string `protobuf:"bytes,2,opt,name=tenant,proto3" json:"tenant,omitempty"` + Projectid string `protobuf:"bytes,3,opt,name=projectid,proto3" json:"projectid,omitempty"` + Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` + Sizeid string `protobuf:"bytes,5,opt,name=sizeid,proto3" json:"sizeid,omitempty"` + ReservationSeconds string `protobuf:"bytes,6,opt,name=reservation_seconds,json=reservationSeconds,proto3" json:"reservation_seconds,omitempty"` + Average string `protobuf:"bytes,7,opt,name=average,proto3" json:"average,omitempty"` + Projectname string `protobuf:"bytes,8,opt,name=projectname,proto3" json:"projectname,omitempty"` + Tenantname string `protobuf:"bytes,9,opt,name=tenantname,proto3" json:"tenantname,omitempty"` + Contractnumber string `protobuf:"bytes,10,opt,name=contractnumber,proto3" json:"contractnumber,omitempty"` + Debtorid string `protobuf:"bytes,11,opt,name=debtorid,proto3" json:"debtorid,omitempty"` } func (x *MachineReservationUsage) Reset() { @@ -386,20 +368,6 @@ func (x *MachineReservationUsage) GetSizeid() string { return "" } -func (x *MachineReservationUsage) GetStart() *timestamppb.Timestamp { - if x != nil { - return x.Start - } - return nil -} - -func (x *MachineReservationUsage) GetEnd() *timestamppb.Timestamp { - if x != nil { - return x.End - } - return nil -} - func (x *MachineReservationUsage) GetReservationSeconds() string { if x != nil { return x.ReservationSeconds @@ -504,7 +472,7 @@ var file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDesc = []b 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x69, 0x6f, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xca, 0x04, 0x0a, 0x18, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xea, 0x03, 0x0a, 0x18, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x72, @@ -517,22 +485,16 @@ var file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDesc = []b 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x18, 0x07, 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, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x03, 0x65, 0x6e, - 0x64, 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, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x09, + 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x7a, 0x65, - 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, + 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, + 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x64, - 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x75, + 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x6e, 0x75, - 0x73, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, + 0x73, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x75, 0x6e, 0x75, 0x73, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x5d, - 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x45, + 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, @@ -573,7 +535,7 @@ var file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDesc = []b 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x64, 0x52, 0x10, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, - 0x6c, 0x61, 0x74, 0x65, 0x64, 0x55, 0x73, 0x61, 0x67, 0x65, 0x22, 0xc6, 0x03, 0x0a, 0x17, 0x4d, + 0x6c, 0x61, 0x74, 0x65, 0x64, 0x55, 0x73, 0x61, 0x67, 0x65, 0x22, 0xe6, 0x02, 0x0a, 0x17, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, @@ -583,25 +545,19 @@ var file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDesc = []b 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, - 0x69, 0x64, 0x12, 0x30, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x06, 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, 0x05, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x07, 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, 0x03, 0x65, - 0x6e, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x6f, - 0x6e, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x18, 0x09, + 0x6e, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, + 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, + 0x1e, 0x0a, 0x0a, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x62, 0x74, 0x6f, - 0x72, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x62, 0x74, 0x6f, + 0x72, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x62, 0x74, 0x6f, 0x72, 0x69, 0x64, 0x22, 0x5c, 0x0a, 0x23, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x6c, 0x69, @@ -670,30 +626,26 @@ var file_metalstack_io_accounting_api_v1_machine_reservation_proto_goTypes = []a } var file_metalstack_io_accounting_api_v1_machine_reservation_proto_depIdxs = []int32{ 6, // 0: metalstack.io.accounting.api.v1.MachineReservationReport.timestamp:type_name -> google.protobuf.Timestamp - 6, // 1: metalstack.io.accounting.api.v1.MachineReservationReport.start:type_name -> google.protobuf.Timestamp - 6, // 2: metalstack.io.accounting.api.v1.MachineReservationReport.end:type_name -> google.protobuf.Timestamp - 5, // 3: metalstack.io.accounting.api.v1.MachineReservationReport.labels:type_name -> metalstack.io.accounting.api.v1.MachineReservationReport.LabelsEntry - 7, // 4: metalstack.io.accounting.api.v1.MachineReservationUsageRequest.query:type_name -> metalstack.io.accounting.api.v1.UsageQuery - 6, // 5: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.from:type_name -> google.protobuf.Timestamp - 6, // 6: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.to:type_name -> google.protobuf.Timestamp - 3, // 7: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.usage:type_name -> metalstack.io.accounting.api.v1.MachineReservationUsage - 4, // 8: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.accumulated_usage:type_name -> metalstack.io.accounting.api.v1.MachineReservationUsageAccumuluated - 6, // 9: metalstack.io.accounting.api.v1.MachineReservationUsage.start:type_name -> google.protobuf.Timestamp - 6, // 10: metalstack.io.accounting.api.v1.MachineReservationUsage.end:type_name -> google.protobuf.Timestamp - 8, // 11: metalstack.io.accounting.api.v1.MachineReservationUsageAccumuluated.lifetime:type_name -> google.protobuf.Duration - 0, // 12: metalstack.io.accounting.api.v1.MachineReservationService.Added:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport - 0, // 13: metalstack.io.accounting.api.v1.MachineReservationService.Modified:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport - 0, // 14: metalstack.io.accounting.api.v1.MachineReservationService.Deleted:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport - 1, // 15: metalstack.io.accounting.api.v1.MachineReservationService.Usage:input_type -> metalstack.io.accounting.api.v1.MachineReservationUsageRequest - 9, // 16: metalstack.io.accounting.api.v1.MachineReservationService.Added:output_type -> metalstack.io.accounting.api.v1.Empty - 9, // 17: metalstack.io.accounting.api.v1.MachineReservationService.Modified:output_type -> metalstack.io.accounting.api.v1.Empty - 9, // 18: metalstack.io.accounting.api.v1.MachineReservationService.Deleted:output_type -> metalstack.io.accounting.api.v1.Empty - 2, // 19: metalstack.io.accounting.api.v1.MachineReservationService.Usage:output_type -> metalstack.io.accounting.api.v1.MachineReservationUsageResponse - 16, // [16:20] is the sub-list for method output_type - 12, // [12:16] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 5, // 1: metalstack.io.accounting.api.v1.MachineReservationReport.labels:type_name -> metalstack.io.accounting.api.v1.MachineReservationReport.LabelsEntry + 7, // 2: metalstack.io.accounting.api.v1.MachineReservationUsageRequest.query:type_name -> metalstack.io.accounting.api.v1.UsageQuery + 6, // 3: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.from:type_name -> google.protobuf.Timestamp + 6, // 4: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.to:type_name -> google.protobuf.Timestamp + 3, // 5: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.usage:type_name -> metalstack.io.accounting.api.v1.MachineReservationUsage + 4, // 6: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.accumulated_usage:type_name -> metalstack.io.accounting.api.v1.MachineReservationUsageAccumuluated + 8, // 7: metalstack.io.accounting.api.v1.MachineReservationUsageAccumuluated.lifetime:type_name -> google.protobuf.Duration + 0, // 8: metalstack.io.accounting.api.v1.MachineReservationService.Added:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport + 0, // 9: metalstack.io.accounting.api.v1.MachineReservationService.Modified:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport + 0, // 10: metalstack.io.accounting.api.v1.MachineReservationService.Deleted:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport + 1, // 11: metalstack.io.accounting.api.v1.MachineReservationService.Usage:input_type -> metalstack.io.accounting.api.v1.MachineReservationUsageRequest + 9, // 12: metalstack.io.accounting.api.v1.MachineReservationService.Added:output_type -> metalstack.io.accounting.api.v1.Empty + 9, // 13: metalstack.io.accounting.api.v1.MachineReservationService.Modified:output_type -> metalstack.io.accounting.api.v1.Empty + 9, // 14: metalstack.io.accounting.api.v1.MachineReservationService.Deleted:output_type -> metalstack.io.accounting.api.v1.Empty + 2, // 15: metalstack.io.accounting.api.v1.MachineReservationService.Usage:output_type -> metalstack.io.accounting.api.v1.MachineReservationUsageResponse + 12, // [12:16] is the sub-list for method output_type + 8, // [8:12] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_metalstack_io_accounting_api_v1_machine_reservation_proto_init() } diff --git a/proto/metalstack/io/accounting/api/v1/machine_reservation.proto b/proto/metalstack/io/accounting/api/v1/machine_reservation.proto index 5829eea..d30977c 100644 --- a/proto/metalstack/io/accounting/api/v1/machine_reservation.proto +++ b/proto/metalstack/io/accounting/api/v1/machine_reservation.proto @@ -22,14 +22,12 @@ message MachineReservationReport { string projectid = 3; google.protobuf.Timestamp timestamp = 5; string projectname = 6; - google.protobuf.Timestamp start = 7; - google.protobuf.Timestamp end = 8; - string id = 9; - string sizeid = 10; - int32 amount = 11; - int32 used_amount = 12; - int32 unused_amount = 13; - map labels = 14; + string id = 7; + string sizeid = 8; + int32 amount = 9; + int32 used_amount = 10; + int32 unused_amount = 11; + map labels = 12; } message MachineReservationUsageRequest { @@ -51,14 +49,12 @@ message MachineReservationUsage { string projectid = 3; string id = 4; string sizeid = 5; - google.protobuf.Timestamp start = 6; - google.protobuf.Timestamp end = 7; - string reservation_seconds = 8; - string average = 9; - string projectname = 10; - string tenantname = 11; - string contractnumber = 12; - string debtorid = 13; + string reservation_seconds = 6; + string average = 7; + string projectname = 8; + string tenantname = 9; + string contractnumber = 10; + string debtorid = 11; } message MachineReservationUsageAccumuluated { From efed27a7f86f2834be4be5229f7378144c8a75db Mon Sep 17 00:00:00 2001 From: Gerrit Date: Thu, 26 Sep 2024 08:51:34 +0200 Subject: [PATCH 3/8] Add ID to query. --- pkg/apis/v1/machine_reservation.pb.go | 184 +++++++++--------- .../api/v1/machine_reservation.proto | 5 +- 2 files changed, 100 insertions(+), 89 deletions(-) diff --git a/pkg/apis/v1/machine_reservation.pb.go b/pkg/apis/v1/machine_reservation.pb.go index 8474b28..514fe6b 100644 --- a/pkg/apis/v1/machine_reservation.pb.go +++ b/pkg/apis/v1/machine_reservation.pb.go @@ -155,8 +155,9 @@ type MachineReservationUsageRequest struct { unknownFields protoimpl.UnknownFields Query *UsageQuery `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` - Sizeid *string `protobuf:"bytes,2,opt,name=sizeid,proto3,oneof" json:"sizeid,omitempty"` - Partition *string `protobuf:"bytes,3,opt,name=partition,proto3,oneof" json:"partition,omitempty"` + Id *string `protobuf:"bytes,2,opt,name=id,proto3,oneof" json:"id,omitempty"` + Sizeid *string `protobuf:"bytes,3,opt,name=sizeid,proto3,oneof" json:"sizeid,omitempty"` + Partition *string `protobuf:"bytes,4,opt,name=partition,proto3,oneof" json:"partition,omitempty"` } func (x *MachineReservationUsageRequest) Reset() { @@ -198,6 +199,13 @@ func (x *MachineReservationUsageRequest) GetQuery() *UsageQuery { return nil } +func (x *MachineReservationUsageRequest) GetId() string { + if x != nil && x.Id != nil { + return *x.Id + } + return "" +} + func (x *MachineReservationUsageRequest) GetSizeid() string { if x != nil && x.Sizeid != nil { return *x.Sizeid @@ -503,100 +511,102 @@ var file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDesc = []b 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbc, 0x01, 0x0a, 0x1e, 0x4d, 0x61, 0x63, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd8, 0x01, 0x0a, 0x1e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, - 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1b, - 0x0a, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x70, - 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, - 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x09, - 0x0a, 0x07, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x61, - 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc0, 0x02, 0x0a, 0x1f, 0x4d, 0x61, 0x63, 0x68, - 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, - 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x66, - 0x72, 0x6f, 0x6d, 0x18, 0x01, 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, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x2a, 0x0a, 0x02, 0x74, - 0x6f, 0x18, 0x02, 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, 0x02, 0x74, 0x6f, 0x12, 0x4e, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, - 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, - 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, - 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, - 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x71, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x75, 0x6d, - 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, - 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, 0x63, 0x75, - 0x6d, 0x75, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x64, 0x52, 0x10, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, - 0x6c, 0x61, 0x74, 0x65, 0x64, 0x55, 0x73, 0x61, 0x67, 0x65, 0x22, 0xe6, 0x02, 0x0a, 0x17, 0x4d, - 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, - 0x7a, 0x65, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, - 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x12, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x6f, - 0x6e, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x62, 0x74, 0x6f, - 0x72, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x62, 0x74, 0x6f, - 0x72, 0x69, 0x64, 0x22, 0x5c, 0x0a, 0x23, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, - 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, - 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x6c, 0x69, - 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, - 0x65, 0x32, 0xf1, 0x03, 0x0a, 0x19, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, - 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x6a, 0x0a, 0x05, 0x41, 0x64, 0x64, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, - 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, - 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, - 0x6f, 0x72, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, - 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6d, 0x0a, 0x08, 0x4d, - 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, - 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, - 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, - 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, - 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6c, 0x0a, 0x07, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, - 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, - 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, - 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x8a, 0x01, 0x0a, 0x05, 0x55, 0x73, 0x61, - 0x67, 0x65, 0x12, 0x3f, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, + 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x13, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, + 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, 0x88, 0x01, 0x01, + 0x12, 0x21, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x88, 0x01, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x69, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0xc0, 0x02, 0x0a, 0x1f, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, + 0x01, 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, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 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, + 0x02, 0x74, 0x6f, 0x12, 0x4e, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, + 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x75, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x71, 0x0a, 0x11, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x44, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x75, + 0x61, 0x74, 0x65, 0x64, 0x52, 0x10, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, + 0x64, 0x55, 0x73, 0x61, 0x67, 0x65, 0x22, 0xe6, 0x02, 0x0a, 0x17, 0x4d, 0x61, 0x63, 0x68, 0x69, + 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x16, 0x0a, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, 0x69, 0x64, 0x12, 0x2f, + 0x0a, 0x13, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, + 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x72, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x74, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x62, 0x74, 0x6f, 0x72, 0x69, 0x64, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x62, 0x74, 0x6f, 0x72, 0x69, 0x64, 0x22, + 0x5c, 0x0a, 0x23, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, + 0x6c, 0x75, 0x61, 0x74, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x32, 0xf1, 0x03, + 0x0a, 0x19, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6a, 0x0a, 0x05, 0x41, + 0x64, 0x64, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, + 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, + 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, + 0x26, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6d, 0x0a, 0x08, 0x4d, 0x6f, 0x64, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, - 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0d, 0x5a, 0x0b, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, - 0x73, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x26, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6c, 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, + 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x26, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x12, 0x8a, 0x01, 0x0a, 0x05, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3f, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x40, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x0d, 0x5a, 0x0b, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/metalstack/io/accounting/api/v1/machine_reservation.proto b/proto/metalstack/io/accounting/api/v1/machine_reservation.proto index d30977c..ba4d7c1 100644 --- a/proto/metalstack/io/accounting/api/v1/machine_reservation.proto +++ b/proto/metalstack/io/accounting/api/v1/machine_reservation.proto @@ -32,8 +32,9 @@ message MachineReservationReport { message MachineReservationUsageRequest { UsageQuery query = 1; - optional string sizeid = 2; - optional string partition = 3; + optional string id = 2; + optional string sizeid = 3; + optional string partition = 4; } message MachineReservationUsageResponse { From cd0e5c238ace4c73b1652f8d869b91c5c2c69221 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Thu, 26 Sep 2024 08:58:40 +0200 Subject: [PATCH 4/8] Correct accumulated response. --- pkg/apis/v1/machine_reservation.pb.go | 124 +++++++++--------- .../api/v1/machine_reservation.proto | 4 +- 2 files changed, 66 insertions(+), 62 deletions(-) diff --git a/pkg/apis/v1/machine_reservation.pb.go b/pkg/apis/v1/machine_reservation.pb.go index 514fe6b..f4bcbec 100644 --- a/pkg/apis/v1/machine_reservation.pb.go +++ b/pkg/apis/v1/machine_reservation.pb.go @@ -9,7 +9,6 @@ package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" @@ -423,7 +422,8 @@ type MachineReservationUsageAccumuluated struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Lifetime *durationpb.Duration `protobuf:"bytes,1,opt,name=lifetime,proto3" json:"lifetime,omitempty"` + ReservationSeconds string `protobuf:"bytes,1,opt,name=reservation_seconds,json=reservationSeconds,proto3" json:"reservation_seconds,omitempty"` + Average string `protobuf:"bytes,2,opt,name=average,proto3" json:"average,omitempty"` } func (x *MachineReservationUsageAccumuluated) Reset() { @@ -458,11 +458,18 @@ func (*MachineReservationUsageAccumuluated) Descriptor() ([]byte, []int) { return file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDescGZIP(), []int{4} } -func (x *MachineReservationUsageAccumuluated) GetLifetime() *durationpb.Duration { +func (x *MachineReservationUsageAccumuluated) GetReservationSeconds() string { if x != nil { - return x.Lifetime + return x.ReservationSeconds } - return nil + return "" +} + +func (x *MachineReservationUsageAccumuluated) GetAverage() string { + if x != nil { + return x.Average + } + return "" } var File_metalstack_io_accounting_api_v1_machine_reservation_proto protoreflect.FileDescriptor @@ -473,9 +480,7 @@ var file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDesc = []b 0x31, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x69, 0x6f, 0x2f, 0x61, 0x63, 0x63, @@ -568,45 +573,46 @@ var file_metalstack_io_accounting_api_v1_machine_reservation_proto_rawDesc = []b 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x62, 0x74, 0x6f, 0x72, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x62, 0x74, 0x6f, 0x72, 0x69, 0x64, 0x22, - 0x5c, 0x0a, 0x23, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x70, 0x0a, 0x23, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, - 0x6c, 0x75, 0x61, 0x74, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x32, 0xf1, 0x03, - 0x0a, 0x19, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6a, 0x0a, 0x05, 0x41, - 0x64, 0x64, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, - 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, - 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, - 0x26, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6d, 0x0a, 0x08, 0x4d, 0x6f, 0x64, 0x69, 0x66, - 0x69, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, + 0x6c, 0x75, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x12, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, + 0x65, 0x32, 0xf1, 0x03, 0x0a, 0x19, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x6a, 0x0a, 0x05, 0x41, 0x64, 0x64, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, + 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, + 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, + 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6d, 0x0a, 0x08, 0x4d, + 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, + 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, + 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6c, 0x0a, 0x07, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, + 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x8a, 0x01, 0x0a, 0x05, 0x55, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x3f, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, + 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, - 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x26, - 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6c, 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x64, 0x12, 0x39, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, - 0x6f, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x26, 0x2e, 0x6d, - 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x12, 0x8a, 0x01, 0x0a, 0x05, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3f, - 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x40, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x69, 0x6f, 0x2e, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x42, 0x0d, 0x5a, 0x0b, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0d, 0x5a, 0x0b, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, + 0x73, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -631,8 +637,7 @@ var file_metalstack_io_accounting_api_v1_machine_reservation_proto_goTypes = []a nil, // 5: metalstack.io.accounting.api.v1.MachineReservationReport.LabelsEntry (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp (*UsageQuery)(nil), // 7: metalstack.io.accounting.api.v1.UsageQuery - (*durationpb.Duration)(nil), // 8: google.protobuf.Duration - (*Empty)(nil), // 9: metalstack.io.accounting.api.v1.Empty + (*Empty)(nil), // 8: metalstack.io.accounting.api.v1.Empty } var file_metalstack_io_accounting_api_v1_machine_reservation_proto_depIdxs = []int32{ 6, // 0: metalstack.io.accounting.api.v1.MachineReservationReport.timestamp:type_name -> google.protobuf.Timestamp @@ -642,20 +647,19 @@ var file_metalstack_io_accounting_api_v1_machine_reservation_proto_depIdxs = []i 6, // 4: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.to:type_name -> google.protobuf.Timestamp 3, // 5: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.usage:type_name -> metalstack.io.accounting.api.v1.MachineReservationUsage 4, // 6: metalstack.io.accounting.api.v1.MachineReservationUsageResponse.accumulated_usage:type_name -> metalstack.io.accounting.api.v1.MachineReservationUsageAccumuluated - 8, // 7: metalstack.io.accounting.api.v1.MachineReservationUsageAccumuluated.lifetime:type_name -> google.protobuf.Duration - 0, // 8: metalstack.io.accounting.api.v1.MachineReservationService.Added:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport - 0, // 9: metalstack.io.accounting.api.v1.MachineReservationService.Modified:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport - 0, // 10: metalstack.io.accounting.api.v1.MachineReservationService.Deleted:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport - 1, // 11: metalstack.io.accounting.api.v1.MachineReservationService.Usage:input_type -> metalstack.io.accounting.api.v1.MachineReservationUsageRequest - 9, // 12: metalstack.io.accounting.api.v1.MachineReservationService.Added:output_type -> metalstack.io.accounting.api.v1.Empty - 9, // 13: metalstack.io.accounting.api.v1.MachineReservationService.Modified:output_type -> metalstack.io.accounting.api.v1.Empty - 9, // 14: metalstack.io.accounting.api.v1.MachineReservationService.Deleted:output_type -> metalstack.io.accounting.api.v1.Empty - 2, // 15: metalstack.io.accounting.api.v1.MachineReservationService.Usage:output_type -> metalstack.io.accounting.api.v1.MachineReservationUsageResponse - 12, // [12:16] is the sub-list for method output_type - 8, // [8:12] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 0, // 7: metalstack.io.accounting.api.v1.MachineReservationService.Added:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport + 0, // 8: metalstack.io.accounting.api.v1.MachineReservationService.Modified:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport + 0, // 9: metalstack.io.accounting.api.v1.MachineReservationService.Deleted:input_type -> metalstack.io.accounting.api.v1.MachineReservationReport + 1, // 10: metalstack.io.accounting.api.v1.MachineReservationService.Usage:input_type -> metalstack.io.accounting.api.v1.MachineReservationUsageRequest + 8, // 11: metalstack.io.accounting.api.v1.MachineReservationService.Added:output_type -> metalstack.io.accounting.api.v1.Empty + 8, // 12: metalstack.io.accounting.api.v1.MachineReservationService.Modified:output_type -> metalstack.io.accounting.api.v1.Empty + 8, // 13: metalstack.io.accounting.api.v1.MachineReservationService.Deleted:output_type -> metalstack.io.accounting.api.v1.Empty + 2, // 14: metalstack.io.accounting.api.v1.MachineReservationService.Usage:output_type -> metalstack.io.accounting.api.v1.MachineReservationUsageResponse + 11, // [11:15] is the sub-list for method output_type + 7, // [7:11] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_metalstack_io_accounting_api_v1_machine_reservation_proto_init() } diff --git a/proto/metalstack/io/accounting/api/v1/machine_reservation.proto b/proto/metalstack/io/accounting/api/v1/machine_reservation.proto index ba4d7c1..1912c21 100644 --- a/proto/metalstack/io/accounting/api/v1/machine_reservation.proto +++ b/proto/metalstack/io/accounting/api/v1/machine_reservation.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package metalstack.io.accounting.api.v1; -import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "metalstack/io/accounting/api/v1/common.proto"; @@ -59,5 +58,6 @@ message MachineReservationUsage { } message MachineReservationUsageAccumuluated { - google.protobuf.Duration lifetime = 1; + string reservation_seconds = 1; + string average = 2; } From 4497267db27a0561465c19ceb1380424e0e5da37 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Thu, 26 Sep 2024 10:56:05 +0200 Subject: [PATCH 5/8] Extend client. --- go.mod | 10 +++--- go.sum | 20 +++++------ pkg/client/client.go | 5 +++ test/client/mock-client.go | 71 ++++++++++++++++++++++---------------- 4 files changed, 61 insertions(+), 45 deletions(-) diff --git a/go.mod b/go.mod index e16daad..c3c159e 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.23 require ( github.com/stretchr/testify v1.9.0 - google.golang.org/grpc v1.64.0 + google.golang.org/grpc v1.67.0 google.golang.org/protobuf v1.34.2 ) @@ -12,9 +12,9 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/objx v0.5.2 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 36e3bc9..2561a1d 100644 --- a/go.sum +++ b/go.sum @@ -8,16 +8,16 @@ github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3 h1:9Xyg6I9IWQZhRVfCWjKK+l6kI0jHcPesVlMnT//aHNo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw= +google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/pkg/client/client.go b/pkg/client/client.go index 494cb51..a54054a 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -25,6 +25,7 @@ type AccountingClient interface { Health() healthv1.HealthClient Postgres() v1.PostgresServiceClient Machine() v1.MachineServiceClient + MachineReservation() v1.MachineReservationServiceClient ProductOption() v1.ProductOptionServiceClient Close() error } @@ -134,6 +135,10 @@ func (c client) Machine() v1.MachineServiceClient { return v1.NewMachineServiceClient(c.conn) } +func (c client) MachineReservation() v1.MachineReservationServiceClient { + return v1.NewMachineReservationServiceClient(c.conn) +} + func (c client) ProductOption() v1.ProductOptionServiceClient { return v1.NewProductOptionServiceClient(c.conn) } diff --git a/test/client/mock-client.go b/test/client/mock-client.go index e286641..f669cb1 100644 --- a/test/client/mock-client.go +++ b/test/client/mock-client.go @@ -12,43 +12,46 @@ import ( ) type AccountingMockFns struct { - Cluster func(mock *mock.Mock) - Pod func(mock *mock.Mock) - S3 func(mock *mock.Mock) - IP func(mock *mock.Mock) - Info func(mock *mock.Mock) - NetworkTraffic func(mock *mock.Mock) - Volume func(mock *mock.Mock) - Postgres func(mock *mock.Mock) - ProductOption func(mock *mock.Mock) - Machine func(mock *mock.Mock) + Cluster func(mock *mock.Mock) + Pod func(mock *mock.Mock) + S3 func(mock *mock.Mock) + IP func(mock *mock.Mock) + Info func(mock *mock.Mock) + NetworkTraffic func(mock *mock.Mock) + Volume func(mock *mock.Mock) + Postgres func(mock *mock.Mock) + ProductOption func(mock *mock.Mock) + Machine func(mock *mock.Mock) + MachineReservation func(mock *mock.Mock) } type AccountingMockClient struct { - ClusterService *accmocks.ClusterServiceClient - PodService *accmocks.PodServiceClient - S3Service *accmocks.S3ServiceClient - IPService *accmocks.IPServiceClient - InfoService *accmocks.InfoServiceClient - NetworkTrafficService *accmocks.NetworkTrafficServiceClient - VolumeService *accmocks.VolumeServiceClient - PostgresService *accmocks.PostgresServiceClient - ProductOptionService *accmocks.ProductOptionServiceClient - MachineService *accmocks.MachineServiceClient + ClusterService *accmocks.ClusterServiceClient + PodService *accmocks.PodServiceClient + S3Service *accmocks.S3ServiceClient + IPService *accmocks.IPServiceClient + InfoService *accmocks.InfoServiceClient + NetworkTrafficService *accmocks.NetworkTrafficServiceClient + VolumeService *accmocks.VolumeServiceClient + PostgresService *accmocks.PostgresServiceClient + ProductOptionService *accmocks.ProductOptionServiceClient + MachineService *accmocks.MachineServiceClient + MachineReservationService *accmocks.MachineReservationServiceClient } func NewAccountingMockClient(mockFns *AccountingMockFns) (*AccountingMockClient, accountingclient.AccountingClient) { a := &AccountingMockClient{ - ClusterService: &accmocks.ClusterServiceClient{}, - PodService: &accmocks.PodServiceClient{}, - S3Service: &accmocks.S3ServiceClient{}, - IPService: &accmocks.IPServiceClient{}, - InfoService: &accmocks.InfoServiceClient{}, - NetworkTrafficService: &accmocks.NetworkTrafficServiceClient{}, - VolumeService: &accmocks.VolumeServiceClient{}, - PostgresService: &accmocks.PostgresServiceClient{}, - ProductOptionService: &accmocks.ProductOptionServiceClient{}, - MachineService: &accmocks.MachineServiceClient{}, + ClusterService: &accmocks.ClusterServiceClient{}, + PodService: &accmocks.PodServiceClient{}, + S3Service: &accmocks.S3ServiceClient{}, + IPService: &accmocks.IPServiceClient{}, + InfoService: &accmocks.InfoServiceClient{}, + NetworkTrafficService: &accmocks.NetworkTrafficServiceClient{}, + VolumeService: &accmocks.VolumeServiceClient{}, + PostgresService: &accmocks.PostgresServiceClient{}, + ProductOptionService: &accmocks.ProductOptionServiceClient{}, + MachineService: &accmocks.MachineServiceClient{}, + MachineReservationService: &accmocks.MachineReservationServiceClient{}, } if mockFns != nil { @@ -82,6 +85,9 @@ func NewAccountingMockClient(mockFns *AccountingMockFns) (*AccountingMockClient, if mockFns.Machine != nil { mockFns.Machine(&a.MachineService.Mock) } + if mockFns.MachineReservation != nil { + mockFns.MachineReservation(&a.MachineReservationService.Mock) + } } return a, a @@ -135,6 +141,10 @@ func (c *AccountingMockClient) Machine() v1.MachineServiceClient { return c.MachineService } +func (c *AccountingMockClient) MachineReservation() v1.MachineReservationServiceClient { + return c.MachineReservationService +} + func (c *AccountingMockClient) AssertExpectations(t *testing.T) { _ = c.ClusterService.AssertExpectations(t) _ = c.PodService.AssertExpectations(t) @@ -146,4 +156,5 @@ func (c *AccountingMockClient) AssertExpectations(t *testing.T) { _ = c.PostgresService.AssertExpectations(t) _ = c.ProductOptionService.AssertExpectations(t) _ = c.MachineService.AssertExpectations(t) + _ = c.MachineReservationService.AssertExpectations(t) } From c91f104e9c021b0417e253a6dd2447b1a3819ea4 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Wed, 2 Oct 2024 12:57:49 +0200 Subject: [PATCH 6/8] Update Makefile Co-authored-by: Stefan Majer --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a5b2153..46f0778 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ proto: .PHONY: mocks mocks: rm -rf test/mocks - docker run --rm --user $$(id -u):$$(id -g) -w /work -v ${PWD}:/work vektra/mockery:v2.46.0 --keeptree --all --dir pkg/apis --output test/mocks + docker run --rm --user $$(id -u):$$(id -g) -w /work -v ${PWD}:/work vektra/mockery:v2.46.1 --keeptree --all --dir pkg/apis --output test/mocks .PHONY: test test: From 01fa569ff57feff149336de347fb02cf39c44c97 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Wed, 2 Oct 2024 12:57:55 +0200 Subject: [PATCH 7/8] Update proto/Makefile Co-authored-by: Stefan Majer --- proto/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/Makefile b/proto/Makefile index 4e471da..9bb01d7 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -1,5 +1,5 @@ MAKEFLAGS += --no-print-directory -BUF_VERSION := 1.42.0 +BUF_VERSION := 1.43.0 _buf: docker run --rm \ From 32b9971fb7a0addfdf4a5c54e0160c7b823f29c8 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Wed, 2 Oct 2024 12:58:50 +0200 Subject: [PATCH 8/8] Gen. --- test/mocks/v1/ClusterServiceClient.go | 2 +- test/mocks/v1/ClusterServiceServer.go | 2 +- test/mocks/v1/IPServiceClient.go | 2 +- test/mocks/v1/IPServiceServer.go | 2 +- test/mocks/v1/InfoServiceClient.go | 2 +- test/mocks/v1/InfoServiceServer.go | 2 +- test/mocks/v1/MachineReservationServiceClient.go | 2 +- test/mocks/v1/MachineReservationServiceServer.go | 2 +- test/mocks/v1/MachineServiceClient.go | 2 +- test/mocks/v1/MachineServiceServer.go | 2 +- test/mocks/v1/NetworkTrafficServiceClient.go | 2 +- test/mocks/v1/NetworkTrafficServiceServer.go | 2 +- test/mocks/v1/PodServiceClient.go | 2 +- test/mocks/v1/PodServiceServer.go | 2 +- test/mocks/v1/PostgresServiceClient.go | 2 +- test/mocks/v1/PostgresServiceServer.go | 2 +- test/mocks/v1/ProductOptionServiceClient.go | 2 +- test/mocks/v1/ProductOptionServiceServer.go | 2 +- test/mocks/v1/S3ServiceClient.go | 2 +- test/mocks/v1/S3ServiceServer.go | 2 +- test/mocks/v1/UnsafeClusterServiceServer.go | 2 +- test/mocks/v1/UnsafeIPServiceServer.go | 2 +- test/mocks/v1/UnsafeInfoServiceServer.go | 2 +- test/mocks/v1/UnsafeMachineReservationServiceServer.go | 2 +- test/mocks/v1/UnsafeMachineServiceServer.go | 2 +- test/mocks/v1/UnsafeNetworkTrafficServiceServer.go | 2 +- test/mocks/v1/UnsafePodServiceServer.go | 2 +- test/mocks/v1/UnsafePostgresServiceServer.go | 2 +- test/mocks/v1/UnsafeProductOptionServiceServer.go | 2 +- test/mocks/v1/UnsafeS3ServiceServer.go | 2 +- test/mocks/v1/UnsafeVolumeServiceServer.go | 2 +- test/mocks/v1/VolumeServiceClient.go | 2 +- test/mocks/v1/VolumeServiceServer.go | 2 +- 33 files changed, 33 insertions(+), 33 deletions(-) diff --git a/test/mocks/v1/ClusterServiceClient.go b/test/mocks/v1/ClusterServiceClient.go index 2feb35f..09ab457 100644 --- a/test/mocks/v1/ClusterServiceClient.go +++ b/test/mocks/v1/ClusterServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/ClusterServiceServer.go b/test/mocks/v1/ClusterServiceServer.go index afc40da..e6fe1e9 100644 --- a/test/mocks/v1/ClusterServiceServer.go +++ b/test/mocks/v1/ClusterServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/IPServiceClient.go b/test/mocks/v1/IPServiceClient.go index 8b320b8..71febf3 100644 --- a/test/mocks/v1/IPServiceClient.go +++ b/test/mocks/v1/IPServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/IPServiceServer.go b/test/mocks/v1/IPServiceServer.go index 596e958..ea41fda 100644 --- a/test/mocks/v1/IPServiceServer.go +++ b/test/mocks/v1/IPServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/InfoServiceClient.go b/test/mocks/v1/InfoServiceClient.go index f0f36ca..c793bee 100644 --- a/test/mocks/v1/InfoServiceClient.go +++ b/test/mocks/v1/InfoServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/InfoServiceServer.go b/test/mocks/v1/InfoServiceServer.go index d8a6df9..ef1dd47 100644 --- a/test/mocks/v1/InfoServiceServer.go +++ b/test/mocks/v1/InfoServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/MachineReservationServiceClient.go b/test/mocks/v1/MachineReservationServiceClient.go index 5bc7b23..9f34991 100644 --- a/test/mocks/v1/MachineReservationServiceClient.go +++ b/test/mocks/v1/MachineReservationServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/MachineReservationServiceServer.go b/test/mocks/v1/MachineReservationServiceServer.go index 3fd8c78..4affc60 100644 --- a/test/mocks/v1/MachineReservationServiceServer.go +++ b/test/mocks/v1/MachineReservationServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/MachineServiceClient.go b/test/mocks/v1/MachineServiceClient.go index b1825fa..e8df14b 100644 --- a/test/mocks/v1/MachineServiceClient.go +++ b/test/mocks/v1/MachineServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/MachineServiceServer.go b/test/mocks/v1/MachineServiceServer.go index e90e056..f8f15c6 100644 --- a/test/mocks/v1/MachineServiceServer.go +++ b/test/mocks/v1/MachineServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/NetworkTrafficServiceClient.go b/test/mocks/v1/NetworkTrafficServiceClient.go index 8783edd..c54a926 100644 --- a/test/mocks/v1/NetworkTrafficServiceClient.go +++ b/test/mocks/v1/NetworkTrafficServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/NetworkTrafficServiceServer.go b/test/mocks/v1/NetworkTrafficServiceServer.go index 369cf7e..528a18e 100644 --- a/test/mocks/v1/NetworkTrafficServiceServer.go +++ b/test/mocks/v1/NetworkTrafficServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/PodServiceClient.go b/test/mocks/v1/PodServiceClient.go index 5077ea8..0ffa470 100644 --- a/test/mocks/v1/PodServiceClient.go +++ b/test/mocks/v1/PodServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/PodServiceServer.go b/test/mocks/v1/PodServiceServer.go index ad75525..7eaae29 100644 --- a/test/mocks/v1/PodServiceServer.go +++ b/test/mocks/v1/PodServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/PostgresServiceClient.go b/test/mocks/v1/PostgresServiceClient.go index 30b219c..9b40bdb 100644 --- a/test/mocks/v1/PostgresServiceClient.go +++ b/test/mocks/v1/PostgresServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/PostgresServiceServer.go b/test/mocks/v1/PostgresServiceServer.go index aeb3c88..d282bb0 100644 --- a/test/mocks/v1/PostgresServiceServer.go +++ b/test/mocks/v1/PostgresServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/ProductOptionServiceClient.go b/test/mocks/v1/ProductOptionServiceClient.go index 3efec39..ff52b9c 100644 --- a/test/mocks/v1/ProductOptionServiceClient.go +++ b/test/mocks/v1/ProductOptionServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/ProductOptionServiceServer.go b/test/mocks/v1/ProductOptionServiceServer.go index efa098f..7c3d738 100644 --- a/test/mocks/v1/ProductOptionServiceServer.go +++ b/test/mocks/v1/ProductOptionServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/S3ServiceClient.go b/test/mocks/v1/S3ServiceClient.go index b044305..9bf5b74 100644 --- a/test/mocks/v1/S3ServiceClient.go +++ b/test/mocks/v1/S3ServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/S3ServiceServer.go b/test/mocks/v1/S3ServiceServer.go index 059e81b..6a3d11f 100644 --- a/test/mocks/v1/S3ServiceServer.go +++ b/test/mocks/v1/S3ServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeClusterServiceServer.go b/test/mocks/v1/UnsafeClusterServiceServer.go index b2beafb..0a9f8d2 100644 --- a/test/mocks/v1/UnsafeClusterServiceServer.go +++ b/test/mocks/v1/UnsafeClusterServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeIPServiceServer.go b/test/mocks/v1/UnsafeIPServiceServer.go index 73a7086..1520472 100644 --- a/test/mocks/v1/UnsafeIPServiceServer.go +++ b/test/mocks/v1/UnsafeIPServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeInfoServiceServer.go b/test/mocks/v1/UnsafeInfoServiceServer.go index a397ed3..d1a6a74 100644 --- a/test/mocks/v1/UnsafeInfoServiceServer.go +++ b/test/mocks/v1/UnsafeInfoServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeMachineReservationServiceServer.go b/test/mocks/v1/UnsafeMachineReservationServiceServer.go index c8b9da2..7a5456c 100644 --- a/test/mocks/v1/UnsafeMachineReservationServiceServer.go +++ b/test/mocks/v1/UnsafeMachineReservationServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeMachineServiceServer.go b/test/mocks/v1/UnsafeMachineServiceServer.go index 16c532e..d38bb58 100644 --- a/test/mocks/v1/UnsafeMachineServiceServer.go +++ b/test/mocks/v1/UnsafeMachineServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeNetworkTrafficServiceServer.go b/test/mocks/v1/UnsafeNetworkTrafficServiceServer.go index 33f1ce6..eb64afa 100644 --- a/test/mocks/v1/UnsafeNetworkTrafficServiceServer.go +++ b/test/mocks/v1/UnsafeNetworkTrafficServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafePodServiceServer.go b/test/mocks/v1/UnsafePodServiceServer.go index 331859f..83d41b2 100644 --- a/test/mocks/v1/UnsafePodServiceServer.go +++ b/test/mocks/v1/UnsafePodServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafePostgresServiceServer.go b/test/mocks/v1/UnsafePostgresServiceServer.go index 9ff1833..ccd6786 100644 --- a/test/mocks/v1/UnsafePostgresServiceServer.go +++ b/test/mocks/v1/UnsafePostgresServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeProductOptionServiceServer.go b/test/mocks/v1/UnsafeProductOptionServiceServer.go index 4e93589..d730102 100644 --- a/test/mocks/v1/UnsafeProductOptionServiceServer.go +++ b/test/mocks/v1/UnsafeProductOptionServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeS3ServiceServer.go b/test/mocks/v1/UnsafeS3ServiceServer.go index 02c6f4e..f516c3d 100644 --- a/test/mocks/v1/UnsafeS3ServiceServer.go +++ b/test/mocks/v1/UnsafeS3ServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/UnsafeVolumeServiceServer.go b/test/mocks/v1/UnsafeVolumeServiceServer.go index 60cc2a5..3cfdcce 100644 --- a/test/mocks/v1/UnsafeVolumeServiceServer.go +++ b/test/mocks/v1/UnsafeVolumeServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/VolumeServiceClient.go b/test/mocks/v1/VolumeServiceClient.go index b473940..68d8d89 100644 --- a/test/mocks/v1/VolumeServiceClient.go +++ b/test/mocks/v1/VolumeServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks diff --git a/test/mocks/v1/VolumeServiceServer.go b/test/mocks/v1/VolumeServiceServer.go index b1bdce0..5ea7690 100644 --- a/test/mocks/v1/VolumeServiceServer.go +++ b/test/mocks/v1/VolumeServiceServer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.46.1. DO NOT EDIT. package mocks