Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/google/cloud/storage/constants.py: 100%

18 statements  

« prev     ^ index     » next       coverage.py v7.3.1, created at 2023-09-25 06:17 +0000

1# Copyright 2019 Google LLC 

2# 

3# Licensed under the Apache License, Version 2.0 (the "License"); 

4# you may not use this file except in compliance with the License. 

5# You may obtain a copy of the License at 

6# 

7# http://www.apache.org/licenses/LICENSE-2.0 

8# 

9# Unless required by applicable law or agreed to in writing, software 

10# distributed under the License is distributed on an "AS IS" BASIS, 

11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

12# See the License for the specific language governing permissions and 

13# limitations under the License. 

14 

15"""Constants used across google.cloud.storage modules. 

16 

17See [Python Storage Client Constants Page](https://github.com/googleapis/python-storage/blob/main/google/cloud/storage/constants.py) 

18for constants used across storage classes, location types, public access prevention, etc. 

19 

20""" 

21 

22# Storage classes 

23 

24STANDARD_STORAGE_CLASS = "STANDARD" 

25"""Storage class for objects accessed more than once per month. 

26 

27See: https://cloud.google.com/storage/docs/storage-classes 

28""" 

29 

30NEARLINE_STORAGE_CLASS = "NEARLINE" 

31"""Storage class for objects accessed at most once per month. 

32 

33See: https://cloud.google.com/storage/docs/storage-classes 

34""" 

35 

36COLDLINE_STORAGE_CLASS = "COLDLINE" 

37"""Storage class for objects accessed at most once per year. 

38 

39See: https://cloud.google.com/storage/docs/storage-classes 

40""" 

41 

42ARCHIVE_STORAGE_CLASS = "ARCHIVE" 

43"""Storage class for objects accessed less frequently than once per year. 

44 

45See: https://cloud.google.com/storage/docs/storage-classes 

46""" 

47 

48MULTI_REGIONAL_LEGACY_STORAGE_CLASS = "MULTI_REGIONAL" 

49"""Legacy storage class. 

50 

51Alias for :attr:`STANDARD_STORAGE_CLASS`. 

52 

53Can only be used for objects in buckets whose 

54:attr:`~google.cloud.storage.bucket.Bucket.location_type` is 

55:attr:`~google.cloud.storage.bucket.Bucket.MULTI_REGION_LOCATION_TYPE`. 

56 

57See: https://cloud.google.com/storage/docs/storage-classes 

58""" 

59 

60REGIONAL_LEGACY_STORAGE_CLASS = "REGIONAL" 

61"""Legacy storage class. 

62 

63Alias for :attr:`STANDARD_STORAGE_CLASS`. 

64 

65Can only be used for objects in buckets whose 

66:attr:`~google.cloud.storage.bucket.Bucket.location_type` is 

67:attr:`~google.cloud.storage.bucket.Bucket.REGION_LOCATION_TYPE`. 

68 

69See: https://cloud.google.com/storage/docs/storage-classes 

70""" 

71 

72DURABLE_REDUCED_AVAILABILITY_LEGACY_STORAGE_CLASS = "DURABLE_REDUCED_AVAILABILITY" 

73"""Legacy storage class. 

74 

75Similar to :attr:`NEARLINE_STORAGE_CLASS`. 

76""" 

77 

78 

79# Location types 

80 

81MULTI_REGION_LOCATION_TYPE = "multi-region" 

82"""Location type: data will be replicated across regions in a multi-region. 

83 

84Provides highest availability across largest area. 

85""" 

86 

87REGION_LOCATION_TYPE = "region" 

88"""Location type: data will be stored within a single region. 

89 

90Provides lowest latency within a single region. 

91""" 

92 

93DUAL_REGION_LOCATION_TYPE = "dual-region" 

94"""Location type: data will be stored within two primary regions. 

95 

96Provides high availability and low latency across two regions. 

97""" 

98 

99 

100# Internal constants 

101 

102_DEFAULT_TIMEOUT = 60 # in seconds 

103"""The default request timeout in seconds if a timeout is not explicitly given. 

104""" 

105 

106# Public Access Prevention 

107PUBLIC_ACCESS_PREVENTION_ENFORCED = "enforced" 

108"""Enforced public access prevention value. 

109 

110See: https://cloud.google.com/storage/docs/public-access-prevention 

111""" 

112 

113PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = "unspecified" 

114"""Unspecified public access prevention value. 

115 

116DEPRECATED: Use 'PUBLIC_ACCESS_PREVENTION_INHERITED' instead. 

117 

118See: https://cloud.google.com/storage/docs/public-access-prevention 

119""" 

120 

121PUBLIC_ACCESS_PREVENTION_INHERITED = "inherited" 

122"""Inherited public access prevention value. 

123 

124See: https://cloud.google.com/storage/docs/public-access-prevention 

125""" 

126 

127RPO_ASYNC_TURBO = "ASYNC_TURBO" 

128"""The recovery point objective (RPO) indicates how quickly newly written objects are asynchronously replicated to a separate geographic location. 

129When the RPO value is set to ASYNC_TURBO, the turbo replication feature is enabled. 

130 

131See: https://cloud.google.com/storage/docs/managing-turbo-replication 

132""" 

133 

134RPO_DEFAULT = "DEFAULT" 

135"""The recovery point objective (RPO) indicates how quickly newly written objects are asynchronously replicated to a separate geographic location. 

136When the RPO value is set to DEFAULT, the default replication behavior is enabled. 

137 

138See: https://cloud.google.com/storage/docs/managing-turbo-replication 

139"""