repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
foremast/foremast
src/foremast/securitygroup/create_securitygroup.py
SpinnakerSecurityGroup.create_ingress_rule
def create_ingress_rule(self, app, rule): """Create a normalized ingress rule. Args: app (str): Application name rule (dict or int): Allowed Security Group ports and protocols. Returns: dict: Contains app, start_port, end_port, protocol, cross_account_env an...
python
def create_ingress_rule(self, app, rule): """Create a normalized ingress rule. Args: app (str): Application name rule (dict or int): Allowed Security Group ports and protocols. Returns: dict: Contains app, start_port, end_port, protocol, cross_account_env an...
[ "def", "create_ingress_rule", "(", "self", ",", "app", ",", "rule", ")", ":", "if", "isinstance", "(", "rule", ",", "dict", ")", ":", "# Advanced", "start_port", "=", "rule", ".", "get", "(", "'start_port'", ")", "end_port", "=", "rule", ".", "get", "(...
Create a normalized ingress rule. Args: app (str): Application name rule (dict or int): Allowed Security Group ports and protocols. Returns: dict: Contains app, start_port, end_port, protocol, cross_account_env and cross_account_vpc_id
[ "Create", "a", "normalized", "ingress", "rule", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/securitygroup/create_securitygroup.py#L281-L324
foremast/foremast
src/foremast/utils/awslambda.py
get_lambda_arn
def get_lambda_arn(app, account, region): """Get lambda ARN. Args: account (str): AWS account name. region (str): Region name, e.g. us-east-1 app (str): Lambda function name Returns: str: ARN for requested lambda function """ session = boto3.Session(profile_name=ac...
python
def get_lambda_arn(app, account, region): """Get lambda ARN. Args: account (str): AWS account name. region (str): Region name, e.g. us-east-1 app (str): Lambda function name Returns: str: ARN for requested lambda function """ session = boto3.Session(profile_name=ac...
[ "def", "get_lambda_arn", "(", "app", ",", "account", ",", "region", ")", ":", "session", "=", "boto3", ".", "Session", "(", "profile_name", "=", "account", ",", "region_name", "=", "region", ")", "lambda_client", "=", "session", ".", "client", "(", "'lambd...
Get lambda ARN. Args: account (str): AWS account name. region (str): Region name, e.g. us-east-1 app (str): Lambda function name Returns: str: ARN for requested lambda function
[ "Get", "lambda", "ARN", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/awslambda.py#L28-L60
foremast/foremast
src/foremast/utils/awslambda.py
get_lambda_alias_arn
def get_lambda_alias_arn(app, account, region): """Get lambda alias ARN. Assumes that account name is equal to alias name. Args: account (str): AWS account name. region (str): Region name, e.g. us-east-1 app (str): Lambda function name Returns: str: ARN for requested lambda...
python
def get_lambda_alias_arn(app, account, region): """Get lambda alias ARN. Assumes that account name is equal to alias name. Args: account (str): AWS account name. region (str): Region name, e.g. us-east-1 app (str): Lambda function name Returns: str: ARN for requested lambda...
[ "def", "get_lambda_alias_arn", "(", "app", ",", "account", ",", "region", ")", ":", "session", "=", "boto3", ".", "Session", "(", "profile_name", "=", "account", ",", "region_name", "=", "region", ")", "lambda_client", "=", "session", ".", "client", "(", "...
Get lambda alias ARN. Assumes that account name is equal to alias name. Args: account (str): AWS account name. region (str): Region name, e.g. us-east-1 app (str): Lambda function name Returns: str: ARN for requested lambda alias
[ "Get", "lambda", "alias", "ARN", ".", "Assumes", "that", "account", "name", "is", "equal", "to", "alias", "name", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/awslambda.py#L63-L91
foremast/foremast
src/foremast/utils/awslambda.py
add_lambda_permissions
def add_lambda_permissions(function='', statement_id='', action='lambda:InvokeFunction', principal='', source_arn='', env='', region='us-east-1'): """Add ...
python
def add_lambda_permissions(function='', statement_id='', action='lambda:InvokeFunction', principal='', source_arn='', env='', region='us-east-1'): """Add ...
[ "def", "add_lambda_permissions", "(", "function", "=", "''", ",", "statement_id", "=", "''", ",", "action", "=", "'lambda:InvokeFunction'", ",", "principal", "=", "''", ",", "source_arn", "=", "''", ",", "env", "=", "''", ",", "region", "=", "'us-east-1'", ...
Add permission to Lambda for the event trigger. Args: function (str): Lambda function name statement_id (str): IAM policy statement (principal) id action (str): Lambda action to allow principal (str): AWS principal to add permissions source_arn (str): ARN of the source of th...
[ "Add", "permission", "to", "Lambda", "for", "the", "event", "trigger", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/awslambda.py#L94-L135
foremast/foremast
src/foremast/utils/awslambda.py
remove_all_lambda_permissions
def remove_all_lambda_permissions(app_name='', env='', region='us-east-1'): """Remove all foremast-* permissions from lambda. Args: app_name (str): Application name env (str): AWS environment region (str): AWS region """ session = boto3.Session(profile_name=env, region_name=regi...
python
def remove_all_lambda_permissions(app_name='', env='', region='us-east-1'): """Remove all foremast-* permissions from lambda. Args: app_name (str): Application name env (str): AWS environment region (str): AWS region """ session = boto3.Session(profile_name=env, region_name=regi...
[ "def", "remove_all_lambda_permissions", "(", "app_name", "=", "''", ",", "env", "=", "''", ",", "region", "=", "'us-east-1'", ")", ":", "session", "=", "boto3", ".", "Session", "(", "profile_name", "=", "env", ",", "region_name", "=", "region", ")", "lambd...
Remove all foremast-* permissions from lambda. Args: app_name (str): Application name env (str): AWS environment region (str): AWS region
[ "Remove", "all", "foremast", "-", "*", "permissions", "from", "lambda", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/awslambda.py#L138-L169
foremast/foremast
src/foremast/iam/resource_action.py
resource_action
def resource_action(client, action='', log_format='item: %(key)s', **kwargs): """Call _action_ using boto3 _client_ with _kwargs_. This is meant for _action_ methods that will create or implicitely prove a given Resource exists. The _log_failure_ flag is available for methods that should always succeed...
python
def resource_action(client, action='', log_format='item: %(key)s', **kwargs): """Call _action_ using boto3 _client_ with _kwargs_. This is meant for _action_ methods that will create or implicitely prove a given Resource exists. The _log_failure_ flag is available for methods that should always succeed...
[ "def", "resource_action", "(", "client", ",", "action", "=", "''", ",", "log_format", "=", "'item: %(key)s'", ",", "*", "*", "kwargs", ")", ":", "result", "=", "None", "try", ":", "result", "=", "getattr", "(", "client", ",", "action", ")", "(", "*", ...
Call _action_ using boto3 _client_ with _kwargs_. This is meant for _action_ methods that will create or implicitely prove a given Resource exists. The _log_failure_ flag is available for methods that should always succeed, but will occasionally fail due to unknown AWS issues. Args: client...
[ "Call", "_action_", "using", "boto3", "_client_", "with", "_kwargs_", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/iam/resource_action.py#L24-L59
foremast/foremast
src/foremast/elb/__main__.py
main
def main(): """Entry point for ELB creation""" logging.basicConfig(format=LOGGING_FORMAT) parser = argparse.ArgumentParser(description='Example with non-optional arguments') add_debug(parser) add_app(parser) add_env(parser) add_region(parser) add_properties(parser) args = parser.p...
python
def main(): """Entry point for ELB creation""" logging.basicConfig(format=LOGGING_FORMAT) parser = argparse.ArgumentParser(description='Example with non-optional arguments') add_debug(parser) add_app(parser) add_env(parser) add_region(parser) add_properties(parser) args = parser.p...
[ "def", "main", "(", ")", ":", "logging", ".", "basicConfig", "(", "format", "=", "LOGGING_FORMAT", ")", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Example with non-optional arguments'", ")", "add_debug", "(", "parser", ")", "add...
Entry point for ELB creation
[ "Entry", "point", "for", "ELB", "creation" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/elb/__main__.py#L30-L47
foremast/foremast
src/foremast/elb/create_elb.py
SpinnakerELB.make_elb_json
def make_elb_json(self): """Render the JSON template with arguments. Returns: str: Rendered ELB template. """ env = self.env region = self.region elb_settings = self.properties['elb'] LOG.debug('Block ELB Settings:\n%s', pformat(elb_settings)) ...
python
def make_elb_json(self): """Render the JSON template with arguments. Returns: str: Rendered ELB template. """ env = self.env region = self.region elb_settings = self.properties['elb'] LOG.debug('Block ELB Settings:\n%s', pformat(elb_settings)) ...
[ "def", "make_elb_json", "(", "self", ")", ":", "env", "=", "self", ".", "env", "region", "=", "self", ".", "region", "elb_settings", "=", "self", ".", "properties", "[", "'elb'", "]", "LOG", ".", "debug", "(", "'Block ELB Settings:\\n%s'", ",", "pformat", ...
Render the JSON template with arguments. Returns: str: Rendered ELB template.
[ "Render", "the", "JSON", "template", "with", "arguments", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/elb/create_elb.py#L47-L112
foremast/foremast
src/foremast/elb/create_elb.py
SpinnakerELB.create_elb
def create_elb(self): """Create or Update the ELB after rendering JSON data from configs. Asserts that the ELB task was successful. """ json_data = self.make_elb_json() LOG.debug('Block ELB JSON Data:\n%s', pformat(json_data)) wait_for_task(json_data) self.add_...
python
def create_elb(self): """Create or Update the ELB after rendering JSON data from configs. Asserts that the ELB task was successful. """ json_data = self.make_elb_json() LOG.debug('Block ELB JSON Data:\n%s', pformat(json_data)) wait_for_task(json_data) self.add_...
[ "def", "create_elb", "(", "self", ")", ":", "json_data", "=", "self", ".", "make_elb_json", "(", ")", "LOG", ".", "debug", "(", "'Block ELB JSON Data:\\n%s'", ",", "pformat", "(", "json_data", ")", ")", "wait_for_task", "(", "json_data", ")", "self", ".", ...
Create or Update the ELB after rendering JSON data from configs. Asserts that the ELB task was successful.
[ "Create", "or", "Update", "the", "ELB", "after", "rendering", "JSON", "data", "from", "configs", ".", "Asserts", "that", "the", "ELB", "task", "was", "successful", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/elb/create_elb.py#L114-L127
foremast/foremast
src/foremast/elb/create_elb.py
SpinnakerELB.add_listener_policy
def add_listener_policy(self, json_data): """Attaches listerner policies to an ELB Args: json_data (json): return data from ELB upsert """ env = boto3.session.Session(profile_name=self.env, region_name=self.region) elbclient = env.client('elb') # create stic...
python
def add_listener_policy(self, json_data): """Attaches listerner policies to an ELB Args: json_data (json): return data from ELB upsert """ env = boto3.session.Session(profile_name=self.env, region_name=self.region) elbclient = env.client('elb') # create stic...
[ "def", "add_listener_policy", "(", "self", ",", "json_data", ")", ":", "env", "=", "boto3", ".", "session", ".", "Session", "(", "profile_name", "=", "self", ".", "env", ",", "region_name", "=", "self", ".", "region", ")", "elbclient", "=", "env", ".", ...
Attaches listerner policies to an ELB Args: json_data (json): return data from ELB upsert
[ "Attaches", "listerner", "policies", "to", "an", "ELB" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/elb/create_elb.py#L129-L161
foremast/foremast
src/foremast/elb/create_elb.py
SpinnakerELB.add_backend_policy
def add_backend_policy(self, json_data): """Attaches backend server policies to an ELB Args: json_data (json): return data from ELB upsert """ env = boto3.session.Session(profile_name=self.env, region_name=self.region) elbclient = env.client('elb') # Attach ...
python
def add_backend_policy(self, json_data): """Attaches backend server policies to an ELB Args: json_data (json): return data from ELB upsert """ env = boto3.session.Session(profile_name=self.env, region_name=self.region) elbclient = env.client('elb') # Attach ...
[ "def", "add_backend_policy", "(", "self", ",", "json_data", ")", ":", "env", "=", "boto3", ".", "session", ".", "Session", "(", "profile_name", "=", "self", ".", "env", ",", "region_name", "=", "self", ".", "region", ")", "elbclient", "=", "env", ".", ...
Attaches backend server policies to an ELB Args: json_data (json): return data from ELB upsert
[ "Attaches", "backend", "server", "policies", "to", "an", "ELB" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/elb/create_elb.py#L163-L180
foremast/foremast
src/foremast/elb/create_elb.py
SpinnakerELB.add_stickiness
def add_stickiness(self): """ Adds stickiness policy to created ELB Returns: dict: A dict of stickiness policies and ports:: example: { 80: "$policy_name" } """ stickiness_dict = {} env = boto3.sess...
python
def add_stickiness(self): """ Adds stickiness policy to created ELB Returns: dict: A dict of stickiness policies and ports:: example: { 80: "$policy_name" } """ stickiness_dict = {} env = boto3.sess...
[ "def", "add_stickiness", "(", "self", ")", ":", "stickiness_dict", "=", "{", "}", "env", "=", "boto3", ".", "session", ".", "Session", "(", "profile_name", "=", "self", ".", "env", ",", "region_name", "=", "self", ".", "region", ")", "elbclient", "=", ...
Adds stickiness policy to created ELB Returns: dict: A dict of stickiness policies and ports:: example: { 80: "$policy_name" }
[ "Adds", "stickiness", "policy", "to", "created", "ELB" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/elb/create_elb.py#L182-L218
foremast/foremast
src/foremast/elb/create_elb.py
SpinnakerELB.configure_attributes
def configure_attributes(self, json_data): """Configure load balancer attributes such as idle timeout, connection draining, etc Args: json_data (json): return data from ELB upsert """ env = boto3.session.Session(profile_name=self.env, region_name=self.region) elbclie...
python
def configure_attributes(self, json_data): """Configure load balancer attributes such as idle timeout, connection draining, etc Args: json_data (json): return data from ELB upsert """ env = boto3.session.Session(profile_name=self.env, region_name=self.region) elbclie...
[ "def", "configure_attributes", "(", "self", ",", "json_data", ")", ":", "env", "=", "boto3", ".", "session", ".", "Session", "(", "profile_name", "=", "self", ".", "env", ",", "region_name", "=", "self", ".", "region", ")", "elbclient", "=", "env", ".", ...
Configure load balancer attributes such as idle timeout, connection draining, etc Args: json_data (json): return data from ELB upsert
[ "Configure", "load", "balancer", "attributes", "such", "as", "idle", "timeout", "connection", "draining", "etc" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/elb/create_elb.py#L220-L276
foremast/foremast
src/foremast/elb/splay_health.py
splay_health
def splay_health(health_target): """Set Health Check path, port, and protocol. Args: health_target (str): The health target. ie ``HTTP:80`` Returns: HealthCheck: A **collections.namedtuple** class with *path*, *port*, *proto*, and *target* attributes. """ HealthCheck = colle...
python
def splay_health(health_target): """Set Health Check path, port, and protocol. Args: health_target (str): The health target. ie ``HTTP:80`` Returns: HealthCheck: A **collections.namedtuple** class with *path*, *port*, *proto*, and *target* attributes. """ HealthCheck = colle...
[ "def", "splay_health", "(", "health_target", ")", ":", "HealthCheck", "=", "collections", ".", "namedtuple", "(", "'HealthCheck'", ",", "[", "'path'", ",", "'port'", ",", "'proto'", ",", "'target'", "]", ")", "proto", ",", "health_port_path", "=", "health_targ...
Set Health Check path, port, and protocol. Args: health_target (str): The health target. ie ``HTTP:80`` Returns: HealthCheck: A **collections.namedtuple** class with *path*, *port*, *proto*, and *target* attributes.
[ "Set", "Health", "Check", "path", "port", "and", "protocol", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/elb/splay_health.py#L23-L49
foremast/foremast
src/foremast/pipeline/create_pipeline_onetime.py
SpinnakerPipelineOnetime.post_pipeline
def post_pipeline(self, pipeline): """Send Pipeline JSON to Spinnaker. Args: pipeline (dict, str): New Pipeline to create. """ if isinstance(pipeline, str): pipeline_str = pipeline else: pipeline_str = json.dumps(pipeline) pipeline_js...
python
def post_pipeline(self, pipeline): """Send Pipeline JSON to Spinnaker. Args: pipeline (dict, str): New Pipeline to create. """ if isinstance(pipeline, str): pipeline_str = pipeline else: pipeline_str = json.dumps(pipeline) pipeline_js...
[ "def", "post_pipeline", "(", "self", ",", "pipeline", ")", ":", "if", "isinstance", "(", "pipeline", ",", "str", ")", ":", "pipeline_str", "=", "pipeline", "else", ":", "pipeline_str", "=", "json", ".", "dumps", "(", "pipeline", ")", "pipeline_json", "=", ...
Send Pipeline JSON to Spinnaker. Args: pipeline (dict, str): New Pipeline to create.
[ "Send", "Pipeline", "JSON", "to", "Spinnaker", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/pipeline/create_pipeline_onetime.py#L45-L74
foremast/foremast
src/foremast/configs/__main__.py
main
def main(): """Append Application Configurations to a given file in multiple formats.""" logging.basicConfig(format=LOGGING_FORMAT) parser = argparse.ArgumentParser(description=main.__doc__) add_debug(parser) parser.add_argument('-o', '--output', required=True, help='Name of environment file to app...
python
def main(): """Append Application Configurations to a given file in multiple formats.""" logging.basicConfig(format=LOGGING_FORMAT) parser = argparse.ArgumentParser(description=main.__doc__) add_debug(parser) parser.add_argument('-o', '--output', required=True, help='Name of environment file to app...
[ "def", "main", "(", ")", ":", "logging", ".", "basicConfig", "(", "format", "=", "LOGGING_FORMAT", ")", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "main", ".", "__doc__", ")", "add_debug", "(", "parser", ")", "parser", ".", ...
Append Application Configurations to a given file in multiple formats.
[ "Append", "Application", "Configurations", "to", "a", "given", "file", "in", "multiple", "formats", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/configs/__main__.py#L33-L56
foremast/foremast
src/foremast/__main__.py
add_infra
def add_infra(subparsers): """Infrastructure subcommands.""" infra_parser = subparsers.add_parser('infra', help=runner.prepare_infrastructure.__doc__) infra_parser.set_defaults(func=runner.prepare_infrastructure)
python
def add_infra(subparsers): """Infrastructure subcommands.""" infra_parser = subparsers.add_parser('infra', help=runner.prepare_infrastructure.__doc__) infra_parser.set_defaults(func=runner.prepare_infrastructure)
[ "def", "add_infra", "(", "subparsers", ")", ":", "infra_parser", "=", "subparsers", ".", "add_parser", "(", "'infra'", ",", "help", "=", "runner", ".", "prepare_infrastructure", ".", "__doc__", ")", "infra_parser", ".", "set_defaults", "(", "func", "=", "runne...
Infrastructure subcommands.
[ "Infrastructure", "subcommands", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/__main__.py#L15-L18
foremast/foremast
src/foremast/__main__.py
add_pipeline
def add_pipeline(subparsers): """Pipeline subcommands.""" pipeline_parser = subparsers.add_parser( 'pipeline', help=add_pipeline.__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) pipeline_parser.set_defaults(func=pipeline_parser.print_help) pipeline_subparsers = pipeline_parser.a...
python
def add_pipeline(subparsers): """Pipeline subcommands.""" pipeline_parser = subparsers.add_parser( 'pipeline', help=add_pipeline.__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) pipeline_parser.set_defaults(func=pipeline_parser.print_help) pipeline_subparsers = pipeline_parser.a...
[ "def", "add_pipeline", "(", "subparsers", ")", ":", "pipeline_parser", "=", "subparsers", ".", "add_parser", "(", "'pipeline'", ",", "help", "=", "add_pipeline", ".", "__doc__", ",", "formatter_class", "=", "argparse", ".", "ArgumentDefaultsHelpFormatter", ")", "p...
Pipeline subcommands.
[ "Pipeline", "subcommands", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/__main__.py#L21-L36
foremast/foremast
src/foremast/__main__.py
add_rebuild
def add_rebuild(subparsers): """Rebuild Pipeline subcommands.""" rebuild_parser = subparsers.add_parser( 'rebuild', help=runner.rebuild_pipelines.__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) rebuild_parser.set_defaults(func=runner.rebuild_pipelines) rebuild_parser.add_argumen...
python
def add_rebuild(subparsers): """Rebuild Pipeline subcommands.""" rebuild_parser = subparsers.add_parser( 'rebuild', help=runner.rebuild_pipelines.__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) rebuild_parser.set_defaults(func=runner.rebuild_pipelines) rebuild_parser.add_argumen...
[ "def", "add_rebuild", "(", "subparsers", ")", ":", "rebuild_parser", "=", "subparsers", ".", "add_parser", "(", "'rebuild'", ",", "help", "=", "runner", ".", "rebuild_pipelines", ".", "__doc__", ",", "formatter_class", "=", "argparse", ".", "ArgumentDefaultsHelpFo...
Rebuild Pipeline subcommands.
[ "Rebuild", "Pipeline", "subcommands", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/__main__.py#L39-L49
foremast/foremast
src/foremast/__main__.py
add_autoscaling
def add_autoscaling(subparsers): """Auto Scaling Group Policy subcommands.""" autoscaling_parser = subparsers.add_parser( 'autoscaling', help=runner.create_scaling_policy.__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) autoscaling_parser.set_defaults(func=runner.crea...
python
def add_autoscaling(subparsers): """Auto Scaling Group Policy subcommands.""" autoscaling_parser = subparsers.add_parser( 'autoscaling', help=runner.create_scaling_policy.__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) autoscaling_parser.set_defaults(func=runner.crea...
[ "def", "add_autoscaling", "(", "subparsers", ")", ":", "autoscaling_parser", "=", "subparsers", ".", "add_parser", "(", "'autoscaling'", ",", "help", "=", "runner", ".", "create_scaling_policy", ".", "__doc__", ",", "formatter_class", "=", "argparse", ".", "Argume...
Auto Scaling Group Policy subcommands.
[ "Auto", "Scaling", "Group", "Policy", "subcommands", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/__main__.py#L52-L58
foremast/foremast
src/foremast/__main__.py
add_validate
def add_validate(subparsers): """Validate Spinnaker setup.""" validate_parser = subparsers.add_parser( 'validate', help=add_validate.__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) validate_parser.set_defaults(func=validate_parser.print_help) validate_subparsers = validate_pars...
python
def add_validate(subparsers): """Validate Spinnaker setup.""" validate_parser = subparsers.add_parser( 'validate', help=add_validate.__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) validate_parser.set_defaults(func=validate_parser.print_help) validate_subparsers = validate_pars...
[ "def", "add_validate", "(", "subparsers", ")", ":", "validate_parser", "=", "subparsers", ".", "add_parser", "(", "'validate'", ",", "help", "=", "add_validate", ".", "__doc__", ",", "formatter_class", "=", "argparse", ".", "ArgumentDefaultsHelpFormatter", ")", "v...
Validate Spinnaker setup.
[ "Validate", "Spinnaker", "setup", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/__main__.py#L61-L75
foremast/foremast
src/foremast/__main__.py
main
def main(manual_args=None): """Foremast, your ship's support.""" parser = argparse.ArgumentParser(description=main.__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.set_defaults(func=parser.print_help) add_debug(parser) parser.add_argument( '-s', '--short-log', ...
python
def main(manual_args=None): """Foremast, your ship's support.""" parser = argparse.ArgumentParser(description=main.__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.set_defaults(func=parser.print_help) add_debug(parser) parser.add_argument( '-s', '--short-log', ...
[ "def", "main", "(", "manual_args", "=", "None", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "main", ".", "__doc__", ",", "formatter_class", "=", "argparse", ".", "ArgumentDefaultsHelpFormatter", ")", "parser", ".", "set...
Foremast, your ship's support.
[ "Foremast", "your", "ship", "s", "support", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/__main__.py#L78-L118
foremast/foremast
src/foremast/pipeline/create_pipeline.py
SpinnakerPipeline.post_pipeline
def post_pipeline(self, pipeline): """Send Pipeline JSON to Spinnaker. Args: pipeline (json): json of the pipeline to be created in Spinnaker """ url = "{0}/pipelines".format(API_URL) if isinstance(pipeline, str): pipeline_json = pipeline else: ...
python
def post_pipeline(self, pipeline): """Send Pipeline JSON to Spinnaker. Args: pipeline (json): json of the pipeline to be created in Spinnaker """ url = "{0}/pipelines".format(API_URL) if isinstance(pipeline, str): pipeline_json = pipeline else: ...
[ "def", "post_pipeline", "(", "self", ",", "pipeline", ")", ":", "url", "=", "\"{0}/pipelines\"", ".", "format", "(", "API_URL", ")", "if", "isinstance", "(", "pipeline", ",", "str", ")", ":", "pipeline_json", "=", "pipeline", "else", ":", "pipeline_json", ...
Send Pipeline JSON to Spinnaker. Args: pipeline (json): json of the pipeline to be created in Spinnaker
[ "Send", "Pipeline", "JSON", "to", "Spinnaker", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/pipeline/create_pipeline.py#L62-L89
foremast/foremast
src/foremast/pipeline/create_pipeline.py
SpinnakerPipeline.render_wrapper
def render_wrapper(self, region='us-east-1'): """Generate the base Pipeline wrapper. This renders the non-repeatable stages in a pipeline, like jenkins, baking, tagging and notifications. Args: region (str): AWS Region. Returns: dict: Rendered Pipeline wrapper....
python
def render_wrapper(self, region='us-east-1'): """Generate the base Pipeline wrapper. This renders the non-repeatable stages in a pipeline, like jenkins, baking, tagging and notifications. Args: region (str): AWS Region. Returns: dict: Rendered Pipeline wrapper....
[ "def", "render_wrapper", "(", "self", ",", "region", "=", "'us-east-1'", ")", ":", "base", "=", "self", ".", "settings", "[", "'pipeline'", "]", "[", "'base'", "]", "if", "self", ".", "base", ":", "base", "=", "self", ".", "base", "email", "=", "self...
Generate the base Pipeline wrapper. This renders the non-repeatable stages in a pipeline, like jenkins, baking, tagging and notifications. Args: region (str): AWS Region. Returns: dict: Rendered Pipeline wrapper.
[ "Generate", "the", "base", "Pipeline", "wrapper", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/pipeline/create_pipeline.py#L91-L146
foremast/foremast
src/foremast/pipeline/create_pipeline.py
SpinnakerPipeline.get_existing_pipelines
def get_existing_pipelines(self): """Get existing pipeline configs for specific application. Returns: str: Pipeline config json """ url = "{0}/applications/{1}/pipelineConfigs".format(API_URL, self.app_name) resp = requests.get(url, verify=GATE_CA_BUNDLE, cert=GATE_...
python
def get_existing_pipelines(self): """Get existing pipeline configs for specific application. Returns: str: Pipeline config json """ url = "{0}/applications/{1}/pipelineConfigs".format(API_URL, self.app_name) resp = requests.get(url, verify=GATE_CA_BUNDLE, cert=GATE_...
[ "def", "get_existing_pipelines", "(", "self", ")", ":", "url", "=", "\"{0}/applications/{1}/pipelineConfigs\"", ".", "format", "(", "API_URL", ",", "self", ".", "app_name", ")", "resp", "=", "requests", ".", "get", "(", "url", ",", "verify", "=", "GATE_CA_BUND...
Get existing pipeline configs for specific application. Returns: str: Pipeline config json
[ "Get", "existing", "pipeline", "configs", "for", "specific", "application", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/pipeline/create_pipeline.py#L148-L159
foremast/foremast
src/foremast/pipeline/create_pipeline.py
SpinnakerPipeline.compare_with_existing
def compare_with_existing(self, region='us-east-1', onetime=False): """Compare desired pipeline with existing pipelines. Args: region (str): Region of desired pipeline. onetime (bool): Looks for different pipeline if Onetime Returns: str: pipeline_id if exis...
python
def compare_with_existing(self, region='us-east-1', onetime=False): """Compare desired pipeline with existing pipelines. Args: region (str): Region of desired pipeline. onetime (bool): Looks for different pipeline if Onetime Returns: str: pipeline_id if exis...
[ "def", "compare_with_existing", "(", "self", ",", "region", "=", "'us-east-1'", ",", "onetime", "=", "False", ")", ":", "pipelines", "=", "self", ".", "get_existing_pipelines", "(", ")", "pipeline_id", "=", "None", "found", "=", "False", "for", "pipeline", "...
Compare desired pipeline with existing pipelines. Args: region (str): Region of desired pipeline. onetime (bool): Looks for different pipeline if Onetime Returns: str: pipeline_id if existing, empty string of not.
[ "Compare", "desired", "pipeline", "with", "existing", "pipelines", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/pipeline/create_pipeline.py#L161-L191
foremast/foremast
src/foremast/pipeline/create_pipeline.py
SpinnakerPipeline.create_pipeline
def create_pipeline(self): """Main wrapper for pipeline creation. 1. Runs clean_pipelines to clean up existing ones 2. determines which environments the pipeline needs 3. gets all subnets for template rendering 4. Renders all of the pipeline blocks as defined in configs 5...
python
def create_pipeline(self): """Main wrapper for pipeline creation. 1. Runs clean_pipelines to clean up existing ones 2. determines which environments the pipeline needs 3. gets all subnets for template rendering 4. Renders all of the pipeline blocks as defined in configs 5...
[ "def", "create_pipeline", "(", "self", ")", ":", "clean_pipelines", "(", "app", "=", "self", ".", "app_name", ",", "settings", "=", "self", ".", "settings", ")", "pipeline_envs", "=", "self", ".", "environments", "self", ".", "log", ".", "debug", "(", "'...
Main wrapper for pipeline creation. 1. Runs clean_pipelines to clean up existing ones 2. determines which environments the pipeline needs 3. gets all subnets for template rendering 4. Renders all of the pipeline blocks as defined in configs 5. Runs post_pipeline to create pipelin...
[ "Main", "wrapper", "for", "pipeline", "creation", ".", "1", ".", "Runs", "clean_pipelines", "to", "clean", "up", "existing", "ones", "2", ".", "determines", "which", "environments", "the", "pipeline", "needs", "3", ".", "gets", "all", "subnets", "for", "temp...
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/pipeline/create_pipeline.py#L193-L259
foremast/foremast
src/foremast/utils/lookups.py
ami_lookup
def ami_lookup(region='us-east-1', name='tomcat8'): """Look up AMI ID. Use _name_ to find AMI ID. If no ami_base_url or gitlab_token is provided, _name_ is returned as the ami id. Args: region (str): AWS Region to find AMI ID. name (str): Simple AMI base name to lookup. Returns: ...
python
def ami_lookup(region='us-east-1', name='tomcat8'): """Look up AMI ID. Use _name_ to find AMI ID. If no ami_base_url or gitlab_token is provided, _name_ is returned as the ami id. Args: region (str): AWS Region to find AMI ID. name (str): Simple AMI base name to lookup. Returns: ...
[ "def", "ami_lookup", "(", "region", "=", "'us-east-1'", ",", "name", "=", "'tomcat8'", ")", ":", "if", "AMI_JSON_URL", ":", "ami_dict", "=", "_get_ami_dict", "(", "AMI_JSON_URL", ")", "ami_id", "=", "ami_dict", "[", "region", "]", "[", "name", "]", "elif",...
Look up AMI ID. Use _name_ to find AMI ID. If no ami_base_url or gitlab_token is provided, _name_ is returned as the ami id. Args: region (str): AWS Region to find AMI ID. name (str): Simple AMI base name to lookup. Returns: str: AMI ID for _name_ in _region_.
[ "Look", "up", "AMI", "ID", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/lookups.py#L32-L59
foremast/foremast
src/foremast/utils/lookups.py
_get_ami_file
def _get_ami_file(region='us-east-1'): """Get file from Gitlab. Args: region (str): AWS Region to find AMI ID. Returns: str: Contents in json format. """ LOG.info("Getting AMI from Gitlab") lookup = FileLookup(git_short='devops/ansible') filename = 'scripts/{0}.json'.forma...
python
def _get_ami_file(region='us-east-1'): """Get file from Gitlab. Args: region (str): AWS Region to find AMI ID. Returns: str: Contents in json format. """ LOG.info("Getting AMI from Gitlab") lookup = FileLookup(git_short='devops/ansible') filename = 'scripts/{0}.json'.forma...
[ "def", "_get_ami_file", "(", "region", "=", "'us-east-1'", ")", ":", "LOG", ".", "info", "(", "\"Getting AMI from Gitlab\"", ")", "lookup", "=", "FileLookup", "(", "git_short", "=", "'devops/ansible'", ")", "filename", "=", "'scripts/{0}.json'", ".", "format", "...
Get file from Gitlab. Args: region (str): AWS Region to find AMI ID. Returns: str: Contents in json format.
[ "Get", "file", "from", "Gitlab", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/lookups.py#L62-L77
foremast/foremast
src/foremast/utils/lookups.py
_get_ami_dict
def _get_ami_dict(json_url): """Get ami from a web url. Args: region (str): AWS Region to find AMI ID. Returns: dict: Contents in dictionary format. """ LOG.info("Getting AMI from %s", json_url) response = requests.get(json_url) assert response.ok, "Error getting ami info ...
python
def _get_ami_dict(json_url): """Get ami from a web url. Args: region (str): AWS Region to find AMI ID. Returns: dict: Contents in dictionary format. """ LOG.info("Getting AMI from %s", json_url) response = requests.get(json_url) assert response.ok, "Error getting ami info ...
[ "def", "_get_ami_dict", "(", "json_url", ")", ":", "LOG", ".", "info", "(", "\"Getting AMI from %s\"", ",", "json_url", ")", "response", "=", "requests", ".", "get", "(", "json_url", ")", "assert", "response", ".", "ok", ",", "\"Error getting ami info from {}\""...
Get ami from a web url. Args: region (str): AWS Region to find AMI ID. Returns: dict: Contents in dictionary format.
[ "Get", "ami", "from", "a", "web", "url", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/lookups.py#L80-L95
foremast/foremast
src/foremast/utils/lookups.py
FileLookup.get_gitlab_project
def get_gitlab_project(self): """Get numerical GitLab Project ID. Returns: int: Project ID number. Raises: foremast.exceptions.GitLabApiError: GitLab responded with bad status code. """ self.server = gitlab.Gitlab(GIT_URL, private_token=...
python
def get_gitlab_project(self): """Get numerical GitLab Project ID. Returns: int: Project ID number. Raises: foremast.exceptions.GitLabApiError: GitLab responded with bad status code. """ self.server = gitlab.Gitlab(GIT_URL, private_token=...
[ "def", "get_gitlab_project", "(", "self", ")", ":", "self", ".", "server", "=", "gitlab", ".", "Gitlab", "(", "GIT_URL", ",", "private_token", "=", "GITLAB_TOKEN", ",", "api_version", "=", "4", ")", "project", "=", "self", ".", "server", ".", "projects", ...
Get numerical GitLab Project ID. Returns: int: Project ID number. Raises: foremast.exceptions.GitLabApiError: GitLab responded with bad status code.
[ "Get", "numerical", "GitLab", "Project", "ID", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/lookups.py#L121-L139
foremast/foremast
src/foremast/utils/lookups.py
FileLookup.local_file
def local_file(self, filename): """Read the local file in _self.runway_dir_. Args: filename (str): Name of file to retrieve relative to root of _runway_dir_. Returns: str: Contents of local file. Raises: FileNotFoundError: Requested ...
python
def local_file(self, filename): """Read the local file in _self.runway_dir_. Args: filename (str): Name of file to retrieve relative to root of _runway_dir_. Returns: str: Contents of local file. Raises: FileNotFoundError: Requested ...
[ "def", "local_file", "(", "self", ",", "filename", ")", ":", "LOG", ".", "info", "(", "'Retrieving \"%s\" from \"%s\".'", ",", "filename", ",", "self", ".", "runway_dir", ")", "file_contents", "=", "''", "file_path", "=", "os", ".", "path", ".", "join", "(...
Read the local file in _self.runway_dir_. Args: filename (str): Name of file to retrieve relative to root of _runway_dir_. Returns: str: Contents of local file. Raises: FileNotFoundError: Requested file missing.
[ "Read", "the", "local", "file", "in", "_self", ".", "runway_dir_", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/lookups.py#L141-L169
foremast/foremast
src/foremast/utils/lookups.py
FileLookup.remote_file
def remote_file(self, branch='master', filename=''): """Read the remote file on Git Server. Args: branch (str): Git Branch to find file. filename (str): Name of file to retrieve relative to root of repository. Returns: str: Contents of remote...
python
def remote_file(self, branch='master', filename=''): """Read the remote file on Git Server. Args: branch (str): Git Branch to find file. filename (str): Name of file to retrieve relative to root of repository. Returns: str: Contents of remote...
[ "def", "remote_file", "(", "self", ",", "branch", "=", "'master'", ",", "filename", "=", "''", ")", ":", "LOG", ".", "info", "(", "'Retrieving \"%s\" from \"%s\".'", ",", "filename", ",", "self", ".", "git_short", ")", "file_contents", "=", "''", "try", ":...
Read the remote file on Git Server. Args: branch (str): Git Branch to find file. filename (str): Name of file to retrieve relative to root of repository. Returns: str: Contents of remote file. Raises: FileNotFoundError: Requested...
[ "Read", "the", "remote", "file", "on", "Git", "Server", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/lookups.py#L171-L205
foremast/foremast
src/foremast/utils/lookups.py
FileLookup.get
def get(self, branch='master', filename=''): """Retrieve _filename_ from GitLab. Args: branch (str): Git Branch to find file. filename (str): Name of file to retrieve relative to root of Git repository, or _runway_dir_ if specified. Returns: ...
python
def get(self, branch='master', filename=''): """Retrieve _filename_ from GitLab. Args: branch (str): Git Branch to find file. filename (str): Name of file to retrieve relative to root of Git repository, or _runway_dir_ if specified. Returns: ...
[ "def", "get", "(", "self", ",", "branch", "=", "'master'", ",", "filename", "=", "''", ")", ":", "file_contents", "=", "''", "if", "self", ".", "runway_dir", ":", "file_contents", "=", "self", ".", "local_file", "(", "filename", "=", "filename", ")", "...
Retrieve _filename_ from GitLab. Args: branch (str): Git Branch to find file. filename (str): Name of file to retrieve relative to root of Git repository, or _runway_dir_ if specified. Returns: str: Contents of file.
[ "Retrieve", "_filename_", "from", "GitLab", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/lookups.py#L207-L226
foremast/foremast
src/foremast/utils/lookups.py
FileLookup.json
def json(self, branch='master', filename=''): """Retrieve _filename_ from GitLab. Args: branch (str): Git Branch to find file. filename (str): Name of file to retrieve. Returns: dict: Decoded JSON. Raises: SystemExit: Invalid JSON provid...
python
def json(self, branch='master', filename=''): """Retrieve _filename_ from GitLab. Args: branch (str): Git Branch to find file. filename (str): Name of file to retrieve. Returns: dict: Decoded JSON. Raises: SystemExit: Invalid JSON provid...
[ "def", "json", "(", "self", ",", "branch", "=", "'master'", ",", "filename", "=", "''", ")", ":", "file_contents", "=", "self", ".", "get", "(", "branch", "=", "branch", ",", "filename", "=", "filename", ")", "try", ":", "json_dict", "=", "json", "."...
Retrieve _filename_ from GitLab. Args: branch (str): Git Branch to find file. filename (str): Name of file to retrieve. Returns: dict: Decoded JSON. Raises: SystemExit: Invalid JSON provided.
[ "Retrieve", "_filename_", "from", "GitLab", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/lookups.py#L228-L256
foremast/foremast
src/foremast/utils/banners.py
banner
def banner(text, border='=', width=80): """Center _text_ in a banner _width_ wide with _border_ characters. Args: text (str): What to write in the banner border (str): Border character width (int): How long the border should be """ text_padding = '{0:^%d}' % (width) LOG.info...
python
def banner(text, border='=', width=80): """Center _text_ in a banner _width_ wide with _border_ characters. Args: text (str): What to write in the banner border (str): Border character width (int): How long the border should be """ text_padding = '{0:^%d}' % (width) LOG.info...
[ "def", "banner", "(", "text", ",", "border", "=", "'='", ",", "width", "=", "80", ")", ":", "text_padding", "=", "'{0:^%d}'", "%", "(", "width", ")", "LOG", ".", "info", "(", "border", "*", "width", ")", "LOG", ".", "info", "(", "text_padding", "."...
Center _text_ in a banner _width_ wide with _border_ characters. Args: text (str): What to write in the banner border (str): Border character width (int): How long the border should be
[ "Center", "_text_", "in", "a", "banner", "_width_", "wide", "with", "_border_", "characters", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/banners.py#L30-L41
foremast/foremast
src/foremast/utils/get_sns_topic_arn.py
get_sns_topic_arn
def get_sns_topic_arn(topic_name, account, region): """Get SNS topic ARN. Args: topic_name (str): Name of the topic to lookup. account (str): Environment, e.g. dev region (str): Region name, e.g. us-east-1 Returns: str: ARN for requested topic name """ if topic_nam...
python
def get_sns_topic_arn(topic_name, account, region): """Get SNS topic ARN. Args: topic_name (str): Name of the topic to lookup. account (str): Environment, e.g. dev region (str): Region name, e.g. us-east-1 Returns: str: ARN for requested topic name """ if topic_nam...
[ "def", "get_sns_topic_arn", "(", "topic_name", ",", "account", ",", "region", ")", ":", "if", "topic_name", ".", "count", "(", "':'", ")", "==", "5", "and", "topic_name", ".", "startswith", "(", "'arn:aws:sns:'", ")", ":", "return", "topic_name", "session", ...
Get SNS topic ARN. Args: topic_name (str): Name of the topic to lookup. account (str): Environment, e.g. dev region (str): Region name, e.g. us-east-1 Returns: str: ARN for requested topic name
[ "Get", "SNS", "topic", "ARN", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/get_sns_topic_arn.py#L11-L39
foremast/foremast
src/foremast/slacknotify/slack_notification.py
SlackNotification.post_message
def post_message(self): """Send templated message to **#deployments-{env}**. Primarily for production deployments. """ message = get_template(template_file='slack/pipeline-prepare-ran.j2', info=self.info) channel = '#deployments-prod' post_slack_message(message=message, ...
python
def post_message(self): """Send templated message to **#deployments-{env}**. Primarily for production deployments. """ message = get_template(template_file='slack/pipeline-prepare-ran.j2', info=self.info) channel = '#deployments-prod' post_slack_message(message=message, ...
[ "def", "post_message", "(", "self", ")", ":", "message", "=", "get_template", "(", "template_file", "=", "'slack/pipeline-prepare-ran.j2'", ",", "info", "=", "self", ".", "info", ")", "channel", "=", "'#deployments-prod'", "post_slack_message", "(", "message", "="...
Send templated message to **#deployments-{env}**. Primarily for production deployments.
[ "Send", "templated", "message", "to", "**", "#deployments", "-", "{", "env", "}", "**", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/slacknotify/slack_notification.py#L45-L52
foremast/foremast
src/foremast/slacknotify/slack_notification.py
SlackNotification.notify_slack_channel
def notify_slack_channel(self): """Post message to a defined Slack channel.""" message = get_template(template_file='slack/pipeline-prepare-ran.j2', info=self.info) if self.settings['pipeline']['notifications']['slack']: post_slack_message( message=message, ...
python
def notify_slack_channel(self): """Post message to a defined Slack channel.""" message = get_template(template_file='slack/pipeline-prepare-ran.j2', info=self.info) if self.settings['pipeline']['notifications']['slack']: post_slack_message( message=message, ...
[ "def", "notify_slack_channel", "(", "self", ")", ":", "message", "=", "get_template", "(", "template_file", "=", "'slack/pipeline-prepare-ran.j2'", ",", "info", "=", "self", ".", "info", ")", "if", "self", ".", "settings", "[", "'pipeline'", "]", "[", "'notifi...
Post message to a defined Slack channel.
[ "Post", "message", "to", "a", "defined", "Slack", "channel", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/slacknotify/slack_notification.py#L54-L63
foremast/foremast
src/foremast/utils/properties.py
get_properties
def get_properties(properties_file='raw.properties.json', env=None, region=None): """Get contents of _properties_file_ for the _env_. Args: properties_file (str): File name of `create-configs` JSON output. env (str): Environment to read optionally. region (str): Region to get specific c...
python
def get_properties(properties_file='raw.properties.json', env=None, region=None): """Get contents of _properties_file_ for the _env_. Args: properties_file (str): File name of `create-configs` JSON output. env (str): Environment to read optionally. region (str): Region to get specific c...
[ "def", "get_properties", "(", "properties_file", "=", "'raw.properties.json'", ",", "env", "=", "None", ",", "region", "=", "None", ")", ":", "with", "open", "(", "properties_file", ",", "'rt'", ")", "as", "file_handle", ":", "properties", "=", "json", ".", ...
Get contents of _properties_file_ for the _env_. Args: properties_file (str): File name of `create-configs` JSON output. env (str): Environment to read optionally. region (str): Region to get specific configs for. Returns: dict: JSON loaded Application properties for _env_. ...
[ "Get", "contents", "of", "_properties_file_", "for", "the", "_env_", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/properties.py#L23-L42
foremast/foremast
src/foremast/elb/destroy_elb/__main__.py
main
def main(): """Destroy any ELB related Resources.""" logging.basicConfig(format=LOGGING_FORMAT) parser = argparse.ArgumentParser(description=main.__doc__) add_debug(parser) add_app(parser) add_env(parser) add_region(parser) args = parser.parse_args() logging.getLogger(__package__.s...
python
def main(): """Destroy any ELB related Resources.""" logging.basicConfig(format=LOGGING_FORMAT) parser = argparse.ArgumentParser(description=main.__doc__) add_debug(parser) add_app(parser) add_env(parser) add_region(parser) args = parser.parse_args() logging.getLogger(__package__.s...
[ "def", "main", "(", ")", ":", "logging", ".", "basicConfig", "(", "format", "=", "LOGGING_FORMAT", ")", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "main", ".", "__doc__", ")", "add_debug", "(", "parser", ")", "add_app", "(",...
Destroy any ELB related Resources.
[ "Destroy", "any", "ELB", "related", "Resources", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/elb/destroy_elb/__main__.py#L27-L40
foremast/foremast
src/foremast/utils/security_group.py
get_security_group_id
def get_security_group_id(name='', env='', region=''): """Get a security group ID. Args: name (str): Security Group name to find. env (str): Deployment environment to search. region (str): AWS Region to search. Returns: str: ID of Security Group, e.g. sg-xxxx. Raises: ...
python
def get_security_group_id(name='', env='', region=''): """Get a security group ID. Args: name (str): Security Group name to find. env (str): Deployment environment to search. region (str): AWS Region to search. Returns: str: ID of Security Group, e.g. sg-xxxx. Raises: ...
[ "def", "get_security_group_id", "(", "name", "=", "''", ",", "env", "=", "''", ",", "region", "=", "''", ")", ":", "vpc_id", "=", "get_vpc_id", "(", "env", ",", "region", ")", "LOG", ".", "info", "(", "'Find %s sg in %s [%s] in %s'", ",", "name", ",", ...
Get a security group ID. Args: name (str): Security Group name to find. env (str): Deployment environment to search. region (str): AWS Region to search. Returns: str: ID of Security Group, e.g. sg-xxxx. Raises: AssertionError: Call to Gate API was not successful. ...
[ "Get", "a", "security", "group", "ID", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/security_group.py#L30-L63
foremast/foremast
src/foremast/utils/security_group.py
remove_duplicate_sg
def remove_duplicate_sg(security_groups): """Removes duplicate Security Groups that share a same name alias Args: security_groups (list): A list of security group id to compare against SECURITYGROUP_REPLACEMENTS Returns: security_groups (list): A list of security groups with duplicate alia...
python
def remove_duplicate_sg(security_groups): """Removes duplicate Security Groups that share a same name alias Args: security_groups (list): A list of security group id to compare against SECURITYGROUP_REPLACEMENTS Returns: security_groups (list): A list of security groups with duplicate alia...
[ "def", "remove_duplicate_sg", "(", "security_groups", ")", ":", "for", "each_sg", ",", "duplicate_sg_name", "in", "SECURITYGROUP_REPLACEMENTS", ".", "items", "(", ")", ":", "if", "each_sg", "in", "security_groups", "and", "duplicate_sg_name", "in", "security_groups", ...
Removes duplicate Security Groups that share a same name alias Args: security_groups (list): A list of security group id to compare against SECURITYGROUP_REPLACEMENTS Returns: security_groups (list): A list of security groups with duplicate aliases removed
[ "Removes", "duplicate", "Security", "Groups", "that", "share", "a", "same", "name", "alias" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/security_group.py#L66-L80
foremast/foremast
src/foremast/utils/encoding.py
generate_encoded_user_data
def generate_encoded_user_data( env='dev', region='us-east-1', generated=None, group_name='', pipeline_type='', canary=False, ): r"""Generate base64 encoded User Data. Args: env (str): Deployment environment, e.g. dev, stage. region (str): AWS Reg...
python
def generate_encoded_user_data( env='dev', region='us-east-1', generated=None, group_name='', pipeline_type='', canary=False, ): r"""Generate base64 encoded User Data. Args: env (str): Deployment environment, e.g. dev, stage. region (str): AWS Reg...
[ "def", "generate_encoded_user_data", "(", "env", "=", "'dev'", ",", "region", "=", "'us-east-1'", ",", "generated", "=", "None", ",", "group_name", "=", "''", ",", "pipeline_type", "=", "''", ",", "canary", "=", "False", ",", ")", ":", "# We need to handle t...
r"""Generate base64 encoded User Data. Args: env (str): Deployment environment, e.g. dev, stage. region (str): AWS Region, e.g. us-east-1. generated (gogoutils.Generator): Generated naming formats. group_name (str): Application group nane, e.g. core. pipeline_type (str): Typ...
[ "r", "Generate", "base64", "encoded", "User", "Data", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/encoding.py#L22-L74
foremast/foremast
src/foremast/runner.py
prepare_infrastructure
def prepare_infrastructure(): """Entry point for preparing the infrastructure in a specific env.""" runner = ForemastRunner() runner.write_configs() runner.create_app() archaius = runner.configs[runner.env]['app']['archaius_enabled'] eureka = runner.configs[runner.env]['app']['eureka_enabled']...
python
def prepare_infrastructure(): """Entry point for preparing the infrastructure in a specific env.""" runner = ForemastRunner() runner.write_configs() runner.create_app() archaius = runner.configs[runner.env]['app']['archaius_enabled'] eureka = runner.configs[runner.env]['app']['eureka_enabled']...
[ "def", "prepare_infrastructure", "(", ")", ":", "runner", "=", "ForemastRunner", "(", ")", "runner", ".", "write_configs", "(", ")", "runner", ".", "create_app", "(", ")", "archaius", "=", "runner", ".", "configs", "[", "runner", ".", "env", "]", "[", "'...
Entry point for preparing the infrastructure in a specific env.
[ "Entry", "point", "for", "preparing", "the", "infrastructure", "in", "a", "specific", "env", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L250-L283
foremast/foremast
src/foremast/runner.py
prepare_app_pipeline
def prepare_app_pipeline(): """Entry point for application setup and initial pipeline in Spinnaker.""" runner = ForemastRunner() runner.write_configs() runner.create_app() runner.create_pipeline() runner.cleanup()
python
def prepare_app_pipeline(): """Entry point for application setup and initial pipeline in Spinnaker.""" runner = ForemastRunner() runner.write_configs() runner.create_app() runner.create_pipeline() runner.cleanup()
[ "def", "prepare_app_pipeline", "(", ")", ":", "runner", "=", "ForemastRunner", "(", ")", "runner", ".", "write_configs", "(", ")", "runner", ".", "create_app", "(", ")", "runner", ".", "create_pipeline", "(", ")", "runner", ".", "cleanup", "(", ")" ]
Entry point for application setup and initial pipeline in Spinnaker.
[ "Entry", "point", "for", "application", "setup", "and", "initial", "pipeline", "in", "Spinnaker", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L286-L292
foremast/foremast
src/foremast/runner.py
prepare_onetime_pipeline
def prepare_onetime_pipeline(): """Entry point for single use pipeline setup in the defined app.""" runner = ForemastRunner() runner.write_configs() runner.create_pipeline(onetime=os.getenv('ENV')) runner.cleanup()
python
def prepare_onetime_pipeline(): """Entry point for single use pipeline setup in the defined app.""" runner = ForemastRunner() runner.write_configs() runner.create_pipeline(onetime=os.getenv('ENV')) runner.cleanup()
[ "def", "prepare_onetime_pipeline", "(", ")", ":", "runner", "=", "ForemastRunner", "(", ")", "runner", ".", "write_configs", "(", ")", "runner", ".", "create_pipeline", "(", "onetime", "=", "os", ".", "getenv", "(", "'ENV'", ")", ")", "runner", ".", "clean...
Entry point for single use pipeline setup in the defined app.
[ "Entry", "point", "for", "single", "use", "pipeline", "setup", "in", "the", "defined", "app", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L295-L300
foremast/foremast
src/foremast/runner.py
rebuild_pipelines
def rebuild_pipelines(*args): """Entry point for rebuilding pipelines. Use to rebuild all pipelines or a specific group. """ rebuild_all = False rebuild_project = os.getenv("REBUILD_PROJECT") if args: LOG.debug('Incoming arguments: %s', args) command_args, *_ = args reb...
python
def rebuild_pipelines(*args): """Entry point for rebuilding pipelines. Use to rebuild all pipelines or a specific group. """ rebuild_all = False rebuild_project = os.getenv("REBUILD_PROJECT") if args: LOG.debug('Incoming arguments: %s', args) command_args, *_ = args reb...
[ "def", "rebuild_pipelines", "(", "*", "args", ")", ":", "rebuild_all", "=", "False", "rebuild_project", "=", "os", ".", "getenv", "(", "\"REBUILD_PROJECT\"", ")", "if", "args", ":", "LOG", ".", "debug", "(", "'Incoming arguments: %s'", ",", "args", ")", "com...
Entry point for rebuilding pipelines. Use to rebuild all pipelines or a specific group.
[ "Entry", "point", "for", "rebuilding", "pipelines", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L311-L355
foremast/foremast
src/foremast/runner.py
debug_flag
def debug_flag(): """Set logging level for entry points.""" logging.basicConfig(format=consts.LOGGING_FORMAT) parser = argparse.ArgumentParser(description=debug_flag.__doc__) add_debug(parser) args, _extra_args = parser.parse_known_args() package, *_ = __package__.split('.') logging.getLog...
python
def debug_flag(): """Set logging level for entry points.""" logging.basicConfig(format=consts.LOGGING_FORMAT) parser = argparse.ArgumentParser(description=debug_flag.__doc__) add_debug(parser) args, _extra_args = parser.parse_known_args() package, *_ = __package__.split('.') logging.getLog...
[ "def", "debug_flag", "(", ")", ":", "logging", ".", "basicConfig", "(", "format", "=", "consts", ".", "LOGGING_FORMAT", ")", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "debug_flag", ".", "__doc__", ")", "add_debug", "(", "pars...
Set logging level for entry points.
[ "Set", "logging", "level", "for", "entry", "points", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L372-L381
foremast/foremast
src/foremast/runner.py
ForemastRunner.write_configs
def write_configs(self): """Generate the configurations needed for pipes.""" utils.banner("Generating Configs") if not self.runway_dir: app_configs = configs.process_git_configs(git_short=self.git_short) else: app_configs = configs.process_runway_configs(runway_di...
python
def write_configs(self): """Generate the configurations needed for pipes.""" utils.banner("Generating Configs") if not self.runway_dir: app_configs = configs.process_git_configs(git_short=self.git_short) else: app_configs = configs.process_runway_configs(runway_di...
[ "def", "write_configs", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Generating Configs\"", ")", "if", "not", "self", ".", "runway_dir", ":", "app_configs", "=", "configs", ".", "process_git_configs", "(", "git_short", "=", "self", ".", "git_short", ...
Generate the configurations needed for pipes.
[ "Generate", "the", "configurations", "needed", "for", "pipes", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L72-L81
foremast/foremast
src/foremast/runner.py
ForemastRunner.create_app
def create_app(self): """Create the spinnaker application.""" utils.banner("Creating Spinnaker App") spinnakerapp = app.SpinnakerApp(app=self.app, email=self.email, project=self.group, repo=self.repo, pipeline_config=self.configs['pipeline']) spinn...
python
def create_app(self): """Create the spinnaker application.""" utils.banner("Creating Spinnaker App") spinnakerapp = app.SpinnakerApp(app=self.app, email=self.email, project=self.group, repo=self.repo, pipeline_config=self.configs['pipeline']) spinn...
[ "def", "create_app", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Creating Spinnaker App\"", ")", "spinnakerapp", "=", "app", ".", "SpinnakerApp", "(", "app", "=", "self", ".", "app", ",", "email", "=", "self", ".", "email", ",", "project", "="...
Create the spinnaker application.
[ "Create", "the", "spinnaker", "application", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L83-L88
foremast/foremast
src/foremast/runner.py
ForemastRunner.create_pipeline
def create_pipeline(self, onetime=None): """Create the spinnaker pipeline(s).""" utils.banner("Creating Pipeline") kwargs = { 'app': self.app, 'trigger_job': self.trigger_job, 'prop_path': self.json_path, 'base': None, 'runway_dir': se...
python
def create_pipeline(self, onetime=None): """Create the spinnaker pipeline(s).""" utils.banner("Creating Pipeline") kwargs = { 'app': self.app, 'trigger_job': self.trigger_job, 'prop_path': self.json_path, 'base': None, 'runway_dir': se...
[ "def", "create_pipeline", "(", "self", ",", "onetime", "=", "None", ")", ":", "utils", ".", "banner", "(", "\"Creating Pipeline\"", ")", "kwargs", "=", "{", "'app'", ":", "self", ".", "app", ",", "'trigger_job'", ":", "self", ".", "trigger_job", ",", "'p...
Create the spinnaker pipeline(s).
[ "Create", "the", "spinnaker", "pipeline", "(", "s", ")", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L90-L122
foremast/foremast
src/foremast/runner.py
ForemastRunner.create_iam
def create_iam(self): """Create IAM resources.""" utils.banner("Creating IAM") iam.create_iam_resources(env=self.env, app=self.app)
python
def create_iam(self): """Create IAM resources.""" utils.banner("Creating IAM") iam.create_iam_resources(env=self.env, app=self.app)
[ "def", "create_iam", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Creating IAM\"", ")", "iam", ".", "create_iam_resources", "(", "env", "=", "self", ".", "env", ",", "app", "=", "self", ".", "app", ")" ]
Create IAM resources.
[ "Create", "IAM", "resources", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L124-L127
foremast/foremast
src/foremast/runner.py
ForemastRunner.create_archaius
def create_archaius(self): """Create S3 bucket for Archaius.""" utils.banner("Creating S3") s3.init_properties(env=self.env, app=self.app)
python
def create_archaius(self): """Create S3 bucket for Archaius.""" utils.banner("Creating S3") s3.init_properties(env=self.env, app=self.app)
[ "def", "create_archaius", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Creating S3\"", ")", "s3", ".", "init_properties", "(", "env", "=", "self", ".", "env", ",", "app", "=", "self", ".", "app", ")" ]
Create S3 bucket for Archaius.
[ "Create", "S3", "bucket", "for", "Archaius", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L129-L132
foremast/foremast
src/foremast/runner.py
ForemastRunner.create_s3app
def create_s3app(self): """Create S3 infra for s3 applications""" utils.banner("Creating S3 App Infrastructure") primary_region = self.configs['pipeline']['primary_region'] s3obj = s3.S3Apps(app=self.app, env=self.env, region=self.regio...
python
def create_s3app(self): """Create S3 infra for s3 applications""" utils.banner("Creating S3 App Infrastructure") primary_region = self.configs['pipeline']['primary_region'] s3obj = s3.S3Apps(app=self.app, env=self.env, region=self.regio...
[ "def", "create_s3app", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Creating S3 App Infrastructure\"", ")", "primary_region", "=", "self", ".", "configs", "[", "'pipeline'", "]", "[", "'primary_region'", "]", "s3obj", "=", "s3", ".", "S3Apps", "(", ...
Create S3 infra for s3 applications
[ "Create", "S3", "infra", "for", "s3", "applications" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L134-L143
foremast/foremast
src/foremast/runner.py
ForemastRunner.deploy_s3app
def deploy_s3app(self): """Deploys artifacts contents to S3 bucket""" utils.banner("Deploying S3 App") primary_region = self.configs['pipeline']['primary_region'] s3obj = s3.S3Deployment( app=self.app, env=self.env, region=self.region, prop...
python
def deploy_s3app(self): """Deploys artifacts contents to S3 bucket""" utils.banner("Deploying S3 App") primary_region = self.configs['pipeline']['primary_region'] s3obj = s3.S3Deployment( app=self.app, env=self.env, region=self.region, prop...
[ "def", "deploy_s3app", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Deploying S3 App\"", ")", "primary_region", "=", "self", ".", "configs", "[", "'pipeline'", "]", "[", "'primary_region'", "]", "s3obj", "=", "s3", ".", "S3Deployment", "(", "app", ...
Deploys artifacts contents to S3 bucket
[ "Deploys", "artifacts", "contents", "to", "S3", "bucket" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L145-L157
foremast/foremast
src/foremast/runner.py
ForemastRunner.promote_s3app
def promote_s3app(self): """promotes S3 deployment to LATEST""" utils.banner("Promoting S3 App") primary_region = self.configs['pipeline']['primary_region'] s3obj = s3.S3Deployment( app=self.app, env=self.env, region=self.region, prop_path=...
python
def promote_s3app(self): """promotes S3 deployment to LATEST""" utils.banner("Promoting S3 App") primary_region = self.configs['pipeline']['primary_region'] s3obj = s3.S3Deployment( app=self.app, env=self.env, region=self.region, prop_path=...
[ "def", "promote_s3app", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Promoting S3 App\"", ")", "primary_region", "=", "self", ".", "configs", "[", "'pipeline'", "]", "[", "'primary_region'", "]", "s3obj", "=", "s3", ".", "S3Deployment", "(", "app",...
promotes S3 deployment to LATEST
[ "promotes", "S3", "deployment", "to", "LATEST" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L159-L171
foremast/foremast
src/foremast/runner.py
ForemastRunner.create_secgroups
def create_secgroups(self): """Create security groups as defined in the configs.""" utils.banner("Creating Security Group") sgobj = securitygroup.SpinnakerSecurityGroup( app=self.app, env=self.env, region=self.region, prop_path=self.json_path) sgobj.create_security_group()
python
def create_secgroups(self): """Create security groups as defined in the configs.""" utils.banner("Creating Security Group") sgobj = securitygroup.SpinnakerSecurityGroup( app=self.app, env=self.env, region=self.region, prop_path=self.json_path) sgobj.create_security_group()
[ "def", "create_secgroups", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Creating Security Group\"", ")", "sgobj", "=", "securitygroup", ".", "SpinnakerSecurityGroup", "(", "app", "=", "self", ".", "app", ",", "env", "=", "self", ".", "env", ",", ...
Create security groups as defined in the configs.
[ "Create", "security", "groups", "as", "defined", "in", "the", "configs", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L173-L178
foremast/foremast
src/foremast/runner.py
ForemastRunner.create_awslambda
def create_awslambda(self): """Create security groups as defined in the configs.""" utils.banner("Creating Lambda Function") awslambdaobj = awslambda.LambdaFunction( app=self.app, env=self.env, region=self.region, prop_path=self.json_path) awslambdaobj.create_lambda_function(...
python
def create_awslambda(self): """Create security groups as defined in the configs.""" utils.banner("Creating Lambda Function") awslambdaobj = awslambda.LambdaFunction( app=self.app, env=self.env, region=self.region, prop_path=self.json_path) awslambdaobj.create_lambda_function(...
[ "def", "create_awslambda", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Creating Lambda Function\"", ")", "awslambdaobj", "=", "awslambda", ".", "LambdaFunction", "(", "app", "=", "self", ".", "app", ",", "env", "=", "self", ".", "env", ",", "reg...
Create security groups as defined in the configs.
[ "Create", "security", "groups", "as", "defined", "in", "the", "configs", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L180-L189
foremast/foremast
src/foremast/runner.py
ForemastRunner.create_elb
def create_elb(self): """Create the ELB for the defined environment.""" utils.banner("Creating ELB") elbobj = elb.SpinnakerELB(app=self.app, env=self.env, region=self.region, prop_path=self.json_path) elbobj.create_elb()
python
def create_elb(self): """Create the ELB for the defined environment.""" utils.banner("Creating ELB") elbobj = elb.SpinnakerELB(app=self.app, env=self.env, region=self.region, prop_path=self.json_path) elbobj.create_elb()
[ "def", "create_elb", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Creating ELB\"", ")", "elbobj", "=", "elb", ".", "SpinnakerELB", "(", "app", "=", "self", ".", "app", ",", "env", "=", "self", ".", "env", ",", "region", "=", "self", ".", ...
Create the ELB for the defined environment.
[ "Create", "the", "ELB", "for", "the", "defined", "environment", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L191-L195
foremast/foremast
src/foremast/runner.py
ForemastRunner.create_dns
def create_dns(self): """Create DNS for the defined app and environment.""" utils.banner("Creating DNS") elb_subnet = self.configs[self.env]['elb']['subnet_purpose'] regions = self.configs[self.env]['regions'] failover = self.configs[self.env]['dns']['failover_dns'] prima...
python
def create_dns(self): """Create DNS for the defined app and environment.""" utils.banner("Creating DNS") elb_subnet = self.configs[self.env]['elb']['subnet_purpose'] regions = self.configs[self.env]['regions'] failover = self.configs[self.env]['dns']['failover_dns'] prima...
[ "def", "create_dns", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Creating DNS\"", ")", "elb_subnet", "=", "self", ".", "configs", "[", "self", ".", "env", "]", "[", "'elb'", "]", "[", "'subnet_purpose'", "]", "regions", "=", "self", ".", "co...
Create DNS for the defined app and environment.
[ "Create", "DNS", "for", "the", "defined", "app", "and", "environment", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L197-L217
foremast/foremast
src/foremast/runner.py
ForemastRunner.create_autoscaling_policy
def create_autoscaling_policy(self): """Create Scaling Policy for app in environment""" utils.banner("Creating Scaling Policy") policyobj = autoscaling_policy.AutoScalingPolicy( app=self.app, env=self.env, region=self.region, prop_path=self.json_path) policyobj.create_policy(...
python
def create_autoscaling_policy(self): """Create Scaling Policy for app in environment""" utils.banner("Creating Scaling Policy") policyobj = autoscaling_policy.AutoScalingPolicy( app=self.app, env=self.env, region=self.region, prop_path=self.json_path) policyobj.create_policy(...
[ "def", "create_autoscaling_policy", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Creating Scaling Policy\"", ")", "policyobj", "=", "autoscaling_policy", ".", "AutoScalingPolicy", "(", "app", "=", "self", ".", "app", ",", "env", "=", "self", ".", "en...
Create Scaling Policy for app in environment
[ "Create", "Scaling", "Policy", "for", "app", "in", "environment" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L219-L224
foremast/foremast
src/foremast/runner.py
ForemastRunner.create_datapipeline
def create_datapipeline(self): """Creates data pipeline and adds definition""" utils.banner("Creating Data Pipeline") dpobj = datapipeline.AWSDataPipeline(app=self.app, env=self.env, region=self.region, prop_path=self.json_path) dpobj.create_datapipeline() dpobj.set_pipeline_defi...
python
def create_datapipeline(self): """Creates data pipeline and adds definition""" utils.banner("Creating Data Pipeline") dpobj = datapipeline.AWSDataPipeline(app=self.app, env=self.env, region=self.region, prop_path=self.json_path) dpobj.create_datapipeline() dpobj.set_pipeline_defi...
[ "def", "create_datapipeline", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Creating Data Pipeline\"", ")", "dpobj", "=", "datapipeline", ".", "AWSDataPipeline", "(", "app", "=", "self", ".", "app", ",", "env", "=", "self", ".", "env", ",", "regio...
Creates data pipeline and adds definition
[ "Creates", "data", "pipeline", "and", "adds", "definition" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L226-L233
foremast/foremast
src/foremast/runner.py
ForemastRunner.slack_notify
def slack_notify(self): """Send out a slack notification.""" utils.banner("Sending slack notification") if self.env.startswith("prod"): notify = slacknotify.SlackNotification(app=self.app, env=self.env, prop_path=self.json_path) notify.post_message() else: ...
python
def slack_notify(self): """Send out a slack notification.""" utils.banner("Sending slack notification") if self.env.startswith("prod"): notify = slacknotify.SlackNotification(app=self.app, env=self.env, prop_path=self.json_path) notify.post_message() else: ...
[ "def", "slack_notify", "(", "self", ")", ":", "utils", ".", "banner", "(", "\"Sending slack notification\"", ")", "if", "self", ".", "env", ".", "startswith", "(", "\"prod\"", ")", ":", "notify", "=", "slacknotify", ".", "SlackNotification", "(", "app", "=",...
Send out a slack notification.
[ "Send", "out", "a", "slack", "notification", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/runner.py#L235-L243
foremast/foremast
src/foremast/args.py
add_debug
def add_debug(parser): """Add a `debug` flag to the _parser_.""" parser.add_argument( '-d', '--debug', action='store_const', const=logging.DEBUG, default=logging.INFO, help='Set DEBUG output')
python
def add_debug(parser): """Add a `debug` flag to the _parser_.""" parser.add_argument( '-d', '--debug', action='store_const', const=logging.DEBUG, default=logging.INFO, help='Set DEBUG output')
[ "def", "add_debug", "(", "parser", ")", ":", "parser", ".", "add_argument", "(", "'-d'", ",", "'--debug'", ",", "action", "=", "'store_const'", ",", "const", "=", "logging", ".", "DEBUG", ",", "default", "=", "logging", ".", "INFO", ",", "help", "=", "...
Add a `debug` flag to the _parser_.
[ "Add", "a", "debug", "flag", "to", "the", "_parser_", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/args.py#L28-L31
foremast/foremast
src/foremast/args.py
add_env
def add_env(parser): """Add an `env` flag to the _parser_.""" parser.add_argument( '-e', '--env', choices=ENVS, default=os.getenv('ENV', default='dev'), help='Deploy environment, overrides $ENV')
python
def add_env(parser): """Add an `env` flag to the _parser_.""" parser.add_argument( '-e', '--env', choices=ENVS, default=os.getenv('ENV', default='dev'), help='Deploy environment, overrides $ENV')
[ "def", "add_env", "(", "parser", ")", ":", "parser", ".", "add_argument", "(", "'-e'", ",", "'--env'", ",", "choices", "=", "ENVS", ",", "default", "=", "os", ".", "getenv", "(", "'ENV'", ",", "default", "=", "'dev'", ")", ",", "help", "=", "'Deploy ...
Add an `env` flag to the _parser_.
[ "Add", "an", "env", "flag", "to", "the", "_parser_", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/args.py#L34-L37
foremast/foremast
src/foremast/autoscaling_policy/__main__.py
main
def main(): """CLI entrypoint for scaling policy creation""" logging.basicConfig(format=LOGGING_FORMAT) log = logging.getLogger(__name__) parser = argparse.ArgumentParser() add_debug(parser) add_app(parser) add_properties(parser) add_env(parser) add_region(parser) args = parser....
python
def main(): """CLI entrypoint for scaling policy creation""" logging.basicConfig(format=LOGGING_FORMAT) log = logging.getLogger(__name__) parser = argparse.ArgumentParser() add_debug(parser) add_app(parser) add_properties(parser) add_env(parser) add_region(parser) args = parser....
[ "def", "main", "(", ")", ":", "logging", ".", "basicConfig", "(", "format", "=", "LOGGING_FORMAT", ")", "log", "=", "logging", ".", "getLogger", "(", "__name__", ")", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "add_debug", "(", "parser", ...
CLI entrypoint for scaling policy creation
[ "CLI", "entrypoint", "for", "scaling", "policy", "creation" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/autoscaling_policy/__main__.py#L29-L48
foremast/foremast
src/foremast/awslambda/__main__.py
main
def main(): """Create Lambda events.""" logging.basicConfig(format=LOGGING_FORMAT) log = logging.getLogger(__name__) parser = argparse.ArgumentParser(description=main.__doc__) add_debug(parser) add_app(parser) add_env(parser) add_properties(parser) add_region(parser) args = pars...
python
def main(): """Create Lambda events.""" logging.basicConfig(format=LOGGING_FORMAT) log = logging.getLogger(__name__) parser = argparse.ArgumentParser(description=main.__doc__) add_debug(parser) add_app(parser) add_env(parser) add_properties(parser) add_region(parser) args = pars...
[ "def", "main", "(", ")", ":", "logging", ".", "basicConfig", "(", "format", "=", "LOGGING_FORMAT", ")", "log", "=", "logging", ".", "getLogger", "(", "__name__", ")", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "main", ".", ...
Create Lambda events.
[ "Create", "Lambda", "events", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/awslambda/__main__.py#L29-L51
foremast/foremast
src/foremast/utils/slack.py
post_slack_message
def post_slack_message(message=None, channel=None, username=None, icon_emoji=None): """Format the message and post to the appropriate slack channel. Args: message (str): Message to post to slack channel (str): Desired channel. Must start with # """ LOG.debug('Slack Channel: %s\nSlack M...
python
def post_slack_message(message=None, channel=None, username=None, icon_emoji=None): """Format the message and post to the appropriate slack channel. Args: message (str): Message to post to slack channel (str): Desired channel. Must start with # """ LOG.debug('Slack Channel: %s\nSlack M...
[ "def", "post_slack_message", "(", "message", "=", "None", ",", "channel", "=", "None", ",", "username", "=", "None", ",", "icon_emoji", "=", "None", ")", ":", "LOG", ".", "debug", "(", "'Slack Channel: %s\\nSlack Message: %s'", ",", "channel", ",", "message", ...
Format the message and post to the appropriate slack channel. Args: message (str): Message to post to slack channel (str): Desired channel. Must start with #
[ "Format", "the", "message", "and", "post", "to", "the", "appropriate", "slack", "channel", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/slack.py#L26-L40
foremast/foremast
src/foremast/utils/generate_s3_tags.py
generated_tag_data
def generated_tag_data(tags): """Convert :obj:`dict` to S3 Tag list. Args: tags (dict): Dictonary of tag key and tag value passed. Returns: list: List of dictionaries. """ generated_tags = [] for key, value in tags.items(): generated_tags.append({ 'Key': ke...
python
def generated_tag_data(tags): """Convert :obj:`dict` to S3 Tag list. Args: tags (dict): Dictonary of tag key and tag value passed. Returns: list: List of dictionaries. """ generated_tags = [] for key, value in tags.items(): generated_tags.append({ 'Key': ke...
[ "def", "generated_tag_data", "(", "tags", ")", ":", "generated_tags", "=", "[", "]", "for", "key", ",", "value", "in", "tags", ".", "items", "(", ")", ":", "generated_tags", ".", "append", "(", "{", "'Key'", ":", "key", ",", "'Value'", ":", "value", ...
Convert :obj:`dict` to S3 Tag list. Args: tags (dict): Dictonary of tag key and tag value passed. Returns: list: List of dictionaries.
[ "Convert", ":", "obj", ":", "dict", "to", "S3", "Tag", "list", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/generate_s3_tags.py#L4-L20
foremast/foremast
src/foremast/dns/destroy_dns/destroy_dns.py
destroy_dns
def destroy_dns(app='', env='dev', **_): """Destroy DNS records. Args: app (str): Spinnaker Application name. env (str): Deployment environment. regions (str): AWS region. Returns: bool: True upon successful completion. """ client = boto3.Session(profile_name=env).c...
python
def destroy_dns(app='', env='dev', **_): """Destroy DNS records. Args: app (str): Spinnaker Application name. env (str): Deployment environment. regions (str): AWS region. Returns: bool: True upon successful completion. """ client = boto3.Session(profile_name=env).c...
[ "def", "destroy_dns", "(", "app", "=", "''", ",", "env", "=", "'dev'", ",", "*", "*", "_", ")", ":", "client", "=", "boto3", ".", "Session", "(", "profile_name", "=", "env", ")", ".", "client", "(", "'route53'", ")", "generated", "=", "get_details", ...
Destroy DNS records. Args: app (str): Spinnaker Application name. env (str): Deployment environment. regions (str): AWS region. Returns: bool: True upon successful completion.
[ "Destroy", "DNS", "records", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/dns/destroy_dns/destroy_dns.py#L27-L52
foremast/foremast
src/foremast/dns/destroy_dns/destroy_dns.py
destroy_record
def destroy_record(client=None, found_record=None, record='', zone_id=''): """Destroy an individual DNS record. Args: client (botocore.client.Route53): Route 53 boto3 client. found_record (dict): Route 53 record set:: {'Name': 'unicorn.forrest.dev.example.com.', 'Resou...
python
def destroy_record(client=None, found_record=None, record='', zone_id=''): """Destroy an individual DNS record. Args: client (botocore.client.Route53): Route 53 boto3 client. found_record (dict): Route 53 record set:: {'Name': 'unicorn.forrest.dev.example.com.', 'Resou...
[ "def", "destroy_record", "(", "client", "=", "None", ",", "found_record", "=", "None", ",", "record", "=", "''", ",", "zone_id", "=", "''", ")", ":", "LOG", ".", "debug", "(", "'Found DNS record: %s'", ",", "found_record", ")", "if", "found_record", "[", ...
Destroy an individual DNS record. Args: client (botocore.client.Route53): Route 53 boto3 client. found_record (dict): Route 53 record set:: {'Name': 'unicorn.forrest.dev.example.com.', 'ResourceRecords': [{'Value': 'internal-unicornforrest-17774...
[ "Destroy", "an", "individual", "DNS", "record", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/dns/destroy_dns/destroy_dns.py#L55-L88
foremast/foremast
src/foremast/awslambda/sns_event/sns_event.py
create_sns_event
def create_sns_event(app_name, env, region, rules): """Create SNS lambda event from rules. Args: app_name (str): name of the lambda function env (str): Environment/Account for lambda function region (str): AWS region of the lambda function rules (str): Trigger rules from the set...
python
def create_sns_event(app_name, env, region, rules): """Create SNS lambda event from rules. Args: app_name (str): name of the lambda function env (str): Environment/Account for lambda function region (str): AWS region of the lambda function rules (str): Trigger rules from the set...
[ "def", "create_sns_event", "(", "app_name", ",", "env", ",", "region", ",", "rules", ")", ":", "session", "=", "boto3", ".", "Session", "(", "profile_name", "=", "env", ",", "region_name", "=", "region", ")", "sns_client", "=", "session", ".", "client", ...
Create SNS lambda event from rules. Args: app_name (str): name of the lambda function env (str): Environment/Account for lambda function region (str): AWS region of the lambda function rules (str): Trigger rules from the settings
[ "Create", "SNS", "lambda", "event", "from", "rules", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/awslambda/sns_event/sns_event.py#L27-L58
foremast/foremast
src/foremast/awslambda/sns_event/destroy_sns_event/destroy_sns_event.py
destroy_sns_event
def destroy_sns_event(app_name, env, region): """ Destroy all Lambda SNS subscriptions. Args: app_name (str): name of the lambda function env (str): Environment/Account for lambda function region (str): AWS region of the lambda function Returns: boolean: True if subscriptio...
python
def destroy_sns_event(app_name, env, region): """ Destroy all Lambda SNS subscriptions. Args: app_name (str): name of the lambda function env (str): Environment/Account for lambda function region (str): AWS region of the lambda function Returns: boolean: True if subscriptio...
[ "def", "destroy_sns_event", "(", "app_name", ",", "env", ",", "region", ")", ":", "session", "=", "boto3", ".", "Session", "(", "profile_name", "=", "env", ",", "region_name", "=", "region", ")", "sns_client", "=", "session", ".", "client", "(", "'sns'", ...
Destroy all Lambda SNS subscriptions. Args: app_name (str): name of the lambda function env (str): Environment/Account for lambda function region (str): AWS region of the lambda function Returns: boolean: True if subscription destroyed successfully
[ "Destroy", "all", "Lambda", "SNS", "subscriptions", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/awslambda/sns_event/destroy_sns_event/destroy_sns_event.py#L27-L47
foremast/foremast
src/foremast/elb/destroy_elb/destroy_elb.py
destroy_elb
def destroy_elb(app='', env='dev', region='us-east-1', **_): """Destroy ELB Resources. Args: app (str): Spinnaker Application name. env (str): Deployment environment. region (str): AWS region. Returns: True upon successful completion. """ task_json = get_template( ...
python
def destroy_elb(app='', env='dev', region='us-east-1', **_): """Destroy ELB Resources. Args: app (str): Spinnaker Application name. env (str): Deployment environment. region (str): AWS region. Returns: True upon successful completion. """ task_json = get_template( ...
[ "def", "destroy_elb", "(", "app", "=", "''", ",", "env", "=", "'dev'", ",", "region", "=", "'us-east-1'", ",", "*", "*", "_", ")", ":", "task_json", "=", "get_template", "(", "template_file", "=", "'destroy/destroy_elb.json.j2'", ",", "app", "=", "app", ...
Destroy ELB Resources. Args: app (str): Spinnaker Application name. env (str): Deployment environment. region (str): AWS region. Returns: True upon successful completion.
[ "Destroy", "ELB", "Resources", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/elb/destroy_elb/destroy_elb.py#L21-L41
foremast/foremast
src/foremast/pipeline/clean_pipelines.py
delete_pipeline
def delete_pipeline(app='', pipeline_name=''): """Delete _pipeline_name_ from _app_.""" safe_pipeline_name = normalize_pipeline_name(name=pipeline_name) LOG.warning('Deleting Pipeline: %s', safe_pipeline_name) url = '{host}/pipelines/{app}/{pipeline}'.format(host=API_URL, app=app, pipeline=safe_pipeli...
python
def delete_pipeline(app='', pipeline_name=''): """Delete _pipeline_name_ from _app_.""" safe_pipeline_name = normalize_pipeline_name(name=pipeline_name) LOG.warning('Deleting Pipeline: %s', safe_pipeline_name) url = '{host}/pipelines/{app}/{pipeline}'.format(host=API_URL, app=app, pipeline=safe_pipeli...
[ "def", "delete_pipeline", "(", "app", "=", "''", ",", "pipeline_name", "=", "''", ")", ":", "safe_pipeline_name", "=", "normalize_pipeline_name", "(", "name", "=", "pipeline_name", ")", "LOG", ".", "warning", "(", "'Deleting Pipeline: %s'", ",", "safe_pipeline_nam...
Delete _pipeline_name_ from _app_.
[ "Delete", "_pipeline_name_", "from", "_app_", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/pipeline/clean_pipelines.py#L28-L47
foremast/foremast
src/foremast/pipeline/clean_pipelines.py
clean_pipelines
def clean_pipelines(app='', settings=None): """Delete Pipelines for regions not defined in application.json files. For Pipelines named **app_name [region]**, _region_ will need to appear in at least one application.json file. All other names are assumed unamanaged. Args: app (str): Applica...
python
def clean_pipelines(app='', settings=None): """Delete Pipelines for regions not defined in application.json files. For Pipelines named **app_name [region]**, _region_ will need to appear in at least one application.json file. All other names are assumed unamanaged. Args: app (str): Applica...
[ "def", "clean_pipelines", "(", "app", "=", "''", ",", "settings", "=", "None", ")", ":", "pipelines", "=", "get_all_pipelines", "(", "app", "=", "app", ")", "envs", "=", "settings", "[", "'pipeline'", "]", "[", "'env'", "]", "LOG", ".", "debug", "(", ...
Delete Pipelines for regions not defined in application.json files. For Pipelines named **app_name [region]**, _region_ will need to appear in at least one application.json file. All other names are assumed unamanaged. Args: app (str): Application name settings (dict): imported configu...
[ "Delete", "Pipelines", "for", "regions", "not", "defined", "in", "application", ".", "json", "files", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/pipeline/clean_pipelines.py#L50-L96
foremast/foremast
src/foremast/consts.py
validate_key_values
def validate_key_values(config_handle, section, key, default=None): """Warn when *key* is missing from configuration *section*. Args: config_handle (configparser.ConfigParser): Instance of configurations. section (str): Name of configuration section to retrieve. key (str): Configuration...
python
def validate_key_values(config_handle, section, key, default=None): """Warn when *key* is missing from configuration *section*. Args: config_handle (configparser.ConfigParser): Instance of configurations. section (str): Name of configuration section to retrieve. key (str): Configuration...
[ "def", "validate_key_values", "(", "config_handle", ",", "section", ",", "key", ",", "default", "=", "None", ")", ":", "if", "section", "not", "in", "config_handle", ":", "LOG", ".", "info", "(", "'Section missing from configurations: [%s]'", ",", "section", ")"...
Warn when *key* is missing from configuration *section*. Args: config_handle (configparser.ConfigParser): Instance of configurations. section (str): Name of configuration section to retrieve. key (str): Configuration key to look up. default (object): Default object to use when *key*...
[ "Warn", "when", "*", "key", "*", "is", "missing", "from", "configuration", "*", "section", "*", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/consts.py#L53-L74
foremast/foremast
src/foremast/consts.py
extract_formats
def extract_formats(config_handle): """Get application formats. See :class:`gogoutils.Formats` for available options. Args: config_handle (configparser.ConfigParser): Instance of configurations. Returns: dict: Formats in ``{$format_type: $format_pattern}``. """ configurations...
python
def extract_formats(config_handle): """Get application formats. See :class:`gogoutils.Formats` for available options. Args: config_handle (configparser.ConfigParser): Instance of configurations. Returns: dict: Formats in ``{$format_type: $format_pattern}``. """ configurations...
[ "def", "extract_formats", "(", "config_handle", ")", ":", "configurations", "=", "dict", "(", "config_handle", ")", "formats", "=", "dict", "(", "configurations", ".", "get", "(", "'formats'", ",", "{", "}", ")", ")", "return", "formats" ]
Get application formats. See :class:`gogoutils.Formats` for available options. Args: config_handle (configparser.ConfigParser): Instance of configurations. Returns: dict: Formats in ``{$format_type: $format_pattern}``.
[ "Get", "application", "formats", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/consts.py#L77-L91
foremast/foremast
src/foremast/consts.py
load_dynamic_config
def load_dynamic_config(config_file=DEFAULT_DYNAMIC_CONFIG_FILE): """Load and parse dynamic config""" dynamic_configurations = {} # Insert config path so we can import it sys.path.insert(0, path.dirname(path.abspath(config_file))) try: config_module = __import__('config') dynamic_c...
python
def load_dynamic_config(config_file=DEFAULT_DYNAMIC_CONFIG_FILE): """Load and parse dynamic config""" dynamic_configurations = {} # Insert config path so we can import it sys.path.insert(0, path.dirname(path.abspath(config_file))) try: config_module = __import__('config') dynamic_c...
[ "def", "load_dynamic_config", "(", "config_file", "=", "DEFAULT_DYNAMIC_CONFIG_FILE", ")", ":", "dynamic_configurations", "=", "{", "}", "# Insert config path so we can import it", "sys", ".", "path", ".", "insert", "(", "0", ",", "path", ".", "dirname", "(", "path"...
Load and parse dynamic config
[ "Load", "and", "parse", "dynamic", "config" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/consts.py#L94-L108
foremast/foremast
src/foremast/consts.py
find_config
def find_config(): """Look for **foremast.cfg** in config_locations or ``./config.py``. Raises: SystemExit: No configuration file found. Returns: dict: Found dynamic or static configuration. """ config_locations = [ '/etc/foremast/foremast.cfg', expanduser('~/.fore...
python
def find_config(): """Look for **foremast.cfg** in config_locations or ``./config.py``. Raises: SystemExit: No configuration file found. Returns: dict: Found dynamic or static configuration. """ config_locations = [ '/etc/foremast/foremast.cfg', expanduser('~/.fore...
[ "def", "find_config", "(", ")", ":", "config_locations", "=", "[", "'/etc/foremast/foremast.cfg'", ",", "expanduser", "(", "'~/.foremast/foremast.cfg'", ")", ",", "'./.foremast/foremast.cfg'", ",", "]", "configurations", "=", "ConfigParser", "(", ")", "cfg_file", "=",...
Look for **foremast.cfg** in config_locations or ``./config.py``. Raises: SystemExit: No configuration file found. Returns: dict: Found dynamic or static configuration.
[ "Look", "for", "**", "foremast", ".", "cfg", "**", "in", "config_locations", "or", ".", "/", "config", ".", "py", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/consts.py#L111-L141
foremast/foremast
src/foremast/consts.py
_remove_empty_entries
def _remove_empty_entries(entries): """Remove empty entries in a list""" valid_entries = [] for entry in set(entries): if entry: valid_entries.append(entry) return sorted(valid_entries)
python
def _remove_empty_entries(entries): """Remove empty entries in a list""" valid_entries = [] for entry in set(entries): if entry: valid_entries.append(entry) return sorted(valid_entries)
[ "def", "_remove_empty_entries", "(", "entries", ")", ":", "valid_entries", "=", "[", "]", "for", "entry", "in", "set", "(", "entries", ")", ":", "if", "entry", ":", "valid_entries", ".", "append", "(", "entry", ")", "return", "sorted", "(", "valid_entries"...
Remove empty entries in a list
[ "Remove", "empty", "entries", "in", "a", "list" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/consts.py#L144-L150
foremast/foremast
src/foremast/consts.py
_convert_string_to_native
def _convert_string_to_native(value): """Convert a string to its native python type""" result = None try: result = ast.literal_eval(str(value)) except (SyntaxError, ValueError): # Likely a string result = value.split(',') return result
python
def _convert_string_to_native(value): """Convert a string to its native python type""" result = None try: result = ast.literal_eval(str(value)) except (SyntaxError, ValueError): # Likely a string result = value.split(',') return result
[ "def", "_convert_string_to_native", "(", "value", ")", ":", "result", "=", "None", "try", ":", "result", "=", "ast", ".", "literal_eval", "(", "str", "(", "value", ")", ")", "except", "(", "SyntaxError", ",", "ValueError", ")", ":", "# Likely a string", "r...
Convert a string to its native python type
[ "Convert", "a", "string", "to", "its", "native", "python", "type" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/consts.py#L153-L162
foremast/foremast
src/foremast/consts.py
_generate_security_groups
def _generate_security_groups(config_key): """Read config file and generate security group dict by environment. Args: config_key (str): Configuration file key Returns: dict: of environments in {'env1': ['group1', 'group2']} format """ raw_default_groups = validate_key_values(CONFIG...
python
def _generate_security_groups(config_key): """Read config file and generate security group dict by environment. Args: config_key (str): Configuration file key Returns: dict: of environments in {'env1': ['group1', 'group2']} format """ raw_default_groups = validate_key_values(CONFIG...
[ "def", "_generate_security_groups", "(", "config_key", ")", ":", "raw_default_groups", "=", "validate_key_values", "(", "CONFIG", ",", "'base'", ",", "config_key", ",", "default", "=", "''", ")", "default_groups", "=", "_convert_string_to_native", "(", "raw_default_gr...
Read config file and generate security group dict by environment. Args: config_key (str): Configuration file key Returns: dict: of environments in {'env1': ['group1', 'group2']} format
[ "Read", "config", "file", "and", "generate", "security", "group", "dict", "by", "environment", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/consts.py#L165-L190
foremast/foremast
src/foremast/datapipeline/datapipeline.py
AWSDataPipeline.create_datapipeline
def create_datapipeline(self): """Creates the data pipeline if it does not already exist Returns: dict: the response of the Boto3 command """ tags = [{"key": "app_group", "value": self.group}, {"key": "app_name", "value": self.app_name}] response = self.client.c...
python
def create_datapipeline(self): """Creates the data pipeline if it does not already exist Returns: dict: the response of the Boto3 command """ tags = [{"key": "app_group", "value": self.group}, {"key": "app_name", "value": self.app_name}] response = self.client.c...
[ "def", "create_datapipeline", "(", "self", ")", ":", "tags", "=", "[", "{", "\"key\"", ":", "\"app_group\"", ",", "\"value\"", ":", "self", ".", "group", "}", ",", "{", "\"key\"", ":", "\"app_name\"", ",", "\"value\"", ":", "self", ".", "app_name", "}", ...
Creates the data pipeline if it does not already exist Returns: dict: the response of the Boto3 command
[ "Creates", "the", "data", "pipeline", "if", "it", "does", "not", "already", "exist" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/datapipeline/datapipeline.py#L53-L70
foremast/foremast
src/foremast/datapipeline/datapipeline.py
AWSDataPipeline.set_pipeline_definition
def set_pipeline_definition(self): """Translates the json definition and puts it on created pipeline Returns: dict: the response of the Boto3 command """ if not self.pipeline_id: self.get_pipeline_id() json_def = self.datapipeline_data['json_definit...
python
def set_pipeline_definition(self): """Translates the json definition and puts it on created pipeline Returns: dict: the response of the Boto3 command """ if not self.pipeline_id: self.get_pipeline_id() json_def = self.datapipeline_data['json_definit...
[ "def", "set_pipeline_definition", "(", "self", ")", ":", "if", "not", "self", ".", "pipeline_id", ":", "self", ".", "get_pipeline_id", "(", ")", "json_def", "=", "self", ".", "datapipeline_data", "[", "'json_definition'", "]", "try", ":", "pipelineobjects", "=...
Translates the json definition and puts it on created pipeline Returns: dict: the response of the Boto3 command
[ "Translates", "the", "json", "definition", "and", "puts", "it", "on", "created", "pipeline" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/datapipeline/datapipeline.py#L72-L98
foremast/foremast
src/foremast/datapipeline/datapipeline.py
AWSDataPipeline.get_pipeline_id
def get_pipeline_id(self): """Finds the pipeline ID for configured pipeline""" all_pipelines = [] paginiator = self.client.get_paginator('list_pipelines') for page in paginiator.paginate(): all_pipelines.extend(page['pipelineIdList']) for pipeline in all_pipelines: ...
python
def get_pipeline_id(self): """Finds the pipeline ID for configured pipeline""" all_pipelines = [] paginiator = self.client.get_paginator('list_pipelines') for page in paginiator.paginate(): all_pipelines.extend(page['pipelineIdList']) for pipeline in all_pipelines: ...
[ "def", "get_pipeline_id", "(", "self", ")", ":", "all_pipelines", "=", "[", "]", "paginiator", "=", "self", ".", "client", ".", "get_paginator", "(", "'list_pipelines'", ")", "for", "page", "in", "paginiator", ".", "paginate", "(", ")", ":", "all_pipelines",...
Finds the pipeline ID for configured pipeline
[ "Finds", "the", "pipeline", "ID", "for", "configured", "pipeline" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/datapipeline/datapipeline.py#L100-L113
foremast/foremast
src/foremast/datapipeline/datapipeline.py
AWSDataPipeline.activate_pipeline
def activate_pipeline(self): """Activates a deployed pipeline, useful for OnDemand pipelines""" self.client.activate_pipeline(pipelineId=self.pipeline_id) LOG.info("Activated Pipeline %s", self.pipeline_id)
python
def activate_pipeline(self): """Activates a deployed pipeline, useful for OnDemand pipelines""" self.client.activate_pipeline(pipelineId=self.pipeline_id) LOG.info("Activated Pipeline %s", self.pipeline_id)
[ "def", "activate_pipeline", "(", "self", ")", ":", "self", ".", "client", ".", "activate_pipeline", "(", "pipelineId", "=", "self", ".", "pipeline_id", ")", "LOG", ".", "info", "(", "\"Activated Pipeline %s\"", ",", "self", ".", "pipeline_id", ")" ]
Activates a deployed pipeline, useful for OnDemand pipelines
[ "Activates", "a", "deployed", "pipeline", "useful", "for", "OnDemand", "pipelines" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/datapipeline/datapipeline.py#L115-L118
foremast/foremast
src/foremast/utils/dns.py
get_dns_zone_ids
def get_dns_zone_ids(env='dev', facing='internal'): """Get Route 53 Hosted Zone IDs for _env_. Args: env (str): Deployment environment. facing (str): Type of ELB, external or internal. Returns: list: Hosted Zone IDs for _env_. Only *PrivateZone* when _facing_ is internal. ...
python
def get_dns_zone_ids(env='dev', facing='internal'): """Get Route 53 Hosted Zone IDs for _env_. Args: env (str): Deployment environment. facing (str): Type of ELB, external or internal. Returns: list: Hosted Zone IDs for _env_. Only *PrivateZone* when _facing_ is internal. ...
[ "def", "get_dns_zone_ids", "(", "env", "=", "'dev'", ",", "facing", "=", "'internal'", ")", ":", "client", "=", "boto3", ".", "Session", "(", "profile_name", "=", "env", ")", ".", "client", "(", "'route53'", ")", "zones", "=", "client", ".", "list_hosted...
Get Route 53 Hosted Zone IDs for _env_. Args: env (str): Deployment environment. facing (str): Type of ELB, external or internal. Returns: list: Hosted Zone IDs for _env_. Only *PrivateZone* when _facing_ is internal.
[ "Get", "Route", "53", "Hosted", "Zone", "IDs", "for", "_env_", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/dns.py#L31-L56
foremast/foremast
src/foremast/utils/dns.py
update_dns_zone_record
def update_dns_zone_record(env, zone_id, **kwargs): """Create a Route53 CNAME record in _env_ zone. Args: env (str): Deployment environment. zone_id (str): Route53 zone id. Keyword Args: dns_name (str): FQDN of application's dns entry to add/update. dns_name_aws (str): FQDN...
python
def update_dns_zone_record(env, zone_id, **kwargs): """Create a Route53 CNAME record in _env_ zone. Args: env (str): Deployment environment. zone_id (str): Route53 zone id. Keyword Args: dns_name (str): FQDN of application's dns entry to add/update. dns_name_aws (str): FQDN...
[ "def", "update_dns_zone_record", "(", "env", ",", "zone_id", ",", "*", "*", "kwargs", ")", ":", "client", "=", "boto3", ".", "Session", "(", "profile_name", "=", "env", ")", ".", "client", "(", "'route53'", ")", "response", "=", "{", "}", "hosted_zone_in...
Create a Route53 CNAME record in _env_ zone. Args: env (str): Deployment environment. zone_id (str): Route53 zone id. Keyword Args: dns_name (str): FQDN of application's dns entry to add/update. dns_name_aws (str): FQDN of AWS resource dns_ttl (int): DNS time-to-live (t...
[ "Create", "a", "Route53", "CNAME", "record", "in", "_env_", "zone", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/dns.py#L59-L96
foremast/foremast
src/foremast/utils/dns.py
find_existing_record
def find_existing_record(env, zone_id, dns_name, check_key=None, check_value=None): """Check if a specific DNS record exists. Args: env (str): Deployment environment. zone_id (str): Route53 zone id. dns_name (str): FQDN of application's dns entry to add/update. check_key(str): K...
python
def find_existing_record(env, zone_id, dns_name, check_key=None, check_value=None): """Check if a specific DNS record exists. Args: env (str): Deployment environment. zone_id (str): Route53 zone id. dns_name (str): FQDN of application's dns entry to add/update. check_key(str): K...
[ "def", "find_existing_record", "(", "env", ",", "zone_id", ",", "dns_name", ",", "check_key", "=", "None", ",", "check_value", "=", "None", ")", ":", "client", "=", "boto3", ".", "Session", "(", "profile_name", "=", "env", ")", ".", "client", "(", "'rout...
Check if a specific DNS record exists. Args: env (str): Deployment environment. zone_id (str): Route53 zone id. dns_name (str): FQDN of application's dns entry to add/update. check_key(str): Key to look for in record. Example: "Type" check_value(str): Value to look for with ...
[ "Check", "if", "a", "specific", "DNS", "record", "exists", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/dns.py#L99-L123
foremast/foremast
src/foremast/utils/dns.py
delete_existing_cname
def delete_existing_cname(env, zone_id, dns_name): """Delete an existing CNAME record. This is used when updating to multi-region for deleting old records. The record can not just be upserted since it changes types. Args: env (str): Deployment environment. zone_id (str): Route53 zone i...
python
def delete_existing_cname(env, zone_id, dns_name): """Delete an existing CNAME record. This is used when updating to multi-region for deleting old records. The record can not just be upserted since it changes types. Args: env (str): Deployment environment. zone_id (str): Route53 zone i...
[ "def", "delete_existing_cname", "(", "env", ",", "zone_id", ",", "dns_name", ")", ":", "client", "=", "boto3", ".", "Session", "(", "profile_name", "=", "env", ")", ".", "client", "(", "'route53'", ")", "startrecord", "=", "None", "newrecord_name", "=", "d...
Delete an existing CNAME record. This is used when updating to multi-region for deleting old records. The record can not just be upserted since it changes types. Args: env (str): Deployment environment. zone_id (str): Route53 zone id. dns_name (str): FQDN of application's dns entry...
[ "Delete", "an", "existing", "CNAME", "record", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/dns.py#L126-L148
foremast/foremast
src/foremast/utils/dns.py
update_failover_dns_record
def update_failover_dns_record(env, zone_id, **kwargs): """Create a Failover Route53 alias record in _env_ zone. Args: env (str): Deployment environment. zone_id (str): Route53 zone id. Keyword Args: dns_name (str): FQDN of application's dns entry to add/update. dns_ttl (in...
python
def update_failover_dns_record(env, zone_id, **kwargs): """Create a Failover Route53 alias record in _env_ zone. Args: env (str): Deployment environment. zone_id (str): Route53 zone id. Keyword Args: dns_name (str): FQDN of application's dns entry to add/update. dns_ttl (in...
[ "def", "update_failover_dns_record", "(", "env", ",", "zone_id", ",", "*", "*", "kwargs", ")", ":", "client", "=", "boto3", ".", "Session", "(", "profile_name", "=", "env", ")", ".", "client", "(", "'route53'", ")", "response", "=", "{", "}", "hosted_zon...
Create a Failover Route53 alias record in _env_ zone. Args: env (str): Deployment environment. zone_id (str): Route53 zone id. Keyword Args: dns_name (str): FQDN of application's dns entry to add/update. dns_ttl (int): DNS time-to-live (ttl) elb_aws_dns (str): DNS A Rec...
[ "Create", "a", "Failover", "Route53", "alias", "record", "in", "_env_", "zone", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/utils/dns.py#L151-L198
foremast/foremast
src/foremast/awslambda/cloudwatch_log_event/cloudwatch_log_event.py
create_cloudwatch_log_event
def create_cloudwatch_log_event(app_name, env, region, rules): """Create cloudwatch log event for lambda from rules. Args: app_name (str): name of the lambda function env (str): Environment/Account for lambda function region (str): AWS region of the lambda function rules (str): ...
python
def create_cloudwatch_log_event(app_name, env, region, rules): """Create cloudwatch log event for lambda from rules. Args: app_name (str): name of the lambda function env (str): Environment/Account for lambda function region (str): AWS region of the lambda function rules (str): ...
[ "def", "create_cloudwatch_log_event", "(", "app_name", ",", "env", ",", "region", ",", "rules", ")", ":", "session", "=", "boto3", ".", "Session", "(", "profile_name", "=", "env", ",", "region_name", "=", "region", ")", "cloudwatch_client", "=", "session", "...
Create cloudwatch log event for lambda from rules. Args: app_name (str): name of the lambda function env (str): Environment/Account for lambda function region (str): AWS region of the lambda function rules (str): Trigger rules from the settings
[ "Create", "cloudwatch", "log", "event", "for", "lambda", "from", "rules", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/awslambda/cloudwatch_log_event/cloudwatch_log_event.py#L28-L75
foremast/foremast
src/foremast/autoscaling_policy/create_policy.py
AutoScalingPolicy.prepare_policy_template
def prepare_policy_template(self, scaling_type, period_sec, server_group): """Renders scaling policy templates based on configs and variables. After rendering, POSTs the json to Spinnaker for creation. Args: scaling_type (str): ``scale_up`` or ``scaling_down``. Type of policy ...
python
def prepare_policy_template(self, scaling_type, period_sec, server_group): """Renders scaling policy templates based on configs and variables. After rendering, POSTs the json to Spinnaker for creation. Args: scaling_type (str): ``scale_up`` or ``scaling_down``. Type of policy ...
[ "def", "prepare_policy_template", "(", "self", ",", "scaling_type", ",", "period_sec", ",", "server_group", ")", ":", "template_kwargs", "=", "{", "'app'", ":", "self", ".", "app", ",", "'env'", ":", "self", ".", "env", ",", "'region'", ":", "self", ".", ...
Renders scaling policy templates based on configs and variables. After rendering, POSTs the json to Spinnaker for creation. Args: scaling_type (str): ``scale_up`` or ``scaling_down``. Type of policy period_sec (int): Period of time to look at metrics for determining scale ...
[ "Renders", "scaling", "policy", "templates", "based", "on", "configs", "and", "variables", ".", "After", "rendering", "POSTs", "the", "json", "to", "Spinnaker", "for", "creation", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/autoscaling_policy/create_policy.py#L56-L88
foremast/foremast
src/foremast/autoscaling_policy/create_policy.py
AutoScalingPolicy.create_policy
def create_policy(self): """Wrapper function. Gets the server group, sets sane defaults, deletes existing policies, and then runs self.prepare_policy_template for scaling up and scaling down policies. This function acts as the main driver for the scaling policy creationprocess ""...
python
def create_policy(self): """Wrapper function. Gets the server group, sets sane defaults, deletes existing policies, and then runs self.prepare_policy_template for scaling up and scaling down policies. This function acts as the main driver for the scaling policy creationprocess ""...
[ "def", "create_policy", "(", "self", ")", ":", "if", "not", "self", ".", "settings", "[", "'asg'", "]", "[", "'scaling_policy'", "]", ":", "self", ".", "log", ".", "info", "(", "\"No scaling policy found, skipping...\"", ")", "return", "server_group", "=", "...
Wrapper function. Gets the server group, sets sane defaults, deletes existing policies, and then runs self.prepare_policy_template for scaling up and scaling down policies. This function acts as the main driver for the scaling policy creationprocess
[ "Wrapper", "function", ".", "Gets", "the", "server", "group", "sets", "sane", "defaults", "deletes", "existing", "policies", "and", "then", "runs", "self", ".", "prepare_policy_template", "for", "scaling", "up", "and", "scaling", "down", "policies", ".", "This",...
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/autoscaling_policy/create_policy.py#L90-L115
foremast/foremast
src/foremast/autoscaling_policy/create_policy.py
AutoScalingPolicy.get_server_group
def get_server_group(self): """Finds the most recently deployed server group for the application. This is the server group that the scaling policy will be applied to. Returns: server_group (str): Name of the newest server group """ api_url = "{0}/applications/{1}".fo...
python
def get_server_group(self): """Finds the most recently deployed server group for the application. This is the server group that the scaling policy will be applied to. Returns: server_group (str): Name of the newest server group """ api_url = "{0}/applications/{1}".fo...
[ "def", "get_server_group", "(", "self", ")", ":", "api_url", "=", "\"{0}/applications/{1}\"", ".", "format", "(", "API_URL", ",", "self", ".", "app", ")", "response", "=", "requests", ".", "get", "(", "api_url", ",", "verify", "=", "GATE_CA_BUNDLE", ",", "...
Finds the most recently deployed server group for the application. This is the server group that the scaling policy will be applied to. Returns: server_group (str): Name of the newest server group
[ "Finds", "the", "most", "recently", "deployed", "server", "group", "for", "the", "application", ".", "This", "is", "the", "server", "group", "that", "the", "scaling", "policy", "will", "be", "applied", "to", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/autoscaling_policy/create_policy.py#L117-L127
foremast/foremast
src/foremast/autoscaling_policy/create_policy.py
AutoScalingPolicy.delete_existing_policy
def delete_existing_policy(self, scaling_policy, server_group): """Given a scaling_policy and server_group, deletes the existing scaling_policy. Scaling policies need to be deleted instead of upserted for consistency. Args: scaling_policy (json): the scaling_policy json from Spinnak...
python
def delete_existing_policy(self, scaling_policy, server_group): """Given a scaling_policy and server_group, deletes the existing scaling_policy. Scaling policies need to be deleted instead of upserted for consistency. Args: scaling_policy (json): the scaling_policy json from Spinnak...
[ "def", "delete_existing_policy", "(", "self", ",", "scaling_policy", ",", "server_group", ")", ":", "self", ".", "log", ".", "info", "(", "\"Deleting policy %s on %s\"", ",", "scaling_policy", "[", "'policyName'", "]", ",", "server_group", ")", "delete_dict", "=",...
Given a scaling_policy and server_group, deletes the existing scaling_policy. Scaling policies need to be deleted instead of upserted for consistency. Args: scaling_policy (json): the scaling_policy json from Spinnaker that should be deleted server_group (str): the affected serv...
[ "Given", "a", "scaling_policy", "and", "server_group", "deletes", "the", "existing", "scaling_policy", ".", "Scaling", "policies", "need", "to", "be", "deleted", "instead", "of", "upserted", "for", "consistency", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/autoscaling_policy/create_policy.py#L129-L153
foremast/foremast
src/foremast/autoscaling_policy/create_policy.py
AutoScalingPolicy.get_all_existing
def get_all_existing(self, server_group): """Finds all existing scaling policies for an application Returns: scalingpolicies (list): List of all existing scaling policies for the application """ self.log.info("Checking for existing scaling policy") url = "{0}/applica...
python
def get_all_existing(self, server_group): """Finds all existing scaling policies for an application Returns: scalingpolicies (list): List of all existing scaling policies for the application """ self.log.info("Checking for existing scaling policy") url = "{0}/applica...
[ "def", "get_all_existing", "(", "self", ",", "server_group", ")", ":", "self", ".", "log", ".", "info", "(", "\"Checking for existing scaling policy\"", ")", "url", "=", "\"{0}/applications/{1}/clusters/{2}/{1}/serverGroups\"", ".", "format", "(", "API_URL", ",", "sel...
Finds all existing scaling policies for an application Returns: scalingpolicies (list): List of all existing scaling policies for the application
[ "Finds", "all", "existing", "scaling", "policies", "for", "an", "application" ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/autoscaling_policy/create_policy.py#L155-L172
foremast/foremast
src/foremast/awslambda/cloudwatch_event/destroy_cloudwatch_event/destroy_cloudwatch_event.py
destroy_cloudwatch_event
def destroy_cloudwatch_event(app='', env='dev', region=''): """Destroy Cloudwatch event subscription. Args: app (str): Spinnaker Application name. env (str): Deployment environment. region (str): AWS region. Returns: bool: True upon successful completion. """ sessio...
python
def destroy_cloudwatch_event(app='', env='dev', region=''): """Destroy Cloudwatch event subscription. Args: app (str): Spinnaker Application name. env (str): Deployment environment. region (str): AWS region. Returns: bool: True upon successful completion. """ sessio...
[ "def", "destroy_cloudwatch_event", "(", "app", "=", "''", ",", "env", "=", "'dev'", ",", "region", "=", "''", ")", ":", "session", "=", "boto3", ".", "Session", "(", "profile_name", "=", "env", ",", "region_name", "=", "region", ")", "cloudwatch_client", ...
Destroy Cloudwatch event subscription. Args: app (str): Spinnaker Application name. env (str): Deployment environment. region (str): AWS region. Returns: bool: True upon successful completion.
[ "Destroy", "Cloudwatch", "event", "subscription", "." ]
train
https://github.com/foremast/foremast/blob/fb70f29b8ce532f061685a17d120486e47b215ba/src/foremast/awslambda/cloudwatch_event/destroy_cloudwatch_event/destroy_cloudwatch_event.py#L26-L45