Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataflow: ListJobs API is missing name request parameter #11511

Open
kberezin-nshl opened this issue Mar 24, 2025 · 7 comments
Open

Dataflow: ListJobs API is missing name request parameter #11511

kberezin-nshl opened this issue Mar 24, 2025 · 7 comments
Assignees

Comments

@kberezin-nshl
Copy link

ListJobsRequest protobuf is missing name parameter, which is clearly present in the Dataflow API documentation.

I also tested it manually using CURL and it works.

@suztomo
Copy link
Member

suztomo commented Mar 24, 2025

Would you share your curl command?

@kberezin-nshl
Copy link
Author

Sure:

curl -X GET \
	"https://dataflow.googleapis.com/v1b3/projects/PRJ-NAME-HERE/locations/us-east1/jobs?name=foo-bar-baz" \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer $(gcloud auth print-access-token)" \

@kberezin-nshl
Copy link
Author

@suztomo hey, any news on this? I believe it's just a simple one-liner fix, right?

@suztomo
Copy link
Member

suztomo commented Mar 25, 2025

Try public final Job getJob(GetJobRequest request). The symbol "name" has special meaning in the underlying framework of the libraries in this repository (Protobuf/gRPC, not JSON/HTTP). The identifier of the job is job ID:

   * try (JobsV1Beta3Client jobsV1Beta3Client = JobsV1Beta3Client.create()) {
   *   GetJobRequest request =
   *       GetJobRequest.newBuilder()
   *           .setProjectId("projectId-894832108")
   *           .setJobId("jobId101296568")
   *           .setView(JobView.forNumber(0))
   *           .setLocation("location1901043637")
   *           .build();
   *   Job response = jobsV1Beta3Client.getJob(request);
   * }

@suztomo suztomo self-assigned this Mar 25, 2025
@suztomo
Copy link
Member

suztomo commented Mar 25, 2025

We found a stale library generation definiton (proto files). If getJob doesn't suit your needs, let me know.

@kberezin-nshl
Copy link
Author

Yeah, that's the whole culprit here, that I don't know the job ID yet and I am trying to find it out.

Basically, here's my scenario (oversimplified):

  • we have stable and unique Job names, which guarantees that whenever we try to request the same job twice (for example, due to PubSub message double-delivery, which happens from time to time), we'll get 409 from Dataflow
  • unfortunately, with that 409 we don't get a job info (Job protobuf), just an error message, but we still need that info to continue the execution correctly
  • so whenever I receive 409, I go ahead and try to find this job using List endpoint
  • without being able to supply the name filter, I have to navigate through all the results in the output and potentially even paginate through them to find my job

It is not the end of the world, of course, but having a more straightforward approach, especially considering that the API already supports that, would be great.

@suztomo
Copy link
Member

suztomo commented Mar 26, 2025

I'll work on fixing the stale library definition. I'll update you here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants