feat: add force refresh of license entitlements (#9155)

* feat: add force refresh of license entitlements
* send "going away" mesasge on licenses pubsub on close
* Add manual refresh to licenses page
This commit is contained in:
Steven Masley
2023-08-22 09:26:43 -05:00
committed by GitHub
parent 37a3b42c55
commit 262d7692b6
16 changed files with 264 additions and 13 deletions

View File

@ -134,6 +134,7 @@ curl -X GET http://coder-server:8080/api/v2/entitlements \
}
},
"has_license": true,
"refreshed_at": "2019-08-24T14:15:22Z",
"require_telemetry": true,
"trial": true,
"warnings": ["string"]

View File

@ -49,6 +49,44 @@ curl -X POST http://coder-server:8080/api/v2/licenses \
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Update license entitlements
### Code samples
```shell
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/licenses/refresh-entitlements \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
`POST /licenses/refresh-entitlements`
### Example responses
> 201 Response
```json
{
"detail": "string",
"message": "string",
"validations": [
{
"detail": "string",
"field": "string"
}
]
}
```
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------------ | ----------- | ------------------------------------------------ |
| 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.Response](schemas.md#codersdkresponse) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Create organization
### Code samples

2
docs/api/schemas.md generated
View File

@ -2674,6 +2674,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
}
},
"has_license": true,
"refreshed_at": "2019-08-24T14:15:22Z",
"require_telemetry": true,
"trial": true,
"warnings": ["string"]
@ -2688,6 +2689,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
| `features` | object | false | | |
| » `[any property]` | [codersdk.Feature](#codersdkfeature) | false | | |
| `has_license` | boolean | false | | |
| `refreshed_at` | string | false | | |
| `require_telemetry` | boolean | false | | |
| `trial` | boolean | false | | |
| `warnings` | array of string | false | | |