> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to update resources via the Nebius AI Cloud CLI

Resource `update` commands modify existing resources. You can provide update data through command parameters, a JSON or YAML file with `--file` or standard input by passing `-` as the input argument.

## Patch vs. full update

An *update mode* determines what happens to parameters that aren't specified in the request.

* A *patch update* changes only the specified parameters and leaves other parameters unchanged. Patch mode is used by default when you provide update data only through command parameters. Use `--patch` to explicitly select it:

  ```bash theme={null}
  nebius <service> <resource> update \
    --id <resource_ID> \
    --patch \
    <configuration_parameters_to_change>
  ```

* A *full update* applies the specified values and resets omitted configuration parameters recognized by your installed CLI version to their default values. Configuration parameters that aren't recognized by that CLI version aren't reset.

  Full mode is used by default when you provide data from a file or standard input. Use `--full` to explicitly select it. Include the configuration parameters that you want to change and all other configuration parameters that you want to keep:

  ```bash theme={null}
  nebius <service> <resource> update \
    --id <resource_ID> \
    --full \
    <configuration_parameters_to_change> \
    <configuration_parameters_to_keep>
  ```

<Warning>
  A full update resets all omitted configuration parameters recognized by your installed CLI version to their default values. Make sure the request contains all configuration that you want to keep.
</Warning>

In patch mode, use `--clear-mask <field_path>` to reset a parameter without changing other parameters. You can also reset a parameter by explicitly assigning the default value for its data type.

## Providing update data

You can combine command parameters with either a file or standard input. If the same parameter is specified both as a command parameter and in the file or standard input, the command parameter takes precedence. You can't use a file and standard input in the same command.

### Using command parameters

Provide individual update values as command parameters:

```bash theme={null}
nebius <service> <resource> update <update_parameters>
```

For example:

```bash theme={null}
nebius <service> <resource> update \
  --id <resource_ID> \
  --name <new_name>
```

Available parameters depend on the resource type. See the corresponding `update` page in the [CLI reference](/cli/reference), for example, [nebius compute instance update](/cli/reference/compute/instance/update).

### Using a file

Pass a JSON or YAML request from a file by using `--file`:

```bash theme={null}
nebius <service> <resource> update --file <path_to_file>
```

For example, pass a partial YAML request:

```bash theme={null}
nebius <service> <resource> update \
  --id <resource_ID> \
  --patch \
  --file update.yaml
```

`--file` selects `--full` mode by default. The example uses `--patch` because the request is partial.

### Using standard input

Pass a JSON or YAML request through standard input and use `-` as the input argument:

```bash theme={null}
cat <path_to_file> | nebius <service> <resource> update -
```

For example, pipe a partial YAML request:

```bash theme={null}
cat update.yaml | nebius <service> <resource> update \
  --id <resource_ID> \
  --patch -
```

Standard input selects `--full` mode by default. The example uses `--patch` because the request is partial.

## Examples

### Renaming a virtual machine and adding a label

Rename a virtual machine and add the `env=testing` label without replacing its other labels:

```bash theme={null}
nebius compute instance update \
  --parent-id <project_ID> \
  --id <VM_ID> \
  --name new-vm-name \
  --labels-add env=testing
```

For all available parameters, see [nebius compute instance update](/cli/reference/compute/instance/update).

### Updating a node group

<Warning>
  Test node group update commands on a non-production node group before applying them to production.
</Warning>

For a node group with autoscaling disabled that does not use NVLink, create `node-group.yaml` to set the number of nodes to three:

```bash theme={null}
cat > node-group.yaml <<EOF
spec:
  fixed_node_count: 3
EOF
```

Apply the configuration as a patch so that omitted parameters remain unchanged:

```bash theme={null}
nebius mk8s node-group update \
  --parent-id <cluster_ID> \
  --id <node_group_ID> \
  --patch \
  --file node-group.yaml
```

Reset a node drain timeout that was set explicitly, without performing a full update:

```bash theme={null}
nebius mk8s node-group update \
  --parent-id <cluster_ID> \
  --id <node_group_ID> \
  --clear-mask spec.strategy.drain_timeout
```

For all available parameters, see [nebius mk8s node-group update](/cli/reference/mk8s/node-group/update).
