-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge: Merge pull request #77 from ArunaStorage/features-workspaces-l…
…ist-object-hooks [feature] Features: workspaces, list object v2, hooks
- Loading branch information
Showing
5 changed files
with
254 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
syntax = "proto3"; | ||
|
||
package aruna.api.hooks.services.v1; | ||
option go_package = "github.com/ArunaStorage/go-api/aruna/api/storage/services/v1"; | ||
option java_multiple_files = true; | ||
option java_package = "com.github.ArunaStorage.java_api.aruna.api.storage.services.v1"; | ||
option java_outer_classname = "HooksService"; | ||
|
||
import "aruna/api/storage/models/v1/models.proto"; | ||
|
||
// HooksService | ||
// | ||
// Status: ALPHA | ||
// | ||
// A service that enables automatic Hook scheduling | ||
service HooksService { | ||
rpc CreateHook(CreateHookRequest) returns (CreateHookResponse) {} | ||
rpc ListHooks(ListHooksRequest) returns (ListHooksResponse) {} | ||
rpc DeleteHook(DeleteHookRequest) returns (DeleteHookResponse) {} | ||
rpc HookCallback(HookCallbackRequest) returns (HookCallbackResponse) {} | ||
} | ||
|
||
enum TriggerType { | ||
TRIGGER_TYPE_UNSPECIFIED = 0; | ||
TRIGGER_TYPE_HOOK_ADDED = 1; | ||
} | ||
|
||
message Trigger { | ||
TriggerType trigger_type = 1; | ||
string key = 2; | ||
string value = 3; | ||
} | ||
|
||
message ExternalHook { | ||
string url = 1; | ||
Credentials credentials = 2; | ||
string json_template = 3; | ||
} | ||
|
||
enum InternalAction { | ||
INTERNAL_ACTION_UNSPECIFIED = 0; | ||
INTERNAL_ACTION_ADD_LABEL = 1; | ||
INTERNAL_ACTION_ADD_HOOK = 2; | ||
INTERNAL_ACTION_CREATE_READ_REFERENCE = 3; | ||
INTERNAL_ACTION_CREATE_WRITE_REFERENCE = 4; | ||
} | ||
|
||
message InternalHook { | ||
InternalAction internal_action = 1; | ||
// Either key or target ID | ||
string target_id = 2; | ||
// Optional value | ||
string value = 3; | ||
} | ||
|
||
message Hook { | ||
oneof hook_type { | ||
ExternalHook external_hook = 1; | ||
InternalHook internal_hook = 2; | ||
} | ||
} | ||
|
||
// Will be updated with additional credential types | ||
message Credentials { | ||
string token = 1; | ||
} | ||
|
||
message CreateHookRequest { | ||
Trigger trigger = 1; | ||
Hook hook = 2; | ||
uint64 timeout = 3; | ||
string project_id = 4; | ||
} | ||
message CreateHookResponse { | ||
string hook_id = 1; | ||
} | ||
|
||
message DeleteHookRequest { | ||
string hook_id = 1; | ||
} | ||
|
||
message DeleteHookResponse {} | ||
|
||
message HookCallbackRequest { | ||
bool success = 1; | ||
repeated aruna.api.storage.models.v1.KeyValue labels = 2; | ||
repeated aruna.api.storage.models.v1.KeyValue hooks = 3; | ||
} | ||
|
||
message HookCallbackResponse{} | ||
|
||
message ListHooksRequest{ | ||
string project_id = 1; | ||
} | ||
|
||
|
||
message HookInfo { | ||
string hook_id = 1; | ||
Hook hook = 2; | ||
Trigger trigger = 3; | ||
uint64 timeout = 4; | ||
} | ||
|
||
message ListHooksResponse{ | ||
repeated HookInfo infos = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters