Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>4.3.0</version>
<version>4.4.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -43,18 +43,18 @@ If you are using Maven without BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-servicedirectory</artifactId>
<version>0.1.0</version>
<version>0.1.1</version>
</dependency>

```

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})

Expand Down
10 changes: 5 additions & 5 deletions google-cloud-servicedirectory-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-servicedirectory-bom</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
<packaging>pom</packaging>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-shared-config</artifactId>
<version>0.4.0</version>
<version>0.5.0</version>
</parent>

<name>Google Cloud Service Directory BOM</name>
Expand Down Expand Up @@ -64,17 +64,17 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-servicedirectory</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-servicedirectory-v1beta1</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-servicedirectory-v1beta1:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-servicedirectory-v1beta1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-servicedirectory-v1beta1</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-servicedirectory-v1beta1:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-servicedirectory-v1beta1:current} -->
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
4 changes: 2 additions & 2 deletions google-cloud-servicedirectory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-servicedirectory</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
<packaging>jar</packaging>
<name>Google Cloud Service Directory</name>
<url>https://github.com/googleapis/java-servicedirectory</url>
<description>Java idiomatic client for Google Cloud Service Directory</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-servicedirectory-parent</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
</parent>
<properties>
<site.installationModule>google-cloud-servicedirectory</site.installationModule>
Expand Down
4 changes: 2 additions & 2 deletions grpc-google-cloud-servicedirectory-v1beta1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-servicedirectory-v1beta1</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-servicedirectory-v1beta1:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-servicedirectory-v1beta1:current} -->
<name>grpc-google-cloud-servicedirectory-v1beta1</name>
<description>GRPC library for grpc-google-cloud-servicedirectory-v1beta1</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-servicedirectory-parent</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-servicedirectory-parent</artifactId>
<packaging>pom</packaging>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
<name>Google Cloud Service Directory Parent</name>
<url>https://github.com/googleapis/java-servicedirectory</url>
<description>
Expand All @@ -14,7 +14,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-shared-config</artifactId>
<version>0.4.0</version>
<version>0.5.0</version>
</parent>

<developers>
Expand Down Expand Up @@ -66,12 +66,12 @@
<google.core.version>1.91.1</google.core.version>
<google.api-common.version>1.9.0</google.api-common.version>
<google.common-protos.version>1.17.0</google.common-protos.version>
<gax.version>1.54.0</gax.version>
<grpc.version>1.27.2</grpc.version>
<gax.version>1.56.0</gax.version>
<grpc.version>1.28.1</grpc.version>
<protobuf.version>3.11.4</protobuf.version>
<junit.version>4.13</junit.version>
<guava.version>28.2-android</guava.version>
<threeten.version>1.4.1</threeten.version>
<threeten.version>1.4.3</threeten.version>
<javax.annotations.version>1.3.2</javax.annotations.version>
<animal-sniffer.version>1.18</animal-sniffer.version>
<google.proto-iam-v1.version>0.13.0</google.proto-iam-v1.version>
Expand All @@ -82,17 +82,17 @@
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-servicedirectory-v1beta1</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-servicedirectory-v1beta1:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-servicedirectory-v1beta1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-servicedirectory-v1beta1</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-servicedirectory-v1beta1:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-servicedirectory-v1beta1:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-servicedirectory</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
</dependency>

<dependency>
Expand Down
4 changes: 2 additions & 2 deletions proto-google-cloud-servicedirectory-v1beta1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-servicedirectory-v1beta1</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-servicedirectory-v1beta1:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-servicedirectory-v1beta1:current} -->
<name>proto-google-cloud-servicedirectory-v1beta1</name>
<description>PROTO library for proto-google-cloud-servicedirectory-v1beta1</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-servicedirectory-parent</artifactId>
<version>0.1.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
<version>0.1.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-servicedirectory:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions samples/install-without-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.0.14</version>
<version>1.0.15</version>
</parent>

<properties>
Expand All @@ -29,7 +29,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-servicedirectory</artifactId>
<version>0.1.0</version>
<version>0.1.1</version>
</dependency>
<!-- [END servicedirectory_install_without_bom] -->

Expand Down
2 changes: 1 addition & 1 deletion samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.0.14</version>
<version>1.0.15</version>
</parent>

<properties>
Expand Down
4 changes: 2 additions & 2 deletions samples/snapshot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.0.14</version>
<version>1.0.15</version>
</parent>

<properties>
Expand All @@ -28,7 +28,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-servicedirectory</artifactId>
<version>0.1.0</version>
<version>0.1.1</version>
</dependency>

<dependency>
Expand Down
46 changes: 46 additions & 0 deletions samples/snippets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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=<your-project-id-here>`

### 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
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).

## Quickstart

Install [Maven](https://maven.apache.org/).

Build your project with:

mvn clean package -DskipTests

You can run all tests with:

mvn clean verify
17 changes: 15 additions & 2 deletions samples/snippets/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--
Copyright 2020 Google Inc.
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
Expand All @@ -14,7 +26,7 @@
<parent>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.0.14</version>
<version>1.0.15</version>
</parent>

<properties>
Expand All @@ -30,7 +42,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>4.3.0</version>
<version>4.4.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -57,4 +69,5 @@
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* 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);

// The endpoint to create, with fields filled in.
// 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);

// 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]
Loading