chore: scope workspace quotas to organizations (#14352)

* chore: scope workspace quotas to organizations

Quotas are now a function of (user_id, organization_id). They are
still sourced from groups. Deprecate the old api endpoint.
This commit is contained in:
Steven Masley
2024-08-21 09:25:20 -05:00
committed by GitHub
parent fa733318e0
commit a359879af5
16 changed files with 309 additions and 68 deletions
+45 -2
View File
@@ -2813,6 +2813,48 @@ const docTemplate = `{
}
}
},
"/organizations/{organization}/members/{user}/workspace-quota": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Enterprise"
],
"summary": "Get workspace quota by user",
"operationId": "get-workspace-quota-by-user",
"parameters": [
{
"type": "string",
"description": "User ID, name, or me",
"name": "user",
"in": "path",
"required": true
},
{
"type": "string",
"format": "uuid",
"description": "Organization ID",
"name": "organization",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.WorkspaceQuota"
}
}
}
}
},
"/organizations/{organization}/members/{user}/workspaces": {
"post": {
"security": [
@@ -6258,8 +6300,9 @@ const docTemplate = `{
"tags": [
"Enterprise"
],
"summary": "Get workspace quota by user",
"operationId": "get-workspace-quota-by-user",
"summary": "Get workspace quota by user deprecated",
"operationId": "get-workspace-quota-by-user-deprecated",
"deprecated": true,
"parameters": [
{
"type": "string",
+41 -2
View File
@@ -2465,6 +2465,44 @@
}
}
},
"/organizations/{organization}/members/{user}/workspace-quota": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": ["application/json"],
"tags": ["Enterprise"],
"summary": "Get workspace quota by user",
"operationId": "get-workspace-quota-by-user",
"parameters": [
{
"type": "string",
"description": "User ID, name, or me",
"name": "user",
"in": "path",
"required": true
},
{
"type": "string",
"format": "uuid",
"description": "Organization ID",
"name": "organization",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.WorkspaceQuota"
}
}
}
}
},
"/organizations/{organization}/members/{user}/workspaces": {
"post": {
"security": [
@@ -5524,8 +5562,9 @@
],
"produces": ["application/json"],
"tags": ["Enterprise"],
"summary": "Get workspace quota by user",
"operationId": "get-workspace-quota-by-user",
"summary": "Get workspace quota by user deprecated",
"operationId": "get-workspace-quota-by-user-deprecated",
"deprecated": true,
"parameters": [
{
"type": "string",