cos_params.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. #ifndef COS_PARAMS_H
  2. #define COS_PARAMS_H
  3. #include <string>
  4. namespace qcloud_cos{
  5. /// http header中的Authorization字段
  6. const std::string kHttpHeaderAuthorization = "Authorization";
  7. //const std::string kParaCustomHeaders = "custom_headers";
  8. const std::string kHttpHeaderCacheControl = "Cache-Control";
  9. const std::string kHttpHeaderContentType = "Content-Type";
  10. const std::string kHttpHeaderContentLength = "Content-Length";
  11. const std::string kHttpHeaderContentDisposition = "Content-Disposition";
  12. const std::string kHttpHeaderContentLanguage = "Content-Language";
  13. const std::string kHttpHeaderContentEncoding = "Content-Encoding";
  14. const std::string kHttpHeaderContentRange = "Content-Range";
  15. const std::string kHttpHeaderExpires = "Expires";
  16. const std::string kHttpHeaderLastModified = "Last-Modified";
  17. const std::string kHttpHeaderConnection = "Connection";
  18. const std::string kHttpHeaderDate = "Date";
  19. const std::string kHttpHeaderServer = "Server";
  20. const std::string kHttpHeaderEtag = "ETag";
  21. const std::string kHttpHeaderLowerCaseEtag = "Etag";
  22. const std::string kParaXCosMetaPrefix = "x-cos-meta-";
  23. const std::string kParaMoveDstFileid = "dest_fileid";
  24. const std::string kParaMoveOverWrite = "to_over_write";
  25. const std::string kParaListNum = "num";
  26. const std::string kParaListFlag = "list_flag";
  27. const std::string kParaListContext = "context";
  28. // const std::string kParaErrorDesc = "parameter error";
  29. // const std::string kNetworkErrorDesc = "network error";
  30. // const std::string kLocalFileNotExistDesc = "local file not exist";
  31. // const std::string kParaPathIleagel = "path ileagel error";
  32. // const std::string kCanNotOpRootPath = "can not operator root folder";
  33. // x-cos-meta-前缀
  34. const std::string kXCosMetaPrefix = "x-cos-meta-";
  35. // Request Header
  36. const std::string kReqHeaderEtag = "ETag";
  37. const std::string kReqHeaderLowerCaseEtag = "Etag";
  38. const std::string kReqHeaderContentLen = "Content-Length";
  39. const std::string kReqHeaderContentType = "Content-Type";
  40. const std::string kReqHeaderConnection = "Connection";
  41. const std::string kReqHeaderDate = "Date";
  42. const std::string kReqHeaderServer = "Server";
  43. const std::string kReqHeaderXCosReqId = "x-cos-request-id";
  44. const std::string kReqHeaderXCosTraceId = "x-cos-trace-id";
  45. // Response Header
  46. const std::string kRespHeaderLastModified = "Last-Modified";
  47. const std::string kRespHeaderXCosObjectType = "x-cos-object-type";
  48. const std::string kRespHeaderXCosStorageClass = "x-cos-storage-class";
  49. const std::string kRespHeaderXCosHashCrc64Ecma = "x-cos-hash-crc64ecma";
  50. const std::string kRespHeaderXCosStorageTier = "x-cos-storage-tier";
  51. const std::string kRespHeaderXCosReqId = "x-cos-request-id";
  52. const std::string kRespHeaderXCosTraceId = "x-cos-trace-id";
  53. const std::string kRespHeaderXCosNextAppendPosition = "x-cos-next-append-position";
  54. const std::string kRespHeaderXCosContentSha1 = "x-cos-content-sha1";
  55. // doc preview response header
  56. const std::string kRespHeaderXTotalPage = "X-Total-Page";
  57. const std::string kRespHeaderXErrNo = "X-ErrNo";
  58. const std::string kRespHeaderXTotalSheet = "X-Total-Sheet";
  59. const std::string kRespHeaderXSheetName = "X-Sheet-Name";
  60. // V5 返回错误信息的xml node名
  61. const std::string kErrorRoot = "Error";
  62. const std::string kErrorCode = "Code";
  63. const std::string kErrorMessage = "Message";
  64. const std::string kErrorResource = "Resource";
  65. const std::string kErrorTraceId = "TraceId";
  66. const std::string kErrorRequestId = "RequestId";
  67. const std::string kErrorServerTime = "ServerTime";
  68. // GetBucketResponse XML node
  69. const std::string kGetBucketRoot = "ListBucketResult";
  70. const std::string kGetBucketName = "Name";
  71. const std::string kGetBucketDelimiter = "Delimiter";
  72. const std::string kGetBucketEncodingType = "EncodingType";
  73. const std::string kGetBucketNextMarker = "NextMarker";
  74. const std::string kGetBucketPrefix = "Prefix";
  75. const std::string kGetBucketMarker = "Marker";
  76. const std::string kGetBucketMaxKeys = "MaxKeys";
  77. const std::string kGetBucketIsTruncated = "IsTruncated";
  78. const std::string kGetBucketCommonPrefixes = "CommonPrefixes";
  79. const std::string kGetBucketContents = "Contents";
  80. const std::string kGetBucketContentsKey = "Key";
  81. const std::string kGetBucketContentsLastModified = "LastModified";
  82. const std::string kGetBucketContentsETag = "ETag";
  83. const std::string kGetBucketContentsSize = "Size";
  84. const std::string kGetBucketContentsStorageClass = "StorageClass";
  85. const std::string kGetBucketContentsOwner = "Owner";
  86. const std::string kGetBucketContentsOwnerID = "ID";
  87. // ListMultipartUpload XML node
  88. const std::string kListMultipartUploadRoot = "ListMultipartUploadsResult";
  89. const std::string kListMultipartUploadBucket = "Bucket";
  90. const std::string kListMultipartUploadMarker = "KeyMarker";
  91. const std::string kListMultipartUploadIdMarker = "UploadIdMarker";
  92. const std::string kListMultipartUploadNextKeyMarker = "NextKeyMarker";
  93. const std::string kListMultipartUploadNextUploadIdMarker = "NextUploadIdMarker";
  94. const std::string kListMultipartUploadMaxUploads = "MaxUploads";
  95. const std::string kListMultipartUploadUpload = "Upload";
  96. const std::string kListMultipartUploadKey = "Key";
  97. const std::string kListMultipartUploadId = "UploadId";
  98. const std::string kListMultipartUploadStorageClass = "StorageClass";
  99. const std::string kListMultipartUploadInitiator = "Initiator";
  100. const std::string kListMultipartUploadOwner = "Owner";
  101. const std::string kListMultipartUploadInitiated = "Initiated";
  102. const std::string kListMultipartUploadID = "ID";
  103. const std::string kListMultipartUploadDisplayName = "DisplayName";
  104. // BucketReplicationResponse XML node
  105. const std::string kBucketReplicationRoot = "ReplicationConfiguration";
  106. const std::string kBucketReplicationRule = "Rule";
  107. const std::string kBucketReplicationID = "ID";
  108. const std::string kBucketReplicationRole = "Role";
  109. const std::string kBucketReplicationPrefix = "Prefix";
  110. const std::string kBucketReplicationStatus = "Status";
  111. const std::string kBucketReplicationDestination = "Destination";
  112. const std::string kBucketReplicationBucket = "Bucket";
  113. const std::string kBucketReplicationStorageClass = "StorageClass";
  114. // InitMultiUploadResp XML node
  115. const std::string kInitiateMultipartUploadRoot = "InitiateMultipartUploadResult";
  116. const std::string kInitiateMultipartUploadBucket = "Bucket";
  117. const std::string kInitiateMultipartUploadKey = "Key";
  118. const std::string kInitiateMultipartUploadId = "UploadId";
  119. // CompleteMultiUploadResp XML node
  120. const std::string kCompleteMultiUploadRoot = "CompleteMultipartUploadResult";
  121. const std::string kCompleteMultiUploadLocation = "Location";
  122. const std::string kCompleteMultiUploadBucket = "Bucket";
  123. const std::string kCompleteMultiUploadKey = "Key";
  124. const std::string kCompleteMultiUploadETag = "ETag";
  125. // StorageClass
  126. const std::string kStorageClassStandard = "STANDARD";
  127. const std::string kStorageClassStandardIA = "STANDARD_IA";
  128. const std::string kStorageClassMAZStandard = "MAZ_STANDARD";
  129. const std::string kStorageClassMAZStandardIA = "MAZ_STANDARD_IA";
  130. const std::string kStorageClassIntelligentTiering = "INTELLIGENT_TIERING";
  131. const std::string kStorageClassArchive = "ARCHIVE";
  132. const std::string kStorageClassDeepArchive = "DEEP_ARCHIVE";
  133. // Resumable download
  134. const std::string kResumableDownloadTaskFileSuffix = ".cosresumabletask";
  135. const std::string kResumableDownloadFileName = "fileName";
  136. const std::string kResumableDownloadTaskLastModified = "lastModified";
  137. const std::string kResumableDownloadTaskContentLength = "contentLength";
  138. const std::string kResumableDownloadTaskEtag = "eTag";
  139. const std::string kResumableDownloadTaskCrc64ecma = "crc64ecma";
  140. const std::string kResumableDownloadResumeOffset = "resumeOffset";
  141. // 预设ACL
  142. const std::string kAclDefault = "default";
  143. const std::string kAclPrivate = "private";
  144. const std::string kAclPublicRead = "public-read";
  145. const std::string kAclPublicReadWrite = "public-read-write";
  146. const std::string kAclAuthenticatedRead = "authenticated-read";
  147. const std::string kAclBucketOwnerRead = "bucket-owner-read";
  148. // object type
  149. const std::string kObjectTypeAppendable = "appendable";
  150. const std::string kObjectTypeNormal = "normal";
  151. } // namespace qcloud_cos
  152. #endif