1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-23 00:22:19 +01:00

feat: deprecate state api (#3551)

## About the changes
This deprecates state API in favor of the new batch import/export
This commit is contained in:
Gastón Fournier 2023-04-18 18:34:12 +02:00 committed by GitHub
parent 8840b430ef
commit 008d9b8bb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 1 deletions

View File

@ -278,7 +278,6 @@ const metaRules: Rule[] = [
'setUiConfigSchema', 'setUiConfigSchema',
'sortOrderSchema', 'sortOrderSchema',
'splashSchema', 'splashSchema',
'stateSchema',
'strategiesSchema', 'strategiesSchema',
'tagTypeSchema', 'tagTypeSchema',
'tagTypesSchema', 'tagTypesSchema',

View File

@ -15,6 +15,9 @@ export const stateSchema = {
$id: '#/components/schemas/stateSchema', $id: '#/components/schemas/stateSchema',
type: 'object', type: 'object',
additionalProperties: true, additionalProperties: true,
deprecated: true,
description:
'The state of the application used by export/import APIs which are deprecated in favor of the more fine grained /api/admin/export and /api/admin/import APIs',
required: ['version'], required: ['version'],
properties: { properties: {
version: { version: {

View File

@ -64,6 +64,10 @@ class StateController extends Controller {
this.openApiService.validPath({ this.openApiService.validPath({
tags: ['Import/Export'], tags: ['Import/Export'],
operationId: 'import', operationId: 'import',
deprecated: true,
summary: 'Import state (deprecated)',
description:
'Imports state into the system. Deprecated in favor of /api/admin/features-batch/import',
responses: { responses: {
202: emptyResponse, 202: emptyResponse,
}, },
@ -80,6 +84,10 @@ class StateController extends Controller {
this.openApiService.validPath({ this.openApiService.validPath({
tags: ['Import/Export'], tags: ['Import/Export'],
operationId: 'export', operationId: 'export',
deprecated: true,
summary: 'Export state (deprecated)',
description:
'Exports the current state of the system. Deprecated in favor of /api/admin/features-batch/export',
responses: { responses: {
200: createResponseSchema('stateSchema'), 200: createResponseSchema('stateSchema'),
}, },

View File

@ -4110,6 +4110,8 @@ Stats are divided into current and previous **windows**.
}, },
"stateSchema": { "stateSchema": {
"additionalProperties": true, "additionalProperties": true,
"deprecated": true,
"description": "The state of the application used by export/import APIs which are deprecated in favor of the more fine grained /api/admin/export and /api/admin/import APIs",
"properties": { "properties": {
"environments": { "environments": {
"items": { "items": {
@ -8501,6 +8503,8 @@ If the provided project does not exist, the list of events will be empty.",
}, },
"/api/admin/state/export": { "/api/admin/state/export": {
"get": { "get": {
"deprecated": true,
"description": "Exports the current state of the system. Deprecated in favor of /api/admin/features-batch/export",
"operationId": "export", "operationId": "export",
"parameters": [ "parameters": [
{ {
@ -8649,6 +8653,7 @@ If the provided project does not exist, the list of events will be empty.",
"description": "stateSchema", "description": "stateSchema",
}, },
}, },
"summary": "Export state (deprecated)",
"tags": [ "tags": [
"Import/Export", "Import/Export",
], ],
@ -8656,6 +8661,8 @@ If the provided project does not exist, the list of events will be empty.",
}, },
"/api/admin/state/import": { "/api/admin/state/import": {
"post": { "post": {
"deprecated": true,
"description": "Imports state into the system. Deprecated in favor of /api/admin/features-batch/import",
"operationId": "import", "operationId": "import",
"requestBody": { "requestBody": {
"content": { "content": {
@ -8673,6 +8680,7 @@ If the provided project does not exist, the list of events will be empty.",
"description": "This response has no body.", "description": "This response has no body.",
}, },
}, },
"summary": "Import state (deprecated)",
"tags": [ "tags": [
"Import/Export", "Import/Export",
], ],