feature/upstream-service #13
@@ -83,7 +83,7 @@ impl From<CreateUpstreamRequestBody> for ConcreteCreateUpstreamRequestBody {
|
|||||||
#[axum::debug_handler]
|
#[axum::debug_handler]
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
post,
|
post,
|
||||||
path = "/api/upstreams",
|
path = "/api/nginx/upstreams",
|
||||||
request_body = CreateUpstreamRequestBody,
|
request_body = CreateUpstreamRequestBody,
|
||||||
responses(
|
responses(
|
||||||
(status = 200, description = "Upstream created successfully", body = UpstreamInfoResponse),
|
(status = 200, description = "Upstream created successfully", body = UpstreamInfoResponse),
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ impl From<CreateUpstreamTargetInfo> for ConcreteCreateUpstreamTargetInfo {
|
|||||||
#[axum::debug_handler]
|
#[axum::debug_handler]
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
post,
|
post,
|
||||||
path = "/api/upstreams/{upstream_id}/targets",
|
path = "/api/nginx/upstreams/{upstream_id}/targets",
|
||||||
request_body = CreateUpstreamTargetInfo,
|
request_body = CreateUpstreamTargetInfo,
|
||||||
responses(
|
responses(
|
||||||
(status = 200, description = "Upstream target created successfully", body = UpstreamTargetInfoResponse),
|
(status = 200, description = "Upstream target created successfully", body = UpstreamTargetInfoResponse),
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ impl From<GetUpstreamParams> for ConcreteGetUpstreamParams {
|
|||||||
|
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
get,
|
get,
|
||||||
path = "/api/upstreams",
|
path = "/api/nginx/upstreams",
|
||||||
responses(
|
responses(
|
||||||
(status = 200, description = "List upstreams", body = UpstreamListResponse),
|
(status = 200, description = "List upstreams", body = UpstreamListResponse),
|
||||||
(status = 500, description = "Internal server error"),
|
(status = 500, description = "Internal server error"),
|
||||||
@@ -72,7 +72,7 @@ pub async fn get_upstream_list(
|
|||||||
|
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
get,
|
get,
|
||||||
path = "/api/upstreams/{upstream_id}",
|
path = "/api/nginx/upstreams/{upstream_id}",
|
||||||
responses(
|
responses(
|
||||||
(status = 200, description = "Get upstream info", body = UpstreamInfoResponse),
|
(status = 200, description = "Get upstream info", body = UpstreamInfoResponse),
|
||||||
(status = 404, description = "Not found"),
|
(status = 404, description = "Not found"),
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ impl From<GetUpstreamTargetsParams> for ConcreteGetUpstreamTargetsParams {
|
|||||||
|
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
get,
|
get,
|
||||||
path = "/api/upstream_targets/{upstream_target_id}",
|
path = "/api/nginx/upstream_targets/{upstream_target_id}",
|
||||||
responses(
|
responses(
|
||||||
(status = 200, description = "Get upstream target info", body = UpstreamTargetInfo),
|
(status = 200, description = "Get upstream target info", body = UpstreamTargetInfo),
|
||||||
(status = 404, description = "Not found"),
|
(status = 404, description = "Not found"),
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use crate::{
|
|||||||
|
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
delete,
|
delete,
|
||||||
path = "/api/upstreams/{upstream_id}",
|
path = "/api/nginx/upstreams/{upstream_id}",
|
||||||
responses(
|
responses(
|
||||||
(status = 200, description = "Upstream removed successfully", body = ()),
|
(status = 200, description = "Upstream removed successfully", body = ()),
|
||||||
(status = 401, description = "Unauthorized"),
|
(status = 401, description = "Unauthorized"),
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use crate::{
|
|||||||
|
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
delete,
|
delete,
|
||||||
path = "/api/upstream_targets/{upstream_target_id}",
|
path = "/api/nginx/upstream_targets/{upstream_target_id}",
|
||||||
responses(
|
responses(
|
||||||
(status = 200, description = "Upstream target removed successfully", body = ()),
|
(status = 200, description = "Upstream target removed successfully", body = ()),
|
||||||
(status = 401, description = "Unauthorized"),
|
(status = 401, description = "Unauthorized"),
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ impl From<UpdateUpstreamRequestBody> for UpdateUpstreamInfo {
|
|||||||
|
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
patch,
|
patch,
|
||||||
path = "/api/upstreams/{upstream_id}",
|
path = "/api/nginx/upstreams/{upstream_id}",
|
||||||
request_body = UpdateUpstreamRequestBody,
|
request_body = UpdateUpstreamRequestBody,
|
||||||
responses(
|
responses(
|
||||||
(status = 200, description = "Upstream updated successfully", body = UpdateUpstreamInfoResponse),
|
(status = 200, description = "Upstream updated successfully", body = UpdateUpstreamInfoResponse),
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ impl From<UpdateUpstreamTargetRequestBody> for UpdateUpstreamTargetInfo {
|
|||||||
|
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
patch,
|
patch,
|
||||||
path = "/api/upstream_targets/{upstream_target_id}",
|
path = "/api/nginx/upstream_targets/{upstream_target_id}",
|
||||||
request_body = UpdateUpstreamTargetRequestBody,
|
request_body = UpdateUpstreamTargetRequestBody,
|
||||||
responses(
|
responses(
|
||||||
(status = 200, description = "Upstream target updated successfully", body = UpdateUpstreamTargetInfoResponse),
|
(status = 200, description = "Upstream target updated successfully", body = UpdateUpstreamTargetInfoResponse),
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api/upstream_targets/{upstream_target_id}": {
|
"/api/nginx/upstream_targets/{upstream_target_id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"Nginx"
|
"Nginx"
|
||||||
@@ -232,7 +232,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api/upstreams": {
|
"/api/nginx/upstreams": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"Nginx"
|
"Nginx"
|
||||||
@@ -292,7 +292,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api/upstreams/{upstream_id}": {
|
"/api/nginx/upstreams/{upstream_id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"Nginx"
|
"Nginx"
|
||||||
@@ -418,7 +418,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api/upstreams/{upstream_id}/targets": {
|
"/api/nginx/upstreams/{upstream_id}/targets": {
|
||||||
"post": {
|
"post": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"Nginx"
|
"Nginx"
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ export namespace Endpoints {
|
|||||||
};
|
};
|
||||||
export type get_Get_upstream_target = {
|
export type get_Get_upstream_target = {
|
||||||
method: "GET";
|
method: "GET";
|
||||||
path: "/api/upstream_targets/{upstream_target_id}";
|
path: "/api/nginx/upstream_targets/{upstream_target_id}";
|
||||||
requestFormat: "json";
|
requestFormat: "json";
|
||||||
parameters: {
|
parameters: {
|
||||||
path: { upstream_target_id: string };
|
path: { upstream_target_id: string };
|
||||||
@@ -160,7 +160,7 @@ export namespace Endpoints {
|
|||||||
};
|
};
|
||||||
export type delete_Remove_upstream_target = {
|
export type delete_Remove_upstream_target = {
|
||||||
method: "DELETE";
|
method: "DELETE";
|
||||||
path: "/api/upstream_targets/{upstream_target_id}";
|
path: "/api/nginx/upstream_targets/{upstream_target_id}";
|
||||||
requestFormat: "json";
|
requestFormat: "json";
|
||||||
parameters: {
|
parameters: {
|
||||||
path: { upstream_target_id: string };
|
path: { upstream_target_id: string };
|
||||||
@@ -169,7 +169,7 @@ export namespace Endpoints {
|
|||||||
};
|
};
|
||||||
export type patch_Update_upstream_target = {
|
export type patch_Update_upstream_target = {
|
||||||
method: "PATCH";
|
method: "PATCH";
|
||||||
path: "/api/upstream_targets/{upstream_target_id}";
|
path: "/api/nginx/upstream_targets/{upstream_target_id}";
|
||||||
requestFormat: "json";
|
requestFormat: "json";
|
||||||
parameters: {
|
parameters: {
|
||||||
path: { upstream_target_id: string };
|
path: { upstream_target_id: string };
|
||||||
@@ -186,14 +186,14 @@ export namespace Endpoints {
|
|||||||
};
|
};
|
||||||
export type get_Get_upstream_list = {
|
export type get_Get_upstream_list = {
|
||||||
method: "GET";
|
method: "GET";
|
||||||
path: "/api/upstreams";
|
path: "/api/nginx/upstreams";
|
||||||
requestFormat: "json";
|
requestFormat: "json";
|
||||||
parameters: never;
|
parameters: never;
|
||||||
responses: { 200: Schemas.UpstreamListResponse; 500: unknown };
|
responses: { 200: Schemas.UpstreamListResponse; 500: unknown };
|
||||||
};
|
};
|
||||||
export type post_Create_upstream = {
|
export type post_Create_upstream = {
|
||||||
method: "POST";
|
method: "POST";
|
||||||
path: "/api/upstreams";
|
path: "/api/nginx/upstreams";
|
||||||
requestFormat: "json";
|
requestFormat: "json";
|
||||||
parameters: {
|
parameters: {
|
||||||
body: Schemas.CreateUpstreamRequestBody;
|
body: Schemas.CreateUpstreamRequestBody;
|
||||||
@@ -202,7 +202,7 @@ export namespace Endpoints {
|
|||||||
};
|
};
|
||||||
export type get_Get_upstream = {
|
export type get_Get_upstream = {
|
||||||
method: "GET";
|
method: "GET";
|
||||||
path: "/api/upstreams/{upstream_id}";
|
path: "/api/nginx/upstreams/{upstream_id}";
|
||||||
requestFormat: "json";
|
requestFormat: "json";
|
||||||
parameters: {
|
parameters: {
|
||||||
path: { upstream_id: string };
|
path: { upstream_id: string };
|
||||||
@@ -211,7 +211,7 @@ export namespace Endpoints {
|
|||||||
};
|
};
|
||||||
export type delete_Remove_upstream = {
|
export type delete_Remove_upstream = {
|
||||||
method: "DELETE";
|
method: "DELETE";
|
||||||
path: "/api/upstreams/{upstream_id}";
|
path: "/api/nginx/upstreams/{upstream_id}";
|
||||||
requestFormat: "json";
|
requestFormat: "json";
|
||||||
parameters: {
|
parameters: {
|
||||||
path: { upstream_id: string };
|
path: { upstream_id: string };
|
||||||
@@ -220,7 +220,7 @@ export namespace Endpoints {
|
|||||||
};
|
};
|
||||||
export type patch_Update_upstream = {
|
export type patch_Update_upstream = {
|
||||||
method: "PATCH";
|
method: "PATCH";
|
||||||
path: "/api/upstreams/{upstream_id}";
|
path: "/api/nginx/upstreams/{upstream_id}";
|
||||||
requestFormat: "json";
|
requestFormat: "json";
|
||||||
parameters: {
|
parameters: {
|
||||||
path: { upstream_id: string };
|
path: { upstream_id: string };
|
||||||
@@ -231,7 +231,7 @@ export namespace Endpoints {
|
|||||||
};
|
};
|
||||||
export type post_Add_upstream_target = {
|
export type post_Add_upstream_target = {
|
||||||
method: "POST";
|
method: "POST";
|
||||||
path: "/api/upstreams/{upstream_id}/targets";
|
path: "/api/nginx/upstreams/{upstream_id}/targets";
|
||||||
requestFormat: "json";
|
requestFormat: "json";
|
||||||
parameters: {
|
parameters: {
|
||||||
body: Schemas.CreateUpstreamTargetInfo;
|
body: Schemas.CreateUpstreamTargetInfo;
|
||||||
@@ -254,23 +254,23 @@ export type EndpointByMethod = {
|
|||||||
post: {
|
post: {
|
||||||
"/api/auth/init_admin": Endpoints.post_Init_admin;
|
"/api/auth/init_admin": Endpoints.post_Init_admin;
|
||||||
"/api/auth/login": Endpoints.post_Login;
|
"/api/auth/login": Endpoints.post_Login;
|
||||||
"/api/upstreams": Endpoints.post_Create_upstream;
|
"/api/nginx/upstreams": Endpoints.post_Create_upstream;
|
||||||
"/api/upstreams/{upstream_id}/targets": Endpoints.post_Add_upstream_target;
|
"/api/nginx/upstreams/{upstream_id}/targets": Endpoints.post_Add_upstream_target;
|
||||||
};
|
};
|
||||||
get: {
|
get: {
|
||||||
"/api/health/info": Endpoints.get_Get_health_info;
|
"/api/health/info": Endpoints.get_Get_health_info;
|
||||||
"/api/upstream_targets/{upstream_target_id}": Endpoints.get_Get_upstream_target;
|
"/api/nginx/upstream_targets/{upstream_target_id}": Endpoints.get_Get_upstream_target;
|
||||||
"/api/upstreams": Endpoints.get_Get_upstream_list;
|
"/api/nginx/upstreams": Endpoints.get_Get_upstream_list;
|
||||||
"/api/upstreams/{upstream_id}": Endpoints.get_Get_upstream;
|
"/api/nginx/upstreams/{upstream_id}": Endpoints.get_Get_upstream;
|
||||||
"/api/user/me": Endpoints.get_Get_user_info;
|
"/api/user/me": Endpoints.get_Get_user_info;
|
||||||
};
|
};
|
||||||
delete: {
|
delete: {
|
||||||
"/api/upstream_targets/{upstream_target_id}": Endpoints.delete_Remove_upstream_target;
|
"/api/nginx/upstream_targets/{upstream_target_id}": Endpoints.delete_Remove_upstream_target;
|
||||||
"/api/upstreams/{upstream_id}": Endpoints.delete_Remove_upstream;
|
"/api/nginx/upstreams/{upstream_id}": Endpoints.delete_Remove_upstream;
|
||||||
};
|
};
|
||||||
patch: {
|
patch: {
|
||||||
"/api/upstream_targets/{upstream_target_id}": Endpoints.patch_Update_upstream_target;
|
"/api/nginx/upstream_targets/{upstream_target_id}": Endpoints.patch_Update_upstream_target;
|
||||||
"/api/upstreams/{upstream_id}": Endpoints.patch_Update_upstream;
|
"/api/nginx/upstreams/{upstream_id}": Endpoints.patch_Update_upstream;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user