Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3116

looking for usage example of dataflow client for c# (nuget) - running job by template

$
0
0

I have a working code to load data to bigtable by dataflow-template by http request.I want to change it to work with the nuget client library for c#, but I can find any example, and the refernce is not so helpfull... can someone give me any reference how should I use this client?

my existing code is like that

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);        }

Viewing all articles
Browse latest Browse all 3116

Trending Articles