Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zypp-io/zypp-containers
https://github.com/zypp-io/zypp-containers
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/zypp-io/zypp-containers
- Owner: zypp-io
- License: mit
- Created: 2023-08-30T09:39:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-13T14:19:34.000Z (about 1 year ago)
- Last Synced: 2024-02-12T17:49:39.596Z (11 months ago)
- Language: Python
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
The Zypp Containers package retrieves the container parameters from that have been configured in your data portal. The package operates under the assumption that you have a `Zypp dataportaal` and use the standard datamodel that comes with it.
The `get_container_params` is the main function in the package. As parameters it accepts the name of the container for which you are trying to retrieve the parameters aswell as the schema under which the container tables can be found in your database. The `schema` parameter has a default value of `dataportaal`. The parameters are returned as a dictionary.
### Example
The below code could be found on the image of the container that you want to run. Originally, the `year` and `category` parameter might have been hardcoded into the script. Now, these can be configured in the database (through your dataportal) and retrieved when the container is started.```py
from zypp_containers import get_container_paramsdef run(year, category):
# .....parameters = get_container_params('afas_consolidation')
year, category = parameters["year"], parameters["category"]
run_afas_consolidation(year=year, category=category)
```