Skip to content

Commit 350ed36

Browse files
erda-botdspo
andauthored
feat: delete invalid package and package api (#5141) (#5142)
* feat: remove useless data * feat: comment provider.Run * feat: projectID * feat: hepa openapi * feat: permission * feat: runtime cli * feat: fatal * feat: typo * feat: more info * feat: do clearing async * fix: NotFoundError Co-authored-by: 悟空 <[email protected]>
1 parent b0d59c0 commit 350ed36

File tree

23 files changed

+1402
-33
lines changed

23 files changed

+1402
-33
lines changed

api/proto/common/status.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
syntax = "proto3";
2+
3+
package erda.common;
4+
5+
option go_package = "github.com/erda-project/erda-proto-go/common/pb";
6+
7+
enum StatusEnum {
8+
unknown_status = 0;
9+
not_found = 404;
10+
}

api/proto/core/hepa/endpoint_api/endpoint_api.proto

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ option go_package = "github.com/erda-project/erda-proto-go/core/hepa/endpoint_ap
55
import "google/api/annotations.proto";
66
import "google/protobuf/struct.proto";
77
import "core/hepa/hepa.proto";
8+
import "common/http.proto";
9+
import "common/openapi.proto";
810

911
// +publish service:"hepa"
1012
service EndpointApiService {
@@ -90,6 +92,23 @@ service EndpointApiService {
9092
};
9193
}
9294

95+
rpc ListInvalidEndpointApi(common.VoidRequest) returns(ListInvalidEndpointApiResp) {
96+
option(google.api.http) = {
97+
get: "/api/gateway/openapi/invalid-endpoints",
98+
};
99+
option(erda.common.openapi) = {
100+
path: "/api/gateway/openapi/invalid-endpoints",
101+
};
102+
}
103+
104+
rpc ClearInvalidEndpointApi(common.VoidRequest) returns (common.VoidResponse) {
105+
option(google.api.http) = {
106+
delete: "/api/gateway/openapi/invalid-endpoints",
107+
};
108+
option(erda.common.openapi) = {
109+
path: "/api/gateway/openapi/invalid-endpoints",
110+
};
111+
}
93112
}
94113

95114
message ChangeEndpointRootResponse {
@@ -129,7 +148,7 @@ message EndpointApi {
129148
string redirectType = 2;
130149
string redirectAddr = 3;
131150
string redirectPath = 4;
132-
string redirectApp = 5;
151+
string redirectApp = 5;
133152
string redirectService = 6;
134153
string redirectRuntimeId = 7;
135154
string redirectRuntimeName = 8;
@@ -234,4 +253,20 @@ message GetEndpointRequest {
234253

235254
message GetEndpointResponse {
236255
Endpoint data = 1;
256+
}
257+
258+
message ListInvalidEndpointApiResp {
259+
repeated ListInvalidEndpointApiItem list = 1;
260+
}
261+
262+
message ListInvalidEndpointApiItem {
263+
string invalidReason = 1;
264+
string type = 2;
265+
string projectID = 3;
266+
string packageID = 4;
267+
string packageApiID = 5;
268+
string upstreamApiID = 6;
269+
string upstreamID = 7;
270+
string upstreamName = 8;
271+
string runtimeID = 9;
237272
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
syntax = "proto3";
2+
3+
package erda.core.project;
4+
5+
import "google/protobuf/timestamp.proto";
6+
import "common/status.proto";
7+
8+
option go_package = "github.com/erda-project/erda-proto-go/core/project/pb";
9+
10+
service Project {
11+
rpc CheckProjectExist(CheckProjectExistReq)returns(CheckProjectExistResp){}
12+
rpc GetProjectByID(GetProjectByIDReq)returns(ProjectDto){}
13+
}
14+
15+
message CheckProjectExistReq {
16+
uint64 id = 1;
17+
}
18+
19+
message CheckProjectExistResp {
20+
bool ok = 1;
21+
}
22+
23+
message GetProjectByIDReq {
24+
uint64 id = 1;
25+
optional string userID = 2;
26+
}
27+
28+
message ProjectDto {
29+
// project primary key
30+
uint64 id = 1;
31+
// project identifies
32+
string name = 2;
33+
// project display name
34+
string displayName = 3;
35+
// for string ddHook
36+
reserved 4;
37+
// org primary key
38+
uint64 orgID = 5;
39+
// the project creator userID
40+
string creatorID = 6;
41+
// the project logo url
42+
string logo = 7;
43+
// the project description
44+
string desc = 8;
45+
// the owners' userIDs of the project
46+
// for owners
47+
reserved 9;
48+
// project active time
49+
google.protobuf.Timestamp activeTime = 10;
50+
// for string joined
51+
reserved 11;
52+
// for bool canUnblock
53+
reserved 12;
54+
// for string blockStatus
55+
reserved 13;
56+
// for bool CanManage
57+
reserved 14;
58+
// is the project public
59+
bool isPublic = 15;
60+
// for ProjectStats stats
61+
reserved 16;
62+
// for ProjectResourceUsage
63+
reserved 17, 18, 19, 20;
64+
// for clusterConfig
65+
reserved 21;
66+
// for ResourceConfigsInfo resourceConfig
67+
reserved 22;
68+
// for map<string, int> RollbackConfig
69+
reserved 23;
70+
// for float64 cpuQuota
71+
reserved 24;
72+
// for float64 memQuota
73+
reserved 25;
74+
google.protobuf.Timestamp createdTime = 26;
75+
google.protobuf.Timestamp updatedTime = 27;
76+
// project type
77+
string type = 28;
78+
}

api/proto/orchestrator/runtime/runtime.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import "google/protobuf/struct.proto";
66
import "google/protobuf/any.proto";
77
import "google/protobuf/timestamp.proto";
88
import "common/http.proto";
9+
import "common/status.proto";
910

1011
option go_package = "github.com/erda-project/erda-proto-go/orchestrator/runtime/pb";
1112

@@ -98,12 +99,23 @@ message Runtime {
9899
repeated ErrorResponse errors = 13;
99100
}
100101

102+
message CheckRuntimeExistReq {
103+
uint64 id = 1;
104+
}
105+
106+
message CheckRuntimeExistResp {
107+
bool ok = 1;
108+
}
109+
101110
service RuntimeService {
102111
rpc GetRuntime (GetRuntimeRequest) returns (RuntimeInspect) {
103112
option (google.api.http) = {
104113
get: "/api/runtimes/{nameOrID}?applicationId={appID}&workspace={workspace}",
105114
};
106115
}
116+
117+
rpc CheckRuntimeExist (CheckRuntimeExistReq) returns (CheckRuntimeExistResp) {}
118+
107119
rpc DelRuntime (DelRuntimeRequest) returns (Runtime) {
108120
option (google.api.http) = {
109121
delete: "/api/runtimes/{id}",

cmd/core-services/main.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,6 @@ import (
1919

2020
"github.com/erda-project/erda-infra/base/servicehub"
2121
"github.com/erda-project/erda/pkg/common"
22-
23-
// providers
24-
_ "github.com/erda-project/erda-infra/providers/grpcclient"
25-
_ "github.com/erda-project/erda-infra/providers/pprof"
26-
_ "github.com/erda-project/erda-infra/providers/redis"
27-
_ "github.com/erda-project/erda-proto-go/core/pipeline/cms/client"
28-
_ "github.com/erda-project/erda/internal/core/legacy"
29-
_ "github.com/erda-project/erda/internal/core/legacy/providers/token"
30-
_ "github.com/erda-project/erda/internal/core/legacy/services/dingtalk/api"
31-
_ "github.com/erda-project/erda/internal/core/messenger/eventbox"
32-
_ "github.com/erda-project/erda/internal/core/messenger/notify"
33-
_ "github.com/erda-project/erda/internal/core/messenger/notify-channel"
34-
_ "github.com/erda-project/erda/internal/core/messenger/notifygroup"
35-
36-
// infra
37-
_ "github.com/erda-project/erda-infra/providers/grpcserver"
38-
_ "github.com/erda-project/erda-infra/providers/httpserver"
39-
_ "github.com/erda-project/erda-infra/providers/mysql"
40-
_ "github.com/erda-project/erda-infra/providers/serviceregister"
4122
)
4223

4324
//go:embed bootstrap.yaml

cmd/core-services/register.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright (c) 2021 Terminus, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package main
16+
17+
import (
18+
_ "embed"
19+
20+
// providers
21+
_ "github.com/erda-project/erda-infra/providers/grpcclient"
22+
_ "github.com/erda-project/erda-infra/providers/pprof"
23+
_ "github.com/erda-project/erda-infra/providers/redis"
24+
_ "github.com/erda-project/erda-proto-go/core/pipeline/cms/client"
25+
_ "github.com/erda-project/erda/internal/core/legacy"
26+
_ "github.com/erda-project/erda/internal/core/legacy/providers/token"
27+
_ "github.com/erda-project/erda/internal/core/legacy/services/dingtalk/api"
28+
_ "github.com/erda-project/erda/internal/core/messenger/eventbox"
29+
_ "github.com/erda-project/erda/internal/core/messenger/notify"
30+
_ "github.com/erda-project/erda/internal/core/messenger/notify-channel"
31+
_ "github.com/erda-project/erda/internal/core/messenger/notifygroup"
32+
_ "github.com/erda-project/erda/internal/core/project"
33+
34+
// infra
35+
_ "github.com/erda-project/erda-infra/providers/grpcserver"
36+
_ "github.com/erda-project/erda-infra/providers/httpserver"
37+
_ "github.com/erda-project/erda-infra/providers/mysql"
38+
_ "github.com/erda-project/erda-infra/providers/serviceregister"
39+
)

cmd/hepa/bootstrap.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ [email protected]:
3737
addr: "${CLUSTER_MANAGER_GRPC_ADDR:cluster-manager:9095}"
3838
erda.core.clustermanager.cluster-client: {}
3939

40+
41+
addr: "${CORE_SERVICES_GRPC_ADDR:core-services:9537}"
42+
erda.core.project-client: {}
43+
44+
45+
addr: "${ORCHESTRATOR_GRPC_ADDR:orchestrator:7080}"
46+
erda.orchestrator.runtime-client: {}
47+
4048
4149
addr: "${MSP_GRPC_ADDR:msp:7080}"
4250
erda.msp.tenant-client: {}

0 commit comments

Comments
 (0)