network.proto 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. syntax = "proto3";
  2. import "kubemodel/diagnostic.proto";
  3. import "google/protobuf/timestamp.proto";
  4. package kubemodel;
  5. option go_package = "github.com/opencost/opencost/core/pkg/model/pb/kubemodel";
  6. // ServicePort represents a port exposed by a service
  7. message ServicePort {
  8. string name = 1;
  9. string protocol = 2;
  10. int32 port = 3;
  11. int32 targetPort = 4;
  12. int32 nodePort = 5;
  13. }
  14. // Service represents a K8s Service (allocated resource)
  15. message Service {
  16. // Identification
  17. string ID = 1;
  18. string clusterID = 2;
  19. // Properties
  20. string name = 3;
  21. string serviceType = 4;
  22. repeated ServicePort ports = 5;
  23. map<string, string> labels = 6;
  24. map<string, string> annotations = 7;
  25. // Resource lifecycle (only when different from cluster window)
  26. optional google.protobuf.Timestamp creationTime = 8;
  27. optional google.protobuf.Timestamp deletionTime = 9;
  28. // Usage metrics
  29. // Network transfer bytes sent through this service
  30. int64 networkTransferBytes = 10;
  31. // Network bytes received through this service
  32. int64 networkReceiveBytes = 11;
  33. // Diagnostic information about this resource
  34. optional DiagnosticResult diagnostic = 99;
  35. }