diff --git a/docs/specs/openapi.json b/docs/specs/openapi.json index 2694aafaab..2b8227c40c 100644 --- a/docs/specs/openapi.json +++ b/docs/specs/openapi.json @@ -5552,6 +5552,98 @@ }] } }, + "/settings/cost-groups/": { + "get": { + "tags": [ + "Settings", + "Cost Groups" + ], + "summary": "Query which projects belong to which cost groups", + "operationId": "getSettingsCostGroups", + "parameters": [ + { + "$ref": "#/components/parameters/QueryOffset" + }, + { + "$ref": "#/components/parameters/QueryLimit" + }, + { + "$ref": "#/components/parameters/QueryFilter" + } + ], + "responses": { + "200": { + "description": "OpenShift projects and the current cost group", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CostGroupsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + }, + "put": { + "tags": [ + "Settings", + "Cost Groups" + ], + "summary": "Add projects to a cost group", + "operationId": "putSettingsCostGroups", + "requestBody": { + "$ref": "#/components/requestBodies/CostGroupsBody" + }, + "responses": { + "204": { + "description": "Cost groups updated" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Settings", + "Cost Groups" + ], + "summary": "Remove projects from a coust group", + "operationId": "deleteSettingsCostGroups", + "responses": { + "204": { + "description": "Cost groups updated" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, "/settings/tags/": { "get": { "tags": [ @@ -5993,6 +6085,39 @@ } } } + }, + "CostGroupsBody": { + "description": "List of project name and cost group", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "project": { + "type": "string" + }, + "group": { + "type": "string" + } + } + }, + "example": [ + { + "project": "accounting", + "group": "Platform" + }, + { + "project": "infra", + "group": "Platform" + } + ] + } + } + } } }, "securitySchemes": { @@ -6003,6 +6128,36 @@ } }, "schemas": { + "CostGroupsResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "properties": { + "project": { + "type": "string" + }, + "group": { + "type": "string" + }, + "default": { + "type": "boolean" + }, + "clusters": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, "CostModel": { "properties": { "name": {