Cloud Computing - Assignment 2, Papers of Computer Applications

1644 - Cloud Computing - Assignment 2

Typology: Papers

2021/2022

Uploaded on 04/05/2022

unkaeciique
unkaeciique 🇻🇳

4.7

(174)

29 documents

1 / 38

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1 | H o N g o c K h a n h
ASSIGNMENT 2 FRONT SHEET
Qualification
BTEC Level 5 HND Diploma in Computing
Unit number and title
Unit 16: Cloud Computing
Submission date
Date Received 1st
submission
Re-submission Date
Date Received 2nd
submission
Student Name
Hồ Ngọc Khánh
Student ID
GCS200074
Class
GCD0901
Assessor name
Trần Trọng Minh
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Student’s signature
Khanh
Grading grid
P5
P6
P7
P8
M3
M4
D2
D3
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26

Partial preview of the text

Download Cloud Computing - Assignment 2 and more Papers Computer Applications in PDF only on Docsity!

ASSIGNMENT 2 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 16 : Cloud Computing

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Hồ Ngọc Khánh Student ID GCS

Class GCD0901 Assessor name Trần Trọng Minh

Student declaration

I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that

making a false declaration is a form of malpractice.

Student’s signature Khanh

Grading grid

P5 P6 P7 P8 M3 M4 D2 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date:

Internal Verifier’s Comments:

Signature & Date:

LO3 Develop Cloud Computing solutions using service provider’s frameworks and open-source tools

I. Configure a Cloud Computing platform with a cloud service

provider’s framework (P5)

1. Configure Git

From the folder of the program, right click at an open space and choose Git Bash Here

Figure 1 : CONNECT GIT TO THE FOLDER

Configure the Git and connect the Git to GitHub

git config --global user.name “

git config --global user.email

Figure 2 : CODE TO CONFIGURE GITHUB Figure 3 : RESULT OF CONFIGURATION

Adding the code into the Git Bash

git add README.md

git commit - m " add new file readme"

git branch - M main

git remote add origin https://github.com//test_git.git

git push - u origin main

Figure 4 : CODE TO CONNECT GIT Figure 5 : RESULT OF CONNECTION Figure 6 : GITHUB AFTER BEING DONE CONNECTING

Figure 9 : DEPLOY TAB

3. Connect Heroku to Git

In the Deploy tab, we can see various ways to connect Heroku. However, in this scenario we will

choose GitHub since we have already deployed our code to GitHub through Git

Figure 10 : VARIOUS METHODS

Login to GitHub and choose the repository that you want to connect, tap Connect and wait

Figure 11 : CONNECT TO GITHUB

In the next step, we will turn on the Automatic Deploys so every change happens in the GitHub

repository, will be announced and changed. However, be aware of the branch that you need to deploy.

Figure 12 : AUTOMATIC DEPLOYS

In this step, we will tap the Deploy Branch button and wait for the Heroku with GitHub connection.

Figure 13 : DEPLOY GITHUB BRANCH Figure 14 : RESULT AFTER DEPLOYING

Figure 18 : HEROKU POSTGRES PLANS Figure 19 : RESULT AFTER ADDING

II. Implement a cloud platform using open-source tools (P6)

1. Setup PgAdmin

After finishing downloading, you should be aware that the app will ask for customized password

during the process of

Figure 20 : CREATE SERVER

After pressing the Create → Server option. A window will pop up for us to fill in the information.

Figure 21 : SERVER NAME

After that, we will look back to the Heroku to get some information for the further filling.

Figure 22 : GET INFORMATION Figure 23 : GET INFORMATION FOR SERVER

Now we got our needed information. We will fill them in the Connection tab. Remember to save the

password for the next login since the password is extremely long and hard to remember.

header('Location: inventory.php'); } else header('Location: login.php'); } pg_close($dbconn); ?> Figure 26 : LOGIN.PHP Figure 27 : AUTHENCIATOR OF THE PROGRAM

  • inventory.php: including refresh real-time, drop-down list and other function to modify the

database

o Refresh real-time function

**_Figure 28 : REFRESH REAL-TIME FUNCTION Figure 29 : REFRESH REAL-TIME_**

o Drop-down list function

Figure 33 : INSERT FUNCTION Figure 34 : INSERT BAR

o Update function

if(isset($_POST['update'])){ $id= $_POST['id']; $name = $_POST ['name']; $price = $_POST['price']; $amount = $_POST['amount']; $role = $_POST['role']; $updateQuery = "UPDATE toys SET name = '".$name."', price = '".$price."', amount = '".$amount."', role = '".$role."' WHERE id = $id"; $update = pg_query($dbconn,$updateQuery); header('Location: inventory.php'); } Figure 35 : UPDATE FUNCTION Figure 36 : UPDATE BAR

o Delete function

if(isset($_POST['delete'])) { $id= $_POST['id']; $delete = "DELETE FROM toys WHERE id = $id"; $deleteResult = pg_query($dbconn, $delete); header('Location: inventory.php'); } Figure 37 : DELETE FUNCTION

o Display table function

function DisplayManagementTable($table){ $getrole = $_SESSION["role"]; echo "

"; echo "

Inventory

"; echo "
"; $num_field = pg_num_fields($table); $num_row=pg_num_rows($table); echo "
"; echo "\n"; echo ""; $i = 0 ; echo ""; while ($i < $num_field) { $fieldName = pg_field_name($table, $i); echo ''; $i = $i + 1 ; } echo ""; echo " "; for ($j= 0 ;$j<$num_row;$j++){ echo ""; $row=pg_fetch_array($table,$j); if(!isset($_POST['edit'])){ echo ""; for ($k= 0 ;$k<$num_field;$k++){ $update_field_name = pg_field_name($table,$k); $update_value=$row[$update_field_name]; if ($k == 0 ){

'. $fieldName. '