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>
16 lines
425 B
Django/Jinja
16 lines
425 B
Django/Jinja
{%- if type_manager.get_parameters("header") | list | length > 0 %}
|
|
|
|
/// Header parameters
|
|
#[derive(Args)]
|
|
struct HeaderParameters {
|
|
{%- for name, param in type_manager.parameters | dictsort %}
|
|
{%- if param.location == "header" %}
|
|
{{ macros.docstring(param.description_with_defaults(), indent=4) }}
|
|
{{ param.clap_macros }}
|
|
{{ param.local_name}}: {{ param.type_hint }},
|
|
{%- endif %}
|
|
{%- endfor %}
|
|
}
|
|
|
|
{%- endif %}
|