Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) CloudFormation AWS::ApiGateway::RestApi support #1238

Merged
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8f6b8fb
Initial setup and work
viksrivat Jun 17, 2019
f457401
Add RestApi tests
viksrivat Jun 19, 2019
8112cf4
Remove Stage Name/Variable from pr
viksrivat Jun 20, 2019
5050dd8
Run make pr
viksrivat Jun 20, 2019
bf5a083
Add Rest Api integration test
viksrivat Jun 20, 2019
6eb226a
Remove AWS::Stage from current pr
viksrivat Jun 20, 2019
7c5823d
Update integration test to only use CloudFormation types
viksrivat Jun 20, 2019
4966513
Re-run Travis Ci
viksrivat Jun 24, 2019
2c38ede
Update Uri to BodyS3Location
viksrivat Jun 24, 2019
9d3d137
Add docstring to extract_swagger_api
viksrivat Jun 24, 2019
b6d9b62
Fix Merge conflicts with dev and branch
viksrivat Jun 24, 2019
54bda7f
Test local file in body fail and clean tests
viksrivat Jun 24, 2019
9b06696
Initial Attempt
viksrivat Jun 25, 2019
145162e
Refactor Sam API provider
viksrivat Jun 25, 2019
5615163
Cleanup Refactoring
viksrivat Jun 25, 2019
752fba8
Merge pull request #1 from viksrivat/feature/cloud_formation_api_prov…
viksrivat Jun 25, 2019
681ede3
Re-run travis
viksrivat Jun 25, 2019
997845c
Initial Refactor refactor
viksrivat Jun 26, 2019
de65fd0
Fix tests and run make pr
viksrivat Jun 26, 2019
4555f11
Reorganize classes
viksrivat Jun 27, 2019
420a842
Update docstrings
viksrivat Jun 27, 2019
6803a0b
Restructure to seperate SAM and CF providers seperately + tests
viksrivat Jun 27, 2019
837137f
Remove transform flag in the rest-api
viksrivat Jun 27, 2019
4130ea2
Remove BaseProvider object
viksrivat Jun 27, 2019
19eaebe
Update tests and code with comments
viksrivat Jun 27, 2019
23467de
Update tests with comments
viksrivat Jun 28, 2019
066b236
Trigger
viksrivat Jun 28, 2019
8987db2
Remove noapievent
viksrivat Jun 28, 2019
4a792bf
Update tests
viksrivat Jun 28, 2019
7662f24
Fixed comments
viksrivat Jul 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions samcli/commands/local/lib/local_api_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import logging

from samcli.local.apigw.local_apigw_service import LocalApigwService, Route
from samcli.commands.local.lib.sam_api_provider import SamApiProvider
from samcli.commands.local.lib.sam_api_provider import ApiProvider
from samcli.commands.local.lib.exceptions import NoApisDefined

LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -38,9 +38,9 @@ def __init__(self,
self.static_dir = static_dir

self.cwd = lambda_invoke_context.get_cwd()
self.api_provider = SamApiProvider(lambda_invoke_context.template,
parameter_overrides=lambda_invoke_context.parameter_overrides,
cwd=self.cwd)
self.api_provider = ApiProvider(lambda_invoke_context.template,
parameter_overrides=lambda_invoke_context.parameter_overrides,
cwd=self.cwd)
self.lambda_runner = lambda_invoke_context.local_lambda_runner
self.stderr_stream = lambda_invoke_context.stderr

Expand Down Expand Up @@ -89,7 +89,7 @@ def _make_routing_list(api_provider):

Parameters
----------
api_provider : samcli.commands.local.lib.sam_api_provider.SamApiProvider
api_provider : samcli.commands.local.lib.sam_api_provider.ApiProvider

Returns
-------
Expand All @@ -116,10 +116,14 @@ def _print_routes(api_provider, host, port):
Mounting Product at http://127.0.0.1:3000/path1/bar [GET, POST, DELETE]
Mounting Product at http://127.0.0.1:3000/path2/bar [HEAD]

:param samcli.commands.local.lib.provider.ApiProvider api_provider: API Provider that can return a list of APIs
:param string host: Host name where the service is running
:param int port: Port number where the service is running
:returns list(string): List of lines that were printed to the console. Helps with testing
:param samcli.commands.local.lib.provider.AbstractApiProvider api_provider:
API Provider that can return a list of APIs
:param string host:
Host name where the service is running
:param int port:
Port number where the service is running
:returns list(string):
List of lines that were printed to the console. Helps with testing
"""
grouped_api_configs = {}

Expand Down
2 changes: 1 addition & 1 deletion samcli/commands/local/lib/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def __hash__(self):
Cors = namedtuple("Cors", ["AllowOrigin", "AllowMethods", "AllowHeaders"])


class ApiProvider(object):
class AbstractApiProvider(object):
"""
Abstract base class to return APIs and the functions they route to
"""
Expand Down
Loading