@Generated(value="by gapic-generator") @BetaApi public class DataTransferServiceClient extends Object implements BackgroundResource
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:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
DataSourceName name = ProjectDataSourceName.of("[PROJECT]", "[DATA_SOURCE]");
DataSource response = dataTransferServiceClient.getDataSource(name);
}
Note: close() needs to be called on the dataTransferServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
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 DataTransferServiceSettings to create(). For example:
To customize credentials:
DataTransferServiceSettings dataTransferServiceSettings =
DataTransferServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DataTransferServiceClient dataTransferServiceClient =
DataTransferServiceClient.create(dataTransferServiceSettings);
To customize the endpoint:
DataTransferServiceSettings dataTransferServiceSettings =
DataTransferServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
DataTransferServiceClient dataTransferServiceClient =
DataTransferServiceClient.create(dataTransferServiceSettings);
Modifier and Type | Class and Description |
---|---|
static class |
DataTransferServiceClient.ListDataSourcesFixedSizeCollection |
static class |
DataTransferServiceClient.ListDataSourcesPage |
static class |
DataTransferServiceClient.ListDataSourcesPagedResponse |
static class |
DataTransferServiceClient.ListTransferConfigsFixedSizeCollection |
static class |
DataTransferServiceClient.ListTransferConfigsPage |
static class |
DataTransferServiceClient.ListTransferConfigsPagedResponse |
static class |
DataTransferServiceClient.ListTransferLogsFixedSizeCollection |
static class |
DataTransferServiceClient.ListTransferLogsPage |
static class |
DataTransferServiceClient.ListTransferLogsPagedResponse |
static class |
DataTransferServiceClient.ListTransferRunsFixedSizeCollection |
static class |
DataTransferServiceClient.ListTransferRunsPage |
static class |
DataTransferServiceClient.ListTransferRunsPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
DataTransferServiceClient(DataTransferServiceSettings settings)
Constructs an instance of DataTransferServiceClient, using the given settings.
|
protected |
DataTransferServiceClient(DataTransferServiceStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse |
checkValidCreds(com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest request)
Returns true if valid credentials exist for the given data source and requesting user.
|
com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse |
checkValidCreds(com.google.cloud.bigquery.datatransfer.v1.DataSourceName name)
Returns true if valid credentials exist for the given data source and requesting user.
|
com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse |
checkValidCreds(String name)
Returns true if valid credentials exist for the given data source and requesting user.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest,com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse> |
checkValidCredsCallable()
Returns true if valid credentials exist for the given data source and requesting user.
|
void |
close() |
static DataTransferServiceClient |
create()
Constructs an instance of DataTransferServiceClient with default settings.
|
static DataTransferServiceClient |
create(DataTransferServiceSettings settings)
Constructs an instance of DataTransferServiceClient, using the given settings.
|
static DataTransferServiceClient |
create(DataTransferServiceStub stub)
Constructs an instance of DataTransferServiceClient, using the given stub for making calls.
|
com.google.cloud.bigquery.datatransfer.v1.TransferConfig |
createTransferConfig(com.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest request)
Creates a new data transfer configuration.
|
com.google.cloud.bigquery.datatransfer.v1.TransferConfig |
createTransferConfig(com.google.cloud.bigquery.datatransfer.v1.ParentName parent,
com.google.cloud.bigquery.datatransfer.v1.TransferConfig transferConfig)
Creates a new data transfer configuration.
|
com.google.cloud.bigquery.datatransfer.v1.TransferConfig |
createTransferConfig(String parent,
com.google.cloud.bigquery.datatransfer.v1.TransferConfig transferConfig)
Creates a new data transfer configuration.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest,com.google.cloud.bigquery.datatransfer.v1.TransferConfig> |
createTransferConfigCallable()
Creates a new data transfer configuration.
|
void |
deleteTransferConfig(com.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest request)
Deletes a data transfer configuration, including any associated transfer runs and logs.
|
void |
deleteTransferConfig(String name)
Deletes a data transfer configuration, including any associated transfer runs and logs.
|
void |
deleteTransferConfig(com.google.cloud.bigquery.datatransfer.v1.TransferConfigName name)
Deletes a data transfer configuration, including any associated transfer runs and logs.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest,Empty> |
deleteTransferConfigCallable()
Deletes a data transfer configuration, including any associated transfer runs and logs.
|
void |
deleteTransferRun(com.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest request)
Deletes the specified transfer run.
|
void |
deleteTransferRun(com.google.cloud.bigquery.datatransfer.v1.RunName name)
Deletes the specified transfer run.
|
void |
deleteTransferRun(String name)
Deletes the specified transfer run.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest,Empty> |
deleteTransferRunCallable()
Deletes the specified transfer run.
|
com.google.cloud.bigquery.datatransfer.v1.DataSource |
getDataSource(com.google.cloud.bigquery.datatransfer.v1.DataSourceName name)
Retrieves a supported data source and returns its settings, which can be used for UI rendering.
|
com.google.cloud.bigquery.datatransfer.v1.DataSource |
getDataSource(com.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest request)
Retrieves a supported data source and returns its settings, which can be used for UI rendering.
|
com.google.cloud.bigquery.datatransfer.v1.DataSource |
getDataSource(String name)
Retrieves a supported data source and returns its settings, which can be used for UI rendering.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest,com.google.cloud.bigquery.datatransfer.v1.DataSource> |
getDataSourceCallable()
Retrieves a supported data source and returns its settings, which can be used for UI rendering.
|
DataTransferServiceSettings |
getSettings() |
DataTransferServiceStub |
getStub() |
com.google.cloud.bigquery.datatransfer.v1.TransferConfig |
getTransferConfig(com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest request)
Returns information about a data transfer config.
|
com.google.cloud.bigquery.datatransfer.v1.TransferConfig |
getTransferConfig(String name)
Returns information about a data transfer config.
|
com.google.cloud.bigquery.datatransfer.v1.TransferConfig |
getTransferConfig(com.google.cloud.bigquery.datatransfer.v1.TransferConfigName name)
Returns information about a data transfer config.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest,com.google.cloud.bigquery.datatransfer.v1.TransferConfig> |
getTransferConfigCallable()
Returns information about a data transfer config.
|
com.google.cloud.bigquery.datatransfer.v1.TransferRun |
getTransferRun(com.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest request)
Returns information about the particular transfer run.
|
com.google.cloud.bigquery.datatransfer.v1.TransferRun |
getTransferRun(com.google.cloud.bigquery.datatransfer.v1.RunName name)
Returns information about the particular transfer run.
|
com.google.cloud.bigquery.datatransfer.v1.TransferRun |
getTransferRun(String name)
Returns information about the particular transfer run.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest,com.google.cloud.bigquery.datatransfer.v1.TransferRun> |
getTransferRunCallable()
Returns information about the particular transfer run.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
DataTransferServiceClient.ListDataSourcesPagedResponse |
listDataSources(com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest request)
Lists supported data sources and returns their settings, which can be used for UI rendering.
|
DataTransferServiceClient.ListDataSourcesPagedResponse |
listDataSources(com.google.cloud.bigquery.datatransfer.v1.ParentName parent)
Lists supported data sources and returns their settings, which can be used for UI rendering.
|
DataTransferServiceClient.ListDataSourcesPagedResponse |
listDataSources(String parent)
Lists supported data sources and returns their settings, which can be used for UI rendering.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest,com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse> |
listDataSourcesCallable()
Lists supported data sources and returns their settings, which can be used for UI rendering.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest,DataTransferServiceClient.ListDataSourcesPagedResponse> |
listDataSourcesPagedCallable()
Lists supported data sources and returns their settings, which can be used for UI rendering.
|
DataTransferServiceClient.ListTransferConfigsPagedResponse |
listTransferConfigs(com.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest request)
Returns information about all data transfers in the project.
|
DataTransferServiceClient.ListTransferConfigsPagedResponse |
listTransferConfigs(com.google.cloud.bigquery.datatransfer.v1.ParentName parent)
Returns information about all data transfers in the project.
|
DataTransferServiceClient.ListTransferConfigsPagedResponse |
listTransferConfigs(String parent)
Returns information about all data transfers in the project.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest,com.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse> |
listTransferConfigsCallable()
Returns information about all data transfers in the project.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest,DataTransferServiceClient.ListTransferConfigsPagedResponse> |
listTransferConfigsPagedCallable()
Returns information about all data transfers in the project.
|
DataTransferServiceClient.ListTransferLogsPagedResponse |
listTransferLogs(com.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest request)
Returns user facing log messages for the data transfer run.
|
DataTransferServiceClient.ListTransferLogsPagedResponse |
listTransferLogs(com.google.cloud.bigquery.datatransfer.v1.RunName parent)
Returns user facing log messages for the data transfer run.
|
DataTransferServiceClient.ListTransferLogsPagedResponse |
listTransferLogs(String parent)
Returns user facing log messages for the data transfer run.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest,com.google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse> |
listTransferLogsCallable()
Returns user facing log messages for the data transfer run.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest,DataTransferServiceClient.ListTransferLogsPagedResponse> |
listTransferLogsPagedCallable()
Returns user facing log messages for the data transfer run.
|
DataTransferServiceClient.ListTransferRunsPagedResponse |
listTransferRuns(com.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest request)
Returns information about running and completed jobs.
|
DataTransferServiceClient.ListTransferRunsPagedResponse |
listTransferRuns(String parent)
Returns information about running and completed jobs.
|
DataTransferServiceClient.ListTransferRunsPagedResponse |
listTransferRuns(com.google.cloud.bigquery.datatransfer.v1.TransferConfigName parent)
Returns information about running and completed jobs.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest,com.google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse> |
listTransferRunsCallable()
Returns information about running and completed jobs.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest,DataTransferServiceClient.ListTransferRunsPagedResponse> |
listTransferRunsPagedCallable()
Returns information about running and completed jobs.
|
com.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse |
scheduleTransferRuns(com.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest request)
Creates transfer runs for a time range [start_time, end_time].
|
com.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse |
scheduleTransferRuns(String parent,
Timestamp startTime,
Timestamp endTime)
Creates transfer runs for a time range [start_time, end_time].
|
com.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse |
scheduleTransferRuns(com.google.cloud.bigquery.datatransfer.v1.TransferConfigName parent,
Timestamp startTime,
Timestamp endTime)
Creates transfer runs for a time range [start_time, end_time].
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest,com.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse> |
scheduleTransferRunsCallable()
Creates transfer runs for a time range [start_time, end_time].
|
void |
shutdown() |
void |
shutdownNow() |
com.google.cloud.bigquery.datatransfer.v1.TransferConfig |
updateTransferConfig(com.google.cloud.bigquery.datatransfer.v1.TransferConfig transferConfig,
FieldMask updateMask)
Updates a data transfer configuration.
|
com.google.cloud.bigquery.datatransfer.v1.TransferConfig |
updateTransferConfig(com.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest request)
Updates a data transfer configuration.
|
UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest,com.google.cloud.bigquery.datatransfer.v1.TransferConfig> |
updateTransferConfigCallable()
Updates a data transfer configuration.
|
protected DataTransferServiceClient(DataTransferServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected DataTransferServiceClient(DataTransferServiceStub stub)
public static final DataTransferServiceClient create() throws IOException
IOException
public static final DataTransferServiceClient create(DataTransferServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final DataTransferServiceClient create(DataTransferServiceStub stub)
public final DataTransferServiceSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public DataTransferServiceStub getStub()
public final com.google.cloud.bigquery.datatransfer.v1.DataSource getDataSource(com.google.cloud.bigquery.datatransfer.v1.DataSourceName name)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
DataSourceName name = ProjectDataSourceName.of("[PROJECT]", "[DATA_SOURCE]");
DataSource response = dataTransferServiceClient.getDataSource(name);
}
name
- The field will contain name of the resource requested, for example:
`projects/{project_id}/dataSources/{data_source_id}`ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.DataSource getDataSource(String name)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
DataSourceName name = ProjectDataSourceName.of("[PROJECT]", "[DATA_SOURCE]");
DataSource response = dataTransferServiceClient.getDataSource(name.toString());
}
name
- The field will contain name of the resource requested, for example:
`projects/{project_id}/dataSources/{data_source_id}`ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.DataSource getDataSource(com.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
DataSourceName name = ProjectDataSourceName.of("[PROJECT]", "[DATA_SOURCE]");
GetDataSourceRequest request = GetDataSourceRequest.newBuilder()
.setName(name.toString())
.build();
DataSource response = dataTransferServiceClient.getDataSource(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest,com.google.cloud.bigquery.datatransfer.v1.DataSource> getDataSourceCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
DataSourceName name = ProjectDataSourceName.of("[PROJECT]", "[DATA_SOURCE]");
GetDataSourceRequest request = GetDataSourceRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<DataSource> future = dataTransferServiceClient.getDataSourceCallable().futureCall(request);
// Do something
DataSource response = future.get();
}
public final DataTransferServiceClient.ListDataSourcesPagedResponse listDataSources(com.google.cloud.bigquery.datatransfer.v1.ParentName parent)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
for (DataSource element : dataTransferServiceClient.listDataSources(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The BigQuery project id for which data sources should be returned. Must be in the
form: `projects/{project_id}`ApiException
- if the remote call failspublic final DataTransferServiceClient.ListDataSourcesPagedResponse listDataSources(String parent)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
for (DataSource element : dataTransferServiceClient.listDataSources(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The BigQuery project id for which data sources should be returned. Must be in the
form: `projects/{project_id}`ApiException
- if the remote call failspublic final DataTransferServiceClient.ListDataSourcesPagedResponse listDataSources(com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
ListDataSourcesRequest request = ListDataSourcesRequest.newBuilder()
.setParent(parent.toString())
.build();
for (DataSource element : dataTransferServiceClient.listDataSources(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest,DataTransferServiceClient.ListDataSourcesPagedResponse> listDataSourcesPagedCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
ListDataSourcesRequest request = ListDataSourcesRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListDataSourcesPagedResponse> future = dataTransferServiceClient.listDataSourcesPagedCallable().futureCall(request);
// Do something
for (DataSource element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest,com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse> listDataSourcesCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
ListDataSourcesRequest request = ListDataSourcesRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListDataSourcesResponse response = dataTransferServiceClient.listDataSourcesCallable().call(request);
for (DataSource element : response.getDataSourcesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.bigquery.datatransfer.v1.TransferConfig createTransferConfig(com.google.cloud.bigquery.datatransfer.v1.ParentName parent, com.google.cloud.bigquery.datatransfer.v1.TransferConfig transferConfig)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
TransferConfig transferConfig = TransferConfig.newBuilder().build();
TransferConfig response = dataTransferServiceClient.createTransferConfig(parent, transferConfig);
}
parent
- The BigQuery project id where the transfer configuration should be created. Must
be in the format /projects/{project_id}/locations/{location_id} If specified location and
location of the destination bigquery dataset do not match - the request will fail.transferConfig
- Data transfer configuration to create.ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.TransferConfig createTransferConfig(String parent, com.google.cloud.bigquery.datatransfer.v1.TransferConfig transferConfig)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
TransferConfig transferConfig = TransferConfig.newBuilder().build();
TransferConfig response = dataTransferServiceClient.createTransferConfig(parent.toString(), transferConfig);
}
parent
- The BigQuery project id where the transfer configuration should be created. Must
be in the format /projects/{project_id}/locations/{location_id} If specified location and
location of the destination bigquery dataset do not match - the request will fail.transferConfig
- Data transfer configuration to create.ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.TransferConfig createTransferConfig(com.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
TransferConfig transferConfig = TransferConfig.newBuilder().build();
CreateTransferConfigRequest request = CreateTransferConfigRequest.newBuilder()
.setParent(parent.toString())
.setTransferConfig(transferConfig)
.build();
TransferConfig response = dataTransferServiceClient.createTransferConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest,com.google.cloud.bigquery.datatransfer.v1.TransferConfig> createTransferConfigCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
TransferConfig transferConfig = TransferConfig.newBuilder().build();
CreateTransferConfigRequest request = CreateTransferConfigRequest.newBuilder()
.setParent(parent.toString())
.setTransferConfig(transferConfig)
.build();
ApiFuture<TransferConfig> future = dataTransferServiceClient.createTransferConfigCallable().futureCall(request);
// Do something
TransferConfig response = future.get();
}
public final com.google.cloud.bigquery.datatransfer.v1.TransferConfig updateTransferConfig(com.google.cloud.bigquery.datatransfer.v1.TransferConfig transferConfig, FieldMask updateMask)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfig transferConfig = TransferConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
TransferConfig response = dataTransferServiceClient.updateTransferConfig(transferConfig, updateMask);
}
transferConfig
- Data transfer configuration to create.updateMask
- Required list of fields to be updated in this request.ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.TransferConfig updateTransferConfig(com.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfig transferConfig = TransferConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateTransferConfigRequest request = UpdateTransferConfigRequest.newBuilder()
.setTransferConfig(transferConfig)
.setUpdateMask(updateMask)
.build();
TransferConfig response = dataTransferServiceClient.updateTransferConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest,com.google.cloud.bigquery.datatransfer.v1.TransferConfig> updateTransferConfigCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfig transferConfig = TransferConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateTransferConfigRequest request = UpdateTransferConfigRequest.newBuilder()
.setTransferConfig(transferConfig)
.setUpdateMask(updateMask)
.build();
ApiFuture<TransferConfig> future = dataTransferServiceClient.updateTransferConfigCallable().futureCall(request);
// Do something
TransferConfig response = future.get();
}
public final void deleteTransferConfig(com.google.cloud.bigquery.datatransfer.v1.TransferConfigName name)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName name = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
dataTransferServiceClient.deleteTransferConfig(name);
}
name
- The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}`ApiException
- if the remote call failspublic final void deleteTransferConfig(String name)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName name = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
dataTransferServiceClient.deleteTransferConfig(name.toString());
}
name
- The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}`ApiException
- if the remote call failspublic final void deleteTransferConfig(com.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName name = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
DeleteTransferConfigRequest request = DeleteTransferConfigRequest.newBuilder()
.setName(name.toString())
.build();
dataTransferServiceClient.deleteTransferConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest,Empty> deleteTransferConfigCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName name = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
DeleteTransferConfigRequest request = DeleteTransferConfigRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = dataTransferServiceClient.deleteTransferConfigCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.cloud.bigquery.datatransfer.v1.TransferConfig getTransferConfig(com.google.cloud.bigquery.datatransfer.v1.TransferConfigName name)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName name = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
TransferConfig response = dataTransferServiceClient.getTransferConfig(name);
}
name
- The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}`ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.TransferConfig getTransferConfig(String name)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName name = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
TransferConfig response = dataTransferServiceClient.getTransferConfig(name.toString());
}
name
- The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}`ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.TransferConfig getTransferConfig(com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName name = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
GetTransferConfigRequest request = GetTransferConfigRequest.newBuilder()
.setName(name.toString())
.build();
TransferConfig response = dataTransferServiceClient.getTransferConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest,com.google.cloud.bigquery.datatransfer.v1.TransferConfig> getTransferConfigCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName name = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
GetTransferConfigRequest request = GetTransferConfigRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<TransferConfig> future = dataTransferServiceClient.getTransferConfigCallable().futureCall(request);
// Do something
TransferConfig response = future.get();
}
public final DataTransferServiceClient.ListTransferConfigsPagedResponse listTransferConfigs(com.google.cloud.bigquery.datatransfer.v1.ParentName parent)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
for (TransferConfig element : dataTransferServiceClient.listTransferConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The BigQuery project id for which data sources should be returned:
`projects/{project_id}`.ApiException
- if the remote call failspublic final DataTransferServiceClient.ListTransferConfigsPagedResponse listTransferConfigs(String parent)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
for (TransferConfig element : dataTransferServiceClient.listTransferConfigs(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- The BigQuery project id for which data sources should be returned:
`projects/{project_id}`.ApiException
- if the remote call failspublic final DataTransferServiceClient.ListTransferConfigsPagedResponse listTransferConfigs(com.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
ListTransferConfigsRequest request = ListTransferConfigsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (TransferConfig element : dataTransferServiceClient.listTransferConfigs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest,DataTransferServiceClient.ListTransferConfigsPagedResponse> listTransferConfigsPagedCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
ListTransferConfigsRequest request = ListTransferConfigsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListTransferConfigsPagedResponse> future = dataTransferServiceClient.listTransferConfigsPagedCallable().futureCall(request);
// Do something
for (TransferConfig element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest,com.google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse> listTransferConfigsCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
ParentName parent = ProjectName.of("[PROJECT]");
ListTransferConfigsRequest request = ListTransferConfigsRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListTransferConfigsResponse response = dataTransferServiceClient.listTransferConfigsCallable().call(request);
for (TransferConfig element : response.getTransferConfigsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse scheduleTransferRuns(com.google.cloud.bigquery.datatransfer.v1.TransferConfigName parent, Timestamp startTime, Timestamp endTime)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName parent = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
Timestamp startTime = Timestamp.newBuilder().build();
Timestamp endTime = Timestamp.newBuilder().build();
ScheduleTransferRunsResponse response = dataTransferServiceClient.scheduleTransferRuns(parent, startTime, endTime);
}
parent
- Transfer configuration name in the form:
`projects/{project_id}/transferConfigs/{config_id}`.startTime
- Start time of the range of transfer runs. For example,
`"2017-05-25T00:00:00+00:00"`.endTime
- End time of the range of transfer runs. For example,
`"2017-05-30T00:00:00+00:00"`.ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse scheduleTransferRuns(String parent, Timestamp startTime, Timestamp endTime)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName parent = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
Timestamp startTime = Timestamp.newBuilder().build();
Timestamp endTime = Timestamp.newBuilder().build();
ScheduleTransferRunsResponse response = dataTransferServiceClient.scheduleTransferRuns(parent.toString(), startTime, endTime);
}
parent
- Transfer configuration name in the form:
`projects/{project_id}/transferConfigs/{config_id}`.startTime
- Start time of the range of transfer runs. For example,
`"2017-05-25T00:00:00+00:00"`.endTime
- End time of the range of transfer runs. For example,
`"2017-05-30T00:00:00+00:00"`.ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse scheduleTransferRuns(com.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName parent = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
Timestamp startTime = Timestamp.newBuilder().build();
Timestamp endTime = Timestamp.newBuilder().build();
ScheduleTransferRunsRequest request = ScheduleTransferRunsRequest.newBuilder()
.setParent(parent.toString())
.setStartTime(startTime)
.setEndTime(endTime)
.build();
ScheduleTransferRunsResponse response = dataTransferServiceClient.scheduleTransferRuns(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest,com.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse> scheduleTransferRunsCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName parent = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
Timestamp startTime = Timestamp.newBuilder().build();
Timestamp endTime = Timestamp.newBuilder().build();
ScheduleTransferRunsRequest request = ScheduleTransferRunsRequest.newBuilder()
.setParent(parent.toString())
.setStartTime(startTime)
.setEndTime(endTime)
.build();
ApiFuture<ScheduleTransferRunsResponse> future = dataTransferServiceClient.scheduleTransferRunsCallable().futureCall(request);
// Do something
ScheduleTransferRunsResponse response = future.get();
}
public final com.google.cloud.bigquery.datatransfer.v1.TransferRun getTransferRun(com.google.cloud.bigquery.datatransfer.v1.RunName name)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName name = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
TransferRun response = dataTransferServiceClient.getTransferRun(name);
}
name
- The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.TransferRun getTransferRun(String name)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName name = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
TransferRun response = dataTransferServiceClient.getTransferRun(name.toString());
}
name
- The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.TransferRun getTransferRun(com.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName name = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
GetTransferRunRequest request = GetTransferRunRequest.newBuilder()
.setName(name.toString())
.build();
TransferRun response = dataTransferServiceClient.getTransferRun(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest,com.google.cloud.bigquery.datatransfer.v1.TransferRun> getTransferRunCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName name = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
GetTransferRunRequest request = GetTransferRunRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<TransferRun> future = dataTransferServiceClient.getTransferRunCallable().futureCall(request);
// Do something
TransferRun response = future.get();
}
public final void deleteTransferRun(com.google.cloud.bigquery.datatransfer.v1.RunName name)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName name = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
dataTransferServiceClient.deleteTransferRun(name);
}
name
- The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`ApiException
- if the remote call failspublic final void deleteTransferRun(String name)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName name = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
dataTransferServiceClient.deleteTransferRun(name.toString());
}
name
- The field will contain name of the resource requested, for example:
`projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`ApiException
- if the remote call failspublic final void deleteTransferRun(com.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName name = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
DeleteTransferRunRequest request = DeleteTransferRunRequest.newBuilder()
.setName(name.toString())
.build();
dataTransferServiceClient.deleteTransferRun(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest,Empty> deleteTransferRunCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName name = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
DeleteTransferRunRequest request = DeleteTransferRunRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = dataTransferServiceClient.deleteTransferRunCallable().futureCall(request);
// Do something
future.get();
}
public final DataTransferServiceClient.ListTransferRunsPagedResponse listTransferRuns(com.google.cloud.bigquery.datatransfer.v1.TransferConfigName parent)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName parent = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
for (TransferRun element : dataTransferServiceClient.listTransferRuns(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Name of transfer configuration for which transfer runs should be retrieved.
Format of transfer configuration resource name is:
`projects/{project_id}/transferConfigs/{config_id}`.ApiException
- if the remote call failspublic final DataTransferServiceClient.ListTransferRunsPagedResponse listTransferRuns(String parent)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName parent = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
for (TransferRun element : dataTransferServiceClient.listTransferRuns(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Name of transfer configuration for which transfer runs should be retrieved.
Format of transfer configuration resource name is:
`projects/{project_id}/transferConfigs/{config_id}`.ApiException
- if the remote call failspublic final DataTransferServiceClient.ListTransferRunsPagedResponse listTransferRuns(com.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName parent = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
ListTransferRunsRequest request = ListTransferRunsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (TransferRun element : dataTransferServiceClient.listTransferRuns(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest,DataTransferServiceClient.ListTransferRunsPagedResponse> listTransferRunsPagedCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName parent = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
ListTransferRunsRequest request = ListTransferRunsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListTransferRunsPagedResponse> future = dataTransferServiceClient.listTransferRunsPagedCallable().futureCall(request);
// Do something
for (TransferRun element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest,com.google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse> listTransferRunsCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfigName parent = ProjectTransferConfigName.of("[PROJECT]", "[TRANSFER_CONFIG]");
ListTransferRunsRequest request = ListTransferRunsRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListTransferRunsResponse response = dataTransferServiceClient.listTransferRunsCallable().call(request);
for (TransferRun element : response.getTransferRunsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final DataTransferServiceClient.ListTransferLogsPagedResponse listTransferLogs(com.google.cloud.bigquery.datatransfer.v1.RunName parent)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName parent = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
for (TransferMessage element : dataTransferServiceClient.listTransferLogs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Transfer run name in the form:
`projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`.ApiException
- if the remote call failspublic final DataTransferServiceClient.ListTransferLogsPagedResponse listTransferLogs(String parent)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName parent = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
for (TransferMessage element : dataTransferServiceClient.listTransferLogs(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Transfer run name in the form:
`projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`.ApiException
- if the remote call failspublic final DataTransferServiceClient.ListTransferLogsPagedResponse listTransferLogs(com.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName parent = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
ListTransferLogsRequest request = ListTransferLogsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (TransferMessage element : dataTransferServiceClient.listTransferLogs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest,DataTransferServiceClient.ListTransferLogsPagedResponse> listTransferLogsPagedCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName parent = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
ListTransferLogsRequest request = ListTransferLogsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListTransferLogsPagedResponse> future = dataTransferServiceClient.listTransferLogsPagedCallable().futureCall(request);
// Do something
for (TransferMessage element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest,com.google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse> listTransferLogsCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
RunName parent = ProjectRunName.of("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]");
ListTransferLogsRequest request = ListTransferLogsRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListTransferLogsResponse response = dataTransferServiceClient.listTransferLogsCallable().call(request);
for (TransferMessage element : response.getTransferMessagesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse checkValidCreds(com.google.cloud.bigquery.datatransfer.v1.DataSourceName name)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
DataSourceName name = ProjectDataSourceName.of("[PROJECT]", "[DATA_SOURCE]");
CheckValidCredsResponse response = dataTransferServiceClient.checkValidCreds(name);
}
name
- The data source in the form: `projects/{project_id}/dataSources/{data_source_id}`ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse checkValidCreds(String name)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
DataSourceName name = ProjectDataSourceName.of("[PROJECT]", "[DATA_SOURCE]");
CheckValidCredsResponse response = dataTransferServiceClient.checkValidCreds(name.toString());
}
name
- The data source in the form: `projects/{project_id}/dataSources/{data_source_id}`ApiException
- if the remote call failspublic final com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse checkValidCreds(com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest request)
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
DataSourceName name = ProjectDataSourceName.of("[PROJECT]", "[DATA_SOURCE]");
CheckValidCredsRequest request = CheckValidCredsRequest.newBuilder()
.setName(name.toString())
.build();
CheckValidCredsResponse response = dataTransferServiceClient.checkValidCreds(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest,com.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse> checkValidCredsCallable()
Sample code:
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
DataSourceName name = ProjectDataSourceName.of("[PROJECT]", "[DATA_SOURCE]");
CheckValidCredsRequest request = CheckValidCredsRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<CheckValidCredsResponse> future = dataTransferServiceClient.checkValidCredsCallable().futureCall(request);
// Do something
CheckValidCredsResponse response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.