How to use extract_service_from_arn method in localstack

Best Python code snippet using localstack_python

provider.py

Source:provider.py Github

copy

Full Screen

...118 "Could not deliver test message to specified Firehose stream. "119 "Check if the given Firehose stream is in ACTIVE state."120 )121 else:122 service = aws_stack.extract_service_from_arn(destination_arn)123 raise InvalidParameterException(124 f"PutSubscriptionFilter operation cannot work with destinationArn for vendor {service}"125 )126 if filter_pattern:127 for stream in log_group.streams.values():128 stream.filter_pattern = filter_pattern129 log_group.put_subscription_filter(filter_name, filter_pattern, destination_arn, role_arn)130@patch(MotoLogStream.put_log_events, pass_target=False)131def moto_put_log_events(self, log_group_name, log_stream_name, log_events):132 # TODO: call/patch upstream method here, instead of duplicating the code!133 self.last_ingestion_time = int(unix_time_millis())134 self.stored_bytes += sum([len(log_event["message"]) for log_event in log_events])135 events = [logs_models.LogEvent(self.last_ingestion_time, log_event) for log_event in log_events]136 self.events += events...

Full Screen

Full Screen

logs_starter.py

Source:logs_starter.py Github

copy

Full Screen

...63 "Could not deliver test message to specified Firehose stream. "64 "Check if the given Firehose stream is in ACTIVE state."65 )66 else:67 service = aws_stack.extract_service_from_arn(destination_arn)68 raise InvalidParameterException(69 "PutSubscriptionFilter operation cannot work with destinationArn for vendor %s"70 % service71 )72 log_group.put_subscription_filter(73 filter_name, filter_pattern, destination_arn, role_arn74 )75 return put_subscription_filter76 def put_log_events_model(self, log_group_name, log_stream_name, log_events, sequence_token):77 # TODO: call/patch upstream method here, instead of duplicating the code!78 self.last_ingestion_time = int(unix_time_millis())79 self.stored_bytes += sum([len(log_event["message"]) for log_event in log_events])80 events = [81 logs_models.LogEvent(self.last_ingestion_time, log_event) for log_event in log_events...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful