Best Python code snippet using localstack_python
client.py
Source:client.py  
...47    def describe_resource_policies(self, nextToken: str = None, limit: int = None) -> Dict:48        pass49    def describe_subscription_filters(self, logGroupName: str, filterNamePrefix: str = None, nextToken: str = None, limit: int = None) -> Dict:50        pass51    def disassociate_kms_key(self, logGroupName: str):52        pass53    def filter_log_events(self, logGroupName: str, logStreamNames: List = None, logStreamNamePrefix: str = None, startTime: int = None, endTime: int = None, filterPattern: str = None, nextToken: str = None, limit: int = None, interleaved: bool = None) -> Dict:54        pass55    def generate_presigned_url(self, ClientMethod: str = None, Params: Dict = None, ExpiresIn: int = None, HttpMethod: str = None):56        pass57    def get_log_events(self, logGroupName: str, logStreamName: str, startTime: int = None, endTime: int = None, nextToken: str = None, limit: int = None, startFromHead: bool = None) -> Dict:58        pass59    def get_log_group_fields(self, logGroupName: str, time: int = None) -> Dict:60        pass61    def get_log_record(self, logRecordPointer: str) -> Dict:62        pass63    def get_paginator(self, operation_name: str = None) -> Paginator:64        pass65    def get_query_results(self, queryId: str) -> Dict:...svccwl.py
Source:svccwl.py  
...92        except botocore.exceptions.ClientError as e:93            if self._utils.is_resource_not_found(e): return94            raise RdqError(self._utils.fail(e, op, 'LogGroupName', logGroupName, 'KmsKeyId', kmsArn))95    #PREVIEW96    def disassociate_kms_key(self, logGroupName):97        op = 'disassociate_kms_key'98        args = {99            'LogGroupName': logGroupName100        }101        if self._utils.preview(op, args): return102        try:103            self._client.disassociate_kms_key(104                logGroupName=logGroupName105            )106        except botocore.exceptions.ClientError as e:107            if self._utils.is_resource_not_found(e): return108            raise RdqError(self._utils.fail(e, op, 'LogGroupName', logGroupName))109    def getLogGroupDescriptor(self, logGroupName :str) -> LogGroupDescriptor:110        exBase = self.describe_log_group(logGroupName)111        if not exBase: return None112        optTagDict = self.list_log_group_tags(logGroupName)113        exTags = Tags(optTagDict, logGroupName)114        return LogGroupDescriptor(exBase, exTags)115    #PREVIEW116    def associateKmsKeyWithLogGroup(self, logGroupName :str, cmkArn :str):117        self.associate_kms_key(logGroupName, cmkArn)...log_management.py
Source:log_management.py  
...56        # If a KMS key is not supplied AND we want to allow KMS disassociation from Cloudwatch, try to disassociate KMS keys from Cloudwatch57        # This will remove KMS associations for ALL Cloudwatch log groups in the specified account and region(s)58        if os.environ.get("KMS_KEY_ALIAS", "None") == "None" and os.environ.get("ALLOW_KMS_DISASSOCIATE", "False") == "True":59            try:60                cw.disassociate_kms_key(61                    logGroupName=log_group['logGroupName'],62                )63            except Exception as e:64                print(f"Ran into error when removing encryption for log group {log_group['logGroupName']} in {cw.meta.region_name}")65                print(traceback.format_exc())66        if os.environ.get("RETENTION_IN_DAYS", "None") != "None":67            try:68                cw.put_retention_policy(69                   logGroupName=log_group['logGroupName'],70                   retentionInDays=int(os.environ['RETENTION_IN_DAYS'])71                )72            except Exception as e:73                print(f"Ran into error when attaching retention policy to log group {log_group['logGroupName']} in {cw.meta.region_name}")74                print(traceback.format_exc())...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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
