repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Miserlou/Zappa | example/authmodule.py | AuthPolicy._addMethod | def _addMethod(self, effect, verb, resource, conditions):
"""Adds a method to the internal lists of allowed or denied methods. Each object in
the internal list contains a resource ARN and a condition statement. The condition
statement can be null."""
if verb != "*" and not hasattr(HttpVe... | python | def _addMethod(self, effect, verb, resource, conditions):
"""Adds a method to the internal lists of allowed or denied methods. Each object in
the internal list contains a resource ARN and a condition statement. The condition
statement can be null."""
if verb != "*" and not hasattr(HttpVe... | [
"def",
"_addMethod",
"(",
"self",
",",
"effect",
",",
"verb",
",",
"resource",
",",
"conditions",
")",
":",
"if",
"verb",
"!=",
"\"*\"",
"and",
"not",
"hasattr",
"(",
"HttpVerb",
",",
"verb",
")",
":",
"raise",
"NameError",
"(",
"\"Invalid HTTP verb \"",
... | Adds a method to the internal lists of allowed or denied methods. Each object in
the internal list contains a resource ARN and a condition statement. The condition
statement can be null. | [
"Adds",
"a",
"method",
"to",
"the",
"internal",
"lists",
"of",
"allowed",
"or",
"denied",
"methods",
".",
"Each",
"object",
"in",
"the",
"internal",
"list",
"contains",
"a",
"resource",
"ARN",
"and",
"a",
"condition",
"statement",
".",
"The",
"condition",
... | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/example/authmodule.py#L104-L134 | train | Adds a method to the internal list of allowed or denied methods. Each object in
is added to the internal list of allowed or denied methods. Each object in
is added to the internal list of allowed or denied methods. The condition statement can be null. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | example/authmodule.py | AuthPolicy.allowMethodWithConditions | def allowMethodWithConditions(self, verb, resource, conditions):
"""Adds an API Gateway method (Http verb + Resource path) to the list of allowed
methods and includes a condition for the policy statement. More on AWS policy
conditions here: http://docs.aws.amazon.com/IAM/latest/UserGuide/referen... | python | def allowMethodWithConditions(self, verb, resource, conditions):
"""Adds an API Gateway method (Http verb + Resource path) to the list of allowed
methods and includes a condition for the policy statement. More on AWS policy
conditions here: http://docs.aws.amazon.com/IAM/latest/UserGuide/referen... | [
"def",
"allowMethodWithConditions",
"(",
"self",
",",
"verb",
",",
"resource",
",",
"conditions",
")",
":",
"self",
".",
"_addMethod",
"(",
"\"Allow\"",
",",
"verb",
",",
"resource",
",",
"conditions",
")"
] | Adds an API Gateway method (Http verb + Resource path) to the list of allowed
methods and includes a condition for the policy statement. More on AWS policy
conditions here: http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#Condition | [
"Adds",
"an",
"API",
"Gateway",
"method",
"(",
"Http",
"verb",
"+",
"Resource",
"path",
")",
"to",
"the",
"list",
"of",
"allowed",
"methods",
"and",
"includes",
"a",
"condition",
"for",
"the",
"policy",
"statement",
".",
"More",
"on",
"AWS",
"policy",
"c... | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/example/authmodule.py#L186-L190 | train | Adds an API Gateway method with the given verb + resource path and add a condition for the policy statement. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | example/authmodule.py | AuthPolicy.denyMethodWithConditions | def denyMethodWithConditions(self, verb, resource, conditions):
"""Adds an API Gateway method (Http verb + Resource path) to the list of denied
methods and includes a condition for the policy statement. More on AWS policy
conditions here: http://docs.aws.amazon.com/IAM/latest/UserGuide/reference... | python | def denyMethodWithConditions(self, verb, resource, conditions):
"""Adds an API Gateway method (Http verb + Resource path) to the list of denied
methods and includes a condition for the policy statement. More on AWS policy
conditions here: http://docs.aws.amazon.com/IAM/latest/UserGuide/reference... | [
"def",
"denyMethodWithConditions",
"(",
"self",
",",
"verb",
",",
"resource",
",",
"conditions",
")",
":",
"self",
".",
"_addMethod",
"(",
"\"Deny\"",
",",
"verb",
",",
"resource",
",",
"conditions",
")"
] | Adds an API Gateway method (Http verb + Resource path) to the list of denied
methods and includes a condition for the policy statement. More on AWS policy
conditions here: http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#Condition | [
"Adds",
"an",
"API",
"Gateway",
"method",
"(",
"Http",
"verb",
"+",
"Resource",
"path",
")",
"to",
"the",
"list",
"of",
"denied",
"methods",
"and",
"includes",
"a",
"condition",
"for",
"the",
"policy",
"statement",
".",
"More",
"on",
"AWS",
"policy",
"co... | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/example/authmodule.py#L192-L196 | train | Adds an API Gateway method to the list of denied
methods and includes a condition for the policy statement. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | example/authmodule.py | AuthPolicy.build | def build(self):
"""Generates the policy document based on the internal lists of allowed and denied
conditions. This will generate a policy with two main statements for the effect:
one statement for Allow and one statement for Deny.
Methods that includes conditions will have their own st... | python | def build(self):
"""Generates the policy document based on the internal lists of allowed and denied
conditions. This will generate a policy with two main statements for the effect:
one statement for Allow and one statement for Deny.
Methods that includes conditions will have their own st... | [
"def",
"build",
"(",
"self",
")",
":",
"if",
"(",
"(",
"self",
".",
"allowMethods",
"is",
"None",
"or",
"len",
"(",
"self",
".",
"allowMethods",
")",
"==",
"0",
")",
"and",
"(",
"self",
".",
"denyMethods",
"is",
"None",
"or",
"len",
"(",
"self",
... | Generates the policy document based on the internal lists of allowed and denied
conditions. This will generate a policy with two main statements for the effect:
one statement for Allow and one statement for Deny.
Methods that includes conditions will have their own statement in the policy. | [
"Generates",
"the",
"policy",
"document",
"based",
"on",
"the",
"internal",
"lists",
"of",
"allowed",
"and",
"denied",
"conditions",
".",
"This",
"will",
"generate",
"a",
"policy",
"with",
"two",
"main",
"statements",
"for",
"the",
"effect",
":",
"one",
"sta... | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/example/authmodule.py#L198-L218 | train | Builds the policy document based on the internal lists of allowed and denied conditions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.configure_boto_session_method_kwargs | def configure_boto_session_method_kwargs(self, service, kw):
"""Allow for custom endpoint urls for non-AWS (testing and bootleg cloud) deployments"""
if service in self.endpoint_urls and not 'endpoint_url' in kw:
kw['endpoint_url'] = self.endpoint_urls[service]
return kw | python | def configure_boto_session_method_kwargs(self, service, kw):
"""Allow for custom endpoint urls for non-AWS (testing and bootleg cloud) deployments"""
if service in self.endpoint_urls and not 'endpoint_url' in kw:
kw['endpoint_url'] = self.endpoint_urls[service]
return kw | [
"def",
"configure_boto_session_method_kwargs",
"(",
"self",
",",
"service",
",",
"kw",
")",
":",
"if",
"service",
"in",
"self",
".",
"endpoint_urls",
"and",
"not",
"'endpoint_url'",
"in",
"kw",
":",
"kw",
"[",
"'endpoint_url'",
"]",
"=",
"self",
".",
"endpoi... | Allow for custom endpoint urls for non-AWS (testing and bootleg cloud) deployments | [
"Allow",
"for",
"custom",
"endpoint",
"urls",
"for",
"non",
"-",
"AWS",
"(",
"testing",
"and",
"bootleg",
"cloud",
")",
"deployments"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L328-L332 | train | Allow for custom endpoint urls for non - AWS deployments | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.boto_client | def boto_client(self, service, *args, **kwargs):
"""A wrapper to apply configuration options to boto clients"""
return self.boto_session.client(service, *args, **self.configure_boto_session_method_kwargs(service, kwargs)) | python | def boto_client(self, service, *args, **kwargs):
"""A wrapper to apply configuration options to boto clients"""
return self.boto_session.client(service, *args, **self.configure_boto_session_method_kwargs(service, kwargs)) | [
"def",
"boto_client",
"(",
"self",
",",
"service",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"boto_session",
".",
"client",
"(",
"service",
",",
"*",
"args",
",",
"*",
"*",
"self",
".",
"configure_boto_session_method_kwa... | A wrapper to apply configuration options to boto clients | [
"A",
"wrapper",
"to",
"apply",
"configuration",
"options",
"to",
"boto",
"clients"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L334-L336 | train | A wrapper to apply configuration options to boto clients | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.boto_resource | def boto_resource(self, service, *args, **kwargs):
"""A wrapper to apply configuration options to boto resources"""
return self.boto_session.resource(service, *args, **self.configure_boto_session_method_kwargs(service, kwargs)) | python | def boto_resource(self, service, *args, **kwargs):
"""A wrapper to apply configuration options to boto resources"""
return self.boto_session.resource(service, *args, **self.configure_boto_session_method_kwargs(service, kwargs)) | [
"def",
"boto_resource",
"(",
"self",
",",
"service",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"boto_session",
".",
"resource",
"(",
"service",
",",
"*",
"args",
",",
"*",
"*",
"self",
".",
"configure_boto_session_method... | A wrapper to apply configuration options to boto resources | [
"A",
"wrapper",
"to",
"apply",
"configuration",
"options",
"to",
"boto",
"resources"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L338-L340 | train | A wrapper to apply configuration options to boto resources | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.cache_param | def cache_param(self, value):
'''Returns a troposphere Ref to a value cached as a parameter.'''
if value not in self.cf_parameters:
keyname = chr(ord('A') + len(self.cf_parameters))
param = self.cf_template.add_parameter(troposphere.Parameter(
keyname, Type="Stri... | python | def cache_param(self, value):
'''Returns a troposphere Ref to a value cached as a parameter.'''
if value not in self.cf_parameters:
keyname = chr(ord('A') + len(self.cf_parameters))
param = self.cf_template.add_parameter(troposphere.Parameter(
keyname, Type="Stri... | [
"def",
"cache_param",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
"not",
"in",
"self",
".",
"cf_parameters",
":",
"keyname",
"=",
"chr",
"(",
"ord",
"(",
"'A'",
")",
"+",
"len",
"(",
"self",
".",
"cf_parameters",
")",
")",
"param",
"=",
"se... | Returns a troposphere Ref to a value cached as a parameter. | [
"Returns",
"a",
"troposphere",
"Ref",
"to",
"a",
"value",
"cached",
"as",
"a",
"parameter",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L342-L353 | train | Returns a troposphere Ref to a value cached as a parameter. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_deps_list | def get_deps_list(self, pkg_name, installed_distros=None):
"""
For a given package, returns a list of required packages. Recursive.
"""
# https://github.com/Miserlou/Zappa/issues/1478. Using `pkg_resources`
# instead of `pip` is the recommended approach. The usage is nearly
... | python | def get_deps_list(self, pkg_name, installed_distros=None):
"""
For a given package, returns a list of required packages. Recursive.
"""
# https://github.com/Miserlou/Zappa/issues/1478. Using `pkg_resources`
# instead of `pip` is the recommended approach. The usage is nearly
... | [
"def",
"get_deps_list",
"(",
"self",
",",
"pkg_name",
",",
"installed_distros",
"=",
"None",
")",
":",
"# https://github.com/Miserlou/Zappa/issues/1478. Using `pkg_resources`",
"# instead of `pip` is the recommended approach. The usage is nearly",
"# identical.",
"import",
"pkg_res... | For a given package, returns a list of required packages. Recursive. | [
"For",
"a",
"given",
"package",
"returns",
"a",
"list",
"of",
"required",
"packages",
".",
"Recursive",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L373-L389 | train | Returns a list of required packages. Recursive. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_handler_venv | def create_handler_venv(self):
"""
Takes the installed zappa and brings it into a fresh virtualenv-like folder. All dependencies are then downloaded.
"""
import subprocess
# We will need the currenv venv to pull Zappa from
current_venv = self.get_current_venv()
... | python | def create_handler_venv(self):
"""
Takes the installed zappa and brings it into a fresh virtualenv-like folder. All dependencies are then downloaded.
"""
import subprocess
# We will need the currenv venv to pull Zappa from
current_venv = self.get_current_venv()
... | [
"def",
"create_handler_venv",
"(",
"self",
")",
":",
"import",
"subprocess",
"# We will need the currenv venv to pull Zappa from",
"current_venv",
"=",
"self",
".",
"get_current_venv",
"(",
")",
"# Make a new folder for the handler packages",
"ve_path",
"=",
"os",
".",
"pat... | Takes the installed zappa and brings it into a fresh virtualenv-like folder. All dependencies are then downloaded. | [
"Takes",
"the",
"installed",
"zappa",
"and",
"brings",
"it",
"into",
"a",
"fresh",
"virtualenv",
"-",
"like",
"folder",
".",
"All",
"dependencies",
"are",
"then",
"downloaded",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L391-L437 | train | Takes the installed zappa and brings it into a fresh virtualenv - like folder. All dependencies are downloaded. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_current_venv | def get_current_venv():
"""
Returns the path to the current virtualenv
"""
if 'VIRTUAL_ENV' in os.environ:
venv = os.environ['VIRTUAL_ENV']
elif os.path.exists('.python-version'): # pragma: no cover
try:
subprocess.check_output(['pyenv', '... | python | def get_current_venv():
"""
Returns the path to the current virtualenv
"""
if 'VIRTUAL_ENV' in os.environ:
venv = os.environ['VIRTUAL_ENV']
elif os.path.exists('.python-version'): # pragma: no cover
try:
subprocess.check_output(['pyenv', '... | [
"def",
"get_current_venv",
"(",
")",
":",
"if",
"'VIRTUAL_ENV'",
"in",
"os",
".",
"environ",
":",
"venv",
"=",
"os",
".",
"environ",
"[",
"'VIRTUAL_ENV'",
"]",
"elif",
"os",
".",
"path",
".",
"exists",
"(",
"'.python-version'",
")",
":",
"# pragma: no cove... | Returns the path to the current virtualenv | [
"Returns",
"the",
"path",
"to",
"the",
"current",
"virtualenv"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L441-L461 | train | Returns the path to the current virtualenv | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_lambda_zip | def create_lambda_zip( self,
prefix='lambda_package',
handler_file=None,
slim_handler=False,
minify=True,
exclude=None,
use_precompiled_packages=True,
... | python | def create_lambda_zip( self,
prefix='lambda_package',
handler_file=None,
slim_handler=False,
minify=True,
exclude=None,
use_precompiled_packages=True,
... | [
"def",
"create_lambda_zip",
"(",
"self",
",",
"prefix",
"=",
"'lambda_package'",
",",
"handler_file",
"=",
"None",
",",
"slim_handler",
"=",
"False",
",",
"minify",
"=",
"True",
",",
"exclude",
"=",
"None",
",",
"use_precompiled_packages",
"=",
"True",
",",
... | Create a Lambda-ready zip file of the current virtualenvironment and working directory.
Returns path to that file. | [
"Create",
"a",
"Lambda",
"-",
"ready",
"zip",
"file",
"of",
"the",
"current",
"virtualenvironment",
"and",
"working",
"directory",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L463-L760 | train | Create a Lambda - ready zip file of the current virtual environment and working directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.extract_lambda_package | def extract_lambda_package(self, package_name, path):
"""
Extracts the lambda package into a given path. Assumes the package exists in lambda packages.
"""
lambda_package = lambda_packages[package_name][self.runtime]
# Trash the local version to help with package space saving
... | python | def extract_lambda_package(self, package_name, path):
"""
Extracts the lambda package into a given path. Assumes the package exists in lambda packages.
"""
lambda_package = lambda_packages[package_name][self.runtime]
# Trash the local version to help with package space saving
... | [
"def",
"extract_lambda_package",
"(",
"self",
",",
"package_name",
",",
"path",
")",
":",
"lambda_package",
"=",
"lambda_packages",
"[",
"package_name",
"]",
"[",
"self",
".",
"runtime",
"]",
"# Trash the local version to help with package space saving",
"shutil",
".",
... | Extracts the lambda package into a given path. Assumes the package exists in lambda packages. | [
"Extracts",
"the",
"lambda",
"package",
"into",
"a",
"given",
"path",
".",
"Assumes",
"the",
"package",
"exists",
"in",
"lambda",
"packages",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L762-L773 | train | Extracts the lambda package into a given path. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_installed_packages | def get_installed_packages(site_packages, site_packages_64):
"""
Returns a dict of installed packages that Zappa cares about.
"""
import pkg_resources
package_to_keep = []
if os.path.isdir(site_packages):
package_to_keep += os.listdir(site_packages)
i... | python | def get_installed_packages(site_packages, site_packages_64):
"""
Returns a dict of installed packages that Zappa cares about.
"""
import pkg_resources
package_to_keep = []
if os.path.isdir(site_packages):
package_to_keep += os.listdir(site_packages)
i... | [
"def",
"get_installed_packages",
"(",
"site_packages",
",",
"site_packages_64",
")",
":",
"import",
"pkg_resources",
"package_to_keep",
"=",
"[",
"]",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"site_packages",
")",
":",
"package_to_keep",
"+=",
"os",
".",
"l... | Returns a dict of installed packages that Zappa cares about. | [
"Returns",
"a",
"dict",
"of",
"installed",
"packages",
"that",
"Zappa",
"cares",
"about",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L776-L795 | train | Returns a dict of installed packages that Zappa cares about. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.have_correct_lambda_package_version | def have_correct_lambda_package_version(self, package_name, package_version):
"""
Checks if a given package version binary should be copied over from lambda packages.
package_name should be lower-cased version of package name.
"""
lambda_package_details = lambda_packages.get(pack... | python | def have_correct_lambda_package_version(self, package_name, package_version):
"""
Checks if a given package version binary should be copied over from lambda packages.
package_name should be lower-cased version of package name.
"""
lambda_package_details = lambda_packages.get(pack... | [
"def",
"have_correct_lambda_package_version",
"(",
"self",
",",
"package_name",
",",
"package_version",
")",
":",
"lambda_package_details",
"=",
"lambda_packages",
".",
"get",
"(",
"package_name",
",",
"{",
"}",
")",
".",
"get",
"(",
"self",
".",
"runtime",
")",... | Checks if a given package version binary should be copied over from lambda packages.
package_name should be lower-cased version of package name. | [
"Checks",
"if",
"a",
"given",
"package",
"version",
"binary",
"should",
"be",
"copied",
"over",
"from",
"lambda",
"packages",
".",
"package_name",
"should",
"be",
"lower",
"-",
"cased",
"version",
"of",
"package",
"name",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L797-L812 | train | Checks if a given package version binary should be copied over from lambda packages. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.download_url_with_progress | def download_url_with_progress(url, stream, disable_progress):
"""
Downloads a given url in chunks and writes to the provided stream (can be any io stream).
Displays the progress bar for the download.
"""
resp = requests.get(url, timeout=float(os.environ.get('PIP_TIMEOUT', 2)), s... | python | def download_url_with_progress(url, stream, disable_progress):
"""
Downloads a given url in chunks and writes to the provided stream (can be any io stream).
Displays the progress bar for the download.
"""
resp = requests.get(url, timeout=float(os.environ.get('PIP_TIMEOUT', 2)), s... | [
"def",
"download_url_with_progress",
"(",
"url",
",",
"stream",
",",
"disable_progress",
")",
":",
"resp",
"=",
"requests",
".",
"get",
"(",
"url",
",",
"timeout",
"=",
"float",
"(",
"os",
".",
"environ",
".",
"get",
"(",
"'PIP_TIMEOUT'",
",",
"2",
")",
... | Downloads a given url in chunks and writes to the provided stream (can be any io stream).
Displays the progress bar for the download. | [
"Downloads",
"a",
"given",
"url",
"in",
"chunks",
"and",
"writes",
"to",
"the",
"provided",
"stream",
"(",
"can",
"be",
"any",
"io",
"stream",
")",
".",
"Displays",
"the",
"progress",
"bar",
"for",
"the",
"download",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L822-L836 | train | Downloads a given url in chunks and writes it to the provided stream. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_cached_manylinux_wheel | def get_cached_manylinux_wheel(self, package_name, package_version, disable_progress=False):
"""
Gets the locally stored version of a manylinux wheel. If one does not exist, the function downloads it.
"""
cached_wheels_dir = os.path.join(tempfile.gettempdir(), 'cached_wheels')
if... | python | def get_cached_manylinux_wheel(self, package_name, package_version, disable_progress=False):
"""
Gets the locally stored version of a manylinux wheel. If one does not exist, the function downloads it.
"""
cached_wheels_dir = os.path.join(tempfile.gettempdir(), 'cached_wheels')
if... | [
"def",
"get_cached_manylinux_wheel",
"(",
"self",
",",
"package_name",
",",
"package_version",
",",
"disable_progress",
"=",
"False",
")",
":",
"cached_wheels_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"tempfile",
".",
"gettempdir",
"(",
")",
",",
"'cache... | Gets the locally stored version of a manylinux wheel. If one does not exist, the function downloads it. | [
"Gets",
"the",
"locally",
"stored",
"version",
"of",
"a",
"manylinux",
"wheel",
".",
"If",
"one",
"does",
"not",
"exist",
"the",
"function",
"downloads",
"it",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L838-L864 | train | Gets the locally stored version of a manylinux wheel. If one does not exist the function downloads it. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_manylinux_wheel_url | def get_manylinux_wheel_url(self, package_name, package_version):
"""
For a given package name, returns a link to the download URL,
else returns None.
Related: https://github.com/Miserlou/Zappa/issues/398
Examples here: https://gist.github.com/perrygeo/9545f94eaddec18a65fd7b5688... | python | def get_manylinux_wheel_url(self, package_name, package_version):
"""
For a given package name, returns a link to the download URL,
else returns None.
Related: https://github.com/Miserlou/Zappa/issues/398
Examples here: https://gist.github.com/perrygeo/9545f94eaddec18a65fd7b5688... | [
"def",
"get_manylinux_wheel_url",
"(",
"self",
",",
"package_name",
",",
"package_version",
")",
":",
"cached_pypi_info_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"tempfile",
".",
"gettempdir",
"(",
")",
",",
"'cached_pypi_info'",
")",
"if",
"not",
"os",
... | For a given package name, returns a link to the download URL,
else returns None.
Related: https://github.com/Miserlou/Zappa/issues/398
Examples here: https://gist.github.com/perrygeo/9545f94eaddec18a65fd7b56880adbae
This function downloads metadata JSON of `package_name` from Pypi
... | [
"For",
"a",
"given",
"package",
"name",
"returns",
"a",
"link",
"to",
"the",
"download",
"URL",
"else",
"returns",
"None",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L866-L909 | train | Get a link to the download URL of a manylinux wheel. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.upload_to_s3 | def upload_to_s3(self, source_path, bucket_name, disable_progress=False):
r"""
Given a file, upload it to S3.
Credentials should be stored in environment variables or ~/.aws/credentials (%USERPROFILE%\.aws\credentials on Windows).
Returns True on success, false on failure.
"""
... | python | def upload_to_s3(self, source_path, bucket_name, disable_progress=False):
r"""
Given a file, upload it to S3.
Credentials should be stored in environment variables or ~/.aws/credentials (%USERPROFILE%\.aws\credentials on Windows).
Returns True on success, false on failure.
"""
... | [
"def",
"upload_to_s3",
"(",
"self",
",",
"source_path",
",",
"bucket_name",
",",
"disable_progress",
"=",
"False",
")",
":",
"try",
":",
"self",
".",
"s3_client",
".",
"head_bucket",
"(",
"Bucket",
"=",
"bucket_name",
")",
"except",
"botocore",
".",
"excepti... | r"""
Given a file, upload it to S3.
Credentials should be stored in environment variables or ~/.aws/credentials (%USERPROFILE%\.aws\credentials on Windows).
Returns True on success, false on failure. | [
"r",
"Given",
"a",
"file",
"upload",
"it",
"to",
"S3",
".",
"Credentials",
"should",
"be",
"stored",
"in",
"environment",
"variables",
"or",
"~",
"/",
".",
"aws",
"/",
"credentials",
"(",
"%USERPROFILE%",
"\\",
".",
"aws",
"\\",
"credentials",
"on",
"Win... | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L915-L973 | train | r Uploads a file to S3. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.copy_on_s3 | def copy_on_s3(self, src_file_name, dst_file_name, bucket_name):
"""
Copies src file to destination within a bucket.
"""
try:
self.s3_client.head_bucket(Bucket=bucket_name)
except botocore.exceptions.ClientError as e: # pragma: no cover
# If a client erro... | python | def copy_on_s3(self, src_file_name, dst_file_name, bucket_name):
"""
Copies src file to destination within a bucket.
"""
try:
self.s3_client.head_bucket(Bucket=bucket_name)
except botocore.exceptions.ClientError as e: # pragma: no cover
# If a client erro... | [
"def",
"copy_on_s3",
"(",
"self",
",",
"src_file_name",
",",
"dst_file_name",
",",
"bucket_name",
")",
":",
"try",
":",
"self",
".",
"s3_client",
".",
"head_bucket",
"(",
"Bucket",
"=",
"bucket_name",
")",
"except",
"botocore",
".",
"exceptions",
".",
"Clien... | Copies src file to destination within a bucket. | [
"Copies",
"src",
"file",
"to",
"destination",
"within",
"a",
"bucket",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L975-L1000 | train | Copies a file from src_file_name to dst_file_name within a bucket. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.remove_from_s3 | def remove_from_s3(self, file_name, bucket_name):
"""
Given a file name and a bucket, remove it from S3.
There's no reason to keep the file hosted on S3 once its been made into a Lambda function, so we can delete it from S3.
Returns True on success, False on failure.
"""
... | python | def remove_from_s3(self, file_name, bucket_name):
"""
Given a file name and a bucket, remove it from S3.
There's no reason to keep the file hosted on S3 once its been made into a Lambda function, so we can delete it from S3.
Returns True on success, False on failure.
"""
... | [
"def",
"remove_from_s3",
"(",
"self",
",",
"file_name",
",",
"bucket_name",
")",
":",
"try",
":",
"self",
".",
"s3_client",
".",
"head_bucket",
"(",
"Bucket",
"=",
"bucket_name",
")",
"except",
"botocore",
".",
"exceptions",
".",
"ClientError",
"as",
"e",
... | Given a file name and a bucket, remove it from S3.
There's no reason to keep the file hosted on S3 once its been made into a Lambda function, so we can delete it from S3.
Returns True on success, False on failure. | [
"Given",
"a",
"file",
"name",
"and",
"a",
"bucket",
"remove",
"it",
"from",
"S3",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1002-L1024 | train | Removes a file from S3. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_lambda_function | def create_lambda_function( self,
bucket=None,
function_name=None,
handler=None,
s3_key=None,
description='Zappa Deployment',
ti... | python | def create_lambda_function( self,
bucket=None,
function_name=None,
handler=None,
s3_key=None,
description='Zappa Deployment',
ti... | [
"def",
"create_lambda_function",
"(",
"self",
",",
"bucket",
"=",
"None",
",",
"function_name",
"=",
"None",
",",
"handler",
"=",
"None",
",",
"s3_key",
"=",
"None",
",",
"description",
"=",
"'Zappa Deployment'",
",",
"timeout",
"=",
"30",
",",
"memory_size"... | Given a bucket and key (or a local path) of a valid Lambda-zip, a function name and a handler, register that Lambda function. | [
"Given",
"a",
"bucket",
"and",
"key",
"(",
"or",
"a",
"local",
"path",
")",
"of",
"a",
"valid",
"Lambda",
"-",
"zip",
"a",
"function",
"name",
"and",
"a",
"handler",
"register",
"that",
"Lambda",
"function",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1030-L1109 | train | Creates a Lambda function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.update_lambda_function | def update_lambda_function(self, bucket, function_name, s3_key=None, publish=True, local_zip=None, num_revisions=None):
"""
Given a bucket and key (or a local path) of a valid Lambda-zip, a function name and a handler, update that Lambda function's code.
Optionally, delete previous versions if t... | python | def update_lambda_function(self, bucket, function_name, s3_key=None, publish=True, local_zip=None, num_revisions=None):
"""
Given a bucket and key (or a local path) of a valid Lambda-zip, a function name and a handler, update that Lambda function's code.
Optionally, delete previous versions if t... | [
"def",
"update_lambda_function",
"(",
"self",
",",
"bucket",
",",
"function_name",
",",
"s3_key",
"=",
"None",
",",
"publish",
"=",
"True",
",",
"local_zip",
"=",
"None",
",",
"num_revisions",
"=",
"None",
")",
":",
"print",
"(",
"\"Updating Lambda function co... | Given a bucket and key (or a local path) of a valid Lambda-zip, a function name and a handler, update that Lambda function's code.
Optionally, delete previous versions if they exceed the optional limit. | [
"Given",
"a",
"bucket",
"and",
"key",
"(",
"or",
"a",
"local",
"path",
")",
"of",
"a",
"valid",
"Lambda",
"-",
"zip",
"a",
"function",
"name",
"and",
"a",
"handler",
"update",
"that",
"Lambda",
"function",
"s",
"code",
".",
"Optionally",
"delete",
"pre... | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1111-L1172 | train | Update the Lambda function s code. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.update_lambda_configuration | def update_lambda_configuration( self,
lambda_arn,
function_name,
handler,
description='Zappa Deployment',
timeout=30... | python | def update_lambda_configuration( self,
lambda_arn,
function_name,
handler,
description='Zappa Deployment',
timeout=30... | [
"def",
"update_lambda_configuration",
"(",
"self",
",",
"lambda_arn",
",",
"function_name",
",",
"handler",
",",
"description",
"=",
"'Zappa Deployment'",
",",
"timeout",
"=",
"30",
",",
"memory_size",
"=",
"512",
",",
"publish",
"=",
"True",
",",
"vpc_config",
... | Given an existing function ARN, update the configuration variables. | [
"Given",
"an",
"existing",
"function",
"ARN",
"update",
"the",
"configuration",
"variables",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1174-L1232 | train | Update the Lambda function configuration. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.invoke_lambda_function | def invoke_lambda_function( self,
function_name,
payload,
invocation_type='Event',
log_type='Tail',
client_context=None,
qualifi... | python | def invoke_lambda_function( self,
function_name,
payload,
invocation_type='Event',
log_type='Tail',
client_context=None,
qualifi... | [
"def",
"invoke_lambda_function",
"(",
"self",
",",
"function_name",
",",
"payload",
",",
"invocation_type",
"=",
"'Event'",
",",
"log_type",
"=",
"'Tail'",
",",
"client_context",
"=",
"None",
",",
"qualifier",
"=",
"None",
")",
":",
"return",
"self",
".",
"l... | Directly invoke a named Lambda function with a payload.
Returns the response. | [
"Directly",
"invoke",
"a",
"named",
"Lambda",
"function",
"with",
"a",
"payload",
".",
"Returns",
"the",
"response",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1234-L1251 | train | Directly invoke a named Lambda function with a payload. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.rollback_lambda_function_version | def rollback_lambda_function_version(self, function_name, versions_back=1, publish=True):
"""
Rollback the lambda function code 'versions_back' number of revisions.
Returns the Function ARN.
"""
response = self.lambda_client.list_versions_by_function(FunctionName=function_name)
... | python | def rollback_lambda_function_version(self, function_name, versions_back=1, publish=True):
"""
Rollback the lambda function code 'versions_back' number of revisions.
Returns the Function ARN.
"""
response = self.lambda_client.list_versions_by_function(FunctionName=function_name)
... | [
"def",
"rollback_lambda_function_version",
"(",
"self",
",",
"function_name",
",",
"versions_back",
"=",
"1",
",",
"publish",
"=",
"True",
")",
":",
"response",
"=",
"self",
".",
"lambda_client",
".",
"list_versions_by_function",
"(",
"FunctionName",
"=",
"functio... | Rollback the lambda function code 'versions_back' number of revisions.
Returns the Function ARN. | [
"Rollback",
"the",
"lambda",
"function",
"code",
"versions_back",
"number",
"of",
"revisions",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1253-L1278 | train | Rollback the lambda function code versions_back number of revisions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_lambda_function | def get_lambda_function(self, function_name):
"""
Returns the lambda function ARN, given a name
This requires the "lambda:GetFunction" role.
"""
response = self.lambda_client.get_function(
FunctionName=function_name)
return response['Configuration']['Func... | python | def get_lambda_function(self, function_name):
"""
Returns the lambda function ARN, given a name
This requires the "lambda:GetFunction" role.
"""
response = self.lambda_client.get_function(
FunctionName=function_name)
return response['Configuration']['Func... | [
"def",
"get_lambda_function",
"(",
"self",
",",
"function_name",
")",
":",
"response",
"=",
"self",
".",
"lambda_client",
".",
"get_function",
"(",
"FunctionName",
"=",
"function_name",
")",
"return",
"response",
"[",
"'Configuration'",
"]",
"[",
"'FunctionArn'",
... | Returns the lambda function ARN, given a name
This requires the "lambda:GetFunction" role. | [
"Returns",
"the",
"lambda",
"function",
"ARN",
"given",
"a",
"name"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1280-L1288 | train | Returns the lambda function ARN given a name | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_lambda_function_versions | def get_lambda_function_versions(self, function_name):
"""
Simply returns the versions available for a Lambda function, given a function name.
"""
try:
response = self.lambda_client.list_versions_by_function(
FunctionName=function_name
)
... | python | def get_lambda_function_versions(self, function_name):
"""
Simply returns the versions available for a Lambda function, given a function name.
"""
try:
response = self.lambda_client.list_versions_by_function(
FunctionName=function_name
)
... | [
"def",
"get_lambda_function_versions",
"(",
"self",
",",
"function_name",
")",
":",
"try",
":",
"response",
"=",
"self",
".",
"lambda_client",
".",
"list_versions_by_function",
"(",
"FunctionName",
"=",
"function_name",
")",
"return",
"response",
".",
"get",
"(",
... | Simply returns the versions available for a Lambda function, given a function name. | [
"Simply",
"returns",
"the",
"versions",
"available",
"for",
"a",
"Lambda",
"function",
"given",
"a",
"function",
"name",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1290-L1301 | train | Returns the versions available for a Lambda function given a function name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.deploy_lambda_alb | def deploy_lambda_alb( self,
lambda_arn,
lambda_name,
alb_vpc_config,
timeout
):
"""
The `zappa deploy` functionality for ALB infrastructure.
"""
if n... | python | def deploy_lambda_alb( self,
lambda_arn,
lambda_name,
alb_vpc_config,
timeout
):
"""
The `zappa deploy` functionality for ALB infrastructure.
"""
if n... | [
"def",
"deploy_lambda_alb",
"(",
"self",
",",
"lambda_arn",
",",
"lambda_name",
",",
"alb_vpc_config",
",",
"timeout",
")",
":",
"if",
"not",
"alb_vpc_config",
":",
"raise",
"EnvironmentError",
"(",
"'When creating an ALB, alb_vpc_config must be filled out in zappa_settings... | The `zappa deploy` functionality for ALB infrastructure. | [
"The",
"zappa",
"deploy",
"functionality",
"for",
"ALB",
"infrastructure",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1320-L1432 | train | Deploy an ALB infrastructure to the AWS Lambda. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.undeploy_lambda_alb | def undeploy_lambda_alb(self, lambda_name):
"""
The `zappa undeploy` functionality for ALB infrastructure.
"""
print("Undeploying ALB infrastructure...")
# Locate and delete alb/lambda permissions
try:
# https://boto3.amazonaws.com/v1/documentation/api/latest... | python | def undeploy_lambda_alb(self, lambda_name):
"""
The `zappa undeploy` functionality for ALB infrastructure.
"""
print("Undeploying ALB infrastructure...")
# Locate and delete alb/lambda permissions
try:
# https://boto3.amazonaws.com/v1/documentation/api/latest... | [
"def",
"undeploy_lambda_alb",
"(",
"self",
",",
"lambda_name",
")",
":",
"print",
"(",
"\"Undeploying ALB infrastructure...\"",
")",
"# Locate and delete alb/lambda permissions",
"try",
":",
"# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambd... | The `zappa undeploy` functionality for ALB infrastructure. | [
"The",
"zappa",
"undeploy",
"functionality",
"for",
"ALB",
"infrastructure",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1434-L1518 | train | Undeploy an ALB infrastructure. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_api_gateway_routes | def create_api_gateway_routes( self,
lambda_arn,
api_name=None,
api_key_required=False,
authorization_type='NONE',
authorizer=None,
... | python | def create_api_gateway_routes( self,
lambda_arn,
api_name=None,
api_key_required=False,
authorization_type='NONE',
authorizer=None,
... | [
"def",
"create_api_gateway_routes",
"(",
"self",
",",
"lambda_arn",
",",
"api_name",
"=",
"None",
",",
"api_key_required",
"=",
"False",
",",
"authorization_type",
"=",
"'NONE'",
",",
"authorizer",
"=",
"None",
",",
"cors_options",
"=",
"None",
",",
"description... | Create the API Gateway for this Zappa deployment.
Returns the new RestAPI CF resource. | [
"Create",
"the",
"API",
"Gateway",
"for",
"this",
"Zappa",
"deployment",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1525-L1616 | train | Create the API Gateway for this deployment. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_authorizer | def create_authorizer(self, restapi, uri, authorizer):
"""
Create Authorizer for API gateway
"""
authorizer_type = authorizer.get("type", "TOKEN").upper()
identity_validation_expression = authorizer.get('validation_expression', None)
authorizer_resource = troposphere.api... | python | def create_authorizer(self, restapi, uri, authorizer):
"""
Create Authorizer for API gateway
"""
authorizer_type = authorizer.get("type", "TOKEN").upper()
identity_validation_expression = authorizer.get('validation_expression', None)
authorizer_resource = troposphere.api... | [
"def",
"create_authorizer",
"(",
"self",
",",
"restapi",
",",
"uri",
",",
"authorizer",
")",
":",
"authorizer_type",
"=",
"authorizer",
".",
"get",
"(",
"\"type\"",
",",
"\"TOKEN\"",
")",
".",
"upper",
"(",
")",
"identity_validation_expression",
"=",
"authoriz... | Create Authorizer for API gateway | [
"Create",
"Authorizer",
"for",
"API",
"gateway"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1618-L1645 | train | Create Authorizer for API Gateway | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_and_setup_methods | def create_and_setup_methods(
self,
restapi,
resource,
api_key_required,
uri,
authorization_type,
... | python | def create_and_setup_methods(
self,
restapi,
resource,
api_key_required,
uri,
authorization_type,
... | [
"def",
"create_and_setup_methods",
"(",
"self",
",",
"restapi",
",",
"resource",
",",
"api_key_required",
",",
"uri",
",",
"authorization_type",
",",
"authorizer_resource",
",",
"depth",
")",
":",
"for",
"method_name",
"in",
"self",
".",
"http_methods",
":",
"me... | Set up the methods, integration responses and method responses for a given API Gateway resource. | [
"Set",
"up",
"the",
"methods",
"integration",
"responses",
"and",
"method",
"responses",
"for",
"a",
"given",
"API",
"Gateway",
"resource",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1647-L1689 | train | Create the methods and integration responses for a given resource. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_and_setup_cors | def create_and_setup_cors(self, restapi, resource, uri, depth, config):
"""
Set up the methods, integration responses and method responses for a given API Gateway resource.
"""
if config is True:
config = {}
method_name = "OPTIONS"
method = troposphere.apigate... | python | def create_and_setup_cors(self, restapi, resource, uri, depth, config):
"""
Set up the methods, integration responses and method responses for a given API Gateway resource.
"""
if config is True:
config = {}
method_name = "OPTIONS"
method = troposphere.apigate... | [
"def",
"create_and_setup_cors",
"(",
"self",
",",
"restapi",
",",
"resource",
",",
"uri",
",",
"depth",
",",
"config",
")",
":",
"if",
"config",
"is",
"True",
":",
"config",
"=",
"{",
"}",
"method_name",
"=",
"\"OPTIONS\"",
"method",
"=",
"troposphere",
... | Set up the methods, integration responses and method responses for a given API Gateway resource. | [
"Set",
"up",
"the",
"methods",
"integration",
"responses",
"and",
"method",
"responses",
"for",
"a",
"given",
"API",
"Gateway",
"resource",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1691-L1749 | train | Create the methods integration responses and method responses for a given API Gateway resource. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.deploy_api_gateway | def deploy_api_gateway( self,
api_id,
stage_name,
stage_description="",
description="",
cache_cluster_enabled=False,
cache_cluster_size='0.5',
... | python | def deploy_api_gateway( self,
api_id,
stage_name,
stage_description="",
description="",
cache_cluster_enabled=False,
cache_cluster_size='0.5',
... | [
"def",
"deploy_api_gateway",
"(",
"self",
",",
"api_id",
",",
"stage_name",
",",
"stage_description",
"=",
"\"\"",
",",
"description",
"=",
"\"\"",
",",
"cache_cluster_enabled",
"=",
"False",
",",
"cache_cluster_size",
"=",
"'0.5'",
",",
"variables",
"=",
"None"... | Deploy the API Gateway!
Return the deployed API URL. | [
"Deploy",
"the",
"API",
"Gateway!"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1751-L1797 | train | Deploy the API Gateway to Amazon. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.remove_binary_support | def remove_binary_support(self, api_id, cors=False):
"""
Remove binary support
"""
response = self.apigateway_client.get_rest_api(
restApiId=api_id
)
if "binaryMediaTypes" in response and "*/*" in response["binaryMediaTypes"]:
self.apigateway_clien... | python | def remove_binary_support(self, api_id, cors=False):
"""
Remove binary support
"""
response = self.apigateway_client.get_rest_api(
restApiId=api_id
)
if "binaryMediaTypes" in response and "*/*" in response["binaryMediaTypes"]:
self.apigateway_clien... | [
"def",
"remove_binary_support",
"(",
"self",
",",
"api_id",
",",
"cors",
"=",
"False",
")",
":",
"response",
"=",
"self",
".",
"apigateway_client",
".",
"get_rest_api",
"(",
"restApiId",
"=",
"api_id",
")",
"if",
"\"binaryMediaTypes\"",
"in",
"response",
"and"... | Remove binary support | [
"Remove",
"binary",
"support"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1840-L1877 | train | Remove binary support from API. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.add_api_compression | def add_api_compression(self, api_id, min_compression_size):
"""
Add Rest API compression
"""
self.apigateway_client.update_rest_api(
restApiId=api_id,
patchOperations=[
{
'op': 'replace',
'path': '/minimumCo... | python | def add_api_compression(self, api_id, min_compression_size):
"""
Add Rest API compression
"""
self.apigateway_client.update_rest_api(
restApiId=api_id,
patchOperations=[
{
'op': 'replace',
'path': '/minimumCo... | [
"def",
"add_api_compression",
"(",
"self",
",",
"api_id",
",",
"min_compression_size",
")",
":",
"self",
".",
"apigateway_client",
".",
"update_rest_api",
"(",
"restApiId",
"=",
"api_id",
",",
"patchOperations",
"=",
"[",
"{",
"'op'",
":",
"'replace'",
",",
"'... | Add Rest API compression | [
"Add",
"Rest",
"API",
"compression"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1879-L1892 | train | Add Rest API compression | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_api_keys | def get_api_keys(self, api_id, stage_name):
"""
Generator that allows to iterate per API keys associated to an api_id and a stage_name.
"""
response = self.apigateway_client.get_api_keys(limit=500)
stage_key = '{}/{}'.format(api_id, stage_name)
for api_key in response.get... | python | def get_api_keys(self, api_id, stage_name):
"""
Generator that allows to iterate per API keys associated to an api_id and a stage_name.
"""
response = self.apigateway_client.get_api_keys(limit=500)
stage_key = '{}/{}'.format(api_id, stage_name)
for api_key in response.get... | [
"def",
"get_api_keys",
"(",
"self",
",",
"api_id",
",",
"stage_name",
")",
":",
"response",
"=",
"self",
".",
"apigateway_client",
".",
"get_api_keys",
"(",
"limit",
"=",
"500",
")",
"stage_key",
"=",
"'{}/{}'",
".",
"format",
"(",
"api_id",
",",
"stage_na... | Generator that allows to iterate per API keys associated to an api_id and a stage_name. | [
"Generator",
"that",
"allows",
"to",
"iterate",
"per",
"API",
"keys",
"associated",
"to",
"an",
"api_id",
"and",
"a",
"stage_name",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1908-L1916 | train | Generator that yields per API key associated to an API ID and stage name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_api_key | def create_api_key(self, api_id, stage_name):
"""
Create new API key and link it with an api_id and a stage_name
"""
response = self.apigateway_client.create_api_key(
name='{}_{}'.format(stage_name, api_id),
description='Api Key for {}'.format(api_id),
... | python | def create_api_key(self, api_id, stage_name):
"""
Create new API key and link it with an api_id and a stage_name
"""
response = self.apigateway_client.create_api_key(
name='{}_{}'.format(stage_name, api_id),
description='Api Key for {}'.format(api_id),
... | [
"def",
"create_api_key",
"(",
"self",
",",
"api_id",
",",
"stage_name",
")",
":",
"response",
"=",
"self",
".",
"apigateway_client",
".",
"create_api_key",
"(",
"name",
"=",
"'{}_{}'",
".",
"format",
"(",
"stage_name",
",",
"api_id",
")",
",",
"description",... | Create new API key and link it with an api_id and a stage_name | [
"Create",
"new",
"API",
"key",
"and",
"link",
"it",
"with",
"an",
"api_id",
"and",
"a",
"stage_name"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1918-L1933 | train | Create new API key and link it with an api_id and a stage_name | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.remove_api_key | def remove_api_key(self, api_id, stage_name):
"""
Remove a generated API key for api_id and stage_name
"""
response = self.apigateway_client.get_api_keys(
limit=1,
nameQuery='{}_{}'.format(stage_name, api_id)
)
for api_key in response.get('items'):... | python | def remove_api_key(self, api_id, stage_name):
"""
Remove a generated API key for api_id and stage_name
"""
response = self.apigateway_client.get_api_keys(
limit=1,
nameQuery='{}_{}'.format(stage_name, api_id)
)
for api_key in response.get('items'):... | [
"def",
"remove_api_key",
"(",
"self",
",",
"api_id",
",",
"stage_name",
")",
":",
"response",
"=",
"self",
".",
"apigateway_client",
".",
"get_api_keys",
"(",
"limit",
"=",
"1",
",",
"nameQuery",
"=",
"'{}_{}'",
".",
"format",
"(",
"stage_name",
",",
"api_... | Remove a generated API key for api_id and stage_name | [
"Remove",
"a",
"generated",
"API",
"key",
"for",
"api_id",
"and",
"stage_name"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1935-L1946 | train | Remove a generated API key for api_id and stage_name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.add_api_stage_to_api_key | def add_api_stage_to_api_key(self, api_key, api_id, stage_name):
"""
Add api stage to Api key
"""
self.apigateway_client.update_api_key(
apiKey=api_key,
patchOperations=[
{
'op': 'add',
'path': '/stages',
... | python | def add_api_stage_to_api_key(self, api_key, api_id, stage_name):
"""
Add api stage to Api key
"""
self.apigateway_client.update_api_key(
apiKey=api_key,
patchOperations=[
{
'op': 'add',
'path': '/stages',
... | [
"def",
"add_api_stage_to_api_key",
"(",
"self",
",",
"api_key",
",",
"api_id",
",",
"stage_name",
")",
":",
"self",
".",
"apigateway_client",
".",
"update_api_key",
"(",
"apiKey",
"=",
"api_key",
",",
"patchOperations",
"=",
"[",
"{",
"'op'",
":",
"'add'",
"... | Add api stage to Api key | [
"Add",
"api",
"stage",
"to",
"Api",
"key"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1948-L1961 | train | Add api stage to Api key | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_patch_op | def get_patch_op(self, keypath, value, op='replace'):
"""
Return an object that describes a change of configuration on the given staging.
Setting will be applied on all available HTTP methods.
"""
if isinstance(value, bool):
value = str(value).lower()
return {... | python | def get_patch_op(self, keypath, value, op='replace'):
"""
Return an object that describes a change of configuration on the given staging.
Setting will be applied on all available HTTP methods.
"""
if isinstance(value, bool):
value = str(value).lower()
return {... | [
"def",
"get_patch_op",
"(",
"self",
",",
"keypath",
",",
"value",
",",
"op",
"=",
"'replace'",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"bool",
")",
":",
"value",
"=",
"str",
"(",
"value",
")",
".",
"lower",
"(",
")",
"return",
"{",
"'op'",... | Return an object that describes a change of configuration on the given staging.
Setting will be applied on all available HTTP methods. | [
"Return",
"an",
"object",
"that",
"describes",
"a",
"change",
"of",
"configuration",
"on",
"the",
"given",
"staging",
".",
"Setting",
"will",
"be",
"applied",
"on",
"all",
"available",
"HTTP",
"methods",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1963-L1970 | train | Get a patch operation that will be applied on all available HTTP methods. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_rest_apis | def get_rest_apis(self, project_name):
"""
Generator that allows to iterate per every available apis.
"""
all_apis = self.apigateway_client.get_rest_apis(
limit=500
)
for api in all_apis['items']:
if api['name'] != project_name:
co... | python | def get_rest_apis(self, project_name):
"""
Generator that allows to iterate per every available apis.
"""
all_apis = self.apigateway_client.get_rest_apis(
limit=500
)
for api in all_apis['items']:
if api['name'] != project_name:
co... | [
"def",
"get_rest_apis",
"(",
"self",
",",
"project_name",
")",
":",
"all_apis",
"=",
"self",
".",
"apigateway_client",
".",
"get_rest_apis",
"(",
"limit",
"=",
"500",
")",
"for",
"api",
"in",
"all_apis",
"[",
"'items'",
"]",
":",
"if",
"api",
"[",
"'name... | Generator that allows to iterate per every available apis. | [
"Generator",
"that",
"allows",
"to",
"iterate",
"per",
"every",
"available",
"apis",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1972-L1983 | train | Generator that yields all available API resources for a given project. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.undeploy_api_gateway | def undeploy_api_gateway(self, lambda_name, domain_name=None, base_path=None):
"""
Delete a deployed REST API Gateway.
"""
print("Deleting API Gateway..")
api_id = self.get_api_id(lambda_name)
if domain_name:
# XXX - Remove Route53 smartly here?
... | python | def undeploy_api_gateway(self, lambda_name, domain_name=None, base_path=None):
"""
Delete a deployed REST API Gateway.
"""
print("Deleting API Gateway..")
api_id = self.get_api_id(lambda_name)
if domain_name:
# XXX - Remove Route53 smartly here?
... | [
"def",
"undeploy_api_gateway",
"(",
"self",
",",
"lambda_name",
",",
"domain_name",
"=",
"None",
",",
"base_path",
"=",
"None",
")",
":",
"print",
"(",
"\"Deleting API Gateway..\"",
")",
"api_id",
"=",
"self",
".",
"get_api_id",
"(",
"lambda_name",
")",
"if",
... | Delete a deployed REST API Gateway. | [
"Delete",
"a",
"deployed",
"REST",
"API",
"Gateway",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L1985-L2014 | train | Delete a deployed REST API Gateway. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.update_stage_config | def update_stage_config( self,
project_name,
stage_name,
cloudwatch_log_level,
cloudwatch_data_trace,
cloudwatch_metrics_enabled
... | python | def update_stage_config( self,
project_name,
stage_name,
cloudwatch_log_level,
cloudwatch_data_trace,
cloudwatch_metrics_enabled
... | [
"def",
"update_stage_config",
"(",
"self",
",",
"project_name",
",",
"stage_name",
",",
"cloudwatch_log_level",
",",
"cloudwatch_data_trace",
",",
"cloudwatch_metrics_enabled",
")",
":",
"if",
"cloudwatch_log_level",
"not",
"in",
"self",
".",
"cloudwatch_log_levels",
":... | Update CloudWatch metrics configuration. | [
"Update",
"CloudWatch",
"metrics",
"configuration",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2016-L2038 | train | Updates CloudWatch metrics configuration for a given stage. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.delete_stack | def delete_stack(self, name, wait=False):
"""
Delete the CF stack managed by Zappa.
"""
try:
stack = self.cf_client.describe_stacks(StackName=name)['Stacks'][0]
except: # pragma: no cover
print('No Zappa stack named {0}'.format(name))
return Fa... | python | def delete_stack(self, name, wait=False):
"""
Delete the CF stack managed by Zappa.
"""
try:
stack = self.cf_client.describe_stacks(StackName=name)['Stacks'][0]
except: # pragma: no cover
print('No Zappa stack named {0}'.format(name))
return Fa... | [
"def",
"delete_stack",
"(",
"self",
",",
"name",
",",
"wait",
"=",
"False",
")",
":",
"try",
":",
"stack",
"=",
"self",
".",
"cf_client",
".",
"describe_stacks",
"(",
"StackName",
"=",
"name",
")",
"[",
"'Stacks'",
"]",
"[",
"0",
"]",
"except",
":",
... | Delete the CF stack managed by Zappa. | [
"Delete",
"the",
"CF",
"stack",
"managed",
"by",
"Zappa",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2076-L2096 | train | Delete the CF stack managed by Zappa. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_stack_template | def create_stack_template( self,
lambda_arn,
lambda_name,
api_key_required,
iam_authorization,
authorizer,
cors_options=None,
... | python | def create_stack_template( self,
lambda_arn,
lambda_name,
api_key_required,
iam_authorization,
authorizer,
cors_options=None,
... | [
"def",
"create_stack_template",
"(",
"self",
",",
"lambda_arn",
",",
"lambda_name",
",",
"api_key_required",
",",
"iam_authorization",
",",
"authorizer",
",",
"cors_options",
"=",
"None",
",",
"description",
"=",
"None",
",",
"endpoint_configuration",
"=",
"None",
... | Build the entire CF stack.
Just used for the API Gateway, but could be expanded in the future. | [
"Build",
"the",
"entire",
"CF",
"stack",
".",
"Just",
"used",
"for",
"the",
"API",
"Gateway",
"but",
"could",
"be",
"expanded",
"in",
"the",
"future",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2098-L2140 | train | Create a new CF stack template. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.update_stack | def update_stack(self, name, working_bucket, wait=False, update_only=False, disable_progress=False):
"""
Update or create the CF stack managed by Zappa.
"""
capabilities = []
template = name + '-template-' + str(int(time.time())) + '.json'
with open(template, 'wb') as ou... | python | def update_stack(self, name, working_bucket, wait=False, update_only=False, disable_progress=False):
"""
Update or create the CF stack managed by Zappa.
"""
capabilities = []
template = name + '-template-' + str(int(time.time())) + '.json'
with open(template, 'wb') as ou... | [
"def",
"update_stack",
"(",
"self",
",",
"name",
",",
"working_bucket",
",",
"wait",
"=",
"False",
",",
"update_only",
"=",
"False",
",",
"disable_progress",
"=",
"False",
")",
":",
"capabilities",
"=",
"[",
"]",
"template",
"=",
"name",
"+",
"'-template-'... | Update or create the CF stack managed by Zappa. | [
"Update",
"or",
"create",
"the",
"CF",
"stack",
"managed",
"by",
"Zappa",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2142-L2237 | train | Update or create the CF stack managed by Zappa. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.stack_outputs | def stack_outputs(self, name):
"""
Given a name, describes CloudFront stacks and returns dict of the stack Outputs
, else returns an empty dict.
"""
try:
stack = self.cf_client.describe_stacks(StackName=name)['Stacks'][0]
return {x['OutputKey']: x['OutputV... | python | def stack_outputs(self, name):
"""
Given a name, describes CloudFront stacks and returns dict of the stack Outputs
, else returns an empty dict.
"""
try:
stack = self.cf_client.describe_stacks(StackName=name)['Stacks'][0]
return {x['OutputKey']: x['OutputV... | [
"def",
"stack_outputs",
"(",
"self",
",",
"name",
")",
":",
"try",
":",
"stack",
"=",
"self",
".",
"cf_client",
".",
"describe_stacks",
"(",
"StackName",
"=",
"name",
")",
"[",
"'Stacks'",
"]",
"[",
"0",
"]",
"return",
"{",
"x",
"[",
"'OutputKey'",
"... | Given a name, describes CloudFront stacks and returns dict of the stack Outputs
, else returns an empty dict. | [
"Given",
"a",
"name",
"describes",
"CloudFront",
"stacks",
"and",
"returns",
"dict",
"of",
"the",
"stack",
"Outputs",
"else",
"returns",
"an",
"empty",
"dict",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2239-L2248 | train | Given a name describes CloudFront stacks and returns dict of the stack Outputs
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_api_url | def get_api_url(self, lambda_name, stage_name):
"""
Given a lambda_name and stage_name, return a valid API URL.
"""
api_id = self.get_api_id(lambda_name)
if api_id:
return "https://{}.execute-api.{}.amazonaws.com/{}".format(api_id, self.boto_session.region_name, stage... | python | def get_api_url(self, lambda_name, stage_name):
"""
Given a lambda_name and stage_name, return a valid API URL.
"""
api_id = self.get_api_id(lambda_name)
if api_id:
return "https://{}.execute-api.{}.amazonaws.com/{}".format(api_id, self.boto_session.region_name, stage... | [
"def",
"get_api_url",
"(",
"self",
",",
"lambda_name",
",",
"stage_name",
")",
":",
"api_id",
"=",
"self",
".",
"get_api_id",
"(",
"lambda_name",
")",
"if",
"api_id",
":",
"return",
"\"https://{}.execute-api.{}.amazonaws.com/{}\"",
".",
"format",
"(",
"api_id",
... | Given a lambda_name and stage_name, return a valid API URL. | [
"Given",
"a",
"lambda_name",
"and",
"stage_name",
"return",
"a",
"valid",
"API",
"URL",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2251-L2259 | train | Given a lambda_name and stage_name return a valid API URL. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_api_id | def get_api_id(self, lambda_name):
"""
Given a lambda_name, return the API id.
"""
try:
response = self.cf_client.describe_stack_resource(StackName=lambda_name,
LogicalResourceId='Api')
return response[... | python | def get_api_id(self, lambda_name):
"""
Given a lambda_name, return the API id.
"""
try:
response = self.cf_client.describe_stack_resource(StackName=lambda_name,
LogicalResourceId='Api')
return response[... | [
"def",
"get_api_id",
"(",
"self",
",",
"lambda_name",
")",
":",
"try",
":",
"response",
"=",
"self",
".",
"cf_client",
".",
"describe_stack_resource",
"(",
"StackName",
"=",
"lambda_name",
",",
"LogicalResourceId",
"=",
"'Api'",
")",
"return",
"response",
"[",... | Given a lambda_name, return the API id. | [
"Given",
"a",
"lambda_name",
"return",
"the",
"API",
"id",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2261-L2282 | train | Get the API ID for a given lambda name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_domain_name | def create_domain_name(self,
domain_name,
certificate_name,
certificate_body=None,
certificate_private_key=None,
certificate_chain=None,
certificate_arn=None,... | python | def create_domain_name(self,
domain_name,
certificate_name,
certificate_body=None,
certificate_private_key=None,
certificate_chain=None,
certificate_arn=None,... | [
"def",
"create_domain_name",
"(",
"self",
",",
"domain_name",
",",
"certificate_name",
",",
"certificate_body",
"=",
"None",
",",
"certificate_private_key",
"=",
"None",
",",
"certificate_chain",
"=",
"None",
",",
"certificate_arn",
"=",
"None",
",",
"lambda_name",
... | Creates the API GW domain and returns the resulting DNS name. | [
"Creates",
"the",
"API",
"GW",
"domain",
"and",
"returns",
"the",
"resulting",
"DNS",
"name",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2284-L2326 | train | Creates the API GW domain and returns the resulting DNS name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.update_route53_records | def update_route53_records(self, domain_name, dns_name):
"""
Updates Route53 Records following GW domain creation
"""
zone_id = self.get_hosted_zone_id_for_domain(domain_name)
is_apex = self.route53.get_hosted_zone(Id=zone_id)['HostedZone']['Name'][:-1] == domain_name
if... | python | def update_route53_records(self, domain_name, dns_name):
"""
Updates Route53 Records following GW domain creation
"""
zone_id = self.get_hosted_zone_id_for_domain(domain_name)
is_apex = self.route53.get_hosted_zone(Id=zone_id)['HostedZone']['Name'][:-1] == domain_name
if... | [
"def",
"update_route53_records",
"(",
"self",
",",
"domain_name",
",",
"dns_name",
")",
":",
"zone_id",
"=",
"self",
".",
"get_hosted_zone_id_for_domain",
"(",
"domain_name",
")",
"is_apex",
"=",
"self",
".",
"route53",
".",
"get_hosted_zone",
"(",
"Id",
"=",
... | Updates Route53 Records following GW domain creation | [
"Updates",
"Route53",
"Records",
"following",
"GW",
"domain",
"creation"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2328-L2377 | train | Updates Route53 Records following GW domain creation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.update_domain_name | def update_domain_name(self,
domain_name,
certificate_name=None,
certificate_body=None,
certificate_private_key=None,
certificate_chain=None,
certificate_arn=... | python | def update_domain_name(self,
domain_name,
certificate_name=None,
certificate_body=None,
certificate_private_key=None,
certificate_chain=None,
certificate_arn=... | [
"def",
"update_domain_name",
"(",
"self",
",",
"domain_name",
",",
"certificate_name",
"=",
"None",
",",
"certificate_body",
"=",
"None",
",",
"certificate_private_key",
"=",
"None",
",",
"certificate_chain",
"=",
"None",
",",
"certificate_arn",
"=",
"None",
",",
... | This updates your certificate information for an existing domain,
with similar arguments to boto's update_domain_name API Gateway api.
It returns the resulting new domain information including the new certificate's ARN
if created during this process.
Previously, this method involved do... | [
"This",
"updates",
"your",
"certificate",
"information",
"for",
"an",
"existing",
"domain",
"with",
"similar",
"arguments",
"to",
"boto",
"s",
"update_domain_name",
"API",
"Gateway",
"api",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2379-L2429 | train | This method updates the certificate name and base path mapping for an existing domain. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.update_domain_base_path_mapping | def update_domain_base_path_mapping(self, domain_name, lambda_name, stage, base_path):
"""
Update domain base path mapping on API Gateway if it was changed
"""
api_id = self.get_api_id(lambda_name)
if not api_id:
print("Warning! Can't update base path mapping!")
... | python | def update_domain_base_path_mapping(self, domain_name, lambda_name, stage, base_path):
"""
Update domain base path mapping on API Gateway if it was changed
"""
api_id = self.get_api_id(lambda_name)
if not api_id:
print("Warning! Can't update base path mapping!")
... | [
"def",
"update_domain_base_path_mapping",
"(",
"self",
",",
"domain_name",
",",
"lambda_name",
",",
"stage",
",",
"base_path",
")",
":",
"api_id",
"=",
"self",
".",
"get_api_id",
"(",
"lambda_name",
")",
"if",
"not",
"api_id",
":",
"print",
"(",
"\"Warning! Ca... | Update domain base path mapping on API Gateway if it was changed | [
"Update",
"domain",
"base",
"path",
"mapping",
"on",
"API",
"Gateway",
"if",
"it",
"was",
"changed"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2431-L2458 | train | Update base path mapping on API Gateway if it was changed | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_all_zones | def get_all_zones(self):
"""Same behaviour of list_host_zones, but transparently handling pagination."""
zones = {'HostedZones': []}
new_zones = self.route53.list_hosted_zones(MaxItems='100')
while new_zones['IsTruncated']:
zones['HostedZones'] += new_zones['HostedZones']
... | python | def get_all_zones(self):
"""Same behaviour of list_host_zones, but transparently handling pagination."""
zones = {'HostedZones': []}
new_zones = self.route53.list_hosted_zones(MaxItems='100')
while new_zones['IsTruncated']:
zones['HostedZones'] += new_zones['HostedZones']
... | [
"def",
"get_all_zones",
"(",
"self",
")",
":",
"zones",
"=",
"{",
"'HostedZones'",
":",
"[",
"]",
"}",
"new_zones",
"=",
"self",
".",
"route53",
".",
"list_hosted_zones",
"(",
"MaxItems",
"=",
"'100'",
")",
"while",
"new_zones",
"[",
"'IsTruncated'",
"]",
... | Same behaviour of list_host_zones, but transparently handling pagination. | [
"Same",
"behaviour",
"of",
"list_host_zones",
"but",
"transparently",
"handling",
"pagination",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2460-L2470 | train | Same behaviour of list_host_zones but transparently handling pagination. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_domain_name | def get_domain_name(self, domain_name, route53=True):
"""
Scan our hosted zones for the record of a given name.
Returns the record entry, else None.
"""
# Make sure api gateway domain is present
try:
self.apigateway_client.get_domain_name(domainName=domain_n... | python | def get_domain_name(self, domain_name, route53=True):
"""
Scan our hosted zones for the record of a given name.
Returns the record entry, else None.
"""
# Make sure api gateway domain is present
try:
self.apigateway_client.get_domain_name(domainName=domain_n... | [
"def",
"get_domain_name",
"(",
"self",
",",
"domain_name",
",",
"route53",
"=",
"True",
")",
":",
"# Make sure api gateway domain is present",
"try",
":",
"self",
".",
"apigateway_client",
".",
"get_domain_name",
"(",
"domainName",
"=",
"domain_name",
")",
"except",... | Scan our hosted zones for the record of a given name.
Returns the record entry, else None. | [
"Scan",
"our",
"hosted",
"zones",
"for",
"the",
"record",
"of",
"a",
"given",
"name",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2472-L2513 | train | Get the domain name from the API Gateway. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_credentials_arn | def get_credentials_arn(self):
"""
Given our role name, get and set the credentials_arn.
"""
role = self.iam.Role(self.role_name)
self.credentials_arn = role.arn
return role, self.credentials_arn | python | def get_credentials_arn(self):
"""
Given our role name, get and set the credentials_arn.
"""
role = self.iam.Role(self.role_name)
self.credentials_arn = role.arn
return role, self.credentials_arn | [
"def",
"get_credentials_arn",
"(",
"self",
")",
":",
"role",
"=",
"self",
".",
"iam",
".",
"Role",
"(",
"self",
".",
"role_name",
")",
"self",
".",
"credentials_arn",
"=",
"role",
".",
"arn",
"return",
"role",
",",
"self",
".",
"credentials_arn"
] | Given our role name, get and set the credentials_arn. | [
"Given",
"our",
"role",
"name",
"get",
"and",
"set",
"the",
"credentials_arn",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2519-L2526 | train | Get and set the credentials_arn. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_iam_roles | def create_iam_roles(self):
"""
Create and defines the IAM roles and policies necessary for Zappa.
If the IAM role already exists, it will be updated if necessary.
"""
attach_policy_obj = json.loads(self.attach_policy)
assume_policy_obj = json.loads(self.assume_policy)
... | python | def create_iam_roles(self):
"""
Create and defines the IAM roles and policies necessary for Zappa.
If the IAM role already exists, it will be updated if necessary.
"""
attach_policy_obj = json.loads(self.attach_policy)
assume_policy_obj = json.loads(self.assume_policy)
... | [
"def",
"create_iam_roles",
"(",
"self",
")",
":",
"attach_policy_obj",
"=",
"json",
".",
"loads",
"(",
"self",
".",
"attach_policy",
")",
"assume_policy_obj",
"=",
"json",
".",
"loads",
"(",
"self",
".",
"assume_policy",
")",
"if",
"self",
".",
"extra_permis... | Create and defines the IAM roles and policies necessary for Zappa.
If the IAM role already exists, it will be updated if necessary. | [
"Create",
"and",
"defines",
"the",
"IAM",
"roles",
"and",
"policies",
"necessary",
"for",
"Zappa",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2528-L2581 | train | Create and defines the IAM roles and policies necessary for Zappa. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa._clear_policy | def _clear_policy(self, lambda_name):
"""
Remove obsolete policy statements to prevent policy from bloating over the limit after repeated updates.
"""
try:
policy_response = self.lambda_client.get_policy(
FunctionName=lambda_name
)
if p... | python | def _clear_policy(self, lambda_name):
"""
Remove obsolete policy statements to prevent policy from bloating over the limit after repeated updates.
"""
try:
policy_response = self.lambda_client.get_policy(
FunctionName=lambda_name
)
if p... | [
"def",
"_clear_policy",
"(",
"self",
",",
"lambda_name",
")",
":",
"try",
":",
"policy_response",
"=",
"self",
".",
"lambda_client",
".",
"get_policy",
"(",
"FunctionName",
"=",
"lambda_name",
")",
"if",
"policy_response",
"[",
"'ResponseMetadata'",
"]",
"[",
... | Remove obsolete policy statements to prevent policy from bloating over the limit after repeated updates. | [
"Remove",
"obsolete",
"policy",
"statements",
"to",
"prevent",
"policy",
"from",
"bloating",
"over",
"the",
"limit",
"after",
"repeated",
"updates",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2583-L2606 | train | Remove obsolete policy statements to prevent policy from bloating over the limit after repeated updates. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_event_permission | def create_event_permission(self, lambda_name, principal, source_arn):
"""
Create permissions to link to an event.
Related: http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-configure-event-source.html
"""
logger.debug('Adding new permission to invoke Lambda function: ... | python | def create_event_permission(self, lambda_name, principal, source_arn):
"""
Create permissions to link to an event.
Related: http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-configure-event-source.html
"""
logger.debug('Adding new permission to invoke Lambda function: ... | [
"def",
"create_event_permission",
"(",
"self",
",",
"lambda_name",
",",
"principal",
",",
"source_arn",
")",
":",
"logger",
".",
"debug",
"(",
"'Adding new permission to invoke Lambda function: {}'",
".",
"format",
"(",
"lambda_name",
")",
")",
"permission_response",
... | Create permissions to link to an event.
Related: http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-configure-event-source.html | [
"Create",
"permissions",
"to",
"link",
"to",
"an",
"event",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2612-L2631 | train | Create permission to link to an event. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.schedule_events | def schedule_events(self, lambda_arn, lambda_name, events, default=True):
"""
Given a Lambda ARN, name and a list of events, schedule this as CloudWatch Events.
'events' is a list of dictionaries, where the dict must contains the string
of a 'function' and the string of the event 'expre... | python | def schedule_events(self, lambda_arn, lambda_name, events, default=True):
"""
Given a Lambda ARN, name and a list of events, schedule this as CloudWatch Events.
'events' is a list of dictionaries, where the dict must contains the string
of a 'function' and the string of the event 'expre... | [
"def",
"schedule_events",
"(",
"self",
",",
"lambda_arn",
",",
"lambda_name",
",",
"events",
",",
"default",
"=",
"True",
")",
":",
"# The stream sources - DynamoDB, Kinesis and SQS - are working differently than the other services (pull vs push)",
"# and do not require event permi... | Given a Lambda ARN, name and a list of events, schedule this as CloudWatch Events.
'events' is a list of dictionaries, where the dict must contains the string
of a 'function' and the string of the event 'expression', and an optional 'name' and 'description'.
Expressions can be in rate or cron ... | [
"Given",
"a",
"Lambda",
"ARN",
"name",
"and",
"a",
"list",
"of",
"events",
"schedule",
"this",
"as",
"CloudWatch",
"Events",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2633-L2771 | train | Given a Lambda ARN name and a list of events schedule this as CloudWatch Events. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_event_name | def get_event_name(lambda_name, name):
"""
Returns an AWS-valid Lambda event name.
"""
return '{prefix:.{width}}-{postfix}'.format(prefix=lambda_name, width=max(0, 63 - len(name)), postfix=name)[:64] | python | def get_event_name(lambda_name, name):
"""
Returns an AWS-valid Lambda event name.
"""
return '{prefix:.{width}}-{postfix}'.format(prefix=lambda_name, width=max(0, 63 - len(name)), postfix=name)[:64] | [
"def",
"get_event_name",
"(",
"lambda_name",
",",
"name",
")",
":",
"return",
"'{prefix:.{width}}-{postfix}'",
".",
"format",
"(",
"prefix",
"=",
"lambda_name",
",",
"width",
"=",
"max",
"(",
"0",
",",
"63",
"-",
"len",
"(",
"name",
")",
")",
",",
"postf... | Returns an AWS-valid Lambda event name. | [
"Returns",
"an",
"AWS",
"-",
"valid",
"Lambda",
"event",
"name",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2790-L2795 | train | Returns an AWS - valid Lambda event name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_hashed_rule_name | def get_hashed_rule_name(event, function, lambda_name):
"""
Returns an AWS-valid CloudWatch rule name using a digest of the event name, lambda name, and function.
This allows support for rule names that may be longer than the 64 char limit.
"""
event_name = event.get('name', func... | python | def get_hashed_rule_name(event, function, lambda_name):
"""
Returns an AWS-valid CloudWatch rule name using a digest of the event name, lambda name, and function.
This allows support for rule names that may be longer than the 64 char limit.
"""
event_name = event.get('name', func... | [
"def",
"get_hashed_rule_name",
"(",
"event",
",",
"function",
",",
"lambda_name",
")",
":",
"event_name",
"=",
"event",
".",
"get",
"(",
"'name'",
",",
"function",
")",
"name_hash",
"=",
"hashlib",
".",
"sha1",
"(",
"'{}-{}'",
".",
"format",
"(",
"lambda_n... | Returns an AWS-valid CloudWatch rule name using a digest of the event name, lambda name, and function.
This allows support for rule names that may be longer than the 64 char limit. | [
"Returns",
"an",
"AWS",
"-",
"valid",
"CloudWatch",
"rule",
"name",
"using",
"a",
"digest",
"of",
"the",
"event",
"name",
"lambda",
"name",
"and",
"function",
".",
"This",
"allows",
"support",
"for",
"rule",
"names",
"that",
"may",
"be",
"longer",
"than",
... | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2798-L2805 | train | Returns an AWS - valid CloudWatch rule name using a hash of the event name lambda name and function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.delete_rule | def delete_rule(self, rule_name):
"""
Delete a CWE rule.
This deletes them, but they will still show up in the AWS console.
Annoying.
"""
logger.debug('Deleting existing rule {}'.format(rule_name))
# All targets must be removed before
# we can actually... | python | def delete_rule(self, rule_name):
"""
Delete a CWE rule.
This deletes them, but they will still show up in the AWS console.
Annoying.
"""
logger.debug('Deleting existing rule {}'.format(rule_name))
# All targets must be removed before
# we can actually... | [
"def",
"delete_rule",
"(",
"self",
",",
"rule_name",
")",
":",
"logger",
".",
"debug",
"(",
"'Deleting existing rule {}'",
".",
"format",
"(",
"rule_name",
")",
")",
"# All targets must be removed before",
"# we can actually delete the rule.",
"try",
":",
"targets",
"... | Delete a CWE rule.
This deletes them, but they will still show up in the AWS console.
Annoying. | [
"Delete",
"a",
"CWE",
"rule",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2807-L2836 | train | Delete a CWE rule. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_event_rule_names_for_lambda | def get_event_rule_names_for_lambda(self, lambda_arn):
"""
Get all of the rule names associated with a lambda function.
"""
response = self.events_client.list_rule_names_by_target(TargetArn=lambda_arn)
rule_names = response['RuleNames']
# Iterate when the results are pagi... | python | def get_event_rule_names_for_lambda(self, lambda_arn):
"""
Get all of the rule names associated with a lambda function.
"""
response = self.events_client.list_rule_names_by_target(TargetArn=lambda_arn)
rule_names = response['RuleNames']
# Iterate when the results are pagi... | [
"def",
"get_event_rule_names_for_lambda",
"(",
"self",
",",
"lambda_arn",
")",
":",
"response",
"=",
"self",
".",
"events_client",
".",
"list_rule_names_by_target",
"(",
"TargetArn",
"=",
"lambda_arn",
")",
"rule_names",
"=",
"response",
"[",
"'RuleNames'",
"]",
"... | Get all of the rule names associated with a lambda function. | [
"Get",
"all",
"of",
"the",
"rule",
"names",
"associated",
"with",
"a",
"lambda",
"function",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2838-L2849 | train | Get all of the rule names associated with a lambda function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_event_rules_for_lambda | def get_event_rules_for_lambda(self, lambda_arn):
"""
Get all of the rule details associated with this function.
"""
rule_names = self.get_event_rule_names_for_lambda(lambda_arn=lambda_arn)
return [self.events_client.describe_rule(Name=r) for r in rule_names] | python | def get_event_rules_for_lambda(self, lambda_arn):
"""
Get all of the rule details associated with this function.
"""
rule_names = self.get_event_rule_names_for_lambda(lambda_arn=lambda_arn)
return [self.events_client.describe_rule(Name=r) for r in rule_names] | [
"def",
"get_event_rules_for_lambda",
"(",
"self",
",",
"lambda_arn",
")",
":",
"rule_names",
"=",
"self",
".",
"get_event_rule_names_for_lambda",
"(",
"lambda_arn",
"=",
"lambda_arn",
")",
"return",
"[",
"self",
".",
"events_client",
".",
"describe_rule",
"(",
"Na... | Get all of the rule details associated with this function. | [
"Get",
"all",
"of",
"the",
"rule",
"details",
"associated",
"with",
"this",
"function",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2851-L2856 | train | Get all of the event rules associated with this function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.unschedule_events | def unschedule_events(self, events, lambda_arn=None, lambda_name=None, excluded_source_services=None):
excluded_source_services = excluded_source_services or []
"""
Given a list of events, unschedule these CloudWatch Events.
'events' is a list of dictionaries, where the dict must contai... | python | def unschedule_events(self, events, lambda_arn=None, lambda_name=None, excluded_source_services=None):
excluded_source_services = excluded_source_services or []
"""
Given a list of events, unschedule these CloudWatch Events.
'events' is a list of dictionaries, where the dict must contai... | [
"def",
"unschedule_events",
"(",
"self",
",",
"events",
",",
"lambda_arn",
"=",
"None",
",",
"lambda_name",
"=",
"None",
",",
"excluded_source_services",
"=",
"None",
")",
":",
"excluded_source_services",
"=",
"excluded_source_services",
"or",
"[",
"]",
"self",
... | Given a list of events, unschedule these CloudWatch Events.
'events' is a list of dictionaries, where the dict must contains the string
of a 'function' and the string of the event 'expression', and an optional 'name' and 'description'. | [
"Given",
"a",
"list",
"of",
"events",
"unschedule",
"these",
"CloudWatch",
"Events",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2858-L2895 | train | Unschedule CloudWatch Events. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_async_sns_topic | def create_async_sns_topic(self, lambda_name, lambda_arn):
"""
Create the SNS-based async topic.
"""
topic_name = get_topic_name(lambda_name)
# Create SNS topic
topic_arn = self.sns_client.create_topic(
Name=topic_name)['TopicArn']
# Create subscriptio... | python | def create_async_sns_topic(self, lambda_name, lambda_arn):
"""
Create the SNS-based async topic.
"""
topic_name = get_topic_name(lambda_name)
# Create SNS topic
topic_arn = self.sns_client.create_topic(
Name=topic_name)['TopicArn']
# Create subscriptio... | [
"def",
"create_async_sns_topic",
"(",
"self",
",",
"lambda_name",
",",
"lambda_arn",
")",
":",
"topic_name",
"=",
"get_topic_name",
"(",
"lambda_name",
")",
"# Create SNS topic",
"topic_arn",
"=",
"self",
".",
"sns_client",
".",
"create_topic",
"(",
"Name",
"=",
... | Create the SNS-based async topic. | [
"Create",
"the",
"SNS",
"-",
"based",
"async",
"topic",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2901-L2931 | train | Create the SNS - based async topic. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.remove_async_sns_topic | def remove_async_sns_topic(self, lambda_name):
"""
Remove the async SNS topic.
"""
topic_name = get_topic_name(lambda_name)
removed_arns = []
for sub in self.sns_client.list_subscriptions()['Subscriptions']:
if topic_name in sub['TopicArn']:
se... | python | def remove_async_sns_topic(self, lambda_name):
"""
Remove the async SNS topic.
"""
topic_name = get_topic_name(lambda_name)
removed_arns = []
for sub in self.sns_client.list_subscriptions()['Subscriptions']:
if topic_name in sub['TopicArn']:
se... | [
"def",
"remove_async_sns_topic",
"(",
"self",
",",
"lambda_name",
")",
":",
"topic_name",
"=",
"get_topic_name",
"(",
"lambda_name",
")",
"removed_arns",
"=",
"[",
"]",
"for",
"sub",
"in",
"self",
".",
"sns_client",
".",
"list_subscriptions",
"(",
")",
"[",
... | Remove the async SNS topic. | [
"Remove",
"the",
"async",
"SNS",
"topic",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2933-L2943 | train | Remove the async SNS topic. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.create_async_dynamodb_table | def create_async_dynamodb_table(self, table_name, read_capacity, write_capacity):
"""
Create the DynamoDB table for async task return values
"""
try:
dynamodb_table = self.dynamodb_client.describe_table(TableName=table_name)
return False, dynamodb_table
#... | python | def create_async_dynamodb_table(self, table_name, read_capacity, write_capacity):
"""
Create the DynamoDB table for async task return values
"""
try:
dynamodb_table = self.dynamodb_client.describe_table(TableName=table_name)
return False, dynamodb_table
#... | [
"def",
"create_async_dynamodb_table",
"(",
"self",
",",
"table_name",
",",
"read_capacity",
",",
"write_capacity",
")",
":",
"try",
":",
"dynamodb_table",
"=",
"self",
".",
"dynamodb_client",
".",
"describe_table",
"(",
"TableName",
"=",
"table_name",
")",
"return... | Create the DynamoDB table for async task return values | [
"Create",
"the",
"DynamoDB",
"table",
"for",
"async",
"task",
"return",
"values"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L2960-L2997 | train | Create the DynamoDB table for async task return values | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.fetch_logs | def fetch_logs(self, lambda_name, filter_pattern='', limit=10000, start_time=0):
"""
Fetch the CloudWatch logs for a given Lambda name.
"""
log_name = '/aws/lambda/' + lambda_name
streams = self.logs_client.describe_log_streams(
logGroupName=log_name,
desc... | python | def fetch_logs(self, lambda_name, filter_pattern='', limit=10000, start_time=0):
"""
Fetch the CloudWatch logs for a given Lambda name.
"""
log_name = '/aws/lambda/' + lambda_name
streams = self.logs_client.describe_log_streams(
logGroupName=log_name,
desc... | [
"def",
"fetch_logs",
"(",
"self",
",",
"lambda_name",
",",
"filter_pattern",
"=",
"''",
",",
"limit",
"=",
"10000",
",",
"start_time",
"=",
"0",
")",
":",
"log_name",
"=",
"'/aws/lambda/'",
"+",
"lambda_name",
"streams",
"=",
"self",
".",
"logs_client",
".... | Fetch the CloudWatch logs for a given Lambda name. | [
"Fetch",
"the",
"CloudWatch",
"logs",
"for",
"a",
"given",
"Lambda",
"name",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L3010-L3049 | train | Fetch CloudWatch logs for a given Lambda name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.remove_log_group | def remove_log_group(self, group_name):
"""
Filter all log groups that match the name given in log_filter.
"""
print("Removing log group: {}".format(group_name))
try:
self.logs_client.delete_log_group(logGroupName=group_name)
except botocore.exceptions.ClientE... | python | def remove_log_group(self, group_name):
"""
Filter all log groups that match the name given in log_filter.
"""
print("Removing log group: {}".format(group_name))
try:
self.logs_client.delete_log_group(logGroupName=group_name)
except botocore.exceptions.ClientE... | [
"def",
"remove_log_group",
"(",
"self",
",",
"group_name",
")",
":",
"print",
"(",
"\"Removing log group: {}\"",
".",
"format",
"(",
"group_name",
")",
")",
"try",
":",
"self",
".",
"logs_client",
".",
"delete_log_group",
"(",
"logGroupName",
"=",
"group_name",
... | Filter all log groups that match the name given in log_filter. | [
"Filter",
"all",
"log",
"groups",
"that",
"match",
"the",
"name",
"given",
"in",
"log_filter",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L3051-L3059 | train | Remove the log group with the given name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.remove_api_gateway_logs | def remove_api_gateway_logs(self, project_name):
"""
Removed all logs that are assigned to a given rest api id.
"""
for rest_api in self.get_rest_apis(project_name):
for stage in self.apigateway_client.get_stages(restApiId=rest_api['id'])['item']:
self.remove_... | python | def remove_api_gateway_logs(self, project_name):
"""
Removed all logs that are assigned to a given rest api id.
"""
for rest_api in self.get_rest_apis(project_name):
for stage in self.apigateway_client.get_stages(restApiId=rest_api['id'])['item']:
self.remove_... | [
"def",
"remove_api_gateway_logs",
"(",
"self",
",",
"project_name",
")",
":",
"for",
"rest_api",
"in",
"self",
".",
"get_rest_apis",
"(",
"project_name",
")",
":",
"for",
"stage",
"in",
"self",
".",
"apigateway_client",
".",
"get_stages",
"(",
"restApiId",
"="... | Removed all logs that are assigned to a given rest api id. | [
"Removed",
"all",
"logs",
"that",
"are",
"assigned",
"to",
"a",
"given",
"rest",
"api",
"id",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L3067-L3073 | train | Removes all logs that are assigned to a given rest api id. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_hosted_zone_id_for_domain | def get_hosted_zone_id_for_domain(self, domain):
"""
Get the Hosted Zone ID for a given domain.
"""
all_zones = self.get_all_zones()
return self.get_best_match_zone(all_zones, domain) | python | def get_hosted_zone_id_for_domain(self, domain):
"""
Get the Hosted Zone ID for a given domain.
"""
all_zones = self.get_all_zones()
return self.get_best_match_zone(all_zones, domain) | [
"def",
"get_hosted_zone_id_for_domain",
"(",
"self",
",",
"domain",
")",
":",
"all_zones",
"=",
"self",
".",
"get_all_zones",
"(",
")",
"return",
"self",
".",
"get_best_match_zone",
"(",
"all_zones",
",",
"domain",
")"
] | Get the Hosted Zone ID for a given domain. | [
"Get",
"the",
"Hosted",
"Zone",
"ID",
"for",
"a",
"given",
"domain",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L3079-L3085 | train | Get the Hosted Zone ID for a given domain. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.get_best_match_zone | def get_best_match_zone(all_zones, domain):
"""Return zone id which name is closer matched with domain name."""
# Related: https://github.com/Miserlou/Zappa/issues/459
public_zones = [zone for zone in all_zones['HostedZones'] if not zone['Config']['PrivateZone']]
zones = {zone['Name'][... | python | def get_best_match_zone(all_zones, domain):
"""Return zone id which name is closer matched with domain name."""
# Related: https://github.com/Miserlou/Zappa/issues/459
public_zones = [zone for zone in all_zones['HostedZones'] if not zone['Config']['PrivateZone']]
zones = {zone['Name'][... | [
"def",
"get_best_match_zone",
"(",
"all_zones",
",",
"domain",
")",
":",
"# Related: https://github.com/Miserlou/Zappa/issues/459",
"public_zones",
"=",
"[",
"zone",
"for",
"zone",
"in",
"all_zones",
"[",
"'HostedZones'",
"]",
"if",
"not",
"zone",
"[",
"'Config'",
"... | Return zone id which name is closer matched with domain name. | [
"Return",
"zone",
"id",
"which",
"name",
"is",
"closer",
"matched",
"with",
"domain",
"name",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L3088-L3099 | train | Return zone id which name is closer matched with domain name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.remove_dns_challenge_txt | def remove_dns_challenge_txt(self, zone_id, domain, txt_challenge):
"""
Remove DNS challenge TXT.
"""
print("Deleting DNS challenge..")
resp = self.route53.change_resource_record_sets(
HostedZoneId=zone_id,
ChangeBatch=self.get_dns_challenge_change_batch('... | python | def remove_dns_challenge_txt(self, zone_id, domain, txt_challenge):
"""
Remove DNS challenge TXT.
"""
print("Deleting DNS challenge..")
resp = self.route53.change_resource_record_sets(
HostedZoneId=zone_id,
ChangeBatch=self.get_dns_challenge_change_batch('... | [
"def",
"remove_dns_challenge_txt",
"(",
"self",
",",
"zone_id",
",",
"domain",
",",
"txt_challenge",
")",
":",
"print",
"(",
"\"Deleting DNS challenge..\"",
")",
"resp",
"=",
"self",
".",
"route53",
".",
"change_resource_record_sets",
"(",
"HostedZoneId",
"=",
"zo... | Remove DNS challenge TXT. | [
"Remove",
"DNS",
"challenge",
"TXT",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L3113-L3123 | train | Remove DNS challenge TXT. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/core.py | Zappa.load_credentials | def load_credentials(self, boto_session=None, profile_name=None):
"""
Load AWS credentials.
An optional boto_session can be provided, but that's usually for testing.
An optional profile_name can be provided for config files that have multiple sets
of credentials.
"""
... | python | def load_credentials(self, boto_session=None, profile_name=None):
"""
Load AWS credentials.
An optional boto_session can be provided, but that's usually for testing.
An optional profile_name can be provided for config files that have multiple sets
of credentials.
"""
... | [
"def",
"load_credentials",
"(",
"self",
",",
"boto_session",
"=",
"None",
",",
"profile_name",
"=",
"None",
")",
":",
"# Automatically load credentials from config or environment",
"if",
"not",
"boto_session",
":",
"# If provided, use the supplied profile name.",
"if",
"pro... | Load AWS credentials.
An optional boto_session can be provided, but that's usually for testing.
An optional profile_name can be provided for config files that have multiple sets
of credentials. | [
"Load",
"AWS",
"credentials",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/core.py#L3161-L3204 | train | Load AWS credentials from config file or environment. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/letsencrypt.py | get_cert_and_update_domain | def get_cert_and_update_domain(
zappa_instance,
lambda_name,
api_stage,
domain=None,
manual=False,
):
"""
Main cert installe... | python | def get_cert_and_update_domain(
zappa_instance,
lambda_name,
api_stage,
domain=None,
manual=False,
):
"""
Main cert installe... | [
"def",
"get_cert_and_update_domain",
"(",
"zappa_instance",
",",
"lambda_name",
",",
"api_stage",
",",
"domain",
"=",
"None",
",",
"manual",
"=",
"False",
",",
")",
":",
"try",
":",
"create_domain_key",
"(",
")",
"create_domain_csr",
"(",
"domain",
")",
"get_c... | Main cert installer path. | [
"Main",
"cert",
"installer",
"path",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/letsencrypt.py#L47-L112 | train | Get the certificate and update the domain name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/letsencrypt.py | parse_account_key | def parse_account_key():
"""Parse account key to get public key"""
LOGGER.info("Parsing account key...")
cmd = [
'openssl', 'rsa',
'-in', os.path.join(gettempdir(), 'account.key'),
'-noout',
'-text'
]
devnull = open(os.devnull, 'wb')
return subprocess.check_output... | python | def parse_account_key():
"""Parse account key to get public key"""
LOGGER.info("Parsing account key...")
cmd = [
'openssl', 'rsa',
'-in', os.path.join(gettempdir(), 'account.key'),
'-noout',
'-text'
]
devnull = open(os.devnull, 'wb')
return subprocess.check_output... | [
"def",
"parse_account_key",
"(",
")",
":",
"LOGGER",
".",
"info",
"(",
"\"Parsing account key...\"",
")",
"cmd",
"=",
"[",
"'openssl'",
",",
"'rsa'",
",",
"'-in'",
",",
"os",
".",
"path",
".",
"join",
"(",
"gettempdir",
"(",
")",
",",
"'account.key'",
")... | Parse account key to get public key | [
"Parse",
"account",
"key",
"to",
"get",
"public",
"key"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/letsencrypt.py#L151-L161 | train | Parse the account key to get public key | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/letsencrypt.py | parse_csr | def parse_csr():
"""
Parse certificate signing request for domains
"""
LOGGER.info("Parsing CSR...")
cmd = [
'openssl', 'req',
'-in', os.path.join(gettempdir(), 'domain.csr'),
'-noout',
'-text'
]
devnull = open(os.devnull, 'wb')
out = subprocess.check_outp... | python | def parse_csr():
"""
Parse certificate signing request for domains
"""
LOGGER.info("Parsing CSR...")
cmd = [
'openssl', 'req',
'-in', os.path.join(gettempdir(), 'domain.csr'),
'-noout',
'-text'
]
devnull = open(os.devnull, 'wb')
out = subprocess.check_outp... | [
"def",
"parse_csr",
"(",
")",
":",
"LOGGER",
".",
"info",
"(",
"\"Parsing CSR...\"",
")",
"cmd",
"=",
"[",
"'openssl'",
",",
"'req'",
",",
"'-in'",
",",
"os",
".",
"path",
".",
"join",
"(",
"gettempdir",
"(",
")",
",",
"'domain.csr'",
")",
",",
"'-no... | Parse certificate signing request for domains | [
"Parse",
"certificate",
"signing",
"request",
"for",
"domains"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/letsencrypt.py#L164-L187 | train | Parse certificate signing request for domains | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/letsencrypt.py | get_boulder_header | def get_boulder_header(key_bytes):
"""
Use regular expressions to find crypto values from parsed account key,
and return a header we can send to our Boulder instance.
"""
pub_hex, pub_exp = re.search(
r"modulus:\n\s+00:([a-f0-9\:\s]+?)\npublicExponent: ([0-9]+)",
key_bytes.decode('ut... | python | def get_boulder_header(key_bytes):
"""
Use regular expressions to find crypto values from parsed account key,
and return a header we can send to our Boulder instance.
"""
pub_hex, pub_exp = re.search(
r"modulus:\n\s+00:([a-f0-9\:\s]+?)\npublicExponent: ([0-9]+)",
key_bytes.decode('ut... | [
"def",
"get_boulder_header",
"(",
"key_bytes",
")",
":",
"pub_hex",
",",
"pub_exp",
"=",
"re",
".",
"search",
"(",
"r\"modulus:\\n\\s+00:([a-f0-9\\:\\s]+?)\\npublicExponent: ([0-9]+)\"",
",",
"key_bytes",
".",
"decode",
"(",
"'utf8'",
")",
",",
"re",
".",
"MULTILINE... | Use regular expressions to find crypto values from parsed account key,
and return a header we can send to our Boulder instance. | [
"Use",
"regular",
"expressions",
"to",
"find",
"crypto",
"values",
"from",
"parsed",
"account",
"key",
"and",
"return",
"a",
"header",
"we",
"can",
"send",
"to",
"our",
"Boulder",
"instance",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/letsencrypt.py#L190-L209 | train | Return a dict that can be used to send to Boulder | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/letsencrypt.py | register_account | def register_account():
"""
Agree to LE TOS
"""
LOGGER.info("Registering account...")
code, result = _send_signed_request(DEFAULT_CA + "/acme/new-reg", {
"resource": "new-reg",
"agreement": "https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf",
})
if code == 201... | python | def register_account():
"""
Agree to LE TOS
"""
LOGGER.info("Registering account...")
code, result = _send_signed_request(DEFAULT_CA + "/acme/new-reg", {
"resource": "new-reg",
"agreement": "https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf",
})
if code == 201... | [
"def",
"register_account",
"(",
")",
":",
"LOGGER",
".",
"info",
"(",
"\"Registering account...\"",
")",
"code",
",",
"result",
"=",
"_send_signed_request",
"(",
"DEFAULT_CA",
"+",
"\"/acme/new-reg\"",
",",
"{",
"\"resource\"",
":",
"\"new-reg\"",
",",
"\"agreemen... | Agree to LE TOS | [
"Agree",
"to",
"LE",
"TOS"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/letsencrypt.py#L212-L226 | train | Register a new LE TOS
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/letsencrypt.py | get_cert | def get_cert(zappa_instance, log=LOGGER, CA=DEFAULT_CA):
"""
Call LE to get a new signed CA.
"""
out = parse_account_key()
header = get_boulder_header(out)
accountkey_json = json.dumps(header['jwk'], sort_keys=True, separators=(',', ':'))
thumbprint = _b64(hashlib.sha256(accountkey_json.enco... | python | def get_cert(zappa_instance, log=LOGGER, CA=DEFAULT_CA):
"""
Call LE to get a new signed CA.
"""
out = parse_account_key()
header = get_boulder_header(out)
accountkey_json = json.dumps(header['jwk'], sort_keys=True, separators=(',', ':'))
thumbprint = _b64(hashlib.sha256(accountkey_json.enco... | [
"def",
"get_cert",
"(",
"zappa_instance",
",",
"log",
"=",
"LOGGER",
",",
"CA",
"=",
"DEFAULT_CA",
")",
":",
"out",
"=",
"parse_account_key",
"(",
")",
"header",
"=",
"get_boulder_header",
"(",
"out",
")",
"accountkey_json",
"=",
"json",
".",
"dumps",
"(",... | Call LE to get a new signed CA. | [
"Call",
"LE",
"to",
"get",
"a",
"new",
"signed",
"CA",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/letsencrypt.py#L229-L293 | train | Get a new certificate for the account key. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/letsencrypt.py | verify_challenge | def verify_challenge(uri):
"""
Loop until our challenge is verified, else fail.
"""
while True:
try:
resp = urlopen(uri)
challenge_status = json.loads(resp.read().decode('utf8'))
except IOError as e:
raise ValueError("Error checking challenge: {0} {1}"... | python | def verify_challenge(uri):
"""
Loop until our challenge is verified, else fail.
"""
while True:
try:
resp = urlopen(uri)
challenge_status = json.loads(resp.read().decode('utf8'))
except IOError as e:
raise ValueError("Error checking challenge: {0} {1}"... | [
"def",
"verify_challenge",
"(",
"uri",
")",
":",
"while",
"True",
":",
"try",
":",
"resp",
"=",
"urlopen",
"(",
"uri",
")",
"challenge_status",
"=",
"json",
".",
"loads",
"(",
"resp",
".",
"read",
"(",
")",
".",
"decode",
"(",
"'utf8'",
")",
")",
"... | Loop until our challenge is verified, else fail. | [
"Loop",
"until",
"our",
"challenge",
"is",
"verified",
"else",
"fail",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/letsencrypt.py#L296-L314 | train | Check if our challenge is valid. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/letsencrypt.py | sign_certificate | def sign_certificate():
"""
Get the new certificate.
Returns the signed bytes.
"""
LOGGER.info("Signing certificate...")
cmd = [
'openssl', 'req',
'-in', os.path.join(gettempdir(), 'domain.csr'),
'-outform', 'DER'
]
devnull = open(os.devnull, 'wb')
csr_der = ... | python | def sign_certificate():
"""
Get the new certificate.
Returns the signed bytes.
"""
LOGGER.info("Signing certificate...")
cmd = [
'openssl', 'req',
'-in', os.path.join(gettempdir(), 'domain.csr'),
'-outform', 'DER'
]
devnull = open(os.devnull, 'wb')
csr_der = ... | [
"def",
"sign_certificate",
"(",
")",
":",
"LOGGER",
".",
"info",
"(",
"\"Signing certificate...\"",
")",
"cmd",
"=",
"[",
"'openssl'",
",",
"'req'",
",",
"'-in'",
",",
"os",
".",
"path",
".",
"join",
"(",
"gettempdir",
"(",
")",
",",
"'domain.csr'",
")",... | Get the new certificate.
Returns the signed bytes. | [
"Get",
"the",
"new",
"certificate",
".",
"Returns",
"the",
"signed",
"bytes",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/letsencrypt.py#L317-L339 | train | Get the new certificate.
Returns the signed bytes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/letsencrypt.py | encode_certificate | def encode_certificate(result):
"""
Encode cert bytes to PEM encoded cert file.
"""
cert_body = """-----BEGIN CERTIFICATE-----\n{0}\n-----END CERTIFICATE-----\n""".format(
"\n".join(textwrap.wrap(base64.b64encode(result).decode('utf8'), 64)))
signed_crt = open("{}/signed.crt".format(gettempd... | python | def encode_certificate(result):
"""
Encode cert bytes to PEM encoded cert file.
"""
cert_body = """-----BEGIN CERTIFICATE-----\n{0}\n-----END CERTIFICATE-----\n""".format(
"\n".join(textwrap.wrap(base64.b64encode(result).decode('utf8'), 64)))
signed_crt = open("{}/signed.crt".format(gettempd... | [
"def",
"encode_certificate",
"(",
"result",
")",
":",
"cert_body",
"=",
"\"\"\"-----BEGIN CERTIFICATE-----\\n{0}\\n-----END CERTIFICATE-----\\n\"\"\"",
".",
"format",
"(",
"\"\\n\"",
".",
"join",
"(",
"textwrap",
".",
"wrap",
"(",
"base64",
".",
"b64encode",
"(",
"res... | Encode cert bytes to PEM encoded cert file. | [
"Encode",
"cert",
"bytes",
"to",
"PEM",
"encoded",
"cert",
"file",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/letsencrypt.py#L342-L352 | train | Encode certificate bytes to PEM encoded cert file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/letsencrypt.py | _send_signed_request | def _send_signed_request(url, payload):
"""
Helper function to make signed requests to Boulder
"""
payload64 = _b64(json.dumps(payload).encode('utf8'))
out = parse_account_key()
header = get_boulder_header(out)
protected = copy.deepcopy(header)
protected["nonce"] = urlopen(DEFAULT_CA +... | python | def _send_signed_request(url, payload):
"""
Helper function to make signed requests to Boulder
"""
payload64 = _b64(json.dumps(payload).encode('utf8'))
out = parse_account_key()
header = get_boulder_header(out)
protected = copy.deepcopy(header)
protected["nonce"] = urlopen(DEFAULT_CA +... | [
"def",
"_send_signed_request",
"(",
"url",
",",
"payload",
")",
":",
"payload64",
"=",
"_b64",
"(",
"json",
".",
"dumps",
"(",
"payload",
")",
".",
"encode",
"(",
"'utf8'",
")",
")",
"out",
"=",
"parse_account_key",
"(",
")",
"header",
"=",
"get_boulder_... | Helper function to make signed requests to Boulder | [
"Helper",
"function",
"to",
"make",
"signed",
"requests",
"to",
"Boulder"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/letsencrypt.py#L366-L398 | train | Helper function to make signed requests to Boulder
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/cli.py | shamelessly_promote | def shamelessly_promote():
"""
Shamelessly promote our little community.
"""
click.echo("Need " + click.style("help", fg='green', bold=True) +
"? Found a " + click.style("bug", fg='green', bold=True) +
"? Let us " + click.style("know", fg='green', bold=True) + "! :D")
... | python | def shamelessly_promote():
"""
Shamelessly promote our little community.
"""
click.echo("Need " + click.style("help", fg='green', bold=True) +
"? Found a " + click.style("bug", fg='green', bold=True) +
"? Let us " + click.style("know", fg='green', bold=True) + "! :D")
... | [
"def",
"shamelessly_promote",
"(",
")",
":",
"click",
".",
"echo",
"(",
"\"Need \"",
"+",
"click",
".",
"style",
"(",
"\"help\"",
",",
"fg",
"=",
"'green'",
",",
"bold",
"=",
"True",
")",
"+",
"\"? Found a \"",
"+",
"click",
".",
"style",
"(",
"\"bug\"... | Shamelessly promote our little community. | [
"Shamelessly",
"promote",
"our",
"little",
"community",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L2744-L2757 | train | Promote our little community. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/cli.py | handle | def handle(): # pragma: no cover
"""
Main program execution handler.
"""
try:
cli = ZappaCLI()
sys.exit(cli.handle())
except SystemExit as e: # pragma: no cover
cli.on_exit()
sys.exit(e.code)
except KeyboardInterrupt: # pragma: no cover
cli.on_exit()
... | python | def handle(): # pragma: no cover
"""
Main program execution handler.
"""
try:
cli = ZappaCLI()
sys.exit(cli.handle())
except SystemExit as e: # pragma: no cover
cli.on_exit()
sys.exit(e.code)
except KeyboardInterrupt: # pragma: no cover
cli.on_exit()
... | [
"def",
"handle",
"(",
")",
":",
"# pragma: no cover",
"try",
":",
"cli",
"=",
"ZappaCLI",
"(",
")",
"sys",
".",
"exit",
"(",
"cli",
".",
"handle",
"(",
")",
")",
"except",
"SystemExit",
"as",
"e",
":",
"# pragma: no cover",
"cli",
".",
"on_exit",
"(",
... | Main program execution handler. | [
"Main",
"program",
"execution",
"handler",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L2772-L2797 | train | Main program execution handler. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/cli.py | ZappaCLI.stage_config | def stage_config(self):
"""
A shortcut property for settings of a stage.
"""
def get_stage_setting(stage, extended_stages=None):
if extended_stages is None:
extended_stages = []
if stage in extended_stages:
raise RuntimeError(stag... | python | def stage_config(self):
"""
A shortcut property for settings of a stage.
"""
def get_stage_setting(stage, extended_stages=None):
if extended_stages is None:
extended_stages = []
if stage in extended_stages:
raise RuntimeError(stag... | [
"def",
"stage_config",
"(",
"self",
")",
":",
"def",
"get_stage_setting",
"(",
"stage",
",",
"extended_stages",
"=",
"None",
")",
":",
"if",
"extended_stages",
"is",
"None",
":",
"extended_stages",
"=",
"[",
"]",
"if",
"stage",
"in",
"extended_stages",
":",
... | A shortcut property for settings of a stage. | [
"A",
"shortcut",
"property",
"for",
"settings",
"of",
"a",
"stage",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L127-L161 | train | Returns a dictionary of all the settings for a stage. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/cli.py | ZappaCLI.override_stage_config_setting | def override_stage_config_setting(self, key, val):
"""
Forcefully override a setting set by zappa_settings (for the current stage only)
:param key: settings key
:param val: value
"""
self._stage_config_overrides = getattr(self, '_stage_config_overrides', {})
self.... | python | def override_stage_config_setting(self, key, val):
"""
Forcefully override a setting set by zappa_settings (for the current stage only)
:param key: settings key
:param val: value
"""
self._stage_config_overrides = getattr(self, '_stage_config_overrides', {})
self.... | [
"def",
"override_stage_config_setting",
"(",
"self",
",",
"key",
",",
"val",
")",
":",
"self",
".",
"_stage_config_overrides",
"=",
"getattr",
"(",
"self",
",",
"'_stage_config_overrides'",
",",
"{",
"}",
")",
"self",
".",
"_stage_config_overrides",
".",
"setdef... | Forcefully override a setting set by zappa_settings (for the current stage only)
:param key: settings key
:param val: value | [
"Forcefully",
"override",
"a",
"setting",
"set",
"by",
"zappa_settings",
"(",
"for",
"the",
"current",
"stage",
"only",
")",
":",
"param",
"key",
":",
"settings",
"key",
":",
"param",
"val",
":",
"value"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L171-L178 | train | Forcefully override a setting set by zappa_settings for the current stage only | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/cli.py | ZappaCLI.handle | def handle(self, argv=None):
"""
Main function.
Parses command, load settings and dispatches accordingly.
"""
desc = ('Zappa - Deploy Python applications to AWS Lambda'
' and API Gateway.\n')
parser = argparse.ArgumentParser(description=desc)
pa... | python | def handle(self, argv=None):
"""
Main function.
Parses command, load settings and dispatches accordingly.
"""
desc = ('Zappa - Deploy Python applications to AWS Lambda'
' and API Gateway.\n')
parser = argparse.ArgumentParser(description=desc)
pa... | [
"def",
"handle",
"(",
"self",
",",
"argv",
"=",
"None",
")",
":",
"desc",
"=",
"(",
"'Zappa - Deploy Python applications to AWS Lambda'",
"' and API Gateway.\\n'",
")",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"desc",
")",
"parser... | Main function.
Parses command, load settings and dispatches accordingly. | [
"Main",
"function",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L180-L513 | train | Main function. Parses command and dispatches appropriate subcommands. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/cli.py | ZappaCLI.dispatch_command | def dispatch_command(self, command, stage):
"""
Given a command to execute and stage,
execute that command.
"""
self.api_stage = stage
if command not in ['status', 'manage']:
if not self.vargs.get('json', None):
click.echo("Calling " + click.... | python | def dispatch_command(self, command, stage):
"""
Given a command to execute and stage,
execute that command.
"""
self.api_stage = stage
if command not in ['status', 'manage']:
if not self.vargs.get('json', None):
click.echo("Calling " + click.... | [
"def",
"dispatch_command",
"(",
"self",
",",
"command",
",",
"stage",
")",
":",
"self",
".",
"api_stage",
"=",
"stage",
"if",
"command",
"not",
"in",
"[",
"'status'",
",",
"'manage'",
"]",
":",
"if",
"not",
"self",
".",
"vargs",
".",
"get",
"(",
"'js... | Given a command to execute and stage,
execute that command. | [
"Given",
"a",
"command",
"to",
"execute",
"and",
"stage",
"execute",
"that",
"command",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L515-L620 | train | Dispatches a command to the appropriate handler. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/cli.py | ZappaCLI.package | def package(self, output=None):
"""
Only build the package
"""
# Make sure we're in a venv.
self.check_venv()
# force not to delete the local zip
self.override_stage_config_setting('delete_local_zip', False)
# Execute the prebuild script
if self.p... | python | def package(self, output=None):
"""
Only build the package
"""
# Make sure we're in a venv.
self.check_venv()
# force not to delete the local zip
self.override_stage_config_setting('delete_local_zip', False)
# Execute the prebuild script
if self.p... | [
"def",
"package",
"(",
"self",
",",
"output",
"=",
"None",
")",
":",
"# Make sure we're in a venv.",
"self",
".",
"check_venv",
"(",
")",
"# force not to delete the local zip",
"self",
".",
"override_stage_config_setting",
"(",
"'delete_local_zip'",
",",
"False",
")",... | Only build the package | [
"Only",
"build",
"the",
"package"
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L626-L642 | train | Create the Lambda package. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/cli.py | ZappaCLI.template | def template(self, lambda_arn, role_arn, output=None, json=False):
"""
Only build the template file.
"""
if not lambda_arn:
raise ClickException("Lambda ARN is required to template.")
if not role_arn:
raise ClickException("Role ARN is required to templat... | python | def template(self, lambda_arn, role_arn, output=None, json=False):
"""
Only build the template file.
"""
if not lambda_arn:
raise ClickException("Lambda ARN is required to template.")
if not role_arn:
raise ClickException("Role ARN is required to templat... | [
"def",
"template",
"(",
"self",
",",
"lambda_arn",
",",
"role_arn",
",",
"output",
"=",
"None",
",",
"json",
"=",
"False",
")",
":",
"if",
"not",
"lambda_arn",
":",
"raise",
"ClickException",
"(",
"\"Lambda ARN is required to template.\"",
")",
"if",
"not",
... | Only build the template file. | [
"Only",
"build",
"the",
"template",
"file",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L644-L681 | train | Create the template file for the given Lambda and Role. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/cli.py | ZappaCLI.deploy | def deploy(self, source_zip=None):
"""
Package your project, upload it to S3, register the Lambda function
and create the API Gateway routes.
"""
if not source_zip:
# Make sure we're in a venv.
self.check_venv()
# Execute the prebuild script... | python | def deploy(self, source_zip=None):
"""
Package your project, upload it to S3, register the Lambda function
and create the API Gateway routes.
"""
if not source_zip:
# Make sure we're in a venv.
self.check_venv()
# Execute the prebuild script... | [
"def",
"deploy",
"(",
"self",
",",
"source_zip",
"=",
"None",
")",
":",
"if",
"not",
"source_zip",
":",
"# Make sure we're in a venv.",
"self",
".",
"check_venv",
"(",
")",
"# Execute the prebuild script",
"if",
"self",
".",
"prebuild_script",
":",
"self",
".",
... | Package your project, upload it to S3, register the Lambda function
and create the API Gateway routes. | [
"Package",
"your",
"project",
"upload",
"it",
"to",
"S3",
"register",
"the",
"Lambda",
"function",
"and",
"create",
"the",
"API",
"Gateway",
"routes",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L683-L854 | train | Deploy the application to the Zappa. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/cli.py | ZappaCLI.update | def update(self, source_zip=None, no_upload=False):
"""
Repackage and update the function code.
"""
if not source_zip:
# Make sure we're in a venv.
self.check_venv()
# Execute the prebuild script
if self.prebuild_script:
s... | python | def update(self, source_zip=None, no_upload=False):
"""
Repackage and update the function code.
"""
if not source_zip:
# Make sure we're in a venv.
self.check_venv()
# Execute the prebuild script
if self.prebuild_script:
s... | [
"def",
"update",
"(",
"self",
",",
"source_zip",
"=",
"None",
",",
"no_upload",
"=",
"False",
")",
":",
"if",
"not",
"source_zip",
":",
"# Make sure we're in a venv.",
"self",
".",
"check_venv",
"(",
")",
"# Execute the prebuild script",
"if",
"self",
".",
"pr... | Repackage and update the function code. | [
"Repackage",
"and",
"update",
"the",
"function",
"code",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L856-L1055 | train | Update the function code and the code. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/cli.py | ZappaCLI.rollback | def rollback(self, revision):
"""
Rollsback the currently deploy lambda code to a previous revision.
"""
print("Rolling back..")
self.zappa.rollback_lambda_function_version(
self.lambda_name, versions_back=revision)
print("Done!") | python | def rollback(self, revision):
"""
Rollsback the currently deploy lambda code to a previous revision.
"""
print("Rolling back..")
self.zappa.rollback_lambda_function_version(
self.lambda_name, versions_back=revision)
print("Done!") | [
"def",
"rollback",
"(",
"self",
",",
"revision",
")",
":",
"print",
"(",
"\"Rolling back..\"",
")",
"self",
".",
"zappa",
".",
"rollback_lambda_function_version",
"(",
"self",
".",
"lambda_name",
",",
"versions_back",
"=",
"revision",
")",
"print",
"(",
"\"Don... | Rollsback the currently deploy lambda code to a previous revision. | [
"Rollsback",
"the",
"currently",
"deploy",
"lambda",
"code",
"to",
"a",
"previous",
"revision",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L1057-L1066 | train | Rollsback the currently deployed lambda code to a previous revision. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Miserlou/Zappa | zappa/cli.py | ZappaCLI.tail | def tail(self, since, filter_pattern, limit=10000, keep_open=True, colorize=True, http=False, non_http=False, force_colorize=False):
"""
Tail this function's logs.
if keep_open, do so repeatedly, printing any new logs
"""
try:
since_stamp = string_to_timestamp(since... | python | def tail(self, since, filter_pattern, limit=10000, keep_open=True, colorize=True, http=False, non_http=False, force_colorize=False):
"""
Tail this function's logs.
if keep_open, do so repeatedly, printing any new logs
"""
try:
since_stamp = string_to_timestamp(since... | [
"def",
"tail",
"(",
"self",
",",
"since",
",",
"filter_pattern",
",",
"limit",
"=",
"10000",
",",
"keep_open",
"=",
"True",
",",
"colorize",
"=",
"True",
",",
"http",
"=",
"False",
",",
"non_http",
"=",
"False",
",",
"force_colorize",
"=",
"False",
")"... | Tail this function's logs.
if keep_open, do so repeatedly, printing any new logs | [
"Tail",
"this",
"function",
"s",
"logs",
"."
] | 3ccf7490a8d8b8fa74a61ee39bf44234f3567739 | https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L1068-L1100 | train | Tail the logs of this function. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.