3 # Copyright (c) 2021 Cisco and/or its affiliates.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 """Storage utilities library."""
18 from boto3 import resource
19 from botocore.client import Config
22 ENDPOINT_URL = u"http://storage.service.consul:9000"
23 AWS_ACCESS_KEY_ID = u"storage"
24 AWS_SECRET_ACCESS_KEY = u"Storage1234"
26 LOGS_BUCKET = f"logs.fd.io"
29 if __name__ == u"__main__":
30 """Main function for storage manipulation."""
32 # Create main storage resource.
35 endpoint_url=ENDPOINT_URL,
36 aws_access_key_id=AWS_ACCESS_KEY_ID,
37 aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
39 signature_version=u"s3v4"
41 region_name=REGION_NAME
44 storage.Bucket(LOGS_BUCKET).download_file(
45 "/vex-yul-rot-jenkins-1/csit-vpp-perf-report-iterative-2101-3n-skx/47/archives/output_info.xml.gz",