Cloud Computing and Web Services Journal
Cloud Computing and Web Services Journal
Practical 1
Aim: define a simple service to convert rs into dollar and call it from
different platforms like java and .net:
Program:
try {
const response = await axios.get(exchangerateapi);
const exchangerate = response.data.rates[to];
if (!exchangerate) {
return res.status(400).json({ error: 'invalid currency code' });
}
1
TYCS Sem VI Cloud Computing and Web Services
Output:
2
TYCS Sem VI Cloud Computing and Web Services
Practical 2
Aim: create a simple soap service
Program: (simple soap service using node.js)
3
TYCS Sem VI Cloud Computing and Web Services
})
App.listen(3300, function() {
console.log("the port is 3300");
});
4
TYCS Sem VI Cloud Computing and Web Services
http://localhost:3300/add/2/3
http://localhost:3300/sub/2/3
http://localhost:3300/mult/2/3
http://localhost:3300/div/2/3
Output:
5
TYCS Sem VI Cloud Computing and Web Services
Practical 3
Aim: create a simple rest service
Program:
Open google crome >search spring boot initializer
Select>project:maven
language:java
spring boot :3.2.3
fill up project metadata
6
TYCS Sem VI Cloud Computing and Web Services
Add dependencies
7
TYCS Sem VI Cloud Computing and Web Services
8
TYCS Sem VI Cloud Computing and Web Services
Select springboot-first-app>src>main>java>com>springboot>app
9
TYCS Sem VI Cloud Computing and Web Services
10
TYCS Sem VI Cloud Computing and Web Services
Now go to springbootfirstappapplication.java
11
TYCS Sem VI Cloud Computing and Web Services
Go to browser type>localhost:8080/welcome
Output:
12
TYCS Sem VI Cloud Computing and Web Services
Practical 4
Aim : develop an application to consume google’s search / google’s map
restful web service
Program:
Import requests
13
TYCS Sem VI Cloud Computing and Web Services
If result:
print("output:")
for key, value in result.items():
print(f"{key}: {value}")
Browse location iq>signup with email> click on the link provided by location iq
(on your email)>you will get your access token copy the key and paste in the
python code:
14
TYCS Sem VI Cloud Computing and Web Services
15
TYCS Sem VI Cloud Computing and Web Services
Practical 5
Aim : installation and configuration of virtualization using kvm
Program:
Commands:
1.sudo grep-c"svm\|vmx"/proc/cpuinfo
2.sudo apt install qemu-kvm libvirt-daemon-system virt-manager brid
3.sudo apt-get update
4.sudo apt-get install qemu-kvm libvirt-daemon-system virt-manager bridge-
utils
5.sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils
6.sudo systemctl start libvirtd
7.sudo usermod -ag kvm $user
8.sudo systemctl is-active libvirtd
9.sudo usermod -ag libvirt $user
Sudo usermod -ag kvm $user
10.virt-manager
11.kvm-ok
Output:
16
TYCS Sem VI Cloud Computing and Web Services
17
TYCS Sem VI Cloud Computing and Web Services
Practical 6
Program:
(node.js) code:
Const fs = require('fs');
cb(null, uploadfolder);
},
cb(null, file.originalname);
},
});
18
TYCS Sem VI Cloud Computing and Web Services
if (!file) {
});
if (fs.existssync(filepath)) {
res.sendfile(filepath);
} else {
});
App.listen(port, () => {
19
TYCS Sem VI Cloud Computing and Web Services
});
Then click on body>form data>name the key item and file type: file
20
TYCS Sem VI Cloud Computing and Web Services
In value tab enter the file you want to upload to the server
Click on send
Upload output:
Download:
21
TYCS Sem VI Cloud Computing and Web Services
Click on submit
22
TYCS Sem VI Cloud Computing and Web Services
Download output :
23
TYCS Sem VI Cloud Computing and Web Services
Practical 7
Aim : cloud functionality vsi (virtual server infrastructure) infrastructure
as a service (iaas), storage
Program:
24
TYCS Sem VI Cloud Computing and Web Services
The first screen after login shows many options to install and deploy any
virtual machine. To install a virtual machine click on virtuai machine-> upload
iso file option and upload the bootable iso file. Here, we are going to upload
linux elementary 0s is0.
Once you uploaded the file, create vimtemplate. In this option you are basically
configuring your virtual machine's storage location, cpu, memory, node etc.
25
TYCS Sem VI Cloud Computing and Web Services
Here, you will find single nodes ana vw po01 1 respective options because
everything was installed at the single server.
Now, click on vmtemplates and you will see a template which you have created
in step 4. To start your machine go to run action tab and click on the green
arrow. Under status tab, it shows the running text with the green circle which
shows that your machine is running without any errors. To view your virtual
machine click on a blue square box under action tab.
To view your virtual machine you have to download spice client tool. The
download link can be found under the links option. After downloading the
application, click on the blue square to view machine. When you click on it, the
browser will pop-up for launching the application.
26
TYCS Sem VI Cloud Computing and Web Services
Once it connects, enter the password which was given in the link and click ok.
Finally you will able to view and control your virtual machine.
27
TYCS Sem VI Cloud Computing and Web Services
28