File tree Expand file tree Collapse file tree 8 files changed +267
-2
lines changed Expand file tree Collapse file tree 8 files changed +267
-2
lines changed Original file line number Diff line number Diff line change @@ -483,7 +483,7 @@ docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/me
483
483
cd site
484
484
yarn run format:write:only ../docs/admin/prometheus.md
485
485
486
- coderd/apidoc/swagger.json : $(shell find ./scripts/apidocgen -not \( -path './scripts/apidocgen/node_modules' -prune \) -type f) $(wildcard coderd/* .go) $(wildcard codersdk/* .go) .swaggo
486
+ coderd/apidoc/swagger.json : $(shell find ./scripts/apidocgen -not \( -path './scripts/apidocgen/node_modules' -prune \) -type f) $(wildcard coderd/* .go) $(wildcard enterprise/coderd/ * .go) $( wildcard codersdk/* .go) .swaggo
487
487
./scripts/apidocgen/generate.sh
488
488
cd site
489
489
yarn run format:write:only ../docs/api ../docs/manifest.json ../coderd/apidoc/swagger.json
Original file line number Diff line number Diff line change @@ -303,6 +303,31 @@ const docTemplate = `{
303
303
}
304
304
}
305
305
},
306
+ "/entitlements": {
307
+ "get": {
308
+ "security": [
309
+ {
310
+ "CoderSessionToken": []
311
+ }
312
+ ],
313
+ "produces": [
314
+ "application/json"
315
+ ],
316
+ "tags": [
317
+ "Enterprise"
318
+ ],
319
+ "summary": "Get entitlements",
320
+ "operationId": "get-entitlements",
321
+ "responses": {
322
+ "200": {
323
+ "description": "OK",
324
+ "schema": {
325
+ "$ref": "#/definitions/codersdk.Entitlements"
326
+ }
327
+ }
328
+ }
329
+ }
330
+ },
306
331
"/files": {
307
332
"post": {
308
333
"security": [
@@ -4788,6 +4813,55 @@ const docTemplate = `{
4788
4813
}
4789
4814
}
4790
4815
},
4816
+ "codersdk.Entitlements": {
4817
+ "type": "object",
4818
+ "properties": {
4819
+ "errors": {
4820
+ "type": "array",
4821
+ "items": {
4822
+ "type": "string"
4823
+ }
4824
+ },
4825
+ "experimental": {
4826
+ "type": "boolean"
4827
+ },
4828
+ "features": {
4829
+ "type": "object",
4830
+ "additionalProperties": {
4831
+ "$ref": "#/definitions/codersdk.Feature"
4832
+ }
4833
+ },
4834
+ "has_license": {
4835
+ "type": "boolean"
4836
+ },
4837
+ "trial": {
4838
+ "type": "boolean"
4839
+ },
4840
+ "warnings": {
4841
+ "type": "array",
4842
+ "items": {
4843
+ "type": "string"
4844
+ }
4845
+ }
4846
+ }
4847
+ },
4848
+ "codersdk.Feature": {
4849
+ "type": "object",
4850
+ "properties": {
4851
+ "actual": {
4852
+ "type": "integer"
4853
+ },
4854
+ "enabled": {
4855
+ "type": "boolean"
4856
+ },
4857
+ "entitlement": {
4858
+ "type": "string"
4859
+ },
4860
+ "limit": {
4861
+ "type": "integer"
4862
+ }
4863
+ }
4864
+ },
4791
4865
"codersdk.GenerateAPIKeyResponse": {
4792
4866
"type": "object",
4793
4867
"properties": {
Original file line number Diff line number Diff line change 257
257
}
258
258
}
259
259
},
260
+ "/entitlements" : {
261
+ "get" : {
262
+ "security" : [
263
+ {
264
+ "CoderSessionToken" : []
265
+ }
266
+ ],
267
+ "produces" : [" application/json" ],
268
+ "tags" : [" Enterprise" ],
269
+ "summary" : " Get entitlements" ,
270
+ "operationId" : " get-entitlements" ,
271
+ "responses" : {
272
+ "200" : {
273
+ "description" : " OK" ,
274
+ "schema" : {
275
+ "$ref" : " #/definitions/codersdk.Entitlements"
276
+ }
277
+ }
278
+ }
279
+ }
280
+ },
260
281
"/files" : {
261
282
"post" : {
262
283
"security" : [
4279
4300
}
4280
4301
}
4281
4302
},
4303
+ "codersdk.Entitlements" : {
4304
+ "type" : " object" ,
4305
+ "properties" : {
4306
+ "errors" : {
4307
+ "type" : " array" ,
4308
+ "items" : {
4309
+ "type" : " string"
4310
+ }
4311
+ },
4312
+ "experimental" : {
4313
+ "type" : " boolean"
4314
+ },
4315
+ "features" : {
4316
+ "type" : " object" ,
4317
+ "additionalProperties" : {
4318
+ "$ref" : " #/definitions/codersdk.Feature"
4319
+ }
4320
+ },
4321
+ "has_license" : {
4322
+ "type" : " boolean"
4323
+ },
4324
+ "trial" : {
4325
+ "type" : " boolean"
4326
+ },
4327
+ "warnings" : {
4328
+ "type" : " array" ,
4329
+ "items" : {
4330
+ "type" : " string"
4331
+ }
4332
+ }
4333
+ }
4334
+ },
4335
+ "codersdk.Feature" : {
4336
+ "type" : " object" ,
4337
+ "properties" : {
4338
+ "actual" : {
4339
+ "type" : " integer"
4340
+ },
4341
+ "enabled" : {
4342
+ "type" : " boolean"
4343
+ },
4344
+ "entitlement" : {
4345
+ "type" : " string"
4346
+ },
4347
+ "limit" : {
4348
+ "type" : " integer"
4349
+ }
4350
+ }
4351
+ },
4282
4352
"codersdk.GenerateAPIKeyResponse" : {
4283
4353
"type" : " object" ,
4284
4354
"properties" : {
Original file line number Diff line number Diff line change
1
+ # Enterprise
2
+
3
+ > This page is incomplete, stay tuned.
4
+
5
+ ## Get entitlements
6
+
7
+ ### Code samples
8
+
9
+ ``` shell
10
+ # Example request using curl
11
+ curl -X GET http://coder-server:8080/api/v2/entitlements \
12
+ -H ' Accept: application/json' \
13
+ -H ' Coder-Session-Token: API_KEY'
14
+ ```
15
+
16
+ ` GET /entitlements `
17
+
18
+ ### Example responses
19
+
20
+ > 200 Response
21
+
22
+ ``` json
23
+ {
24
+ "errors" : [" string" ],
25
+ "experimental" : true ,
26
+ "features" : {
27
+ "property1" : {
28
+ "actual" : 0 ,
29
+ "enabled" : true ,
30
+ "entitlement" : " string" ,
31
+ "limit" : 0
32
+ },
33
+ "property2" : {
34
+ "actual" : 0 ,
35
+ "enabled" : true ,
36
+ "entitlement" : " string" ,
37
+ "limit" : 0
38
+ }
39
+ },
40
+ "has_license" : true ,
41
+ "trial" : true ,
42
+ "warnings" : [" string" ]
43
+ }
44
+ ```
45
+
46
+ ### Responses
47
+
48
+ | Status | Meaning | Description | Schema |
49
+ | ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------- |
50
+ | 200 | [ OK] ( https://tools.ietf.org/html/rfc7231#section-6.3.1 ) | OK | [ codersdk.Entitlements] ( schemas.md#codersdkentitlements ) |
51
+
52
+ To perform this operation, you must be authenticated. [ Learn more] ( authentication.md ) .
Original file line number Diff line number Diff line change @@ -2082,6 +2082,64 @@ CreateParameterRequest is a structure used to create a new parameter value for a
2082
2082
| ` usage ` | string | false | | |
2083
2083
| ` value ` | integer | false | | |
2084
2084
2085
+ ## codersdk.Entitlements
2086
+
2087
+ ``` json
2088
+ {
2089
+ "errors" : [" string" ],
2090
+ "experimental" : true ,
2091
+ "features" : {
2092
+ "property1" : {
2093
+ "actual" : 0 ,
2094
+ "enabled" : true ,
2095
+ "entitlement" : " string" ,
2096
+ "limit" : 0
2097
+ },
2098
+ "property2" : {
2099
+ "actual" : 0 ,
2100
+ "enabled" : true ,
2101
+ "entitlement" : " string" ,
2102
+ "limit" : 0
2103
+ }
2104
+ },
2105
+ "has_license" : true ,
2106
+ "trial" : true ,
2107
+ "warnings" : [" string" ]
2108
+ }
2109
+ ```
2110
+
2111
+ ### Properties
2112
+
2113
+ | Name | Type | Required | Restrictions | Description |
2114
+ | ------------------ | ------------------------------------ | -------- | ------------ | ----------- |
2115
+ | ` errors ` | array of string | false | | |
2116
+ | ` experimental ` | boolean | false | | |
2117
+ | ` features ` | object | false | | |
2118
+ | » ` [any property] ` | [ codersdk.Feature] ( #codersdkfeature ) | false | | |
2119
+ | ` has_license ` | boolean | false | | |
2120
+ | ` trial ` | boolean | false | | |
2121
+ | ` warnings ` | array of string | false | | |
2122
+
2123
+ ## codersdk.Feature
2124
+
2125
+ ``` json
2126
+ {
2127
+ "actual" : 0 ,
2128
+ "enabled" : true ,
2129
+ "entitlement" : " string" ,
2130
+ "limit" : 0
2131
+ }
2132
+ ```
2133
+
2134
+ ### Properties
2135
+
2136
+ | Name | Type | Required | Restrictions | Description |
2137
+ | ------------- | ------- | -------- | ------------ | ----------- |
2138
+ | ` actual ` | integer | false | | |
2139
+ | ` enabled ` | boolean | false | | |
2140
+ | ` entitlement ` | string | false | | |
2141
+ | ` limit ` | integer | false | | |
2142
+
2085
2143
## codersdk.GenerateAPIKeyResponse
2086
2144
2087
2145
``` json
Original file line number Diff line number Diff line change 345
345
"title" : " Authorization" ,
346
346
"path" : " ./api/authorization.md"
347
347
},
348
+ {
349
+ "title" : " Enterprise" ,
350
+ "path" : " ./api/enterprise.md"
351
+ },
348
352
{
349
353
"title" : " Files" ,
350
354
"path" : " ./api/files.md"
Original file line number Diff line number Diff line change @@ -331,6 +331,13 @@ func (api *API) updateEntitlements(ctx context.Context) error {
331
331
return nil
332
332
}
333
333
334
+ // @Summary Get entitlements
335
+ // @ID get-entitlements
336
+ // @Security CoderSessionToken
337
+ // @Produce json
338
+ // @Tags Enterprise
339
+ // @Success 200 {object} codersdk.Entitlements
340
+ // @Router /entitlements [get]
334
341
func (api * API ) serveEntitlements (rw http.ResponseWriter , r * http.Request ) {
335
342
ctx := r .Context ()
336
343
api .entitlementsMu .RLock ()
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ log "Use temporary file: ${API_MD_TMP_FILE}"
20
20
pushd " ${PROJECT_ROOT} "
21
21
go run github.com/swaggo/swag/cmd/
[email protected] init \
22
22
--generalInfo=" coderd.go" \
23
- --dir=" ./coderd,./codersdk" \
23
+ --dir=" ./coderd,./codersdk,./enterprise/coderd " \
24
24
--output=" ./coderd/apidoc" \
25
25
--outputTypes=" go,json" \
26
26
--parseDependency=true
You can’t perform that action at this time.
0 commit comments