CLOUD STORAGE WEB COMMUNICATION APIs CLOUD STORAGE MODELS
CLOUD STORAGE && WEB COMMUNICATION APIs CLOUD STORAGE MODELS and COMMUNICATION APIs 1. WAMP – Auto. Bahn for Io. T 2. Xively Cloud for Io. T 3. Python Web Application Framework – Django 4. Designing RESTful web API 5. Amazon web services for Io. T 6. Sky. Net Io. T Messaging Platform Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 1
Amazon Web services for Io. T 2 5 4 1 3 6 Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru src: https: //aws. amazon. com/gettingstarted/hands-on/remotely-run-commands-ec 2 instance-systems-manager/ 2
Amazon Web services for Io. T: : Amazon EC 2 §EC 2 is an Infrastructure-as-a-service(Iaas) provided by Amazon §EC 2 delivers scalable, pay as you go compute capacity in the cloud. §EC 2 is a web service that provides computing capacity in the form of virtual machines that are launched in the Amazon’s cloud computing environment. §EC 2 can be used for several purposes of Io. T. §Example: Io. T developers can deploy Io. T applications on EC 2 , set up Io. T platforms with REST API services Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 3
Amazon Web services for Io. T: : Amazon EC 2 v. Python program for launching the EC 2 instance Connection to EC 2 is established; ACCESS KEY and SECRET KEY are passed to the function The run_instances(. . ) function returns the reservation New instance Is launched AMI_ID, EC 2_KEY_HANDLE, INSTANCE_TYPE, SECGROUP_HAND Are passed to the Function. 4 Instances associated with reservation are obtained #1 The status of the instance associated with reservation is obtained 2 Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 4
Amazon Web services for Io. T: : Amazon EC 2 v. Python program for stopping an EC 2 instance § conn. get_all_instances() is called to get all running instances. This function returns reservations. § ID of all instances associated with each reservation are obtained. § The instances are stopped by calling conn. stop_instances function to which the IDs of the instance to stop are passed.
Amazon Web services for Io. T: : Amazon EC 2 Example- Launching instance at aws (only for demo purpose): Dr Sumalatha Aradhya, Dept of CSE, SIT, https: //aws. amazon. com/getting-started/hands-on/remotely-run-commands Tumakuru -ec 2 -instance-systems-manager/ 6
Amazon Web services for Io. T: : Amazon EC 2(for Demo purpose only) Explore more at: Dr Sumalatha Aradhya, Dept of CSE, SIT, https: //aws. amazon. com/getting-started/hands-on/remotely-run-commands Tumakuru -ec 2 -instance-systems-manager/ 7
Amazon Web services for Io. T: : Amazon EC 2(for Demo purpose only) Explore more at: Dr Sumalatha Aradhya, Dept of CSE, SIT, https: //aws. amazon. com/getting-started/hands-on/remotely-run-commands Tumakuru -ec 2 -instance-systems-manager/ 8
Amazon Web services for Io. T: : Amazon EC 2(for Demo purpose only) Explore more at: Dr Sumalatha Aradhya, Dept of CSE, SIT, https: //aws. amazon. com/getting-started/hands-on/remotely-run-commands Tumakuru -ec 2 -instance-systems-manager/ 9
Amazon Web services for Io. T: : Amazon EC 2(for Demo purpose only) Explore more at: Dr Sumalatha Aradhya, Dept of CSE, SIT, https: //aws. amazon. com/getting-started/hands-on/remotely-run-commands Tumakuru -ec 2 -instance-systems-manager/ 10
Amazon Web services for Io. T: : Amazon EC 2(for Demo purpose only) Explore more at: Dr Sumalatha Aradhya, Dept of CSE, SIT, https: //aws. amazon. com/getting-started/hands-on/remotely-run-commands Tumakuru -ec 2 -instance-systems-manager/ 11
v Amazon EC 2 instance: : Reference https: //github. com/aws-iot-device-sdk-python https: //docs. aws. amazon. com/iot/latest/developerguide/iot-moisture-raspi-setup. html https: //aws. amazon. com/getting-started/hands-on/remotely-run-commands-ec 2 -instance-systems -manager/ https: //intellipaat. com/community/43039/how-to-stop-an-instance-using-python-boto 3 https: //docs. aws. amazon. com/AWSEC 2/latest/User. Guide/concepts. html#access-ec 2 Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 12
Amazon Web services for Io. T: : Amazon Auto. Scaling §Amazon autoscaling allows automatically scaling Amazon EC 2 capacity up or down according to user defined conditions. §With autoscaling the users can increase the number of EC 2 instances running their applications seamlessly during their spikes in the application workloads to meet -> o application performance requirements o scale down capacity when the workload is low to save costs. §Autoscaling can be used for autoscaling Io. T applications and Io. T platforms deployed on Amazon EC 2 Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 13
Amazon Web services for Io. T: : Amazon Auto. Scaling – example @aws EC 2 console Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 14
Amazon Web services for Io. T: : Amazon Auto. Scaling 2 A new launch configuration is created. Let’s look into an example of creating Autoscaling group: Launch configuration contains instructions to launch new instances. After launch creation, instances gets associated with a new Autoscaling group. 1 Connection to Autoscaling service is established. AWA access key, secret key are passed to the functions 3 New Autoscaling group is 4 created #2 #1 Scale up and down policies are defined 5 Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 15
Amazon Web services for Io. T: : Amazon Auto. Scaling creating Autoscaling group contd… 7 Change. In. Capacity , scaling_adjustment = 1 is defined in Scale up poicy. 5 6 Change. In. Ca pacity , scaling_adju stment = -1 is defined in Scale down policy. Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 8 Alarm is defined using CPUUtilization metric with Average statistic and threshold greater 70% for a period of 60 sec, for Scale up and Threshold of lesser than 50% for Scale down policies gets associated. 16
Amazon Web services for Io. T: : Amazon Auto. Scaling – example @aws EC 2 console( only for demo purpose) Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 17
Amazon Web services for Io. T: : Amazon Auto. Scaling – example @aws EC 2 console( only for demo purpose) Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 18
Amazon Web services for Io. T: : Amazon Auto. Scaling – example @aws EC 2 console( only for demo purpose) Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 19
Amazon Web services for Io. T: : Amazon Auto. Scaling – example @aws EC 2 console( only for demo purpose) Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 20
Amazon Web services for Io. T: : Amazon Auto. Scaling – example @aws EC 2 console( only for demo purpose) Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 21
Amazon Web services for Io. T: : Amazon Auto. Scaling – example @aws EC 2 console( only for demo purpose) Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 22
Amazon Web services for Io. T: : Amazon Auto. Scaling – example @aws EC 2 console( only for demo purpose) Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 23
Amazon Web services for Io. T: : Amazon Auto. Scaling – example @aws EC 2 console( only for demo purpose) Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 24
Amazon Web services for Io. T: : Amazon Auto. Scaling –In Summary Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 25
v Amazon Auto. Scaling: : Auto. Scaling References https: //aws. amazon. com/autoscaling/ https: //docs. aws. amazon. com/autoscaling/ec 2/userguide/ what-is-amazon-ec 2 -auto-scaling. html Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 26
Amazon Web services for Io. T: : Amazon S 3 § Amazon S 3 is an online cloud based data storage infrastructure for storing and retrieving a very large amount of data § S 3 provides highly reliable, scalable, fast, fully redundant and affordable storage infrastructure. § S 3 can serve as a raw datastore for Io. T systems for storing raw data, such as sensor data, image, audio and video data. § S 3 Buckets are the fundamental container in Amazon S 3 for data storage. § For others to access the objects in your S 3 buckets, you'll need to explicitly grant them permissions Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 27
Amazon Web services for Io. T: : Amazon S 3 v. Python code for uploading file to Amazon S 3 Bucket: cloud storage 1 §A connection to S 3 service is established by calling connect_s 3() function. § A AWS access key, secret key are passed to this function. 2 §The function upload_to_s 3_bucket _path() uploads the file to the S 3 Bucket specified at the specified path 3 Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru §The function upload_to_s 3_bucket _root() uploads the file to the S 3 Bucket root 28
Amazon Web services for Io. T: : Amazon S 3 (Example – for demo purpose only) Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 29
Amazon Web services for Io. T: : Amazon S 3 (Example – for demo purpose only) Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 30
Amazon Web services for Io. T: : Amazon S 3 (Example – for demo purpose only) Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 31
Amazon Web services for Io. T: : Amazon S 3 References https: //docs. aws. amazon. com/AWSEC 2/latest/ User. Guide/Amazon. S 3. html Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 32
Amazon Web services for Io. T: : Amazon RDS §Refer Part 6 video for further details. Dr Sumalatha Aradhya, Dept of CSE, SIT, Tumakuru 33
- Slides: 33