@Override public Paginated<Instance> listInstances( int pageSize, @Nullable String pageToken, @Nullable String filter) throws SpannerException { ListInstancesRequest.Builder requestBuilder = ListInstancesRequest.newBuilder().setParent(projectName).setPageSize(pageSize); if (pageToken != null) { requestBuilder.setPageToken(pageToken); } if (filter != null) { requestBuilder.setFilter(filter); } ListInstancesRequest request = requestBuilder.build(); GrpcCallContext context = newCallContext(null, projectName); ListInstancesResponse response = get(instanceAdminStub.listInstancesCallable().futureCall(request, context)); return new Paginated<>(response.getInstancesList(), response.getNextPageToken()); }
@Override public Paginated<Instance> listInstances( int pageSize, @Nullable String pageToken, @Nullable String filter) throws SpannerException { ListInstancesRequest.Builder requestBuilder = ListInstancesRequest.newBuilder().setParent(projectName).setPageSize(pageSize); if (pageToken != null) { requestBuilder.setPageToken(pageToken); } if (filter != null) { requestBuilder.setFilter(filter); } ListInstancesRequest request = requestBuilder.build(); GrpcCallContext context = newCallContext(null, projectName); ListInstancesResponse response = get(instanceAdminStub.listInstancesCallable().futureCall(request, context)); return new Paginated<>(response.getInstancesList(), response.getNextPageToken()); }
/** * Lists all instances in the given project. * * <p>Sample code: * * <pre><code> * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); * for (Instance element : instanceAdminClient.listInstances(parent).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent Required. The name of the project for which a list of instances is requested. * Values are of the form `projects/<project>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListInstancesPagedResponse listInstances(ProjectName parent) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listInstances(request); }
/** * Lists all instances in the given project. * * <p>Sample code: * * <pre><code> * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); * for (Instance element : instanceAdminClient.listInstances(parent.toString()).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent Required. The name of the project for which a list of instances is requested. * Values are of the form `projects/<project>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListInstancesPagedResponse listInstances(String parent) { ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); return listInstances(request); }
@Override public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) { return ListInstancesRequest.newBuilder(payload).setPageToken(token).build(); }
@Override public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) { return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build(); }
/** * Lists all instances in the given project. * * <p>Sample code: * * <pre><code> * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); * for (Instance element : instanceAdminClient.listInstances(parent).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent Required. The name of the project for which a list of instances is requested. * Values are of the form `projects/<project>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListInstancesPagedResponse listInstances(ProjectName parent) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listInstances(request); }
/** * Lists all instances in the given project. * * <p>Sample code: * * <pre><code> * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); * for (Instance element : instanceAdminClient.listInstances(parent.toString()).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent Required. The name of the project for which a list of instances is requested. * Values are of the form `projects/<project>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListInstancesPagedResponse listInstances(String parent) { ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); return listInstances(request); }
@Override public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) { return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build(); }
@Override public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) { return ListInstancesRequest.newBuilder(payload).setPageToken(token).build(); }