googleapis / googleapis/google-cloud-java
CloudRun - Support listing jobs with a label
- Dominant language
- Java
- Stars
- 2.1k
- Forks
- 1.2k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 157
Description
**Describe the solution you'd like**
We would like to be able to list CloudRun job using a filter.
Something like the following code snippet (which didn't work yet as there is no `setFilter()` method).
```java
var jobsClient = JobsClient.create();
var existingJob = jobsClient.listJobs(ListJobsRequest.newBuilder()
.setParent(String.format("projects/%s/locations/%s", projectId, region))
.setFilter("labels.key=value")
.build();
```
**Describe alternatives you've considered**
The alternative is to list all jobs and filter later.
However, this didn't scale if there were a lot of jobs.
**Additional context**
It is already possible via gcloud: `gcloud run jobs list --filter "labels.key=value"`.
Contributor guide
Research direction
Start with the Java JobsClient.listJobs entry point and its ListJobsRequest builder, comparing the requested label-filter behavior with the gcloud run jobs list --filter command. Done means callers can list Cloud Run jobs using a label filter instead of fetching every job first, with the relevant client behavior covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, java
- Domain
- api, cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100