def data(args): # TODO: add better error handling validate_args(args) api_key = args["api_key"] is_authorized(api_key) return json.dumps({ data: get_data(params) })
def main(): if util.is_authorized(): snapshot_handler = SnapshotsHandler(config) snapshot_handler.delete_snapshots() print("Done deleting snapshots older than {} days!".format( config.BACKUP_RETENTION_IN_DAYS)) return 1 print ("The IP of this server is not the Main Instance! Skipping delete snapshots...") return 0
def main(): if util.is_authorized(): autoscale_creator = AutoScalingConfigCreator(config) autoscale_creator.instance_refresh() print("Done executing instance refresh for ASG {}!".format( config.ASG_NAME)) return 1 print( "The IP of this server is not the Main Instance! Skipping instance refresh..." ) return 0
def main(): if util.is_authorized(): image_creator = Ec2ImageCreator(config) image = image_creator.create_image() print("Done creating new image of {}!".format(config.AMI_NAME)) autoscale_creator = AutoScalingConfigCreator(image, config) autoscale_creator.update_autoscaling() print("Done updating ASG of {}!".format(config.ASG_NAME)) return 1 print( "The IP of this server is not the Main Instance! Skipping create image..." ) return 0
def belongs_to(self, user_email): return util.is_authorized(user_email, self.author_email)