-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
131 lines (127 loc) · 4.25 KB
/
index.html
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
<title>AWS Lambda to AWS RDS without VPC</title>
</head>
<body>
<style>
.action-container {
margin-top: 2px;
border: 1px solid;
width: 35%;
padding: 5px;
}
</style>
<h1>AWS Lambda to AWS RDS without VPC</h1>
<div class="action-container">
<p><input type="text" id="1eventTypeInput" placeholder="" value="saveRecord"
hidden
/></p>
<p><input type="text" id="1dataInput" placeholder="Input Value" value=""
/></p>
<p><button id="button1" data-url="https://w3u594yy4i.execute-api.us-east-1.amazonaws.com/s/db-interface">
Create
</button></p>
<p id="result1"></p>
</div>
<div class="action-container">
<p><input type="text" id="2eventTypeInput" placeholder="" value="updateRecord"
hidden
/></p>
<p><input type="text" id="2record_idInput" placeholder="Record ID" value=""
/></p>
<p><input type="text" id="2dataInput" placeholder="Input Value" value=""
/></p>
<p><button id="button2" data-url="https://w3u594yy4i.execute-api.us-east-1.amazonaws.com/s/db-interface">
Update
</button></p>
<p id="result2"></p>
</div>
<div class="action-container">
<p id="result3"></p>
<p><input type="text" id="0eventTypeInput" placeholder="" value="getRecords"
hidden
/></p>
<p><button id="button0" data-url="https://w3u594yy4i.execute-api.us-east-1.amazonaws.com/s/db-interface">
Get
</button></p>
<pre id="result0"></pre>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#"+"button0").click(function(event){
var data = {}
data["eventType"] = $("#0eventTypeInput").val();
$.ajax({
type: "POST",
url: "https://w3u594yy4i.execute-api.us-east-1.amazonaws.com/s/db-interface",
contentType: 'application/json',
data: JSON.stringify(data),
headers: {
"x-api-key": "yP9fjdYNx45R39DGnWyTS2FRAEvli03A3DXmUaoz"
},
success: function(data){
$("#result0").text(JSON.stringify(data, null, ' '))
}
})
})
$("#"+"button1").click(function(event){
var data = {}
data["eventType"] = $("#1eventTypeInput").val();
data["recordInfo"] = {
"data": $("#1dataInput").val()
}
$.ajax({
type: "POST",
url: "https://w3u594yy4i.execute-api.us-east-1.amazonaws.com/s/db-interface",
contentType: 'application/json',
data: JSON.stringify(data),
headers: {
"x-api-key": "yP9fjdYNx45R39DGnWyTS2FRAEvli03A3DXmUaoz"
},
success: function(data){
$("#result1").html(JSON.stringify(data))
}
})
})
$("#"+"button2").click(function(event){
var data = {}
data["eventType"] = $("#2eventTypeInput").val();
data["recordInfo"] = {
"record_id": $("#2record_idInput").val(),
"data": $("#2dataInput").val()
}
$.ajax({
type: "POST",
url: "https://w3u594yy4i.execute-api.us-east-1.amazonaws.com/s/db-interface",
contentType: 'application/json',
data: JSON.stringify(data),
headers: {
"x-api-key": "yP9fjdYNx45R39DGnWyTS2FRAEvli03A3DXmUaoz"
},
success: function(data){
$("#result2").html(JSON.stringify(data))
}
})
})
$("#"+"button3").click(function(event){
var data = {}
data["eventType"] = $("#3eventTypeInput").val();
data["record_id"] = $("#3record_idInput").val();
$.ajax({
type: "POST",
url: "https://w3u594yy4i.execute-api.us-east-1.amazonaws.com/s/db-interface",
contentType: 'application/json',
data: JSON.stringify(data),
headers: {
"x-api-key": "yP9fjdYNx45R39DGnWyTS2FRAEvli03A3DXmUaoz"
},
success: function(data){
$("#result3").html(JSON.stringify(data))
}
})
})
})
</script>
</body>
</html>