|
| 1 | +# FinOps FOCUS JSON Schemas |
| 2 | + |
| 3 | +This repository contains JSON schemas and tools for the [FinOps Foundation's Open Cost and Usage Specification (FOCUS)](https://focus.finops.org/). |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +To use the schema, clone this repository or download the schema directly and reference the JSON schema file in your data validation tools or scripts. Bundled schemas can be found in the `schemas/bundled` folder: |
| 8 | + |
| 9 | +- [`v1.0-Preview Candidate Release`](./schemas/bundled/1.0-rc.1.schema.json) |
| 10 | + |
| 11 | +## Roadmap |
| 12 | + |
| 13 | +- [ ] Conditional rules, for example: |
| 14 | + |
| 15 | + ```json |
| 16 | + "$defs": { |
| 17 | + "rules": { |
| 18 | + "allOf": [ |
| 19 | + { |
| 20 | + "$description": "When ChargeCategory is 'Purchase', ChargeFrequency MUST NOT be 'Usage-Based'.", |
| 21 | + "if": { |
| 22 | + "properties": { |
| 23 | + "ChargeCategory": { "const": "Purchase" } |
| 24 | + } |
| 25 | + }, |
| 26 | + "then": { |
| 27 | + "properties": { |
| 28 | + "ChargeFrequency": { "not": { "const": "Usage-Based" } } |
| 29 | + } |
| 30 | + } |
| 31 | + } |
| 32 | + ] |
| 33 | + } |
| 34 | + } |
| 35 | + ``` |
| 36 | + |
| 37 | +- [ ] Validation CLI command |
| 38 | +- [ ] Sample data generation command |
| 39 | + |
| 40 | +## Contributing |
| 41 | + |
| 42 | +Contributions to the schema are welcome, particularly in the following areas: |
| 43 | + |
| 44 | +- Enhancements to reflect updates in the FinOps FOCUS specification. |
| 45 | +- Additional examples and use cases. |
| 46 | + |
| 47 | +## Development |
| 48 | + |
| 49 | +**For an optimal developer experience, it is recommended to install [Nix](https://nixos.org/download.html) and [direnv](https://direnv.net/docs/installation.html).** |
| 50 | + |
| 51 | +<details><summary><i>Installing Nix and direnv</i></summary><br> |
| 52 | + |
| 53 | +**Note: These are instructions that _SHOULD_ work in most cases. Consult the links above for the official instructions for your OS.** |
| 54 | + |
| 55 | +Install Nix: |
| 56 | + |
| 57 | +```sh |
| 58 | +sh <(curl -L https://nixos.org/nix/install) --daemon |
| 59 | +``` |
| 60 | + |
| 61 | +Consult the [installation instructions](https://direnv.net/docs/installation.html) to install direnv using your package manager. |
| 62 | + |
| 63 | +On MacOS: |
| 64 | + |
| 65 | +```sh |
| 66 | +brew install direnv |
| 67 | +``` |
| 68 | + |
| 69 | +Install from binary builds: |
| 70 | + |
| 71 | +```sh |
| 72 | +curl -sfL https://direnv.net/install.sh | bash |
| 73 | +``` |
| 74 | + |
| 75 | +The last step is to configure your shell to use direnv. For example for bash, add the following lines at the end of your `~/.bashrc`: |
| 76 | + |
| 77 | + eval "\$(direnv hook bash)" |
| 78 | + |
| 79 | +**Then restart the shell.** |
| 80 | + |
| 81 | +For other shells, see [https://direnv.net/docs/hook.html](https://direnv.net/docs/hook.html). |
| 82 | + |
| 83 | +**MacOS specific instructions** |
| 84 | + |
| 85 | +Nix may stop working after a MacOS upgrade. If it does, follow [these instructions](https://github.com/NixOS/nix/issues/3616#issuecomment-662858874). |
| 86 | + |
| 87 | +<hr> |
| 88 | +</details> |
| 89 | + |
| 90 | +## License |
| 91 | + |
| 92 | +This project is licensed under the MIT License - see the LICENSE file for details. |
0 commit comments