Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/java/com/myjeeva/digitalocean/DigitalOcean.java
Original file line number Diff line number Diff line change
Expand Up @@ -888,14 +888,16 @@ Domain getDomainInfo(String domainName) throws DigitalOceanException,
* Method returns all of your current domain records from DNS control panel for given domain.
*
* @param domainName of the domain
* @param pageNo of request pagination
* @param perPage no. of items per page
* @return {@link DomainRecords}
* @throws DigitalOceanException if request had interruption [
* <code>HTTP status code &gt;= 400 &amp;&amp; &lt; 510</code>]
* @throws RequestUnsuccessfulException if any RESTful request unsuccessful from wrapper method
*
* @since v1.1
*/
DomainRecords getDomainRecords(String domainName) throws DigitalOceanException,
DomainRecords getDomainRecords(String domainName, Integer pageNo, Integer perPage) throws DigitalOceanException,
RequestUnsuccessfulException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -764,12 +764,12 @@ public Delete deleteDomain(String domainName) throws DigitalOceanException,
}

@Override
public DomainRecords getDomainRecords(String domainName) throws DigitalOceanException,
public DomainRecords getDomainRecords(String domainName, Integer pageNo, Integer perPage) throws DigitalOceanException,
RequestUnsuccessfulException {
checkEmptyAndThrowError(domainName, "Missing required parameter - domainName.");

Object[] params = {domainName};
return (DomainRecords) perform(new ApiRequest(ApiAction.GET_DOMAIN_RECORDS, params)).getData();
return (DomainRecords) perform(new ApiRequest(ApiAction.GET_DOMAIN_RECORDS, params, pageNo, perPage)).getData();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ public void testDeleteDomain() throws DigitalOceanException, RequestUnsuccessful
@Test
public void testGetDomainRecords() throws DigitalOceanException, RequestUnsuccessfulException {

DomainRecords domainRecords = apiClient.getDomainRecords("jeeutil.com");
DomainRecords domainRecords = apiClient.getDomainRecords("jeeutil.com", 1, null);

assertNotNull(domainRecords);
assertTrue((domainRecords.getDomainRecords().size() > 0));
Expand Down