Certain API operations support/require additional header parameters to be set with the query (i.e. DNS supports `x-auth-all-projects` and `x-auth-sudo-project-id`). Such supported headers should be known from the OpenAPI spec, so add them in the CLI operation and correspondingly set them into the query. In difference to the `python-designateclient` `x-auth-all-projects` will not be set by default, it is wrong to assume so. Admin user is expected to set this parameter in the CLI invocation explicitly. Change-Id: I49b9c31dc47911e261cbdd880c3e6d7327e50f4b Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
14 lines
534 B
Django/Jinja
14 lines
534 B
Django/Jinja
{%- if type_manager.get_parameters("header") | list | length > 0 -%}
|
|
|
|
// Set header parameters
|
|
{%- for (k, v) in type_manager.get_parameters("header") %}
|
|
{%- if not v.is_required %}
|
|
if let Some(val) = &self.headers.{{ v.local_name }} {
|
|
{{ macros.set_request_header_from_input(type_manager, "ep_builder", v, "val")}}
|
|
}
|
|
{%- else %}
|
|
{{ macros.set_request_header_from_input(type_manager, "ep_builder", v, "&self.headers." + v.local_name )}}
|
|
{%- endif %}
|
|
{%- endfor %}
|
|
{% endif -%}
|