common.proto 5.7 KB

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