From 033ca6b23b0d1213ae5de549fc974fbe62770cd0 Mon Sep 17 00:00:00 2001 From: Jinming Hu Date: Mon, 30 Dec 2019 12:10:27 +0800 Subject: [PATCH] Use different API versions for different services --- adls/src/append_data_request.cpp | 2 +- adls/src/create_directory_request.cpp | 2 +- adls/src/create_file_request.cpp | 2 +- adls/src/delete_directory_request.cpp | 2 +- adls/src/flush_data_request.cpp | 2 +- adls/src/get_access_control_request.cpp | 2 +- adls/src/list_paths_request.cpp | 2 +- adls/src/rename_file_request.cpp | 2 +- adls/src/set_access_control_request.cpp | 2 +- include/constants.dat | 2 +- src/append_block_request_base.cpp | 2 +- src/copy_blob_request_base.cpp | 2 +- src/create_container_request_base.cpp | 2 +- src/delete_blob_request_base.cpp | 2 +- src/delete_container_request_base.cpp | 2 +- src/get_blob_property_request_base.cpp | 2 +- src/get_blob_request_base.cpp | 2 +- src/get_block_list_request_base.cpp | 2 +- src/get_container_property_request_base.cpp | 2 +- src/get_page_ranges_request_base.cpp | 2 +- src/list_blobs_request_base.cpp | 4 ++-- src/list_containers_request_base.cpp | 2 +- src/put_blob_request_base.cpp | 2 +- src/put_block_list_request_base.cpp | 2 +- src/put_block_request_base.cpp | 2 +- src/put_page_request_base.cpp | 2 +- src/set_blob_metadata_request_base.cpp | 2 +- src/set_container_metadata_request_base.cpp | 2 +- 28 files changed, 29 insertions(+), 29 deletions(-) diff --git a/adls/src/append_data_request.cpp b/adls/src/append_data_request.cpp index c6f3f12..d69f639 100644 --- a/adls/src/append_data_request.cpp +++ b/adls/src/append_data_request.cpp @@ -22,7 +22,7 @@ namespace azure { namespace storage_adls { add_content_length(http, headers, m_length); http.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(http, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_blob_version); account.credential()->sign_request(*this, http, url, headers); } diff --git a/adls/src/create_directory_request.cpp b/adls/src/create_directory_request.cpp index 6e56d8f..bcf71b0 100644 --- a/adls/src/create_directory_request.cpp +++ b/adls/src/create_directory_request.cpp @@ -21,7 +21,7 @@ namespace azure { namespace storage_adls { add_content_length(http, headers, 0); http.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(http, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_blob_version); account.credential()->sign_request(*this, http, url, headers); } diff --git a/adls/src/create_file_request.cpp b/adls/src/create_file_request.cpp index 1e01696..8caa861 100644 --- a/adls/src/create_file_request.cpp +++ b/adls/src/create_file_request.cpp @@ -21,7 +21,7 @@ namespace azure { namespace storage_adls { add_content_length(http, headers, 0); http.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(http, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_blob_version); account.credential()->sign_request(*this, http, url, headers); } diff --git a/adls/src/delete_directory_request.cpp b/adls/src/delete_directory_request.cpp index 7fbef7e..75f5fc9 100644 --- a/adls/src/delete_directory_request.cpp +++ b/adls/src/delete_directory_request.cpp @@ -21,7 +21,7 @@ namespace azure { namespace storage_adls { storage_headers headers; http.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(http, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_blob_version); account.credential()->sign_request(*this, http, url, headers); } diff --git a/adls/src/flush_data_request.cpp b/adls/src/flush_data_request.cpp index bf73913..a35595e 100644 --- a/adls/src/flush_data_request.cpp +++ b/adls/src/flush_data_request.cpp @@ -22,7 +22,7 @@ namespace azure { namespace storage_adls { add_content_length(http, headers, 0); http.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(http, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_blob_version); account.credential()->sign_request(*this, http, url, headers); } diff --git a/adls/src/get_access_control_request.cpp b/adls/src/get_access_control_request.cpp index c056de2..c862036 100644 --- a/adls/src/get_access_control_request.cpp +++ b/adls/src/get_access_control_request.cpp @@ -20,7 +20,7 @@ namespace azure { namespace storage_adls { storage_headers headers; http.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(http, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_blob_version); account.credential()->sign_request(*this, http, url, headers); } diff --git a/adls/src/list_paths_request.cpp b/adls/src/list_paths_request.cpp index 9aeba2a..72e0327 100644 --- a/adls/src/list_paths_request.cpp +++ b/adls/src/list_paths_request.cpp @@ -24,7 +24,7 @@ namespace azure { namespace storage_adls { storage_headers headers; http.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(http, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_blob_version); account.credential()->sign_request(*this, http, url, headers); } diff --git a/adls/src/rename_file_request.cpp b/adls/src/rename_file_request.cpp index 44a8051..2285a7d 100644 --- a/adls/src/rename_file_request.cpp +++ b/adls/src/rename_file_request.cpp @@ -20,7 +20,7 @@ namespace azure { namespace storage_adls { add_content_length(http, headers, 0); http.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(http, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_blob_version); add_ms_header(http, headers, constants::header_ms_rename_source, encode_url_path("/" + m_source_filesystem + "/" + m_source_path)); account.credential()->sign_request(*this, http, url, headers); diff --git a/adls/src/set_access_control_request.cpp b/adls/src/set_access_control_request.cpp index 6edeb42..d8fcd93 100644 --- a/adls/src/set_access_control_request.cpp +++ b/adls/src/set_access_control_request.cpp @@ -21,7 +21,7 @@ namespace azure { namespace storage_adls { add_content_length(http, headers, 0); http.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(http, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(http, headers, constants::header_ms_version, constants::header_value_storage_blob_version); add_ms_header(http, headers, constants::header_ms_owner, m_acl.owner, true); add_ms_header(http, headers, constants::header_ms_group, m_acl.group, true); add_ms_header(http, headers, constants::header_ms_permissions, m_acl.permissions, true); diff --git a/include/constants.dat b/include/constants.dat index 79ad1bf..bd2cbdc 100644 --- a/include/constants.dat +++ b/include/constants.dat @@ -114,7 +114,7 @@ DAT(header_value_page_write_update, "update") DAT(header_value_page_write_clear, "clear") DAT(header_value_payload_format_nometadata, "application/json;odata=nometadata") DAT(header_value_payload_format_fullmetadata, "application/json;odata=fullmetadata") -DAT(header_value_storage_version, "2018-11-09") +DAT(header_value_storage_blob_version, "2018-11-09") DAT(header_value_user_agent, "azure-storage-cpplite/0.2.0") diff --git a/src/append_block_request_base.cpp b/src/append_block_request_base.cpp index 52b3718..5561332 100644 --- a/src/append_block_request_base.cpp +++ b/src/append_block_request_base.cpp @@ -33,7 +33,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/copy_blob_request_base.cpp b/src/copy_blob_request_base.cpp index ca0b6ff..ce8b5c6 100644 --- a/src/copy_blob_request_base.cpp +++ b/src/copy_blob_request_base.cpp @@ -33,7 +33,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); // set copy src add_ms_header(h, headers, constants::header_ms_copy_source, a.credential()->transform_url(source_url.get_domain() + source_url.get_path())); diff --git a/src/create_container_request_base.cpp b/src/create_container_request_base.cpp index d80ddfd..ac1e7f0 100644 --- a/src/create_container_request_base.cpp +++ b/src/create_container_request_base.cpp @@ -40,7 +40,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/delete_blob_request_base.cpp b/src/delete_blob_request_base.cpp index fa98367..07b6ac5 100644 --- a/src/delete_blob_request_base.cpp +++ b/src/delete_blob_request_base.cpp @@ -42,7 +42,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/delete_container_request_base.cpp b/src/delete_container_request_base.cpp index 33ced7e..12fee7d 100644 --- a/src/delete_container_request_base.cpp +++ b/src/delete_container_request_base.cpp @@ -26,7 +26,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/get_blob_property_request_base.cpp b/src/get_blob_property_request_base.cpp index 0c94448..3542eb0 100644 --- a/src/get_blob_property_request_base.cpp +++ b/src/get_blob_property_request_base.cpp @@ -28,7 +28,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/get_blob_request_base.cpp b/src/get_blob_request_base.cpp index 9e45fa5..b9fca17 100644 --- a/src/get_blob_request_base.cpp +++ b/src/get_blob_request_base.cpp @@ -36,7 +36,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/get_block_list_request_base.cpp b/src/get_block_list_request_base.cpp index 032ba3e..9d7907b 100644 --- a/src/get_block_list_request_base.cpp +++ b/src/get_block_list_request_base.cpp @@ -41,7 +41,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/get_container_property_request_base.cpp b/src/get_container_property_request_base.cpp index b661de7..99a84ed 100644 --- a/src/get_container_property_request_base.cpp +++ b/src/get_container_property_request_base.cpp @@ -28,7 +28,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/get_page_ranges_request_base.cpp b/src/get_page_ranges_request_base.cpp index 7c578a9..bce6112 100644 --- a/src/get_page_ranges_request_base.cpp +++ b/src/get_page_ranges_request_base.cpp @@ -30,7 +30,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/list_blobs_request_base.cpp b/src/list_blobs_request_base.cpp index 6c8841d..e99b0a3 100644 --- a/src/list_blobs_request_base.cpp +++ b/src/list_blobs_request_base.cpp @@ -48,7 +48,7 @@ void list_blobs_request_base::build_request(const storage_account &a, http_base h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } @@ -108,7 +108,7 @@ void list_blobs_segmented_request_base::build_request(const storage_account &a, h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/list_containers_request_base.cpp b/src/list_containers_request_base.cpp index fd0bfb6..c55c9c8 100644 --- a/src/list_containers_request_base.cpp +++ b/src/list_containers_request_base.cpp @@ -31,7 +31,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/put_blob_request_base.cpp b/src/put_blob_request_base.cpp index 5eff720..6f32f97 100644 --- a/src/put_blob_request_base.cpp +++ b/src/put_blob_request_base.cpp @@ -71,7 +71,7 @@ void put_blob_request_base::build_request(const storage_account &a, http_base &h h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/put_block_list_request_base.cpp b/src/put_block_list_request_base.cpp index 88cbb0c..554ce67 100644 --- a/src/put_block_list_request_base.cpp +++ b/src/put_block_list_request_base.cpp @@ -52,7 +52,7 @@ void put_block_list_request_base::build_request(const storage_account &a, http_b h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/put_block_request_base.cpp b/src/put_block_request_base.cpp index d16cf13..f3c6e76 100644 --- a/src/put_block_request_base.cpp +++ b/src/put_block_request_base.cpp @@ -28,7 +28,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/put_page_request_base.cpp b/src/put_page_request_base.cpp index 88e3ce5..5146fc1 100644 --- a/src/put_page_request_base.cpp +++ b/src/put_page_request_base.cpp @@ -46,7 +46,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); a.credential()->sign_request(r, h, url, headers); } diff --git a/src/set_blob_metadata_request_base.cpp b/src/set_blob_metadata_request_base.cpp index 79bc8d6..6d0481e 100644 --- a/src/set_blob_metadata_request_base.cpp +++ b/src/set_blob_metadata_request_base.cpp @@ -29,7 +29,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); for (const auto& m : metadata()) { diff --git a/src/set_container_metadata_request_base.cpp b/src/set_container_metadata_request_base.cpp index 0181bc5..90cd759 100644 --- a/src/set_container_metadata_request_base.cpp +++ b/src/set_container_metadata_request_base.cpp @@ -30,7 +30,7 @@ namespace azure { namespace storage_lite { h.add_header(constants::header_user_agent, constants::header_value_user_agent); add_ms_header(h, headers, constants::header_ms_date, get_ms_date(date_format::rfc_1123)); - add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_version); + add_ms_header(h, headers, constants::header_ms_version, constants::header_value_storage_blob_version); for (const auto& m : metadata()) {