diff --git a/internal/app/enaptercli/cmd_device_create_standalone.go b/internal/app/enaptercli/cmd_device_create_standalone.go index 7230eb6..b9ce065 100644 --- a/internal/app/enaptercli/cmd_device_create_standalone.go +++ b/internal/app/enaptercli/cmd_device_create_standalone.go @@ -14,6 +14,7 @@ type cmdDeviceCreateStandalone struct { cmdDeviceCreate siteID string deviceName string + deviceSlug string } func buildCmdDeviceCreateStandalone() *cli.Command { @@ -43,6 +44,10 @@ func (c *cmdDeviceCreateStandalone) Flags() []cli.Flag { Usage: "name for the new device", Destination: &c.deviceName, Required: true, + }, &cli.StringFlag{ + Name: "device-slug", + Usage: "slug for the new standalone device", + Destination: &c.deviceSlug, }) } @@ -50,6 +55,7 @@ func (c *cmdDeviceCreateStandalone) do(ctx context.Context) error { body, err := json.Marshal(map[string]any{ "site_id": c.siteID, "name": c.deviceName, + "slug": c.deviceSlug, }) if err != nil { return fmt.Errorf("build request: %w", err) diff --git a/internal/app/enaptercli/testdata/helps/enapter device create standalone b/internal/app/enaptercli/testdata/helps/enapter device create standalone index 75e0c76..b8e9f0e 100644 --- a/internal/app/enaptercli/testdata/helps/enapter device create standalone +++ b/internal/app/enaptercli/testdata/helps/enapter device create standalone @@ -10,6 +10,7 @@ OPTIONS: --verbose log extra details about the operation (default: false) --site-id value, -s value site ID where the device will be created --device-name value, -n value name for the new device + --device-slug value slug for the new standalone device --help, -h show help ENVIRONMENT VARIABLES: