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

Feat/v2 workspaces #96

Merged
merged 24 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
111 changes: 110 additions & 1 deletion aruna/api/dataproxy/services/v2/dataproxy_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ service DataproxyService {
rpc InitReplication(InitReplicationRequest) returns (InitReplicationResponse) {}
}


service DataproxyBackendService {
rpc PutObject(stream PutObjectRequest) returns (PutObjectResponse) {}
rpc GetObject(GetObjectRequest) returns (stream GetObjectResponse) {}
rpc HeadObject(HeadObjectRequest) returns (HeadObjectResponse) {}
rpc InitMultiPartUpload(InitMultiPartUploadRequest) returns (InitMultiPartUploadResponse) {}
rpc UploadPart(stream UploadPartRequest) returns (UploadPartResponse) {}
rpc CompleteMultiPartUpload(CompleteMultiPartUploadRequest) returns (CompleteMultiPartUploadResponse) {}
rpc CreateBucket(CreateBucketRequest) returns (CreateBucketResponse) {}
rpc DeleteBucket(DeleteBucketRequest) returns (DeleteBucketResponse) {}
rpc DeleteObject(DeleteObjectRequest) returns (DeleteObjectResponse) {}
rpc InitLocation(InitLocationRequest) returns (InitLocationResponse) {}
}

service DataproxyUserService {
// GetCredentials
//
Expand Down Expand Up @@ -74,6 +88,10 @@ service DataproxyUserService {
}
}





message DataProxyInfo {
string dataproxy_id = 1;
int64 available_space = 2;
Expand Down Expand Up @@ -160,4 +178,95 @@ enum ReplicationStatus {
message ReplicationStatusResponse {
ReplicationStatus status = 1;
string message = 2;
}
}

message ObjectLocation {
string bucket = 1;
string key = 2;
string upload_id = 3;
string content_length = 4;
}

message PutObjectRequest {
ObjectLocation location = 1;
bytes data = 2;
}

message PutObjectResponse {}

message GetObjectRequest {
ObjectLocation location = 1;
}

message GetObjectResponse {
bytes data = 1;
}

message HeadObjectRequest {
ObjectLocation location = 1;
}

message HeadObjectResponse {
string content_length = 1;
bool exists = 2;
}

message InitMultiPartUploadRequest {
ObjectLocation location = 1;
}

message InitMultiPartUploadResponse {
string upload_id = 1;
}

message UploadPartRequest {
ObjectLocation location = 1;
int32 part_number = 3;
bytes data = 4;
}

message UploadPartResponse {
string etag = 1;
}

message CompletedPart {
int32 part_number = 1;
string etag = 2;
}

message CompleteMultiPartUploadRequest {
ObjectLocation location = 1;
repeated CompletedPart completed_parts = 2;
}

message CompleteMultiPartUploadResponse {}

message CreateBucketRequest {
string bucket = 1;
}

message CreateBucketResponse {}

message DeleteBucketRequest {
string bucket = 1;
}

message DeleteBucketResponse {}

message DeleteObjectRequest {
ObjectLocation location = 1;
}

message DeleteObjectResponse {}

message InitLocationRequest {
string object_name = 1;
int64 size = 2;
bool is_temporary = 3;
}

message InitLocationResponse {
ObjectLocation location = 1;
}


2 changes: 1 addition & 1 deletion aruna/api/google
Submodule google updated 143 files
89 changes: 68 additions & 21 deletions aruna/api/hooks/services/v2/hooks_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,40 @@ package aruna.api.hooks.services.v2;
option go_package = "github.com/ArunaStorage/go-api/aruna/api/storage/services/v2";
option java_multiple_files = true;
option java_package = "com.github.ArunaStorage.java_api.aruna.api.storage.services.v2";
option java_outer_classname = "HooksService";
option java_outer_classname = "HooksService";
import "google/api/annotations.proto";

import "aruna/api/storage/models/v2/models.proto";


// HooksService
//
// Status: ALPHA
//
// A service that enables automatic Hook scheduling
service HooksService {
// Created Hooks are always associated with the owner that creates the hook
rpc CreateHook(CreateHookRequest) returns (CreateHookResponse) {
option (google.api.http) = {
post : "/v2/hook"
body : "*"
};
}
rpc ListHooks(ListHooksRequest) returns (ListHooksResponse) {
rpc AddProjectsToHook(AddProjectsToHookRequest) returns (AddProjectsToHookResponse) {
option (google.api.http) = {
post : "/v2/hook/{hook_id}/{project_id}"
body : "*"
};
}
rpc ListProjectHooks(ListProjectHooksRequest) returns (ListProjectHooksResponse) {
option (google.api.http) = {
get : "/v2/hooks/project/{project_id}"
};
}
rpc ListOwnedHooks(ListOwnedHooksRequest) returns (ListOwnedHooksResponse) {
option (google.api.http) = {
get : "/v2/hooks/owner/{user_id}"
};
}
rpc DeleteHook(DeleteHookRequest) returns (DeleteHookResponse) {
option (google.api.http) = {
delete : "/v2/hook/{hook_id}"
Expand All @@ -42,8 +54,12 @@ enum TriggerType {
TRIGGER_TYPE_UNSPECIFIED = 0;
TRIGGER_TYPE_HOOK_ADDED = 1;
TRIGGER_TYPE_OBJECT_CREATED = 2;
TRIGGER_TYPE_LABEL_ADDED = 3;
TRIGGER_TYPE_STATIC_LABEL_ADDED = 4;
TRIGGER_TYPE_HOOK_STATUS_CHANGED = 5;
}


message Trigger {
TriggerType trigger_type = 1;
string key = 2;
Expand All @@ -53,8 +69,11 @@ message Trigger {
message ExternalHook {
string url = 1;
Credentials credentials = 2;
string json_template = 3;
Method method = 4;
// If empty a basic JSON template will be used
optional string custom_template = 3;
// Optional Project/Collection/Dataset where hooks can upload results.
optional string result_object = 4;
Method method = 5;
}

enum Method {
Expand Down Expand Up @@ -94,10 +113,12 @@ message Credentials {
}

message CreateHookRequest {
Trigger trigger = 1;
Hook hook = 2;
uint64 timeout = 3;
string project_id = 4;
string name = 1;
Trigger trigger = 2;
Hook hook = 3;
uint64 timeout = 4;
repeated string project_ids = 5;
string description = 6;
}
message CreateHookResponse {
string hook_id = 1;
Expand All @@ -110,28 +131,54 @@ message DeleteHookRequest {
message DeleteHookResponse {}

message HookCallbackRequest {
bool success = 1;
repeated storage.models.v2.KeyValue add_key_values = 2;
repeated storage.models.v2.KeyValue remove_key_values = 3;
string secret = 4;
string hook_id = 5;
string object_id = 6;
int32 pubkey_serial = 7;
oneof status {
Finished finished = 1;
Error error = 2;
};
string secret = 3;
string hook_id = 4;
string object_id = 5;
int32 pubkey_serial = 6;
}
message Finished {
repeated storage.models.v2.KeyValue add_key_values = 1;
repeated storage.models.v2.KeyValue remove_key_values = 2;
}
message Error {
string error = 1;
}

message HookCallbackResponse{}

message ListHooksRequest{
message ListProjectHooksRequest{
string project_id = 1;
}

message ListOwnedHooksRequest{
string user_id = 1;
}

message HookInfo {
string hook_id = 1;
Hook hook = 2;
Trigger trigger = 3;
uint64 timeout = 4;
repeated string project_ids = 2;
string name = 3;
string description = 4;
Hook hook = 5;
Trigger trigger = 6;
uint64 timeout = 7;
}

message ListProjectHooksResponse{
repeated HookInfo infos = 1;
}

message ListHooksResponse{
message ListOwnedHooksResponse{
repeated HookInfo infos = 1;
}

message AddProjectsToHookRequest {
string hook_id = 1;
repeated string project_ids = 2;
}

message AddProjectsToHookResponse {};
6 changes: 4 additions & 2 deletions aruna/api/storage/services/v2/object_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ message UpdateObjectRequest {
string object_id = 1;
// object name
optional string name = 2;
//
// object description
optional string description = 3;
// key_values to add
repeated storage.models.v2.KeyValue add_key_values = 4;
Expand All @@ -234,6 +234,8 @@ message UpdateObjectRequest {
string dataset_id = 10;
}
repeated storage.models.v2.Hash hashes = 12;
// Force new object revision
bool force_revision = 13;
}

message UpdateObjectResponse {
Expand Down Expand Up @@ -308,4 +310,4 @@ message GetObjectEndpointsRequest {
string collection_id = 1;
// Object id
string object_id = 2;
}
}
16 changes: 16 additions & 0 deletions aruna/api/storage/services/v2/search_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ service SearchService {
};
}

// RequestResourceAccess
//
// Status: ALPHA
//
// Requests access to resources
rpc RequestResourceAccess(RequestResourceAccessRequest) returns (RequestResourceAccessResponse){
option (google.api.http) = {
get : "/v2/resource/{resource_id}/access"
};
}
}

message SearchResourcesRequest {
Expand Down Expand Up @@ -86,3 +96,9 @@ message GetResourcesResponse {
repeated ResourceWithPermission resources = 1;
}

message RequestResourceAccessRequest {
string resource_id = 1;
}


message RequestResourceAccessResponse {}
Loading
Loading