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"""Constants used acros google.cloud.storage modules.""" 15 16# Storage classes 17 18STANDARD_STORAGE_CLASS = "STANDARD" 19"""Storage class for objects accessed more than once per month. 20 21See: https://cloud.google.com/storage/docs/storage-classes 22""" 23 24NEARLINE_STORAGE_CLASS = "NEARLINE" 25"""Storage class for objects accessed at most once per month. 26 27See: https://cloud.google.com/storage/docs/storage-classes 28""" 29 30COLDLINE_STORAGE_CLASS = "COLDLINE" 31"""Storage class for objects accessed at most once per year. 32 33See: https://cloud.google.com/storage/docs/storage-classes 34""" 35 36ARCHIVE_STORAGE_CLASS = "ARCHIVE" 37"""Storage class for objects accessed less frequently than once per year. 38 39See: https://cloud.google.com/storage/docs/storage-classes 40""" 41 42MULTI_REGIONAL_LEGACY_STORAGE_CLASS = "MULTI_REGIONAL" 43"""Legacy storage class. 44 45Alias for :attr:`STANDARD_STORAGE_CLASS`. 46 47Can only be used for objects in buckets whose 48:attr:`~google.cloud.storage.bucket.Bucket.location_type` is 49:attr:`~google.cloud.storage.bucket.Bucket.MULTI_REGION_LOCATION_TYPE`. 50 51See: https://cloud.google.com/storage/docs/storage-classes 52""" 53 54REGIONAL_LEGACY_STORAGE_CLASS = "REGIONAL" 55"""Legacy storage class. 56 57Alias for :attr:`STANDARD_STORAGE_CLASS`. 58 59Can only be used for objects in buckets whose 60:attr:`~google.cloud.storage.bucket.Bucket.location_type` is 61:attr:`~google.cloud.storage.bucket.Bucket.REGION_LOCATION_TYPE`. 62 63See: https://cloud.google.com/storage/docs/storage-classes 64""" 65 66DURABLE_REDUCED_AVAILABILITY_LEGACY_STORAGE_CLASS = "DURABLE_REDUCED_AVAILABILITY" 67"""Legacy storage class. 68 69Similar to :attr:`NEARLINE_STORAGE_CLASS`. 70""" 71 72 73# Location types 74 75MULTI_REGION_LOCATION_TYPE = "multi-region" 76"""Location type: data will be replicated across regions in a multi-region. 77 78Provides highest availability across largest area. 79""" 80 81REGION_LOCATION_TYPE = "region" 82"""Location type: data will be stored within a single region. 83 84Provides lowest latency within a single region. 85""" 86 87DUAL_REGION_LOCATION_TYPE = "dual-region" 88"""Location type: data will be stored within two primary regions. 89 90Provides high availability and low latency across two regions. 91""" 92 93 94# Internal constants 95 96_DEFAULT_TIMEOUT = 60 # in seconds 97"""The default request timeout in seconds if a timeout is not explicitly given. 98""" 99 100# Public Access Prevention 101PUBLIC_ACCESS_PREVENTION_ENFORCED = "enforced" 102"""Enforced public access prevention value. 103 104See: https://cloud.google.com/storage/docs/public-access-prevention 105""" 106 107PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = "unspecified" 108"""Unspecified public access prevention value. 109 110DEPRECATED: Use 'PUBLIC_ACCESS_PREVENTION_INHERITED' instead. 111 112See: https://cloud.google.com/storage/docs/public-access-prevention 113""" 114 115PUBLIC_ACCESS_PREVENTION_INHERITED = "inherited" 116"""Inherited public access prevention value. 117 118See: https://cloud.google.com/storage/docs/public-access-prevention 119""" 120