mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
E2C: Fix Swagger spec for createMigration post body (#85525)
* E2C: Fix Swagger spec for CreateCloudMigration post body * actually, don't rename that type
This commit is contained in:
parent
b885da09da
commit
e08b5bd456
@ -58,6 +58,12 @@ type CloudMigrationRunList struct {
|
||||
}
|
||||
|
||||
// swagger:parameters createMigration
|
||||
type CloudMigrationRequestParams struct {
|
||||
// required: true
|
||||
// in: body
|
||||
Body CloudMigrationRequest `json:"body"`
|
||||
}
|
||||
|
||||
type CloudMigrationRequest struct {
|
||||
AuthToken string `json:"authToken"`
|
||||
}
|
||||
|
@ -2319,9 +2319,12 @@
|
||||
"operationId": "createMigration",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "authToken",
|
||||
"in": "query"
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/CloudMigrationRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@ -12751,6 +12754,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"CloudMigrationRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"authToken": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"CloudMigrationResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -5,11 +5,7 @@ const injectedRtkApi = api.injectEndpoints({
|
||||
query: () => ({ url: `/cloudmigration/migration` }),
|
||||
}),
|
||||
createMigration: build.mutation<CreateMigrationApiResponse, CreateMigrationApiArg>({
|
||||
query: (queryArg) => ({
|
||||
url: `/cloudmigration/migration`,
|
||||
method: 'POST',
|
||||
params: { authToken: queryArg.authToken },
|
||||
}),
|
||||
query: (queryArg) => ({ url: `/cloudmigration/migration`, method: 'POST', body: queryArg.cloudMigrationRequest }),
|
||||
}),
|
||||
deleteCloudMigration: build.mutation<DeleteCloudMigrationApiResponse, DeleteCloudMigrationApiArg>({
|
||||
query: (queryArg) => ({ url: `/cloudmigration/migration/${queryArg.id}`, method: 'DELETE' }),
|
||||
@ -20,6 +16,9 @@ const injectedRtkApi = api.injectEndpoints({
|
||||
getCloudMigrationRunList: build.query<GetCloudMigrationRunListApiResponse, GetCloudMigrationRunListApiArg>({
|
||||
query: (queryArg) => ({ url: `/cloudmigration/migration/${queryArg.id}/run` }),
|
||||
}),
|
||||
runCloudMigration: build.mutation<RunCloudMigrationApiResponse, RunCloudMigrationApiArg>({
|
||||
query: (queryArg) => ({ url: `/cloudmigration/migration/${queryArg.id}/run`, method: 'POST' }),
|
||||
}),
|
||||
getCloudMigrationRun: build.query<GetCloudMigrationRunApiResponse, GetCloudMigrationRunApiArg>({
|
||||
query: (queryArg) => ({ url: `/cloudmigration/migration/${queryArg.id}/run/${queryArg.runId}` }),
|
||||
}),
|
||||
@ -34,7 +33,7 @@ export type GetMigrationListApiResponse = /** status 200 (empty) */ CloudMigrati
|
||||
export type GetMigrationListApiArg = void;
|
||||
export type CreateMigrationApiResponse = /** status 200 (empty) */ CloudMigrationResponse;
|
||||
export type CreateMigrationApiArg = {
|
||||
authToken?: string;
|
||||
cloudMigrationRequest: CloudMigrationRequest;
|
||||
};
|
||||
export type DeleteCloudMigrationApiResponse = unknown;
|
||||
export type DeleteCloudMigrationApiArg = {
|
||||
@ -51,7 +50,12 @@ export type GetCloudMigrationRunListApiArg = {
|
||||
/** ID of an migration */
|
||||
id: number;
|
||||
};
|
||||
export type GetCloudMigrationRunApiResponse = /** status 200 (empty) */ CloudMigrationRun;
|
||||
export type RunCloudMigrationApiResponse = /** status 200 (empty) */ MigrateDataResponseDto;
|
||||
export type RunCloudMigrationApiArg = {
|
||||
/** ID of an migration */
|
||||
id: number;
|
||||
};
|
||||
export type GetCloudMigrationRunApiResponse = /** status 200 (empty) */ MigrateDataResponseDto;
|
||||
export type GetCloudMigrationRunApiArg = {
|
||||
/** ID of an migration */
|
||||
id: number;
|
||||
@ -79,32 +83,21 @@ export type ErrorResponseBody = {
|
||||
For example, a 412 Precondition Failed error may include additional information of why that error happened. */
|
||||
status?: string;
|
||||
};
|
||||
export type MigratedResourceResult = {
|
||||
message?: string;
|
||||
status?: string;
|
||||
export type CloudMigrationRequest = {
|
||||
authToken?: string;
|
||||
};
|
||||
export type MigratedResource = {
|
||||
id?: string;
|
||||
name?: string;
|
||||
refID?: string;
|
||||
result?: MigratedResourceResult;
|
||||
type?: string;
|
||||
export type ItemStatus = string;
|
||||
export type MigrateDataResponseItemDto = {
|
||||
error?: string;
|
||||
refId?: string;
|
||||
status?: ItemStatus;
|
||||
};
|
||||
export type MigrationResult = {
|
||||
message?: string;
|
||||
status?: string;
|
||||
};
|
||||
export type CloudMigrationRun = {
|
||||
created?: string;
|
||||
finished?: string;
|
||||
export type MigrateDataResponseDto = {
|
||||
id?: number;
|
||||
items?: MigratedResource[];
|
||||
result?: MigrationResult;
|
||||
uid?: string;
|
||||
updated?: string;
|
||||
items?: MigrateDataResponseItemDto[];
|
||||
};
|
||||
export type CloudMigrationRunList = {
|
||||
runs?: CloudMigrationRun[];
|
||||
runs?: MigrateDataResponseDto[];
|
||||
};
|
||||
export type CreateAccessTokenResponseDto = {
|
||||
token?: string;
|
||||
@ -115,6 +108,7 @@ export const {
|
||||
useDeleteCloudMigrationMutation,
|
||||
useGetCloudMigrationQuery,
|
||||
useGetCloudMigrationRunListQuery,
|
||||
useRunCloudMigrationMutation,
|
||||
useGetCloudMigrationRunQuery,
|
||||
useCreateCloudMigrationTokenMutation,
|
||||
} = injectedRtkApi;
|
||||
|
@ -3532,6 +3532,14 @@
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"CloudMigrationRequest": {
|
||||
"properties": {
|
||||
"authToken": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"CloudMigrationResponse": {
|
||||
"properties": {
|
||||
"created": {
|
||||
@ -14799,15 +14807,17 @@
|
||||
},
|
||||
"post": {
|
||||
"operationId": "createMigration",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "authToken",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
"$ref": "#/components/schemas/CloudMigrationRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
},
|
||||
"required": true,
|
||||
"x-originalParamName": "body"
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/components/responses/cloudMigrationResponse"
|
||||
|
Loading…
Reference in New Issue
Block a user