For the complete documentation index, see llms.txt. This page is also available as Markdown.

Parameter Types

This guide introduces the usage methods for different parameter types in Zenlayer Cloud CLI.

Parameter Types Overview

Zenlayer Cloud CLI supports the following parameter types:

  • String Parameters - Plain text strings

  • Enum Parameters - Parameters selected from predefined values

  • Integer Parameters - Integer values

  • Float Parameters - Floating-point values

  • Boolean Parameters - Boolean values (true/false)

  • List Parameters - Lists of multiple values (supports string, integer, and other types)

  • Object Parameters - Key-value pair objects

  • Object Array Parameters - Lists of multiple objects

String Parameters

String parameters are the most common parameter type, used to pass text values.

Usage

zeno zlb create-load-balancer --load-balancer-name my-load-balancer

Notes

  • String parameters can contain spaces but must be enclosed in quotes

  • Special characters may need to be escaped

Enum Parameters

Enum parameters are used to select a value from a predefined list of values.

Usage

Notes

  • Only predefined enum values can be used

  • Use --help to view available enum values

  • Command auto-completion is supported

Integer Parameters

Integer parameters are used to pass integer values.

Usage

Notes

  • Some parameters may have value range restrictions

  • Parameters with a default value of 0 are not sent to the API

Float Parameters

Float parameters are used to pass floating-point values.

Usage

Notes

  • Supports both integers and decimals

  • Parameters with a default value of 0 are not sent to the API

Boolean Parameters

Boolean parameters are used to pass true or false values.

Usage

Notes

  • Boolean parameters usually do not need an explicit value; including the parameter name alone represents true

  • You can explicitly specify true or false

List Parameters

List parameters are used to pass multiple values, supporting string, integer, and other types.

Description

One or more values separated by spaces. If any value contains spaces, it must be enclosed in quotes. Follow your terminal's quoting rules to prevent unexpected results.

Usage

Notes

  • Multiple values can be passed by separating with spaces or repeating the parameter name

  • Items containing spaces must be enclosed in quotes

  • Some list parameters may have quantity limits

Object Parameters

Object parameters are used to pass structured key-value pair data, supporting two formats: KV format and JSON format.

JSON Format (For Complex Objects)

Notes

  • KV format uses key=value format with multiple key-value pairs separated by commas

  • If the value starts with {, it is automatically recognized as JSON format

  • Automatic type conversion based on schema (integer, float, boolean)

Object Array Parameters

Object array parameters are used to pass multiple objects in JSON format.

Notes

  • JSON field keys should follow the same camelCase format as the API.

Parameter Format and Notes

Quoting

Quoting rules may differ across terminals:

  • Linux/macOS (bash/zsh):

    • Parameters containing spaces must be enclosed in single or double quotes

    • Content within single quotes is not interpreted by the shell

    • Variables within double quotes are interpreted by the shell

  • Windows (cmd):

    • Parameters containing spaces must be enclosed in double quotes

    • Backslash \ is used to escape special characters

  • Windows (PowerShell):

    • Parameters containing spaces must be enclosed in double quotes

    • Content within single quotes is not interpreted by PowerShell

    • Variables within double quotes are interpreted by PowerShell

Special Characters

When parameters contain special characters, appropriate escaping is needed based on the terminal type:

  • Linux/macOS: Use backslash \ to escape special characters

  • Windows (cmd): Use backslash \ to escape special characters

  • Windows (PowerShell): Use backtick ` to escape special characters

Parameter Precedence

When the same parameter is specified multiple times, only the last value is used:

Parameter Examples

Example 1: Using Different Parameter Types Together

Example 2: Using JSON Object Parameters

Best Practices

  • Use Help Commands: Use --help to view parameters and their types supported by a command

  • Use Quotes: Enclose parameters containing spaces or special characters in quotes

  • Use Auto-Completion: Enable command auto-completion to reduce parameter input errors

  • Check Parameter Values: Ensure parameter values meet command requirements

  • Choose the Right Format: Use KV format for simple objects and JSON format for complex objects

FAQ

Parameter Errors

If you encounter parameter errors, check:

  • Whether the parameter name is correct

  • Whether the parameter type is correct

  • Whether the parameter value meets requirements

  • Whether quoting is correct

Spaces and Special Characters

When parameters contain spaces or special characters, ensure you use the correct quotes and escape characters.

Choosing Object Parameter Format

  • Use KV format for simple key-value pairs for conciseness

  • Use JSON format for nested structures or complex types for clarity

  • If unsure, try KV format first

Last updated

Was this helpful?