Skip to content

Commit

Permalink
doc/howto: Add information and example on start upon creation via API
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Bolton <mark.bolton@canonical.com>
  • Loading branch information
boltmark committed Jul 2, 2024
1 parent 4cbddb4 commit 941d643
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions doc/howto/instances_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ To start an instance, send a PUT request to change the instance state:
lxc query --request PUT /1.0/instances/<instance_name>/state --data '{"action": "start"}'
If you would like to start the instance upon creation, set the `start` property to true. The following example will create the container, then start it:
lxc query --request POST /1.0/instances --data '{
"name": "<instance_name>",
"source": {
"alias": "<image_alias>",
"protocol": "simplestreams",
"server": "<server_URL>",
"type": "image"
}
"start": true
}'
See {ref}`instances-manage-start` for more information.
````
Expand Down

0 comments on commit 941d643

Please sign in to comment.