コード例 #1
0
ファイル: test_util.py プロジェクト: fsouza/awsmanager
    def test_should_get_connection_to_amazon_cloudfront_using_boto(self):
        with app.test_request_context():
            CloudFrontConnection = self.mocker.replace('boto.cloudfront.CloudFrontConnection')
            CloudFrontConnection(aws_access_key_id=app.config['AWS_ACCESS_KEY_ID'], aws_secret_access_key=app.config['AWS_SECRET_ACCESS_KEY'])
            self.mocker.result('connected')
            self.mocker.replay()

            from awsmanager.util import ConnectionManager
            connection = ConnectionManager.get_cloudfront_connection()
            assert_equals('connected', connection)
            self.mocker.verify()
コード例 #2
0
ファイル: views.py プロジェクト: fsouza/awsmanager
def purge_paths():
    distribution_id = request.form["distribution"]
    paths = [p.strip() for p in request.form["paths"].split("\n")]
    connection = ConnectionManager.get_cloudfront_connection()
    batch = connection.create_invalidation_request(distribution_id, paths)
    return render_template("invalidation_sent.html", batch=batch)
コード例 #3
0
ファイル: views.py プロジェクト: fsouza/awsmanager
def show_purge_form():
    connection = ConnectionManager.get_cloudfront_connection()
    distributions = connection.get_all_distributions()
    return render_template("purge_form.html", distributions=distributions)
コード例 #4
0
ファイル: views.py プロジェクト: fsouza/awsmanager
def purge_paths():
    distribution_id = request.form['distribution']
    paths = [p.strip() for p in request.form['paths'].split('\n')]
    connection = ConnectionManager.get_cloudfront_connection()
    batch = connection.create_invalidation_request(distribution_id, paths)
    return render_template("invalidation_sent.html", batch=batch)
コード例 #5
0
ファイル: views.py プロジェクト: fsouza/awsmanager
def show_purge_form():
    connection = ConnectionManager.get_cloudfront_connection()
    distributions = connection.get_all_distributions()
    return render_template("purge_form.html", distributions=distributions)