Skip to content

Commit

Permalink
[Storage] Add x-ms-creation-time to response on download (#28745)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenttran-msft authored Feb 17, 2023
1 parent 95a573a commit 8dc6cc8
Show file tree
Hide file tree
Showing 9 changed files with 386 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ async def download(
response_headers = {}
if response.status_code == 200:
response_headers["Last-Modified"] = self._deserialize("rfc-1123", response.headers.get("Last-Modified"))
response_headers["x-ms-creation-time"] = self._deserialize(
"rfc-1123", response.headers.get("x-ms-creation-time")
)
response_headers["x-ms-meta"] = self._deserialize("{str}", response.headers.get("x-ms-meta"))
response_headers["x-ms-or-policy-id"] = self._deserialize("str", response.headers.get("x-ms-or-policy-id"))
response_headers["x-ms-or"] = self._deserialize("{str}", response.headers.get("x-ms-or"))
Expand Down Expand Up @@ -280,6 +283,9 @@ async def download(

if response.status_code == 206:
response_headers["Last-Modified"] = self._deserialize("rfc-1123", response.headers.get("Last-Modified"))
response_headers["x-ms-creation-time"] = self._deserialize(
"rfc-1123", response.headers.get("x-ms-creation-time")
)
response_headers["x-ms-meta"] = self._deserialize("{str}", response.headers.get("x-ms-meta"))
response_headers["x-ms-or-policy-id"] = self._deserialize("str", response.headers.get("x-ms-or-policy-id"))
response_headers["x-ms-or"] = self._deserialize("{str}", response.headers.get("x-ms-or"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,9 @@ def download(
response_headers = {}
if response.status_code == 200:
response_headers["Last-Modified"] = self._deserialize("rfc-1123", response.headers.get("Last-Modified"))
response_headers["x-ms-creation-time"] = self._deserialize(
"rfc-1123", response.headers.get("x-ms-creation-time")
)
response_headers["x-ms-meta"] = self._deserialize("{str}", response.headers.get("x-ms-meta"))
response_headers["x-ms-or-policy-id"] = self._deserialize("str", response.headers.get("x-ms-or-policy-id"))
response_headers["x-ms-or"] = self._deserialize("{str}", response.headers.get("x-ms-or"))
Expand Down Expand Up @@ -1681,6 +1684,9 @@ def download(

if response.status_code == 206:
response_headers["Last-Modified"] = self._deserialize("rfc-1123", response.headers.get("Last-Modified"))
response_headers["x-ms-creation-time"] = self._deserialize(
"rfc-1123", response.headers.get("x-ms-creation-time")
)
response_headers["x-ms-meta"] = self._deserialize("{str}", response.headers.get("x-ms-meta"))
response_headers["x-ms-or-policy-id"] = self._deserialize("str", response.headers.get("x-ms-or-policy-id"))
response_headers["x-ms-or"] = self._deserialize("{str}", response.headers.get("x-ms-or"))
Expand Down
2 changes: 2 additions & 0 deletions sdk/storage/azure-storage-blob/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ vanilla: true
clear-output-folder: true
python: true
version-tolerant: false
modelerfour:
seal-single-value-enum-by-default: true
```
### Remove x-ms-pageable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Content-Length": "0",
"User-Agent": "azsdk-python-storage-blob/12.14.0b1 Python/3.10.5 (Windows-10-10.0.22000-SP0)",
"x-ms-date": "Fri, 12 Aug 2022 20:48:55 GMT",
"x-ms-version": "2021-08-06"
"User-Agent": "azsdk-python-storage-blob/12.15.0 Python/3.11.1 (Windows-10-10.0.22621-SP0)",
"x-ms-date": "Fri, 17 Feb 2023 00:16:21 GMT",
"x-ms-version": "2021-12-02"
},
"RequestBody": null,
"StatusCode": 201,
"ResponseHeaders": {
"Content-Length": "0",
"Date": "Fri, 12 Aug 2022 20:48:54 GMT",
"ETag": "\u00220x8DA7CA412737768\u0022",
"Last-Modified": "Fri, 12 Aug 2022 20:48:55 GMT",
"Date": "Fri, 17 Feb 2023 00:16:19 GMT",
"ETag": "\u00220x8DB107C31A2EEC1\u0022",
"Last-Modified": "Fri, 17 Feb 2023 00:16:19 GMT",
"Server": [
"Windows-Azure-Blob/1.0",
"Microsoft-HTTPAPI/2.0"
],
"x-ms-version": "2021-08-06"
"x-ms-version": "2021-12-02"
},
"ResponseBody": null
},
Expand All @@ -35,22 +35,22 @@
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Content-Length": "0",
"User-Agent": "azsdk-python-storage-blob/12.14.0b1 Python/3.10.5 (Windows-10-10.0.22000-SP0)",
"x-ms-date": "Fri, 12 Aug 2022 20:48:55 GMT",
"x-ms-version": "2021-08-06"
"User-Agent": "azsdk-python-storage-blob/12.15.0 Python/3.11.1 (Windows-10-10.0.22621-SP0)",
"x-ms-date": "Fri, 17 Feb 2023 00:16:22 GMT",
"x-ms-version": "2021-12-02"
},
"RequestBody": null,
"StatusCode": 201,
"ResponseHeaders": {
"Content-Length": "0",
"Date": "Fri, 12 Aug 2022 20:48:54 GMT",
"ETag": "\u00220x8DA7CA4127D8805\u0022",
"Last-Modified": "Fri, 12 Aug 2022 20:48:55 GMT",
"Date": "Fri, 17 Feb 2023 00:16:19 GMT",
"ETag": "\u00220x8DB107C31B38F29\u0022",
"Last-Modified": "Fri, 17 Feb 2023 00:16:19 GMT",
"Server": [
"Windows-Azure-Blob/1.0",
"Microsoft-HTTPAPI/2.0"
],
"x-ms-version": "2021-08-06"
"x-ms-version": "2021-12-02"
},
"ResponseBody": null
},
Expand All @@ -64,26 +64,26 @@
"Content-Length": "3",
"Content-Type": "application/octet-stream",
"If-None-Match": "*",
"User-Agent": "azsdk-python-storage-blob/12.14.0b1 Python/3.10.5 (Windows-10-10.0.22000-SP0)",
"User-Agent": "azsdk-python-storage-blob/12.15.0 Python/3.11.1 (Windows-10-10.0.22621-SP0)",
"x-ms-blob-type": "BlockBlob",
"x-ms-date": "Fri, 12 Aug 2022 20:48:55 GMT",
"x-ms-version": "2021-08-06"
"x-ms-date": "Fri, 17 Feb 2023 00:16:22 GMT",
"x-ms-version": "2021-12-02"
},
"RequestBody": "Pz8/",
"StatusCode": 201,
"ResponseHeaders": {
"Content-Length": "0",
"Content-MD5": "DRsIw0hYkhvHxmKyKKy3ug==",
"Date": "Fri, 12 Aug 2022 20:48:54 GMT",
"ETag": "\u00220x8DA7CA412883577\u0022",
"Last-Modified": "Fri, 12 Aug 2022 20:48:55 GMT",
"Date": "Fri, 17 Feb 2023 00:16:19 GMT",
"ETag": "\u00220x8DB107C31C34670\u0022",
"Last-Modified": "Fri, 17 Feb 2023 00:16:19 GMT",
"Server": [
"Windows-Azure-Blob/1.0",
"Microsoft-HTTPAPI/2.0"
],
"x-ms-content-crc64": "VtoDJyOMw/A=",
"x-ms-request-server-encrypted": "true",
"x-ms-version": "2021-08-06"
"x-ms-version": "2021-12-02"
},
"ResponseBody": null
},
Expand All @@ -94,10 +94,10 @@
"Accept": "application/xml",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"User-Agent": "azsdk-python-storage-blob/12.14.0b1 Python/3.10.5 (Windows-10-10.0.22000-SP0)",
"x-ms-date": "Fri, 12 Aug 2022 20:48:55 GMT",
"User-Agent": "azsdk-python-storage-blob/12.15.0 Python/3.11.1 (Windows-10-10.0.22621-SP0)",
"x-ms-date": "Fri, 17 Feb 2023 00:16:22 GMT",
"x-ms-range": "bytes=0-33554431",
"x-ms-version": "2021-08-06"
"x-ms-version": "2021-12-02"
},
"RequestBody": null,
"StatusCode": 206,
Expand All @@ -106,21 +106,21 @@
"Content-Length": "3",
"Content-Range": "bytes 0-2/3",
"Content-Type": "application/octet-stream",
"Date": "Fri, 12 Aug 2022 20:48:55 GMT",
"ETag": "\u00220x8DA7CA412883577\u0022",
"Last-Modified": "Fri, 12 Aug 2022 20:48:55 GMT",
"Date": "Fri, 17 Feb 2023 00:16:19 GMT",
"ETag": "\u00220x8DB107C31C34670\u0022",
"Last-Modified": "Fri, 17 Feb 2023 00:16:19 GMT",
"Server": [
"Windows-Azure-Blob/1.0",
"Microsoft-HTTPAPI/2.0"
],
"Vary": "Origin",
"x-ms-blob-content-md5": "DRsIw0hYkhvHxmKyKKy3ug==",
"x-ms-blob-type": "BlockBlob",
"x-ms-creation-time": "Fri, 12 Aug 2022 20:48:55 GMT",
"x-ms-creation-time": "Fri, 17 Feb 2023 00:16:19 GMT",
"x-ms-lease-state": "available",
"x-ms-lease-status": "unlocked",
"x-ms-server-encrypted": "true",
"x-ms-version": "2021-08-06"
"x-ms-version": "2021-12-02"
},
"ResponseBody": "Pz8/"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"Entries": [
{
"RequestUri": "https://storagename.blob.core.windows.net/utcontainera3942b6e?restype=container\u0026timeout=5",
"RequestMethod": "PUT",
"RequestHeaders": {
"Accept": "application/xml",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Content-Length": "0",
"User-Agent": "azsdk-python-storage-blob/12.15.0 Python/3.11.1 (Windows-10-10.0.22621-SP0)",
"x-ms-date": "Fri, 17 Feb 2023 00:32:26 GMT",
"x-ms-version": "2021-12-02"
},
"RequestBody": null,
"StatusCode": 201,
"ResponseHeaders": {
"Content-Length": "0",
"Date": "Fri, 17 Feb 2023 00:32:24 GMT",
"ETag": "\u00220x8DB107E70E48ABB\u0022",
"Last-Modified": "Fri, 17 Feb 2023 00:32:24 GMT",
"Server": [
"Windows-Azure-Blob/1.0",
"Microsoft-HTTPAPI/2.0"
],
"x-ms-version": "2021-12-02"
},
"ResponseBody": null
},
{
"RequestUri": "https://storagename.blob.core.windows.net/utcontainersourcea3942b6e?restype=container\u0026timeout=5",
"RequestMethod": "PUT",
"RequestHeaders": {
"Accept": "application/xml",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Content-Length": "0",
"User-Agent": "azsdk-python-storage-blob/12.15.0 Python/3.11.1 (Windows-10-10.0.22621-SP0)",
"x-ms-date": "Fri, 17 Feb 2023 00:32:27 GMT",
"x-ms-version": "2021-12-02"
},
"RequestBody": null,
"StatusCode": 201,
"ResponseHeaders": {
"Content-Length": "0",
"Date": "Fri, 17 Feb 2023 00:32:24 GMT",
"ETag": "\u00220x8DB107E70F440E1\u0022",
"Last-Modified": "Fri, 17 Feb 2023 00:32:25 GMT",
"Server": [
"Windows-Azure-Blob/1.0",
"Microsoft-HTTPAPI/2.0"
],
"x-ms-version": "2021-12-02"
},
"ResponseBody": null
},
{
"RequestUri": "https://storagename.blob.core.windows.net/utcontainera3942b6e/utcontainera3942b6e",
"RequestMethod": "PUT",
"RequestHeaders": {
"Accept": "application/xml",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Content-Length": "3",
"Content-Type": "application/octet-stream",
"If-None-Match": "*",
"User-Agent": "azsdk-python-storage-blob/12.15.0 Python/3.11.1 (Windows-10-10.0.22621-SP0)",
"x-ms-blob-type": "BlockBlob",
"x-ms-date": "Fri, 17 Feb 2023 00:32:27 GMT",
"x-ms-version": "2021-12-02"
},
"RequestBody": "YWJj",
"StatusCode": 201,
"ResponseHeaders": {
"Content-Length": "0",
"Content-MD5": "kAFQmDzST7DWlj99KOF/cg==",
"Date": "Fri, 17 Feb 2023 00:32:24 GMT",
"ETag": "\u00220x8DB107E710645CB\u0022",
"Last-Modified": "Fri, 17 Feb 2023 00:32:25 GMT",
"Server": [
"Windows-Azure-Blob/1.0",
"Microsoft-HTTPAPI/2.0"
],
"x-ms-content-crc64": "6/rBP7vK5QU=",
"x-ms-request-server-encrypted": "true",
"x-ms-version": "2021-12-02"
},
"ResponseBody": null
},
{
"RequestUri": "https://storagename.blob.core.windows.net/utcontainera3942b6e/utcontainera3942b6e",
"RequestMethod": "GET",
"RequestHeaders": {
"Accept": "application/xml",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"User-Agent": "azsdk-python-storage-blob/12.15.0 Python/3.11.1 (Windows-10-10.0.22621-SP0)",
"x-ms-date": "Fri, 17 Feb 2023 00:32:27 GMT",
"x-ms-range": "bytes=0-33554431",
"x-ms-version": "2021-12-02"
},
"RequestBody": null,
"StatusCode": 206,
"ResponseHeaders": {
"Accept-Ranges": "bytes",
"Content-Length": "3",
"Content-Range": "bytes 0-2/3",
"Content-Type": "application/octet-stream",
"Date": "Fri, 17 Feb 2023 00:32:24 GMT",
"ETag": "\u00220x8DB107E710645CB\u0022",
"Last-Modified": "Fri, 17 Feb 2023 00:32:25 GMT",
"Server": [
"Windows-Azure-Blob/1.0",
"Microsoft-HTTPAPI/2.0"
],
"Vary": "Origin",
"x-ms-blob-content-md5": "kAFQmDzST7DWlj99KOF/cg==",
"x-ms-blob-type": "BlockBlob",
"x-ms-creation-time": "Fri, 17 Feb 2023 00:32:25 GMT",
"x-ms-lease-state": "available",
"x-ms-lease-status": "unlocked",
"x-ms-server-encrypted": "true",
"x-ms-version": "2021-12-02"
},
"ResponseBody": "YWJj"
}
],
"Variables": {}
}
Loading

0 comments on commit 8dc6cc8

Please sign in to comment.