| syntax = "proto3"; |
| |
| option java_multiple_files = true; |
| package org.apache.airavata.datalake.metadata.service; |
| |
| import "google/api/annotations.proto"; |
| import "common/Common.proto"; |
| import "user/User.proto"; |
| import "group/Group.proto"; |
| |
| |
| message ResourceMetadataAPIRequest { |
| Resource resource = 1; |
| MetadataServiceAuthToken auth_token = 2; |
| string source = 3; |
| } |
| |
| |
| message ResourceMetadataSharingRequest { |
| repeated ResourceSharings sharings = 1; |
| MetadataServiceAuthToken auth_token = 2; |
| string source = 3; |
| } |
| |
| message ResourceMetadataAPIResponse { |
| bool status = 1; |
| } |
| |
| message ResourcePermissionRequest { |
| string username = 1; |
| string groupname = 2; |
| string permission_type = 3; |
| string tenant_id = 4; |
| string resource_name = 5; |
| map<string, string> resource_properties = 6; |
| } |
| |
| message ResourcePermissionResponse { |
| bool accessible = 1; |
| } |
| |
| |
| |
| message Resource { |
| string tenant_id = 1; |
| string name = 2; |
| string description = 3; |
| map<string, string> properties = 4; |
| int64 created_at = 5; |
| int64 last_modified_at = 6; |
| string type = 7; |
| string full_text = 8; |
| string source = 9; |
| repeated Resource child_resources = 10; |
| string parent_resource_id = 11; |
| repeated ResourceSharings sharings = 12; |
| } |
| |
| |
| message ResourceSharings { |
| string shared_entity_id = 1; |
| string shared_entity_type = 2; |
| string sharing_type = 3; |
| string permission_type = 4; |
| map<string, string> properties = 5; |
| int64 created_at = 6; |
| int64 last_modified_at = 7; |
| string resource_id = 8; |
| repeated User users = 9; |
| repeated Group groups = 10; |
| } |
| |
| |
| service ResourceMetadataService { |
| |
| rpc createResource (ResourceMetadataAPIRequest) returns (ResourceMetadataAPIResponse) { |
| option (google.api.http) = { |
| post: "/v1.0/api/metadata/resource" |
| }; |
| } |
| |
| rpc getResource (ResourceMetadataAPIRequest) returns (Resource) { |
| option (google.api.http) = { |
| get: "/v1.0/api/metadata/resource" |
| }; |
| } |
| |
| rpc updateResource (ResourceMetadataAPIRequest) returns (ResourceMetadataAPIResponse) { |
| option (google.api.http) = { |
| put: "/v1.0/api/metadata/resource" |
| }; |
| } |
| |
| rpc deleteResource (ResourceMetadataAPIRequest) returns (ResourceMetadataAPIResponse) { |
| option (google.api.http) = { |
| delete: "/v1.0/api/metadata/resource" |
| }; |
| } |
| |
| rpc shareResource (ResourceMetadataSharingRequest) returns (ResourceMetadataAPIResponse) { |
| option (google.api.http) = { |
| post: "/v1.0/api/metadata/resource/sharings" |
| }; |
| } |
| |
| rpc deleteSharing (ResourceMetadataSharingRequest) returns (ResourceMetadataAPIResponse) { |
| option (google.api.http) = { |
| delete: "/v1.0/api/metadata/resource/sharings" |
| }; |
| } |
| |
| rpc hasAccess (ResourcePermissionRequest) returns (ResourcePermissionResponse) { |
| option (google.api.http) = { |
| get: "/v1.0/api/metadata/resource/permission" |
| }; |
| } |
| |
| } |