From c238cc5c87274d7fc4f2f30bf6ffd26d51ce6b24 Mon Sep 17 00:00:00 2001 From: Mahina Kaholokula Date: Thu, 2 Apr 2020 06:57:39 -0400 Subject: [PATCH 01/13] Add code snippets for Service Directory. Initially reviewed in pull request: github.com/GoogleCloudPlatform/java-docs-samples/pull/2538 These are expected to be added to go on our docs site page: cloud.google.com/service-directory/docs/configuring-service-directory --- samples/snippets/README.md | 45 ++++++ samples/snippets/pom.xml | 15 +- .../servicedirectory/EndpointsCreate.java | 67 +++++++++ .../servicedirectory/EndpointsDelete.java | 58 ++++++++ .../servicedirectory/NamespacesCreate.java | 58 ++++++++ .../servicedirectory/NamespacesDelete.java | 54 ++++++++ .../servicedirectory/ServicesCreate.java | 60 ++++++++ .../servicedirectory/ServicesDelete.java | 56 ++++++++ .../servicedirectory/ServicesResolve.java | 68 +++++++++ .../servicedirectory/EndpointsTests.java | 114 ++++++++++++++++ .../servicedirectory/NamespacesTests.java | 104 ++++++++++++++ .../servicedirectory/ServicesTests.java | 129 ++++++++++++++++++ 12 files changed, 827 insertions(+), 1 deletion(-) create mode 100644 samples/snippets/README.md create mode 100644 samples/snippets/src/main/java/com/example/servicedirectory/EndpointsCreate.java create mode 100644 samples/snippets/src/main/java/com/example/servicedirectory/EndpointsDelete.java create mode 100644 samples/snippets/src/main/java/com/example/servicedirectory/NamespacesCreate.java create mode 100644 samples/snippets/src/main/java/com/example/servicedirectory/NamespacesDelete.java create mode 100644 samples/snippets/src/main/java/com/example/servicedirectory/ServicesCreate.java create mode 100644 samples/snippets/src/main/java/com/example/servicedirectory/ServicesDelete.java create mode 100644 samples/snippets/src/main/java/com/example/servicedirectory/ServicesResolve.java create mode 100644 samples/snippets/src/test/java/com/example/servicedirectory/EndpointsTests.java create mode 100644 samples/snippets/src/test/java/com/example/servicedirectory/NamespacesTests.java create mode 100644 samples/snippets/src/test/java/com/example/servicedirectory/ServicesTests.java diff --git a/samples/snippets/README.md b/samples/snippets/README.md new file mode 100644 index 00000000..eb240b53 --- /dev/null +++ b/samples/snippets/README.md @@ -0,0 +1,45 @@ +# Service Directory + +[Service Directory](https://cloud.google.com/service-directory/) is a platform +for discovering, publishing, and connecting services. It offers customers a +single place to register and discover their services in a consistent and +reliable way, regardless of their environment. These sample Java applications +demonstrate how to access the Service Directory API using the Google Java API +Client Libraries. + +## Prerequisites + +### Enable the API + +You must enable the Service Directory API for your project in order to use these +samples. You can do so +[here](https://console.cloud.google.com/flows/enableapi?apiid=servicedirectory.googleapis.com&_ga=2.140387959.57242806.1585772225-360187285.1585772225). + +### Set Environment Variables + +You must set your project ID in order to run the tests + +`$ export GOOGLE_CLOUD_PROJECT=` + +### Grant Permissions + +You must ensure that the +[user account or service account](https://cloud.google.com/iam/docs/service-accounts#differences_between_a_service_account_and_a_user_account) +you used to authorize your gcloud session has the proper permissions to edit KMS +resources for your project. In the Cloud Console under IAM, add the `Service +Directory Admin` role to the project whose service account you're using to test. + +More information can be found in the +[Authentication docs](https://cloud.google.com/docs/authentication/production). + +## Quickstart + +Install [Maven](https://maven.apache.org/). + +Build your project with: + + mvn clean package -DskipTests + +You can run all tests with: + + mvn clean verify diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b28d5ed4..0fc2b0d0 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -1,4 +1,16 @@ + 4.0.0 com.google.cloud @@ -30,7 +42,7 @@ com.google.cloud libraries-bom - 4.3.0 + 4.4.0 pom import @@ -57,4 +69,5 @@ test + diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsCreate.java b/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsCreate.java new file mode 100644 index 00000000..6cf5dced --- /dev/null +++ b/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsCreate.java @@ -0,0 +1,67 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +package com.example.servicedirectory; + +// [START servicedirectory_create_endpoint] + +import com.google.cloud.servicedirectory.v1beta1.Endpoint; +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient; +import com.google.cloud.servicedirectory.v1beta1.ServiceName; +import java.io.IOException; + +public class EndpointsCreate { + + public static void createEndpoint() throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "your-project-id"; + String locationId = "your-region"; + String namespaceId = "your-namespace"; + String serviceId = "your-service"; + String endpointId = "your-endpoint"; + createEndpoint(projectId, locationId, namespaceId, serviceId, endpointId); + } + + // Create a new endpoint. + public static void createEndpoint( + String projectId, String locationId, String namespaceId, String serviceId, String endpointId) + throws IOException { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (RegistrationServiceClient client = RegistrationServiceClient.create()) { + + // The service to create the endpoint in. + ServiceName parent = ServiceName.of(projectId, locationId, namespaceId, serviceId); + + // Optionally set an IP address and port for the endpoint. + String address = "10.0.0.1"; + int port = 443; + + // The endpoint to create, with fields filled in. + Endpoint endpoint = Endpoint.newBuilder().setAddress(address).setPort(port).build(); + + // Send the request to create the endpoint. + Endpoint createdEndpoint = client.createEndpoint(parent, endpoint, endpointId); + + // Process the response. + System.out.println("Created Endpoint: " + createdEndpoint.getName()); + System.out.println("IP Address: " + createdEndpoint.getAddress()); + System.out.println("Port: " + createdEndpoint.getPort()); + } + } +} +// [END servicedirectory_create_endpoint] diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsDelete.java b/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsDelete.java new file mode 100644 index 00000000..bf18a9e8 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsDelete.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +package com.example.servicedirectory; + +// [START servicedirectory_delete_endpoint] + +import com.google.cloud.servicedirectory.v1beta1.EndpointName; +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient; +import java.io.IOException; + +public class EndpointsDelete { + + public static void deleteEndpoint() throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "your-project-id"; + String locationId = "your-region"; + String namespaceId = "your-namespace"; + String serviceId = "your-service"; + String endpointId = "your-endpoint"; + deleteEndpoint(projectId, locationId, namespaceId, serviceId, endpointId); + } + + // Delete an endpoint. + public static void deleteEndpoint( + String projectId, String locationId, String namespaceId, String serviceId, String endpointId) + throws IOException { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (RegistrationServiceClient client = RegistrationServiceClient.create()) { + + // The endpoint to delete. + EndpointName endpointName = + EndpointName.of(projectId, locationId, namespaceId, serviceId, endpointId); + + // Send the request to delete the endpoint. + client.deleteEndpoint(endpointName); + + // Log the action. + System.out.println("Deleted Endpoint: " + endpointName.toString()); + } + } +} +// [END servicedirectory_delete_endpoint] diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesCreate.java b/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesCreate.java new file mode 100644 index 00000000..2b797a2d --- /dev/null +++ b/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesCreate.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +package com.example.servicedirectory; + +// [START servicedirectory_create_namespace] + +import com.google.cloud.servicedirectory.v1beta1.LocationName; +import com.google.cloud.servicedirectory.v1beta1.Namespace; +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient; +import java.io.IOException; + +public class NamespacesCreate { + + public static void createNamespace() throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "your-project-id"; + String locationId = "your-region"; + String namespaceId = "your-namespace"; + createNamespace(projectId, locationId, namespaceId); + } + + // Create a new namespace. + public static void createNamespace(String projectId, String locationId, String namespaceId) + throws IOException { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (RegistrationServiceClient client = RegistrationServiceClient.create()) { + + // The project and location to create the namespace in. + LocationName parent = LocationName.of(projectId, locationId); + + // The namespace object to create. Here, we use the default instance. + Namespace namespace = Namespace.newBuilder().build(); + + // Send the request to create the namespace. + Namespace createdNamespace = client.createNamespace(parent, namespace, namespaceId); + + // Process the response. + System.out.println("Created Namespace: " + createdNamespace.getName()); + } + } +} +// [END servicedirectory_create_namespace] diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesDelete.java b/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesDelete.java new file mode 100644 index 00000000..323c8e38 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesDelete.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +package com.example.servicedirectory; + +// [START servicedirectory_delete_namespace] + +import com.google.cloud.servicedirectory.v1beta1.NamespaceName; +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient; +import java.io.IOException; + +public class NamespacesDelete { + + public static void deleteNamespace() throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "your-project-id"; + String locationId = "your-region"; + String namespaceId = "your-namespace"; + deleteNamespace(projectId, locationId, namespaceId); + } + + // Delete a namespace. + public static void deleteNamespace(String projectId, String locationId, String namespaceId) + throws IOException { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (RegistrationServiceClient client = RegistrationServiceClient.create()) { + + // The namespace to delete. + NamespaceName namespaceName = NamespaceName.of(projectId, locationId, namespaceId); + + // Send the request to delete the namespace. + client.deleteNamespace(namespaceName); + + // Log the action. + System.out.println("Deleted Namespace: " + namespaceName.toString()); + } + } +} +// [END servicedirectory_delete_namespace] diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/ServicesCreate.java b/samples/snippets/src/main/java/com/example/servicedirectory/ServicesCreate.java new file mode 100644 index 00000000..3c9d0873 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/servicedirectory/ServicesCreate.java @@ -0,0 +1,60 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +package com.example.servicedirectory; + +// [START servicedirectory_create_service] + +import com.google.cloud.servicedirectory.v1beta1.NamespaceName; +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient; +import com.google.cloud.servicedirectory.v1beta1.Service; +import java.io.IOException; + +public class ServicesCreate { + + public static void createService() throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "your-project-id"; + String locationId = "your-region"; + String namespaceId = "your-namespace"; + String serviceId = "your-service"; + createService(projectId, locationId, namespaceId, serviceId); + } + + // Create a new service. + public static void createService( + String projectId, String locationId, String namespaceId, String serviceId) + throws IOException { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (RegistrationServiceClient client = RegistrationServiceClient.create()) { + + // The namespace to create the service in. + NamespaceName parent = NamespaceName.of(projectId, locationId, namespaceId); + + // The service object to create. Here, we use the default instance. + Service service = Service.newBuilder().build(); + + // Send the request to create the namespace. + Service createdService = client.createService(parent, service, serviceId); + + // Process the response. + System.out.println("Created Service: " + createdService.getName()); + } + } +} +// [END servicedirectory_create_service] diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/ServicesDelete.java b/samples/snippets/src/main/java/com/example/servicedirectory/ServicesDelete.java new file mode 100644 index 00000000..fde04c4a --- /dev/null +++ b/samples/snippets/src/main/java/com/example/servicedirectory/ServicesDelete.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +package com.example.servicedirectory; + +// [START servicedirectory_delete_service] + +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient; +import com.google.cloud.servicedirectory.v1beta1.ServiceName; +import java.io.IOException; + +public class ServicesDelete { + + public static void deleteService() throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "your-project-id"; + String locationId = "your-region"; + String namespaceId = "your-namespace"; + String serviceId = "your-service"; + deleteService(projectId, locationId, namespaceId, serviceId); + } + + // Delete a service. + public static void deleteService( + String projectId, String locationId, String namespaceId, String serviceId) + throws IOException { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (RegistrationServiceClient client = RegistrationServiceClient.create()) { + + // The service to delete. + ServiceName serviceName = ServiceName.of(projectId, locationId, namespaceId, serviceId); + + // Send the request to delete the service. + client.deleteService(serviceName); + + // Log the action. + System.out.println("Deleted Service: " + serviceName.toString()); + } + } +} +// [END servicedirectory_delete_service] diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/ServicesResolve.java b/samples/snippets/src/main/java/com/example/servicedirectory/ServicesResolve.java new file mode 100644 index 00000000..dbeeb0b7 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/servicedirectory/ServicesResolve.java @@ -0,0 +1,68 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +package com.example.servicedirectory; + +// [START servicedirectory_resolve_service] + +import com.google.cloud.servicedirectory.v1beta1.Endpoint; +import com.google.cloud.servicedirectory.v1beta1.LookupServiceClient; +import com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse; +import com.google.cloud.servicedirectory.v1beta1.ServiceName; +import java.io.IOException; + +public class ServicesResolve { + + public static void resolveService() throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "your-project-id"; + String locationId = "your-region"; + String namespaceId = "your-namespace"; + String serviceId = "your-service"; + resolveService(projectId, locationId, namespaceId, serviceId); + } + + // Resolve a service. + public static void resolveService( + String projectId, String locationId, String namespaceId, String serviceId) + throws IOException { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. After completing all of your requests, call + // the "close" method on the client to safely clean up any remaining background resources. + try (LookupServiceClient client = LookupServiceClient.create()) { + // The service to resolve. + ServiceName name = ServiceName.of(projectId, locationId, namespaceId, serviceId); + + // Construct the resolve request to be sent to the client. + ResolveServiceRequest request = + ResolveServiceRequest.newBuilder().setName(name.toString()).build(); + + // Send the request to resolve the service. + ResolveServiceResponse resolveResponse = client.resolveService(request); + + // Process the response. + System.out.println("Resolved Service: " + resolveResponse.getService().getName()); + + System.out.println("Endpoints found:"); + for (Endpoint endpoint : resolveResponse.getService().getEndpointsList()) { + System.out.println( + endpoint.getName() + " -- " + endpoint.getAddress() + ":" + endpoint.getPort()); + } + } + } +} +// [END servicedirectory_resolve_service] diff --git a/samples/snippets/src/test/java/com/example/servicedirectory/EndpointsTests.java b/samples/snippets/src/test/java/com/example/servicedirectory/EndpointsTests.java new file mode 100644 index 00000000..e8aaf7a3 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/servicedirectory/EndpointsTests.java @@ -0,0 +1,114 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +package com.example.servicedirectory; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThat; + +import com.google.cloud.servicedirectory.v1beta1.EndpointName; +import com.google.cloud.servicedirectory.v1beta1.LocationName; +import com.google.cloud.servicedirectory.v1beta1.Namespace; +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient; +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListNamespacesPagedResponse; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.UUID; +import org.hamcrest.CoreMatchers; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class EndpointsTests { + + private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static final String LOCATION_ID = "us-central1"; + private static final String NAMESPACE_ID = "namespace-" + UUID.randomUUID().toString(); + private static final String SERVICE_ID = "service-" + UUID.randomUUID().toString(); + private static final String ENDPOINT_ID = "endpoint-" + UUID.randomUUID().toString(); + + private ByteArrayOutputStream bout; + + private static void requireEnvVar(String varName) { + assertNotNull( + String.format("Environment variable '%s' must be set to perform these tests.", varName), + System.getenv(varName)); + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("GOOGLE_APPLICATION_CREDENTIALS"); + requireEnvVar("GOOGLE_CLOUD_PROJECT"); + } + + @Before + public void setUp() throws Exception { + bout = new ByteArrayOutputStream(); + System.setOut(new PrintStream(bout)); + + // Setup: create a namespace for the endpoints to live in. + NamespacesCreate.createNamespace(PROJECT_ID, LOCATION_ID, NAMESPACE_ID); + + // Setup: create a service for the endpoints to live in. + ServicesCreate.createService(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID); + } + + @After + public void tearDown() throws Exception { + System.setOut(null); + bout.reset(); + + // Deletes all resources created during these tests. + try (RegistrationServiceClient client = RegistrationServiceClient.create()) { + // List the namespaces. + String locationPath = LocationName.format(PROJECT_ID, LOCATION_ID); + ListNamespacesPagedResponse response = client.listNamespaces(locationPath); + + // Delete each namespace. + for (Namespace namespace : response.iterateAll()) { + client.deleteNamespace(namespace.getName()); + } + } + } + + @Test + public void testCreateEndpoint() throws Exception { + EndpointsCreate.createEndpoint(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID, ENDPOINT_ID); + String endpointName = + EndpointName.format(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID, ENDPOINT_ID); + String output = bout.toString(); + assertThat( + output, CoreMatchers.containsString(String.format("Created Endpoint: %s", endpointName))); + } + + @Test + public void testDeleteService() throws Exception { + // Setup: create an endpoint. + EndpointsCreate.createEndpoint(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID, ENDPOINT_ID); + String endpointName = + EndpointName.format(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID, ENDPOINT_ID); + + // Delete the endpoint with the specified ID. + EndpointsDelete.deleteEndpoint(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID, ENDPOINT_ID); + String output = bout.toString(); + assertThat( + output, CoreMatchers.containsString(String.format("Deleted Endpoint: %s", endpointName))); + } +} diff --git a/samples/snippets/src/test/java/com/example/servicedirectory/NamespacesTests.java b/samples/snippets/src/test/java/com/example/servicedirectory/NamespacesTests.java new file mode 100644 index 00000000..b57beb14 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/servicedirectory/NamespacesTests.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +package com.example.servicedirectory; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThat; + +import com.google.cloud.servicedirectory.v1beta1.LocationName; +import com.google.cloud.servicedirectory.v1beta1.Namespace; +import com.google.cloud.servicedirectory.v1beta1.NamespaceName; +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient; +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListNamespacesPagedResponse; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.UUID; +import org.hamcrest.CoreMatchers; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class NamespacesTests { + + private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static final String LOCATION_ID = "us-central1"; + private static final String NAMESPACE_ID = "namespace-" + UUID.randomUUID().toString(); + + private ByteArrayOutputStream bout; + + private static void requireEnvVar(String varName) { + assertNotNull( + String.format("Environment variable '%s' must be set to perform these tests.", varName), + System.getenv(varName)); + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("GOOGLE_APPLICATION_CREDENTIALS"); + requireEnvVar("GOOGLE_CLOUD_PROJECT"); + } + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + System.setOut(new PrintStream(bout)); + } + + @After + public void tearDown() throws Exception { + System.setOut(null); + bout.reset(); + + // Deletes any namespaces created during these tests. + try (RegistrationServiceClient client = RegistrationServiceClient.create()) { + // List the namespaces. + String locationPath = LocationName.format(PROJECT_ID, LOCATION_ID); + ListNamespacesPagedResponse response = client.listNamespaces(locationPath); + + // Delete each namespace. + for (Namespace ns : response.iterateAll()) { + client.deleteNamespace(ns.getName()); + } + } + } + + @Test + public void testCreateNamespace() throws Exception { + NamespacesCreate.createNamespace(PROJECT_ID, LOCATION_ID, NAMESPACE_ID); + String namespaceName = NamespaceName.format(PROJECT_ID, LOCATION_ID, NAMESPACE_ID); + String output = bout.toString(); + assertThat( + output, CoreMatchers.containsString(String.format("Created Namespace: %s", namespaceName))); + } + + @Test + public void testDeleteNamespace() throws Exception { + // Setup: create a namespace. + NamespacesCreate.createNamespace(PROJECT_ID, LOCATION_ID, NAMESPACE_ID); + String namespaceName = NamespaceName.format(PROJECT_ID, LOCATION_ID, NAMESPACE_ID); + + // Delete the namespace with the specified ID. + NamespacesDelete.deleteNamespace(PROJECT_ID, LOCATION_ID, NAMESPACE_ID); + String output = bout.toString(); + assertThat( + output, CoreMatchers.containsString(String.format("Deleted Namespace: %s", namespaceName))); + } +} diff --git a/samples/snippets/src/test/java/com/example/servicedirectory/ServicesTests.java b/samples/snippets/src/test/java/com/example/servicedirectory/ServicesTests.java new file mode 100644 index 00000000..d44c1f12 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/servicedirectory/ServicesTests.java @@ -0,0 +1,129 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ + +package com.example.servicedirectory; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThat; + +import com.google.cloud.servicedirectory.v1beta1.EndpointName; +import com.google.cloud.servicedirectory.v1beta1.LocationName; +import com.google.cloud.servicedirectory.v1beta1.Namespace; +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient; +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListNamespacesPagedResponse; +import com.google.cloud.servicedirectory.v1beta1.ServiceName; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.UUID; +import org.hamcrest.CoreMatchers; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class ServicesTests { + + private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static final String LOCATION_ID = "us-central1"; + private static final String NAMESPACE_ID = "namespace-" + UUID.randomUUID().toString(); + private static final String SERVICE_ID = "service-" + UUID.randomUUID().toString(); + + private ByteArrayOutputStream bout; + + private static void requireEnvVar(String varName) { + assertNotNull( + String.format("Environment variable '%s' must be set to perform these tests.", varName), + System.getenv(varName)); + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("GOOGLE_APPLICATION_CREDENTIALS"); + requireEnvVar("GOOGLE_CLOUD_PROJECT"); + } + + @Before + public void setUp() throws Exception { + bout = new ByteArrayOutputStream(); + System.setOut(new PrintStream(bout)); + + // Setup: create a namespace for the services to live in. + NamespacesCreate.createNamespace(PROJECT_ID, LOCATION_ID, NAMESPACE_ID); + } + + @After + public void tearDown() throws Exception { + System.setOut(null); + bout.reset(); + + // Deletes all resources created during these tests. + try (RegistrationServiceClient client = RegistrationServiceClient.create()) { + // List the namespaces. + String locationPath = LocationName.format(PROJECT_ID, LOCATION_ID); + ListNamespacesPagedResponse response = client.listNamespaces(locationPath); + + // Delete each namespace. + for (Namespace namespace : response.iterateAll()) { + client.deleteNamespace(namespace.getName()); + } + } + } + + @Test + public void testCreateService() throws Exception { + ServicesCreate.createService(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID); + String serviceName = ServiceName.format(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID); + String output = bout.toString(); + assertThat( + output, CoreMatchers.containsString(String.format("Created Service: %s", serviceName))); + } + + @Test + public void testResolveService() throws Exception { + // Setup: create a service. + ServicesCreate.createService(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID); + String serviceName = ServiceName.format(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID); + // Setup: Create an endpoint in the service. + EndpointsCreate.createEndpoint( + PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID, "default-endpoint"); + String endpointName = + EndpointName.format(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID, "default-endpoint"); + + // Resolve the service with the specified ID. + ServicesResolve.resolveService(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID); + String output = bout.toString(); + assertThat( + output, CoreMatchers.containsString(String.format("Resolved Service: %s", serviceName))); + assertThat( + output, CoreMatchers.containsString(String.format("Endpoints found:\n%s", endpointName))); + } + + @Test + public void testDeleteService() throws Exception { + // Setup: create a service. + ServicesCreate.createService(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID); + String serviceName = ServiceName.format(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID); + + // Delete the service with the specified ID. + ServicesDelete.deleteService(PROJECT_ID, LOCATION_ID, NAMESPACE_ID, SERVICE_ID); + String output = bout.toString(); + assertThat( + output, CoreMatchers.containsString(String.format("Deleted Service: %s", serviceName))); + } +} From 98d371f2c9cdd8d0846b31283fe1a0454403a9fb Mon Sep 17 00:00:00 2001 From: Mahina Kaholokula Date: Fri, 3 Apr 2020 08:23:21 -0400 Subject: [PATCH 02/13] inline some stuff in EndpointsCreate snippet. --- .../java/com/example/servicedirectory/EndpointsCreate.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsCreate.java b/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsCreate.java index 6cf5dced..3db485e9 100644 --- a/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsCreate.java +++ b/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsCreate.java @@ -47,12 +47,9 @@ public static void createEndpoint( // The service to create the endpoint in. ServiceName parent = ServiceName.of(projectId, locationId, namespaceId, serviceId); - // Optionally set an IP address and port for the endpoint. - String address = "10.0.0.1"; - int port = 443; - // The endpoint to create, with fields filled in. - Endpoint endpoint = Endpoint.newBuilder().setAddress(address).setPort(port).build(); + // Optionally set an IP address and port for the endpoint. + Endpoint endpoint = Endpoint.newBuilder().setAddress("10.0.0.1").setPort(443).build(); // Send the request to create the endpoint. Endpoint createdEndpoint = client.createEndpoint(parent, endpoint, endpointId); From 207ed6b891f1950943f110d3ee1d95fb8f1be5da Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 2 Apr 2020 12:26:11 -0700 Subject: [PATCH 03/13] chore: update libraries-bom to 4.4.0 (#26) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/46cdbcfa-1e99-4e4f-be05-90f447630a24/targets --- README.md | 2 +- synth.metadata | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 19ba01d8..0f924f1c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 4.3.0 + 4.4.0 pom import diff --git a/synth.metadata b/synth.metadata index 4d1bfad9..bb17cc09 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,21 +1,19 @@ { - "updateTime": "2020-03-25T18:39:26.190680Z", + "updateTime": "2020-04-02T00:16:04.494828Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", "sha": "fd83ab212176a1042e8d45ea90766b3bf59ac679", - "internalRef": "302913609", - "log": "fd83ab212176a1042e8d45ea90766b3bf59ac679\nfix: migrate osconfig/agentendpoint/v1 go_gapic_library target to microgen impl\n\nPiperOrigin-RevId: 302913609\n\n0e07113e776bdd8fcc0783372e08bb6e76cb1b5b\ndocs: Update documentation with links to smart home developer guides and reference pages. Remove outdated authorization instructions.\n\nPiperOrigin-RevId: 302892245\n\n" + "internalRef": "302913609" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e36822bfa0acb355502dab391b8ef9c4f30208d8", - "log": "e36822bfa0acb355502dab391b8ef9c4f30208d8\nchore(java): treat samples shared configuration dependency update as chore (#457)\n\n\n1b4cc80a7aaf164f6241937dd87f3bd1f4149e0c\nfix: do not run node 8 CI (#456)\n\n\n" + "sha": "e36822bfa0acb355502dab391b8ef9c4f30208d8" } } ], From 6fdee70495334cc106d65aadc8d0c1f4f2f4dda7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 6 Apr 2020 17:50:59 +0200 Subject: [PATCH 04/13] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.15 (#29) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud.samples:shared-configuration](https://togithub.com/GoogleCloudPlatform/java-repo-tools) | patch | `1.0.14` -> `1.0.15` | --- ### Release Notes
GoogleCloudPlatform/java-repo-tools ### [`v1.0.15`](https://togithub.com/GoogleCloudPlatform/java-repo-tools/releases/v1.0.15) [Compare Source](https://togithub.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.14...v1.0.15) - Move some stuff around (in prep for a change to release process) pom.xml's - Add an exclude filter for SpotBugs. (disable the Java 11 surprise) - Don't fail on SpotBugs issues for now - add PMD reporting - Don't fail on PMD issues for now.
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/java-servicedirectory). --- samples/install-without-bom/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index cfd53b9d..cae1e166 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.14 + 1.0.15 diff --git a/samples/pom.xml b/samples/pom.xml index cb2e8e32..beb5f94e 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -18,7 +18,7 @@ com.google.cloud.samples shared-configuration - 1.0.14 + 1.0.15 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 37aa9d59..3edb3cda 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.14 + 1.0.15 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0fc2b0d0..123f7662 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -26,7 +26,7 @@ com.google.cloud.samples shared-configuration - 1.0.14 + 1.0.15 From 34007b006b38fd9023fc9299ed63677f501f2378 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 6 Apr 2020 18:37:12 +0200 Subject: [PATCH 05/13] deps: update dependency org.threeten:threetenbp to v1.4.3 (#14) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [org.threeten:threetenbp](https://www.threeten.org/threetenbp) ([source](https://togithub.com/ThreeTen/threetenbp)) | patch | `1.4.1` -> `1.4.3` | --- ### Release Notes
ThreeTen/threetenbp ### [`v1.4.3`](https://togithub.com/ThreeTen/threetenbp/releases/v1.4.3) [Compare Source](https://togithub.com/ThreeTen/threetenbp/compare/v1.4.2...v1.4.3) See the [change notes](https://www.threeten.org/threetenbp/changes-report.html) for more information. ### [`v1.4.2`](https://togithub.com/ThreeTen/threetenbp/releases/v1.4.2) [Compare Source](https://togithub.com/ThreeTen/threetenbp/compare/v1.4.1...v1.4.2) See the [change notes](https://www.threeten.org/threetenbp/changes-report.html) for more information.
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/java-servicedirectory). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 55ac204d..8c75be09 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 3.11.4 4.13 28.2-android - 1.4.1 + 1.4.3 1.3.2 1.18 0.13.0 From 21c8e5a82dd21216395dbc49690ef7eb19a41ec0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 6 Apr 2020 19:59:54 +0200 Subject: [PATCH 06/13] chore(deps): update dependency com.google.cloud:libraries-bom to v4.4.1 (#30) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | patch | `4.4.0` -> `4.4.1` | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/java-servicedirectory). --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 123f7662..eaf26f78 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -42,7 +42,7 @@ com.google.cloud libraries-bom - 4.4.0 + 4.4.1 pom import From 46ce0fc47989263504fe2315b8943ed908c03fd0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Apr 2020 00:57:03 +0200 Subject: [PATCH 07/13] deps: update core dependencies (#1) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [io.grpc:grpc-bom](https://togithub.com/grpc/grpc-java) | minor | `1.27.2` -> `1.28.1` | | [com.google.api:gax-grpc](https://togithub.com/googleapis/gax-java) | minor | `1.54.0` -> `1.56.0` | | [com.google.api:gax-bom](https://togithub.com/googleapis/gax-java) | minor | `1.54.0` -> `1.56.0` | --- ### Release Notes
grpc/grpc-java ### [`v1.28.1`](https://togithub.com/grpc/grpc-java/releases/v1.28.1) [Compare Source](https://togithub.com/grpc/grpc-java/compare/v1.28.0...v1.28.1) #### Bug Fixes - xds: implement more clear specifications for locality filtering (allow localities with 0 endpoint, ignore localities with 0 weight, check for locality priority continuity). ([#​6875](https://togithub.com/grpc/grpc-java/issues/6875)) ### [`v1.28.0`](https://togithub.com/grpc/grpc-java/releases/v1.28.0) [Compare Source](https://togithub.com/grpc/grpc-java/compare/v1.27.2...v1.28.0) #### gRPC Java 1.28.0 Release Notes #### API Changes - core: service config parsing now validates the final config object via `LoadBalancerProvider#parseLoadBalancingPolicyConfig`. LoadBalancer developers should use parsed config(`loadBalancingPolicyConfig`) in `ResolvedAddresses` instead of deprecated attribute `io.grpc.LoadBalancer.ATTR_LOAD_BALANCING_CONFIG`. - core: remove stickiness from round robin ([#​6698](https://togithub.com/grpc/grpc-java/issues/6698)) #### Behavioral Changes - core, grpclb: change policy selection strategy for Grpclb policy (take one: eliminate special logic for deciding grpclb policy in core) ([#​6637](https://togithub.com/grpc/grpc-java/issues/6637)) - gRPCLB policy selection is being stabilized according to [this gRFC](https://togithub.com/grpc/proposal/blob/master/A26-grpclb-selection.md). gRPCLB policy will not be automatically selected even if there are SRV addresses resolved. You need to explicitly specify the selection by service config (in TXT records, or via `ManagedChannelBuilder#defaultServiceConfig` or `ManagedChannelBuilder#defaultLoadBalancingPolicy`). #### New Features - This release adds an experimental client side implementation of [xDSv2](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api) APIs. This allows a gRPC client written in Java to receive configuration from an xDSv2 API compatible server and use that configuration to load balance RPCs. In this release, only the virtual host matching and cluster route action is supported. More features will be added in future. #### Bug Fixes - netty: fix a deadlock on start gRPC server ([#​6601](https://togithub.com/grpc/grpc-java/issues/6601)) - netty: negotiated application level protocol is now checked against the correct ALPN list in the SslContext settings - okhttp: fix incorrect connection-level flow control handling at beginning of connection. - alts: Fix using the wrong way of checking if Conscrypt is available ([#​6672](https://togithub.com/grpc/grpc-java/issues/6672)) - grpclb: grpclb can handle empty address from LoadBalancer instead of throwing exception - alts: do not exclude opencensus-api from google-oauth2's transitive dependencies ([#​6607](https://togithub.com/grpc/grpc-java/issues/6607)) - grpc-alts was broken since 1.27.0 release for missing opencensus-api used in google-oauth2. This was due to opencensus-api dependency was eliminated from grpc-core. Now it should be included. #### Documentation - stub,examples: Clarify CallStreamObserver's Javadoc ([#​6561](https://togithub.com/grpc/grpc-java/issues/6561)) #### Dependencies - Bump Netty to 4.1.45.Final and tcnative to 2.0.28.Final - Bump okhttp to 2.7.4 - Bump google-auth-library-credentials and google-auth-library-oauth2-http to 0.20.0 #### Acknowledgements [@​chrisschek](https://togithub.com/chrisschek) [@​cushon](https://togithub.com/cushon) Liam Miller-Cushon [@​elharo](https://togithub.com/elharo) Elliotte Rusty Harold [@​gfelbing](https://togithub.com/gfelbing) Georg Welzel [@​hatahet](https://togithub.com/hatahet) Ziad Hatahet [@​leventov](https://togithub.com/leventov) Roman Leventov [@​sourabhsparkala](https://togithub.com/sourabhsparkala) Sourabh Sarvotham Parkala [@​ZhenLian](https://togithub.com/ZhenLian) Zhen Lian
googleapis/gax-java ### [`v1.56.0`](https://togithub.com/googleapis/gax-java/releases/v1.56.0) [Compare Source](https://togithub.com/googleapis/gax-java/compare/v1.55.0...v1.56.0) 04-06-2020 10:29 PDT ##### New Features - Add ability to partially update retry settings ([#​993](https://togithub.com/googleapis/gax-java/pull/993)) ##### Dependencies - Update grpc to 1.28.1 ([#​1013](https://togithub.com/googleapis/gax-java/pull/1013)) - Update com.google.api:api-common to 1.9.0 ([#​992](https://togithub.com/googleapis/gax-java/pull/992)) - Add javax.annotations dependency in bazel build to gax-grpc ([#​1000](https://togithub.com/googleapis/gax-java/pull/1000)) ##### Internal / Testing Changes - test: make it easier to debug failures in SettingsTest ([#​994](https://togithub.com/googleapis/gax-java/pull/994)) - build: update dependency gradle.plugin.com.dorongold.plugins:task-tree to v1.5 ([#​995](https://togithub.com/googleapis/gax-java/pull/995)) - test: update dependency com.google.api.grpc:grpc-google-cloud-pubsub-v1 to v1.86.0 ([#​1008](https://togithub.com/googleapis/gax-java/pull/1008)) ### [`v1.55.0`](https://togithub.com/googleapis/gax-java/releases/v1.55.0) [Compare Source](https://togithub.com/googleapis/gax-java/compare/v1.54.0...v1.55.0) 03-27-2020 08:33 PDT ##### New Features - Allow client authors to create their own callable chains ([#​891](https://togithub.com/googleapis/gax-java/pull/891)) ##### Dependencies - Update org.threeten:threetenbp to v1.4.1 ([#​890](https://togithub.com/googleapis/gax-java/pull/890)) ##### Internal / Testing Changes - chore(deps): update dependency com.google.api.grpc:grpc-google-cloud-bigtable-v2 to v1 ([#​953](https://togithub.com/googleapis/gax-java/pull/953)) - chore(deps): update dependency com.google.api.grpc:grpc-google-cloud-pubsub-v1 to v1 ([#​970](https://togithub.com/googleapis/gax-java/pull/970)) - remove unused property ([#​887](https://togithub.com/googleapis/gax-java/pull/887))
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :ghost: **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/config-help/issues) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/java-servicedirectory). --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8c75be09..b0023016 100644 --- a/pom.xml +++ b/pom.xml @@ -66,8 +66,8 @@ 1.91.1 1.9.0 1.17.0 - 1.54.0 - 1.27.2 + 1.56.0 + 1.28.1 3.11.4 4.13 28.2-android From 3dd8ec2699d41b6debd57a68dd9c34e71e9d3405 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2020 00:21:04 +0000 Subject: [PATCH 08/13] chore: release 0.1.1 (#23) :robot: I have created a release \*beep\* \*boop\* --- ### [0.1.1](https://www.github.com/googleapis/java-servicedirectory/compare/v0.1.0...v0.1.1) (2020-04-06) ### Dependencies * update core dependencies ([#1](https://www.github.com/googleapis/java-servicedirectory/issues/1)) ([a6b5a40](https://www.github.com/googleapis/java-servicedirectory/commit/a6b5a40a93d1ad2fe7865b6d284bab6c7adb6692)) * update dependency com.google.api:api-common to v1.9.0 ([#22](https://www.github.com/googleapis/java-servicedirectory/issues/22)) ([a7a8938](https://www.github.com/googleapis/java-servicedirectory/commit/a7a89380580ace369d535d6321cea716f3783105)) * update dependency org.threeten:threetenbp to v1.4.3 ([#14](https://www.github.com/googleapis/java-servicedirectory/issues/14)) ([017312e](https://www.github.com/googleapis/java-servicedirectory/commit/017312ec13e45e3fed02d90ed64a56e8a99a64e4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- CHANGELOG.md | 9 +++++++++ README.md | 6 +++--- google-cloud-servicedirectory-bom/pom.xml | 8 ++++---- google-cloud-servicedirectory/pom.xml | 4 ++-- grpc-google-cloud-servicedirectory-v1beta1/pom.xml | 4 ++-- pom.xml | 8 ++++---- proto-google-cloud-servicedirectory-v1beta1/pom.xml | 4 ++-- versions.txt | 6 +++--- 8 files changed, 29 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 256f090a..b0920d15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +### [0.1.1](https://www.github.com/googleapis/java-servicedirectory/compare/v0.1.0...v0.1.1) (2020-04-06) + + +### Dependencies + +* update core dependencies ([#1](https://www.github.com/googleapis/java-servicedirectory/issues/1)) ([a6b5a40](https://www.github.com/googleapis/java-servicedirectory/commit/a6b5a40a93d1ad2fe7865b6d284bab6c7adb6692)) +* update dependency com.google.api:api-common to v1.9.0 ([#22](https://www.github.com/googleapis/java-servicedirectory/issues/22)) ([a7a8938](https://www.github.com/googleapis/java-servicedirectory/commit/a7a89380580ace369d535d6321cea716f3783105)) +* update dependency org.threeten:threetenbp to v1.4.3 ([#14](https://www.github.com/googleapis/java-servicedirectory/issues/14)) ([017312e](https://www.github.com/googleapis/java-servicedirectory/commit/017312ec13e45e3fed02d90ed64a56e8a99a64e4)) + ## 0.1.0 (2020-03-13) diff --git a/README.md b/README.md index 0f924f1c..353a9285 100644 --- a/README.md +++ b/README.md @@ -43,18 +43,18 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-servicedirectory - 0.1.0 + 0.1.1 ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-servicedirectory:0.1.0' +compile 'com.google.cloud:google-cloud-servicedirectory:0.1.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-servicedirectory" % "0.1.0" +libraryDependencies += "com.google.cloud" % "google-cloud-servicedirectory" % "0.1.1" ``` [//]: # ({x-version-update-end}) diff --git a/google-cloud-servicedirectory-bom/pom.xml b/google-cloud-servicedirectory-bom/pom.xml index b939ac08..e09bcd85 100644 --- a/google-cloud-servicedirectory-bom/pom.xml +++ b/google-cloud-servicedirectory-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-servicedirectory-bom - 0.1.1-SNAPSHOT + 0.1.1 pom com.google.cloud @@ -64,17 +64,17 @@ com.google.cloud google-cloud-servicedirectory - 0.1.1-SNAPSHOT + 0.1.1 com.google.api.grpc grpc-google-cloud-servicedirectory-v1beta1 - 0.1.1-SNAPSHOT + 0.1.1 com.google.api.grpc proto-google-cloud-servicedirectory-v1beta1 - 0.1.1-SNAPSHOT + 0.1.1 diff --git a/google-cloud-servicedirectory/pom.xml b/google-cloud-servicedirectory/pom.xml index 315b589c..0642be2d 100644 --- a/google-cloud-servicedirectory/pom.xml +++ b/google-cloud-servicedirectory/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-servicedirectory - 0.1.1-SNAPSHOT + 0.1.1 jar Google Cloud Service Directory https://github.com/googleapis/java-servicedirectory @@ -11,7 +11,7 @@ com.google.cloud google-cloud-servicedirectory-parent - 0.1.1-SNAPSHOT + 0.1.1 google-cloud-servicedirectory diff --git a/grpc-google-cloud-servicedirectory-v1beta1/pom.xml b/grpc-google-cloud-servicedirectory-v1beta1/pom.xml index 12b99dfe..1d18d052 100644 --- a/grpc-google-cloud-servicedirectory-v1beta1/pom.xml +++ b/grpc-google-cloud-servicedirectory-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-servicedirectory-v1beta1 - 0.1.1-SNAPSHOT + 0.1.1 grpc-google-cloud-servicedirectory-v1beta1 GRPC library for grpc-google-cloud-servicedirectory-v1beta1 com.google.cloud google-cloud-servicedirectory-parent - 0.1.1-SNAPSHOT + 0.1.1 diff --git a/pom.xml b/pom.xml index b0023016..f3adc08c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-servicedirectory-parent pom - 0.1.1-SNAPSHOT + 0.1.1 Google Cloud Service Directory Parent https://github.com/googleapis/java-servicedirectory @@ -82,17 +82,17 @@ com.google.api.grpc proto-google-cloud-servicedirectory-v1beta1 - 0.1.1-SNAPSHOT + 0.1.1 com.google.api.grpc grpc-google-cloud-servicedirectory-v1beta1 - 0.1.1-SNAPSHOT + 0.1.1 com.google.cloud google-cloud-servicedirectory - 0.1.1-SNAPSHOT + 0.1.1 diff --git a/proto-google-cloud-servicedirectory-v1beta1/pom.xml b/proto-google-cloud-servicedirectory-v1beta1/pom.xml index 845e2feb..22ca1b60 100644 --- a/proto-google-cloud-servicedirectory-v1beta1/pom.xml +++ b/proto-google-cloud-servicedirectory-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-servicedirectory-v1beta1 - 0.1.1-SNAPSHOT + 0.1.1 proto-google-cloud-servicedirectory-v1beta1 PROTO library for proto-google-cloud-servicedirectory-v1beta1 com.google.cloud google-cloud-servicedirectory-parent - 0.1.1-SNAPSHOT + 0.1.1 diff --git a/versions.txt b/versions.txt index 6b62d430..ad25b0e6 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -proto-google-cloud-servicedirectory-v1beta1:0.1.0:0.1.1-SNAPSHOT -grpc-google-cloud-servicedirectory-v1beta1:0.1.0:0.1.1-SNAPSHOT -google-cloud-servicedirectory:0.1.0:0.1.1-SNAPSHOT +proto-google-cloud-servicedirectory-v1beta1:0.1.1:0.1.1 +grpc-google-cloud-servicedirectory-v1beta1:0.1.1:0.1.1 +google-cloud-servicedirectory:0.1.1:0.1.1 From a5ea611dc759ffa8c807496e730e7c5f7dc92566 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Apr 2020 17:49:04 +0200 Subject: [PATCH 09/13] chore(deps): update dependency com.google.cloud:google-cloud-servicedirectory to v0.1.1 (#32) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud:google-cloud-servicedirectory](https://togithub.com/googleapis/java-servicedirectory) | patch | `0.1.0` -> `0.1.1` | --- ### Release Notes
googleapis/java-servicedirectory ### [`v0.1.1`](https://togithub.com/googleapis/java-servicedirectory/blob/master/CHANGELOG.md#​011-httpswwwgithubcomgoogleapisjava-servicedirectorycomparev010v011-2020-04-06) [Compare Source](https://togithub.com/googleapis/java-servicedirectory/compare/v0.1.0...v0.1.1)
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/java-servicedirectory). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index cae1e166..9b6ff6b2 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-servicedirectory - 0.1.0 + 0.1.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3edb3cda..a83c6b5a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-servicedirectory - 0.1.0 + 0.1.1 From 5c99182e0dcd140b5ad74a82d1186b5d95226c6c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2020 16:02:21 +0000 Subject: [PATCH 10/13] chore: release 0.1.2-SNAPSHOT (#33) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- google-cloud-servicedirectory-bom/pom.xml | 8 ++++---- google-cloud-servicedirectory/pom.xml | 4 ++-- grpc-google-cloud-servicedirectory-v1beta1/pom.xml | 4 ++-- pom.xml | 8 ++++---- proto-google-cloud-servicedirectory-v1beta1/pom.xml | 4 ++-- versions.txt | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/google-cloud-servicedirectory-bom/pom.xml b/google-cloud-servicedirectory-bom/pom.xml index e09bcd85..e75164f0 100644 --- a/google-cloud-servicedirectory-bom/pom.xml +++ b/google-cloud-servicedirectory-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-servicedirectory-bom - 0.1.1 + 0.1.2-SNAPSHOT pom com.google.cloud @@ -64,17 +64,17 @@ com.google.cloud google-cloud-servicedirectory - 0.1.1 + 0.1.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-servicedirectory-v1beta1 - 0.1.1 + 0.1.2-SNAPSHOT com.google.api.grpc proto-google-cloud-servicedirectory-v1beta1 - 0.1.1 + 0.1.2-SNAPSHOT
diff --git a/google-cloud-servicedirectory/pom.xml b/google-cloud-servicedirectory/pom.xml index 0642be2d..2d9c5825 100644 --- a/google-cloud-servicedirectory/pom.xml +++ b/google-cloud-servicedirectory/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-servicedirectory - 0.1.1 + 0.1.2-SNAPSHOT jar Google Cloud Service Directory https://github.com/googleapis/java-servicedirectory @@ -11,7 +11,7 @@ com.google.cloud google-cloud-servicedirectory-parent - 0.1.1 + 0.1.2-SNAPSHOT google-cloud-servicedirectory diff --git a/grpc-google-cloud-servicedirectory-v1beta1/pom.xml b/grpc-google-cloud-servicedirectory-v1beta1/pom.xml index 1d18d052..68ed6185 100644 --- a/grpc-google-cloud-servicedirectory-v1beta1/pom.xml +++ b/grpc-google-cloud-servicedirectory-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-servicedirectory-v1beta1 - 0.1.1 + 0.1.2-SNAPSHOT grpc-google-cloud-servicedirectory-v1beta1 GRPC library for grpc-google-cloud-servicedirectory-v1beta1 com.google.cloud google-cloud-servicedirectory-parent - 0.1.1 + 0.1.2-SNAPSHOT diff --git a/pom.xml b/pom.xml index f3adc08c..1dce246a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-servicedirectory-parent pom - 0.1.1 + 0.1.2-SNAPSHOT Google Cloud Service Directory Parent https://github.com/googleapis/java-servicedirectory @@ -82,17 +82,17 @@ com.google.api.grpc proto-google-cloud-servicedirectory-v1beta1 - 0.1.1 + 0.1.2-SNAPSHOT com.google.api.grpc grpc-google-cloud-servicedirectory-v1beta1 - 0.1.1 + 0.1.2-SNAPSHOT com.google.cloud google-cloud-servicedirectory - 0.1.1 + 0.1.2-SNAPSHOT diff --git a/proto-google-cloud-servicedirectory-v1beta1/pom.xml b/proto-google-cloud-servicedirectory-v1beta1/pom.xml index 22ca1b60..13507a6c 100644 --- a/proto-google-cloud-servicedirectory-v1beta1/pom.xml +++ b/proto-google-cloud-servicedirectory-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-servicedirectory-v1beta1 - 0.1.1 + 0.1.2-SNAPSHOT proto-google-cloud-servicedirectory-v1beta1 PROTO library for proto-google-cloud-servicedirectory-v1beta1 com.google.cloud google-cloud-servicedirectory-parent - 0.1.1 + 0.1.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index ad25b0e6..36cf62ca 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -proto-google-cloud-servicedirectory-v1beta1:0.1.1:0.1.1 -grpc-google-cloud-servicedirectory-v1beta1:0.1.1:0.1.1 -google-cloud-servicedirectory:0.1.1:0.1.1 +proto-google-cloud-servicedirectory-v1beta1:0.1.1:0.1.2-SNAPSHOT +grpc-google-cloud-servicedirectory-v1beta1:0.1.1:0.1.2-SNAPSHOT +google-cloud-servicedirectory:0.1.1:0.1.2-SNAPSHOT From 53862d196d6da4ec24a9dd6dbec82bc4af571808 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 8 Apr 2020 06:49:34 +0200 Subject: [PATCH 11/13] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v0.5.0 (#35) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | minor | `0.4.0` -> `0.5.0` | --- ### Release Notes
googleapis/java-shared-config ### [`v0.5.0`](https://togithub.com/googleapis/java-shared-config/blob/master/CHANGELOG.md#​050-httpswwwgithubcomgoogleapisjava-shared-configcomparev040v050-2020-04-07) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v0.4.0...v0.5.0) ##### Features - add ban duplicate classes rule ([#​126](https://www.github.com/googleapis/java-shared-config/issues/126)) ([e38a7cc](https://www.github.com/googleapis/java-shared-config/commit/e38a7cc949396f8f5696e62cd060e0c076047b8d)) - add devsite javadoc profile ([#​121](https://www.github.com/googleapis/java-shared-config/issues/121)) ([7f452fb](https://www.github.com/googleapis/java-shared-config/commit/7f452fb6c5704f6ce0f731085479a28fb99ebcb9)) - add maven flatten plugin ([#​127](https://www.github.com/googleapis/java-shared-config/issues/127)) ([fb00799](https://www.github.com/googleapis/java-shared-config/commit/fb00799c416d324d68da5b660a26f7ef595c26d9)) ##### Bug Fixes - declare com.coveo:fmt-maven-plugin version/configuration ([#​90](https://www.github.com/googleapis/java-shared-config/issues/90)) ([5cf71a6](https://www.github.com/googleapis/java-shared-config/commit/5cf71a6ed699907082756e70c2fdee6ad3632f38)) ##### Dependencies - update dependency com.google.cloud.samples:shared-configuration to v1.0.13 ([#​118](https://www.github.com/googleapis/java-shared-config/issues/118)) ([58ae69e](https://www.github.com/googleapis/java-shared-config/commit/58ae69eb5ba037963cdaed0c2b0e30663bc873eb)) - update dependency com.puppycrawl.tools:checkstyle to v8.29 ([f62292d](https://www.github.com/googleapis/java-shared-config/commit/f62292dab75699a75f8a7d499fe2ccfb7ee93783)) - update dependency org.apache.maven.plugins:maven-antrun-plugin to v1.8 ([#​124](https://www.github.com/googleapis/java-shared-config/issues/124)) ([a681536](https://www.github.com/googleapis/java-shared-config/commit/a68153643400c3f3b5c5959cda4dc3b552336427)) - update dependency org.apache.maven.plugins:maven-dependency-plugin to v3.1.2 ([#​107](https://www.github.com/googleapis/java-shared-config/issues/107)) ([c9b096b](https://www.github.com/googleapis/java-shared-config/commit/c9b096b81b1f4f8dc2d1302f259f0321722e1ca5)) - update dependency org.apache.maven.plugins:maven-site-plugin to v3.9.0 ([#​103](https://www.github.com/googleapis/java-shared-config/issues/103)) ([abe7140](https://www.github.com/googleapis/java-shared-config/commit/abe714060e858c70a83888fb34438c45d97b1168)) - update dependency org.codehaus.mojo:build-helper-maven-plugin to v3.1.0 ([#​101](https://www.github.com/googleapis/java-shared-config/issues/101)) ([ac69572](https://www.github.com/googleapis/java-shared-config/commit/ac69572be76e4462fdf65fa6e7f0935c3d51d827))
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/java-servicedirectory). --- google-cloud-servicedirectory-bom/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-servicedirectory-bom/pom.xml b/google-cloud-servicedirectory-bom/pom.xml index e75164f0..449fb582 100644 --- a/google-cloud-servicedirectory-bom/pom.xml +++ b/google-cloud-servicedirectory-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud google-cloud-shared-config - 0.4.0 + 0.5.0 Google Cloud Service Directory BOM diff --git a/pom.xml b/pom.xml index 1dce246a..c745a3ef 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.4.0 + 0.5.0 From dedd57d18f45bf50c70f88bad025c29e31db7918 Mon Sep 17 00:00:00 2001 From: Mahina Kaholokula Date: Wed, 8 Apr 2020 06:17:43 -0400 Subject: [PATCH 12/13] Fix type in README. --- samples/snippets/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/samples/snippets/README.md b/samples/snippets/README.md index eb240b53..fe368e2a 100644 --- a/samples/snippets/README.md +++ b/samples/snippets/README.md @@ -25,9 +25,10 @@ You must set your project ID in order to run the tests You must ensure that the [user account or service account](https://cloud.google.com/iam/docs/service-accounts#differences_between_a_service_account_and_a_user_account) -you used to authorize your gcloud session has the proper permissions to edit KMS -resources for your project. In the Cloud Console under IAM, add the `Service -Directory Admin` role to the project whose service account you're using to test. +you used to authorize your gcloud session has the proper permissions to edit +Service Directory resources for your project. In the Cloud Console under IAM, +add the `Service Directory Admin` role to the project whose service account +you're using to test. More information can be found in the [Authentication docs](https://cloud.google.com/docs/authentication/production). From aa2efb9c1d184ad8819c21f65d4ead989e7ad67f Mon Sep 17 00:00:00 2001 From: Mahina Kaholokula Date: Thu, 9 Apr 2020 05:48:47 -0400 Subject: [PATCH 13/13] Add clarifying comments. Add some configuration in ServicesCreate --- .../com/example/servicedirectory/EndpointsCreate.java | 2 ++ .../com/example/servicedirectory/EndpointsDelete.java | 1 + .../com/example/servicedirectory/NamespacesCreate.java | 1 + .../com/example/servicedirectory/NamespacesDelete.java | 1 + .../java/com/example/servicedirectory/ServicesCreate.java | 8 ++++++-- .../java/com/example/servicedirectory/ServicesDelete.java | 1 + .../com/example/servicedirectory/ServicesResolve.java | 1 + 7 files changed, 13 insertions(+), 2 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsCreate.java b/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsCreate.java index 3db485e9..73144a63 100644 --- a/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsCreate.java +++ b/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsCreate.java @@ -27,10 +27,12 @@ public class EndpointsCreate { public static void createEndpoint() throws IOException { // TODO(developer): Replace these variables before running the sample. + // These variables should refer to an existing Service Directory service. String projectId = "your-project-id"; String locationId = "your-region"; String namespaceId = "your-namespace"; String serviceId = "your-service"; + // This is user-created; must be unique within the service above. String endpointId = "your-endpoint"; createEndpoint(projectId, locationId, namespaceId, serviceId, endpointId); } diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsDelete.java b/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsDelete.java index bf18a9e8..7946d632 100644 --- a/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsDelete.java +++ b/samples/snippets/src/main/java/com/example/servicedirectory/EndpointsDelete.java @@ -26,6 +26,7 @@ public class EndpointsDelete { public static void deleteEndpoint() throws IOException { // TODO(developer): Replace these variables before running the sample. + // These variables should refer to an existing Service Directory endpoint. String projectId = "your-project-id"; String locationId = "your-region"; String namespaceId = "your-namespace"; diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesCreate.java b/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesCreate.java index 2b797a2d..da7f4712 100644 --- a/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesCreate.java +++ b/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesCreate.java @@ -29,6 +29,7 @@ public static void createNamespace() throws IOException { // TODO(developer): Replace these variables before running the sample. String projectId = "your-project-id"; String locationId = "your-region"; + // This is user-created; must be unique within the project/region above. String namespaceId = "your-namespace"; createNamespace(projectId, locationId, namespaceId); } diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesDelete.java b/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesDelete.java index 323c8e38..47773add 100644 --- a/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesDelete.java +++ b/samples/snippets/src/main/java/com/example/servicedirectory/NamespacesDelete.java @@ -26,6 +26,7 @@ public class NamespacesDelete { public static void deleteNamespace() throws IOException { // TODO(developer): Replace these variables before running the sample. + // These variables should refer to an existing Service Directory namespace. String projectId = "your-project-id"; String locationId = "your-region"; String namespaceId = "your-namespace"; diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/ServicesCreate.java b/samples/snippets/src/main/java/com/example/servicedirectory/ServicesCreate.java index 3c9d0873..7f531584 100644 --- a/samples/snippets/src/main/java/com/example/servicedirectory/ServicesCreate.java +++ b/samples/snippets/src/main/java/com/example/servicedirectory/ServicesCreate.java @@ -27,9 +27,11 @@ public class ServicesCreate { public static void createService() throws IOException { // TODO(developer): Replace these variables before running the sample. + // These variables should refer to an existing Service Directory namespace. String projectId = "your-project-id"; String locationId = "your-region"; String namespaceId = "your-namespace"; + // This is user-created; must be unique within the namespace above. String serviceId = "your-service"; createService(projectId, locationId, namespaceId, serviceId); } @@ -46,14 +48,16 @@ public static void createService( // The namespace to create the service in. NamespaceName parent = NamespaceName.of(projectId, locationId, namespaceId); - // The service object to create. Here, we use the default instance. - Service service = Service.newBuilder().build(); + // The service object to create. + // Optionally add some metadata for the service. + Service service = Service.newBuilder().putMetadata("protocol", "tcp").build(); // Send the request to create the namespace. Service createdService = client.createService(parent, service, serviceId); // Process the response. System.out.println("Created Service: " + createdService.getName()); + System.out.println("Metadata: " + createdService.getMetadata()); } } } diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/ServicesDelete.java b/samples/snippets/src/main/java/com/example/servicedirectory/ServicesDelete.java index fde04c4a..82713e38 100644 --- a/samples/snippets/src/main/java/com/example/servicedirectory/ServicesDelete.java +++ b/samples/snippets/src/main/java/com/example/servicedirectory/ServicesDelete.java @@ -26,6 +26,7 @@ public class ServicesDelete { public static void deleteService() throws IOException { // TODO(developer): Replace these variables before running the sample. + // These variables should refer to an existing Service Directory service. String projectId = "your-project-id"; String locationId = "your-region"; String namespaceId = "your-namespace"; diff --git a/samples/snippets/src/main/java/com/example/servicedirectory/ServicesResolve.java b/samples/snippets/src/main/java/com/example/servicedirectory/ServicesResolve.java index dbeeb0b7..99da6588 100644 --- a/samples/snippets/src/main/java/com/example/servicedirectory/ServicesResolve.java +++ b/samples/snippets/src/main/java/com/example/servicedirectory/ServicesResolve.java @@ -29,6 +29,7 @@ public class ServicesResolve { public static void resolveService() throws IOException { // TODO(developer): Replace these variables before running the sample. + // These variables should refer to an existing Service Directory service. String projectId = "your-project-id"; String locationId = "your-region"; String namespaceId = "your-namespace";