Skip to content

Commit

Permalink
feat: add DataSourceAccount service
Browse files Browse the repository at this point in the history
Signed-off-by: ImMin5 <[email protected]>
  • Loading branch information
ImMin5 committed Apr 19, 2024
1 parent 79e68b1 commit 13b6fad
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 17 deletions.
2 changes: 1 addition & 1 deletion proto/spaceone/api/cost_analysis/plugin/cost.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ service Cost {

message GetLinkedAccountsRequest {
google.protobuf.Struct options = 1;
google.protobuf.Struct schema = 2;
string schema = 2;
google.protobuf.Struct secret_data = 3;
string domain_id = 21;
}
Expand Down
33 changes: 17 additions & 16 deletions proto/spaceone/api/cost_analysis/plugin/job.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,39 @@ import "google/protobuf/struct.proto";


service Job {
rpc get_tasks (GetTasksRequest) returns (TasksInfo) {}
rpc get_tasks (GetTasksRequest) returns (TasksInfo) {}
}

//{
//
//}
message GetTasksRequest {
google.protobuf.Struct options = 1;
google.protobuf.Struct secret_data = 2;
// +optional
string schema = 3;
// +optional
string start = 4;
// +optional
string last_synchronized_at = 5;
string domain_id = 6;
google.protobuf.Struct options = 1;
google.protobuf.Struct secret_data = 2;
// +optional
string schema = 3;
// +optional
string start = 4;
// +optional
string last_synchronized_at = 5;
string domain_id = 6;
repeated google.protobuf.Struct linked_accounts = 7;
}

message TaskInfo {
google.protobuf.Struct task_options = 1;
google.protobuf.Struct task_options = 1;
}

message ChangedInfo {
string start = 1;
string end = 2;
google.protobuf.Struct filter = 3;
string start = 1;
string end = 2;
google.protobuf.Struct filter = 3;
}

//{
//
//}
message TasksInfo {
repeated TaskInfo tasks = 1;
repeated ChangedInfo changed = 2;
repeated TaskInfo tasks = 1;
repeated ChangedInfo changed = 2;
}
111 changes: 111 additions & 0 deletions proto/spaceone/api/cost_analysis/v1/data_source_account.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// A DataSourceAccount is a resource that for routing cost data from a specific account to a workspace, project, service account.
syntax = "proto3";

package spaceone.api.cost_analysis.v1;

option go_package = "github.com/cloudforet-io/api/dist/go/spaceone/api/cost_analysis/v1";

import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
import "google/api/annotations.proto";
import "spaceone/api/core/v2/query.proto";


service DataSourceAccount {
// Update a DataSourceAccount with the specified DataSourceAccount ID related to the DataSource.
rpc update (UpdateDataSourceAccountRequest) returns (DataSourceAccountInfo) {
option (google.api.http) = {
post: "/cost-analysis/v1/data-source-account/update"
body: "*"
};
}

rpc reset (ResetDataSourceAccountRequest) returns (DataSourceAccountsInfo) {
option (google.api.http) = {
post: "/cost-analysis/v1/data-source-account/reset"
body: "*"
};
}

// Get a DataSourceAccount with the specified DataSourceAccount ID related to the DataSource.
rpc get (DataSourceAccountRequest) returns (DataSourceAccountInfo) {
option (google.api.http) = {
post: "/cost-analysis/v1/data-source-account/get"
body: "*"
};
}

rpc list (DataSourceAccountQuery) returns (DataSourceAccountsInfo) {
option (google.api.http) = {
post: "/cost-analysis/v1/data-source-account/list"
body: "*"
};
}

rpc stat (DataSourceAccountStatQuery) returns (google.protobuf.Struct) {
option (google.api.http) = {
post: "/cost-analysis/v1/data-source-account/stat"
body: "*"
};
}
}

message UpdateDataSourceAccountRequest{
string data_source_id = 1;
// account_id is the unique identifier of each CSP account.(e.g. Azure Tenant ID)
string account_id = 2;
// +optional
string workspace_id = 21;
// +optional
string project_id = 22;
// +optional
string service_account_id = 23;
}

message ResetDataSourceAccountRequest {
string data_source_account_id = 1;
}

message DataSourceAccountRequest {
string data_source_account_id = 1;
string account_id = 2;
}


message DataSourceAccountQuery {
// +optional
spaceone.api.core.v2.Query query = 1;
// +optional
string data_source_id = 2;
// +optional
string account_id = 3;
// +optional
string workspace_id = 21;
// +optional
string project_id = 22;
// +optional
string service_account_id = 23;
}

message DataSourceAccountInfo {
string account_id = 1;
string data_source_id = 2;
string name = 3;
bool is_sync = 4;
string domain_id = 21;
string workspace_id = 22;
string project_id = 23;
string service_account_id = 24;
string created_at = 31;
string updated_at = 32;
}

message DataSourceAccountsInfo {
repeated DataSourceAccountInfo results = 1;
int32 total_count = 2;

}

message DataSourceAccountStatQuery {
spaceone.api.core.v2.StatisticsQuery query = 1;
}

0 comments on commit 13b6fad

Please sign in to comment.