Skip to content

Commit d09b109

Browse files
authored
Merge pull request #24 from stac-extensions/v2
Proposal for version 2
2 parents a93487e + 274b0f2 commit d09b109

File tree

16 files changed

+522
-258
lines changed

16 files changed

+522
-258
lines changed

CHANGELOG.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
### Fixed
1818

19+
## [v2.0.0] - 2024-08-30
20+
21+
### Added
22+
23+
- `storage:schemes`, `storage:refs` and Storage Scheme Object
24+
- Support the storage extension in Links
25+
- Support for the Alternate Assets Extension
26+
- Support for other storage providers, including custom S3 hosts
27+
28+
### Changed
29+
30+
- The extension is a framework for storage providers, it doesn't strictly define the individual providers.
31+
- The storage providers are grouped in `storage:schemes` and located in the Item Properties, Collections or Catalog metadata
32+
- Assets and Links reference the storage schemes by key in `storage:refs`
33+
34+
### Removed
35+
36+
- `storage:platform`, `storage:region`, `storage:requester_pays` and `storage:tier`
37+
(moved to Storage Scheme Object, except for the tier)
38+
1939
## [v1.0.0] - 2021-06-23
2040

2141
Initial release
2242

23-
[Unreleased]: <https://github.com/stac-extensions/storage/compare/v1.0.0...HEAD>
43+
[Unreleased]: <https://github.com/stac-extensions/storage/compare/v2.0.0...HEAD>
44+
[v2.0.0]: <https://github.com/stac-extensions/storage/compare/v1.0.0...v2.0.0>
2445
[v1.0.0]: <https://github.com/stac-extensions/storage/tree/v1.0.0>

CONTRIBUTING.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Contributing
2+
3+
All contributions are subject to the
4+
[STAC Specification Code of Conduct](https://github.com/radiantearth/stac-spec/blob/master/CODE_OF_CONDUCT.md).
5+
For contributions, please follow the
6+
[STAC specification contributing guide](https://github.com/radiantearth/stac-spec/blob/master/CONTRIBUTING.md) Instructions
7+
for running tests are copied here for convenience.
8+
9+
## Running tests
10+
11+
The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid.
12+
To run tests locally, you'll need `npm`, which is a standard part of any [node.js installation](https://nodejs.org/en/download/).
13+
14+
First you'll need to install everything with npm once. Just navigate to the root of this repository and on
15+
your command line run:
16+
17+
```bash
18+
npm install
19+
```
20+
21+
Then to check markdown formatting and test the examples against the JSON schema, you can run:
22+
23+
```bash
24+
npm test
25+
```
26+
27+
This will spit out the same texts that you see online, and you can then go and fix your markdown or examples.
28+
29+
If the tests reveal formatting problems with the examples, you can fix them with:
30+
31+
```bash
32+
npm run format-examples
33+
```
34+
35+
## Adding a new provider
36+
37+
1. Add documentation in a Markdown file to the folder `platforms`
38+
2. Add the provider to the table in the `README.md`, see chapter "type"
39+
3. Add a JSON Schema to the folder `json-schema/platforms`
40+
4. Add the schema to the extension schema in file `json-schema/schema.json` (search for `allOf` below the definition of `storage:schemes`)
41+
5. Add the newly created schema to the `validator-config.json`
42+
43+
Use the same file names (excluding the extension) for documentation and schema.

README.md

Lines changed: 74 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,110 @@
11
# Storage Extension Specification
22

33
- **Title:** Storage
4-
- **Identifier:** <https://stac-extensions.github.io/storage/v1.0.0/schema.json>
4+
- **Identifier:** <https://stac-extensions.github.io/storage/v2.0.0/schema.json>
55
- **Field Name Prefix:** storage
6-
- **Scope:** Item, Collection
6+
- **Scope:** Item, Catalog, Collection
77
- **Extension [Maturity Classification](https://github.com/radiantearth/stac-spec/tree/master/extensions/README.md#extension-maturity):** Pilot
8-
- **Owner**: @davidraleigh @matthewhanson
8+
- **Owner**: @matthewhanson @m-mohr
99

1010
This document explains the Storage Extension to the [SpatioTemporal Asset Catalog](https://github.com/radiantearth/stac-spec) (STAC) specification.
11-
It allows adding details related to cloud storage access and costs to be associated with STAC Assets.
11+
It allows adding details related to cloud object storage access and costs to be associated with STAC Assets.
1212
This extension does not cover NFS solutions provided by PaaS cloud companies.
1313

1414
- Examples:
15-
- [Item example 1](examples/item-naip.json): Shows the basic usage of the extension in a STAC Item.
16-
- [Item example 2](examples/item-nsl.json): Another example of basic usage.
15+
- [NAIP Item with Alternate Assets](examples/item-naip.json): Shows a mixture of storage providers, including custom S3 hosts
16+
and the [alternate assets extension](https://github.com/stac-extensions/alternate-assets).
17+
- [Catalog with Link](examples/catalog-link.json): Shows the usage of the extension on a link in a STAC Catalog.
18+
- [Collection with Auth](examples/catalog-link.json): Shows the usage of the extension in a STAC Collecion in combination with the
19+
[authentication extension](https://github.com/stac-extensions/authentication).
1720
- [JSON Schema](json-schema/schema.json)
1821
- [Changelog](./CHANGELOG.md)
1922

2023
## Fields
2124

2225
The fields in the table below can be used in these parts of STAC documents:
2326

27+
- [x] Catalogs
28+
- [x] Collections
29+
- [x] Item Properties (incl. Summaries in Collections)
30+
- [ ] Assets (for both Collections and Items, incl. Item Asset Definitions in Collections)
31+
- [ ] Links
32+
33+
| Field Name | Type | Description |
34+
| ----------------- | ------------------------------------------------------------ | ----------- |
35+
| `storage:schemes` | Map<string, [Storage Scheme Object](#storage-scheme-object)> | **REQUIRED.** A property that contains all of the storage schemes used by Assets and Links in the STAC Item, Catalog or Collection. |
36+
37+
---
38+
39+
The fields in the table below can be used in these parts of STAC documents:
40+
2441
- [ ] Catalogs
2542
- [ ] Collections
26-
- [x] Item Properties (incl. Summaries in Collections)
43+
- [ ] Item Properties (incl. Summaries in Collections)
2744
- [x] Assets (for both Collections and Items, incl. Item Asset Definitions in Collections)
28-
- [ ] Links
45+
- [x] Links
46+
- [x] [Alternate Assets Object](https://github.com/stac-extensions/alternate-assets?tab=readme-ov-file#alternate-asset-object)
2947

30-
| Field Name | Type | Description |
31-
| ---------------------- | --------- | ----------- |
32-
| storage:platform | string | The [cloud provider](#providers) where data is stored |
33-
| storage:region | string | The region where the data is stored. Relevant to speed of access and inter region egress costs (as defined by PaaS provider) |
34-
| storage:requester_pays | boolean | Is the data requester pays or is it data manager/cloud provider pays. *Defaults to false* |
35-
| storage:tier | string | The title for the tier type (as defined by PaaS provider) |
48+
| Field Name | Type | Description |
49+
| -------------- | ---------- | ----------- |
50+
| `storage:refs` | \[string\] | A property that specifies which schemes in `storage:schemes` may be used to access an Asset or Link. Each value must be one of the keys defined in `storage:schemes`. |
3651

37-
While these are all valid properties on an Item, they will typically be defined per-asset. If a field applies equally
38-
to all assets (e.g., storage:platform=AWS if all assets are on AWS), then it should be specified in Item properties.
52+
### Storage Scheme Object
3953

40-
### Additional Field Information
54+
| Field Name | Type | Description |
55+
| -------------- | ------- | ----------- |
56+
| type | string | **REQUIRED.** Type identifier for the platform, see below. |
57+
| platform | string | **REQUIRED.** The cloud provider where data is stored as URI or URI template to the API. |
58+
| region | string | The region where the data is stored. Relevant to speed of access and inter region egress costs (as defined by PaaS provider). |
59+
| requester_pays | boolean | Is the data "requester pays" (`true`) or is it "data manager/cloud provider pays" (`false`). Defaults to `false`. |
60+
| ... | ... | Additional properties as defined in the URL template or in the platform specific documents. |
4161

42-
#### Providers
43-
Currently this document is arranged to support object storage users of the following PaaS solutions:
62+
The properties `title` and `description` as defined in Common Metadata should be used as well.
4463

45-
- Alibaba Cloud (Aliyun): `ALIBABA`
46-
- Amazon AWS: `AWS`
47-
- Microsoft Azure: `AZURE`
48-
- Google Cloud Platform: `GCP`
49-
- IBM Cloud: `IBM`
50-
- Oracle Cloud: `ORACLE`
51-
- All other PaaS solutions: `OTHER`
64+
#### platform
5265

53-
The upper-cased values are meant to be used for `storage:platform`.
66+
The `platform` field identifies the cloud provider where the data is stored as URI or URI template to the API of the service.
5467

55-
#### Cloud Provider Storage Tiers
68+
If a URI template is provided, all variables must be defined in the Storage Scheme Object as a property with the same name.
69+
For example, the URI template `https://{bucket}.{region}.example.com` must have at least the properties
70+
`bucket` and `region` defined:
5671

57-
| Minimum Duration | [Google Cloud Platform](https://cloud.google.com/storage/docs/storage-classes) | [Amazon AWS](https://aws.amazon.com/s3/storage-classes/) | [Microsoft Azure](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-storage-tiers) | [IBM Cloud](https://cloud.ibm.com/objectstorage/create#pricing) | [Oracle Cloud](https://www.oracle.com/cloud/storage/pricing.html) | [Alibaba Cloud](https://www.alibabacloud.com/product/oss/pricing) |
58-
| ------------- | --------- | ------------------------ | ------- |---------- | ----------------- | ----------------- |
59-
| 0 (Auto-Tier) | | Intelligent-Tiering | | Smart Tier |
60-
| 0 days | STANDARD | Standard | hot | Standard | Standard | Standard |
61-
| 30 days | NEARLINE | Standard-IA, One Zone-IA | cool | Vault | Infrequent Access | Infrequent Access |
62-
| 60 days | | | | | | Archive |
63-
| 90 days | COLDLINE | Glacier | | Cold Vault | Archive | |
64-
| 180 days | | Glacier Deep Archive | archive | | | Cold Archive |
65-
| 365 days | ARCHIVE | | | | | |
72+
```json
73+
{
74+
"type": "example",
75+
"platform": "https://{bucket}.{region}.example.com",
76+
"region": "eu-fr",
77+
"bucket": "john-doe-stac",
78+
"requester_pays": true
79+
}
80+
```
6681

67-
## Contributing
82+
In case an `href` contains a non-HTTP URL that is not directly resolvable,
83+
the `platform` property must identify the host so that the URL can be resolved without further information.
84+
For example, this is especially useful to provide the endpoint URL for custom S3 providers.
85+
In this case the `platform` could effectively provide the endpoint URL.
6886

69-
All contributions are subject to the
70-
[STAC Specification Code of Conduct](https://github.com/radiantearth/stac-spec/blob/master/CODE_OF_CONDUCT.md).
71-
For contributions, please follow the
72-
[STAC specification contributing guide](https://github.com/radiantearth/stac-spec/blob/master/CONTRIBUTING.md) Instructions
73-
for running tests are copied here for convenience.
87+
#### type
7488

75-
### Running tests
89+
We try to collect pre-defined templates and best pratices for as many providers as possible
90+
in this repository, but be aware that these are not part of the official extension releases.
91+
This extension just provides the framework, the provider best pratices
92+
may change at any time without a new version of this extension being released.
7693

77-
The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid.
78-
To run tests locally, you'll need `npm`, which is a standard part of any [node.js installation](https://nodejs.org/en/download/).
94+
The following providers have defined best pratices at this point:
7995

80-
First you'll need to install everything with npm once. Just navigate to the root of this repository and on
81-
your command line run:
82-
```bash
83-
npm install
84-
```
96+
| `type` | Provider and Documentation |
97+
| ----------- | -------------------------- |
98+
| `aws-s3` | [AWS S3](platforms/aws-s3.md) |
99+
| `custom-s3` | [Generic S3 (non-AWS)](platforms/custom-s3.md) |
100+
| `ms-azure` | [Microsoft Azure](platforms/ms-azure.md) |
85101

86-
Then to check markdown formatting and test the examples against the JSON schema, you can run:
87-
```bash
88-
npm test
89-
```
102+
Feel encouraged to submit additional platform specifications via Pull Requests.
90103

91-
This will spit out the same texts that you see online, and you can then go and fix your markdown or examples.
104+
The `type` fields can be any value chosen by the implementor,
105+
but the types defined in the table above should be used as defined in the best practices.
106+
This ensures proper schema validation.
92107

93-
If the tests reveal formatting problems with the examples, you can fix them with:
94-
```bash
95-
npm run format-examples
96-
```
108+
## Contributing
109+
110+
See the [Contributor documentation](CONTRIBUTING.md) for details.

examples/catalog-link.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"stac_version": "1.0.0",
3+
"stac_extensions": [
4+
"https://stac-extensions.github.io/storage/v2.0.0/schema.json"
5+
],
6+
"type": "Catalog",
7+
"id": "20190822T183518Z_746_POM1_ST2_P",
8+
"title": "Example Catalog",
9+
"description": "An example catalog with a link to documentation on object storage.",
10+
"storage:schemes": {
11+
"aws": {
12+
"type": "aws-s3",
13+
"platform": "https://{bucket}.s3.{region}.amazonaws.com",
14+
"bucket": "mybucket",
15+
"region": "us-west-2",
16+
"requester_pays": true
17+
}
18+
},
19+
"links": [
20+
{
21+
"href": "https://example.com/examples/catalog-link.json",
22+
"rel": "self"
23+
},
24+
{
25+
"title": "Documentation",
26+
"href": "s3://mybucket/project/documentation.pdf",
27+
"type": "application/pdf",
28+
"rel": "about",
29+
"storage:refs": [
30+
"aws"
31+
]
32+
}
33+
]
34+
}

examples/collection.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"stac_version": "1.0.0",
3+
"stac_extensions": [
4+
"https://stac-extensions.github.io/storage/v2.0.0/schema.json",
5+
"https://stac-extensions.github.io/authentication/v1.1.0/schema.json"
6+
],
7+
"type": "Collection",
8+
"id": "20190822T183518Z_746_POM1_ST2_P",
9+
"title": "Example Collection",
10+
"description": "An example catalog with a link to documentation on object storage.",
11+
"license": "CC-0",
12+
"storage:schemes": {
13+
"aws": {
14+
"type": "aws-s3",
15+
"platform": "https://{bucket}.s3.{region}.amazonaws.com",
16+
"bucket": "mybucket",
17+
"region": "us-west-2",
18+
"requester_pays": true,
19+
"tier": "Standard"
20+
}
21+
},
22+
"auth:schemes": {
23+
"aws": {
24+
"type": "s3"
25+
}
26+
},
27+
"assets": {
28+
"stac-items": {
29+
"title": "STAC Items as GeoParquet",
30+
"href": "s3://mybucket/project/items.parquet",
31+
"type": "application/vnd.apache.parquet",
32+
"storage:refs": [
33+
"aws"
34+
],
35+
"auth:refs": [
36+
"aws"
37+
]
38+
}
39+
},
40+
"links": [
41+
{
42+
"href": "https://example.com/examples/catalog-link.json",
43+
"rel": "self"
44+
},
45+
{
46+
"title": "Documentation",
47+
"href": "s3://mybucket/project/documentation.pdf",
48+
"type": "application/pdf",
49+
"rel": "about",
50+
"storage:refs": [
51+
"aws"
52+
],
53+
"auth:refs": [
54+
"aws"
55+
]
56+
}
57+
],
58+
"extent": {
59+
"spatial": {
60+
"bbox": [
61+
[
62+
-180,
63+
-56,
64+
180,
65+
83
66+
]
67+
]
68+
},
69+
"temporal": {
70+
"interval": [
71+
[
72+
"2015-06-23T00:00:00Z",
73+
null
74+
]
75+
]
76+
}
77+
}
78+
}

0 commit comments

Comments
 (0)