diff --git a/proto/spaceone/api/cost_analysis/v1/cost_report.proto b/proto/spaceone/api/cost_analysis/v1/cost_report.proto index 40f8749e..8bfa67f7 100644 --- a/proto/spaceone/api/cost_analysis/v1/cost_report.proto +++ b/proto/spaceone/api/cost_analysis/v1/cost_report.proto @@ -103,9 +103,11 @@ message CostReportInfo { string report_month = 9; string workspace_name = 10; string bank_name = 11; + bool is_adjusted = 12; string cost_report_config_id = 21; - string workspace_id = 22; - string domain_id = 23; + string project_id = 22; + string workspace_id = 23; + string domain_id = 24; string created_at = 31; } diff --git a/proto/spaceone/api/cost_analysis/v1/cost_report_config.proto b/proto/spaceone/api/cost_analysis/v1/cost_report_config.proto index f399ba9e..4fce1ae2 100644 --- a/proto/spaceone/api/cost_analysis/v1/cost_report_config.proto +++ b/proto/spaceone/api/cost_analysis/v1/cost_report_config.proto @@ -82,19 +82,32 @@ service CostReportConfig { } } +message AdjustmentOptions { + bool enabled = 1; + int32 period = 2; +} + message CreateCostReportConfigRequest { + enum Scope { + SCOPE_NONE = 0; + WORKSPACE = 1; + PROJECT = 2; + } + Scope scope = 1; // +optional - int32 issue_day = 1; + int32 issue_day = 2; // +optional - bool is_last_day = 2; + bool is_last_day = 3; // +optional - string currency = 3; - google.protobuf.Struct recipients = 4; + AdjustmentOptions adjustment_options = 4; // +optional - google.protobuf.Struct data_source_filter = 5; + string currency = 6; + google.protobuf.Struct recipients = 7; + // +optional + google.protobuf.Struct data_source_filter = 8; // Default `en` // +optional - string language = 6; + string language = 9; } message UpdateCostReportConfigRequest { @@ -105,11 +118,13 @@ message UpdateCostReportConfigRequest { // +optional bool is_last_day = 3; // +optional - string currency = 4; + AdjustmentOptions adjustment_options = 4; // +optional - google.protobuf.Struct data_source_filter = 5; + string currency = 6; // +optional - string language = 6; + google.protobuf.Struct data_source_filter = 7; + // +optional + string language = 8; } @@ -130,6 +145,12 @@ message CostReportConfigQuery { DISABLED = 2; } + enum Scope { + SCOPE_NONE = 0; + WORKSPACE = 1; + PROJECT = 2; + } + // +optional spaceone.api.core.v2.Query query = 1; // The ID of cost report in the Protocol. @@ -137,6 +158,8 @@ message CostReportConfigQuery { string cost_report_config_id = 2; // +optional State state = 3; + // +optional + Scope scope = 4; } message CostReportConfigInfo { @@ -147,15 +170,23 @@ message CostReportConfigInfo { DELETED = 3; } + enum Scope { + SCOPE_NONE = 0; + WORKSPACE = 1; + PROJECT = 2; + } + // The ID of cost report in the Protocol. string cost_report_config_id = 1; State state = 2; - int32 issue_day = 3; - bool is_last_day = 4; - string currency = 6; - google.protobuf.Struct recipients = 7; - google.protobuf.Struct data_source_filter = 8; - string language = 9; + Scope scope = 3; + int32 issue_day = 4; + bool is_last_day = 5; + AdjustmentOptions adjustment_options = 6; + string currency = 8; + google.protobuf.Struct recipients = 9; + google.protobuf.Struct data_source_filter = 10; + string language = 11; string domain_id = 21; string created_at = 31; string updated_at = 32; diff --git a/proto/spaceone/api/cost_analysis/v1/cost_report_data.proto b/proto/spaceone/api/cost_analysis/v1/cost_report_data.proto index f448af75..2622b6cf 100644 --- a/proto/spaceone/api/cost_analysis/v1/cost_report_data.proto +++ b/proto/spaceone/api/cost_analysis/v1/cost_report_data.proto @@ -84,19 +84,21 @@ message CostReportDataInfo { string report_year = 5; string report_month = 6; bool is_confirmed = 7; - string provider = 8; - string product = 9; - string service_account_name = 10; - string data_source_name = 11; - string project_name = 12; - string workspace_name = 13; + bool is_adjusted = 8; + string provider = 9; + string product = 10; + string service_account_name = 11; + string data_source_name = 12; + string project_name = 13; + string workspace_name = 14; string domain_id = 21; string workspace_id = 22; string project_id = 23; string cost_report_config_id = 24; - string cost_report_id = 25; - string data_source_id = 26; - string service_account_id = 27; + string report_adjustment_policy_id = 25; + string cost_report_id = 26; + string data_source_id = 27; + string service_account_id = 28; string created_at = 31; } diff --git a/proto/spaceone/api/cost_analysis/v1/report_adjustment.proto b/proto/spaceone/api/cost_analysis/v1/report_adjustment.proto new file mode 100644 index 00000000..0c6dd4c6 --- /dev/null +++ b/proto/spaceone/api/cost_analysis/v1/report_adjustment.proto @@ -0,0 +1,148 @@ +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/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; +import "spaceone/api/core/v2/query.proto"; +import "spaceone/api/cost_analysis/v1/job.proto"; + +service ReportAdjustment { + rpc create (CreateReportAdjustmentRequest) returns (ReportAdjustmentInfo) { + option (google.api.http) = { + post: "/cost-analysis/v1/report-adjustment/create", + body: "*" + }; + } + + rpc update (UpdateReportAdjustmentRequest) returns (ReportAdjustmentInfo) { + option (google.api.http) = { + post: "/cost-analysis/v1/report-adjustment/update", + body: "*" + }; + } + + rpc change_order (ChangeOrderReportAdjustmentRequest) returns (ReportAdjustmentInfo) { + option (google.api.http) = { + post: "/cost-analysis/v1/report-adjustment/change-order", + body: "*" + }; + } + + rpc delete (ReportAdjustmentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/cost-analysis/v1/report-adjustment/delete" + body: "*" + }; + } + + rpc get (ReportAdjustmentRequest) returns (ReportAdjustmentInfo) { + option (google.api.http) = { + post: "/cost-analysis/v1/report-adjustment/get", + body: "*" + }; + } + + rpc list (ReportAdjustmentQuery) returns (ReportAdjustmentsInfo) { + option (google.api.http) = { + post: "/cost-analysis/v1/report-adjustment/list", + body: "*" + }; + } + +} + +enum AdjustmentMethod { + METHOD_NONE = 0; + FIXED = 1; + RATE = 2; +} + +message CreateReportAdjustmentRequest { + string name = 1; + AdjustmentMethod method = 2; + float value = 3; + // +optional + string description = 4; + // +optional + string provider = 5; + // +optional + string currency = 6; + // +optional + int32 order = 7; + // +optional + google.protobuf.Struct filters = 8; + string report_adjustment_policy_id = 10; +} + +message UpdateReportAdjustmentRequest { + string report_adjustment_id = 1; + // +optional + string name = 2; + // +optional + AdjustmentMethod method = 3; + // +optional + float value = 4; + // +optional + string description = 5; + // +optional + string provider = 6; + // +optional + google.protobuf.Struct filters = 7; +} + +message ChangeOrderReportAdjustmentRequest { + string report_adjustment_id = 1; + int32 order = 2; +} + +message ReportAdjustmentRequest { + string report_adjustment_id = 1; +} + +message ReportAdjustmentQuery { + enum State { + NONE = 0; + ENABLED = 1; + DISABLED = 2; + DELETED = 3; + } + // +optional + spaceone.api.core.v2.Query query = 1; + // +optional + string name = 2; + // +optional + State state = 3; + // +optional + string workspace_id = 4; + // +optional + string project_id = 5; +} + +message ReportAdjustmentInfo { + string report_adjustment_id = 1; + string name = 2; + AdjustmentMethod method = 3; + float value = 4; + string description = 5; + string provider = 6; + string currency = 7; + int32 order = 8; + google.protobuf.Struct filters = 9; + + string created_at = 11; + string updated_at = 12; + string deleted_at = 13; + + string cost_report_config_id = 19; + string report_adjustment_policy_id = 20; + string domain_id = 21; +} + +message ReportAdjustmentsInfo { + repeated ReportAdjustmentInfo results = 1; + int32 total_count = 2; +} \ No newline at end of file diff --git a/proto/spaceone/api/cost_analysis/v1/report_adjustment_policy.proto b/proto/spaceone/api/cost_analysis/v1/report_adjustment_policy.proto new file mode 100644 index 00000000..c2ec58b1 --- /dev/null +++ b/proto/spaceone/api/cost_analysis/v1/report_adjustment_policy.proto @@ -0,0 +1,149 @@ +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/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; +import "spaceone/api/core/v2/query.proto"; +import "spaceone/api/cost_analysis/v1/job.proto"; + +service ReportAdjustmentPolicy { + rpc create (CreateReportAdjustmentPolicyRequest) returns (ReportAdjustmentPolicyInfo) { + option (google.api.http) = { + post: "/cost-analysis/v1/report-adjustment-policy/create", + body: "*" + }; + } + + rpc update (UpdateReportAdjustmentPolicyRequest) returns (ReportAdjustmentPolicyInfo) { + option (google.api.http) = { + post: "/cost-analysis/v1/report-adjustment-policy/update", + body: "*" + }; + } + + rpc change_order (ChangeOrderReportAdjustmentPolicyRequest) returns (ReportAdjustmentPolicyInfo) { + option (google.api.http) = { + post: "/cost-analysis/v1/report-adjustment-policy/change-order", + body: "*" + }; + } + + rpc delete (ReportAdjustmentPolicyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/cost-analysis/v1/report-adjustment-policy/delete" + body: "*" + }; + } + + rpc get (ReportAdjustmentPolicyRequest) returns (ReportAdjustmentPolicyInfo) { + option (google.api.http) = { + post: "/cost-analysis/v1/report-adjustment-policy/get", + body: "*" + }; + } + + rpc list (ReportAdjustmentPolicyQuery) returns (ReportAdjustmentPolicesInfo) { + option (google.api.http) = { + post: "/cost-analysis/v1/report-adjustment-policy/list", + body: "*" + }; + } + +} + +message CreateReportAdjustmentPolicyRequest { + enum Scope { + SCOPE_NONE = 0; + WORKSPACE = 1; + PROJECT = 2; + } + string name = 1; + Scope scope = 2; + string cost_report_config_id = 3; + // +optional + int32 order = 4; + // +optional + google.protobuf.Struct tags = 6; + // +optional + string project_id = 7; + // +optional + string workspace_id = 8; +} + +message UpdateReportAdjustmentPolicyRequest { + string report_adjustment_policy_id = 1; + // +optional + string name = 2; + // +optional + google.protobuf.Struct tags = 6; + // +optional + string workspace_id = 8; +} + +message ChangeOrderReportAdjustmentPolicyRequest { + string report_adjustment_policy_id = 1; + int32 order = 2; +} + +message ReportAdjustmentPolicyRequest { + string report_adjustment_policy_id = 1; +} + +message ReportAdjustmentPolicyQuery { + enum State { + NONE = 0; + ENABLED = 1; + DISABLED = 2; + DELETED = 3; + } + // +optional + spaceone.api.core.v2.Query query = 1; + // +optional + string name = 2; + // +optional + State state = 3; + // +optional + string workspace_id = 4; + // +optional + string project_id = 5; +} + +message ReportAdjustmentPolicyInfo { + enum Scope { + SCOPE_NONE = 0; + WORKSPACE = 1; + PROJECT = 2; + } + + enum State { + NONE = 0; + ENABLED = 1; + DISABLED = 2; + DELETED = 3; + } + string report_adjustment_policy_id = 1; + string name = 2; + State state = 3; + repeated string adjustments = 4; + Scope scope = 5; + int32 order = 6; + google.protobuf.Struct tags = 7; + string cost_report_config_id = 8; + + string created_at = 11; + string updated_at = 12; + string deleted_at = 13; + + string project_id = 21; + string workspace_id = 22; + string domain_id = 23; +} + +message ReportAdjustmentPolicesInfo { + repeated ReportAdjustmentPolicyInfo results = 1; + int32 total_count = 2; +} \ No newline at end of file