Search in sources :

Example 1 with GetTransferConfigRequest

use of com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest in project java-bigquerydatatransfer by googleapis.

the class GetTransferConfigInfo method getTransferConfigInfo.

public static void getTransferConfigInfo(String configId) throws IOException {
    try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
        GetTransferConfigRequest request = GetTransferConfigRequest.newBuilder().setName(configId).build();
        TransferConfig info = dataTransferServiceClient.getTransferConfig(request);
        System.out.print("Config info retrieved successfully." + info.getName() + "\n");
    } catch (ApiException ex) {
        System.out.print("config not found." + ex.toString());
    }
}
Also used : DataTransferServiceClient(com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient) GetTransferConfigRequest(com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest) TransferConfig(com.google.cloud.bigquery.datatransfer.v1.TransferConfig) ApiException(com.google.api.gax.rpc.ApiException)

Aggregations

ApiException (com.google.api.gax.rpc.ApiException)1 DataTransferServiceClient (com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient)1 GetTransferConfigRequest (com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest)1 TransferConfig (com.google.cloud.bigquery.datatransfer.v1.TransferConfig)1