This is an automated email from the ASF dual-hosted git repository. yasith pushed a commit to branch feat/grpc-armeria-migration in repository https://gitbox.apache.org/repos/asf/airavata.git
commit 354411d75ddba8b1efd964fa4b2cca80cf783d2d Author: yasithdev <[email protected]> AuthorDate: Tue Mar 31 02:35:48 2026 -0400 feat: add execution domain gRPC service protos Add 4 service proto files with google.api.http annotations for REST transcoding: experiment (22 RPCs), project (6), gateway (8), notification (5). --- .../main/proto/services/experiment_service.proto | 323 +++++++++++++++++++++ .../src/main/proto/services/gateway_service.proto | 135 +++++++++ .../main/proto/services/notification_service.proto | 97 +++++++ .../src/main/proto/services/project_service.proto | 116 ++++++++ 4 files changed, 671 insertions(+) diff --git a/airavata-api/src/main/proto/services/experiment_service.proto b/airavata-api/src/main/proto/services/experiment_service.proto new file mode 100644 index 0000000000..a7714ffe33 --- /dev/null +++ b/airavata-api/src/main/proto/services/experiment_service.proto @@ -0,0 +1,323 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +syntax = "proto3"; + +package org.apache.airavata.api.experiment; + +option java_package = "org.apache.airavata.api.experiment"; +option java_multiple_files = true; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "org/apache/airavata/model/experiment/experiment.proto"; +import "org/apache/airavata/model/status/status.proto"; +import "org/apache/airavata/model/application/io/application_io.proto"; +import "org/apache/airavata/model/job/job.proto"; +import "org/apache/airavata/model/scheduling/scheduling.proto"; + +// ExperimentService provides RPCs for managing experiments. +service ExperimentService { + + rpc CreateExperiment(CreateExperimentRequest) returns (CreateExperimentResponse) { + option (google.api.http) = { + post: "/api/v1/experiments" + body: "experiment" + }; + } + + rpc GetExperiment(GetExperimentRequest) returns (org.apache.airavata.model.experiment.ExperimentModel) { + option (google.api.http) = { + get: "/api/v1/experiments/{experiment_id}" + }; + } + + rpc GetExperimentByAdmin(GetExperimentByAdminRequest) returns (org.apache.airavata.model.experiment.ExperimentModel) { + option (google.api.http) = { + get: "/api/v1/experiments/{experiment_id}:admin" + }; + } + + rpc UpdateExperiment(UpdateExperimentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/api/v1/experiments/{experiment_id}" + body: "experiment" + }; + } + + rpc DeleteExperiment(DeleteExperimentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/api/v1/experiments/{experiment_id}" + }; + } + + rpc SearchExperiments(SearchExperimentsRequest) returns (SearchExperimentsResponse) { + option (google.api.http) = { + get: "/api/v1/experiments" + }; + } + + rpc GetExperimentStatus(GetExperimentStatusRequest) returns (org.apache.airavata.model.status.ExperimentStatus) { + option (google.api.http) = { + get: "/api/v1/experiments/{experiment_id}/status" + }; + } + + rpc GetExperimentOutputs(GetExperimentOutputsRequest) returns (GetExperimentOutputsResponse) { + option (google.api.http) = { + get: "/api/v1/experiments/{experiment_id}/outputs" + }; + } + + rpc GetExperimentsInProject(GetExperimentsInProjectRequest) returns (GetExperimentsInProjectResponse) { + option (google.api.http) = { + get: "/api/v1/projects/{project_id}/experiments" + }; + } + + rpc GetUserExperiments(GetUserExperimentsRequest) returns (GetUserExperimentsResponse) { + option (google.api.http) = { + get: "/api/v1/gateways/{gateway_id}/users/{user_name}/experiments" + }; + } + + rpc GetDetailedExperimentTree(GetDetailedExperimentTreeRequest) returns (org.apache.airavata.model.experiment.ExperimentModel) { + option (google.api.http) = { + get: "/api/v1/experiments/{experiment_id}:detailed" + }; + } + + rpc UpdateExperimentConfiguration(UpdateExperimentConfigurationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/api/v1/experiments/{experiment_id}/configuration" + body: "configuration" + }; + } + + rpc UpdateResourceScheduling(UpdateResourceSchedulingRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/api/v1/experiments/{experiment_id}/scheduling" + body: "scheduling" + }; + } + + rpc ValidateExperiment(ValidateExperimentRequest) returns (ValidateExperimentResponse) { + option (google.api.http) = { + post: "/api/v1/experiments/{experiment_id}:validate" + }; + } + + rpc LaunchExperiment(LaunchExperimentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/api/v1/experiments/{experiment_id}:launch" + }; + } + + rpc TerminateExperiment(TerminateExperimentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/api/v1/experiments/{experiment_id}:terminate" + }; + } + + rpc CloneExperiment(CloneExperimentRequest) returns (CloneExperimentResponse) { + option (google.api.http) = { + post: "/api/v1/experiments/{experiment_id}:clone" + }; + } + + rpc GetJobStatuses(GetJobStatusesRequest) returns (GetJobStatusesResponse) { + option (google.api.http) = { + get: "/api/v1/experiments/{experiment_id}/job-statuses" + }; + } + + rpc GetJobDetails(GetJobDetailsRequest) returns (GetJobDetailsResponse) { + option (google.api.http) = { + get: "/api/v1/experiments/{experiment_id}/jobs" + }; + } + + rpc FetchIntermediateOutputs(FetchIntermediateOutputsRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/api/v1/experiments/{experiment_id}:fetch-outputs" + }; + } + + rpc GetIntermediateOutputProcessStatus(GetIntermediateOutputProcessStatusRequest) returns (org.apache.airavata.model.status.ProcessStatus) { + option (google.api.http) = { + get: "/api/v1/experiments/{experiment_id}/intermediate-status" + }; + } + + rpc GetExperimentStatistics(GetExperimentStatisticsRequest) returns (org.apache.airavata.model.experiment.ExperimentStatistics) { + option (google.api.http) = { + get: "/api/v1/experiment-statistics" + }; + } +} + +// Request/Response messages + +message CreateExperimentRequest { + string gateway_id = 1; + org.apache.airavata.model.experiment.ExperimentModel experiment = 2; +} + +message CreateExperimentResponse { + string experiment_id = 1; +} + +message GetExperimentRequest { + string experiment_id = 1; +} + +message GetExperimentByAdminRequest { + string experiment_id = 1; +} + +message UpdateExperimentRequest { + string experiment_id = 1; + org.apache.airavata.model.experiment.ExperimentModel experiment = 2; +} + +message DeleteExperimentRequest { + string experiment_id = 1; +} + +message SearchExperimentsRequest { + string gateway_id = 1; + string user_name = 2; + map<string, string> filters = 3; + int32 limit = 4; + int32 offset = 5; +} + +message SearchExperimentsResponse { + repeated org.apache.airavata.model.experiment.ExperimentSummaryModel experiments = 1; +} + +message GetExperimentStatusRequest { + string experiment_id = 1; +} + +message GetExperimentOutputsRequest { + string experiment_id = 1; +} + +message GetExperimentOutputsResponse { + repeated org.apache.airavata.model.application.io.OutputDataObjectType outputs = 1; +} + +message GetExperimentsInProjectRequest { + string project_id = 1; + int32 limit = 2; + int32 offset = 3; +} + +message GetExperimentsInProjectResponse { + repeated org.apache.airavata.model.experiment.ExperimentModel experiments = 1; +} + +message GetUserExperimentsRequest { + string gateway_id = 1; + string user_name = 2; + int32 limit = 3; + int32 offset = 4; +} + +message GetUserExperimentsResponse { + repeated org.apache.airavata.model.experiment.ExperimentModel experiments = 1; +} + +message GetDetailedExperimentTreeRequest { + string experiment_id = 1; +} + +message UpdateExperimentConfigurationRequest { + string experiment_id = 1; + org.apache.airavata.model.experiment.UserConfigurationDataModel configuration = 2; +} + +message UpdateResourceSchedulingRequest { + string experiment_id = 1; + org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel scheduling = 2; +} + +message ValidateExperimentRequest { + string experiment_id = 1; +} + +message ValidateExperimentResponse { + bool is_valid = 1; + repeated string validation_errors = 2; +} + +message LaunchExperimentRequest { + string experiment_id = 1; + string gateway_id = 2; +} + +message TerminateExperimentRequest { + string experiment_id = 1; + string gateway_id = 2; +} + +message CloneExperimentRequest { + string experiment_id = 1; + string new_experiment_name = 2; + string new_experiment_project_id = 3; +} + +message CloneExperimentResponse { + string experiment_id = 1; +} + +message GetJobStatusesRequest { + string experiment_id = 1; +} + +message GetJobStatusesResponse { + map<string, org.apache.airavata.model.status.JobStatus> job_statuses = 1; +} + +message GetJobDetailsRequest { + string experiment_id = 1; +} + +message GetJobDetailsResponse { + repeated org.apache.airavata.model.job.JobModel jobs = 1; +} + +message FetchIntermediateOutputsRequest { + string experiment_id = 1; + repeated string output_names = 2; +} + +message GetIntermediateOutputProcessStatusRequest { + string experiment_id = 1; +} + +message GetExperimentStatisticsRequest { + string gateway_id = 1; + int64 from_time = 2; + int64 to_time = 3; + string user_name = 4; + string application_name = 5; + string resource_host_name = 6; + int32 limit = 7; + int32 offset = 8; +} diff --git a/airavata-api/src/main/proto/services/gateway_service.proto b/airavata-api/src/main/proto/services/gateway_service.proto new file mode 100644 index 0000000000..2ca4a95efa --- /dev/null +++ b/airavata-api/src/main/proto/services/gateway_service.proto @@ -0,0 +1,135 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +syntax = "proto3"; + +package org.apache.airavata.api.gateway; + +option java_package = "org.apache.airavata.api.gateway"; +option java_multiple_files = true; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "org/apache/airavata/model/workspace/workspace.proto"; + +// GatewayService provides RPCs for managing gateways and their users. +service GatewayService { + + rpc AddGateway(AddGatewayRequest) returns (AddGatewayResponse) { + option (google.api.http) = { + post: "/api/v1/gateways" + body: "gateway" + }; + } + + rpc GetGateway(GetGatewayRequest) returns (org.apache.airavata.model.workspace.Gateway) { + option (google.api.http) = { + get: "/api/v1/gateways/{gateway_id}" + }; + } + + rpc UpdateGateway(UpdateGatewayRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/api/v1/gateways/{gateway_id}" + body: "gateway" + }; + } + + rpc DeleteGateway(DeleteGatewayRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/api/v1/gateways/{gateway_id}" + }; + } + + rpc GetAllGateways(GetAllGatewaysRequest) returns (GetAllGatewaysResponse) { + option (google.api.http) = { + get: "/api/v1/gateways" + }; + } + + rpc IsGatewayExist(IsGatewayExistRequest) returns (IsGatewayExistResponse) { + option (google.api.http) = { + get: "/api/v1/gateways/{gateway_id}:exists" + }; + } + + rpc GetAllUsersInGateway(GetAllUsersInGatewayRequest) returns (GetAllUsersInGatewayResponse) { + option (google.api.http) = { + get: "/api/v1/gateways/{gateway_id}/users" + }; + } + + rpc IsUserExists(IsUserExistsRequest) returns (IsUserExistsResponse) { + option (google.api.http) = { + get: "/api/v1/gateways/{gateway_id}/users/{user_name}:exists" + }; + } +} + +// Request/Response messages + +message AddGatewayRequest { + org.apache.airavata.model.workspace.Gateway gateway = 1; +} + +message AddGatewayResponse { + string gateway_id = 1; +} + +message GetGatewayRequest { + string gateway_id = 1; +} + +message UpdateGatewayRequest { + string gateway_id = 1; + org.apache.airavata.model.workspace.Gateway gateway = 2; +} + +message DeleteGatewayRequest { + string gateway_id = 1; +} + +message GetAllGatewaysRequest {} + +message GetAllGatewaysResponse { + repeated org.apache.airavata.model.workspace.Gateway gateways = 1; +} + +message IsGatewayExistRequest { + string gateway_id = 1; +} + +message IsGatewayExistResponse { + bool exists = 1; +} + +message GetAllUsersInGatewayRequest { + string gateway_id = 1; +} + +message GetAllUsersInGatewayResponse { + repeated string user_names = 1; +} + +message IsUserExistsRequest { + string gateway_id = 1; + string user_name = 2; +} + +message IsUserExistsResponse { + bool exists = 1; +} diff --git a/airavata-api/src/main/proto/services/notification_service.proto b/airavata-api/src/main/proto/services/notification_service.proto new file mode 100644 index 0000000000..237f8bb54e --- /dev/null +++ b/airavata-api/src/main/proto/services/notification_service.proto @@ -0,0 +1,97 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +syntax = "proto3"; + +package org.apache.airavata.api.notification; + +option java_package = "org.apache.airavata.api.notification"; +option java_multiple_files = true; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "org/apache/airavata/model/workspace/workspace.proto"; + +// NotificationService provides RPCs for managing notifications. +service NotificationService { + + rpc CreateNotification(CreateNotificationRequest) returns (CreateNotificationResponse) { + option (google.api.http) = { + post: "/api/v1/notifications" + body: "notification" + }; + } + + rpc UpdateNotification(UpdateNotificationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/api/v1/notifications/{notification_id}" + body: "notification" + }; + } + + rpc DeleteNotification(DeleteNotificationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/api/v1/gateways/{gateway_id}/notifications/{notification_id}" + }; + } + + rpc GetNotification(GetNotificationRequest) returns (org.apache.airavata.model.workspace.Notification) { + option (google.api.http) = { + get: "/api/v1/gateways/{gateway_id}/notifications/{notification_id}" + }; + } + + rpc GetAllNotifications(GetAllNotificationsRequest) returns (GetAllNotificationsResponse) { + option (google.api.http) = { + get: "/api/v1/gateways/{gateway_id}/notifications" + }; + } +} + +// Request/Response messages + +message CreateNotificationRequest { + string gateway_id = 1; + org.apache.airavata.model.workspace.Notification notification = 2; +} + +message CreateNotificationResponse { + string notification_id = 1; +} + +message UpdateNotificationRequest { + string notification_id = 1; + org.apache.airavata.model.workspace.Notification notification = 2; +} + +message DeleteNotificationRequest { + string gateway_id = 1; + string notification_id = 2; +} + +message GetNotificationRequest { + string gateway_id = 1; + string notification_id = 2; +} + +message GetAllNotificationsRequest { + string gateway_id = 1; +} + +message GetAllNotificationsResponse { + repeated org.apache.airavata.model.workspace.Notification notifications = 1; +} diff --git a/airavata-api/src/main/proto/services/project_service.proto b/airavata-api/src/main/proto/services/project_service.proto new file mode 100644 index 0000000000..f91363e7a0 --- /dev/null +++ b/airavata-api/src/main/proto/services/project_service.proto @@ -0,0 +1,116 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +syntax = "proto3"; + +package org.apache.airavata.api.project; + +option java_package = "org.apache.airavata.api.project"; +option java_multiple_files = true; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "org/apache/airavata/model/workspace/workspace.proto"; + +// ProjectService provides RPCs for managing projects. +service ProjectService { + + rpc CreateProject(CreateProjectRequest) returns (CreateProjectResponse) { + option (google.api.http) = { + post: "/api/v1/projects" + body: "project" + }; + } + + rpc GetProject(GetProjectRequest) returns (org.apache.airavata.model.workspace.Project) { + option (google.api.http) = { + get: "/api/v1/projects/{project_id}" + }; + } + + rpc UpdateProject(UpdateProjectRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + put: "/api/v1/projects/{project_id}" + body: "project" + }; + } + + rpc DeleteProject(DeleteProjectRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/api/v1/projects/{project_id}" + }; + } + + rpc GetUserProjects(GetUserProjectsRequest) returns (GetUserProjectsResponse) { + option (google.api.http) = { + get: "/api/v1/gateways/{gateway_id}/users/{user_name}/projects" + }; + } + + rpc SearchProjects(SearchProjectsRequest) returns (SearchProjectsResponse) { + option (google.api.http) = { + get: "/api/v1/projects" + }; + } +} + +// Request/Response messages + +message CreateProjectRequest { + string gateway_id = 1; + org.apache.airavata.model.workspace.Project project = 2; +} + +message CreateProjectResponse { + string project_id = 1; +} + +message GetProjectRequest { + string project_id = 1; +} + +message UpdateProjectRequest { + string project_id = 1; + org.apache.airavata.model.workspace.Project project = 2; +} + +message DeleteProjectRequest { + string project_id = 1; +} + +message GetUserProjectsRequest { + string gateway_id = 1; + string user_name = 2; + int32 limit = 3; + int32 offset = 4; +} + +message GetUserProjectsResponse { + repeated org.apache.airavata.model.workspace.Project projects = 1; +} + +message SearchProjectsRequest { + string gateway_id = 1; + string user_name = 2; + map<string, string> filters = 3; + int32 limit = 4; + int32 offset = 5; +} + +message SearchProjectsResponse { + repeated org.apache.airavata.model.workspace.Project projects = 1; +}
