> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/zenlayer-cli/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/zenlayer-cli/usage/parameter-types.md).

# 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

```bash
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

```bash
zeno zlb create-load-balancer --internet-charge-type ByBandwidth
```

### 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

```bash
zeno zlb create-load-balancer --bandwidth-mbps 100
zeno zec create-zec-instances --instance-count 2
```

### 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

```bash
zeno update-resource --price 99.99
```

### 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

```bash
# Enable (set to true)
zeno zec create-zec-instances --enable-agent

# Explicitly specify a value
zeno zec create-zec-instances --enable-agent true

# Disable (set to false)
zeno zec create-zec-instances --enable-agent false
```

### 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

```bash
# String list example
zeno zlb create-load-balancer --health-check-private-ips 192.168.1.1 192.168.1.2

# Using repeated parameters
zeno zec describe-resources --resource-ids 123 --resource-ids 456 --resource-ids 789
```

### 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.

### KV Format (Recommended for Simple Objects)

```bash
zeno zlb create-load-balancer --marketing-options discountCode=SAVE10,usePocVoucher=true
```

### JSON Format (For Complex Objects)

```bash
zeno zlb create-load-balancer --marketing-options '{"discountCode": "SAVE10", "usePocVoucher": true}'
```

### 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.

### JSON Array Format (Recommended for Complex Object Arrays)

```bash
zeno zlb create-load-balancer --tags '[{"key": "env", "value": "prod"}, {"key": "app", "value": "web"}]'
```

### 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:

```bash
# Only the last value will be used
zeno zlb create-load-balancer --load-balancer-name first-name --load-balancer-name final-name
```

## Parameter Examples

### Example 1: Using Different Parameter Types Together

```bash
zeno zlb create-load-balancer \
  --region-id asia-east-1 \
  --vpc-id vpc-123456 \
  --load-balancer-name "My Load Balancer" \
  --internet-charge-type ByBandwidth \
  --bandwidth-mbps 100 \
  --number 2 \
  --tags key=env,value=prod key=app,value=web \
  --marketing-options discountCode=SAVE10,usePocVoucher=true
```

### Example 2: Using JSON Object Parameters

```bash
# Directly specify JSON
zeno zlb create-load-balancer --marketing-options '{"discountCode": "SAVE10", "usePocVoucher": true}'

# Using JSON array
zeno zlb create-load-balancer --tags '[{"key": "env", "value": "prod"}, {"key": "app", "value": "web"}]'
```

## 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

## Related Documentation

* [Command Structure](/zenlayer-cli/usage/command-structure.md) - Learn about the basic structure of CLI commands
* [Help Commands](/zenlayer-cli/usage/help.md) - Learn how to get command help


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/zenlayer-cli/usage/parameter-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
