SlideShare a Scribd company logo
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
•
•
•
•
•
•
•
•
•
•
see@	http://www.restapitutorial.com/lessons/whatisrest.html
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
REST	API
Client
Mobile client
REST	API
GET /users HTTP/1.1
{"users": […]}
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
REST	API
Amazon
DynamoDB
Amazon	S3
Amazon	
CloudWatch
Auto Scaling group
Security group
Elastic Load
Balancing
Instance
REST API
Amazon
DynamoDB
Amazon	
CloudWatch
Amazon	S3
Amazon
DynamoDB
Amazon	
CloudWatch
Amazon API Gateway
AWS Lambda
Amazon	S3
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
Lambda.GetFunction(params: {'body': '', 'url': u'https://lambda.us-west-2.amazonaws.com/2015-03-31
IAM.GetRole(params: {'body': {'Action': u'GetRole', 'RoleName': u'helloworld7', 'Version': u'2010-
IAM.CreateRole(params: {'body': {'Action': u'CreateRole', 'RoleName': u'helloworld7', 'Version': u
IAM.PutRolePolicy(params: {'body': {'Action': u'PutRolePolicy', 'RoleName': u'helloworld7', 'Polic
Lambda.CreateFunction(params: (... omitted from logs due to size ...)
APIGateway.GetRestApis(params: {'body': '', 'url': u'https://apigateway.us-west-2.amazonaws.com/re
APIGateway.CreateRestApi(params: {'body': '{"name": "helloworld7"}', 'url': u'https://apigateway.u
APIGateway.GetResources(params: {'body': '', 'url': u'https://apigateway.us-west-2.amazonaws.com/r
APIGateway.PutMethod(params: {'body': '{"authorizationType": "NONE"}', 'url': u'https://apigateway
APIGateway.PutIntegration(params: {'body': '{"httpMethod": "POST", "requestTemplates": {"applicati
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"responseTemplates": {"application/json": ""}
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "ChaliceViewError.*", "re
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "BadRequestError.*", "res
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "NotFoundError.*", "respo
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "UnauthorizedError.*", "r
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "ForbiddenError.*", "resp
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "ConflictError.*", "respo
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "TooManyRequestsError.*",
Lambda.GetPolicy(params: {'body': '', 'url': u'https://lambda.us-west-2.amazonaws.com/2015-03-31/f
Lambda.AddPermission(params: {'body': '{"Action": "lambda:InvokeFunction", "StatementId": "1e96468
APIGatewayCreateDeployment(params: {'body': '{"stageName": "dev"}', 'url': u'https://apigateway.us
API
# AWS SAM
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
https://github.com/aws/chalice
•
•
•
•
•
•
•
$ pip install chalice
$ chalice new-project helloworld && cd helloworld
$ cat app.py
from chalice import Chalice
app = Chalice(app_name="helloworld")
@app.route("/")
def index():
return {"hello": "world"}
$ chalice deploy
...
https://endpoint/api
$ curl https://endpoint/api
{"hello": "world"}
$ git diff
from chalice import Chalice
+import boto3
app = Chalice(app_name='chalice-sample')
+S3 = boto3.client('s3', region_name='us-east-1')
@app.route('/')
def index():
+ S3.get_object(Bucket = BUCKET, Key = key)
return {'hello': 'world'}
$ chalice deploy
Creating role: chalice-sample-dev
The following execution policy will be used:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": ["*"],
"Sid": "40e10c45a..."
},
...
}
Would you like to continue? [Y/n]:
$ chalice local
Serving on localhost:8000
$ npm install -g nodemon
$ nodemon --exec "chalice local" --watch *.py
[nodemon] 1.12.5
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: app.py
[nodemon] starting `chalice local`
Serving on localhost:8000
see@	https://qiita.com/TakenoriHirao/items/69f2af5aaf64db77124b
•
•
•
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
# Basic Definition
@app.route('/')
def index():
return {"GET": "/"}
# Specify Methods
@app.route('/', methods=['PUT'])
def index_put():
return {"PUT": "/"}
@app.route('/res', methods=['GET', 'POST'])
def my_resource():
request = app.current_request
if request.method == 'GET':
return {"GET": "/res"}
elif request.method == 'POST':
return {"POST": "/res"}
# Path Params
@app.route('/myresources/{object_name}')
def my_resource_key(object_name):
try:
response = S3.get_object(
Bucket = BUCKET, Key = object_name)
return response['Body'].read()
except ClientError as e:
raise e
@app.route('/s3/{bucket_name}/objects')
def objects_of(bucket_name):
try:
response =
S3.list_objects_v2(Bucket=bucket_name,
Prefix = S3_PREFIX)
objects = list(map(lambda x: x["Key"],
response["Contents"]))
return {"objects": objects}
except ClientError as e:
raise ...
@app.route('/')
def index():
return Response(
body = 'hello world!',
status_code = 200,
headers = {'Content-Type': 'text/plain'}
)
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
@app.route('/',
cors=True,
api_key_required=True,
authorizer=IAMAuthorizer())
def index():
return "yey"
@app.schedule(Rate(1,	unit=Rate.HOURS))
def every_hour(event):
print(event.to_dict())
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
•
•
•
•
•
class Chalice(object):
def route(self, path, **kwargs): #
def _register_view(view_func):
self._add_route(path, view_func, **kwargs)
return view_func
return _register_view
def _add_route(self, path, view_func, **kwargs):
methods = kwargs.pop('methods', ['GET'])
...
for method in methods:
...
entry = RouteEntry(view_func, name,
path, method, api_key_required, content_types, cors,
authorizer)
self.routes[path][method] = entry
class Chalice(object):
def __call__(self, event, context): #
resource_path = event.get('requestContext',
{}).get('resourcePath')
http_method = event['requestContext']['httpMethod']
route_entry = self.routes[resource_path][http_method]
view_function = route_entry.view_function
function_args = {name: event['pathParameters'][name]
for name in route_entry.view_args}
...
response = self._get_view_function_response(view_function,
function_args)
response_headers = CaseInsensitiveMapping(response.headers)
...
response = response.to_dict(self.api.binary_types)
return response
class Chalice(object):
def _get_view_function_response(self, view_function, function_args):
try:
response = view_function(**function_args)
if not isinstance(response, Response):
response = Response(body=response)
self._validate_response(response)
except ChaliceViewError as e:
response = Response(...)
except Exception as e:
headers = {}
if self.debug:
...
else:
response = Response(..., status_code=500)
return response
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
https://speakerdeck.com/akitsukada/sabaresudewang-dao-webhuremuwakuwoshi-ufang-fa
https://www.slideshare.net/shimy_net/aws-79149218
https://www.slideshare.net/shimy_net/cloud-roadshow-2017-osaka
•
•
•
https://github.com/kislyuk/domovoi
@app.sns_topic_subscriber("bartender")
def tend(event, context):
message = json.loads(event["Records"][0]["Sns"]["Message"])
context.log(dict(beer="Quadrupel", quantity=message["beer"]))
@app.cloudwatch_event_handler(source=["aws.ecs"])
def monitor_ecs_events(event, context):
message = json.loads(event["Records"][0]["Sns"]["Message"])
context.log("Got an event from ECS: {}".format(message))
@app.s3_event_handler(bucket="myS3bucket",
events=["s3:ObjectCreated:*"], prefix="foo", suffix=".bar")
def monitor_s3(event, context):
message = json.loads(event["Records"][0]["Sns"]["Message"])
context.log("Got an event from S3: {}".format(message))
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
•
•
•
•
•
•
•
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
Ad

Recommended

PDF
WordPress RESTful API & Amazon API Gateway (English version)
崇之 清水
 
PDF
AWS における サーバーレスの基礎からチューニングまで
崇之 清水
 
PDF
サーバーレスの現実と夢と今
Hiroyuki Hara
 
PDF
A Crash Course on Serverless Applications in Python
James Saryerwinnie
 
PDF
Why your next serverless project should use AWS AppSync
Yan Cui
 
PDF
Serverless in production, an experience report (London DevOps)
Yan Cui
 
ODP
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Atlassian
 
PDF
【AWS Developers Meetup】RESTful APIをChaliceで紐解く
Amazon Web Services Japan
 
PPTX
Serverless solution architecture in AWS
Runcy Oommen
 
PDF
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS User Group - Thailand
 
PDF
OpenStack API's and WSGI
Mike Pittaro
 
PPTX
Aws serverless architecture
genesesoftware
 
PPTX
Building self service framework
Rovshan Musayev
 
PDF
Aws Technical Day 2015 - Amazon API Gateway
aws-marketing-il
 
PDF
ACDKOCHI19 - Building a serverless full-stack AWS native website
AWS User Group Kochi
 
PDF
Building AWS native serverless website
Runcy Oommen
 
PDF
Using Sinatra to Build REST APIs in Ruby
LaunchAny
 
PPTX
AWS as platform for scalable applications
Roman Gomolko
 
PPT
Intro to CloudStack API
Sebastien Goasguen
 
PDF
2016-06 - Design your api management strategy - AWS - Microservices on AWS
SmartWave
 
PDF
Super lazy side projects - Hamik Mukelyan
Drew Malone
 
PDF
Introduction to AWS
Angel Borroy López
 
PPTX
StackMate - CloudFormation for CloudStack
Chiradeep Vittal
 
PDF
Build an app on aws for your first 10 million users (2)
AWS Vietnam Community
 
PDF
Auto scaling with Ruby, AWS, Jenkins and Redis
Yi Hsuan (Jeddie) Chuang
 
PPTX
Getting Started with Apache CloudStack
Joe Brockmeier
 
PPTX
Dissecting Open Source Cloud Evolution: An OpenStack Case Study
Salman Baset
 
PDF
how to use openstack api
Liang Bo
 
PDF
知らなきゃ損なアップデートを振り返り(2020年分)- いにしえのサービスから勝手にチョイス
崇之 清水
 
PDF
マイクロサービスを AWS サーバレス&コンテナで実装する方法
崇之 清水
 

More Related Content

Similar to RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜 (20)

PPTX
Serverless solution architecture in AWS
Runcy Oommen
 
PDF
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS User Group - Thailand
 
PDF
OpenStack API's and WSGI
Mike Pittaro
 
PPTX
Aws serverless architecture
genesesoftware
 
PPTX
Building self service framework
Rovshan Musayev
 
PDF
Aws Technical Day 2015 - Amazon API Gateway
aws-marketing-il
 
PDF
ACDKOCHI19 - Building a serverless full-stack AWS native website
AWS User Group Kochi
 
PDF
Building AWS native serverless website
Runcy Oommen
 
PDF
Using Sinatra to Build REST APIs in Ruby
LaunchAny
 
PPTX
AWS as platform for scalable applications
Roman Gomolko
 
PPT
Intro to CloudStack API
Sebastien Goasguen
 
PDF
2016-06 - Design your api management strategy - AWS - Microservices on AWS
SmartWave
 
PDF
Super lazy side projects - Hamik Mukelyan
Drew Malone
 
PDF
Introduction to AWS
Angel Borroy López
 
PPTX
StackMate - CloudFormation for CloudStack
Chiradeep Vittal
 
PDF
Build an app on aws for your first 10 million users (2)
AWS Vietnam Community
 
PDF
Auto scaling with Ruby, AWS, Jenkins and Redis
Yi Hsuan (Jeddie) Chuang
 
PPTX
Getting Started with Apache CloudStack
Joe Brockmeier
 
PPTX
Dissecting Open Source Cloud Evolution: An OpenStack Case Study
Salman Baset
 
PDF
how to use openstack api
Liang Bo
 
Serverless solution architecture in AWS
Runcy Oommen
 
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS User Group - Thailand
 
OpenStack API's and WSGI
Mike Pittaro
 
Aws serverless architecture
genesesoftware
 
Building self service framework
Rovshan Musayev
 
Aws Technical Day 2015 - Amazon API Gateway
aws-marketing-il
 
ACDKOCHI19 - Building a serverless full-stack AWS native website
AWS User Group Kochi
 
Building AWS native serverless website
Runcy Oommen
 
Using Sinatra to Build REST APIs in Ruby
LaunchAny
 
AWS as platform for scalable applications
Roman Gomolko
 
Intro to CloudStack API
Sebastien Goasguen
 
2016-06 - Design your api management strategy - AWS - Microservices on AWS
SmartWave
 
Super lazy side projects - Hamik Mukelyan
Drew Malone
 
Introduction to AWS
Angel Borroy López
 
StackMate - CloudFormation for CloudStack
Chiradeep Vittal
 
Build an app on aws for your first 10 million users (2)
AWS Vietnam Community
 
Auto scaling with Ruby, AWS, Jenkins and Redis
Yi Hsuan (Jeddie) Chuang
 
Getting Started with Apache CloudStack
Joe Brockmeier
 
Dissecting Open Source Cloud Evolution: An OpenStack Case Study
Salman Baset
 
how to use openstack api
Liang Bo
 

More from 崇之 清水 (20)

PDF
知らなきゃ損なアップデートを振り返り(2020年分)- いにしえのサービスから勝手にチョイス
崇之 清水
 
PDF
マイクロサービスを AWS サーバレス&コンテナで実装する方法
崇之 清水
 
PDF
クラウドを活用したセンシング/モニタリングなどデータ分析の実現
崇之 清水
 
PDF
AWS 主要なサービスアップデート 6/3-11/28
崇之 清水
 
PDF
5分でサーバーレスの環境構築から本番デプロイまでやったろやないか! - Serverless Meetup Osaka #4 LT
崇之 清水
 
PDF
サーバレスアプリケーションの入門と実践 - AWS Cloud Roadshow 2017 Osaka
崇之 清水
 
PDF
データ分析 on AWS
崇之 清水
 
PDF
日本語でおk AI スピーカーを作ってみた
崇之 清水
 
PDF
Amazon Web Services (AWS) のご紹介
崇之 清水
 
PDF
Amazon AI のスゴいデモ(仮) - Serverless Meetup Osaka
崇之 清水
 
PDF
Amazon Pinpoint - re:Invent Serverless Follow Up - 20161207
崇之 清水
 
PDF
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
崇之 清水
 
PDF
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
崇之 清水
 
PDF
Amazon API Gateway を活用したゲームサーバー構築
崇之 清水
 
PDF
関西スタートアップAWS勉強会 スタートアップ最新事例
崇之 清水
 
PDF
スタートアップ向け構成例とAWS活用事例(福岡市スタートアップカフェ)
崇之 清水
 
PDF
Amazon Aurora の活用 - Developers.IO in OSAKA
崇之 清水
 
PDF
SA プライムなう! - AWS IoT とロボットアームでお絵かき
崇之 清水
 
PDF
Amazon Aurora の活用
崇之 清水
 
PDF
CTO Night & Days 2015 Winter - AWS Mobile Testing
崇之 清水
 
知らなきゃ損なアップデートを振り返り(2020年分)- いにしえのサービスから勝手にチョイス
崇之 清水
 
マイクロサービスを AWS サーバレス&コンテナで実装する方法
崇之 清水
 
クラウドを活用したセンシング/モニタリングなどデータ分析の実現
崇之 清水
 
AWS 主要なサービスアップデート 6/3-11/28
崇之 清水
 
5分でサーバーレスの環境構築から本番デプロイまでやったろやないか! - Serverless Meetup Osaka #4 LT
崇之 清水
 
サーバレスアプリケーションの入門と実践 - AWS Cloud Roadshow 2017 Osaka
崇之 清水
 
データ分析 on AWS
崇之 清水
 
日本語でおk AI スピーカーを作ってみた
崇之 清水
 
Amazon Web Services (AWS) のご紹介
崇之 清水
 
Amazon AI のスゴいデモ(仮) - Serverless Meetup Osaka
崇之 清水
 
Amazon Pinpoint - re:Invent Serverless Follow Up - 20161207
崇之 清水
 
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
崇之 清水
 
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
崇之 清水
 
Amazon API Gateway を活用したゲームサーバー構築
崇之 清水
 
関西スタートアップAWS勉強会 スタートアップ最新事例
崇之 清水
 
スタートアップ向け構成例とAWS活用事例(福岡市スタートアップカフェ)
崇之 清水
 
Amazon Aurora の活用 - Developers.IO in OSAKA
崇之 清水
 
SA プライムなう! - AWS IoT とロボットアームでお絵かき
崇之 清水
 
Amazon Aurora の活用
崇之 清水
 
CTO Night & Days 2015 Winter - AWS Mobile Testing
崇之 清水
 
Ad

Recently uploaded (20)

PDF
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PDF
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
PDF
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
PPTX
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
PDF
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
PDF
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
PDF
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
PDF
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PDF
The Growing Value and Application of FME & GenAI
Safe Software
 
PDF
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PDF
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
PDF
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
PDF
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
PDF
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
PDF
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
The Growing Value and Application of FME & GenAI
Safe Software
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Ad

RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜