gitlab4j-api icon indicating copy to clipboard operation
gitlab4j-api copied to clipboard

Ability to search on runners by tag

Open gubespam opened this issue 3 years ago • 0 comments

RunnersApi.getRunners() is missing the ability to search based on tag_list.

Either a new getRunners() method could be added with the additional parameter, or a new, more generic method could be added that would allow searching on any parameter that GitLab supports, like below:

public List<Runner> getRunners(Map<String,String> searchParams, int page, int perPage) throws GitLabApiException 
{
    GitLabApiForm formData = new GitLabApiForm(page, perPage);
    for(Map.Entry<String,String> entry: params.entrySet()){
        formData = formData.withParam(entry.getKey(), entry.getValue(), false);
    }
    Response response = get(Response.Status.OK, formData.asMap(), "runners");
    return (response.readEntity(new GenericType<List<Runner>>() {}));
}

gubespam avatar Jul 26 '21 21:07 gubespam