-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
55 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
from sys import argv | ||
|
||
import requests | ||
|
||
try: | ||
timeout_seconds = 10 | ||
requested = requests.get("http://localhost:8082/server_request", params={"param": argv[0]}, timeout=120) | ||
assert requested.status_code == 200 | ||
except requests.exceptions.HTTPError as http_err: | ||
print(f"HTTP error occurred: {http_err}") | ||
except requests.exceptions.Timeout as timeout_err: | ||
print(f"Timeout error occurred: {timeout_err}") | ||
except requests.exceptions.RequestException as req_err: | ||
print(f"Request error occurred: {req_err}") |
21 changes: 21 additions & 0 deletions
21
sample-applications/simple-client-server/server_automatic_s3client.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
import boto3 | ||
from flask import Flask, request | ||
|
||
# Let's use Amazon S3 | ||
s3 = boto3.resource("s3") | ||
|
||
app = Flask(__name__) | ||
|
||
|
||
@app.route("/server_request") | ||
def server_request(): | ||
print(request.args.get("param")) | ||
for bucket in s3.buckets.all(): | ||
print(bucket.name) | ||
return "served" | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run(port=8082) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.