Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 250982a

Browse files
committed
templates.go, templateversions.go
1 parent f37c6b3 commit 250982a

File tree

10 files changed

+1015
-50
lines changed

10 files changed

+1015
-50
lines changed

coderd/apidoc/docs.go

Lines changed: 248 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,169 @@ const docTemplate = `{
808808
}
809809
}
810810
},
811+
"/templates/{id}/daus": {
812+
"get": {
813+
"security": [
814+
{
815+
"CoderSessionToken": []
816+
}
817+
],
818+
"produces": [
819+
"application/json"
820+
],
821+
"tags": [
822+
"Templates"
823+
],
824+
"summary": "Get template DAUs by ID",
825+
"operationId": "get-template-daus-by-id",
826+
"parameters": [
827+
{
828+
"type": "string",
829+
"format": "uuid",
830+
"description": "Template ID",
831+
"name": "id",
832+
"in": "path",
833+
"required": true
834+
}
835+
],
836+
"responses": {
837+
"200": {
838+
"description": "OK",
839+
"schema": {
840+
"$ref": "#/definitions/codersdk.TemplateDAUsResponse"
841+
}
842+
}
843+
}
844+
}
845+
},
846+
"/templates/{id}/versions": {
847+
"get": {
848+
"security": [
849+
{
850+
"CoderSessionToken": []
851+
}
852+
],
853+
"produces": [
854+
"application/json"
855+
],
856+
"tags": [
857+
"Templates"
858+
],
859+
"summary": "List template versions by template ID",
860+
"operationId": "list-template-versions-by-template-ID",
861+
"parameters": [
862+
{
863+
"type": "string",
864+
"format": "uuid",
865+
"description": "Template ID",
866+
"name": "id",
867+
"in": "path",
868+
"required": true
869+
}
870+
],
871+
"responses": {
872+
"200": {
873+
"description": "OK",
874+
"schema": {
875+
"type": "array",
876+
"items": {
877+
"$ref": "#/definitions/codersdk.TemplateVersion"
878+
}
879+
}
880+
}
881+
}
882+
},
883+
"patch": {
884+
"security": [
885+
{
886+
"CoderSessionToken": []
887+
}
888+
],
889+
"consumes": [
890+
"application/json"
891+
],
892+
"produces": [
893+
"application/json"
894+
],
895+
"tags": [
896+
"Templates"
897+
],
898+
"summary": "Update active template version by template ID",
899+
"operationId": "update-active-template-version-by-template-ID",
900+
"parameters": [
901+
{
902+
"description": "Modified template version",
903+
"name": "request",
904+
"in": "body",
905+
"required": true,
906+
"schema": {
907+
"$ref": "#/definitions/codersdk.UpdateActiveTemplateVersion"
908+
}
909+
},
910+
{
911+
"type": "string",
912+
"format": "uuid",
913+
"description": "Template ID",
914+
"name": "id",
915+
"in": "path",
916+
"required": true
917+
}
918+
],
919+
"responses": {
920+
"200": {
921+
"description": "OK",
922+
"schema": {
923+
"$ref": "#/definitions/codersdk.Response"
924+
}
925+
}
926+
}
927+
}
928+
},
929+
"/templates/{id}/versions/{name}": {
930+
"get": {
931+
"security": [
932+
{
933+
"CoderSessionToken": []
934+
}
935+
],
936+
"produces": [
937+
"application/json"
938+
],
939+
"tags": [
940+
"Templates"
941+
],
942+
"summary": "Get template version by template ID and name",
943+
"operationId": "get-template-version-by-template-id-and-name",
944+
"parameters": [
945+
{
946+
"type": "string",
947+
"format": "uuid",
948+
"description": "Template ID",
949+
"name": "id",
950+
"in": "path",
951+
"required": true
952+
},
953+
{
954+
"type": "string",
955+
"description": "Template name",
956+
"name": "name",
957+
"in": "path",
958+
"required": true
959+
}
960+
],
961+
"responses": {
962+
"200": {
963+
"description": "OK",
964+
"schema": {
965+
"type": "array",
966+
"items": {
967+
"$ref": "#/definitions/codersdk.TemplateVersion"
968+
}
969+
}
970+
}
971+
}
972+
}
973+
},
811974
"/updatecheck": {
812975
"get": {
813976
"produces": [
@@ -2250,6 +2413,17 @@ const docTemplate = `{
22502413
}
22512414
}
22522415
},
2416+
"codersdk.DAUEntry": {
2417+
"type": "object",
2418+
"properties": {
2419+
"amount": {
2420+
"type": "integer"
2421+
},
2422+
"date": {
2423+
"type": "string"
2424+
}
2425+
}
2426+
},
22532427
"codersdk.DERP": {
22542428
"type": "object",
22552429
"properties": {
@@ -3100,6 +3274,54 @@ const docTemplate = `{
31003274
"$ref": "#/definitions/codersdk.TransitionStats"
31013275
}
31023276
},
3277+
"codersdk.TemplateDAUsResponse": {
3278+
"type": "object",
3279+
"properties": {
3280+
"entries": {
3281+
"type": "array",
3282+
"items": {
3283+
"$ref": "#/definitions/codersdk.DAUEntry"
3284+
}
3285+
}
3286+
}
3287+
},
3288+
"codersdk.TemplateVersion": {
3289+
"type": "object",
3290+
"properties": {
3291+
"created_at": {
3292+
"type": "string",
3293+
"format": "date-time"
3294+
},
3295+
"created_by": {
3296+
"$ref": "#/definitions/codersdk.User"
3297+
},
3298+
"id": {
3299+
"type": "string",
3300+
"format": "uuid"
3301+
},
3302+
"job": {
3303+
"$ref": "#/definitions/codersdk.ProvisionerJob"
3304+
},
3305+
"name": {
3306+
"type": "string"
3307+
},
3308+
"organization_id": {
3309+
"type": "string",
3310+
"format": "uuid"
3311+
},
3312+
"readme": {
3313+
"type": "string"
3314+
},
3315+
"template_id": {
3316+
"type": "string",
3317+
"format": "uuid"
3318+
},
3319+
"updated_at": {
3320+
"type": "string",
3321+
"format": "date-time"
3322+
}
3323+
}
3324+
},
31033325
"codersdk.TraceConfig": {
31043326
"type": "object",
31053327
"properties": {
@@ -3127,6 +3349,17 @@ const docTemplate = `{
31273349
}
31283350
}
31293351
},
3352+
"codersdk.UpdateActiveTemplateVersion": {
3353+
"type": "object",
3354+
"required": [
3355+
"id"
3356+
],
3357+
"properties": {
3358+
"id": {
3359+
"type": "string"
3360+
}
3361+
}
3362+
},
31303363
"codersdk.UpdateCheckResponse": {
31313364
"type": "object",
31323365
"properties": {
@@ -3186,24 +3419,29 @@ const docTemplate = `{
31863419
],
31873420
"properties": {
31883421
"avatar_url": {
3189-
"type": "string"
3422+
"type": "string",
3423+
"format": "uri"
31903424
},
31913425
"created_at": {
3192-
"type": "string"
3426+
"type": "string",
3427+
"format": "date-time"
31933428
},
31943429
"email": {
31953430
"type": "string"
31963431
},
31973432
"id": {
3198-
"type": "string"
3433+
"type": "string",
3434+
"format": "uuid"
31993435
},
32003436
"last_seen_at": {
3201-
"type": "string"
3437+
"type": "string",
3438+
"format": "date-time"
32023439
},
32033440
"organization_ids": {
32043441
"type": "array",
32053442
"items": {
3206-
"type": "string"
3443+
"type": "string",
3444+
"format": "uuid"
32073445
}
32083446
},
32093447
"roles": {
@@ -3213,7 +3451,11 @@ const docTemplate = `{
32133451
}
32143452
},
32153453
"status": {
3216-
"type": "string"
3454+
"type": "string",
3455+
"enum": [
3456+
"active",
3457+
"suspended"
3458+
]
32173459
},
32183460
"username": {
32193461
"type": "string"

0 commit comments

Comments
 (0)