-
Notifications
You must be signed in to change notification settings - Fork 7
/
CertificateDelete.js
47 lines (36 loc) · 1.48 KB
/
CertificateDelete.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* This is an example implementation of the sdk for AdonisJS (https://adonisjs.com/)
*/
"use strict"
const DomainRobot = require("@internetx/js-domainrobot-sdk").DomainRobot
const Logger = use("Logger")
class CertificateDelete {
async sdk({ request, response, params }) {
// Create a new Instance of the Domainrobot SDK
// and provide your (AutoDNS) Authentication Data
// The Option auth.context is optional for non personal
// AutoDNS Users but mandatory for personal ones
let domainRobot = new DomainRobot({
url: "https://api.demo.autodns.com/v1",
auth: {
user: "user",
password: "password",
context: "4"
}
});
// Send an Request and react to Success or Error Results
try {
// If the Request is Successful the returned Object
// will be of the Type DomainRobotResult
// Delete the Certificate
const domainRobotResult = await domainRobot.certificate().delete(2121)
Logger.transport("file").info("Request success", domainRobotResult)
return domainRobotResult
} catch (DomainRobotException) {
// If the Request produces an Error the returned Object
// will be of the Type DomainRobotException
Logger.transport("file").error("Request error", DomainRobotException)
}
}
}
module.exports = CertificateDelete