我有一个工作代码,可以通过http请求通过dataflow-template将数据加载到bigtable。我想更改它以与c#的nuget客户端库一起使用,但是我可以找到任何示例,但是reference并非如此有用的...有人可以给我任何参考,我应该如何使用此客户端?
我现有的代码就是这样
using (var client = new HttpClient())
{
var obj = new requestFormat
{
jobName = fileName,
parameters = new parameters
{
bigtableInstanceId = "ariel",
bigtableProjectId = cloudProjectId,
bigtableTableId = "ariel",
inputFilePattern = $"gs://{bucketName}/{fileName}.avro"
}
};
var objStr = JsonConvert.SerializeObject(obj);
var content = new StringContent(objStr, Encoding.UTF8, "application/json");
var response = client.PostAsync("https://dataflow.googleapis.com/v1b3/projects/proj/templates:launch?gcsPath=gs://dataflow-templates/latest/GCS_Avro_to_Cloud_Bigtable", content).Result;
var responseString = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(responseString);
}
我继承了