Skip to content
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mlavin
/
cloudping
Public
Notifications
You must be signed in to change notification settings
Fork
22
Star
129
Code
Issues
3
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
master
Breadcrumbs
cloudping
/
cloudping.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
22 lines (19 loc) · 573 Bytes
master
Breadcrumbs
cloudping
/
cloudping.py
Copy path
Top
File metadata and controls
Code
Blame
22 lines (19 loc) · 573 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from __future__ import unicode_literals
import requests
def ping(event, context):
"""Ping the status of a webpage."""
options = {
'domain': 'example.com',
'protocol': 'http',
'path': '/',
'method': 'GET',
'allow_redirects': False,
'timeout': 5,
}
options.update(event)
response = requests.request(
options['method'],
'{protocol}://{domain}{path}'.format(**options),
allow_redirects=options['allow_redirects'],
timeout=options['timeout'])
response.raise_for_status()
You can’t perform that action at this time.