Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples for domain, project, role, user, workspace #444

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 79 additions & 1 deletion proto/spaceone/api/identity/v2/domain.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ service Domain {
body: "*"
};
}

// +noauth
rpc get_auth_info (GetDomainAuthRequest) returns (DomainAuthInfo) {
option (google.api.http) = {
Expand Down Expand Up @@ -89,13 +90,28 @@ message Admin {
bool reset_password = 8;
}

//{
// "name": "wonny-dev",
// "admin": {
// "user_id": "[email protected]",
// "name": "Wonny",
// "password": "Password1234!",
// "email": "[email protected]",
// "language": "en",
// "timezone": "UTC"
// }
//}
message CreateDomainRequest {
string name = 1;
Admin admin = 2;
// +optional
google.protobuf.Struct tags = 3;
}

//{
// "domain_id": "domain-a1b2c3d4e5f6",
// "name": "wonny-dev"
//}
message UpdateDomainRequest {
string domain_id = 1;
// +optional
Expand All @@ -104,15 +120,41 @@ message UpdateDomainRequest {
google.protobuf.Struct tags = 3;
}


//{
// "domain_id": "domain-a1b2c3d4e5f6"
//}
message DomainRequest {
string domain_id = 1;
}

//{
// "name": "wonny-dev"
//}
message GetDomainAuthRequest {
string name = 1;
}

//{
// "domain_id": "domain-a1b2c3d4e5f6",
// "name": "wonny-dev",
// "external_auth_state": "DISABLED",
// "metadata": {},
// "config": {
// "settings": {
// "unified_cost_config": {
// "aggregation_day": 15.0,
// "currency": "KRW",
// "custom_exchange_rate": {},
// "exchange_date": 15.0,
// "exchange_rate_mode": "AUTO",
// "exchange_source": "Yahoo! Finance",
// "is_exchange_last_day": false,
// "is_last_day": false,
// "run_hour": 0.0
// }
// }
// }
//}
message DomainAuthInfo {
enum ExternalAuthState {
NONE = 0;
Expand All @@ -127,6 +169,12 @@ message DomainAuthInfo {
google.protobuf.Struct config = 5;
}

//{
// "domain_id": "domain-a1b2c3d4e5f6",
// "name": "wonny-dev",
// "state": "ENABLED",
// "created_at": "2024-11-12T02:24:01.233Z"
//}
message DomainInfo {
enum State {
NONE = 0;
Expand All @@ -142,6 +190,19 @@ message DomainInfo {
string deleted_at = 32;
}

//{
// "query": {
// "filter": [{
// "k": "tag.env",
// "v": "dev",
// "o": "eq"
// }],
// "sort": [{
// "key": "created_at",
// "desc": true
// }]
// }
//}
message DomainSearchQuery {
enum State {
NONE = 0;
Expand All @@ -158,6 +219,23 @@ message DomainSearchQuery {
State state = 4;
}

//{
// "results": [
// {
// "domain_id": "domain-a1b2c3d4e5f6",
// "name": "wonny-dev1",
// "state": "ENABLED",
// "created_at": "2024-11-12T02:24:01.233Z"
// },
// {
// "domain_id": "domain-g7h8i9j1k2l3",
// "name": "wonny-dev2",
// "state": "ENABLED",
// "created_at": "2024-11-01T03:34:01.233Z"
// }
// ],
// "total_count": 2
//}
message DomainsInfo {
repeated DomainInfo results = 1;
int32 total_count = 2;
Expand Down
79 changes: 79 additions & 0 deletions proto/spaceone/api/identity/v2/project.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ service Project {
body: "*"
};
}

rpc update (UpdateProjectRequest) returns (ProjectInfo) {
option (google.api.http) = {
post: "/identity/v2/project/update"
Expand All @@ -32,6 +33,7 @@ service Project {
body: "*"
};
}

rpc change_project_group (ChangeProjectGroupRequest) returns (ProjectInfo) {
option (google.api.http) = {
post: "/identity/v2/project/change-project-group"
Expand Down Expand Up @@ -87,6 +89,10 @@ enum ProjectType {
PUBLIC = 2;
}

//{
// "name": "Cloudforet Project",
// "project_type": "PUBLIC"
//}
message CreateProjectRequest {
string name = 1;
ProjectType project_type = 2;
Expand All @@ -96,6 +102,10 @@ message CreateProjectRequest {
string project_group_id = 4;
}

//{
// "project_id": "project-a1b2c3d4e5f6",
// "name": "Wonny Project"
//}
message UpdateProjectRequest {
string project_id = 1;
// +optional
Expand All @@ -104,25 +114,50 @@ message UpdateProjectRequest {
google.protobuf.Struct tags = 3;
}

//{
// "project_id": "project-a1b2c3d4e5f6",
// "project_type": "PRIVATE"
//}
message UpdateProjectTypeRequest {
string project_id = 1;
ProjectType project_type = 2;
}

//{
// "project_group_id": "pg-a1b2c3d4e5f6",
// "project_id": "project-a1b2c3d4e5f6"
//}
message ChangeProjectGroupRequest {
string project_id = 1;
string project_group_id = 2;
}

//{
// "project_id": "project-a1b2c3d4e5f6"
//}
message ProjectRequest {
string project_id = 1;
}


//{
// "project_id": "project-a1b2c3d4e5f6",
// "users": ["[email protected]", "[email protected]"]
//}
message UsersProjectRequest {
string project_id = 1;
repeated string users = 2;
}

//{
// "project_id": "project-a1b2c3d4e5f6",
// "name": "Cloudforet Project",
// "project_type": "PUBLIC",
// "created_by": "[email protected]",
// "domain_id": "domain-a1b2c3d4e5f6",
// "workspace_id": "workspace-a1b2c3d4e5f6",
// "created_at": "2024-11-13T06:35:11.877Z"
//}
message ProjectInfo {
string project_id = 1;
string name = 2;
Expand All @@ -140,6 +175,19 @@ message ProjectInfo {
string last_synced_at = 32;
}

//{
// "project_type": "PRIVATE",
// "query": {
// "page": {
// "start": 1,
// "limit": 10
// },
// "sort": [{
// "key": "created_at",
// "desc": true
// }]
// }
//}
message ProjectSearchQuery {
// +optional
spaceone.api.core.v2.Query query = 1;
Expand All @@ -161,6 +209,37 @@ message ProjectSearchQuery {
string user_id = 24;
}

//{
// "results": [
// {
// "created_at": "2024-11-13T07:01:56.295Z",
// "created_by": "[email protected]",
// "domain_id": "domain-d11d0ccbbea8",
// "name": "hanhyung-project1",
// "project_group_id": "pg-0a33ab207144",
// "project_id": "project-5c84552701b1",
// "project_type": "PRIVATE",
// "users": [
// "[email protected]"
// ],
// "workspace_id": "workspace-a13327969661"
// },
// {
// "created_at": "2024-11-13T06:35:11.877Z",
// "created_by": "[email protected]",
// "domain_id": "domain-d11d0ccbbea8",
// "name": "hanhyung-project2",
// "project_group_id": "pg-0a33ab207144",
// "project_id": "project-cc4e2ebecc4e",
// "project_type": "PRIVATE",
// "users": [
// "[email protected]"
// ],
// "workspace_id": "workspace-a13327969661"
// }
// ],
// "total_count": 2
//}
message ProjectsInfo {
repeated ProjectInfo results = 1;
int32 total_count = 2;
Expand Down
Loading
Loading