Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

feat: add ConnectMode to v1 and UpgradeInstance RPC to v1beta1 #53

Merged
merged 2 commits into from Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion google-cloud-redis-bom/pom.xml
Expand Up @@ -11,7 +11,7 @@
<version>0.4.0</version>
</parent>

<name>Google Cloud redis BOM</name>
<name>Google Cloud Redis BOM</name>
<url>https://github.com/googleapis/java-redis</url>
<description>
BOM for Google Cloud Redis
Expand Down
Expand Up @@ -187,8 +187,9 @@ public final OperationsClient getOperationsClient() {
* Lists all Redis instances owned by a project in either the specified location (region) or all
* locations.
*
* <p>The location should have the following format: &#42;
* `projects/{project_id}/locations/{location_id}`
* <p>The location should have the following format:
*
* <p>&#42; `projects/{project_id}/locations/{location_id}`
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
* are queried, and the results are aggregated.
Expand Down Expand Up @@ -221,8 +222,9 @@ public final ListInstancesPagedResponse listInstances(LocationName parent) {
* Lists all Redis instances owned by a project in either the specified location (region) or all
* locations.
*
* <p>The location should have the following format: &#42;
* `projects/{project_id}/locations/{location_id}`
* <p>The location should have the following format:
*
* <p>&#42; `projects/{project_id}/locations/{location_id}`
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
* are queried, and the results are aggregated.
Expand Down Expand Up @@ -252,8 +254,9 @@ public final ListInstancesPagedResponse listInstances(String parent) {
* Lists all Redis instances owned by a project in either the specified location (region) or all
* locations.
*
* <p>The location should have the following format: &#42;
* `projects/{project_id}/locations/{location_id}`
* <p>The location should have the following format:
*
* <p>&#42; `projects/{project_id}/locations/{location_id}`
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
* are queried, and the results are aggregated.
Expand Down Expand Up @@ -284,8 +287,9 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
* Lists all Redis instances owned by a project in either the specified location (region) or all
* locations.
*
* <p>The location should have the following format: &#42;
* `projects/{project_id}/locations/{location_id}`
* <p>The location should have the following format:
*
* <p>&#42; `projects/{project_id}/locations/{location_id}`
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
* are queried, and the results are aggregated.
Expand Down Expand Up @@ -316,8 +320,9 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
* Lists all Redis instances owned by a project in either the specified location (region) or all
* locations.
*
* <p>The location should have the following format: &#42;
* `projects/{project_id}/locations/{location_id}`
* <p>The location should have the following format:
*
* <p>&#42; `projects/{project_id}/locations/{location_id}`
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
* are queried, and the results are aggregated.
Expand Down Expand Up @@ -709,7 +714,7 @@ public final UnaryCallable<CreateInstanceRequest, Operation> createInstanceCalla
*
* @param updateMask Required. Mask of fields to update. At least one path must be supplied in
* this field. The elements of the repeated paths field may only include these fields from
* [Instance][CloudRedis.Instance]:
* [Instance][google.cloud.redis.v1.Instance]:
* <p>&#42; `displayName` &#42; `labels` &#42; `memorySizeGb` &#42; `redisConfig`
* @param instance Required. Update description. Only fields specified in update_mask are updated.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
Expand Down
Expand Up @@ -188,8 +188,9 @@ public final OperationsClient getOperationsClient() {
* Lists all Redis instances owned by a project in either the specified location (region) or all
* locations.
*
* <p>The location should have the following format: &#42;
* `projects/{project_id}/locations/{location_id}`
* <p>The location should have the following format:
*
* <p>&#42; `projects/{project_id}/locations/{location_id}`
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
* are queried, and the results are aggregated.
Expand Down Expand Up @@ -222,8 +223,9 @@ public final ListInstancesPagedResponse listInstances(LocationName parent) {
* Lists all Redis instances owned by a project in either the specified location (region) or all
* locations.
*
* <p>The location should have the following format: &#42;
* `projects/{project_id}/locations/{location_id}`
* <p>The location should have the following format:
*
* <p>&#42; `projects/{project_id}/locations/{location_id}`
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
* are queried, and the results are aggregated.
Expand Down Expand Up @@ -253,8 +255,9 @@ public final ListInstancesPagedResponse listInstances(String parent) {
* Lists all Redis instances owned by a project in either the specified location (region) or all
* locations.
*
* <p>The location should have the following format: &#42;
* `projects/{project_id}/locations/{location_id}`
* <p>The location should have the following format:
*
* <p>&#42; `projects/{project_id}/locations/{location_id}`
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
* are queried, and the results are aggregated.
Expand Down Expand Up @@ -285,8 +288,9 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
* Lists all Redis instances owned by a project in either the specified location (region) or all
* locations.
*
* <p>The location should have the following format: &#42;
* `projects/{project_id}/locations/{location_id}`
* <p>The location should have the following format:
*
* <p>&#42; `projects/{project_id}/locations/{location_id}`
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
* are queried, and the results are aggregated.
Expand Down Expand Up @@ -317,8 +321,9 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
* Lists all Redis instances owned by a project in either the specified location (region) or all
* locations.
*
* <p>The location should have the following format: &#42;
* `projects/{project_id}/locations/{location_id}`
* <p>The location should have the following format:
*
* <p>&#42; `projects/{project_id}/locations/{location_id}`
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
* are queried, and the results are aggregated.
Expand Down Expand Up @@ -1365,6 +1370,144 @@ public final UnaryCallable<DeleteInstanceRequest, Operation> deleteInstanceCalla
return stub.deleteInstanceCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Upgrades Redis instance to the newer Redis version specified in the request.
*
* <p>Sample code:
*
* <pre><code>
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
* String redisVersion = "";
* Instance response = cloudRedisClient.upgradeInstanceAsync(name, redisVersion).get();
* }
* </code></pre>
*
* @param name Required. Redis instance resource name using the form:
* `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id`
* refers to a GCP region.
* @param redisVersion Required. Specifies the target version of Redis software to upgrade to.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Instance, Any> upgradeInstanceAsync(
InstanceName name, String redisVersion) {
UpgradeInstanceRequest request =
UpgradeInstanceRequest.newBuilder()
.setName(name == null ? null : name.toString())
.setRedisVersion(redisVersion)
.build();
return upgradeInstanceAsync(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Upgrades Redis instance to the newer Redis version specified in the request.
*
* <p>Sample code:
*
* <pre><code>
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
* String redisVersion = "";
* Instance response = cloudRedisClient.upgradeInstanceAsync(name.toString(), redisVersion).get();
* }
* </code></pre>
*
* @param name Required. Redis instance resource name using the form:
* `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id`
* refers to a GCP region.
* @param redisVersion Required. Specifies the target version of Redis software to upgrade to.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Instance, Any> upgradeInstanceAsync(
String name, String redisVersion) {
UpgradeInstanceRequest request =
UpgradeInstanceRequest.newBuilder().setName(name).setRedisVersion(redisVersion).build();
return upgradeInstanceAsync(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Upgrades Redis instance to the newer Redis version specified in the request.
*
* <p>Sample code:
*
* <pre><code>
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
* String redisVersion = "";
* UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder()
* .setName(name.toString())
* .setRedisVersion(redisVersion)
* .build();
* Instance response = cloudRedisClient.upgradeInstanceAsync(request).get();
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Instance, Any> upgradeInstanceAsync(UpgradeInstanceRequest request) {
return upgradeInstanceOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Upgrades Redis instance to the newer Redis version specified in the request.
*
* <p>Sample code:
*
* <pre><code>
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
* String redisVersion = "";
* UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder()
* .setName(name.toString())
* .setRedisVersion(redisVersion)
* .build();
* OperationFuture&lt;Instance, Any&gt; future = cloudRedisClient.upgradeInstanceOperationCallable().futureCall(request);
* // Do something
* Instance response = future.get();
* }
* </code></pre>
*/
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallable<UpgradeInstanceRequest, Instance, Any>
upgradeInstanceOperationCallable() {
return stub.upgradeInstanceOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Upgrades Redis instance to the newer Redis version specified in the request.
*
* <p>Sample code:
*
* <pre><code>
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
* String redisVersion = "";
* UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder()
* .setName(name.toString())
* .setRedisVersion(redisVersion)
* .build();
* ApiFuture&lt;Operation&gt; future = cloudRedisClient.upgradeInstanceCallable().futureCall(request);
* // Do something
* Operation response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<UpgradeInstanceRequest, Operation> upgradeInstanceCallable() {
return stub.upgradeInstanceCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Expand Up @@ -156,6 +156,19 @@ public UnaryCallSettings<DeleteInstanceRequest, Operation> deleteInstanceSetting
return ((CloudRedisStubSettings) getStubSettings()).deleteInstanceOperationSettings();
}

/** Returns the object with the settings used for calls to upgradeInstance. */
public UnaryCallSettings<UpgradeInstanceRequest, Operation> upgradeInstanceSettings() {
return ((CloudRedisStubSettings) getStubSettings()).upgradeInstanceSettings();
}

/** Returns the object with the settings used for calls to upgradeInstance. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings<UpgradeInstanceRequest, Instance, Any>
upgradeInstanceOperationSettings() {
return ((CloudRedisStubSettings) getStubSettings()).upgradeInstanceOperationSettings();
}

public static final CloudRedisSettings create(CloudRedisStubSettings stub) throws IOException {
return new CloudRedisSettings.Builder(stub.toBuilder()).build();
}
Expand Down Expand Up @@ -343,6 +356,19 @@ public UnaryCallSettings.Builder<DeleteInstanceRequest, Operation> deleteInstanc
return getStubSettingsBuilder().deleteInstanceOperationSettings();
}

/** Returns the builder for the settings used for calls to upgradeInstance. */
public UnaryCallSettings.Builder<UpgradeInstanceRequest, Operation> upgradeInstanceSettings() {
return getStubSettingsBuilder().upgradeInstanceSettings();
}

/** Returns the builder for the settings used for calls to upgradeInstance. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings.Builder<UpgradeInstanceRequest, Instance, Any>
upgradeInstanceOperationSettings() {
return getStubSettingsBuilder().upgradeInstanceOperationSettings();
}

@Override
public CloudRedisSettings build() throws IOException {
return new CloudRedisSettings(this);
Expand Down
Expand Up @@ -31,6 +31,7 @@
import com.google.cloud.redis.v1beta1.ListInstancesRequest;
import com.google.cloud.redis.v1beta1.ListInstancesResponse;
import com.google.cloud.redis.v1beta1.UpdateInstanceRequest;
import com.google.cloud.redis.v1beta1.UpgradeInstanceRequest;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
import com.google.protobuf.Any;
Expand Down Expand Up @@ -120,6 +121,16 @@ public UnaryCallable<DeleteInstanceRequest, Operation> deleteInstanceCallable()
throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()");
}

@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public OperationCallable<UpgradeInstanceRequest, Instance, Any>
upgradeInstanceOperationCallable() {
throw new UnsupportedOperationException("Not implemented: upgradeInstanceOperationCallable()");
}

public UnaryCallable<UpgradeInstanceRequest, Operation> upgradeInstanceCallable() {
throw new UnsupportedOperationException("Not implemented: upgradeInstanceCallable()");
}

@Override
public abstract void close();
}