mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-06 19:36:41 +00:00
feat: Add GetInstance endpoint (#9452)
This commit is contained in:
52
proto/zitadel/instance/v2/instance.proto
Normal file
52
proto/zitadel/instance/v2/instance.proto
Normal file
@@ -0,0 +1,52 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "protoc-gen-openapiv2/options/annotations.proto";
|
||||
import "zitadel/object/v2/object.proto";
|
||||
|
||||
package zitadel.instance.v2;
|
||||
|
||||
option go_package = "github.com/zitadel/zitadel/pkg/grpc/instance/v2;instance";
|
||||
|
||||
message Instance {
|
||||
string id = 1 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
example: "\"69629023906488334\""
|
||||
}
|
||||
];
|
||||
zitadel.object.v2.Details details = 2;
|
||||
State state = 3 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
description: "current state of the instance";
|
||||
}
|
||||
];
|
||||
string name = 4 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
example: "\"ZITADEL\"";
|
||||
}
|
||||
];
|
||||
string version = 5 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
example: "\"1.0.0\"";
|
||||
}
|
||||
];
|
||||
repeated Domain domains = 6;
|
||||
}
|
||||
|
||||
enum State {
|
||||
STATE_UNSPECIFIED = 0;
|
||||
STATE_CREATING = 1;
|
||||
STATE_RUNNING = 2;
|
||||
STATE_STOPPING = 3;
|
||||
STATE_STOPPED = 4;
|
||||
}
|
||||
|
||||
message Domain {
|
||||
zitadel.object.v2.Details details = 1;
|
||||
string domain = 2 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
example: "\"zitadel.com\""
|
||||
}
|
||||
];
|
||||
bool primary = 3;
|
||||
bool generated = 4;
|
||||
}
|
||||
@@ -4,6 +4,8 @@ package zitadel.instance.v2;
|
||||
|
||||
import "validate/validate.proto";
|
||||
import "zitadel/object/v2/object.proto";
|
||||
import "zitadel/instance/v2/instance.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "protoc-gen-openapiv2/options/annotations.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
@@ -115,6 +117,10 @@ message DeleteInstanceResponse {
|
||||
zitadel.object.v2.Details details = 1;
|
||||
}
|
||||
|
||||
message GetInstanceResponse {
|
||||
zitadel.instance.v2.Instance instance = 1;
|
||||
}
|
||||
|
||||
service InstanceService {
|
||||
|
||||
// DeleteInstance deletes an instance with the given ID.
|
||||
@@ -148,10 +154,39 @@ service InstanceService {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// GetInstance returns the instance for the current context.
|
||||
rpc GetInstance(google.protobuf.Empty) returns (GetInstanceResponse) {
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
description: "Gets the instance associated to the current context";
|
||||
tags: "Instance";
|
||||
responses: {
|
||||
key: "200";
|
||||
value: {
|
||||
description: "The instance of the context.";
|
||||
schema: {
|
||||
json_schema: {
|
||||
ref: "#/definitions/GetInstanceResponse";
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
option (google.api.http) = {
|
||||
get: "/v2/instances/current"
|
||||
};
|
||||
|
||||
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
||||
auth_option: {
|
||||
permission: "instance.get"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// UpdateInstance
|
||||
// GetInstance
|
||||
// ListInstances
|
||||
// DeleteInstance
|
||||
|
||||
|
||||
Reference in New Issue
Block a user