From e500a643bbaf2b34e832eb09af563be1de6cd993 Mon Sep 17 00:00:00 2001 From: Jongmin Kim Date: Wed, 20 Nov 2024 11:32:24 +0900 Subject: [PATCH] feat: add package APIs and change user group APIs Signed-off-by: Jongmin Kim --- proto/spaceone/api/identity/v2/package.proto | 128 ++++++++++++++++++ .../spaceone/api/identity/v2/user_group.proto | 13 +- 2 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 proto/spaceone/api/identity/v2/package.proto diff --git a/proto/spaceone/api/identity/v2/package.proto b/proto/spaceone/api/identity/v2/package.proto new file mode 100644 index 000000000..83827deb8 --- /dev/null +++ b/proto/spaceone/api/identity/v2/package.proto @@ -0,0 +1,128 @@ +syntax = "proto3"; + +package spaceone.api.identity.v2; + +option go_package = "github.com/cloudforet-io/api/dist/go/spaceone/api/identity/v2"; + +import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; +import "google/api/annotations.proto"; +import "spaceone/api/core/v2/query.proto"; + + +service Package { + + rpc create (CreatePackageRequest) returns (PackageInfo) { + option (google.api.http) = { + post: "/identity/v2/package/create" + body: "*" + }; + } + + rpc update (UpdatePackageRequest) returns (PackageInfo) { + option (google.api.http) = { + post: "/identity/v2/package/update" + body: "*" + }; + } + + rpc delete (PackageRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/identity/v2/package/delete" + body: "*" + }; + } + + rpc set_default (PackageRequest) returns (PackageInfo) { + option (google.api.http) = { + post: "/identity/v2/package/set-default" + body: "*" + }; + } + + rpc change_order (ChangePackageOrderRequest) returns (PackageInfo) { + option (google.api.http) = { + post: "/identity/v2/package/change-order" + body: "*" + }; + } + + rpc get (PackageRequest) returns (PackageInfo) { + option (google.api.http) = { + post: "/identity/v2/package/get" + body: "*" + }; + } + + rpc list (PackageSearchQuery) returns (PackagesInfo) { + option (google.api.http) = { + post: "/identity/v2/package/list" + body: "*" + }; + } + rpc stat (PackageStatQuery) returns (google.protobuf.Struct) { + option (google.api.http) = { + post: "/identity/v1/package/stat" + body: "*" + }; + } +} + + +message CreatePackageRequest { + string name = 1; + // +optional + string description = 2; + // +optional + google.protobuf.Struct tags = 3; +} + +message UpdatePackageRequest { + string package_id = 1; + // +optional + string name = 2; + // +optional + string description = 3; + // +optional + google.protobuf.Struct tags = 4; +} + +message PackageRequest { + string package_id = 1; +} + +message ChangePackageOrderRequest { + string package_id = 1; + int32 order = 2; +} + +message PackageInfo { + string package_id = 1; + string name = 2; + string description = 3; + int32 order = 4; + bool is_default = 5; + google.protobuf.Struct tags = 11; + string domain_id = 21; + string workspace_id = 22; + string created_at = 31; + string updated_at = 32; +} + +message PackageSearchQuery { + // +optional + spaceone.api.core.v2.Query query = 1; + // +optional + string package_id = 2; + // +optional + string name = 3; +} + +message PackagesInfo { + repeated PackageInfo results = 1; + int32 total_count = 2; +} + +message PackageStatQuery { + spaceone.api.core.v2.StatisticsQuery query = 1; +} diff --git a/proto/spaceone/api/identity/v2/user_group.proto b/proto/spaceone/api/identity/v2/user_group.proto index 24a98398d..c02ec0cd4 100644 --- a/proto/spaceone/api/identity/v2/user_group.proto +++ b/proto/spaceone/api/identity/v2/user_group.proto @@ -72,7 +72,9 @@ service UserGroup { message CreateUserGroupRequest { string name = 1; // +optional - google.protobuf.Struct tags = 2; + string description = 2; + // +optional + google.protobuf.Struct tags = 3; } message UpdateUserGroupRequest { @@ -80,7 +82,9 @@ message UpdateUserGroupRequest { // +optional string name = 2; // +optional - google.protobuf.Struct tags = 3; + string description = 3; + // +optional + google.protobuf.Struct tags = 4; } message UserGroupRequest { @@ -95,8 +99,9 @@ message UsersUserGroupRequest { message UserGroupInfo { string user_group_id = 1; string name = 2; - repeated string users = 3; - google.protobuf.Struct tags = 4; + string description = 3; + repeated string users = 4; + google.protobuf.Struct tags = 5; string domain_id = 21; string workspace_id = 22; string created_at = 31;