diff options
author | Mark Chappell <mchappel@redhat.com> | 2015-11-03 15:29:57 +0200 |
---|---|---|
committer | Mark Chappell <mchappel@redhat.com> | 2015-11-11 09:24:00 +0100 |
commit | ce309763c6da3c50d613ee243d98c215b3a13465 (patch) | |
tree | 0216e1d3f9f24a566c958e075c63585b3a532ba6 /network/endpoints/endpoint.yaml | |
parent | adefda09c02b6d0b6fe2bfd68513e03924bc028d (diff) |
Refacter Endpoints into EndpointMap
Because many of the service endpoints URLs use the same patterns for
generating the URLs it makes sense to use the same templates to reduce
the copy and paste.
In the process also adds support for explicitly specifying hostnames
for use in the endpoints. Note: DNS must be pre-configured. The
Heat templates do not directly configure DNS.
Change-Id: Ie3270909beca3d63f2d7e4bcb04c559380ddc54d
Co-Authored-By: Juan Antonio Osorio Robles <jaosorior@redhat.com>
Diffstat (limited to 'network/endpoints/endpoint.yaml')
-rw-r--r-- | network/endpoints/endpoint.yaml | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/network/endpoints/endpoint.yaml b/network/endpoints/endpoint.yaml new file mode 100644 index 00000000..8ffd6c4b --- /dev/null +++ b/network/endpoints/endpoint.yaml @@ -0,0 +1,55 @@ +heat_template_version: 2015-04-30 + +description: > + OpenStack Endpoint + +parameters: + EndpointName: + type: string + description: The name of the Endpoint being evaluated + EndpointMap: + type: json + default: {} + description: Mapping of service endpoint -> protocol. Typically set + via parameter_defaults in the resource registry. + IP: + type: string + description: The IP address of the Neutron Port that the endpoint is attached to + UriSuffix: + type: string + default: '' + description: A suffix attached to the URL + +outputs: + endpoint: + description: > + A Hash containing a mapping of service endpoints to ports, protocols, uris + assigned IPs, and hostnames for a specific endpoint + value: + port: {get_param: [EndpointMap, {get_param: EndpointName }, port] } + protocol: {get_param: [EndpointMap, {get_param: EndpointName }, protocol] } + host: + str_replace: + template: {get_param: [EndpointMap, {get_param: EndpointName }, host]} + params: {IP_ADDRESS: {get_param: IP} } + uri: + list_join: + - '' + - - {get_param: [EndpointMap, {get_param: EndpointName }, protocol] } + - '://' + - str_replace: + template: {get_param: [EndpointMap, {get_param: EndpointName }, host]} + params: {IP_ADDRESS: {get_param: IP} } + - ':' + - {get_param: [EndpointMap, {get_param: EndpointName }, port] } + - {get_param: UriSuffix } + uri_no_suffix: + list_join: + - '' + - - {get_param: [EndpointMap, {get_param: EndpointName }, protocol] } + - '://' + - str_replace: + template: {get_param: [EndpointMap, {get_param: EndpointName }, host]} + params: {IP_ADDRESS: {get_param: IP} } + - ':' + - {get_param: [EndpointMap, {get_param: EndpointName }, port] } |