Skip to content

Commit c823203

Browse files
author
songshiyuan 00649746
committed
[feat] support define environment
1 parent 88da93f commit c823203

File tree

2 files changed

+68
-19
lines changed

2 files changed

+68
-19
lines changed

discovery/error.go

+21-19
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,27 @@ const (
2525
)
2626

2727
const (
28-
ErrInvalidParams int32 = 400001
29-
ErrUnhealthy int32 = 400002
30-
ErrServiceAlreadyExists int32 = 400010
31-
ErrServiceNotExists int32 = 400012
32-
ErrDeployedInstance int32 = 400013
33-
ErrUndefinedSchemaID int32 = 400014
34-
ErrModifySchemaNotAllow int32 = 400015
35-
ErrSchemaNotExists int32 = 400016
36-
ErrInstanceNotExists int32 = 400017
37-
ErrTagNotExists int32 = 400018
38-
ErrRuleAlreadyExists int32 = 400019
39-
ErrBlackAndWhiteRule int32 = 400020
40-
ErrModifyRuleNotAllow int32 = 400021
41-
ErrRuleNotExists int32 = 400022
42-
ErrDependedOnConsumer int32 = 400023
43-
ErrPermissionDeny int32 = 400024
44-
ErrEndpointAlreadyExists int32 = 400025
45-
ErrServiceVersionNotExists int32 = 400026
46-
ErrNotEnoughQuota int32 = 400100
28+
ErrInvalidParams int32 = 400001
29+
ErrUnhealthy int32 = 400002
30+
ErrServiceAlreadyExists int32 = 400010
31+
ErrServiceNotExists int32 = 400012
32+
ErrDeployedInstance int32 = 400013
33+
ErrUndefinedSchemaID int32 = 400014
34+
ErrModifySchemaNotAllow int32 = 400015
35+
ErrSchemaNotExists int32 = 400016
36+
ErrInstanceNotExists int32 = 400017
37+
ErrTagNotExists int32 = 400018
38+
ErrRuleAlreadyExists int32 = 400019
39+
ErrBlackAndWhiteRule int32 = 400020
40+
ErrModifyRuleNotAllow int32 = 400021
41+
ErrRuleNotExists int32 = 400022
42+
ErrDependedOnConsumer int32 = 400023
43+
ErrPermissionDeny int32 = 400024
44+
ErrEndpointAlreadyExists int32 = 400025
45+
ErrServiceVersionNotExists int32 = 400026
46+
ErrNotEnoughQuota int32 = 400100
47+
ErrEnvironmentAlreadyExists int32 = 400027
48+
ErrEnvironmentNotExists int32 = 400028
4749

4850
ErrForbidden int32 = 403001
4951

discovery/types.go

+47
Original file line numberDiff line numberDiff line change
@@ -462,3 +462,50 @@ type GetServiceCountResponse struct {
462462
Response *Response `protobuf:"bytes,1,opt,name=response" json:"-"`
463463
Count int64 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"`
464464
}
465+
466+
type GetEnvironmentsResponse struct {
467+
Response *Response `protobuf:"bytes,1,opt,name=response" json:"-"`
468+
Environments []*Environment `protobuf:"bytes,2,rep,name=environments" json:"environments,omitempty"`
469+
}
470+
471+
type CreateEnvironmentRequest struct {
472+
Environment *Environment `protobuf:"bytes,1,opt,name=environment" json:"environment,omitempty"`
473+
}
474+
475+
type CreateEnvironmentResponse struct {
476+
Response *Response `protobuf:"bytes,1,opt,name=response" json:"-"`
477+
EnvId string `protobuf:"bytes,2,opt,name=envId" json:"envId,omitempty"`
478+
}
479+
480+
type EnvironmentKey struct {
481+
// Tenant: The format is "{domain}/{project}"
482+
Tenant string `protobuf:"bytes,1,opt,name=tenant" json:"tenant,omitempty"`
483+
Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty" bson:"name"`
484+
}
485+
486+
type GetEnvironmentRequest struct {
487+
EnvironmentId string `protobuf:"bytes,1,opt,name=environmentId" json:"environmentId,omitempty"`
488+
}
489+
490+
type GetEnvironmentResponse struct {
491+
Response *Response `protobuf:"bytes,1,opt,name=response" json:"-"`
492+
Environment *Environment `protobuf:"bytes,2,opt,name=environment" json:"environment,omitempty"`
493+
}
494+
495+
type DeleteEnvironmentRequest struct {
496+
EnvironmentId string `protobuf:"bytes,1,opt,name=environmentId" json:"environmentId,omitempty"`
497+
}
498+
499+
type UpdateEnvironmentRequest struct {
500+
Environment *Environment `protobuf:"bytes,1,opt,name=environment" json:"environment,omitempty"`
501+
}
502+
503+
type GetEnvironmentCountRequest struct {
504+
Domain string `protobuf:"bytes,1,opt,name=domain" json:"domain,omitempty"`
505+
Project string `protobuf:"bytes,2,opt,name=project" json:"project,omitempty"`
506+
}
507+
508+
type GetEnvironmentCountResponse struct {
509+
Response *Response `protobuf:"bytes,1,opt,name=response" json:"-"`
510+
Count int64 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"`
511+
}

0 commit comments

Comments
 (0)