common.proto 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.networkservices.v1beta1;
  16. import "google/api/field_behavior.proto";
  17. import "google/protobuf/timestamp.proto";
  18. option csharp_namespace = "Google.Cloud.NetworkServices.V1Beta1";
  19. option go_package = "google.golang.org/genproto/googleapis/cloud/networkservices/v1beta1;networkservices";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "CommonProto";
  22. option java_package = "com.google.cloud.networkservices.v1beta1";
  23. option php_namespace = "Google\\Cloud\\NetworkServices\\V1beta1";
  24. option ruby_package = "Google::Cloud::NetworkServices::V1beta1";
  25. // Represents the metadata of the long-running operation.
  26. message OperationMetadata {
  27. // Output only. The time the operation was created.
  28. google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  29. // Output only. The time the operation finished running.
  30. google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  31. // Output only. Server-defined resource path for the target of the operation.
  32. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  33. // Output only. Name of the verb executed by the operation.
  34. string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  35. // Output only. Human-readable status of the operation, if any.
  36. string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  37. // Output only. Identifies whether the user has requested cancellation
  38. // of the operation. Operations that have successfully been cancelled
  39. // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  40. // corresponding to `Code.CANCELLED`.
  41. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  42. // Output only. API version used to start the operation.
  43. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  44. }
  45. // Specification of a port-based selector.
  46. message TrafficPortSelector {
  47. // Optional. A list of ports. Can be port numbers or port range
  48. // (example, [80-90] specifies all ports from 80 to 90, including
  49. // 80 and 90) or named ports or * to specify all ports. If the
  50. // list is empty, all ports are selected.
  51. repeated string ports = 1 [(google.api.field_behavior) = OPTIONAL];
  52. }
  53. // A definition of a matcher that selects endpoints to which the policies
  54. // should be applied.
  55. message EndpointMatcher {
  56. // The matcher that is based on node metadata presented by xDS clients.
  57. message MetadataLabelMatcher {
  58. // Defines a name-pair value for a single label.
  59. message MetadataLabels {
  60. // Required. Label name presented as key in xDS Node Metadata.
  61. string label_name = 1 [(google.api.field_behavior) = REQUIRED];
  62. // Required. Label value presented as value corresponding to the above
  63. // key, in xDS Node Metadata.
  64. string label_value = 2 [(google.api.field_behavior) = REQUIRED];
  65. }
  66. // Possible criteria values that define logic of how matching is made.
  67. enum MetadataLabelMatchCriteria {
  68. // Default value. Should not be used.
  69. METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED = 0;
  70. // At least one of the Labels specified in the matcher should match the
  71. // metadata presented by xDS client.
  72. MATCH_ANY = 1;
  73. // The metadata presented by the xDS client should contain all of the
  74. // labels specified here.
  75. MATCH_ALL = 2;
  76. }
  77. // Specifies how matching should be done.
  78. //
  79. // Supported values are:
  80. // MATCH_ANY: At least one of the Labels specified in the
  81. // matcher should match the metadata presented by xDS client.
  82. // MATCH_ALL: The metadata presented by the xDS client should
  83. // contain all of the labels specified here.
  84. //
  85. // The selection is determined based on the best match. For
  86. // example, suppose there are three EndpointPolicy
  87. // resources P1, P2 and P3 and if P1 has a the matcher as
  88. // MATCH_ANY <A:1, B:1>, P2 has MATCH_ALL <A:1,B:1>, and P3 has
  89. // MATCH_ALL <A:1,B:1,C:1>.
  90. //
  91. // If a client with label <A:1> connects, the config from P1
  92. // will be selected.
  93. //
  94. // If a client with label <A:1,B:1> connects, the config from P2
  95. // will be selected.
  96. //
  97. // If a client with label <A:1,B:1,C:1> connects, the config
  98. // from P3 will be selected.
  99. //
  100. // If there is more than one best match, (for example, if a
  101. // config P4 with selector <A:1,D:1> exists and if a client with
  102. // label <A:1,B:1,D:1> connects), an error will be thrown.
  103. MetadataLabelMatchCriteria metadata_label_match_criteria = 1;
  104. // The list of label value pairs that must match labels in the
  105. // provided metadata based on filterMatchCriteria This list can
  106. // have at most 64 entries. The list can be empty if the match
  107. // criteria is MATCH_ANY, to specify a wildcard match (i.e this
  108. // matches any client).
  109. repeated MetadataLabels metadata_labels = 2;
  110. }
  111. // Specifies type of the matcher used for this endpoint matcher.
  112. oneof matcher_type {
  113. // The matcher is based on node metadata presented by xDS clients.
  114. MetadataLabelMatcher metadata_label_matcher = 1;
  115. }
  116. }