Skip to content

Commit d69baf2

Browse files
Google APIscopybara-github
authored andcommitted
feat: Update Service Directory v1beta1 protos to include VPC Network field, and create/modify timestamp fields.
PiperOrigin-RevId: 381234166
1 parent 8b976f7 commit d69baf2

7 files changed

Lines changed: 305 additions & 127 deletions

File tree

google/cloud/servicedirectory/v1beta1/BUILD.bazel

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# This file was automatically generated by BuildFileGenerator
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
3+
4+
# Most of the manual changes to this file will be overwritten.
5+
# It's **only** allowed to change the following rule attribute values:
6+
# - names of *_gapic_assembly_* rules
7+
# - certain parameters of *_gapic_library rules, including but not limited to:
8+
# * extra_protoc_parameters
9+
# * extra_protoc_file_parameters
10+
# The complete list of preserved parameters can be found in the source code.
211

312
# This is an API workspace, having public visibility by default makes perfect sense.
413
package(default_visibility = ["//visibility:public"])
@@ -27,6 +36,7 @@ proto_library(
2736
"//google/iam/v1:policy_proto",
2837
"@com_google_protobuf//:empty_proto",
2938
"@com_google_protobuf//:field_mask_proto",
39+
"@com_google_protobuf//:timestamp_proto",
3040
],
3141
)
3242

@@ -122,6 +132,7 @@ go_gapic_library(
122132
srcs = [":servicedirectory_proto_with_info"],
123133
grpc_service_config = "servicedirectory_grpc_service_config.json",
124134
importpath = "cloud.google.com/go/servicedirectory/apiv1beta1;servicedirectory",
135+
metadata = True,
125136
service_yaml = "servicedirectory_v1beta1.yaml",
126137
deps = [
127138
":servicedirectory_go_proto",
@@ -141,6 +152,7 @@ go_gapic_assembly_pkg(
141152
name = "gapi-cloud-servicedirectory-v1beta1-go",
142153
deps = [
143154
":servicedirectory_go_gapic",
155+
":servicedirectory_go_gapic_srcjar-metadata.srcjar",
144156
":servicedirectory_go_gapic_srcjar-test.srcjar",
145157
":servicedirectory_go_proto",
146158
],
@@ -159,6 +171,7 @@ py_gapic_library(
159171
name = "servicedirectory_py_gapic",
160172
srcs = [":servicedirectory_proto"],
161173
grpc_service_config = "servicedirectory_grpc_service_config.json",
174+
opt_args = ["warehouse-package-name=google-cloud-service-directory"],
162175
)
163176

164177
# Open Source Packages
@@ -195,6 +208,7 @@ php_gapic_library(
195208
name = "servicedirectory_php_gapic",
196209
srcs = [":servicedirectory_proto_with_info"],
197210
grpc_service_config = "servicedirectory_grpc_service_config.json",
211+
service_yaml = "servicedirectory_v1beta1.yaml",
198212
deps = [
199213
":servicedirectory_php_grpc",
200214
":servicedirectory_php_proto",
@@ -266,11 +280,11 @@ ruby_cloud_gapic_library(
266280
name = "servicedirectory_ruby_gapic",
267281
srcs = [":servicedirectory_proto_with_info"],
268282
extra_protoc_parameters = [
269-
"ruby-cloud-gem-name=google-cloud-service_directory-v1beta1",
270-
"ruby-cloud-env-prefix=SERVICE_DIRECTORY",
271-
"ruby-cloud-product-url=https://cloud.google.com/service-directory",
272283
"ruby-cloud-api-id=servicedirectory.googleapis.com",
273284
"ruby-cloud-api-shortname=servicedirectory",
285+
"ruby-cloud-env-prefix=SERVICE_DIRECTORY",
286+
"ruby-cloud-gem-name=google-cloud-service_directory-v1beta1",
287+
"ruby-cloud-product-url=https://cloud.google.com/service-directory",
274288
],
275289
grpc_service_config = "servicedirectory_grpc_service_config.json",
276290
ruby_cloud_description = "Service directory is the single place to register, browse, and resolve application services.",
@@ -333,3 +347,8 @@ csharp_gapic_assembly_pkg(
333347
":servicedirectory_csharp_proto",
334348
],
335349
)
350+
351+
##############################################################################
352+
# C++
353+
##############################################################################
354+
# Put your C++ rules here

google/cloud/servicedirectory/v1beta1/endpoint.proto

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package google.cloud.servicedirectory.v1beta1;
1818

1919
import "google/api/field_behavior.proto";
2020
import "google/api/resource.proto";
21+
import "google/protobuf/timestamp.proto";
2122
import "google/api/annotations.proto";
2223

2324
option cc_enable_arenas = true;
@@ -28,6 +29,10 @@ option java_outer_classname = "EndpointProto";
2829
option java_package = "com.google.cloud.servicedirectory.v1beta1";
2930
option php_namespace = "Google\\Cloud\\ServiceDirectory\\V1beta1";
3031
option ruby_package = "Google::Cloud::ServiceDirectory::V1beta1";
32+
option (google.api.resource_definition) = {
33+
type: "servicedirectory.googleapis.com/Network"
34+
pattern: "projects/{project}/locations/global/networks/{network}"
35+
};
3136

3237
// An individual endpoint that provides a
3338
// [service][google.cloud.servicedirectory.v1beta1.Service]. The service must
@@ -39,25 +44,66 @@ message Endpoint {
3944
};
4045

4146
// Immutable. The resource name for the endpoint in the format
42-
// 'projects/*/locations/*/namespaces/*/services/*/endpoints/*'.
47+
// `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
4348
string name = 1 [(google.api.field_behavior) = IMMUTABLE];
4449

45-
// Optional. An IPv4 or IPv6 address. Service Directory will reject bad
46-
// addresses like:
47-
// "8.8.8"
48-
// "8.8.8.8:53"
49-
// "test:bad:address"
50-
// "[::1]"
51-
// "[::1]:8080"
50+
// Optional. An IPv4 or IPv6 address. Service Directory rejects bad addresses like:
51+
//
52+
// * `8.8.8`
53+
// * `8.8.8.8:53`
54+
// * `test:bad:address`
55+
// * `[::1]`
56+
// * `[::1]:8080`
57+
//
5258
// Limited to 45 characters.
5359
string address = 2 [(google.api.field_behavior) = OPTIONAL];
5460

55-
// Optional. Service Directory will reject values outside of [0, 65535].
61+
// Optional. Service Directory rejects values outside of `[0, 65535]`.
5662
int32 port = 3 [(google.api.field_behavior) = OPTIONAL];
5763

5864
// Optional. Metadata for the endpoint. This data can be consumed by service
59-
// clients. The entire metadata dictionary may contain up to 512 characters,
60-
// spread accoss all key-value pairs. Metadata that goes beyond any these
61-
// limits will be rejected.
65+
// clients.
66+
//
67+
// Restrictions:
68+
//
69+
// * The entire metadata dictionary may contain up to 512 characters,
70+
// spread accoss all key-value pairs. Metadata that goes beyond this
71+
// limit are rejected
72+
// * Valid metadata keys have two segments: an optional prefix and name,
73+
// separated by a slash (/). The name segment is required and must be 63
74+
// characters or less, beginning and ending with an alphanumeric character
75+
// ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
76+
// alphanumerics between. The prefix is optional. If specified, the prefix
77+
// must be a DNS subdomain: a series of DNS labels separated by dots (.),
78+
// not longer than 253 characters in total, followed by a slash (/).
79+
// Metadata that fails to meet these requirements are rejected
80+
// * The `(*.)google.com/` and `(*.)googleapis.com/` prefixes are reserved
81+
// for system metadata managed by Service Directory. If the user tries
82+
// to write to these keyspaces, those entries are silently ignored by
83+
// the system
84+
//
85+
// Note: This field is equivalent to the `annotations` field in the v1 API.
86+
// They have the same syntax and read/write to the same location in Service
87+
// Directory.
6288
map<string, string> metadata = 4 [(google.api.field_behavior) = OPTIONAL];
89+
90+
// Immutable. The Google Compute Engine network (VPC) of the endpoint in the format
91+
// `projects/<project number>/locations/global/networks/*`.
92+
//
93+
// The project must be specified by project number (project id is rejected).
94+
// Incorrectly formatted networks are rejected, but no other validation
95+
// is performed on this field (ex. network or project existence, reachability,
96+
// or permissions).
97+
string network = 5 [
98+
(google.api.field_behavior) = IMMUTABLE,
99+
(google.api.resource_reference) = {
100+
type: "servicedirectory.googleapis.com/Network"
101+
}
102+
];
103+
104+
// Output only. The timestamp when the endpoint was created.
105+
google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
106+
107+
// Output only. The timestamp when the endpoint was last updated.
108+
google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
63109
}

google/cloud/servicedirectory/v1beta1/lookup_service.proto

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -65,22 +65,37 @@ message ResolveServiceRequest {
6565

6666
// Optional. The filter applied to the endpoints of the resolved service.
6767
//
68-
// General filter string syntax:
69-
// <field> <operator> <value> (<logical connector>)
70-
// <field> can be "name" or "metadata.<key>" for map field.
71-
// <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
72-
// roughly the same as "=".
73-
// <value> must be the same data type as the field.
74-
// <logical connector> can be "AND, OR, NOT".
68+
// General `filter` string syntax:
69+
// `<field> <operator> <value> (<logical connector>)`
70+
//
71+
// * `<field>` can be `name`, `address`, `port`, or `metadata.<key>` for
72+
// map field
73+
// * `<operator>` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:`
74+
// means `HAS`, and is roughly the same as `=`
75+
// * `<value>` must be the same data type as field
76+
// * `<logical connector>` can be `AND`, `OR`, `NOT`
7577
//
7678
// Examples of valid filters:
77-
// * "metadata.owner" returns Endpoints that have a label with the
78-
// key "owner", this is the same as "metadata:owner"
79-
// * "metadata.protocol=gRPC" returns Endpoints that have key/value
80-
// "protocol=gRPC"
81-
// * "metadata.owner!=sd AND metadata.foo=bar" returns
82-
// Endpoints that have "owner" field in metadata with a value that is not
83-
// "sd" AND have the key/value foo=bar.
79+
//
80+
// * `metadata.owner` returns endpoints that have a annotation with the key
81+
// `owner`, this is the same as `metadata:owner`
82+
// * `metadata.protocol=gRPC` returns endpoints that have key/value
83+
// `protocol=gRPC`
84+
// * `address=192.108.1.105` returns endpoints that have this address
85+
// * `port>8080` returns endpoints that have port number larger than 8080
86+
// *
87+
// `name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c`
88+
// returns endpoints that have name that is alphabetically later than the
89+
// string, so "endpoint-e" is returned but "endpoint-a" is not
90+
// * `metadata.owner!=sd AND metadata.foo=bar` returns endpoints that have
91+
// `owner` in annotation key but value is not `sd` AND have key/value
92+
// `foo=bar`
93+
// * `doesnotexist.foo=bar` returns an empty list. Note that endpoint
94+
// doesn't have a field called "doesnotexist". Since the filter does not
95+
// match any endpoint, it returns no results
96+
//
97+
// For more information about filtering, see
98+
// [API Filtering](https://aip.dev/160).
8499
string endpoint_filter = 3 [(google.api.field_behavior) = OPTIONAL];
85100
}
86101

google/cloud/servicedirectory/v1beta1/namespace.proto

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package google.cloud.servicedirectory.v1beta1;
1818

1919
import "google/api/field_behavior.proto";
2020
import "google/api/resource.proto";
21+
import "google/protobuf/timestamp.proto";
2122
import "google/api/annotations.proto";
2223

2324
option cc_enable_arenas = true;
@@ -39,11 +40,17 @@ message Namespace {
3940
};
4041

4142
// Immutable. The resource name for the namespace in the format
42-
// 'projects/*/locations/*/namespaces/*'.
43+
// `projects/*/locations/*/namespaces/*`.
4344
string name = 1 [(google.api.field_behavior) = IMMUTABLE];
4445

45-
// Optional. Resource labels associated with this Namespace.
46-
// No more than 64 user labels can be associated with a given resource. Label
46+
// Optional. Resource labels associated with this namespace.
47+
// No more than 64 user labels can be associated with a given resource. Label
4748
// keys and values can be no longer than 63 characters.
4849
map<string, string> labels = 2 [(google.api.field_behavior) = OPTIONAL];
50+
51+
// Output only. The timestamp when the namespace was created.
52+
google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
53+
54+
// Output only. The timestamp when the namespace was last updated.
55+
google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
4956
}

0 commit comments

Comments
 (0)