form_request_by_name - Linux


Overview

form_request_by_name is a command-line tool that generates a JSON request artifact based on an input YAML template file and a set of provided values.

Syntax

form_request_by_name [options] [template] [values]

Options/Flags

-n, –name: Specifies the name of the template to use.
-v, –version: Specifies the version of the template to use.
-o, –output: Specifies the output file path.
-h, –help: Displays help information.

Examples

Simple Example:

Generate a request artifact based on the "my_template.yml" template and the "my_values.yaml" values file:

form_request_by_name -n my_template -v 1.0 -i my_values.yaml

Advanced Example:

Generate a request artifact based on the "my_template.yml" template, the "my_values.yaml" values file, and override a specific value from the command line:

form_request_by_name -n my_template -v 1.0 -i my_values.yaml -v "foo=bar"

Common Issues

  • Template not found: Ensure the specified template name and version exist.
  • Values file not found: Verify that the provided values file is present and accessible.
  • Invalid template: Check if the template file is valid YAML and conforms to the expected schema.
  • Invalid values file: Ensure the values file is valid YAML and contains the required fields.

Integration

form_request_by_name can be integrated into scripts or automated pipelines to generate request artifacts dynamically based on provided values. For example:

template_name="my_template"
values_file="my_values.yaml"
output_file="my_request.json"

form_request_by_name -n $template_name -v 1.0 -i $values_file -o $output_file

Related Commands

  • form_request: Generates request artifacts based on Protobuf templates.
  • form_template: Creates or modifies request template artifacts.