Skip to content

Commit

Permalink
feat: add support for ARCHIVE storage class (#2428)
Browse files Browse the repository at this point in the history
* feat: add support for ARCHIVE storage class

* update documentation

* fix docs
  • Loading branch information
jdpedrie authored and dwsupplee committed Dec 30, 2019
1 parent ca739c4 commit bb0e3d9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
11 changes: 8 additions & 3 deletions Storage/src/Bucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -821,9 +821,14 @@ public function delete(array $options = [])
* current bucket's logs.
* @type string $storageClass The bucket's storage class. This defines
* how objects in the bucket are stored and determines the SLA and
* the cost of storage. Acceptable values include
* `"MULTI_REGIONAL"`, `"REGIONAL"`, `"NEARLINE"`, `"COLDLINE"`,
* `"STANDARD"` and `"DURABLE_REDUCED_AVAILABILITY"`.
* the cost of storage. Acceptable values include the following
* strings: `"STANDARD"`, `"NEARLINE"`, `"COLDLINE"` and
* `"ARCHIVE"`. Legacy values including `"MULTI_REGIONAL"`,
* `"REGIONAL"` and `"DURABLE_REDUCED_AVAILABILITY"` are also
* available, but should be avoided for new implementations. For
* more information, refer to the
* [Storage Classes](https://cloud.google.com/storage/docs/storage-classes)
* documentation. **Defaults to** `"STANDARD"`.
* @type array $versioning The bucket's versioning configuration.
* @type array $website The bucket's website configuration.
* @type array $billing The bucket's billing configuration.
Expand Down
3 changes: 2 additions & 1 deletion Storage/src/Lifecycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public function __construct(array $lifecycle = [])
* @type string[] $matchesStorageClass Objects having any of the storage
* classes specified by this condition will be matched. Values
* include `"MULTI_REGIONAL"`, `"REGIONAL"`, `"NEARLINE"`,
* `"COLDLINE"`, `"STANDARD"`, and `"DURABLE_REDUCED_AVAILABILITY"`.
* `"ARCHIVE"`, `"COLDLINE"`, `"STANDARD"`, and
* `"DURABLE_REDUCED_AVAILABILITY"`.
* @type int $numNewerVersions Relevant only for versioned objects. If
* the value is N, this condition is satisfied when there are at
* least N versions (including the live version) newer than this
Expand Down
12 changes: 8 additions & 4 deletions Storage/src/StorageClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,14 @@ function (array $bucket) use ($userProject) {
* current bucket's logs.
* @type string $storageClass The bucket's storage class. This defines
* how objects in the bucket are stored and determines the SLA and
* the cost of storage. Acceptable values include
* `"MULTI_REGIONAL"`, `"REGIONAL"`, `"NEARLINE"`, `"COLDLINE"`,
* `"STANDARD"` and `"DURABLE_REDUCED_AVAILABILITY"`.
* **Defaults to** `STANDARD`.
* the cost of storage. Acceptable values include the following
* strings: `"STANDARD"`, `"NEARLINE"`, `"COLDLINE"` and
* `"ARCHIVE"`. Legacy values including `"MULTI_REGIONAL"`,
* `"REGIONAL"` and `"DURABLE_REDUCED_AVAILABILITY"` are also
* available, but should be avoided for new implementations. For
* more information, refer to the
* [Storage Classes](https://cloud.google.com/storage/docs/storage-classes)
* documentation. **Defaults to** `"STANDARD"`.
* @type array $versioning The bucket's versioning configuration.
* @type array $website The bucket's website configuration.
* @type array $billing The bucket's billing configuration.
Expand Down
7 changes: 6 additions & 1 deletion Storage/tests/System/ManageBucketsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function testLabels()
}

/**
* @group location
* @group storage-bucket-location
* @dataProvider locationTypes
*/
public function testBucketLocationType($storageClass, $location, $expectedLocationType, $updateStorageClass)
Expand Down Expand Up @@ -260,6 +260,11 @@ public function locationTypes()
'nam4',
'dual-region',
'STANDARD'
], [
'ARCHIVE',
'nam4',
'dual-region',
'STANDARD'
]
];
}
Expand Down

0 comments on commit bb0e3d9

Please sign in to comment.