Skip to content

Commit

Permalink
feat(optimus): add resource upsert rpc (#108)
Browse files Browse the repository at this point in the history
* feat(optimus): add resource upsert rpc

* feat(optimus): accept multiple resources when doing upsert

* feat(optimus): include resource upsert detail result in upsert response

* feat(optimus): add message to upsert result

* feat(optimus): expose http api for resource upsert

* feat(optimus): add successful resource names in resource upsert response
  • Loading branch information
arinda-arif authored Jun 25, 2024
1 parent 5499ce1 commit 0278f04
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions gotocompany/optimus/core/v1beta1/resource.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ service ResourceService {
body: "*"
};
}
// UpsertResource updates/inserts a resource specification of a datastore in project
rpc UpsertResource(UpsertResourceRequest) returns (UpsertResourceResponse) {
option (google.api.http) = {
post: "/v1beta1/project/{project_name}/namespace/{namespace_name}/datastore/{datastore_name}/resources-upsert"
body: "*"
};
}

// DeleteResource soft delete a specific resource
rpc DeleteResource(DeleteResourceRequest) returns (DeleteResourceResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -140,6 +148,26 @@ message UpdateResourceResponse {
string message = 2;
}

message UpsertResourceRequest {
string project_name = 1;
string datastore_name = 2;
repeated ResourceSpecification resources = 3;
string namespace_name = 4;
}

message UpsertResourceResponse {
bool success = 1;
string message = 2;
repeated ResourceStatus results = 3;
repeated string successful_resource_names = 4;
}

message ResourceStatus {
string resource_name = 1;
string status = 2;
string message = 3;
}

// ResourceSpecification are datastore specification representation of a resource
message ResourceSpecification {
reserved 3; // depricated "datastore"
Expand Down

0 comments on commit 0278f04

Please sign in to comment.