Toggle navigation
Toggle navigation
This project
Loading...
Sign in
서승완
/
kappa
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Mitch Garnaat
2016-03-13 15:30:45 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d4fef507f9ed88d4abf7ec4638e1d9b6fd9f302c
d4fef507
1 parent
0727b3ac
Cleaning up a few small things.
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
40 deletions
docs/config_file.rst
kappa/restapi.py
samples/python/_src/simple.py
docs/config_file.rst
deleted
100644 → 0
View file @
0727b3a
The Config File
===============
The config file is at the heart of kappa. It is what describes your functions
and drives your deployments. This section provides a reference for all of the
elements of the kappa config file.
Example
-------
Here is a simple example config file from the sample/simple directory::
---
name: foobar
environments:
dev:
profile: fiebaz-dev
region: us-west-2
policy:
arn: arn:aws:iam::aws:policy/service-role/AWSLambdaRole
prod:
profile: fiebaz-prod
region: us-west-2
policy:
arn: arn:aws:iam::aws:policy/service-role/AWSLambdaRole
lambda:
description: A simple Python Lambda example
path: code/
handler: foobar.handler
runtime: python2.7
memory_size: 256
timeout: 3
test_data: input.json
This config file is defining
kappa/restapi.py
View file @
d4fef50
...
...
@@ -189,7 +189,7 @@ class RestApi(object):
def
create_methods
(
self
):
resource_config
=
self
.
_config
[
'resource'
]
for
method
in
resource_config
.
get
(
'methods'
,
dict
()):
if
not
self
.
method_exists
():
if
not
self
.
method_exists
(
method
):
method_config
=
resource_config
[
'methods'
][
method
]
self
.
create_method
(
method
,
method_config
)
...
...
@@ -253,7 +253,7 @@ class RestApi(object):
resourceId
=
self
.
resource_id
)
LOG
.
debug
(
response
)
except
ClientError
:
LOG
.
exception
(
'Unable to delete resource '
,
self
.
resource_name
)
LOG
.
exception
(
'Unable to delete resource
%
s
'
,
self
.
resource_name
)
return
response
def
status
(
self
):
...
...
samples/python/_src/simple.py
View file @
d4fef50
...
...
@@ -42,10 +42,10 @@ def _post(event, context):
def
_put
(
event
,
context
):
data
=
_get
(
event
,
context
)
id
=
data
.
get
(
'id'
)
id
_
=
data
.
get
(
'id'
)
data
.
update
(
event
[
'json_body'
])
# don't allow the id to be changed
data
[
'id'
]
=
id
data
[
'id'
]
=
id
_
table
.
put_item
(
Item
=
data
)
return
data
...
...
Please
register
or
login
to post a comment