Class LifecycleRule (2.21.0)

Defines objects to read, create, and modify Object Lifecycle Rules.

Object Lifecycle Rules allow to configure a Bucket to automatically delete or change the storage class of objects as they go through lifecycle events.

See Also

https://cloud.google.com/storage/docs/lifecycle for general information on Object Lifecycle Management in Google Cloud Storage.

Constructors

LifecycleRule(LifecycleRuleCondition, LifecycleRuleAction)

Parameters
NameDescription
condition LifecycleRuleCondition
action LifecycleRuleAction

Functions

static Delete()

Creates different types of LifecycleRule actions.

Returns
TypeDescription
LifecycleRuleAction

static AbortIncompleteMultipartUpload()

Creates different types of LifecycleRule actions.

Returns
TypeDescription
LifecycleRuleAction

static SetStorageClassStandard()

Creates different types of LifecycleRule actions.

Returns
TypeDescription
LifecycleRuleAction

static SetStorageClassMultiRegional()

Creates different types of LifecycleRule actions.

Returns
TypeDescription
LifecycleRuleAction

static SetStorageClassRegional()

Creates different types of LifecycleRule actions.

Returns
TypeDescription
LifecycleRuleAction

static SetStorageClassNearline()

Creates different types of LifecycleRule actions.

Returns
TypeDescription
LifecycleRuleAction

static SetStorageClassColdline()

Creates different types of LifecycleRule actions.

Returns
TypeDescription
LifecycleRuleAction

static SetStorageClassDurableReducedAvailability()

Creates different types of LifecycleRule actions.

Returns
TypeDescription
LifecycleRuleAction

static SetStorageClassArchive()

Creates different types of LifecycleRule actions.

Returns
TypeDescription
LifecycleRuleAction

static SetStorageClass(std::string)

Creates different types of LifecycleRule actions.

Parameter
NameDescription
storage_class std::string
Returns
TypeDescription
LifecycleRuleAction

static MaxAge(std::int32_t)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
days std::int32_t
Returns
TypeDescription
LifecycleRuleCondition

static CreatedBefore(absl::CivilDay)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
date absl::CivilDay
Returns
TypeDescription
LifecycleRuleCondition

static IsLive(bool)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
value bool
Returns
TypeDescription
LifecycleRuleCondition

static MatchesStorageClass(std::string)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
storage_class std::string
Returns
TypeDescription
LifecycleRuleCondition

static MatchesStorageClasses(std::initializer_list< std::string >)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
list std::initializer_list< std::string >
Returns
TypeDescription
LifecycleRuleCondition

static MatchesStorageClasses(Iterator, Iterator)

Creates different types of LifecycleRule rules.

Parameters
NameDescription
begin Iterator
end Iterator
typename Iterator
Returns
TypeDescription
LifecycleRuleCondition

static MatchesStorageClassStandard()

Creates different types of LifecycleRule rules.

Returns
TypeDescription
LifecycleRuleCondition

static MatchesStorageClassMultiRegional()

Creates different types of LifecycleRule rules.

Returns
TypeDescription
LifecycleRuleCondition

static MatchesStorageClassRegional()

Creates different types of LifecycleRule rules.

Returns
TypeDescription
LifecycleRuleCondition

static MatchesStorageClassNearline()

Creates different types of LifecycleRule rules.

Returns
TypeDescription
LifecycleRuleCondition

static MatchesStorageClassColdline()

Creates different types of LifecycleRule rules.

Returns
TypeDescription
LifecycleRuleCondition

static MatchesStorageClassDurableReducedAvailability()

Creates different types of LifecycleRule rules.

Returns
TypeDescription
LifecycleRuleCondition

static MatchesStorageClassArchive()

Creates different types of LifecycleRule rules.

Returns
TypeDescription
LifecycleRuleCondition

static NumNewerVersions(std::int32_t)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
days std::int32_t
Returns
TypeDescription
LifecycleRuleCondition

static DaysSinceNoncurrentTime(std::int32_t)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
days std::int32_t
Returns
TypeDescription
LifecycleRuleCondition

static NoncurrentTimeBefore(absl::CivilDay)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
date absl::CivilDay
Returns
TypeDescription
LifecycleRuleCondition

static DaysSinceCustomTime(std::int32_t)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
days std::int32_t
Returns
TypeDescription
LifecycleRuleCondition

static CustomTimeBefore(absl::CivilDay)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
date absl::CivilDay
Returns
TypeDescription
LifecycleRuleCondition

static MatchesPrefix(std::string)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
prefix std::string
Returns
TypeDescription
LifecycleRuleCondition

static MatchesPrefixes(std::initializer_list< std::string >)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
list std::initializer_list< std::string >
Returns
TypeDescription
LifecycleRuleCondition

static MatchesSuffix(std::string)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
suffix std::string
Returns
TypeDescription
LifecycleRuleCondition

static MatchesSuffixes(std::initializer_list< std::string >)

Creates different types of LifecycleRule rules.

Parameter
NameDescription
list std::initializer_list< std::string >
Returns
TypeDescription
LifecycleRuleCondition

action() const

Returns
TypeDescription
LifecycleRuleAction const &

condition() const

Returns
TypeDescription
LifecycleRuleCondition const &

static ConditionConjunction(Condition &&...)

Combines multiple LifecycleRule conditions using conjunction.

Create a condition that require all the condition parameters to be met to take effect.

Example
// Affect objects that are in the STANDARD storage class, have at
// least 2 new versions, are at least 7 days old, and are alive.
LifecycleRuleCondition condition = LifecycleRule::ConditionConjunction(
    LifecycleRule::NumNewerVersions(2),
    LifecycleRule::MatchesStorageClassStandard(),
    LifecycleRule::MaxAge(7), LifecycleRule::IsLive(true));
Parameters
NameDescription
condition Condition &&...
typename...
Exceptions
TypeDescription
std::invalid_argumentif the list of parameters is contradictory, for example, `IsLive(true)` and `IsLive(false)` are in the `condition` list.
Returns
TypeDescription
LifecycleRuleCondition

a LifecycleRuleCondition that is satisfied when all the condition conditions are satisfied.