AWS supports various glacier conf options such as Standard, Expetided
to restore object with in a time period. Theses options may not be supported in
other S3 servers. So introducing option NoTier, so other vendors can be supported.
Resolves: rhbz#
2365095
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
(cherry picked from commit
a6e199398e6886806037467ae16bdef55f77b6c8)
The duration for which the objects are to be restored on the remote cloud service.
-* ``glacier_restore_tier_type`` (``Standard`` | ``Expedited``)
+* ``glacier_restore_tier_type`` (``Standard`` | ``Expedited`` | ``NoTier``)
The type of retrieval within the cloud service, which may represent different
-pricing. Supported options are ``Standard`` and ``Expedited``.
+pricing. Supported options are ``Standard``, ``Expedited`` and ``NoTier``.
+
+``NoTier`` for the s3 servers which does not follow options in ``Tier`` as per s3 protocol.
For example:
bufferlist bl, out_bl;
string resource = obj_to_aws_path(dest_obj);
- const std::string tier_v = (glacier_params.glacier_restore_tier_type == GlacierRestoreTierType::Expedited) ? "Expedited" : "Standard";
-
+ std::optional<std::string> tier_v;
+ if (glacier_params.glacier_restore_tier_type != GlacierRestoreTierType::NoTier) {
+ tier_v = (glacier_params.glacier_restore_tier_type == GlacierRestoreTierType::Expedited) ? "Expedited" : "Standard";
+ }
struct RestoreRequest {
std::optional<uint64_t> days;
std::optional<std::string> tier;
if (config.exists("glacier_restore_tier_type")) {
string s;
s = config["glacier_restore_tier_type"];
- if (s != "Expedited") {
- glacier_restore_tier_type = Standard;
- } else {
+ if (s == "Expedited") {
glacier_restore_tier_type = Expedited;
+ } else if (s == "NoTier") {
+ glacier_restore_tier_type = NoTier;
+ } else {
+ glacier_restore_tier_type = Standard;
}
}
return 0;
void RGWZoneGroupTierS3Glacier::dump(Formatter *f) const
{
encode_json("glacier_restore_days", glacier_restore_days, f);
- string s = (glacier_restore_tier_type == Standard ? "Standard" : "Expedited");
+ string s;
+ if (glacier_restore_tier_type == Expedited) {
+ s = "Expedited";
+ } else if (glacier_restore_tier_type == NoTier) {
+ s = "NoTier";
+ } else {
+ s = "Standard";
+ }
encode_json("glacier_restore_tier_type", s, f);
}
JSONDecoder::decode_json("glacier_restore_days", glacier_restore_days, obj);
string s;
JSONDecoder::decode_json("glacier_restore_tier_type", s, obj);
- if (s != "Expedited") {
- glacier_restore_tier_type = Standard;
- } else {
+ if (s == "Expedited") {
glacier_restore_tier_type = Expedited;
+ } else if (s == "NoTier") {
+ glacier_restore_tier_type = NoTier;
+ } else {
+ glacier_restore_tier_type = Standard;
}
}
enum GlacierRestoreTierType : uint8_t {
Standard = 0,
Expedited = 1,
+ NoTier = 2,
};
struct RGWZoneGroupTierS3Glacier {