Skip to content

Latest commit

 

History

History
230 lines (177 loc) · 8.01 KB

README.md

File metadata and controls

230 lines (177 loc) · 8.01 KB

Java Domainrobot Sdk

A java package for easy integration of the Domainrobot API powered by InterNetX GmbH.

Table of Contents

  1. Preamble
  2. Install And Import
  3. Usage
  4. Changelog
  5. Copyright and license

Preamble

This Maven package is not available via known repositories. It must be manually installed into a local Maven repository.

Install And Import

Download repository

Download the code from the current release on the release page.

Install to local repository

cd /path/to/package
mvn install

Pom

Update pom.xml and add the following line to your dependencies.

<dependency>
    <groupId>org.domainrobot</groupId>
    <artifactId>sdk-client</artifactId>
    <version>0.2.8</version>
</dependency>

Usage

Provider

The package contains a Domainrobot class that is the main access to the api. Instantiate the class with your api credentials and the matching baseUrl of the api.

String userName = "USER";
String password = "PASSWORD";
String context = "CONTEXT";
String baseUrl = "URL";
Domainrobot sdk = Domainrobot(userName,password,context,baseUrl);

Supported API calls

Domain tasks

ObjectJob create(Domain body, Map<String, String> customHeaders);
ObjectJob update(Domain body, Map<String, String> customHeaders);
Domain info(String domain, Map<String, String> customHeaders);
List<Domain> list(Query body, Map<String, String> customHeaders);
Domain createAuthinfo1(String domain, Map<String, String> customHeaders);
void deleteAuthinfo1(String domain, Map<String, String> customHeaders);
Domain createAuthinfo2(String domain, Map<String, String> customHeaders);
ObjectJob renew(Domain body, Map<String, String> customHeaders);
ObjectJob transfer(Domain body, Map<String, String> customHeaders);
void updateStatus(Domain body, Map<String, String> customHeaders);
List<DomainRestore> restoreList(Query body, Map<String, String> customHeaders);
ObjectJob restore(Domain body, Map<String, String> customHeaders);

Domain cancelation tasks

DomainCancelation create(DomainCancelation body, Map<String, String> customHeaders);
void update(DomainCancelation body, Map<String, String> customHeaders);
void delete(String domain, Map<String, String> customHeaders);
DomainCancelation info(String domain, Map<String, String> customHeaders);
List<DomainCancelation> list(Query body, Map<String, String> customHeaders);

Contact tasks

Contact create(Contact body, Map<String, String> customHeaders);
Contact update(Contact body, Map<String, String> customHeaders);
void delete(int id, Map<String, String> customHeaders);
Contact info(int id, Map<String, String> customHeaders);
List<Contact> list(Query body, Map<String, String> customHeaders);

Zone tasks

Zone create(Zone body, Map<String, String> customHeaders);
Zone update(Zone body, Map<String, String> customHeaders);
void delete(String origin, String virtualNameServer, Map<String, String> customHeaders);
Zone info(String origin, String virtualNameServer, Map<String, String> customHeaders);
List<Zone> list(Query body, Map<String, String> customHeaders);
void stream(String origin, ZoneStream body, Map<String, String> customHeaders);
Zone importZone(Zone body, Map<String, String> customHeaders);

Certificate tasks

Certificate realtime(Certificate body, Map<String, String> customHeaders);
CertificateData prepareOrder(CertificateData body, Map<String, String> customHeaders);
ObjectJob create(Certificate body, Map<String, String> customHeaders);
ObjectJob reissue(Certificate body, Map<String, String> customHeaders);
ObjectJob delete(int id, Map<String, String> customHeaders);
Certificate info(int id, Map<String, String> customHeaders);
List<Certificate> list(Query body, Map<String, String> customHeaders);
ObjectJob renew(Certificate body, Map<String, String> customHeaders);
void commentUpdate(int id, String comment, Map<String, String> customHeaders);

SslContact tasks

SslContact create(SslContact body, Map<String, String> customHeaders);
SslContact update(SslContact body, Map<String, String> customHeaders);
void delete(int id, Map<String, String> customHeaders);
SslContact info(int id, Map<String, String> customHeaders);
List<SslContact> list(Query body, Map<String, String> customHeaders);

TrustedApplication tasks

TrustedApplication create(TrustedApplication body, Map<String, String> customHeaders);
TrustedApplication update(TrustedApplication body, Map<String, String> customHeaders);
void delete(String uuid, Map<String, String> customHeaders);
TrustedApplication info(String uuid, Map<String, String> customHeaders);
List<TrustedApplication> list(Query body, Map<String, String> customHeaders);

Domainstudio tasks

List<DomainEnvelope> search(DomainEnvelopeSearchRequest body, MultiValueMap<String, String> customHeaders);

Poll tasks

PollMessage info(Map<String, String> customHeaders);
void confirm(int id, Map<String, String> customHeaders)

Transferout tasks

Models

The package contains many classes that represent entities from the Domainrobot API. All Models can be used inside of your own project.

Exception handling

If there is any error response from the API. The DomainRobotprovider will throw a DomainRobotApiException, which contains information about the error.

String userName = "USER";
String password = "PASSWORD";
String context = "4";
String baseUrl = "https://api.autodns.com/v1";
Domainrobot sdk = new Domainrobot(userName, context, password, baseUrl);
DomainEnvelopeSearchRequest body = new DomainEnvelopeSearchRequest();
DomainStudioSources sources = new DomainStudioSources();
sources.suggestion(new DomainStudioSourceSuggestion().max(5));
body.searchToken("java").sources(sources);
try {
    List<DomainEnvelope> data = sdk.domainStudio.search(body, null);
    for (DomainEnvelope d : data) {
        System.out.println(d.getDomain());
    }
} catch(DomainrobotApiException e) {
    // Handle exception from the API
    System.out.println(e.getMessage());
    System.out.println(e.getErrorCode());
    System.out.println(e.getBody());
} catch(Exception e) {
    // Handle unexpected exception
    System.out.println("Unknown error " + e);
}

Changelog

For a detailed changelog, see the CHANGELOG.md file

Copyright and license

MIT License

Copyright (c) 2020 InterNetX GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.