Skip to content

Commit

Permalink
feat: [servicedirectory] added network and uid fields in Endpoint mes…
Browse files Browse the repository at this point in the history
…sage (#4437)

* feat: added network and uid fields in Endpoint message
feat: added uid field to Namespace message
feat: added uid field to Service message
feat: enable Location methods
docs: updated docs for ResolveServiceRequest message
docs: updated docs for ListServicesRequest and ListEndpointsRequest message

PiperOrigin-RevId: 549683092

Source-Link: googleapis/googleapis@c661ee0

Source-Link: googleapis/googleapis-gen@e3c7b02
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlcnZpY2VkaXJlY3RvcnkvLk93bEJvdC55YW1sIiwiaCI6ImUzYzdiMDI5OGE1MzJhNzEwMWQyYWU4ZWMxZGMwYTBlMmNmYmIyYzUifQ==

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
sofisl and gcf-owl-bot[bot] authored Jul 24, 2023
1 parent 28b5dca commit 055fad6
Show file tree
Hide file tree
Showing 33 changed files with 2,517 additions and 683 deletions.
83 changes: 41 additions & 42 deletions packages/google-cloud-servicedirectory/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.servicedirectory.v1;
Expand All @@ -26,6 +27,10 @@ option java_outer_classname = "EndpointProto";
option java_package = "com.google.cloud.servicedirectory.v1";
option php_namespace = "Google\\Cloud\\ServiceDirectory\\V1";
option ruby_package = "Google::Cloud::ServiceDirectory::V1";
option (google.api.resource_definition) = {
type: "servicedirectory.googleapis.com/Network"
pattern: "projects/{project}/locations/global/networks/{network}"
};

// An individual endpoint that provides a
// [service][google.cloud.servicedirectory.v1.Service]. The service must
Expand All @@ -39,36 +44,59 @@ message Endpoint {
// Immutable. The resource name for the endpoint in the format
// `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
string name = 1 [(google.api.field_behavior) = IMMUTABLE];
// Optional. An IPv4 or IPv6 address. Service Directory will reject bad
// addresses like:
// "8.8.8"
// "8.8.8.8:53"
// "test:bad:address"
// "[::1]"
// "[::1]:8080"

// Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses
// like:
//
// * `8.8.8`
// * `8.8.8.8:53`
// * `test:bad:address`
// * `[::1]`
// * `[::1]:8080`
//
// Limited to 45 characters.
string address = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. Service Directory will reject values outside of [0, 65535].

// Optional. Service Directory rejects values outside of `[0, 65535]`.
int32 port = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. Annotations for the endpoint. This data can be consumed by
// service clients. Restrictions:
// - The entire annotations dictionary may contain up to 512 characters,
// spread accoss all key-value pairs. Annotations that goes beyond any
// these limits will be rejected.
// - Valid annotation keys have two segments: an optional prefix and name,
// separated by a slash (/). The name segment is required and must be 63
// characters or less, beginning and ending with an alphanumeric character
// ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
// alphanumerics between. The prefix is optional. If specified, the prefix
// must be a DNS subdomain: a series of DNS labels separated by dots (.),
// not longer than 253 characters in total, followed by a slash (/).
// Annotations that fails to meet these requirements will be rejected.
// - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
// for system annotations managed by Service Directory. If the user tries
// to write to these keyspaces, those entries will be silently ignored by
// the system.
// Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
// service clients.
//
// Restrictions:
//
// * The entire annotations dictionary may contain up to 512 characters,
// spread accoss all key-value pairs. Annotations that go beyond this
// limit are rejected
// * Valid annotation keys have two segments: an optional prefix and name,
// separated by a slash (/). The name segment is required and must be 63
// characters or less, beginning and ending with an alphanumeric character
// ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
// alphanumerics between. The prefix is optional. If specified, the prefix
// must be a DNS subdomain: a series of DNS labels separated by dots (.),
// not longer than 253 characters in total, followed by a slash (/)
// Annotations that fails to meet these requirements are rejected.
//
// Note: This field is equivalent to the `metadata` field in the v1beta1 API.
// They have the same syntax and read/write to the same location in Service
// Directory.
map<string, string> annotations = 5 [(google.api.field_behavior) = OPTIONAL];

// Immutable. The Google Compute Engine network (VPC) of the endpoint in the
// format `projects/<project number>/locations/global/networks/*`.
//
// The project must be specified by project number (project id is rejected).
// Incorrectly formatted networks are rejected, we also check to make sure
// that you have the servicedirectory.networks.attach permission on the
// project specified.
string network = 8 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.resource_reference) = {
type: "servicedirectory.googleapis.com/Network"
}
];

// Output only. The globally unique identifier of the endpoint in the UUID4
// format.
string uid = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -67,22 +67,40 @@ message ResolveServiceRequest {

// Optional. The filter applied to the endpoints of the resolved service.
//
// General filter string syntax:
// <field> <operator> <value> (<logical connector>)
// <field> can be "name" or "metadata.<key>" for map field.
// <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
// roughly the same as "=".
// <value> must be the same data type as the field.
// <logical connector> can be "AND, OR, NOT".
// General `filter` string syntax:
// `<field> <operator> <value> (<logical connector>)`
//
// * `<field>` can be `name`, `address`, `port`, or `annotations.<key>` for
// map field
// * `<operator>` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:`
// means `HAS`, and is roughly the same as `=`
// * `<value>` must be the same data type as field
// * `<logical connector>` can be `AND`, `OR`, `NOT`
//
// Examples of valid filters:
// * "metadata.owner" returns Endpoints that have a label with the
// key "owner", this is the same as "metadata:owner"
// * "metadata.protocol=gRPC" returns Endpoints that have key/value
// "protocol=gRPC"
// * "metadata.owner!=sd AND metadata.foo=bar" returns
// Endpoints that have "owner" field in metadata with a value that is not
// "sd" AND have the key/value foo=bar.
//
// * `annotations.owner` returns endpoints that have a annotation with the
// key `owner`, this is the same as `annotations:owner`
// * `annotations.protocol=gRPC` returns endpoints that have key/value
// `protocol=gRPC`
// * `address=192.108.1.105` returns endpoints that have this address
// * `port>8080` returns endpoints that have port number larger than 8080
// *
// `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c`
// returns endpoints that have name that is alphabetically later than the
// string, so "endpoint-e" is returned but "endpoint-a" is not
// *
// `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1`
// returns the endpoint that has an endpoint_id equal to `ep-1`
// * `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that
// have `owner` in annotation key but value is not `sd` AND have
// key/value `foo=bar`
// * `doesnotexist.foo=bar` returns an empty list. Note that endpoint
// doesn't have a field called "doesnotexist". Since the filter does not
// match any endpoint, it returns no results
//
// For more information about filtering, see
// [API Filtering](https://aip.dev/160).
string endpoint_filter = 3 [(google.api.field_behavior) = OPTIONAL];
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,8 +41,12 @@ message Namespace {
// `projects/*/locations/*/namespaces/*`.
string name = 1 [(google.api.field_behavior) = IMMUTABLE];

// Optional. Resource labels associated with this Namespace.
// No more than 64 user labels can be associated with a given resource. Label
// Optional. Resource labels associated with this namespace.
// No more than 64 user labels can be associated with a given resource. Label
// keys and values can be no longer than 63 characters.
map<string, string> labels = 2 [(google.api.field_behavior) = OPTIONAL];

// Output only. The globally unique identifier of the namespace in the UUID4
// format.
string uid = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
}
Loading

0 comments on commit 055fad6

Please sign in to comment.