jeevatkm/digitalocean-api-java

getAvailableDropletsByTagName method?

Closed this issue · 3 comments

Hi,

Is there a plan for getAvailableDropletsByTagName method?
Related to: https://developers.digitalocean.com/documentation/v2/#listing-droplets-by-tag

The code will likely look something like this:

  @Override
  public Droplets getAvailableDropletsByTagName(String tagName, Integer pageNo, Integer perPage)
      throws DigitalOceanException, RequestUnsuccessfulException {
    checkBlankAndThrowError(tagName, "Missing required parameter - tagName.");
    validatePageNo(pageNo);

    Map<String, String> queryParams = new HashMap<String, String>();
    queryParams.put("tag_name", tagName);

    return (Droplets) perform(new ApiRequest(ApiAction.AVAILABLE_DROPLETS, pageNo, queryParams, perPage))
        .getData();
  }

Thanks,
Tasos

@tasosz you have already created the method implementation. I would suggest you to send PR with

  • Interface and Javadoc
  • Implementation (you have DONE it already)
  • Test case

@tasosz I will add it.

Done