| GitHub Repository | Product Reference |
Service Description: Service describing handlers for resources
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ServerName name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
Server response = cloudFtpClient.getServer(name);
}
Note: close() needs to be called on the CloudFtpClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListServers |
Lists Servers in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetServer |
Gets details of a single Server. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateServer |
Creates a new Server in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateServer |
Updates the parameters of a single Server. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteServer |
Deletes a single Server. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListUsers |
Lists Users in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetUser |
Gets details of a single User. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateUser |
Creates a new User in a given project and location and Server. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateUser |
Updates the parameters of a single User. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteUser |
Deletes a single User. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StartServer |
Starts a stopping/stopped Server. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StopServer |
Stops an active Server. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. This method lists locations based on the resource scope provided inthe ListLocationsRequest.name field: ***Global locations**: If For gRPC and client library implementations, the resource name ispassed as the |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of CloudFtpSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
CloudFtpSettings cloudFtpSettings =
CloudFtpSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
CloudFtpClient cloudFtpClient = CloudFtpClient.create(cloudFtpSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
CloudFtpSettings cloudFtpSettings =
CloudFtpSettings.newBuilder().setEndpoint(myEndpoint).build();
CloudFtpClient cloudFtpClient = CloudFtpClient.create(cloudFtpSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final CloudFtpClient create()Constructs an instance of CloudFtpClient with default settings.
| Returns | |
|---|---|
| Type | Description |
CloudFtpClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(CloudFtpSettings settings)
public static final CloudFtpClient create(CloudFtpSettings settings)Constructs an instance of CloudFtpClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
| Parameter | |
|---|---|
| Name | Description |
settings |
CloudFtpSettings |
| Returns | |
|---|---|
| Type | Description |
CloudFtpClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(CloudFtpStub stub)
public static final CloudFtpClient create(CloudFtpStub stub)Constructs an instance of CloudFtpClient, using the given stub for making calls. This is for advanced usage - prefer using create(CloudFtpSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
CloudFtpStub |
| Returns | |
|---|---|
| Type | Description |
CloudFtpClient |
|
Constructors
CloudFtpClient(CloudFtpSettings settings)
protected CloudFtpClient(CloudFtpSettings settings)Constructs an instance of CloudFtpClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
| Parameter | |
|---|---|
| Name | Description |
settings |
CloudFtpSettings |
CloudFtpClient(CloudFtpStub stub)
protected CloudFtpClient(CloudFtpStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
CloudFtpStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
close()
public final void close()createServerAsync(@Nullable LocationName parent, Server server, String serverId)
public final OperationFuture<Server,OperationMetadata> createServerAsync(@Nullable LocationName parent, Server server, String serverId)Creates a new Server in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Server server = Server.newBuilder().build();
String serverId = "serverId1379103678";
Server response = cloudFtpClient.createServerAsync(parent, server, serverId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.ftp.v1.LocationNameRequired. Value for parent. |
server |
ServerRequired. The resource being created |
serverId |
StringRequired. A unique ID for the server. Must start with a lowercase letter, and end with a lowercase letter or number. Can contain lowercase letters, numbers, and hyphens. Maximum length is 30 characters. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Server,OperationMetadata> |
|
createServerAsync(CreateServerRequest request)
public final OperationFuture<Server,OperationMetadata> createServerAsync(CreateServerRequest request)Creates a new Server in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
CreateServerRequest request =
CreateServerRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setServerId("serverId1379103678")
.setServer(Server.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Server response = cloudFtpClient.createServerAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateServerRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Server,OperationMetadata> |
|
createServerAsync(String parent, Server server, String serverId)
public final OperationFuture<Server,OperationMetadata> createServerAsync(String parent, Server server, String serverId)Creates a new Server in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Server server = Server.newBuilder().build();
String serverId = "serverId1379103678";
Server response = cloudFtpClient.createServerAsync(parent, server, serverId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Value for parent. |
server |
ServerRequired. The resource being created |
serverId |
StringRequired. A unique ID for the server. Must start with a lowercase letter, and end with a lowercase letter or number. Can contain lowercase letters, numbers, and hyphens. Maximum length is 30 characters. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Server,OperationMetadata> |
|
createServerCallable()
public final UnaryCallable<CreateServerRequest,Operation> createServerCallable()Creates a new Server in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
CreateServerRequest request =
CreateServerRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setServerId("serverId1379103678")
.setServer(Server.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = cloudFtpClient.createServerCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateServerRequest,Operation> |
|
createServerOperationCallable()
public final OperationCallable<CreateServerRequest,Server,OperationMetadata> createServerOperationCallable()Creates a new Server in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
CreateServerRequest request =
CreateServerRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setServerId("serverId1379103678")
.setServer(Server.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Server, OperationMetadata> future =
cloudFtpClient.createServerOperationCallable().futureCall(request);
// Do something.
Server response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateServerRequest,Server,OperationMetadata> |
|
createUserAsync(@Nullable ServerName parent, User user, String userId)
public final OperationFuture<User,OperationMetadata> createUserAsync(@Nullable ServerName parent, User user, String userId)Creates a new User in a given project and location and Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ServerName parent = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
User user = User.newBuilder().build();
String userId = "userId-836030906";
User response = cloudFtpClient.createUserAsync(parent, user, userId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.ftp.v1.ServerNameRequired. Value for parent. |
user |
UserRequired. The resource being created |
userId |
StringRequired. A unique user ID for the SFTP user. The user ID must start with a lowercase letter and can include lowercase letters, numbers, or hyphens. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<User,OperationMetadata> |
|
createUserAsync(CreateUserRequest request)
public final OperationFuture<User,OperationMetadata> createUserAsync(CreateUserRequest request)Creates a new User in a given project and location and Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
CreateUserRequest request =
CreateUserRequest.newBuilder()
.setParent(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.setUserId("userId-836030906")
.setUser(User.newBuilder().build())
.setRequestId("requestId693933066")
.build();
User response = cloudFtpClient.createUserAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateUserRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<User,OperationMetadata> |
|
createUserAsync(String parent, User user, String userId)
public final OperationFuture<User,OperationMetadata> createUserAsync(String parent, User user, String userId)Creates a new User in a given project and location and Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
String parent = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString();
User user = User.newBuilder().build();
String userId = "userId-836030906";
User response = cloudFtpClient.createUserAsync(parent, user, userId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. Value for parent. |
user |
UserRequired. The resource being created |
userId |
StringRequired. A unique user ID for the SFTP user. The user ID must start with a lowercase letter and can include lowercase letters, numbers, or hyphens. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<User,OperationMetadata> |
|
createUserCallable()
public final UnaryCallable<CreateUserRequest,Operation> createUserCallable()Creates a new User in a given project and location and Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
CreateUserRequest request =
CreateUserRequest.newBuilder()
.setParent(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.setUserId("userId-836030906")
.setUser(User.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = cloudFtpClient.createUserCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateUserRequest,Operation> |
|
createUserOperationCallable()
public final OperationCallable<CreateUserRequest,User,OperationMetadata> createUserOperationCallable()Creates a new User in a given project and location and Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
CreateUserRequest request =
CreateUserRequest.newBuilder()
.setParent(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.setUserId("userId-836030906")
.setUser(User.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<User, OperationMetadata> future =
cloudFtpClient.createUserOperationCallable().futureCall(request);
// Do something.
User response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateUserRequest,User,OperationMetadata> |
|
deleteServerAsync(@Nullable ServerName name)
public final OperationFuture<Empty,OperationMetadata> deleteServerAsync(@Nullable ServerName name)Deletes a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ServerName name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
cloudFtpClient.deleteServerAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.ftp.v1.ServerNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteServerAsync(DeleteServerRequest request)
public final OperationFuture<Empty,OperationMetadata> deleteServerAsync(DeleteServerRequest request)Deletes a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
DeleteServerRequest request =
DeleteServerRequest.newBuilder()
.setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.build();
cloudFtpClient.deleteServerAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteServerRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteServerAsync(String name)
public final OperationFuture<Empty,OperationMetadata> deleteServerAsync(String name)Deletes a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
String name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString();
cloudFtpClient.deleteServerAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteServerCallable()
public final UnaryCallable<DeleteServerRequest,Operation> deleteServerCallable()Deletes a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
DeleteServerRequest request =
DeleteServerRequest.newBuilder()
.setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.build();
ApiFuture<Operation> future = cloudFtpClient.deleteServerCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteServerRequest,Operation> |
|
deleteServerOperationCallable()
public final OperationCallable<DeleteServerRequest,Empty,OperationMetadata> deleteServerOperationCallable()Deletes a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
DeleteServerRequest request =
DeleteServerRequest.newBuilder()
.setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
cloudFtpClient.deleteServerOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteServerRequest,Empty,OperationMetadata> |
|
deleteUserAsync(@Nullable UserName name)
public final OperationFuture<Empty,OperationMetadata> deleteUserAsync(@Nullable UserName name)Deletes a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]");
cloudFtpClient.deleteUserAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.ftp.v1.UserNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteUserAsync(DeleteUserRequest request)
public final OperationFuture<Empty,OperationMetadata> deleteUserAsync(DeleteUserRequest request)Deletes a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
DeleteUserRequest request =
DeleteUserRequest.newBuilder()
.setName(UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString())
.setForce(true)
.build();
cloudFtpClient.deleteUserAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteUserRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteUserAsync(String name)
public final OperationFuture<Empty,OperationMetadata> deleteUserAsync(String name)Deletes a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
String name = UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString();
cloudFtpClient.deleteUserAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteUserCallable()
public final UnaryCallable<DeleteUserRequest,Operation> deleteUserCallable()Deletes a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
DeleteUserRequest request =
DeleteUserRequest.newBuilder()
.setName(UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString())
.setForce(true)
.build();
ApiFuture<Operation> future = cloudFtpClient.deleteUserCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteUserRequest,Operation> |
|
deleteUserOperationCallable()
public final OperationCallable<DeleteUserRequest,Empty,OperationMetadata> deleteUserOperationCallable()Deletes a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
DeleteUserRequest request =
DeleteUserRequest.newBuilder()
.setName(UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString())
.setForce(true)
.build();
OperationFuture<Empty, OperationMetadata> future =
cloudFtpClient.deleteUserOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteUserRequest,Empty,OperationMetadata> |
|
getHttpJsonOperationsClient()
public final OperationsClient getHttpJsonOperationsClient()Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
| Returns | |
|---|---|
| Type | Description |
OperationsClient |
|
getLocation(GetLocationRequest request)
public final Location getLocation(GetLocationRequest request)Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = cloudFtpClient.getLocation(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.GetLocationRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.cloud.location.Location |
|
getLocationCallable()
public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = cloudFtpClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
|
getServer(@Nullable ServerName name)
public final Server getServer(@Nullable ServerName name)Gets details of a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ServerName name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
Server response = cloudFtpClient.getServer(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.ftp.v1.ServerNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
Server |
|
getServer(GetServerRequest request)
public final Server getServer(GetServerRequest request)Gets details of a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
GetServerRequest request =
GetServerRequest.newBuilder()
.setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.setView(ServerView.forNumber(0))
.build();
Server response = cloudFtpClient.getServer(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetServerRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Server |
|
getServer(String name)
public final Server getServer(String name)Gets details of a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
String name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString();
Server response = cloudFtpClient.getServer(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
Server |
|
getServerCallable()
public final UnaryCallable<GetServerRequest,Server> getServerCallable()Gets details of a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
GetServerRequest request =
GetServerRequest.newBuilder()
.setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.setView(ServerView.forNumber(0))
.build();
ApiFuture<Server> future = cloudFtpClient.getServerCallable().futureCall(request);
// Do something.
Server response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetServerRequest,Server> |
|
getSettings()
public final @Nullable CloudFtpSettings getSettings()| Returns | |
|---|---|
| Type | Description |
@org.jspecify.annotations.Nullable com.google.cloud.ftp.v1.CloudFtpSettings |
|
getStub()
public CloudFtpStub getStub()| Returns | |
|---|---|
| Type | Description |
CloudFtpStub |
|
getUser(@Nullable UserName name)
public final User getUser(@Nullable UserName name)Gets details of a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]");
User response = cloudFtpClient.getUser(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.ftp.v1.UserNameRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
User |
|
getUser(GetUserRequest request)
public final User getUser(GetUserRequest request)Gets details of a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
GetUserRequest request =
GetUserRequest.newBuilder()
.setName(UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString())
.setView(UserView.forNumber(0))
.build();
User response = cloudFtpClient.getUser(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetUserRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
User |
|
getUser(String name)
public final User getUser(String name)Gets details of a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
String name = UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString();
User response = cloudFtpClient.getUser(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource |
| Returns | |
|---|---|
| Type | Description |
User |
|
getUserCallable()
public final UnaryCallable<GetUserRequest,User> getUserCallable()Gets details of a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
GetUserRequest request =
GetUserRequest.newBuilder()
.setName(UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString())
.setView(UserView.forNumber(0))
.build();
ApiFuture<User> future = cloudFtpClient.getUserCallable().futureCall(request);
// Do something.
User response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetUserRequest,User> |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listLocations(ListLocationsRequest request)
public final CloudFtpClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)Lists information about the supported locations for this service.
This method lists locations based on the resource scope provided inthe
ListLocationsRequest.name field:
***Global locations**: If name is empty, the method lists thepublic
locations available to all projects. * **Project-specificlocations**: If
name follows the formatprojects/{project}, the method lists locations visible to
thatspecific project. This includes public, private, or otherproject-specific locations enabled
for the project.
For gRPC and client library implementations, the resource name ispassed as the name field.
For direct service calls, the resourcename isincorporated into the request path based on the
specific serviceimplementation and version.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : cloudFtpClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.ListLocationsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CloudFtpClient.ListLocationsPagedResponse |
|
listLocationsCallable()
public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()Lists information about the supported locations for this service.
This method lists locations based on the resource scope provided inthe
ListLocationsRequest.name field:
***Global locations**: If name is empty, the method lists thepublic
locations available to all projects. * **Project-specificlocations**: If
name follows the formatprojects/{project}, the method lists locations visible to
thatspecific project. This includes public, private, or otherproject-specific locations enabled
for the project.
For gRPC and client library implementations, the resource name ispassed as the name field.
For direct service calls, the resourcename isincorporated into the request path based on the
specific serviceimplementation and version.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response = cloudFtpClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
|
listLocationsPagedCallable()
public final UnaryCallable<ListLocationsRequest,CloudFtpClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.
This method lists locations based on the resource scope provided inthe
ListLocationsRequest.name field:
***Global locations**: If name is empty, the method lists thepublic
locations available to all projects. * **Project-specificlocations**: If
name follows the formatprojects/{project}, the method lists locations visible to
thatspecific project. This includes public, private, or otherproject-specific locations enabled
for the project.
For gRPC and client library implementations, the resource name ispassed as the name field.
For direct service calls, the resourcename isincorporated into the request path based on the
specific serviceimplementation and version.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future = cloudFtpClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
|
listServers(@Nullable LocationName parent)
public final CloudFtpClient.ListServersPagedResponse listServers(@Nullable LocationName parent)Lists Servers in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Server element : cloudFtpClient.listServers(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.ftp.v1.LocationNameRequired. Parent value for ListServersRequest |
| Returns | |
|---|---|
| Type | Description |
CloudFtpClient.ListServersPagedResponse |
|
listServers(ListServersRequest request)
public final CloudFtpClient.ListServersPagedResponse listServers(ListServersRequest request)Lists Servers in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ListServersRequest request =
ListServersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setView(ServerView.forNumber(0))
.build();
for (Server element : cloudFtpClient.listServers(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListServersRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CloudFtpClient.ListServersPagedResponse |
|
listServers(String parent)
public final CloudFtpClient.ListServersPagedResponse listServers(String parent)Lists Servers in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Server element : cloudFtpClient.listServers(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ListServersRequest |
| Returns | |
|---|---|
| Type | Description |
CloudFtpClient.ListServersPagedResponse |
|
listServersCallable()
public final UnaryCallable<ListServersRequest,ListServersResponse> listServersCallable()Lists Servers in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ListServersRequest request =
ListServersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setView(ServerView.forNumber(0))
.build();
while (true) {
ListServersResponse response = cloudFtpClient.listServersCallable().call(request);
for (Server element : response.getServersList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListServersRequest,ListServersResponse> |
|
listServersPagedCallable()
public final UnaryCallable<ListServersRequest,CloudFtpClient.ListServersPagedResponse> listServersPagedCallable()Lists Servers in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ListServersRequest request =
ListServersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setView(ServerView.forNumber(0))
.build();
ApiFuture<Server> future = cloudFtpClient.listServersPagedCallable().futureCall(request);
// Do something.
for (Server element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListServersRequest,ListServersPagedResponse> |
|
listUsers(@Nullable ServerName parent)
public final CloudFtpClient.ListUsersPagedResponse listUsers(@Nullable ServerName parent)Lists Users in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ServerName parent = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
for (User element : cloudFtpClient.listUsers(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.ftp.v1.ServerNameRequired. Parent value for ListUsersRequest |
| Returns | |
|---|---|
| Type | Description |
CloudFtpClient.ListUsersPagedResponse |
|
listUsers(ListUsersRequest request)
public final CloudFtpClient.ListUsersPagedResponse listUsers(ListUsersRequest request)Lists Users in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ListUsersRequest request =
ListUsersRequest.newBuilder()
.setParent(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setView(UserView.forNumber(0))
.build();
for (User element : cloudFtpClient.listUsers(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListUsersRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
CloudFtpClient.ListUsersPagedResponse |
|
listUsers(String parent)
public final CloudFtpClient.ListUsersPagedResponse listUsers(String parent)Lists Users in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
String parent = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString();
for (User element : cloudFtpClient.listUsers(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. Parent value for ListUsersRequest |
| Returns | |
|---|---|
| Type | Description |
CloudFtpClient.ListUsersPagedResponse |
|
listUsersCallable()
public final UnaryCallable<ListUsersRequest,ListUsersResponse> listUsersCallable()Lists Users in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ListUsersRequest request =
ListUsersRequest.newBuilder()
.setParent(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setView(UserView.forNumber(0))
.build();
while (true) {
ListUsersResponse response = cloudFtpClient.listUsersCallable().call(request);
for (User element : response.getUsersList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListUsersRequest,ListUsersResponse> |
|
listUsersPagedCallable()
public final UnaryCallable<ListUsersRequest,CloudFtpClient.ListUsersPagedResponse> listUsersPagedCallable()Lists Users in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ListUsersRequest request =
ListUsersRequest.newBuilder()
.setParent(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setView(UserView.forNumber(0))
.build();
ApiFuture<User> future = cloudFtpClient.listUsersPagedCallable().futureCall(request);
// Do something.
for (User element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListUsersRequest,ListUsersPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()startServerAsync(@Nullable ServerName name)
public final OperationFuture<Server,OperationMetadata> startServerAsync(@Nullable ServerName name)Starts a stopping/stopped Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ServerName name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
Server response = cloudFtpClient.startServerAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.ftp.v1.ServerNameRequired. Name of the resource Format:
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Server,OperationMetadata> |
|
startServerAsync(StartServerRequest request)
public final OperationFuture<Server,OperationMetadata> startServerAsync(StartServerRequest request)Starts a stopping/stopped Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
StartServerRequest request =
StartServerRequest.newBuilder()
.setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.build();
Server response = cloudFtpClient.startServerAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
StartServerRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Server,OperationMetadata> |
|
startServerAsync(String name)
public final OperationFuture<Server,OperationMetadata> startServerAsync(String name)Starts a stopping/stopped Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
String name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString();
Server response = cloudFtpClient.startServerAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource Format:
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Server,OperationMetadata> |
|
startServerCallable()
public final UnaryCallable<StartServerRequest,Operation> startServerCallable()Starts a stopping/stopped Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
StartServerRequest request =
StartServerRequest.newBuilder()
.setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.build();
ApiFuture<Operation> future = cloudFtpClient.startServerCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<StartServerRequest,Operation> |
|
startServerOperationCallable()
public final OperationCallable<StartServerRequest,Server,OperationMetadata> startServerOperationCallable()Starts a stopping/stopped Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
StartServerRequest request =
StartServerRequest.newBuilder()
.setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.build();
OperationFuture<Server, OperationMetadata> future =
cloudFtpClient.startServerOperationCallable().futureCall(request);
// Do something.
Server response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<StartServerRequest,Server,OperationMetadata> |
|
stopServerAsync(@Nullable ServerName name)
public final OperationFuture<Server,OperationMetadata> stopServerAsync(@Nullable ServerName name)Stops an active Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
ServerName name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
Server response = cloudFtpClient.stopServerAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.ftp.v1.ServerNameRequired. Name of the resource. Format:
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Server,OperationMetadata> |
|
stopServerAsync(StopServerRequest request)
public final OperationFuture<Server,OperationMetadata> stopServerAsync(StopServerRequest request)Stops an active Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
StopServerRequest request =
StopServerRequest.newBuilder()
.setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.build();
Server response = cloudFtpClient.stopServerAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
StopServerRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Server,OperationMetadata> |
|
stopServerAsync(String name)
public final OperationFuture<Server,OperationMetadata> stopServerAsync(String name)Stops an active Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
String name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString();
Server response = cloudFtpClient.stopServerAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. Name of the resource. Format:
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Server,OperationMetadata> |
|
stopServerCallable()
public final UnaryCallable<StopServerRequest,Operation> stopServerCallable()Stops an active Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
StopServerRequest request =
StopServerRequest.newBuilder()
.setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.build();
ApiFuture<Operation> future = cloudFtpClient.stopServerCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<StopServerRequest,Operation> |
|
stopServerOperationCallable()
public final OperationCallable<StopServerRequest,Server,OperationMetadata> stopServerOperationCallable()Stops an active Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
StopServerRequest request =
StopServerRequest.newBuilder()
.setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
.build();
OperationFuture<Server, OperationMetadata> future =
cloudFtpClient.stopServerOperationCallable().futureCall(request);
// Do something.
Server response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<StopServerRequest,Server,OperationMetadata> |
|
updateServerAsync(Server server, FieldMask updateMask)
public final OperationFuture<Server,OperationMetadata> updateServerAsync(Server server, FieldMask updateMask)Updates the parameters of a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
Server server = Server.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Server response = cloudFtpClient.updateServerAsync(server, updateMask).get();
}
| Parameters | |
|---|---|
| Name | Description |
server |
ServerRequired. The resource being updated |
updateMask |
FieldMaskOptional. Field mask is used to specify the fields to be overwritten in the Server resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields present in the request will be overwritten. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Server,OperationMetadata> |
|
updateServerAsync(UpdateServerRequest request)
public final OperationFuture<Server,OperationMetadata> updateServerAsync(UpdateServerRequest request)Updates the parameters of a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
UpdateServerRequest request =
UpdateServerRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setServer(Server.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Server response = cloudFtpClient.updateServerAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateServerRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Server,OperationMetadata> |
|
updateServerCallable()
public final UnaryCallable<UpdateServerRequest,Operation> updateServerCallable()Updates the parameters of a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
UpdateServerRequest request =
UpdateServerRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setServer(Server.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = cloudFtpClient.updateServerCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateServerRequest,Operation> |
|
updateServerOperationCallable()
public final OperationCallable<UpdateServerRequest,Server,OperationMetadata> updateServerOperationCallable()Updates the parameters of a single Server.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
UpdateServerRequest request =
UpdateServerRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setServer(Server.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Server, OperationMetadata> future =
cloudFtpClient.updateServerOperationCallable().futureCall(request);
// Do something.
Server response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateServerRequest,Server,OperationMetadata> |
|
updateUserAsync(UpdateUserRequest request)
public final OperationFuture<User,OperationMetadata> updateUserAsync(UpdateUserRequest request)Updates the parameters of a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
UpdateUserRequest request =
UpdateUserRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setUser(User.newBuilder().build())
.build();
User response = cloudFtpClient.updateUserAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateUserRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<User,OperationMetadata> |
|
updateUserAsync(User user, FieldMask updateMask)
public final OperationFuture<User,OperationMetadata> updateUserAsync(User user, FieldMask updateMask)Updates the parameters of a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
User user = User.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
User response = cloudFtpClient.updateUserAsync(user, updateMask).get();
}
| Parameters | |
|---|---|
| Name | Description |
user |
UserRequired. The resource being updated |
updateMask |
FieldMaskOptional. Field mask is used to specify the fields to be overwritten in the User resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields present in the request will be overwritten. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<User,OperationMetadata> |
|
updateUserCallable()
public final UnaryCallable<UpdateUserRequest,Operation> updateUserCallable()Updates the parameters of a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
UpdateUserRequest request =
UpdateUserRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setUser(User.newBuilder().build())
.build();
ApiFuture<Operation> future = cloudFtpClient.updateUserCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateUserRequest,Operation> |
|
updateUserOperationCallable()
public final OperationCallable<UpdateUserRequest,User,OperationMetadata> updateUserOperationCallable()Updates the parameters of a single User.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
UpdateUserRequest request =
UpdateUserRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setUser(User.newBuilder().build())
.build();
OperationFuture<User, OperationMetadata> future =
cloudFtpClient.updateUserOperationCallable().futureCall(request);
// Do something.
User response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateUserRequest,User,OperationMetadata> |
|