Skip to content

Commit

Permalink
Merge pull request #143 from whdalsrnt/master
Browse files Browse the repository at this point in the history
Cloud Service Report API
  • Loading branch information
whdalsrnt authored Oct 23, 2023
2 parents 850f32f + 2a99d74 commit 38e7721
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 5 deletions.
2 changes: 1 addition & 1 deletion proto/spaceone/api/core/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ message ExportAnalyzeQuery {
google.protobuf.Struct select = 7;
}

message ExportOptions {
message ExportOption {
enum QueryType{
QUERY_TYPE_NONE = 0;
SEARCH = 1;
Expand Down
11 changes: 9 additions & 2 deletions proto/spaceone/api/inventory/v1/cloud_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,15 @@ message CloudServicesInfo {
}

message CloudServiceExportRequest {
repeated spaceone.api.core.v1.ExportOptions options = 1;
string domain_id = 2;
enum FileFormat {
NONE_FILE_FORMAT = 0;
EXCEL = 1;
CSV = 2;
}

repeated spaceone.api.core.v1.ExportOption options = 1;
FileFormat file_format = 2;
string domain_id = 3;
}

message CloudServiceAnalyzeQuery {
Expand Down
2 changes: 0 additions & 2 deletions proto/spaceone/api/inventory/v1/cloud_service_query_set.proto
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ message CreateCloudServiceQuerySetRequest {
string cloud_service_type = 6;
// +optional
google.protobuf.Struct tags = 11;

string domain_id = 21;
}

Expand All @@ -147,7 +146,6 @@ message UpdateCloudServiceQuerySetRequest {
google.protobuf.Struct unit = 4;
// +optional
google.protobuf.Struct tags = 11;
// +optional
string domain_id = 21;
}

Expand Down
182 changes: 182 additions & 0 deletions proto/spaceone/api/inventory/v1/cloud_service_report.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
syntax = "proto3";

package spaceone.api.inventory.v1;

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

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


service CloudServiceReport {

rpc create (CreateCloudServiceReportRequest) returns (CloudServiceReportInfo) {
option (google.api.http) = {
post: "/inventory/v1/cloud-service-report/create"
body: "*"
};
}

rpc update (UpdateCloudServiceReportRequest) returns (CloudServiceReportInfo) {
option (google.api.http) = {
post: "/inventory/v1/cloud-service-report/update"
body: "*"
};
}

rpc delete (CloudServiceReportRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/inventory/v1/cloud-service-report/delete"
body: "*"
};
}

rpc send (CloudServiceReportRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/inventory/v1/cloud-service-report/send"
body: "*"
};
}

rpc get (GetCloudServiceReportRequest) returns (CloudServiceReportInfo) {
option (google.api.http) = {
post: "/inventory/v1/cloud-service-report/get"
body: "*"
};
}

rpc list (CloudServiceReportQuery) returns (CloudServiceReportsInfo) {
option (google.api.http) = {
post: "/inventory/v1/cloud-service-report/list"
body: "*"
};
}

rpc stat (CloudServiceReportStatQuery) returns (google.protobuf.Struct) {
option (google.api.http) = {
post: "/inventory/v1/cloud-service-report/stat"
body: "*"
};
}
}

message ReportSchedule {
enum ScheduleState {
SCHEDULE_STATE_NONE = 0;
ENABLED = 1;
DISABLED = 2;
}

enum DayOfWeek {
DAY_OF_WEEK_NONE = 0;
MON = 1;
TUE = 2;
WED = 3;
THU = 4;
FRI = 5;
SAT = 6;
SUN = 7;
}

ScheduleState state = 1;
repeated int32 hours = 2;
repeated DayOfWeek days_of_week = 3;
}

message CreateCloudServiceReportRequest {
enum FileFormat {
NONE_FILE_FORMAT = 0;
EXCEL = 1;
CSV = 2;
}

string name = 1;
repeated spaceone.api.core.v1.ExportOption options = 2;
// +optional
FileFormat file_format = 3;
ReportSchedule schedule = 4;
google.protobuf.Struct target = 5;
// +optional
google.protobuf.Struct tags = 11;
string domain_id = 21;
}


message UpdateCloudServiceReportRequest {
enum FileFormat {
NONE_FILE_FORMAT = 0;
EXCEL = 1;
CSV = 2;
}

string report_id = 1;
// +optional
string name = 2;
// +optional
repeated spaceone.api.core.v1.ExportOption options = 3;
// +optional
FileFormat file_format = 4;
// +optional
ReportSchedule schedule = 5;
// +optional
google.protobuf.Struct target = 6;
// +optional
google.protobuf.Struct tags = 11;
string domain_id = 21;
}

message CloudServiceReportRequest {
string report_id = 1;
string domain_id = 2;
}

message GetCloudServiceReportRequest {
string report_id = 1;
string domain_id = 2;
// +optional
repeated string only = 3;
}

message CloudServiceReportQuery {
// +optional
spaceone.api.core.v1.Query query = 1;
// +optional
string report_id = 2;
// +optional
string name = 3;
string domain_id = 11;
}

message CloudServiceReportInfo {
enum FileFormat {
NONE_FILE_FORMAT = 0;
EXCEL = 1;
CSV = 2;
}

string report_id = 1;
string name = 2;
repeated spaceone.api.core.v1.ExportOption options = 3;
FileFormat file_format = 4;
ReportSchedule schedule = 5;
google.protobuf.Struct target = 6;

google.protobuf.Struct tags = 11;

string domain_id = 21;

string created_at = 31;
string updated_at = 32;
}

message CloudServiceReportsInfo {
repeated CloudServiceReportInfo results = 1;
int32 total_count = 2;
}

message CloudServiceReportStatQuery {
spaceone.api.core.v1.StatisticsQuery query = 1;
string domain_id = 2;
}

0 comments on commit 38e7721

Please sign in to comment.