Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/dev/reference/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ Use [`resource.FromProvider`](https://pkg.go.dev/go.viam.com/rdk/resource#FromPr

{{% /changelog %}}

{{% changelog color="changed" title="Fragment Variables" date="2025-10-06" %}}

[Fragments](/manage/fleet/reuse-configuration/) now support variables, allowing you to define variable values per-machine.

{{% /changelog %}}

{{% changelog color="added" title="Machine job scheduling" date="2025-08-19" %}}

Added support for scheduling automated jobs on machines that run at specified intervals.
Expand Down
61 changes: 61 additions & 0 deletions docs/manage/fleet/reuse-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,52 @@ If you already created a machine to test your configuration, you can **Switch to

{{% /tablestep %}}
{{% tablestep %}}
**Add variable templates.**

Fragments support variable substitution, allowing you to use the same fragment for multiple use cases even if there are small differences in configuration.

When configuring resources, click the **{} JSON** button to switch to advanced view.
Instead of a key value, add a variable in the form `"$variable": { "name": "placeholder" } }}`.
For example:

{{< tabs >}}
{{% tab name="With Variable" %}}

```json {class="line-numbers linkable-line-numbers" data-line="4-8"}
{
"api": "rdk:component:camera",
"attributes": {
"preloaded_image": {
"$variable": {
"name": "placeholder"
}
}
},
"model": "rdk:builtin:image_file",
"name": "camera-placeholder"
}
```

{{% /tab %}}
{{% tab name="Without Variable" %}}

```json {class="line-numbers linkable-line-numbers" data-line="4"}
{
"api": "rdk:component:camera",
"attributes": {
"preloaded_image": "dog"
},
"model": "rdk:builtin:image_file",
"name": "camera-placeholder"
}
```

{{% /tab %}}
{{< /tabs >}}

{{% /tablestep %}}
{{% tablestep %}}

**Set your privacy settings in the menu bar.**
There are three options for this:

Expand Down Expand Up @@ -86,6 +132,21 @@ Search for your fragment and add it.

Click **Save** in the upper right corner of the screen.

{{% /tablestep %}}
{{% tablestep %}}
**Add variables** if the fragment uses variable templates.

In the fragment's panel, find the **Variables** section and add them to the JSON object.
For example:

```json {class="line-numbers linkable-line-numbers" data-line="5"}
{
"placeholder": "dog"
}
```

Click **Save** in the upper right corner of the screen.

{{% /tablestep %}}
{{% tablestep %}}
**Repeat step 1 for each of the machines** that you want to configure in the same way.
Expand Down
Loading