@@ -1327,3 +1327,155 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/builds \
1327
1327
| 200 | [ OK] ( https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | [ codersdk.WorkspaceBuild] ( schemas.md#codersdkworkspacebuild ) |
1328
1328
1329
1329
To perform this operation, you must be authenticated. [ Learn more] ( authentication.md ) .
1330
+
1331
+ ## Restart workspace
1332
+
1333
+ ### Code samples
1334
+
1335
+ ``` shell
1336
+ # Example request using curl
1337
+ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/builds/restart \
1338
+ -H ' Accept: application/json' \
1339
+ -H ' Coder-Session-Token: API_KEY'
1340
+ ```
1341
+
1342
+ ` POST /workspaces/{workspace}/builds/restart `
1343
+
1344
+ ### Parameters
1345
+
1346
+ | Name | In | Type | Required | Description |
1347
+ | ----------- | ---- | ------------ | -------- | ------------ |
1348
+ | ` workspace ` | path | string(uuid) | true | Workspace ID |
1349
+
1350
+ ### Example responses
1351
+
1352
+ > 200 Response
1353
+
1354
+ ``` json
1355
+ {
1356
+ "build_number" : 0 ,
1357
+ "created_at" : " 2019-08-24T14:15:22Z" ,
1358
+ "daily_cost" : 0 ,
1359
+ "deadline" : " 2019-08-24T14:15:22Z" ,
1360
+ "id" : " 497f6eca-6276-4993-bfeb-53cbbbba6f08" ,
1361
+ "initiator_id" : " 06588898-9a84-4b35-ba8f-f9cbd64946f3" ,
1362
+ "initiator_name" : " string" ,
1363
+ "job" : {
1364
+ "canceled_at" : " 2019-08-24T14:15:22Z" ,
1365
+ "completed_at" : " 2019-08-24T14:15:22Z" ,
1366
+ "created_at" : " 2019-08-24T14:15:22Z" ,
1367
+ "error" : " string" ,
1368
+ "error_code" : " MISSING_TEMPLATE_PARAMETER" ,
1369
+ "file_id" : " 8a0cfb4f-ddc9-436d-91bb-75133c583767" ,
1370
+ "id" : " 497f6eca-6276-4993-bfeb-53cbbbba6f08" ,
1371
+ "started_at" : " 2019-08-24T14:15:22Z" ,
1372
+ "status" : " pending" ,
1373
+ "tags" : {
1374
+ "property1" : " string" ,
1375
+ "property2" : " string"
1376
+ },
1377
+ "worker_id" : " ae5fa6f7-c55b-40c1-b40a-b36ac467652b"
1378
+ },
1379
+ "max_deadline" : " 2019-08-24T14:15:22Z" ,
1380
+ "reason" : " initiator" ,
1381
+ "resources" : [
1382
+ {
1383
+ "agents" : [
1384
+ {
1385
+ "apps" : [
1386
+ {
1387
+ "command" : " string" ,
1388
+ "display_name" : " string" ,
1389
+ "external" : true ,
1390
+ "health" : " disabled" ,
1391
+ "healthcheck" : {
1392
+ "interval" : 0 ,
1393
+ "threshold" : 0 ,
1394
+ "url" : " string"
1395
+ },
1396
+ "icon" : " string" ,
1397
+ "id" : " 497f6eca-6276-4993-bfeb-53cbbbba6f08" ,
1398
+ "sharing_level" : " owner" ,
1399
+ "slug" : " string" ,
1400
+ "subdomain" : true ,
1401
+ "url" : " string"
1402
+ }
1403
+ ],
1404
+ "architecture" : " string" ,
1405
+ "connection_timeout_seconds" : 0 ,
1406
+ "created_at" : " 2019-08-24T14:15:22Z" ,
1407
+ "directory" : " string" ,
1408
+ "disconnected_at" : " 2019-08-24T14:15:22Z" ,
1409
+ "environment_variables" : {
1410
+ "property1" : " string" ,
1411
+ "property2" : " string"
1412
+ },
1413
+ "expanded_directory" : " string" ,
1414
+ "first_connected_at" : " 2019-08-24T14:15:22Z" ,
1415
+ "id" : " 497f6eca-6276-4993-bfeb-53cbbbba6f08" ,
1416
+ "instance_id" : " string" ,
1417
+ "last_connected_at" : " 2019-08-24T14:15:22Z" ,
1418
+ "latency" : {
1419
+ "property1" : {
1420
+ "latency_ms" : 0 ,
1421
+ "preferred" : true
1422
+ },
1423
+ "property2" : {
1424
+ "latency_ms" : 0 ,
1425
+ "preferred" : true
1426
+ }
1427
+ },
1428
+ "lifecycle_state" : " created" ,
1429
+ "login_before_ready" : true ,
1430
+ "name" : " string" ,
1431
+ "operating_system" : " string" ,
1432
+ "resource_id" : " 4d5215ed-38bb-48ed-879a-fdb9ca58522f" ,
1433
+ "shutdown_script" : " string" ,
1434
+ "shutdown_script_timeout_seconds" : 0 ,
1435
+ "startup_logs_length" : 0 ,
1436
+ "startup_logs_overflowed" : true ,
1437
+ "startup_script" : " string" ,
1438
+ "startup_script_timeout_seconds" : 0 ,
1439
+ "status" : " connecting" ,
1440
+ "troubleshooting_url" : " string" ,
1441
+ "updated_at" : " 2019-08-24T14:15:22Z" ,
1442
+ "version" : " string"
1443
+ }
1444
+ ],
1445
+ "created_at" : " 2019-08-24T14:15:22Z" ,
1446
+ "daily_cost" : 0 ,
1447
+ "hide" : true ,
1448
+ "icon" : " string" ,
1449
+ "id" : " 497f6eca-6276-4993-bfeb-53cbbbba6f08" ,
1450
+ "job_id" : " 453bd7d7-5355-4d6d-a38e-d9e7eb218c3f" ,
1451
+ "metadata" : [
1452
+ {
1453
+ "key" : " string" ,
1454
+ "sensitive" : true ,
1455
+ "value" : " string"
1456
+ }
1457
+ ],
1458
+ "name" : " string" ,
1459
+ "type" : " string" ,
1460
+ "workspace_transition" : " start"
1461
+ }
1462
+ ],
1463
+ "status" : " pending" ,
1464
+ "template_version_id" : " 0ba39c92-1f1b-4c32-aa3e-9925d7713eb1" ,
1465
+ "template_version_name" : " string" ,
1466
+ "transition" : " start" ,
1467
+ "updated_at" : " 2019-08-24T14:15:22Z" ,
1468
+ "workspace_id" : " 0967198e-ec7b-4c6b-b4d3-f71244cadbe9" ,
1469
+ "workspace_name" : " string" ,
1470
+ "workspace_owner_id" : " e7078695-5279-4c86-8774-3ac2367a2fc7" ,
1471
+ "workspace_owner_name" : " string"
1472
+ }
1473
+ ```
1474
+
1475
+ ### Responses
1476
+
1477
+ | Status | Meaning | Description | Schema |
1478
+ | ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ |
1479
+ | 200 | [ OK] ( https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | [ codersdk.WorkspaceBuild] ( schemas.md#codersdkworkspacebuild ) |
1480
+
1481
+ To perform this operation, you must be authenticated. [ Learn more] ( authentication.md ) .
0 commit comments