forked from googleapis/python-storage
/
constants.py
131 lines (90 loc) · 3.61 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Constants used acros google.cloud.storage modules."""
# Storage classes
STANDARD_STORAGE_CLASS = "STANDARD"
"""Storage class for objects accessed more than once per month.
See: https://cloud.google.com/storage/docs/storage-classes
"""
NEARLINE_STORAGE_CLASS = "NEARLINE"
"""Storage class for objects accessed at most once per month.
See: https://cloud.google.com/storage/docs/storage-classes
"""
COLDLINE_STORAGE_CLASS = "COLDLINE"
"""Storage class for objects accessed at most once per year.
See: https://cloud.google.com/storage/docs/storage-classes
"""
ARCHIVE_STORAGE_CLASS = "ARCHIVE"
"""Storage class for objects accessed less frequently than once per year.
See: https://cloud.google.com/storage/docs/storage-classes
"""
MULTI_REGIONAL_LEGACY_STORAGE_CLASS = "MULTI_REGIONAL"
"""Legacy storage class.
Alias for :attr:`STANDARD_STORAGE_CLASS`.
Can only be used for objects in buckets whose
:attr:`~google.cloud.storage.bucket.Bucket.location_type` is
:attr:`~google.cloud.storage.bucket.Bucket.MULTI_REGION_LOCATION_TYPE`.
See: https://cloud.google.com/storage/docs/storage-classes
"""
REGIONAL_LEGACY_STORAGE_CLASS = "REGIONAL"
"""Legacy storage class.
Alias for :attr:`STANDARD_STORAGE_CLASS`.
Can only be used for objects in buckets whose
:attr:`~google.cloud.storage.bucket.Bucket.location_type` is
:attr:`~google.cloud.storage.bucket.Bucket.REGION_LOCATION_TYPE`.
See: https://cloud.google.com/storage/docs/storage-classes
"""
DURABLE_REDUCED_AVAILABILITY_LEGACY_STORAGE_CLASS = "DURABLE_REDUCED_AVAILABILITY"
"""Legacy storage class.
Similar to :attr:`NEARLINE_STORAGE_CLASS`.
"""
# Location types
MULTI_REGION_LOCATION_TYPE = "multi-region"
"""Location type: data will be replicated across regions in a multi-region.
Provides highest availability across largest area.
"""
REGION_LOCATION_TYPE = "region"
"""Location type: data will be stored within a single region.
Provides lowest latency within a single region.
"""
DUAL_REGION_LOCATION_TYPE = "dual-region"
"""Location type: data will be stored within two primary regions.
Provides high availability and low latency across two regions.
"""
# Internal constants
_DEFAULT_TIMEOUT = 60 # in seconds
"""The default request timeout in seconds if a timeout is not explicitly given.
"""
# Public Access Prevention
PUBLIC_ACCESS_PREVENTION_ENFORCED = "enforced"
"""Enforced public access prevention value.
See: https://cloud.google.com/storage/docs/public-access-prevention
"""
PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = "unspecified"
"""Unspecified public access prevention value.
DEPRECATED: Use 'PUBLIC_ACCESS_PREVENTION_INHERITED' instead.
See: https://cloud.google.com/storage/docs/public-access-prevention
"""
PUBLIC_ACCESS_PREVENTION_INHERITED = "inherited"
"""Inherited public access prevention value.
See: https://cloud.google.com/storage/docs/public-access-prevention
"""
RPO_ASYNC_TURBO = "ASYNC_TURBO"
"""Turbo Replication RPO
See: https://cloud.google.com/storage/docs/managing-turbo-replication
"""
RPO_DEFAULT = "DEFAULT"
"""Default RPO
See: https://cloud.google.com/storage/docs/managing-turbo-replication
"""