Last active
February 23, 2021 19:30
-
-
Save cari-lynn/5d6f4a4a8969199d479d38e051258b35 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@data/values | |
--- | |
#! default base of all endpoints | |
endpoints: | |
default: | |
base: https://default-server | |
serviceA: | |
base: ~ | |
path: /service/v2/A | |
serviceB: | |
base: ~ | |
path: /service/B | |
serviceC: | |
base: ~ | |
path: /service/C | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@ load("@ytt:data", "data"); d = data.values | |
#@ load("endpoints.star", "service_url") | |
--- | |
endpoints: | |
serviceA_URL: #@ service_url(d.endpoints, "serviceA") | |
serviceB_URL: #@ service_url(d.endpoints, "serviceB") | |
serviceC_URL: #@ service_url(d.endpoints, "serviceC") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def service_url(dvs, name): | |
base = dvs[name].base or dvs.default.base | |
return base + dvs[name].path | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@data/values | |
--- | |
endpoints: | |
default: | |
base: https://staging-server | |
serviceA: | |
base: http://new-server | |
path: /as/new/path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment