diff --git a/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/grpc/GatewayResourceProfileGrpcService.java b/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/grpc/GatewayResourceProfileGrpcService.java index 86c6c2fef5f..4206b552e6e 100644 --- a/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/grpc/GatewayResourceProfileGrpcService.java +++ b/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/grpc/GatewayResourceProfileGrpcService.java @@ -76,6 +76,20 @@ public void getGatewayResourceProfile( } } + @Override + public void getGatewayResourceProfileWithAccess( + GetGatewayResourceProfileRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + GatewayResourceProfileWithAccess result = + gatewayResourceProfileService.getGatewayResourceProfileWithAccess(ctx, request.getGatewayId()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void updateGatewayResourceProfile( UpdateGatewayResourceProfileRequest request, StreamObserver observer) { diff --git a/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/grpc/GroupResourceProfileGrpcService.java b/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/grpc/GroupResourceProfileGrpcService.java index 955750896bc..9e4ea77d08c 100644 --- a/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/grpc/GroupResourceProfileGrpcService.java +++ b/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/grpc/GroupResourceProfileGrpcService.java @@ -75,6 +75,20 @@ public void getGroupResourceProfile( } } + @Override + public void getGroupResourceProfileWithAccess( + GetGroupResourceProfileRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + GroupResourceProfileWithAccess result = groupResourceProfileService.getGroupResourceProfileWithAccess( + ctx, request.getGroupResourceProfileId()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void updateGroupResourceProfile(UpdateGroupResourceProfileRequest request, StreamObserver observer) { try { @@ -87,6 +101,20 @@ public void updateGroupResourceProfile(UpdateGroupResourceProfileRequest request } } + @Override + public void updateGroupResourceProfileReconciled( + UpdateGroupResourceProfileRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + GroupResourceProfileWithAccess result = groupResourceProfileService.updateGroupResourceProfileReconciled( + ctx, request.getGroupResourceProfile()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void removeGroupResourceProfile(RemoveGroupResourceProfileRequest request, StreamObserver observer) { try { @@ -115,6 +143,22 @@ public void getGroupResourceList( } } + @Override + public void getGroupResourceListWithAccess( + GetGroupResourceListRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + List profiles = + groupResourceProfileService.getGroupResourceListWithAccess(ctx, ctx.getGatewayId()); + observer.onNext(GetGroupResourceListWithAccessResponse.newBuilder() + .addAllProfiles(profiles) + .build()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + // --- Group Compute Preferences --- @Override diff --git a/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/service/GatewayResourceProfileService.java b/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/service/GatewayResourceProfileService.java index cc7da04743f..b033d16de3a 100644 --- a/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/service/GatewayResourceProfileService.java +++ b/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/service/GatewayResourceProfileService.java @@ -21,8 +21,10 @@ import java.util.ArrayList; import java.util.List; +import org.apache.airavata.api.gatewayprofile.GatewayResourceProfileWithAccess; import org.apache.airavata.config.RequestContext; import org.apache.airavata.exception.ServiceException; +import org.apache.airavata.exception.ServiceNotFoundException; import org.apache.airavata.interfaces.ConfigParam; import org.apache.airavata.interfaces.ResourceProfileRegistry; import org.apache.airavata.interfaces.SSHAccountProvisionerFactory; @@ -33,6 +35,7 @@ import org.apache.airavata.model.appcatalog.gatewayprofile.proto.ComputeResourcePreference; import org.apache.airavata.model.appcatalog.gatewayprofile.proto.GatewayResourceProfile; import org.apache.airavata.model.appcatalog.gatewayprofile.proto.StoragePreference; +import org.apache.airavata.model.commons.proto.AccessFlags; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -69,6 +72,32 @@ public GatewayResourceProfile getGatewayResourceProfile(RequestContext ctx, Stri } } + /** + * {@link #getGatewayResourceProfile} plus the caller's server-computed access flags (additive). + * Reuses {@code getGatewayResourceProfile} for READ enforcement so a caller can never + * self-authorize. A gateway resource profile is a gateway-level entity with no owner and no + * sharing entity, so {@code is_owner} is always false and {@code user_has_write_access} reflects + * the gateway-admin (admin-rw) role of the caller. + */ + public GatewayResourceProfileWithAccess getGatewayResourceProfileWithAccess(RequestContext ctx, String gatewayId) + throws ServiceException { + GatewayResourceProfile profile = getGatewayResourceProfile(ctx, gatewayId); + if (profile == null) { + throw new ServiceNotFoundException("Gateway resource profile " + gatewayId + " does not exist"); + } + try { + return GatewayResourceProfileWithAccess.newBuilder() + .setGatewayResourceProfile(profile) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(false) + .setUserHasWriteAccess(ctx.isGatewayAdmin()) + .build()) + .build(); + } catch (Exception e) { + throw new ServiceException("Error while computing gateway resource profile access: " + e.getMessage(), e); + } + } + public boolean updateGatewayResourceProfile( RequestContext ctx, String gatewayId, GatewayResourceProfile gatewayResourceProfile) throws ServiceException { diff --git a/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/service/GroupResourceProfileService.java b/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/service/GroupResourceProfileService.java index d51485c524e..4d53e9fa136 100644 --- a/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/service/GroupResourceProfileService.java +++ b/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/service/GroupResourceProfileService.java @@ -23,6 +23,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import org.apache.airavata.api.groupprofile.GroupResourceProfileWithAccess; import org.apache.airavata.config.RequestContext; import org.apache.airavata.exception.ServiceAuthorizationException; import org.apache.airavata.exception.ServiceException; @@ -35,6 +36,7 @@ import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.ComputeResourcePolicy; import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.GroupComputeResourcePreference; import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.GroupResourceProfile; +import org.apache.airavata.model.commons.proto.AccessFlags; import org.apache.airavata.model.group.proto.ResourcePermissionType; import org.apache.airavata.model.group.proto.ResourceType; import org.apache.airavata.sharing.registry.models.proto.EntitySearchField; @@ -124,6 +126,58 @@ public void updateGroupResourceProfile(RequestContext ctx, GroupResourceProfile } } + /** + * Reconcile-then-update: removes the child compute preferences / resource policies / batch-queue + * policies that are no longer present in the incoming profile, applies the update, and returns the + * refreshed profile with the caller's access flags. Composes the existing single-purpose service + * methods — the reconcile orchestration the SDK helper did client-side now lives server-side. + */ + public GroupResourceProfileWithAccess updateGroupResourceProfileReconciled( + RequestContext ctx, GroupResourceProfile groupResourceProfile) throws ServiceException { + String profileId = groupResourceProfile.getGroupResourceProfileId(); + try { + GroupResourceProfile original = getGroupResourceProfile(ctx, profileId); + + Set newPrefIds = new HashSet<>(); + for (GroupComputeResourcePreference cp : groupResourceProfile.getComputePreferencesList()) { + newPrefIds.add(cp.getComputeResourceId()); + } + for (GroupComputeResourcePreference cp : original.getComputePreferencesList()) { + if (!newPrefIds.contains(cp.getComputeResourceId())) { + removeGroupComputePrefs(ctx, cp.getComputeResourceId(), cp.getGroupResourceProfileId()); + } + } + + Set newPolicyIds = new HashSet<>(); + for (ComputeResourcePolicy p : groupResourceProfile.getComputeResourcePoliciesList()) { + newPolicyIds.add(p.getResourcePolicyId()); + } + for (ComputeResourcePolicy p : original.getComputeResourcePoliciesList()) { + if (!p.getResourcePolicyId().isEmpty() && !newPolicyIds.contains(p.getResourcePolicyId())) { + removeGroupComputeResourcePolicy(ctx, p.getResourcePolicyId()); + } + } + + Set newBqIds = new HashSet<>(); + for (BatchQueueResourcePolicy p : groupResourceProfile.getBatchQueueResourcePoliciesList()) { + newBqIds.add(p.getResourcePolicyId()); + } + for (BatchQueueResourcePolicy p : original.getBatchQueueResourcePoliciesList()) { + if (!p.getResourcePolicyId().isEmpty() && !newBqIds.contains(p.getResourcePolicyId())) { + removeGroupBatchQueueResourcePolicy(ctx, p.getResourcePolicyId()); + } + } + + updateGroupResourceProfile(ctx, groupResourceProfile); + return getGroupResourceProfileWithAccess(ctx, profileId); + } catch (ServiceException e) { + throw e; + } catch (Exception e) { + throw new ServiceException( + "Error reconciling group resource profile " + profileId + ": " + e.getMessage(), e); + } + } + public GroupResourceProfile getGroupResourceProfile(RequestContext ctx, String groupResourceProfileId) throws ServiceException { String userId = ctx.getUserId(); @@ -154,6 +208,90 @@ public GroupResourceProfile getGroupResourceProfile(RequestContext ctx, String g } } + /** + * {@link #getGroupResourceProfile} plus the caller's server-computed access flags (additive). + * Reuses {@code getGroupResourceProfile} for READ enforcement so a caller can never + * self-authorize. {@code GroupResourceProfile} carries no owner field, so ownership is derived + * from the sharing OWNER grant established at creation. + * + *

{@code userHasWriteAccess} is a COMPOSITE that mirrors what + * {@link #updateGroupResourceProfile} actually enforces: the caller must have sharing WRITE + * (or OWNER) on the profile AND READ on every credential token the profile references — the + * {@code default_credential_store_token} and each compute preference's + * {@code resource_specific_credential_store_token}. {@link #updateGroupResourceProfile} + * re-validates those token READs ({@link #validateGroupResourceProfileCredentials}), so a + * profile that looks editable but whose update would be rejected is reported as not writable. + */ + public GroupResourceProfileWithAccess getGroupResourceProfileWithAccess( + RequestContext ctx, String groupResourceProfileId) throws ServiceException { + GroupResourceProfile groupResourceProfile = getGroupResourceProfile(ctx, groupResourceProfileId); + if (groupResourceProfile == null) { + throw new ServiceAuthorizationException("User does not have permission to access this resource"); + } + try { + return computeProfileAccess(ctx, groupResourceProfile); + } catch (Exception e) { + throw new ServiceException("Error while computing group resource profile access: " + e.getMessage(), e); + } + } + + /** + * Computes the caller's access flags for an already-loaded {@link GroupResourceProfile} and unions + * them onto it, without re-fetching the profile or re-enforcing READ (the caller must have already + * passed a READ gate before reaching this point). This is the per-profile core shared by + * {@link #getGroupResourceProfileWithAccess} and {@link #getGroupResourceListWithAccess}, so the list + * variant reuses the exact same token-composite write logic per row without N extra fetches. + * + *

{@code userHasWriteAccess} is a COMPOSITE that mirrors what {@link #updateGroupResourceProfile} + * actually enforces: the caller must have sharing WRITE (or OWNER) on the profile AND READ on every + * credential token the profile references — the {@code default_credential_store_token} and each + * compute preference's {@code resource_specific_credential_store_token}. + */ + private GroupResourceProfileWithAccess computeProfileAccess( + RequestContext ctx, GroupResourceProfile groupResourceProfile) { + String userId = ctx.getUserId(); + String gatewayId = ctx.getGatewayId(); + String groupResourceProfileId = groupResourceProfile.getGroupResourceProfileId(); + boolean isOwner = false; + boolean userHasWriteAccess = false; + if (SharingHelper.isSharingEnabled()) { + isOwner = SharingHelper.userHasAccess( + sharingHandler, gatewayId, userId, groupResourceProfileId, ResourcePermissionType.OWNER); + userHasWriteAccess = isOwner + || SharingHelper.userHasAccess( + sharingHandler, gatewayId, userId, groupResourceProfileId, ResourcePermissionType.WRITE); + if (userHasWriteAccess) { + // Token READ uses the OWNER-inclusive helper, matching the check + // validateGroupResourceProfileCredentials enforces on update, so the write flag + // accurately predicts whether an update would be permitted. + String defaultToken = groupResourceProfile.getDefaultCredentialStoreToken(); + if (!defaultToken.isEmpty() + && !SharingHelper.userHasAccess( + sharingHandler, gatewayId, userId, defaultToken, ResourcePermissionType.READ)) { + userHasWriteAccess = false; + } + if (userHasWriteAccess) { + for (GroupComputeResourcePreference pref : groupResourceProfile.getComputePreferencesList()) { + String token = pref.getResourceSpecificCredentialStoreToken(); + if (!token.isEmpty() + && !SharingHelper.userHasAccess( + sharingHandler, gatewayId, userId, token, ResourcePermissionType.READ)) { + userHasWriteAccess = false; + break; + } + } + } + } + } + return GroupResourceProfileWithAccess.newBuilder() + .setGroupResourceProfile(groupResourceProfile) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(isOwner) + .setUserHasWriteAccess(userHasWriteAccess) + .build()) + .build(); + } + public boolean removeGroupResourceProfile(RequestContext ctx, String groupResourceProfileId) throws ServiceException { String userId = ctx.getUserId(); @@ -213,6 +351,32 @@ public List getGroupResourceList(RequestContext ctx, Strin } } + /** + * {@link #getGroupResourceList} plus the caller's server-computed access flags per profile (additive). + * Reuses {@code getGroupResourceList} for READ enforcement (outside the try, so it can never be + * self-authorized) and maps each already-loaded profile through {@link #computeProfileAccess}, so + * the per-row flags use the exact same token-composite write logic as + * {@link #getGroupResourceProfileWithAccess} without re-fetching any profile. + */ + public List getGroupResourceListWithAccess(RequestContext ctx, String gatewayId) + throws ServiceException { + List profiles = getGroupResourceList(ctx, gatewayId); + try { + List result = new ArrayList<>(profiles.size()); + for (GroupResourceProfile profile : profiles) { + result.add(computeProfileAccess(ctx, profile)); + } + logger.debug( + "Computed access flags for {} group resource profiles in gateway {}", result.size(), gatewayId); + return result; + } catch (Exception e) { + throw new ServiceException( + "Error while computing group resource profile list access for gateway " + gatewayId + ": " + + e.getMessage(), + e); + } + } + public boolean removeGroupComputePrefs(RequestContext ctx, String computeResourceId, String groupResourceProfileId) throws ServiceException { String userId = ctx.getUserId(); diff --git a/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/util/SSHJStorageAdaptor.java b/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/util/SSHJStorageAdaptor.java index 230917885b8..b4b5ce1193f 100644 --- a/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/util/SSHJStorageAdaptor.java +++ b/airavata-api/compute-service/src/main/java/org/apache/airavata/compute/util/SSHJStorageAdaptor.java @@ -227,6 +227,24 @@ public void moveFile(String sourcePath, String destinationPath) throws AgentExce } } + @Override + public void copyFile(String sourcePath, String destinationPath) throws AgentException { + // SFTP has no server-side copy primitive, so stage the source through a local temp + // file and re-upload to the destination (same get/put mechanism used by download/upload). + // Unlike moveFile, the source is left in place. + try (SFTPClient sftp = openSftp()) { + java.io.File tempFile = java.io.File.createTempFile("airavata-copy-", ".tmp"); + try { + sftp.get(sourcePath, tempFile.getAbsolutePath()); + sftp.put(tempFile.getAbsolutePath(), destinationPath); + } finally { + tempFile.delete(); + } + } catch (Exception e) { + throw new AgentException("Failed to copy file: " + sourcePath + " -> " + destinationPath, e); + } + } + @Override public void createSymlink(String targetPath, String linkPath) throws AgentException { try (SFTPClient sftp = openSftp()) { diff --git a/airavata-api/compute-service/src/main/proto/gateway_resource_profile_service.proto b/airavata-api/compute-service/src/main/proto/gateway_resource_profile_service.proto index ad2b3467640..75d439411cd 100644 --- a/airavata-api/compute-service/src/main/proto/gateway_resource_profile_service.proto +++ b/airavata-api/compute-service/src/main/proto/gateway_resource_profile_service.proto @@ -26,6 +26,7 @@ import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile.proto"; import "org/apache/airavata/model/appcatalog/accountprovisioning/account_provisioning.proto"; +import "org/apache/airavata/model/commons/commons.proto"; // GatewayResourceProfileService provides RPCs for managing gateway resource profiles, // compute preferences, storage preferences, and SSH account provisioners. @@ -46,6 +47,14 @@ service GatewayResourceProfileService { }; } + // Additive: GetGatewayResourceProfile plus the caller's server-computed access + // flags, so a client does not recompute access from a separate sharing round-trip. + rpc GetGatewayResourceProfileWithAccess(GetGatewayResourceProfileRequest) returns (GatewayResourceProfileWithAccess) { + option (google.api.http) = { + get: "/api/v1/gateway-profiles/{gateway_id}:withAccess" + }; + } + rpc UpdateGatewayResourceProfile(UpdateGatewayResourceProfileRequest) returns (google.protobuf.Empty) { option (google.api.http) = { put: "/api/v1/gateway-profiles/{gateway_id}" @@ -156,6 +165,14 @@ message GetGatewayResourceProfileRequest { string gateway_id = 1; } +// A GatewayResourceProfile unioned with the caller's access flags (see commons.AccessFlags). +// A gateway resource profile is a gateway-level entity with no owner and no sharing entity, +// so is_owner is always false and user_has_write_access reflects gateway-admin (admin-rw). +message GatewayResourceProfileWithAccess { + org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile gateway_resource_profile = 1; + org.apache.airavata.model.commons.AccessFlags access = 2; +} + message UpdateGatewayResourceProfileRequest { string gateway_id = 1; org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile gateway_resource_profile = 2; diff --git a/airavata-api/compute-service/src/main/proto/group_resource_profile_service.proto b/airavata-api/compute-service/src/main/proto/group_resource_profile_service.proto index fbbbfb2a997..edc259a55a5 100644 --- a/airavata-api/compute-service/src/main/proto/group_resource_profile_service.proto +++ b/airavata-api/compute-service/src/main/proto/group_resource_profile_service.proto @@ -26,6 +26,7 @@ import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile.proto"; import "org/apache/airavata/model/appcatalog/gatewaygroups/gateway_groups.proto"; +import "org/apache/airavata/model/commons/commons.proto"; // GroupResourceProfileService provides RPCs for managing group resource profiles, // compute preferences, compute resource policies, and batch queue policies. @@ -46,6 +47,14 @@ service GroupResourceProfileService { }; } + // Additive: GetGroupResourceProfile plus the caller's server-computed access + // flags, so a client does not recompute access from a separate sharing round-trip. + rpc GetGroupResourceProfileWithAccess(GetGroupResourceProfileRequest) returns (GroupResourceProfileWithAccess) { + option (google.api.http) = { + get: "/api/v1/group-profiles/{group_resource_profile_id}:withAccess" + }; + } + rpc UpdateGroupResourceProfile(UpdateGroupResourceProfileRequest) returns (google.protobuf.Empty) { option (google.api.http) = { put: "/api/v1/group-profiles/{group_resource_profile_id}" @@ -53,6 +62,17 @@ service GroupResourceProfileService { }; } + // Reconcile-then-update for thin clients: removes the child compute preferences / + // resource policies / batch-queue policies absent from the incoming profile, applies + // the update, and returns the refreshed profile with the caller's access flags — + // replacing the SDK helper's client-side reconcile loop. + rpc UpdateGroupResourceProfileReconciled(UpdateGroupResourceProfileRequest) returns (GroupResourceProfileWithAccess) { + option (google.api.http) = { + put: "/api/v1/group-profiles/{group_resource_profile_id}:reconciled" + body: "group_resource_profile" + }; + } + rpc RemoveGroupResourceProfile(RemoveGroupResourceProfileRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/api/v1/group-profiles/{group_resource_profile_id}" @@ -65,6 +85,14 @@ service GroupResourceProfileService { }; } + // Additive: GetGroupResourceList plus each profile's server-computed access flags + // for the caller, so a client does not recompute access from a separate sharing round-trip. + rpc GetGroupResourceListWithAccess(GetGroupResourceListRequest) returns (GetGroupResourceListWithAccessResponse) { + option (google.api.http) = { + get: "/api/v1/group-profiles:withAccess" + }; + } + // --- Group Compute Preferences --- rpc GetGroupComputePreference(GetGroupComputePreferenceRequest) returns (org.apache.airavata.model.appcatalog.groupresourceprofile.GroupComputeResourcePreference) { @@ -144,6 +172,12 @@ message GetGroupResourceProfileRequest { string group_resource_profile_id = 1; } +// A GroupResourceProfile unioned with the caller's access flags (see commons.AccessFlags). +message GroupResourceProfileWithAccess { + org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile group_resource_profile = 1; + org.apache.airavata.model.commons.AccessFlags access = 2; +} + message UpdateGroupResourceProfileRequest { string group_resource_profile_id = 1; org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile group_resource_profile = 2; @@ -159,6 +193,10 @@ message GetGroupResourceListResponse { repeated org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile group_resource_profiles = 1; } +message GetGroupResourceListWithAccessResponse { + repeated GroupResourceProfileWithAccess profiles = 1; +} + // --- Group Compute Preference Request/Response messages --- message GetGroupComputePreferenceRequest { diff --git a/airavata-api/compute-service/src/test/java/org/apache/airavata/compute/service/GatewayResourceProfileServiceTest.java b/airavata-api/compute-service/src/test/java/org/apache/airavata/compute/service/GatewayResourceProfileServiceTest.java index bee38fcb322..5e224a184a9 100644 --- a/airavata-api/compute-service/src/test/java/org/apache/airavata/compute/service/GatewayResourceProfileServiceTest.java +++ b/airavata-api/compute-service/src/test/java/org/apache/airavata/compute/service/GatewayResourceProfileServiceTest.java @@ -24,6 +24,8 @@ import java.util.List; import java.util.Map; +import org.apache.airavata.api.gatewayprofile.GatewayResourceProfileWithAccess; +import org.apache.airavata.config.Constants; import org.apache.airavata.config.RequestContext; import org.apache.airavata.exception.ServiceException; import org.apache.airavata.interfaces.ResourceProfileRegistry; @@ -79,6 +81,41 @@ void getGatewayResourceProfile_delegatesToRegistry() throws Exception { assertEquals("testGateway", result.getGatewayId()); } + @Test + void getGatewayResourceProfileWithAccess_adminCallerHasWriteAccess() throws Exception { + GatewayResourceProfile profile = + GatewayResourceProfile.newBuilder().setGatewayId("testGateway").build(); + when(registryHandler.getGatewayResourceProfile("testGateway")).thenReturn(profile); + // admin-rw role -> ctx.isGatewayAdmin() == true + RequestContext adminCtx = new RequestContext( + "admin", + "testGateway", + "token123", + Map.of("userName", "admin", "gatewayId", "testGateway"), + List.of(Constants.ROLE_GATEWAY_ADMIN)); + + GatewayResourceProfileWithAccess result = service.getGatewayResourceProfileWithAccess(adminCtx, "testGateway"); + + assertEquals("testGateway", result.getGatewayResourceProfile().getGatewayId()); + // gateway resource profile has no owner and no sharing entity + assertFalse(result.getAccess().getIsOwner()); + assertTrue(result.getAccess().getUserHasWriteAccess()); + } + + @Test + void getGatewayResourceProfileWithAccess_nonAdminCallerHasNoWriteAccess() throws Exception { + GatewayResourceProfile profile = + GatewayResourceProfile.newBuilder().setGatewayId("testGateway").build(); + when(registryHandler.getGatewayResourceProfile("testGateway")).thenReturn(profile); + // no roles -> ctx.isGatewayAdmin() == false + + GatewayResourceProfileWithAccess result = service.getGatewayResourceProfileWithAccess(ctx, "testGateway"); + + assertEquals("testGateway", result.getGatewayResourceProfile().getGatewayId()); + assertFalse(result.getAccess().getIsOwner()); + assertFalse(result.getAccess().getUserHasWriteAccess()); + } + @Test void updateGatewayResourceProfile_delegatesToRegistry() throws Exception { GatewayResourceProfile profile = GatewayResourceProfile.getDefaultInstance(); diff --git a/airavata-api/compute-service/src/test/java/org/apache/airavata/compute/service/GroupResourceProfileServiceTest.java b/airavata-api/compute-service/src/test/java/org/apache/airavata/compute/service/GroupResourceProfileServiceTest.java index ef7bfbbc76c..d383733fc9e 100644 --- a/airavata-api/compute-service/src/test/java/org/apache/airavata/compute/service/GroupResourceProfileServiceTest.java +++ b/airavata-api/compute-service/src/test/java/org/apache/airavata/compute/service/GroupResourceProfileServiceTest.java @@ -25,6 +25,7 @@ import java.util.List; import java.util.Map; +import org.apache.airavata.api.groupprofile.GroupResourceProfileWithAccess; import org.apache.airavata.config.RequestContext; import org.apache.airavata.iam.service.GatewayGroupsInitializer; import org.apache.airavata.interfaces.RegistryHandler; @@ -177,6 +178,103 @@ void removeGroupComputePrefs_sharingDisabled_delegatesToRegistry() throws Except assertTrue(result); } + @Test + void getGroupResourceProfileWithAccess_writeAndAllTokenReadsPass_writeTrue() throws Exception { + GroupComputeResourcePreference pref = GroupComputeResourcePreference.newBuilder() + .setResourceSpecificCredentialStoreToken("resource-token") + .build(); + GroupResourceProfile profile = GroupResourceProfile.newBuilder() + .setGroupResourceProfileId("grp-profile-1") + .setGatewayId("testGateway") + .setDefaultCredentialStoreToken("default-token") + .addComputePreferences(pref) + .build(); + when(registryHandler.getGroupResourceProfile("grp-profile-1")).thenReturn(profile); + // Caller is not OWNER of the profile or any token (so each token READ check is actually + // consulted), holds WRITE on the profile, and READ on every token (lenient default). + when(sharingHandler.userHasAccess(anyString(), anyString(), anyString(), endsWith(":OWNER"))) + .thenReturn(false); + when(sharingHandler.userHasAccess( + "testGateway", "testUser@testGateway", "grp-profile-1", "testGateway:WRITE")) + .thenReturn(true); + + GroupResourceProfileWithAccess result = service.getGroupResourceProfileWithAccess(ctx, "grp-profile-1"); + + assertTrue(result.getAccess().getUserHasWriteAccess()); + verify(sharingHandler) + .userHasAccess("testGateway", "testUser@testGateway", "default-token", "testGateway:READ"); + verify(sharingHandler) + .userHasAccess("testGateway", "testUser@testGateway", "resource-token", "testGateway:READ"); + } + + @Test + void getGroupResourceProfileWithAccess_tokenReadDenied_writeFalse() throws Exception { + GroupComputeResourcePreference pref = GroupComputeResourcePreference.newBuilder() + .setResourceSpecificCredentialStoreToken("resource-token") + .build(); + GroupResourceProfile profile = GroupResourceProfile.newBuilder() + .setGroupResourceProfileId("grp-profile-1") + .setGatewayId("testGateway") + .setDefaultCredentialStoreToken("default-token") + .addComputePreferences(pref) + .build(); + when(registryHandler.getGroupResourceProfile("grp-profile-1")).thenReturn(profile); + // Caller has WRITE on the profile but no access (neither OWNER nor READ) to the + // resource-specific token, so the composite write flag must be false. + when(sharingHandler.userHasAccess( + "testGateway", "testUser@testGateway", "grp-profile-1", "testGateway:WRITE")) + .thenReturn(true); + when(sharingHandler.userHasAccess( + eq("testGateway"), eq("testUser@testGateway"), eq("resource-token"), anyString())) + .thenReturn(false); + + GroupResourceProfileWithAccess result = service.getGroupResourceProfileWithAccess(ctx, "grp-profile-1"); + + assertFalse(result.getAccess().getUserHasWriteAccess()); + } + + @Test + void getGroupResourceListWithAccess_perRowFlags_writableAndTokenDenied() throws Exception { + // Profile 1: WRITE on the profile + READ on its single token -> writable. + GroupResourceProfile p1 = GroupResourceProfile.newBuilder() + .setGroupResourceProfileId("grp-profile-1") + .setGatewayId("testGateway") + .setDefaultCredentialStoreToken("token-1") + .build(); + // Profile 2: WRITE on the profile but READ denied on its token -> not writable. + GroupResourceProfile p2 = GroupResourceProfile.newBuilder() + .setGroupResourceProfileId("grp-profile-2") + .setGatewayId("testGateway") + .setDefaultCredentialStoreToken("token-2") + .build(); + when(registryHandler.getGroupResourceList(eq("testGateway"), anyList())).thenReturn(List.of(p1, p2)); + + // Caller is OWNER of nothing (SharingHelper.userHasAccess is OWNER-inclusive, so denying + // OWNER lets the explicit WRITE/READ stubs decide each row). + when(sharingHandler.userHasAccess(anyString(), anyString(), anyString(), endsWith(":OWNER"))) + .thenReturn(false); + // WRITE on both profiles. + when(sharingHandler.userHasAccess( + "testGateway", "testUser@testGateway", "grp-profile-1", "testGateway:WRITE")) + .thenReturn(true); + when(sharingHandler.userHasAccess( + "testGateway", "testUser@testGateway", "grp-profile-2", "testGateway:WRITE")) + .thenReturn(true); + // READ allowed on profile 1's token, denied on profile 2's token. + when(sharingHandler.userHasAccess(eq("testGateway"), eq("testUser@testGateway"), eq("token-1"), anyString())) + .thenReturn(true); + when(sharingHandler.userHasAccess(eq("testGateway"), eq("testUser@testGateway"), eq("token-2"), anyString())) + .thenReturn(false); + + List result = service.getGroupResourceListWithAccess(ctx, "testGateway"); + + assertEquals(2, result.size()); + assertEquals("grp-profile-1", result.get(0).getGroupResourceProfile().getGroupResourceProfileId()); + assertTrue(result.get(0).getAccess().getUserHasWriteAccess()); + assertEquals("grp-profile-2", result.get(1).getGroupResourceProfile().getGroupResourceProfileId()); + assertFalse(result.get(1).getAccess().getUserHasWriteAccess()); + } + @Test void getGroupComputeResourcePolicy_sharingDisabled_returnsPolicy() throws Exception { ComputeResourcePolicy policy = ComputeResourcePolicy.newBuilder() @@ -189,4 +287,45 @@ void getGroupComputeResourcePolicy_sharingDisabled_returnsPolicy() throws Except assertNotNull(result); assertEquals("policy-1", result.getResourcePolicyId()); } + + @Test + void updateGroupResourceProfileReconciled_removesOrphansThenUpdatesAndRefetches() throws Exception { + GroupResourceProfile original = GroupResourceProfile.newBuilder() + .setGroupResourceProfileId("grp-1") + .addComputePreferences(GroupComputeResourcePreference.newBuilder() + .setComputeResourceId("c-keep") + .setGroupResourceProfileId("grp-1")) + .addComputePreferences(GroupComputeResourcePreference.newBuilder() + .setComputeResourceId("c-drop") + .setGroupResourceProfileId("grp-1")) + .addComputeResourcePolicies( + ComputeResourcePolicy.newBuilder().setResourcePolicyId("pol-drop")) + .build(); + GroupResourceProfile incoming = GroupResourceProfile.newBuilder() + .setGroupResourceProfileId("grp-1") + .addComputePreferences( + GroupComputeResourcePreference.newBuilder().setComputeResourceId("c-keep")) + .build(); + GroupResourceProfileWithAccess refreshed = GroupResourceProfileWithAccess.newBuilder() + .setGroupResourceProfile(incoming) + .build(); + + GroupResourceProfileService spy = spy(service); + doReturn(original).when(spy).getGroupResourceProfile(ctx, "grp-1"); + doReturn(true).when(spy).removeGroupComputePrefs(eq(ctx), anyString(), anyString()); + doReturn(true).when(spy).removeGroupComputeResourcePolicy(eq(ctx), anyString()); + doNothing().when(spy).updateGroupResourceProfile(ctx, incoming); + doReturn(refreshed).when(spy).getGroupResourceProfileWithAccess(ctx, "grp-1"); + + GroupResourceProfileWithAccess result = spy.updateGroupResourceProfileReconciled(ctx, incoming); + + // Orphaned child pref removed; retained one untouched. + verify(spy).removeGroupComputePrefs(ctx, "c-drop", "grp-1"); + verify(spy, never()).removeGroupComputePrefs(ctx, "c-keep", "grp-1"); + // Orphaned compute resource policy removed. + verify(spy).removeGroupComputeResourcePolicy(ctx, "pol-drop"); + // Update applied + refreshed profile returned. + verify(spy).updateGroupResourceProfile(ctx, incoming); + assertSame(refreshed, result); + } } diff --git a/airavata-api/credential-service/src/main/java/org/apache/airavata/credential/grpc/CredentialGrpcService.java b/airavata-api/credential-service/src/main/java/org/apache/airavata/credential/grpc/CredentialGrpcService.java index 36d25c86892..7b6d4a9e82f 100644 --- a/airavata-api/credential-service/src/main/java/org/apache/airavata/credential/grpc/CredentialGrpcService.java +++ b/airavata-api/credential-service/src/main/java/org/apache/airavata/credential/grpc/CredentialGrpcService.java @@ -85,6 +85,20 @@ public void getCredentialSummary(GetCredentialSummaryRequest request, StreamObse } } + @Override + public void getCredentialSummaryWithAccess( + GetCredentialSummaryRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + CredentialSummaryWithAccess result = + credentialService.getCredentialSummaryWithAccess(ctx, request.getTokenId()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void getAllCredentialSummaries( GetAllCredentialSummariesRequest request, StreamObserver observer) { diff --git a/airavata-api/credential-service/src/main/java/org/apache/airavata/credential/service/CredentialService.java b/airavata-api/credential-service/src/main/java/org/apache/airavata/credential/service/CredentialService.java index 0624c76edf9..686de644e02 100644 --- a/airavata-api/credential-service/src/main/java/org/apache/airavata/credential/service/CredentialService.java +++ b/airavata-api/credential-service/src/main/java/org/apache/airavata/credential/service/CredentialService.java @@ -21,10 +21,12 @@ import java.util.ArrayList; import java.util.List; +import org.apache.airavata.api.credential.CredentialSummaryWithAccess; import org.apache.airavata.config.RequestContext; import org.apache.airavata.exception.ServiceAuthorizationException; import org.apache.airavata.exception.ServiceException; import org.apache.airavata.interfaces.SharingFacade; +import org.apache.airavata.model.commons.proto.AccessFlags; import org.apache.airavata.model.credential.store.proto.CredentialSummary; import org.apache.airavata.model.credential.store.proto.PasswordCredential; import org.apache.airavata.model.credential.store.proto.SSHCredential; @@ -150,6 +152,38 @@ public CredentialSummary getCredentialSummary(RequestContext ctx, String tokenId } } + /** + * {@link #getCredentialSummary} plus the caller's server-computed access flags (additive). Reuses + * {@code getCredentialSummary} for READ enforcement so a caller can never self-authorize; the flags + * are derived from the credential's owner (token {@code username}) and the same sharing WRITE check + * the delete operations use. + */ + public CredentialSummaryWithAccess getCredentialSummaryWithAccess(RequestContext ctx, String tokenId) + throws ServiceException { + CredentialSummary credentialSummary = getCredentialSummary(ctx, tokenId); + if (credentialSummary == null) { + throw new ServiceAuthorizationException("User does not have permission to access this resource"); + } + try { + boolean isOwner = ctx.getUserId().equals(credentialSummary.getUsername()) + && ctx.getGatewayId().equals(credentialSummary.getGatewayId()); + boolean userHasWriteAccess = isOwner; + if (!isOwner && SharingHelper.isSharingEnabled()) { + userHasWriteAccess = SharingHelper.userHasAccess( + sharingHandler, ctx.getGatewayId(), ctx.getUserId(), tokenId, ResourcePermissionType.WRITE); + } + return CredentialSummaryWithAccess.newBuilder() + .setCredentialSummary(credentialSummary) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(isOwner) + .setUserHasWriteAccess(userHasWriteAccess) + .build()) + .build(); + } catch (Exception e) { + throw new ServiceException("Error while computing credential access: " + e.getMessage(), e); + } + } + public List getAllCredentialSummaries(RequestContext ctx, SummaryType type) throws ServiceException { String gatewayId = ctx.getGatewayId(); diff --git a/airavata-api/credential-service/src/main/proto/credential_service.proto b/airavata-api/credential-service/src/main/proto/credential_service.proto index 385489dab62..75c709c45d4 100644 --- a/airavata-api/credential-service/src/main/proto/credential_service.proto +++ b/airavata-api/credential-service/src/main/proto/credential_service.proto @@ -25,6 +25,7 @@ option java_multiple_files = true; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "org/apache/airavata/model/credential/store/credential_store.proto"; +import "org/apache/airavata/model/commons/commons.proto"; // CredentialService provides RPCs for managing SSH keys, password credentials, // and SSH account setup on compute resources. @@ -50,6 +51,15 @@ service CredentialService { }; } + // Additive: GetCredentialSummary plus the caller's server-computed access + // flags, so a client does not recompute access from a separate sharing + // round-trip. + rpc GetCredentialSummaryWithAccess(GetCredentialSummaryRequest) returns (CredentialSummaryWithAccess) { + option (google.api.http) = { + get: "/api/v1/credentials/{token_id}:withAccess" + }; + } + rpc GetAllCredentialSummaries(GetAllCredentialSummariesRequest) returns (GetAllCredentialSummariesResponse) { option (google.api.http) = { get: "/api/v1/credentials" @@ -114,6 +124,12 @@ message GetCredentialSummaryRequest { string gateway_id = 2; } +// A CredentialSummary unioned with the caller's access flags (see commons.AccessFlags). +message CredentialSummaryWithAccess { + org.apache.airavata.model.credential.store.CredentialSummary credential_summary = 1; + org.apache.airavata.model.commons.AccessFlags access = 2; +} + message GetAllCredentialSummariesRequest { string gateway_id = 1; org.apache.airavata.model.credential.store.SummaryType type = 2; diff --git a/airavata-api/iam-service/pom.xml b/airavata-api/iam-service/pom.xml index 8c80863f61a..bceae99b05c 100644 --- a/airavata-api/iam-service/pom.xml +++ b/airavata-api/iam-service/pom.xml @@ -62,6 +62,10 @@ under the License. org.mapstruct mapstruct + + com.google.protobuf + protobuf-java-util + diff --git a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/grpc/GroupManagerGrpcService.java b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/grpc/GroupManagerGrpcService.java index 71b24531eab..759a07c891a 100644 --- a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/grpc/GroupManagerGrpcService.java +++ b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/grpc/GroupManagerGrpcService.java @@ -22,12 +22,11 @@ import com.google.protobuf.Empty; import io.grpc.stub.StreamObserver; import java.util.List; -import java.util.stream.Collectors; import org.apache.airavata.api.iam.groupmanager.*; import org.apache.airavata.config.RequestContext; +import org.apache.airavata.exception.ServiceNotFoundException; import org.apache.airavata.grpc.GrpcRequestContext; import org.apache.airavata.grpc.GrpcStatusMapper; -import org.apache.airavata.iam.model.GroupAdminEntity; import org.apache.airavata.iam.model.UserGroupEntity; import org.apache.airavata.iam.service.SharingService; import org.apache.airavata.model.group.proto.GroupModel; @@ -37,9 +36,11 @@ public class GroupManagerGrpcService extends GroupManagerServiceGrpc.GroupManagerServiceImplBase { private final SharingService sharingHandler; + private final GroupWithAccessAssembler groupAssembler; - public GroupManagerGrpcService(SharingService sharingHandler) { + public GroupManagerGrpcService(SharingService sharingHandler, GroupWithAccessAssembler groupAssembler) { this.sharingHandler = sharingHandler; + this.groupAssembler = groupAssembler; } @Override @@ -70,6 +71,52 @@ public void updateGroup(UpdateGroupRequest request, StreamObserver observ } } + @Override + public void createGroupReconciled(CreateGroupRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + GroupModel group = request.getGroup(); + UserGroupEntity entity = toEntity(group, ctx.getGatewayId()); + String groupId = sharingHandler.createGroup(entity); + // New group: no current roster, so every desired non-owner member/admin is added. + sharingHandler.reconcileGroupMembership( + ctx.getGatewayId(), groupId, group.getMembersList(), group.getAdminsList(), group.getOwnerId(), true); + UserGroupEntity reloaded = sharingHandler.getGroup(ctx.getGatewayId(), groupId); + if (reloaded == null) { + throw new ServiceNotFoundException("Group " + groupId + " does not exist"); + } + observer.onNext(groupAssembler.buildGroupWithAccess(ctx, reloaded)); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void updateGroupReconciled(UpdateGroupRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + GroupModel group = request.getGroup(); + sharingHandler.reconcileGroupMembership( + ctx.getGatewayId(), + group.getId(), + group.getMembersList(), + group.getAdminsList(), + group.getOwnerId(), + false); + UserGroupEntity entity = toEntity(group, ctx.getGatewayId()); + sharingHandler.updateGroup(entity); + UserGroupEntity reloaded = sharingHandler.getGroup(ctx.getGatewayId(), group.getId()); + if (reloaded == null) { + throw new ServiceNotFoundException("Group " + group.getId() + " does not exist"); + } + observer.onNext(groupAssembler.buildGroupWithAccess(ctx, reloaded)); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void deleteGroup(DeleteGroupRequest request, StreamObserver observer) { try { @@ -87,7 +134,25 @@ public void getGroup(GetGroupRequest request, StreamObserver observe try { RequestContext ctx = GrpcRequestContext.current(); UserGroupEntity entity = sharingHandler.getGroup(ctx.getGatewayId(), request.getGroupId()); - observer.onNext(toGroupModel(entity)); + if (entity == null) { + throw new ServiceNotFoundException("Group " + request.getGroupId() + " does not exist"); + } + observer.onNext(GroupWithAccessAssembler.toGroupModel(entity)); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void getGroupWithAccess(GetGroupRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + UserGroupEntity entity = sharingHandler.getGroup(ctx.getGatewayId(), request.getGroupId()); + if (entity == null) { + throw new ServiceNotFoundException("Group " + request.getGroupId() + " does not exist"); + } + observer.onNext(groupAssembler.buildGroupWithAccess(ctx, entity)); observer.onCompleted(); } catch (Exception e) { observer.onError(GrpcStatusMapper.toStatusException(e)); @@ -100,7 +165,24 @@ public void getGroups(GetGroupsRequest request, StreamObserver groups = sharingHandler.getGroups(ctx.getGatewayId(), 0, -1); GetGroupsResponse.Builder builder = GetGroupsResponse.newBuilder(); - groups.forEach(g -> builder.addGroups(toGroupModel(g))); + groups.forEach(g -> builder.addGroups(GroupWithAccessAssembler.toGroupModel(g))); + observer.onNext(builder.build()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void getGroupsWithAccess( + GetGroupsRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + List groups = sharingHandler.getGroups(ctx.getGatewayId(), 0, -1); + GetGroupsWithAccessResponse.Builder builder = GetGroupsWithAccessResponse.newBuilder(); + for (UserGroupEntity entity : groups) { + builder.addGroups(groupAssembler.buildGroupWithAccess(ctx, entity)); + } observer.onNext(builder.build()); observer.onCompleted(); } catch (Exception e) { @@ -116,7 +198,25 @@ public void getAllGroupsUserBelongs( List groups = sharingHandler.getAllMemberGroupEntitiesForUser(ctx.getGatewayId(), request.getUserName()); GetAllGroupsUserBelongsResponse.Builder builder = GetAllGroupsUserBelongsResponse.newBuilder(); - groups.forEach(g -> builder.addGroups(toGroupModel(g))); + groups.forEach(g -> builder.addGroups(GroupWithAccessAssembler.toGroupModel(g))); + observer.onNext(builder.build()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void getAllGroupsUserBelongsWithAccess( + GetAllGroupsUserBelongsRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + List groups = + sharingHandler.getAllMemberGroupEntitiesForUser(ctx.getGatewayId(), request.getUserName()); + GetGroupsWithAccessResponse.Builder builder = GetGroupsWithAccessResponse.newBuilder(); + for (UserGroupEntity entity : groups) { + builder.addGroups(groupAssembler.buildGroupWithAccess(ctx, entity)); + } observer.onNext(builder.build()); observer.onCompleted(); } catch (Exception e) { @@ -223,18 +323,4 @@ private static UserGroupEntity toEntity(GroupModel model, String domainId) { if (!model.getOwnerId().isEmpty()) entity.setOwnerId(model.getOwnerId()); return entity; } - - private static GroupModel toGroupModel(UserGroupEntity entity) { - GroupModel.Builder b = GroupModel.newBuilder(); - if (entity.getGroupId() != null) b.setId(entity.getGroupId()); - if (entity.getName() != null) b.setName(entity.getName()); - if (entity.getOwnerId() != null) b.setOwnerId(entity.getOwnerId()); - if (entity.getDescription() != null) b.setDescription(entity.getDescription()); - if (entity.getGroupAdmins() != null) { - b.addAllAdmins(entity.getGroupAdmins().stream() - .map(GroupAdminEntity::getAdminId) - .collect(Collectors.toList())); - } - return b.build(); - } } diff --git a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/grpc/GroupWithAccessAssembler.java b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/grpc/GroupWithAccessAssembler.java new file mode 100644 index 00000000000..3302f304d42 --- /dev/null +++ b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/grpc/GroupWithAccessAssembler.java @@ -0,0 +1,91 @@ +/** +* +* 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. +*/ +package org.apache.airavata.iam.grpc; + +import java.util.stream.Collectors; +import org.apache.airavata.api.iam.groupmanager.GroupAccessFlags; +import org.apache.airavata.api.iam.groupmanager.GroupWithAccess; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.iam.model.GroupAdminEntity; +import org.apache.airavata.iam.model.UserGroupEntity; +import org.apache.airavata.iam.service.SharingService; +import org.apache.airavata.model.group.proto.GroupModel; +import org.springframework.stereotype.Component; + +/** + * Builds the GroupModel-plus-access envelope shared by GroupManager (single + list) and the + * SharedEntity composite. The flags are always returned, but the member and admin rosters are + * populated only when the caller is an insider (member, admin, owner, or a gateway admin) so an + * outsider never sees a group's roster. + */ +@Component +public class GroupWithAccessAssembler { + + private final SharingService sharingHandler; + + public GroupWithAccessAssembler(SharingService sharingHandler) { + this.sharingHandler = sharingHandler; + } + + public GroupWithAccess buildGroupWithAccess(RequestContext ctx, UserGroupEntity entity) throws Exception { + String callerId = ctx.getUserId() + "@" + ctx.getGatewayId(); + SharingService.GroupAccess access = + sharingHandler.getGroupAccessFlags(ctx.getGatewayId(), entity.getGroupId(), callerId, entity); + boolean insider = access.isMember() + || access.isAdmin() + || access.isOwner() + || ctx.isGatewayAdmin() + || ctx.isReadOnlyGatewayAdmin(); + // toGroupModel populates id/name/owner/description (+admins); members and admins are the + // roster fields gated to insiders, so strip them when the caller is an outsider. + GroupModel.Builder group = toGroupModel(entity).toBuilder(); + if (insider) { + group.addAllMembers(access.memberIds()); + } else { + group.clearMembers(); + group.clearAdmins(); + } + return GroupWithAccess.newBuilder() + .setGroup(group.build()) + .setAccess(GroupAccessFlags.newBuilder() + .setIsAdmin(access.isAdmin()) + .setIsOwner(access.isOwner()) + .setIsMember(access.isMember()) + .setIsGatewayAdminsGroup(access.isGatewayAdminsGroup()) + .setIsReadOnlyGatewayAdminsGroup(access.isReadOnlyGatewayAdminsGroup()) + .setIsDefaultGatewayUsersGroup(access.isDefaultGatewayUsersGroup()) + .build()) + .build(); + } + + static GroupModel toGroupModel(UserGroupEntity entity) { + GroupModel.Builder b = GroupModel.newBuilder(); + if (entity.getGroupId() != null) b.setId(entity.getGroupId()); + if (entity.getName() != null) b.setName(entity.getName()); + if (entity.getOwnerId() != null) b.setOwnerId(entity.getOwnerId()); + if (entity.getDescription() != null) b.setDescription(entity.getDescription()); + if (entity.getGroupAdmins() != null) { + b.addAllAdmins(entity.getGroupAdmins().stream() + .map(GroupAdminEntity::getAdminId) + .collect(Collectors.toList())); + } + return b.build(); + } +} diff --git a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/grpc/SharingGrpcService.java b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/grpc/SharingGrpcService.java index 5d640e6b9cf..2766dbc7478 100644 --- a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/grpc/SharingGrpcService.java +++ b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/grpc/SharingGrpcService.java @@ -30,6 +30,7 @@ import org.apache.airavata.grpc.GrpcRequestContext; import org.apache.airavata.grpc.GrpcStatusMapper; import org.apache.airavata.iam.service.ResourceSharingService; +import org.apache.airavata.iam.service.SharedEntityService; import org.apache.airavata.iam.service.SharingService; import org.apache.airavata.model.group.proto.ResourcePermissionType; import org.springframework.stereotype.Component; @@ -39,10 +40,15 @@ public class SharingGrpcService extends SharingServiceGrpc.SharingServiceImplBas private final ResourceSharingService resourceSharingService; private final SharingService sharingHandler; + private final SharedEntityService sharedEntityService; - public SharingGrpcService(ResourceSharingService resourceSharingService, SharingService sharingHandler) { + public SharingGrpcService( + ResourceSharingService resourceSharingService, + SharingService sharingHandler, + SharedEntityService sharedEntityService) { this.resourceSharingService = resourceSharingService; this.sharingHandler = sharingHandler; + this.sharedEntityService = sharedEntityService; } // ======================================================================== @@ -183,6 +189,45 @@ public void userHasAccess(UserHasAccessRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + observer.onNext(sharedEntityService.loadSharedEntity(ctx, request.getEntityId(), true)); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void getAllSharedEntity(GetSharedEntityRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + observer.onNext(sharedEntityService.loadSharedEntity(ctx, request.getEntityId(), false)); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void setEntitySharing(SetEntitySharingRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + Map userPermissions = + toResourcePermissionMap(request.getUserPermissionsMap()); + Map groupPermissions = + toResourcePermissionMap(request.getGroupPermissionsMap()); + resourceSharingService.setEntitySharing( + ctx, request.getResourceId(), userPermissions, groupPermissions); + observer.onNext(Empty.getDefaultInstance()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + // ======================================================================== // Domain CRUD // ======================================================================== diff --git a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/model/UserPreferencesEntity.java b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/model/UserPreferencesEntity.java new file mode 100644 index 00000000000..b6ff901bf03 --- /dev/null +++ b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/model/UserPreferencesEntity.java @@ -0,0 +1,85 @@ +/** +* +* 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. +*/ +package org.apache.airavata.iam.model; + +import jakarta.persistence.*; +import java.util.Date; + +@Entity +@Table(name = "USER_PREFERENCES") +@IdClass(UserPreferencesPK.class) +public class UserPreferencesEntity { + + @Id + private String gatewayId; + + @Id + private String userId; + + @Column(columnDefinition = "TEXT") + private String preferencesJson; + + private Date createdAt; + private Date updatedAt; + + public String getGatewayId() { + return gatewayId; + } + + public void setGatewayId(String gatewayId) { + this.gatewayId = gatewayId; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getPreferencesJson() { + return preferencesJson; + } + + public void setPreferencesJson(String preferencesJson) { + this.preferencesJson = preferencesJson; + } + + public Date getCreatedAt() { + return createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + @PrePersist + void onCreate() { + Date now = new Date(); + this.createdAt = now; + this.updatedAt = now; + } + + @PreUpdate + void onUpdate() { + this.updatedAt = new Date(); + } +} diff --git a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/model/UserPreferencesPK.java b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/model/UserPreferencesPK.java new file mode 100644 index 00000000000..c7da9c56c60 --- /dev/null +++ b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/model/UserPreferencesPK.java @@ -0,0 +1,64 @@ +/** +* +* 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. +*/ +package org.apache.airavata.iam.model; + +import java.io.Serializable; +import java.util.Objects; + +public class UserPreferencesPK implements Serializable { + private String gatewayId; + private String userId; + + public UserPreferencesPK() {} + + public UserPreferencesPK(String gatewayId, String userId) { + this.gatewayId = gatewayId; + this.userId = userId; + } + + public String getGatewayId() { + return gatewayId; + } + + public void setGatewayId(String gatewayId) { + this.gatewayId = gatewayId; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UserPreferencesPK that = (UserPreferencesPK) o; + return Objects.equals(gatewayId, that.gatewayId) && Objects.equals(userId, that.userId); + } + + @Override + public int hashCode() { + return Objects.hash(gatewayId, userId); + } +} diff --git a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/repository/UserPreferencesRepository.java b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/repository/UserPreferencesRepository.java new file mode 100644 index 00000000000..117e97bb2e7 --- /dev/null +++ b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/repository/UserPreferencesRepository.java @@ -0,0 +1,29 @@ +/** +* +* 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. +*/ +package org.apache.airavata.iam.repository; + +import java.util.Optional; +import org.apache.airavata.iam.model.UserPreferencesEntity; +import org.apache.airavata.iam.model.UserPreferencesPK; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface UserPreferencesRepository extends JpaRepository { + Optional findByGatewayIdAndUserId(String gatewayId, String userId); +} diff --git a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/ResourceSharingService.java b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/ResourceSharingService.java index c074e8ba6c8..258c5bbdcd2 100644 --- a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/ResourceSharingService.java +++ b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/ResourceSharingService.java @@ -23,8 +23,10 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.function.BiFunction; import org.apache.airavata.config.RequestContext; import org.apache.airavata.exception.ServiceAuthorizationException; @@ -327,6 +329,150 @@ public boolean userHasAccess(RequestContext ctx, String resourceId, ResourcePerm } } + // Precedence used to fold the per-permission direct-grant lists into a single highest-permission + // map: a later (more privileged) name overwrites an earlier one. OWNER is excluded — owners are + // not modifiable through declarative set-sharing. + private static final ResourcePermissionType[] SETTABLE_PRECEDENCE = { + ResourcePermissionType.READ, ResourcePermissionType.WRITE, ResourcePermissionType.MANAGE_SHARING + }; + + // Implied-permission sets for grant/revoke deltas: WRITE implies READ; MANAGE_SHARING implies + // READ + WRITE. Mirrors the Python _IMPLIED_PERMISSIONS. + private static final Map> IMPLIED_PERMISSIONS = Map.of( + ResourcePermissionType.READ, + Set.of(ResourcePermissionType.READ), + ResourcePermissionType.WRITE, + Set.of(ResourcePermissionType.READ, ResourcePermissionType.WRITE), + ResourcePermissionType.MANAGE_SHARING, + Set.of( + ResourcePermissionType.READ, + ResourcePermissionType.WRITE, + ResourcePermissionType.MANAGE_SHARING)); + + /** + * Declaratively set an entity's DIRECT sharing. {@code desiredUsers} / {@code desiredGroups} are + * {@code id -> permission NAME} maps describing the desired end-state; ids absent from a map have + * their direct grants revoked. The server reads the current direct grants, computes the + * grant/revoke diff (per {@link #IMPLIED_PERMISSIONS}), and applies it — replacing the Python + * SDK's client-side diff (sharing_resources.apply_sharing_update). OWNER is not settable. + */ + public void setEntitySharing( + RequestContext ctx, + String resourceId, + Map desiredUsers, + Map desiredGroups) + throws ServiceException { + // Authorization gate: only the owner or a MANAGE_SHARING holder may change sharing. The + // share/revoke methods below enforce the same gate per call, but checking up-front gives a + // single clean PERMISSION_DENIED before any partial mutation, and matches the read-then-write + // contract of a declarative endpoint. userHasAccess(MANAGE_SHARING) is true for owners too. + if (!userHasAccess(ctx, resourceId, ResourcePermissionType.MANAGE_SHARING)) { + throw new ServiceAuthorizationException( + "User is not allowed to change sharing because the user is either not the resource owner or does not have access to share the resource"); + } + try { + Map currentUsers = + currentDirectGrants((t) -> getAllDirectlyAccessibleUsers(ctx, resourceId, t)); + // The OWNER is unioned into the READ/WRITE/MANAGE_SHARING accessor results but ownership is + // not a settable grant; drop it (mirroring the read side) so a desired map that omits the + // owner does not compute a revoke against the owner's grants. + for (String ownerId : getAllDirectlyAccessibleUsers(ctx, resourceId, ResourcePermissionType.OWNER)) { + currentUsers.remove(ownerId); + } + Map currentGroups = + currentDirectGrants((t) -> getAllDirectlyAccessibleGroups(ctx, resourceId, t)); + + applyDeltas( + currentUsers, + desiredUsers, + (permissions) -> shareResourceWithUsers(ctx, resourceId, permissions), + (permissions) -> revokeSharingOfResourceFromUsers(ctx, resourceId, permissions)); + applyDeltas( + currentGroups, + desiredGroups, + (permissions) -> shareResourceWithGroups(ctx, resourceId, permissions), + (permissions) -> revokeSharingOfResourceFromGroups(ctx, resourceId, permissions)); + } catch (ServiceException e) { + throw e; + } catch (Exception e) { + throw new ServiceException( + "Error setting sharing for resource " + resourceId + ": " + e.getMessage(), e); + } + } + + /** A direct-grant accessor for a single permission name; throws checked exceptions. */ + @FunctionalInterface + private interface DirectGrantAccessor { + List apply(ResourcePermissionType permissionType) throws ServiceException; + } + + /** Applies a per-permission share / revoke bucket (the non-empty buckets only). */ + @FunctionalInterface + private interface ShareRevokeApplier { + void apply(Map idToPermission) throws ServiceException; + } + + // {id -> highest direct permission name} over [READ, WRITE, MANAGE_SHARING] in precedence order + // (more privileged overwrites). OWNER is excluded — owners are not modifiable here. Mirrors the + // Python current-map construction. + private Map currentDirectGrants(DirectGrantAccessor accessor) + throws ServiceException { + Map current = new LinkedHashMap<>(); + for (ResourcePermissionType name : SETTABLE_PRECEDENCE) { + for (String id : accessor.apply(name)) { + current.put(id, name); + } + } + return current; + } + + // Compute the grant/revoke deltas (over current ∪ desired) and fire the share / revoke appliers + // for each non-empty bucket, grant-then-revoke. Mirrors the Python compute_sharing_deltas + + // apply_sharing_update. + private void applyDeltas( + Map current, + Map desired, + ShareRevokeApplier shareApplier, + ShareRevokeApplier revokeApplier) + throws ServiceException { + Map> grant = new LinkedHashMap<>(); + Map> revoke = new LinkedHashMap<>(); + + Set allIds = new HashSet<>(); + allIds.addAll(current.keySet()); + allIds.addAll(desired.keySet()); + + for (String id : allIds) { + Set currentSet = implied(current.get(id)); + Set newSet = implied(desired.get(id)); + for (ResourcePermissionType name : currentSet) { + if (!newSet.contains(name)) { + revoke.computeIfAbsent(name, k -> new LinkedHashMap<>()).put(id, name); + } + } + for (ResourcePermissionType name : newSet) { + if (!currentSet.contains(name)) { + grant.computeIfAbsent(name, k -> new LinkedHashMap<>()).put(id, name); + } + } + } + + for (Map bucket : grant.values()) { + shareApplier.apply(bucket); + } + for (Map bucket : revoke.values()) { + revokeApplier.apply(bucket); + } + } + + // The implied-permission set of a name; null (no grant) -> empty set. Mirrors the Python None->set(). + private static Set implied(ResourcePermissionType name) { + if (name == null) { + return Set.of(); + } + return IMPLIED_PERMISSIONS.getOrDefault(name, Set.of()); + } + // Internal helpers boolean userHasAccess(String gatewayId, String userId, String entityId, ResourcePermissionType permissionType) { diff --git a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/SharedEntityService.java b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/SharedEntityService.java new file mode 100644 index 00000000000..972306ed87d --- /dev/null +++ b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/SharedEntityService.java @@ -0,0 +1,163 @@ +/** +* +* 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. +*/ +package org.apache.airavata.iam.service; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.apache.airavata.api.iam.sharing.GroupPermission; +import org.apache.airavata.api.iam.sharing.SharedEntity; +import org.apache.airavata.api.iam.sharing.UserPermission; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.exception.ServiceException; +import org.apache.airavata.exception.ServiceNotFoundException; +import org.apache.airavata.iam.grpc.GroupWithAccessAssembler; +import org.apache.airavata.iam.model.UserGroupEntity; +import org.apache.airavata.iam.repository.UserProfileRepository; +import org.apache.airavata.model.group.proto.ResourcePermissionType; +import org.apache.airavata.model.user.proto.UserProfile; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * Assembles the composed SharedEntity view (owner + per-user / per-group permissions) server-side, + * replacing the Python SDK's sharing_resources.get_shared_entity / get_all_shared_entity. The + * accessor lists are already authorization-scoped by {@link ResourceSharingService}, so there is no + * extra READ gate here (mirroring the Python which has none). + */ +@Service +public class SharedEntityService { + + // A later (more privileged) grant overwrites an earlier one, so WRITE (which implies READ) wins + // over a bare READ. Mirrors the Python _PERMISSION_PRECEDENCE. + private static final ResourcePermissionType[] PERMISSION_PRECEDENCE = { + ResourcePermissionType.READ, ResourcePermissionType.WRITE, ResourcePermissionType.MANAGE_SHARING + }; + + private final ResourceSharingService resourceSharingService; + private final UserProfileRepository userProfileRepository; + private final SharingService sharingHandler; + private final GroupWithAccessAssembler groupAssembler; + + @Autowired + public SharedEntityService( + ResourceSharingService resourceSharingService, + UserProfileRepository userProfileRepository, + SharingService sharingHandler, + GroupWithAccessAssembler groupAssembler) { + this.resourceSharingService = resourceSharingService; + this.userProfileRepository = userProfileRepository; + this.sharingHandler = sharingHandler; + this.groupAssembler = groupAssembler; + } + + /** {@code (entityId, permissionType) -> qualified ids} accessor, one of the four sharing lists. */ + @FunctionalInterface + private interface Accessor { + List apply(String entityId, ResourcePermissionType permissionType) throws Exception; + } + + /** + * {@code directly} selects the direct-only (true) vs. accessible-including-inherited (false) + * accessor pair, then loads the user/group permission maps, drops the owner from the users list, + * fetches every profile/group, and composes a {@link SharedEntity}. + */ + public SharedEntity loadSharedEntity(RequestContext ctx, String entityId, boolean directly) + throws ServiceException { + try { + Accessor usersAccessor; + Accessor groupsAccessor; + if (directly) { + usersAccessor = (id, t) -> resourceSharingService.getAllDirectlyAccessibleUsers(ctx, id, t); + groupsAccessor = (id, t) -> resourceSharingService.getAllDirectlyAccessibleGroups(ctx, id, t); + } else { + usersAccessor = (id, t) -> resourceSharingService.getAllAccessibleUsers(ctx, id, t); + groupsAccessor = (id, t) -> resourceSharingService.getAllAccessibleGroups(ctx, id, t); + } + + Map users = collectPermissions(usersAccessor, entityId); + // The owner is the single DIRECT owner (the OWNER grant); there is exactly one (indirect + // cascading owners are not returned by these RPCs). + List ownerIds = usersAccessor.apply(entityId, ResourcePermissionType.OWNER); + if (ownerIds.isEmpty()) { + throw new ServiceNotFoundException("Shared entity " + entityId + " has no owner grant"); + } + String ownerId = ownerIds.get(0); + users.remove(ownerId); + + Map groups = collectPermissions(groupsAccessor, entityId); + + SharedEntity.Builder builder = SharedEntity.newBuilder().setEntityId(entityId); + + for (Map.Entry entry : users.entrySet()) { + UserProfile profile = loadProfile(ctx, entry.getKey()); + builder.addUserPermissions(UserPermission.newBuilder() + .setUser(profile) + .setPermissionType(entry.getValue().name()) + .build()); + } + + for (Map.Entry entry : groups.entrySet()) { + UserGroupEntity group = sharingHandler.getGroup(ctx.getGatewayId(), entry.getKey()); + if (group == null) { + // A grant can outlive its group; skip a dangling group grant rather than failing. + continue; + } + builder.addGroupPermissions(GroupPermission.newBuilder() + .setGroup(groupAssembler.buildGroupWithAccess(ctx, group)) + .setPermissionType(entry.getValue().name()) + .build()); + } + + UserProfile owner = loadProfile(ctx, ownerId); + builder.setOwner(owner); + builder.setIsOwner(owner.getUserId().equals(ctx.getUserId())); + builder.setHasSharingPermission( + resourceSharingService.userHasAccess(ctx, entityId, ResourcePermissionType.MANAGE_SHARING)); + + return builder.build(); + } catch (ServiceException e) { + throw e; + } catch (Exception e) { + throw new ServiceException( + "Error loading shared entity " + entityId + ": " + e.getMessage(), e); + } + } + + // {id -> permission_name} across the precedence order (most privileged grant wins). Mirrors the + // Python _collect_permissions. + private Map collectPermissions(Accessor accessor, String entityId) + throws Exception { + Map result = new LinkedHashMap<>(); + for (ResourcePermissionType name : PERMISSION_PRECEDENCE) { + for (String id : accessor.apply(entityId, name)) { + result.put(id, name); + } + } + return result; + } + + // The accessible-* lists key on qualified user@gateway ids, but getUserProfileByIdAndGateWay + // keys on the bare username (mirrors the Python _username_from_internal_id). + private UserProfile loadProfile(RequestContext ctx, String qualifiedUserId) { + String bare = qualifiedUserId.substring(0, qualifiedUserId.lastIndexOf('@')); + return userProfileRepository.getUserProfileByIdAndGateWay(bare, ctx.getGatewayId()); + } +} diff --git a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/SharingService.java b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/SharingService.java index b36e32a637a..ed246e19cd5 100644 --- a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/SharingService.java +++ b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/SharingService.java @@ -28,6 +28,7 @@ import org.apache.airavata.iam.util.DBConstants; import org.apache.airavata.interfaces.SharingFacade; import org.apache.airavata.interfaces.SharingProvider; +import org.apache.airavata.model.appcatalog.gatewaygroups.proto.GatewayGroups; import org.apache.airavata.sharing.registry.models.proto.GroupCardinality; import org.apache.airavata.sharing.registry.models.proto.GroupChildType; import org.apache.airavata.sharing.registry.models.proto.GroupType; @@ -312,6 +313,90 @@ public boolean updateGroup(UserGroupEntity group) throws SharingRegistryExceptio } } + /** + * Declaratively reconcile a group's roster to the desired members + admins lists, computing and + * applying add/remove deltas server-side. This is the server-side counterpart of the thin client's + * former member/admin diffing: {@code added = desired − current}, {@code removed = current − desired} + * for both members and admins, and any desired admin that is not also a desired member is promoted to + * a member (admins must belong to the group). Each non-empty delta is applied via the existing + * add/remove member + admin operations; metadata is not touched here (the caller updates it + * separately via updateGroup). + * + * @param newGroup {@code true} when the group was just created (no current roster, so all desired + * members/admins are added); {@code false} for an update against the existing roster. + */ + public void reconcileGroupMembership( + String domainId, + String groupId, + List desiredMembers, + List desiredAdmins, + String ownerId, + boolean newGroup) + throws SharingRegistryException { + try { + Set desiredMemberSet = new LinkedHashSet<>(desiredMembers); + Set desiredAdminSet = new LinkedHashSet<>(desiredAdmins); + + // The owner is managed by createGroup and holds implicit membership/ownership; it is never + // a settable member/admin here and must never be added (duplicate) or removed. Exclude it + // from both the desired and current sets so the diff never targets the owner. + if (ownerId != null && !ownerId.isEmpty()) { + desiredMemberSet.remove(ownerId); + desiredAdminSet.remove(ownerId); + } + + // Admins must belong to the group: any desired admin not already a desired member is + // promoted to a member too (mirrors the former client-side _member_admin_diff). + Set promotedMembers = new LinkedHashSet<>(desiredAdminSet); + promotedMembers.removeAll(desiredMemberSet); + Set finalMemberSet = new LinkedHashSet<>(desiredMemberSet); + finalMemberSet.addAll(promotedMembers); + + Set currentMembers = new LinkedHashSet<>(); + Set currentAdmins = new LinkedHashSet<>(); + if (!newGroup) { + getGroupMembersOfTypeUser(domainId, groupId, 0, -1) + .forEach(u -> currentMembers.add(u.getUserId())); + UserGroupEntity entity = getGroup(domainId, groupId); + if (entity != null && entity.getGroupAdmins() != null) { + entity.getGroupAdmins().forEach(a -> currentAdmins.add(a.getAdminId())); + } + if (ownerId != null && !ownerId.isEmpty()) { + currentMembers.remove(ownerId); + currentAdmins.remove(ownerId); + } + } + + List addedMembers = new ArrayList<>(finalMemberSet); + addedMembers.removeAll(currentMembers); + List removedMembers = new ArrayList<>(currentMembers); + removedMembers.removeAll(finalMemberSet); + + List addedAdmins = new ArrayList<>(desiredAdminSet); + addedAdmins.removeAll(currentAdmins); + List removedAdmins = new ArrayList<>(currentAdmins); + removedAdmins.removeAll(desiredAdminSet); + + // Apply member adds before admin adds (an admin must already be a member), and admin + // removals before member removals (an owner/member cannot be dropped while still an admin). + if (!addedMembers.isEmpty()) { + addUsersToGroup(domainId, addedMembers, groupId); + } + if (!removedAdmins.isEmpty()) { + removeGroupAdmins(domainId, groupId, removedAdmins); + } + if (!addedAdmins.isEmpty()) { + addGroupAdmins(domainId, groupId, addedAdmins); + } + if (!removedMembers.isEmpty()) { + removeUsersFromGroup(domainId, removedMembers, groupId); + } + } catch (Exception ex) { + logger.error(ex.getMessage(), ex); + throw new SharingRegistryException(ex.getMessage() + " Stack trace:" + ExceptionUtils.getStackTrace(ex)); + } + } + /** * API method to check Group Exists * @param domainId @@ -523,6 +608,43 @@ public boolean hasAdminAccess(String domainId, String groupId, String adminId) t } } + /** The caller's six group-access flags plus the group's member ids (see GroupAccessFlags). */ + public record GroupAccess( + List memberIds, + boolean isAdmin, + boolean isOwner, + boolean isMember, + boolean isGatewayAdminsGroup, + boolean isReadOnlyGatewayAdminsGroup, + boolean isDefaultGatewayUsersGroup) {} + + /** + * Compose the caller's group-access flags server-side, replacing the per-flag round-trips the + * client does today. {@code group} is the already-fetched group (its owner id drives is_owner); + * the caller id is the qualified {@code user@gateway}. + */ + public GroupAccess getGroupAccessFlags(String domainId, String groupId, String callerId, UserGroupEntity group) + throws SharingRegistryException { + List memberIds = getGroupMembersOfTypeUser(domainId, groupId, 0, -1).stream() + .map(UserEntity::getUserId) + .collect(Collectors.toList()); + GatewayGroups gg = new GatewayGroupsRepository().get(domainId); + boolean isAdmin = hasAdminAccess(domainId, groupId, callerId); + boolean isOwner = group.getOwnerId() != null && group.getOwnerId().equals(callerId); + boolean isMember = memberIds.contains(callerId); + boolean isGatewayAdminsGroup = gg != null && groupId.equals(gg.getAdminsGroupId()); + boolean isReadOnlyGatewayAdminsGroup = gg != null && groupId.equals(gg.getReadOnlyAdminsGroupId()); + boolean isDefaultGatewayUsersGroup = gg != null && groupId.equals(gg.getDefaultGatewayUsersGroupId()); + return new GroupAccess( + memberIds, + isAdmin, + isOwner, + isMember, + isGatewayAdminsGroup, + isReadOnlyGatewayAdminsGroup, + isDefaultGatewayUsersGroup); + } + public boolean hasOwnerAccess(String domainId, String groupId, String ownerId) throws SharingRegistryException { try { UserGroupPK userGroupPK = new UserGroupPK(); diff --git a/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/UserPreferencesService.java b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/UserPreferencesService.java new file mode 100644 index 00000000000..5040904e260 --- /dev/null +++ b/airavata-api/iam-service/src/main/java/org/apache/airavata/iam/service/UserPreferencesService.java @@ -0,0 +1,76 @@ +/** +* +* 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. +*/ +package org.apache.airavata.iam.service; + +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.util.JsonFormat; +import org.apache.airavata.api.iam.userprofile.UserPreferences; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.iam.model.UserPreferencesEntity; +import org.apache.airavata.iam.repository.UserPreferencesRepository; +import org.springframework.stereotype.Service; + +/** Per-user workspace preferences, stored as the JSON of the UserPreferences proto. */ +@Service +public class UserPreferencesService { + + private final UserPreferencesRepository repository; + + public UserPreferencesService(UserPreferencesRepository repository) { + this.repository = repository; + } + + public UserPreferences getUserPreferences(RequestContext ctx) { + return repository + .findByGatewayIdAndUserId(ctx.getGatewayId(), ctx.getUserId()) + .map(UserPreferencesService::fromJson) + .orElseGet(UserPreferences::getDefaultInstance); + } + + public UserPreferences updateUserPreferences(RequestContext ctx, UserPreferences prefs) { + UserPreferencesEntity entity = repository + .findByGatewayIdAndUserId(ctx.getGatewayId(), ctx.getUserId()) + .orElseGet(UserPreferencesEntity::new); + entity.setGatewayId(ctx.getGatewayId()); + entity.setUserId(ctx.getUserId()); + entity.setPreferencesJson(toJson(prefs)); + return fromJson(repository.save(entity)); + } + + private static String toJson(UserPreferences prefs) { + try { + return JsonFormat.printer().print(prefs); + } catch (InvalidProtocolBufferException e) { + throw new RuntimeException(e); + } + } + + private static UserPreferences fromJson(UserPreferencesEntity entity) { + UserPreferences.Builder builder = UserPreferences.newBuilder(); + try { + if (entity.getPreferencesJson() != null) { + JsonFormat.parser().ignoringUnknownFields().merge(entity.getPreferencesJson(), builder); + } + } catch (InvalidProtocolBufferException e) { + throw new RuntimeException(e); + } + return builder.build(); + } +} diff --git a/airavata-api/iam-service/src/main/proto/group_manager_service.proto b/airavata-api/iam-service/src/main/proto/group_manager_service.proto index 107af60bc47..52c64c75417 100644 --- a/airavata-api/iam-service/src/main/proto/group_manager_service.proto +++ b/airavata-api/iam-service/src/main/proto/group_manager_service.proto @@ -43,6 +43,28 @@ service GroupManagerService { }; } + // Additive declarative create: the client sends the desired full members + admins lists in + // GroupModel and the server reconciles (computes add/remove deltas) in one call. Unlike CreateGroup + // (which persists only metadata and ignores members/admins), this rpc also applies the roster, so a + // thin client need not diff and fan out the membership/admin mutator rpcs itself. + rpc CreateGroupReconciled(CreateGroupRequest) returns (GroupWithAccess) { + option (google.api.http) = { + post: "/api/v1/groups:reconcile" + body: "group" + }; + } + + // Additive declarative update: the client sends the desired full members + admins lists in + // GroupModel and the server reconciles current vs desired (add/remove members and admins, promoting + // admins-not-yet-members to members) plus the metadata, in one call. Unlike UpdateGroup (which + // persists only metadata and ignores members/admins), this rpc reconciles the roster server-side. + rpc UpdateGroupReconciled(UpdateGroupRequest) returns (GroupWithAccess) { + option (google.api.http) = { + put: "/api/v1/groups/{group.id}:reconcile" + body: "group" + }; + } + rpc DeleteGroup(DeleteGroupRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/api/v1/groups/{group_id}" @@ -55,18 +77,46 @@ service GroupManagerService { }; } + // Additive: GetGroup plus the caller's six server-computed group-access flags (and the + // group's members), so a client does not recompute group access from separate + // GroupManager / gateway-groups round-trips. + rpc GetGroupWithAccess(GetGroupRequest) returns (GroupWithAccess) { + option (google.api.http) = { + get: "/api/v1/groups/{group_id}:withAccess" + }; + } + rpc GetGroups(GetGroupsRequest) returns (GetGroupsResponse) { option (google.api.http) = { get: "/api/v1/groups" }; } + // Additive: the list analogue of GetGroupWithAccess. Each group is unioned with the + // caller's six server-computed group-access flags; members/admins are populated only for + // insiders (see GetGroupWithAccess) so non-members do not see the roster. + rpc GetGroupsWithAccess(GetGroupsRequest) returns (GetGroupsWithAccessResponse) { + option (google.api.http) = { + get: "/api/v1/groups:withAccess" + }; + } + rpc GetAllGroupsUserBelongs(GetAllGroupsUserBelongsRequest) returns (GetAllGroupsUserBelongsResponse) { option (google.api.http) = { get: "/api/v1/groups/user/{user_name}" }; } + // Additive: the with-access analogue of GetAllGroupsUserBelongs. Each group the + // user belongs to is unioned with the caller's six server-computed group-access + // flags (members/admins populated for insiders, as GetGroupsWithAccess), so the + // portal no longer fans out per-group HasAdminAccess / GetGatewayGroups lookups. + rpc GetAllGroupsUserBelongsWithAccess(GetAllGroupsUserBelongsRequest) returns (GetGroupsWithAccessResponse) { + option (google.api.http) = { + get: "/api/v1/groups/user/{user_name}:withAccess" + }; + } + rpc AddUsersToGroup(AddUsersToGroupRequest) returns (google.protobuf.Empty) { option (google.api.http) = { post: "/api/v1/groups/{group_id}/members" @@ -136,6 +186,24 @@ message GetGroupRequest { string group_id = 1; } +// The caller's six cross-context group-access flags. A group needs more than the +// two-flag commons.AccessFlags: an admin lookup, ownership, membership, and whether the +// group is one of the three gateway-identity groups (admins / read-only admins / default users). +message GroupAccessFlags { + bool is_admin = 1; + bool is_owner = 2; + bool is_member = 3; + bool is_gateway_admins_group = 4; + bool is_read_only_gateway_admins_group = 5; + bool is_default_gateway_users_group = 6; +} + +// A GroupModel (members populated) unioned with the caller's group-access flags. +message GroupWithAccess { + org.apache.airavata.model.group.GroupModel group = 1; + GroupAccessFlags access = 2; +} + message GetGroupsRequest { } @@ -143,6 +211,10 @@ message GetGroupsResponse { repeated org.apache.airavata.model.group.GroupModel groups = 1; } +message GetGroupsWithAccessResponse { + repeated GroupWithAccess groups = 1; +} + message GetAllGroupsUserBelongsRequest { string user_name = 1; } diff --git a/airavata-api/iam-service/src/main/proto/sharing_service.proto b/airavata-api/iam-service/src/main/proto/sharing_service.proto index 7020bf484da..897746c3878 100644 --- a/airavata-api/iam-service/src/main/proto/sharing_service.proto +++ b/airavata-api/iam-service/src/main/proto/sharing_service.proto @@ -25,6 +25,8 @@ option java_multiple_files = true; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "org/apache/airavata/model/sharing/sharing.proto"; +import "org/apache/airavata/model/user/user_profile.proto"; +import "group_manager_service.proto"; // SharingService provides RPCs for managing resource sharing with users and groups, // as well as domain, user, group, entity type, permission type, and entity CRUD. @@ -88,6 +90,37 @@ service SharingService { }; } + // Additive: the composed sharing view of an entity (owner + per-user UserProfile and per-group + // GroupWithAccess permissions, with is_owner / has_sharing_permission), assembled server-side so + // a client does not fan out per-permission accessor RPCs + profile/group lookups. DIRECT-only: + // only directly granted permissions (the ones the portal UI can edit). + rpc GetSharedEntity(GetSharedEntityRequest) returns (SharedEntity) { + option (google.api.http) = { + get: "/api/v1/sharing/entities/{entity_id}:shared" + }; + } + + // Additive: the accessible-including-inherited analogue of GetSharedEntity (direct + inherited + // sharing settings). + rpc GetAllSharedEntity(GetSharedEntityRequest) returns (SharedEntity) { + option (google.api.http) = { + get: "/api/v1/sharing/entities/{entity_id}:sharedAll" + }; + } + + // Additive: declaratively set an entity's direct sharing. The client sends the DESIRED end-state + // (which users/groups should hold which permission); the server reads the current DIRECT grants, + // computes the grant/revoke diff (READ implies READ; WRITE implies READ+WRITE; MANAGE_SHARING + // implies READ+WRITE+MANAGE_SHARING), and applies it. Replaces the Python SDK's client-side diff + // (sharing_resources.apply_sharing_update). Map values are permission member NAME strings + // (READ / WRITE / MANAGE_SHARING); OWNER is not settable here. + rpc SetEntitySharing(SetEntitySharingRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/api/v1/sharing/entities/{resource_id}/permissions" + body: "*" + }; + } + // --- Domain CRUD --- rpc CreateDomain(CreateDomainRequest) returns (CreateDomainResponse) { @@ -532,6 +565,47 @@ message UserHasAccessResponse { bool has_access = 1; } +// =========================================================================== +// Request/Response messages — SharedEntity composite +// =========================================================================== + +// A single user grant: the user's profile plus the permission member NAME (READ / WRITE / +// MANAGE_SHARING). +message UserPermission { + org.apache.airavata.model.user.UserProfile user = 1; + string permission_type = 2; +} + +// A single group grant: the group (with the caller's access flags) plus the permission member +// NAME (READ / WRITE / MANAGE_SHARING). +message GroupPermission { + org.apache.airavata.api.iam.groupmanager.GroupWithAccess group = 1; + string permission_type = 2; +} + +// The composed sharing view of an entity. owner is excluded from user_permissions. is_owner is +// owner == caller; has_sharing_permission is the caller's MANAGE_SHARING access. +message SharedEntity { + string entity_id = 1; + org.apache.airavata.model.user.UserProfile owner = 2; + repeated UserPermission user_permissions = 3; + repeated GroupPermission group_permissions = 4; + bool is_owner = 5; + bool has_sharing_permission = 6; +} + +message GetSharedEntityRequest { + string entity_id = 1; +} + +// The DESIRED end-state of an entity's direct sharing. Map values are permission member NAME +// strings (READ / WRITE / MANAGE_SHARING); ids absent from a map have their direct grants revoked. +message SetEntitySharingRequest { + string resource_id = 1; + map user_permissions = 2; + map group_permissions = 3; +} + // =========================================================================== // Request/Response messages — Domain CRUD // =========================================================================== diff --git a/airavata-api/iam-service/src/main/proto/user_profile_service.proto b/airavata-api/iam-service/src/main/proto/user_profile_service.proto index b37f7851582..769083a5e94 100644 --- a/airavata-api/iam-service/src/main/proto/user_profile_service.proto +++ b/airavata-api/iam-service/src/main/proto/user_profile_service.proto @@ -72,6 +72,28 @@ service UserProfileService { get: "/api/v1/gateways/{gateway_id}/user-profiles/{user_name}:exists" }; } + + // Per-user workspace preferences, scoped to the authenticated caller + // (gateway + user from the request context, not the request body). + rpc GetUserPreferences(google.protobuf.Empty) returns (UserPreferences) { + option (google.api.http) = { + get: "/api/v1/user/preferences" + }; + } + + rpc UpdateUserPreferences(UserPreferences) returns (UserPreferences) { + option (google.api.http) = { + put: "/api/v1/user/preferences" + body: "*" + }; + } +} + +message UserPreferences { + string most_recent_project_id = 1; + string most_recent_group_resource_profile_id = 2; + string most_recent_compute_resource_id = 3; + map application_favorites = 4; } // Request/Response messages diff --git a/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/grpc/GroupManagerGrpcServiceTest.java b/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/grpc/GroupManagerGrpcServiceTest.java new file mode 100644 index 00000000000..3d5c6643069 --- /dev/null +++ b/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/grpc/GroupManagerGrpcServiceTest.java @@ -0,0 +1,169 @@ +/** +* +* 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. +*/ +package org.apache.airavata.iam.grpc; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +import io.grpc.stub.StreamObserver; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; +import org.apache.airavata.api.iam.groupmanager.GetAllGroupsUserBelongsRequest; +import org.apache.airavata.api.iam.groupmanager.GetGroupsRequest; +import org.apache.airavata.api.iam.groupmanager.GetGroupsWithAccessResponse; +import org.apache.airavata.api.iam.groupmanager.GroupWithAccess; +import org.apache.airavata.config.Constants; +import org.apache.airavata.config.UserContext; +import org.apache.airavata.iam.model.GroupAdminEntity; +import org.apache.airavata.iam.model.UserGroupEntity; +import org.apache.airavata.iam.service.SharingService; +import org.apache.airavata.model.security.proto.AuthzToken; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class GroupManagerGrpcServiceTest { + + private static final String GATEWAY_ID = "testGateway"; + private static final String CALLER = "caller@" + GATEWAY_ID; + + @Mock + SharingService sharingHandler; + + GroupManagerGrpcService service; + + @BeforeEach + void setUp() { + service = new GroupManagerGrpcService(sharingHandler, new GroupWithAccessAssembler(sharingHandler)); + // GrpcRequestContext.current() resolves the caller from UserContext thread-locals. + UserContext.setAuthzToken(AuthzToken.newBuilder() + .setAccessToken("token") + .putClaimsMap(Constants.USER_NAME, "caller") + .putClaimsMap(Constants.GATEWAY_ID, GATEWAY_ID) + .build()); + } + + @AfterEach + void tearDown() { + UserContext.clear(); + } + + private static UserGroupEntity group(String id) { + UserGroupEntity entity = new UserGroupEntity(); + entity.setGroupId(id); + entity.setDomainId(GATEWAY_ID); + entity.setName("Group " + id); + entity.setDescription("desc " + id); + entity.setOwnerId("owner@" + GATEWAY_ID); + GroupAdminEntity admin = new GroupAdminEntity(); + admin.setAdminId("admin@" + GATEWAY_ID); + entity.setGroupAdmins(List.of(admin)); + return entity; + } + + private static SharingService.GroupAccess access(boolean member) { + // memberIds always carries the roster; only the read gate decides whether it is exposed. + return new SharingService.GroupAccess( + List.of("m1@" + GATEWAY_ID, "m2@" + GATEWAY_ID), false, false, member, false, false, false); + } + + @Test + void getGroupsWithAccess_insiderSeesRosterOutsiderDoesNot() throws Exception { + UserGroupEntity insiderGroup = group("g-in"); + UserGroupEntity outsiderGroup = group("g-out"); + when(sharingHandler.getGroups(GATEWAY_ID, 0, -1)).thenReturn(List.of(insiderGroup, outsiderGroup)); + when(sharingHandler.getGroupAccessFlags(GATEWAY_ID, "g-in", CALLER, insiderGroup)) + .thenReturn(access(true)); + when(sharingHandler.getGroupAccessFlags(GATEWAY_ID, "g-out", CALLER, outsiderGroup)) + .thenReturn(access(false)); + + GetGroupsWithAccessResponse response = capture(o -> service.getGroupsWithAccess( + GetGroupsRequest.getDefaultInstance(), o)); + + assertEquals(2, response.getGroupsCount()); + + GroupWithAccess insider = response.getGroups(0); + assertEquals("g-in", insider.getGroup().getId()); + assertTrue(insider.getAccess().getIsMember()); + // Insider: roster (members + admins) is exposed. + assertEquals(List.of("m1@" + GATEWAY_ID, "m2@" + GATEWAY_ID), insider.getGroup().getMembersList()); + assertEquals(List.of("admin@" + GATEWAY_ID), insider.getGroup().getAdminsList()); + + GroupWithAccess outsider = response.getGroups(1); + assertEquals("g-out", outsider.getGroup().getId()); + assertFalse(outsider.getAccess().getIsMember()); + // Outsider: flags are returned but the member/admin roster is withheld. + assertTrue(outsider.getGroup().getMembersList().isEmpty()); + assertTrue(outsider.getGroup().getAdminsList().isEmpty()); + // Non-roster fields remain visible. + assertEquals("Group g-out", outsider.getGroup().getName()); + assertEquals("owner@" + GATEWAY_ID, outsider.getGroup().getOwnerId()); + } + + @Test + void getAllGroupsUserBelongsWithAccess_unionsEachGroupWithFlags() throws Exception { + String userName = "m1@" + GATEWAY_ID; + UserGroupEntity g1 = group("g1"); + UserGroupEntity g2 = group("g2"); + when(sharingHandler.getAllMemberGroupEntitiesForUser(GATEWAY_ID, userName)) + .thenReturn(List.of(g1, g2)); + when(sharingHandler.getGroupAccessFlags(GATEWAY_ID, "g1", CALLER, g1)).thenReturn(access(true)); + when(sharingHandler.getGroupAccessFlags(GATEWAY_ID, "g2", CALLER, g2)).thenReturn(access(true)); + + GetGroupsWithAccessResponse response = capture(o -> service.getAllGroupsUserBelongsWithAccess( + GetAllGroupsUserBelongsRequest.newBuilder().setUserName(userName).build(), o)); + + assertEquals(2, response.getGroupsCount()); + GroupWithAccess first = response.getGroups(0); + assertEquals("g1", first.getGroup().getId()); + assertTrue(first.getAccess().getIsMember()); + // member of the group: roster exposed + assertEquals(List.of("m1@" + GATEWAY_ID, "m2@" + GATEWAY_ID), first.getGroup().getMembersList()); + assertEquals("g2", response.getGroups(1).getGroup().getId()); + } + + private static T capture(java.util.function.Consumer> call) { + AtomicReference ref = new AtomicReference<>(); + AtomicReference err = new AtomicReference<>(); + call.accept(new StreamObserver<>() { + @Override + public void onNext(T value) { + ref.set(value); + } + + @Override + public void onError(Throwable t) { + err.set(t); + } + + @Override + public void onCompleted() {} + }); + if (err.get() != null) { + fail("adapter reported error", err.get()); + } + return ref.get(); + } +} diff --git a/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/service/ResourceSharingServiceTest.java b/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/service/ResourceSharingServiceTest.java index 470222555f8..84a32b0c86a 100644 --- a/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/service/ResourceSharingServiceTest.java +++ b/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/service/ResourceSharingServiceTest.java @@ -337,4 +337,116 @@ void getAllAccessibleGroups_manageSharingPermission() throws Exception { assertEquals(1, result.size()); assertTrue(result.contains("group-manage-1")); } + + @Test + void setEntitySharing_computesAndAppliesUserDeltas() throws Exception { + // Spy the SUT so the delta computation runs for real while the share/revoke delegations can + // be verified with the exact per-permission maps. The grant/revoke methods are stubbed to + // no-op (they have their own tested behaviour and their own auth gate). + ResourceSharingService service = spy(resourceSharingService); + + // Auth gate: caller is the owner (MANAGE_SHARING access is true). + doReturn(true).when(service).userHasAccess(ctx, "resource-1", ResourcePermissionType.MANAGE_SHARING); + + // Current DIRECT user grants: u1=READ, u2=WRITE (WRITE also reports the READ list per the + // store, but the highest-permission fold yields u1=READ, u2=WRITE). + doReturn(List.of("u1", "u2")) + .when(service) + .getAllDirectlyAccessibleUsers(ctx, "resource-1", ResourcePermissionType.READ); + doReturn(List.of("u2")) + .when(service) + .getAllDirectlyAccessibleUsers(ctx, "resource-1", ResourcePermissionType.WRITE); + doReturn(List.of()) + .when(service) + .getAllDirectlyAccessibleUsers(ctx, "resource-1", ResourcePermissionType.MANAGE_SHARING); + // No owner among the direct user grants in this scenario. + doReturn(List.of()) + .when(service) + .getAllDirectlyAccessibleUsers(ctx, "resource-1", ResourcePermissionType.OWNER); + // No current group grants. + doReturn(List.of()) + .when(service) + .getAllDirectlyAccessibleGroups(eq(ctx), eq("resource-1"), any(ResourcePermissionType.class)); + + // Stub the share/revoke delegations to no-op; we verify the maps they receive. + doReturn(true).when(service).shareResourceWithUsers(eq(ctx), eq("resource-1"), anyMap()); + doReturn(true).when(service).revokeSharingOfResourceFromUsers(eq(ctx), eq("resource-1"), anyMap()); + + // Desired: u1 -> WRITE (upgrade), u3 -> MANAGE_SHARING (new), u2 omitted (revoke all). + Map desiredUsers = Map.of( + "u1", ResourcePermissionType.WRITE, + "u3", ResourcePermissionType.MANAGE_SHARING); + + service.setEntitySharing(ctx, "resource-1", desiredUsers, Map.of()); + + // Implied-permission diff per id: + // u1: {READ} -> {READ,WRITE} => grant WRITE + // u2: {READ,WRITE} -> {} => revoke READ, revoke WRITE + // u3: {} -> {READ,WRITE,MANAGE_SHARING} => grant READ, WRITE, MANAGE_SHARING + // Expected grant buckets: READ={u3}, WRITE={u1,u3}, MANAGE_SHARING={u3}. + // Expected revoke buckets: READ={u2}, WRITE={u2}. + verify(service) + .shareResourceWithUsers(ctx, "resource-1", Map.of("u3", ResourcePermissionType.READ)); + verify(service) + .shareResourceWithUsers( + ctx, + "resource-1", + Map.of("u1", ResourcePermissionType.WRITE, "u3", ResourcePermissionType.WRITE)); + verify(service) + .shareResourceWithUsers( + ctx, "resource-1", Map.of("u3", ResourcePermissionType.MANAGE_SHARING)); + verify(service) + .revokeSharingOfResourceFromUsers(ctx, "resource-1", Map.of("u2", ResourcePermissionType.READ)); + verify(service) + .revokeSharingOfResourceFromUsers(ctx, "resource-1", Map.of("u2", ResourcePermissionType.WRITE)); + + // Exactly three grant buckets and two revoke buckets for users; no group share/revoke (empty). + verify(service, times(3)).shareResourceWithUsers(eq(ctx), eq("resource-1"), anyMap()); + verify(service, times(2)).revokeSharingOfResourceFromUsers(eq(ctx), eq("resource-1"), anyMap()); + verify(service, never()).shareResourceWithGroups(eq(ctx), eq("resource-1"), anyMap()); + verify(service, never()).revokeSharingOfResourceFromGroups(eq(ctx), eq("resource-1"), anyMap()); + } + + @Test + void setEntitySharing_rejectsCallerWithoutManageSharing() throws Exception { + ResourceSharingService service = spy(resourceSharingService); + doReturn(false).when(service).userHasAccess(ctx, "resource-1", ResourcePermissionType.MANAGE_SHARING); + + assertThrows( + ServiceAuthorizationException.class, + () -> service.setEntitySharing( + ctx, "resource-1", Map.of("u1", ResourcePermissionType.READ), Map.of())); + + verify(service, never()).shareResourceWithUsers(any(), anyString(), anyMap()); + verify(service, never()).revokeSharingOfResourceFromUsers(any(), anyString(), anyMap()); + } + + @Test + void setEntitySharing_excludesOwnerFromRevoke() throws Exception { + // The OWNER is unioned into every direct accessor list. A desired map that omits the owner + // (the read side drops it) must NOT compute a revoke against the owner. + ResourceSharingService service = spy(resourceSharingService); + doReturn(true).when(service).userHasAccess(ctx, "resource-1", ResourcePermissionType.MANAGE_SHARING); + doReturn(List.of("owner@testGateway")) + .when(service) + .getAllDirectlyAccessibleUsers(ctx, "resource-1", ResourcePermissionType.READ); + doReturn(List.of("owner@testGateway")) + .when(service) + .getAllDirectlyAccessibleUsers(ctx, "resource-1", ResourcePermissionType.WRITE); + doReturn(List.of("owner@testGateway")) + .when(service) + .getAllDirectlyAccessibleUsers(ctx, "resource-1", ResourcePermissionType.MANAGE_SHARING); + doReturn(List.of("owner@testGateway")) + .when(service) + .getAllDirectlyAccessibleUsers(ctx, "resource-1", ResourcePermissionType.OWNER); + doReturn(List.of()) + .when(service) + .getAllDirectlyAccessibleGroups(eq(ctx), eq("resource-1"), any(ResourcePermissionType.class)); + + // Desired omits the owner; nothing else changes -> no share and no revoke should fire. + service.setEntitySharing(ctx, "resource-1", Map.of(), Map.of()); + + verify(service, never()).revokeSharingOfResourceFromUsers(eq(ctx), eq("resource-1"), anyMap()); + verify(service, never()).shareResourceWithUsers(eq(ctx), eq("resource-1"), anyMap()); + } } diff --git a/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/service/SharedEntityServiceTest.java b/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/service/SharedEntityServiceTest.java new file mode 100644 index 00000000000..e867967e79f --- /dev/null +++ b/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/service/SharedEntityServiceTest.java @@ -0,0 +1,211 @@ +/** +* +* 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. +*/ +package org.apache.airavata.iam.service; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +import java.util.List; +import java.util.Map; +import org.apache.airavata.api.iam.groupmanager.GroupWithAccess; +import org.apache.airavata.api.iam.sharing.GroupPermission; +import org.apache.airavata.api.iam.sharing.SharedEntity; +import org.apache.airavata.api.iam.sharing.UserPermission; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.iam.grpc.GroupWithAccessAssembler; +import org.apache.airavata.iam.model.UserGroupEntity; +import org.apache.airavata.iam.repository.UserProfileRepository; +import org.apache.airavata.model.group.proto.GroupModel; +import org.apache.airavata.model.group.proto.ResourcePermissionType; +import org.apache.airavata.model.user.proto.UserProfile; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class SharedEntityServiceTest { + + private static final String GATEWAY_ID = "testGateway"; + private static final String CALLER = "caller"; + private static final String ENTITY_ID = "entity-1"; + + @Mock + ResourceSharingService resourceSharingService; + + @Mock + UserProfileRepository userProfileRepository; + + @Mock + SharingService sharingHandler; + + @Mock + GroupWithAccessAssembler groupAssembler; + + SharedEntityService service; + RequestContext ctx; + + @BeforeEach + void setUp() { + service = new SharedEntityService( + resourceSharingService, userProfileRepository, sharingHandler, groupAssembler); + ctx = new RequestContext(CALLER, GATEWAY_ID, "token", Map.of()); + } + + private static UserProfile profile(String userId) { + return UserProfile.newBuilder() + .setUserId(userId) + .setGatewayId(GATEWAY_ID) + .build(); + } + + private static String qid(String user) { + return user + "@" + GATEWAY_ID; + } + + @Test + void loadSharedEntity_directOnly_composesOwnerUsersAndGroupsWithPrecedence() throws Exception { + // Direct accessor returns: + // READ: alice, bob, owner ; WRITE: bob, owner ; MANAGE_SHARING: owner ; OWNER: owner + // After precedence overwrite: alice=READ, bob=WRITE, owner=MANAGE_SHARING — then owner dropped. + when(resourceSharingService.getAllDirectlyAccessibleUsers(ctx, ENTITY_ID, ResourcePermissionType.READ)) + .thenReturn(List.of(qid("alice"), qid("bob"), qid(CALLER))); + when(resourceSharingService.getAllDirectlyAccessibleUsers(ctx, ENTITY_ID, ResourcePermissionType.WRITE)) + .thenReturn(List.of(qid("bob"), qid(CALLER))); + when(resourceSharingService.getAllDirectlyAccessibleUsers( + ctx, ENTITY_ID, ResourcePermissionType.MANAGE_SHARING)) + .thenReturn(List.of(qid(CALLER))); + when(resourceSharingService.getAllDirectlyAccessibleUsers(ctx, ENTITY_ID, ResourcePermissionType.OWNER)) + .thenReturn(List.of(qid(CALLER))); + + // One group with WRITE access. + when(resourceSharingService.getAllDirectlyAccessibleGroups(ctx, ENTITY_ID, ResourcePermissionType.READ)) + .thenReturn(List.of()); + when(resourceSharingService.getAllDirectlyAccessibleGroups(ctx, ENTITY_ID, ResourcePermissionType.WRITE)) + .thenReturn(List.of("group-1")); + when(resourceSharingService.getAllDirectlyAccessibleGroups( + ctx, ENTITY_ID, ResourcePermissionType.MANAGE_SHARING)) + .thenReturn(List.of()); + + when(userProfileRepository.getUserProfileByIdAndGateWay("alice", GATEWAY_ID)).thenReturn(profile("alice")); + when(userProfileRepository.getUserProfileByIdAndGateWay("bob", GATEWAY_ID)).thenReturn(profile("bob")); + when(userProfileRepository.getUserProfileByIdAndGateWay(CALLER, GATEWAY_ID)).thenReturn(profile(CALLER)); + + UserGroupEntity group = new UserGroupEntity(); + group.setGroupId("group-1"); + when(sharingHandler.getGroup(GATEWAY_ID, "group-1")).thenReturn(group); + GroupWithAccess gwa = GroupWithAccess.newBuilder() + .setGroup(GroupModel.newBuilder().setId("group-1").build()) + .build(); + when(groupAssembler.buildGroupWithAccess(ctx, group)).thenReturn(gwa); + + when(resourceSharingService.userHasAccess(ctx, ENTITY_ID, ResourcePermissionType.MANAGE_SHARING)) + .thenReturn(true); + + SharedEntity result = service.loadSharedEntity(ctx, ENTITY_ID, true); + + assertEquals(ENTITY_ID, result.getEntityId()); + assertEquals(CALLER, result.getOwner().getUserId()); + assertTrue(result.getIsOwner()); + assertTrue(result.getHasSharingPermission()); + + // Owner is excluded from user_permissions; alice=READ, bob=WRITE (WRITE overwrote READ). + assertEquals(2, result.getUserPermissionsCount()); + Map userPerms = result.getUserPermissionsList().stream() + .collect(java.util.stream.Collectors.toMap( + up -> up.getUser().getUserId(), UserPermission::getPermissionType)); + assertEquals("READ", userPerms.get("alice")); + assertEquals("WRITE", userPerms.get("bob")); + assertFalse(userPerms.containsKey(CALLER)); + + assertEquals(1, result.getGroupPermissionsCount()); + GroupPermission gp = result.getGroupPermissions(0); + assertEquals("group-1", gp.getGroup().getGroup().getId()); + assertEquals("WRITE", gp.getPermissionType()); + } + + @Test + void loadSharedEntity_notOwner_setsIsOwnerFalse() throws Exception { + when(resourceSharingService.getAllDirectlyAccessibleUsers(ctx, ENTITY_ID, ResourcePermissionType.READ)) + .thenReturn(List.of(qid("other"))); + when(resourceSharingService.getAllDirectlyAccessibleUsers(ctx, ENTITY_ID, ResourcePermissionType.WRITE)) + .thenReturn(List.of()); + when(resourceSharingService.getAllDirectlyAccessibleUsers( + ctx, ENTITY_ID, ResourcePermissionType.MANAGE_SHARING)) + .thenReturn(List.of()); + when(resourceSharingService.getAllDirectlyAccessibleUsers(ctx, ENTITY_ID, ResourcePermissionType.OWNER)) + .thenReturn(List.of(qid("other"))); + when(resourceSharingService.getAllDirectlyAccessibleGroups(ctx, ENTITY_ID, ResourcePermissionType.READ)) + .thenReturn(List.of()); + when(resourceSharingService.getAllDirectlyAccessibleGroups(ctx, ENTITY_ID, ResourcePermissionType.WRITE)) + .thenReturn(List.of()); + when(resourceSharingService.getAllDirectlyAccessibleGroups( + ctx, ENTITY_ID, ResourcePermissionType.MANAGE_SHARING)) + .thenReturn(List.of()); + + when(userProfileRepository.getUserProfileByIdAndGateWay("other", GATEWAY_ID)).thenReturn(profile("other")); + when(resourceSharingService.userHasAccess(ctx, ENTITY_ID, ResourcePermissionType.MANAGE_SHARING)) + .thenReturn(false); + + SharedEntity result = service.loadSharedEntity(ctx, ENTITY_ID, true); + + // The single direct OWNER is "other"; the caller is not the owner. + assertEquals("other", result.getOwner().getUserId()); + assertFalse(result.getIsOwner()); + assertFalse(result.getHasSharingPermission()); + // The owner is the only user grant and is dropped, leaving no user permissions. + assertEquals(0, result.getUserPermissionsCount()); + } + + @Test + void loadSharedEntity_inherited_usesAccessibleAccessors() throws Exception { + when(resourceSharingService.getAllAccessibleUsers(ctx, ENTITY_ID, ResourcePermissionType.READ)) + .thenReturn(List.of(qid(CALLER))); + when(resourceSharingService.getAllAccessibleUsers(ctx, ENTITY_ID, ResourcePermissionType.WRITE)) + .thenReturn(List.of()); + when(resourceSharingService.getAllAccessibleUsers(ctx, ENTITY_ID, ResourcePermissionType.MANAGE_SHARING)) + .thenReturn(List.of()); + when(resourceSharingService.getAllAccessibleUsers(ctx, ENTITY_ID, ResourcePermissionType.OWNER)) + .thenReturn(List.of(qid(CALLER))); + when(resourceSharingService.getAllAccessibleGroups(ctx, ENTITY_ID, ResourcePermissionType.READ)) + .thenReturn(List.of()); + when(resourceSharingService.getAllAccessibleGroups(ctx, ENTITY_ID, ResourcePermissionType.WRITE)) + .thenReturn(List.of()); + when(resourceSharingService.getAllAccessibleGroups(ctx, ENTITY_ID, ResourcePermissionType.MANAGE_SHARING)) + .thenReturn(List.of()); + + when(userProfileRepository.getUserProfileByIdAndGateWay(CALLER, GATEWAY_ID)).thenReturn(profile(CALLER)); + when(resourceSharingService.userHasAccess(ctx, ENTITY_ID, ResourcePermissionType.MANAGE_SHARING)) + .thenReturn(true); + + SharedEntity result = service.loadSharedEntity(ctx, ENTITY_ID, false); + + assertEquals(CALLER, result.getOwner().getUserId()); + assertTrue(result.getIsOwner()); + assertEquals(0, result.getUserPermissionsCount()); + // The direct accessors must not be touched on the inherited path. + verify(resourceSharingService, never()) + .getAllDirectlyAccessibleUsers(any(), anyString(), any()); + verify(resourceSharingService, never()) + .getAllDirectlyAccessibleGroups(any(), anyString(), any()); + } +} diff --git a/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/service/SharingServiceTest.java b/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/service/SharingServiceTest.java new file mode 100644 index 00000000000..4bba8505d0d --- /dev/null +++ b/airavata-api/iam-service/src/test/java/org/apache/airavata/iam/service/SharingServiceTest.java @@ -0,0 +1,95 @@ +/** +* +* 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. +*/ +package org.apache.airavata.iam.service; + +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; + +import java.util.List; +import org.apache.airavata.iam.model.GroupAdminEntity; +import org.apache.airavata.iam.model.UserEntity; +import org.apache.airavata.iam.model.UserGroupEntity; +import org.junit.jupiter.api.Test; + +/** Unit tests for {@link SharingService#reconcileGroupMembership} — the declarative member/admin diff. */ +class SharingServiceTest { + + private static UserEntity user(String id) { + UserEntity u = new UserEntity(); + u.setUserId(id); + return u; + } + + private static GroupAdminEntity admin(String id) { + GroupAdminEntity a = new GroupAdminEntity(); + a.setAdminId(id); + return a; + } + + @Test + void reconcileGroupMembership_update_computesAddRemoveDeltasAndPromotesAdmin() throws Exception { + SharingService service = spy(new SharingService()); + + // Current: members {u1, u2}, admins {u1}. + doReturn(List.of(user("u1@gw"), user("u2@gw"))) + .when(service) + .getGroupMembersOfTypeUser(eq("gw"), eq("g1"), anyInt(), anyInt()); + UserGroupEntity entity = new UserGroupEntity(); + entity.setGroupId("g1"); + entity.setGroupAdmins(List.of(admin("u1@gw"))); + doReturn(entity).when(service).getGroup("gw", "g1"); + + doReturn(true).when(service).addUsersToGroup(eq("gw"), eq(List.of("u3@gw")), eq("g1")); + doReturn(true).when(service).removeUsersFromGroup(eq("gw"), eq(List.of("u2@gw")), eq("g1")); + doReturn(true).when(service).addGroupAdmins(eq("gw"), eq("g1"), eq(List.of("u3@gw"))); + doReturn(true).when(service).removeGroupAdmins(eq("gw"), eq("g1"), eq(List.of("u1@gw"))); + + // Desired: members {u1}, admins {u3}. u3 is an admin but not a desired member -> promoted to member. + // owner@gw is the owner (excluded from the diff); it is not among the test users. + service.reconcileGroupMembership("gw", "g1", List.of("u1@gw"), List.of("u3@gw"), "owner@gw", false); + + verify(service).addUsersToGroup("gw", List.of("u3@gw"), "g1"); // u3 added (incl. promotion) + verify(service).removeUsersFromGroup("gw", List.of("u2@gw"), "g1"); // u2 dropped + verify(service).addGroupAdmins("gw", "g1", List.of("u3@gw")); // u3 promoted to admin + verify(service).removeGroupAdmins("gw", "g1", List.of("u1@gw")); // u1 demoted from admin + } + + @Test + void reconcileGroupMembership_create_addsAllDesiredWithAdminPromotion() throws Exception { + SharingService service = spy(new SharingService()); + + // New group: no current roster is read. + doReturn(true).when(service).addUsersToGroup(eq("gw"), eq(List.of("u1@gw", "u3@gw")), eq("g1")); + doReturn(true).when(service).addGroupAdmins(eq("gw"), eq("g1"), eq(List.of("u3@gw"))); + + // Desired: members {u1}, admins {u3}; u3 promoted to member. + service.reconcileGroupMembership("gw", "g1", List.of("u1@gw"), List.of("u3@gw"), "owner@gw", true); + + verify(service).addUsersToGroup("gw", List.of("u1@gw", "u3@gw"), "g1"); + verify(service).addGroupAdmins("gw", "g1", List.of("u3@gw")); + // A new group has no current roster, so nothing is revoked. + verify(service, never()).removeUsersFromGroup(eq("gw"), org.mockito.ArgumentMatchers.anyList(), eq("g1")); + verify(service, never()).removeGroupAdmins(eq("gw"), eq("g1"), org.mockito.ArgumentMatchers.anyList()); + } +} diff --git a/airavata-api/research-service/pom.xml b/airavata-api/research-service/pom.xml index a6a45e2cab3..1ff7763550f 100644 --- a/airavata-api/research-service/pom.xml +++ b/airavata-api/research-service/pom.xml @@ -193,6 +193,16 @@ under the License. org.apache.maven.plugins maven-surefire-plugin + + + + 1.44 + + + ${env.DOCKER_HOST} + ${env.TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE} + + diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ApplicationCatalogGrpcService.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ApplicationCatalogGrpcService.java index 81ecf73d013..b73af309fc2 100644 --- a/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ApplicationCatalogGrpcService.java +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ApplicationCatalogGrpcService.java @@ -74,6 +74,20 @@ public void getApplicationModule(GetApplicationModuleRequest request, StreamObse } } + @Override + public void getApplicationModuleWithAccess( + GetApplicationModuleRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ApplicationModuleWithAccess result = + applicationCatalogService.getApplicationModuleWithAccess(ctx, request.getAppModuleId()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void updateApplicationModule(UpdateApplicationModuleRequest request, StreamObserver observer) { try { @@ -113,6 +127,39 @@ public void getAllAppModules(GetAllAppModulesRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + List modules = + applicationCatalogService.getAllApplicationModulesWithAccess(ctx, request.getGatewayId()); + observer.onNext(GetAllApplicationModulesWithAccessResponse.newBuilder() + .addAllModules(modules) + .build()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void getAccessibleApplicationModulesWithAccess( + GetAccessibleAppModulesRequest request, + StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + List modules = + applicationCatalogService.getAccessibleApplicationModulesWithAccess(ctx, request.getGatewayId()); + observer.onNext(GetAccessibleApplicationModulesWithAccessResponse.newBuilder() + .addAllModules(modules) + .build()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void getAccessibleAppModules( GetAccessibleAppModulesRequest request, StreamObserver observer) { @@ -162,6 +209,36 @@ public void getApplicationDeployment( } } + @Override + public void getApplicationDeploymentWithAccess( + GetApplicationDeploymentRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ApplicationDeploymentWithAccess result = + applicationCatalogService.getApplicationDeploymentWithAccess(ctx, request.getAppDeploymentId()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void getApplicationDeploymentQueues( + GetApplicationDeploymentRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + GetApplicationDeploymentQueuesResponse result = GetApplicationDeploymentQueuesResponse.newBuilder() + .addAllQueues( + applicationCatalogService.getApplicationDeploymentQueues(ctx, request.getAppDeploymentId())) + .build(); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void updateApplicationDeployment( UpdateApplicationDeploymentRequest request, StreamObserver observer) { @@ -206,6 +283,23 @@ public void getAllApplicationDeployments( } } + @Override + public void getAllApplicationDeploymentsWithAccess( + GetAllApplicationDeploymentsRequest request, + StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + List deployments = + applicationCatalogService.getAllApplicationDeploymentsWithAccess(ctx, request.getGatewayId()); + observer.onNext(GetAllApplicationDeploymentsWithAccessResponse.newBuilder() + .addAllDeployments(deployments) + .build()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void getAccessibleApplicationDeployments( GetAccessibleApplicationDeploymentsRequest request, @@ -226,6 +320,26 @@ public void getAccessibleApplicationDeployments( } } + @Override + public void getAccessibleApplicationDeploymentsWithAccess( + GetAccessibleApplicationDeploymentsRequest request, + StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + List deployments = + applicationCatalogService.getAccessibleApplicationDeploymentsWithAccess( + ctx, + request.getGatewayId(), + org.apache.airavata.model.group.proto.ResourcePermissionType.READ); + observer.onNext(GetAccessibleApplicationDeploymentsWithAccessResponse.newBuilder() + .addAllDeployments(deployments) + .build()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void getAppModuleDeployedResources( GetAppModuleDeployedResourcesRequest request, @@ -310,6 +424,20 @@ public void getApplicationInterface( } } + @Override + public void getApplicationInterfaceWithAccess( + GetApplicationInterfaceRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ApplicationInterfaceWithAccess result = + applicationCatalogService.getApplicationInterfaceWithAccess(ctx, request.getAppInterfaceId()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void updateApplicationInterface(UpdateApplicationInterfaceRequest request, StreamObserver observer) { try { @@ -368,6 +496,23 @@ public void getAllApplicationInterfaces( } } + @Override + public void getAllApplicationInterfacesWithAccess( + GetAllApplicationInterfacesRequest request, + StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + List interfaces = + applicationCatalogService.getAllApplicationInterfacesWithAccess(ctx, request.getGatewayId()); + observer.onNext(GetAllApplicationInterfacesWithAccessResponse.newBuilder() + .addAllInterfaces(interfaces) + .build()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void getApplicationInputs( GetApplicationInputsRequest request, StreamObserver observer) { diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ExperimentGrpcService.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ExperimentGrpcService.java index b876a96e1df..a322deca4b8 100644 --- a/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ExperimentGrpcService.java +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ExperimentGrpcService.java @@ -62,6 +62,19 @@ public void createExperiment(CreateExperimentRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ExperimentWithAccess result = experimentService.createExperimentWithAccess(ctx, request.getExperiment()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void getExperiment(GetExperimentRequest request, StreamObserver observer) { try { @@ -74,6 +87,30 @@ public void getExperiment(GetExperimentRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ExperimentWithAccess result = experimentService.getExperimentWithAccess(ctx, request.getExperimentId()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void getFullExperiment(GetExperimentRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + FullExperiment result = experimentService.getFullExperiment(ctx, request.getExperimentId()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void getExperimentByAdmin(GetExperimentByAdminRequest request, StreamObserver observer) { try { @@ -98,6 +135,20 @@ public void updateExperiment(UpdateExperimentRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ExperimentWithAccess result = experimentService.updateExperimentWithAccess( + ctx, request.getExperimentId(), request.getExperiment()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void deleteExperiment(DeleteExperimentRequest request, StreamObserver observer) { try { @@ -136,6 +187,32 @@ public void searchExperiments( } } + @Override + public void searchExperimentsWithAccess( + SearchExperimentsRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + // TODO: Map string filter keys to ExperimentSearchFields enum — needs mapper + Map filters = new HashMap<>(); + for (Map.Entry entry : request.getFiltersMap().entrySet()) { + filters.put(ExperimentSearchFields.valueOf(entry.getKey()), entry.getValue()); + } + List results = experimentService.searchExperimentsWithAccess( + ctx, + request.getGatewayId(), + request.getUserName(), + filters, + request.getLimit(), + request.getOffset()); + observer.onNext(SearchExperimentsWithAccessResponse.newBuilder() + .addAllExperiments(results) + .build()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void getExperimentStatus(GetExperimentStatusRequest request, StreamObserver observer) { try { @@ -179,6 +256,23 @@ public void getExperimentsInProject( } } + @Override + public void getExperimentsInProjectWithAccess( + GetExperimentsInProjectRequest request, + StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + List results = experimentService.getExperimentsInProjectWithAccess( + ctx, request.getProjectId(), request.getLimit(), request.getOffset()); + observer.onNext(GetExperimentsInProjectWithAccessResponse.newBuilder() + .addAllExperiments(results) + .build()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void getUserExperiments( GetUserExperimentsRequest request, StreamObserver observer) { @@ -259,6 +353,20 @@ public void launchExperiment(LaunchExperimentRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + experimentService.launchExperimentWithStorageSetup( + ctx, request.getExperimentId(), request.getGatewayId(), request.getNotificationEmail()); + observer.onNext(Empty.getDefaultInstance()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void terminateExperiment(TerminateExperimentRequest request, StreamObserver observer) { try { @@ -289,6 +397,23 @@ public void cloneExperiment(CloneExperimentRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ExperimentWithAccess result = experimentService.cloneExperimentWithInputFiles( + ctx, + request.getExperimentId(), + request.getNewExperimentName(), + request.getNewExperimentProjectId()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void getJobStatuses(GetJobStatusesRequest request, StreamObserver observer) { try { @@ -364,4 +489,17 @@ public void getExperimentStatistics( observer.onError(GrpcStatusMapper.toStatusException(e)); } } + + @Override + public void createExperimentFromSpec( + CreateExperimentFromSpecRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ExperimentWithAccess r = experimentService.createExperimentFromSpec(ctx, request.getSpec()); + observer.onNext(r); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } } diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ExperimentSetGrpcService.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ExperimentSetGrpcService.java new file mode 100644 index 00000000000..be1546f7d71 --- /dev/null +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ExperimentSetGrpcService.java @@ -0,0 +1,114 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.grpc; + +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.List; +import org.apache.airavata.api.experimentset.*; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.grpc.GrpcRequestContext; +import org.apache.airavata.grpc.GrpcStatusMapper; +import org.apache.airavata.research.service.ExperimentSetService; +import org.springframework.stereotype.Component; + +@Component +public class ExperimentSetGrpcService extends ExperimentSetServiceGrpc.ExperimentSetServiceImplBase { + + private final ExperimentSetService experimentSetService; + + public ExperimentSetGrpcService(ExperimentSetService experimentSetService) { + this.experimentSetService = experimentSetService; + } + + @Override + public void createExperimentSet(CreateExperimentSetRequest request, StreamObserver responseObserver) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ExperimentSet r = experimentSetService.createExperimentSet(ctx, request); + responseObserver.onNext(r); + responseObserver.onCompleted(); + } catch (Exception e) { + responseObserver.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void launchExperimentSet(LaunchExperimentSetRequest request, StreamObserver responseObserver) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ExperimentSet r = experimentSetService.launchExperimentSet(ctx, request.getExperimentSetId(), request.getNotificationEmail()); + responseObserver.onNext(r); + responseObserver.onCompleted(); + } catch (Exception e) { + responseObserver.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void getExperimentSet(GetExperimentSetRequest request, StreamObserver responseObserver) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ExperimentSet r = experimentSetService.getExperimentSet(ctx, request.getExperimentSetId()); + responseObserver.onNext(r); + responseObserver.onCompleted(); + } catch (Exception e) { + responseObserver.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void listExperimentSets(ListExperimentSetsRequest request, StreamObserver responseObserver) { + try { + RequestContext ctx = GrpcRequestContext.current(); + List sets = experimentSetService.listExperimentSets(ctx, request.getLimit(), request.getOffset()); + responseObserver.onNext(ListExperimentSetsResponse.newBuilder() + .addAllExperimentSets(sets) + .build()); + responseObserver.onCompleted(); + } catch (Exception e) { + responseObserver.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void getExperimentSetStatus(GetExperimentSetRequest request, StreamObserver responseObserver) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ExperimentSetStatus r = experimentSetService.getExperimentSetStatus(ctx, request.getExperimentSetId()); + responseObserver.onNext(r); + responseObserver.onCompleted(); + } catch (Exception e) { + responseObserver.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void deleteExperimentSet(DeleteExperimentSetRequest request, StreamObserver responseObserver) { + try { + RequestContext ctx = GrpcRequestContext.current(); + experimentSetService.deleteExperimentSet(ctx, request.getExperimentSetId()); + responseObserver.onNext(Empty.getDefaultInstance()); + responseObserver.onCompleted(); + } catch (Exception e) { + responseObserver.onError(GrpcStatusMapper.toStatusException(e)); + } + } +} diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/NotificationGrpcService.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/NotificationGrpcService.java index 77d82442f06..d2312d0a598 100644 --- a/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/NotificationGrpcService.java +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/NotificationGrpcService.java @@ -105,4 +105,32 @@ public void getAllNotifications( observer.onError(GrpcStatusMapper.toStatusException(e)); } } + + @Override + public void getNotificationWithAccess( + GetNotificationRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + NotificationWithAccess result = notificationService.getNotificationWithAccess( + ctx, request.getGatewayId(), request.getNotificationId()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void getAllNotificationsWithAccess( + GetAllNotificationsRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + GetAllNotificationsWithAccessResponse result = + notificationService.getAllNotificationsWithAccess(ctx, request.getGatewayId()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } } diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ProjectGrpcService.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ProjectGrpcService.java index e0a4116ed49..2d4fa26ff46 100644 --- a/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ProjectGrpcService.java +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/grpc/ProjectGrpcService.java @@ -66,6 +66,31 @@ public void getProject(GetProjectRequest request, StreamObserver observ } } + @Override + public void getProjectWithAccess(GetProjectRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ProjectWithAccess result = projectService.getProjectWithAccess(ctx, request.getProjectId()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void createProjectWithAccess(CreateProjectRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ProjectWithAccess result = + projectService.createProjectWithAccess(ctx, request.getGatewayId(), request.getProject()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void updateProject(UpdateProjectRequest request, StreamObserver observer) { try { @@ -78,6 +103,19 @@ public void updateProject(UpdateProjectRequest request, StreamObserver ob } } + @Override + public void updateProjectWithAccess(UpdateProjectRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ProjectWithAccess result = + projectService.updateProjectWithAccess(ctx, request.getProjectId(), request.getProject()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void deleteProject(DeleteProjectRequest request, StreamObserver observer) { try { @@ -104,6 +142,36 @@ public void getUserProjects(GetUserProjectsRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + List results = projectService.getUserProjectsWithAccess( + ctx, request.getGatewayId(), request.getUserName(), request.getLimit(), request.getOffset()); + observer.onNext(GetUserProjectsWithAccessResponse.newBuilder() + .addAllProjects(results) + .build()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void getMostRecentWritableProject( + GetUserProjectsRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + ProjectWithAccess result = projectService.getMostRecentWritableProject( + ctx, request.getGatewayId(), request.getUserName()); + observer.onNext(result); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void searchProjects(SearchProjectsRequest request, StreamObserver observer) { try { diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/model/ExperimentSetEntity.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/model/ExperimentSetEntity.java new file mode 100644 index 00000000000..c57cefca368 --- /dev/null +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/model/ExperimentSetEntity.java @@ -0,0 +1,140 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.model; + +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityListeners; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import org.hibernate.annotations.UuidGenerator; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +@Entity +@Table(name = "EXPERIMENT_SET") +@EntityListeners(AuditingEntityListener.class) +public class ExperimentSetEntity { + + @Id + @GeneratedValue + @UuidGenerator + @Column(nullable = false, updatable = false, length = 48) + private String id; + + @Column(nullable = false) + private String setName; + + @Column(nullable = false) + private String owner; + + @Column(nullable = false) + private String gatewayId; + + @Column(columnDefinition = "LONGTEXT") + private String sweepSpecJson; + + @OneToMany( + mappedBy = "experimentSet", + cascade = CascadeType.ALL, + orphanRemoval = true, + fetch = FetchType.EAGER) + private List members = new ArrayList<>(); + + @Column(nullable = false, updatable = false) + @CreatedDate + private Instant createdAt; + + @Column(nullable = false) + @LastModifiedDate + private Instant updatedAt; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getSetName() { + return setName; + } + + public void setSetName(String setName) { + this.setName = setName; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getGatewayId() { + return gatewayId; + } + + public void setGatewayId(String gatewayId) { + this.gatewayId = gatewayId; + } + + public String getSweepSpecJson() { + return sweepSpecJson; + } + + public void setSweepSpecJson(String sweepSpecJson) { + this.sweepSpecJson = sweepSpecJson; + } + + public List getMembers() { + return members; + } + + public void setMembers(List members) { + this.members = members; + } + + public Instant getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Instant createdAt) { + this.createdAt = createdAt; + } + + public Instant getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Instant updatedAt) { + this.updatedAt = updatedAt; + } +} diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/model/ExperimentSetMemberEntity.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/model/ExperimentSetMemberEntity.java new file mode 100644 index 00000000000..ac5a553f94d --- /dev/null +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/model/ExperimentSetMemberEntity.java @@ -0,0 +1,83 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.model; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import org.hibernate.annotations.UuidGenerator; + +@Entity +@Table(name = "EXPERIMENT_SET_MEMBER") +public class ExperimentSetMemberEntity { + + @Id + @GeneratedValue + @UuidGenerator + @Column(nullable = false, updatable = false, length = 48) + private String id; + + @ManyToOne(fetch = FetchType.LAZY, optional = false) + @JoinColumn(name = "experiment_set_id", nullable = false) + private ExperimentSetEntity experimentSet; + + @Column(nullable = false) + private String experimentId; + + @Column(nullable = false) + private int ordinal; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ExperimentSetEntity getExperimentSet() { + return experimentSet; + } + + public void setExperimentSet(ExperimentSetEntity experimentSet) { + this.experimentSet = experimentSet; + } + + public String getExperimentId() { + return experimentId; + } + + public void setExperimentId(String experimentId) { + this.experimentId = experimentId; + } + + public int getOrdinal() { + return ordinal; + } + + public void setOrdinal(int ordinal) { + this.ordinal = ordinal; + } +} diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/repository/ExperimentSetRepository.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/repository/ExperimentSetRepository.java new file mode 100644 index 00000000000..22531ced7da --- /dev/null +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/repository/ExperimentSetRepository.java @@ -0,0 +1,31 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.repository; + +import java.util.List; +import org.apache.airavata.research.model.ExperimentSetEntity; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface ExperimentSetRepository extends JpaRepository { + + List findByOwnerAndGatewayIdOrderByCreatedAtDesc(String owner, String gatewayId); +} diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ApplicationCatalogService.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ApplicationCatalogService.java index be9839eb2a5..320ec0a1eea 100644 --- a/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ApplicationCatalogService.java +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ApplicationCatalogService.java @@ -25,19 +25,27 @@ import org.apache.airavata.config.RequestContext; import org.apache.airavata.exception.ServiceAuthorizationException; import org.apache.airavata.exception.ServiceException; +import org.apache.airavata.exception.ServiceNotFoundException; import org.apache.airavata.interfaces.AppCatalogRegistry; +import org.apache.airavata.interfaces.ComputeRegistry; import org.apache.airavata.interfaces.CredentialProvider; import org.apache.airavata.interfaces.GatewayGroupsProvider; import org.apache.airavata.interfaces.RegistryProvider; +import org.apache.airavata.api.appcatalog.ApplicationDeploymentWithAccess; +import org.apache.airavata.api.appcatalog.ApplicationInterfaceWithAccess; +import org.apache.airavata.api.appcatalog.ApplicationModuleWithAccess; import org.apache.airavata.interfaces.ResourceProfileRegistry; import org.apache.airavata.interfaces.SharingFacade; import org.apache.airavata.model.appcatalog.appdeployment.proto.ApplicationDeploymentDescription; import org.apache.airavata.model.appcatalog.appdeployment.proto.ApplicationModule; import org.apache.airavata.model.appcatalog.appinterface.proto.ApplicationInterfaceDescription; +import org.apache.airavata.model.appcatalog.computeresource.proto.BatchQueue; +import org.apache.airavata.model.appcatalog.computeresource.proto.ComputeResourceDescription; import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.GroupComputeResourcePreference; import org.apache.airavata.model.appcatalog.groupresourceprofile.proto.GroupResourceProfile; import org.apache.airavata.model.application.io.proto.InputDataObjectType; import org.apache.airavata.model.application.io.proto.OutputDataObjectType; +import org.apache.airavata.model.commons.proto.AccessFlags; import org.apache.airavata.model.group.proto.ResourcePermissionType; import org.apache.airavata.model.group.proto.ResourceType; import org.apache.airavata.sharing.registry.models.proto.EntitySearchField; @@ -54,6 +62,7 @@ public class ApplicationCatalogService { private static final Logger logger = LoggerFactory.getLogger(ApplicationCatalogService.class); private final AppCatalogRegistry appCatalogRegistry; + private final ComputeRegistry computeRegistry; private final ResourceProfileRegistry resourceProfileRegistry; private final RegistryProvider registryProvider; private final SharingFacade sharingHandler; @@ -62,12 +71,14 @@ public class ApplicationCatalogService { public ApplicationCatalogService( AppCatalogRegistry appCatalogRegistry, + ComputeRegistry computeRegistry, ResourceProfileRegistry resourceProfileRegistry, RegistryProvider registryProvider, SharingFacade sharingHandler, CredentialProvider credentialHandler, GatewayGroupsProvider gatewayGroupsInitializer) { this.appCatalogRegistry = appCatalogRegistry; + this.computeRegistry = computeRegistry; this.resourceProfileRegistry = resourceProfileRegistry; this.registryProvider = registryProvider; this.sharingHandler = sharingHandler; @@ -96,6 +107,32 @@ public ApplicationModule getApplicationModule(RequestContext ctx, String appModu } } + /** + * {@link #getApplicationModule} plus the caller's server-computed access flags (additive). + * Reuses {@code getApplicationModule} for READ enforcement so a caller can never self-authorize. + * Application modules are not sharing entities — {@code registerApplicationModule} creates no + * sharing entity; they are gateway-admin-managed catalog entries. So {@code is_owner} is always + * false and {@code user_has_write_access} reflects the caller's gateway-admin status. + */ + public ApplicationModuleWithAccess getApplicationModuleWithAccess(RequestContext ctx, String appModuleId) + throws ServiceException { + ApplicationModule module = getApplicationModule(ctx, appModuleId); + if (module == null) { + throw new ServiceNotFoundException("Application module " + appModuleId + " does not exist"); + } + try { + return ApplicationModuleWithAccess.newBuilder() + .setApplicationModule(module) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(false) + .setUserHasWriteAccess(ctx.isGatewayAdmin()) + .build()) + .build(); + } catch (Exception e) { + throw new ServiceException("Error while computing application module access: " + e.getMessage(), e); + } + } + public boolean updateApplicationModule(RequestContext ctx, String appModuleId, ApplicationModule applicationModule) throws ServiceException { try { @@ -113,6 +150,60 @@ public List getAllAppModules(RequestContext ctx, String gatew } } + /** + * {@link #getAllAppModules} plus each module's caller-scoped access flags (additive). Reuses + * {@code getAllAppModules} for READ. Application modules are gateway-admin-managed catalog + * entries (no sharing entity), so every module carries the same flags: {@code is_owner} false + * and {@code user_has_write_access} the caller's gateway-admin status. + */ + public List getAllApplicationModulesWithAccess(RequestContext ctx, String gatewayId) + throws ServiceException { + List modules = getAllAppModules(ctx, gatewayId); + try { + AccessFlags access = AccessFlags.newBuilder() + .setIsOwner(false) + .setUserHasWriteAccess(ctx.isGatewayAdmin()) + .build(); + List result = new ArrayList<>(); + for (ApplicationModule module : modules) { + result.add(ApplicationModuleWithAccess.newBuilder() + .setApplicationModule(module) + .setAccess(access) + .build()); + } + return result; + } catch (Exception e) { + throw new ServiceException("Error while computing application module access: " + e.getMessage(), e); + } + } + + /** + * {@link #getAccessibleAppModules} plus each module's caller-scoped access flags (additive). + * Reuses {@code getAccessibleAppModules} for the accessible set; application modules are + * gateway-admin-managed catalog entries (no sharing entity), so every module carries the same + * flags: {@code is_owner} false and {@code user_has_write_access} the caller's gateway-admin status. + */ + public List getAccessibleApplicationModulesWithAccess( + RequestContext ctx, String gatewayId) throws ServiceException { + List modules = getAccessibleAppModules(ctx, gatewayId); + try { + AccessFlags access = AccessFlags.newBuilder() + .setIsOwner(false) + .setUserHasWriteAccess(ctx.isGatewayAdmin()) + .build(); + List result = new ArrayList<>(); + for (ApplicationModule module : modules) { + result.add(ApplicationModuleWithAccess.newBuilder() + .setApplicationModule(module) + .setAccess(access) + .build()); + } + return result; + } catch (Exception e) { + throw new ServiceException("Error while computing application module access: " + e.getMessage(), e); + } + } + public List getAccessibleAppModules(RequestContext ctx, String gatewayId) throws ServiceException { try { @@ -197,6 +288,90 @@ public ApplicationDeploymentDescription getApplicationDeployment(RequestContext } } + /** + * {@link #getApplicationDeployment} plus the caller's server-computed access flags (additive). + * Reuses {@code getApplicationDeployment} for READ enforcement so a caller can never + * self-authorize. Application deployments carry no owner field on the model — ownership lives + * in the sharing registry (see {@code registerApplicationDeployment}), so the flags are derived + * from the same sharing OWNER/WRITE checks the mutating operations use. + */ + public ApplicationDeploymentWithAccess getApplicationDeploymentWithAccess( + RequestContext ctx, String appDeploymentId) throws ServiceException { + ApplicationDeploymentDescription deployment = getApplicationDeployment(ctx, appDeploymentId); + if (deployment == null) { + throw new ServiceAuthorizationException("User does not have permission to access this resource"); + } + try { + return ApplicationDeploymentWithAccess.newBuilder() + .setApplicationDeployment(deployment) + .setAccess(computeDeploymentAccessFlags(ctx, appDeploymentId)) + .build(); + } catch (Exception e) { + throw new ServiceException("Error while computing application deployment access: " + e.getMessage(), e); + } + } + + /** + * Derives the caller's access flags for one deployment. Deployments are sharing entities (see + * {@code registerApplicationDeployment}), so {@code is_owner} is the caller's sharing OWNER grant + * and {@code user_has_write_access} the WRITE grant, both checked against {@code appDeploymentId}. + * When sharing is disabled both flags are false. + */ + private AccessFlags computeDeploymentAccessFlags(RequestContext ctx, String appDeploymentId) { + boolean isOwner = false; + boolean userHasWriteAccess = false; + if (SharingHelper.isSharingEnabled()) { + isOwner = SharingHelper.userHasAccess( + sharingHandler, ctx.getGatewayId(), ctx.getUserId(), appDeploymentId, + ResourcePermissionType.OWNER); + userHasWriteAccess = SharingHelper.userHasAccess( + sharingHandler, ctx.getGatewayId(), ctx.getUserId(), appDeploymentId, + ResourcePermissionType.WRITE); + } + return AccessFlags.newBuilder() + .setIsOwner(isOwner) + .setUserHasWriteAccess(userHasWriteAccess) + .build(); + } + + /** + * The deployment's effective batch queues: the deployment's compute resource's queues, with the + * deployment's default queue flagged ({@code is_default_queue}) and its default node/cpu/walltime + * applied. Reuses {@code getApplicationDeployment} for READ enforcement. Moves the queue-shaping + * join the portal does today onto the server. + */ + public List getApplicationDeploymentQueues(RequestContext ctx, String appDeploymentId) + throws ServiceException { + ApplicationDeploymentDescription deployment = getApplicationDeployment(ctx, appDeploymentId); + if (deployment == null) { + throw new ServiceNotFoundException("Application deployment " + appDeploymentId + " does not exist"); + } + try { + ComputeResourceDescription computeResource = + computeRegistry.getComputeResource(deployment.getComputeHostId()); + String defaultQueueName = deployment.getDefaultQueueName(); + List queues = new ArrayList<>(); + for (BatchQueue queue : computeResource.getBatchQueuesList()) { + if (!defaultQueueName.isEmpty()) { + if (defaultQueueName.equals(queue.getQueueName())) { + queue = queue.toBuilder() + .setIsDefaultQueue(true) + .setDefaultNodeCount(deployment.getDefaultNodeCount()) + .setDefaultCpuCount(deployment.getDefaultCpuCount()) + .setDefaultWalltime(deployment.getDefaultWalltime()) + .build(); + } else { + queue = queue.toBuilder().setIsDefaultQueue(false).build(); + } + } + queues.add(queue); + } + return queues; + } catch (Exception e) { + throw new ServiceException("Error while computing application deployment queues: " + e.getMessage(), e); + } + } + public boolean updateApplicationDeployment( RequestContext ctx, String appDeploymentId, ApplicationDeploymentDescription applicationDeployment) throws ServiceException { @@ -275,6 +450,45 @@ public List getAccessibleApplicationDeployment } } + /** + * {@link #getAllApplicationDeployments} plus each deployment's caller-scoped access flags + * (additive). Reuses {@code getAllApplicationDeployments} for READ, then derives per deployment + * the same sharing OWNER/WRITE flags {@code getApplicationDeploymentWithAccess} computes. + */ + public List getAllApplicationDeploymentsWithAccess( + RequestContext ctx, String gatewayId) throws ServiceException { + List deployments = getAllApplicationDeployments(ctx, gatewayId); + return toDeploymentsWithAccess(ctx, deployments); + } + + /** + * {@link #getAccessibleApplicationDeployments} plus each deployment's caller-scoped access flags + * (additive). Reuses {@code getAccessibleApplicationDeployments} for READ, then derives per + * deployment the same sharing OWNER/WRITE flags {@code getApplicationDeploymentWithAccess} computes. + */ + public List getAccessibleApplicationDeploymentsWithAccess( + RequestContext ctx, String gatewayId, ResourcePermissionType permissionType) throws ServiceException { + List deployments = + getAccessibleApplicationDeployments(ctx, gatewayId, permissionType); + return toDeploymentsWithAccess(ctx, deployments); + } + + private List toDeploymentsWithAccess( + RequestContext ctx, List deployments) throws ServiceException { + try { + List result = new ArrayList<>(); + for (ApplicationDeploymentDescription deployment : deployments) { + result.add(ApplicationDeploymentWithAccess.newBuilder() + .setApplicationDeployment(deployment) + .setAccess(computeDeploymentAccessFlags(ctx, deployment.getAppDeploymentId())) + .build()); + } + return result; + } catch (Exception e) { + throw new ServiceException("Error while computing application deployment access: " + e.getMessage(), e); + } + } + public List getAppModuleDeployedResources(RequestContext ctx, String appModuleId) throws ServiceException { try { return appCatalogRegistry.getAppModuleDeployedResources(appModuleId); @@ -375,6 +589,32 @@ public ApplicationInterfaceDescription getApplicationInterface(RequestContext ct } } + /** + * {@link #getApplicationInterface} plus the caller's server-computed access flags (additive). + * Reuses {@code getApplicationInterface} for READ enforcement so a caller can never self-authorize. + * Application interfaces are not sharing entities — {@code registerApplicationInterface} creates no + * sharing entity; they are gateway-admin-managed catalog entries. So {@code is_owner} is always + * false and {@code user_has_write_access} reflects the caller's gateway-admin status. + */ + public ApplicationInterfaceWithAccess getApplicationInterfaceWithAccess(RequestContext ctx, String appInterfaceId) + throws ServiceException { + ApplicationInterfaceDescription appInterface = getApplicationInterface(ctx, appInterfaceId); + if (appInterface == null) { + throw new ServiceNotFoundException("Application interface " + appInterfaceId + " does not exist"); + } + try { + return ApplicationInterfaceWithAccess.newBuilder() + .setApplicationInterface(appInterface) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(false) + .setUserHasWriteAccess(ctx.isGatewayAdmin()) + .build()) + .build(); + } catch (Exception e) { + throw new ServiceException("Error while computing application interface access: " + e.getMessage(), e); + } + } + public boolean updateApplicationInterface( RequestContext ctx, String appInterfaceId, ApplicationInterfaceDescription applicationInterface) throws ServiceException { @@ -411,6 +651,33 @@ public List getAllApplicationInterfaces(Request } } + /** + * {@link #getAllApplicationInterfaces} plus each interface's caller-scoped access flags (additive). + * Reuses {@code getAllApplicationInterfaces} for READ. Application interfaces are gateway-admin-managed + * catalog entries (no sharing entity), so every interface carries the same flags: {@code is_owner} + * false and {@code user_has_write_access} the caller's gateway-admin status. + */ + public List getAllApplicationInterfacesWithAccess( + RequestContext ctx, String gatewayId) throws ServiceException { + List interfaces = getAllApplicationInterfaces(ctx, gatewayId); + try { + AccessFlags access = AccessFlags.newBuilder() + .setIsOwner(false) + .setUserHasWriteAccess(ctx.isGatewayAdmin()) + .build(); + List result = new ArrayList<>(); + for (ApplicationInterfaceDescription appInterface : interfaces) { + result.add(ApplicationInterfaceWithAccess.newBuilder() + .setApplicationInterface(appInterface) + .setAccess(access) + .build()); + } + return result; + } catch (Exception e) { + throw new ServiceException("Error while computing application interface access: " + e.getMessage(), e); + } + } + public List getApplicationInputs(RequestContext ctx, String appInterfaceId) throws ServiceException { try { diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ExperimentService.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ExperimentService.java index fba7a666f7c..92d8abfb5ba 100644 --- a/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ExperimentService.java +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ExperimentService.java @@ -27,15 +27,36 @@ import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; +import org.apache.airavata.api.experiment.DataProductWithAccess; +import org.apache.airavata.api.experiment.ExperimentSpec; +import org.apache.airavata.api.experiment.ExperimentSummaryWithAccess; +import org.apache.airavata.api.experiment.ExperimentWithAccess; +import org.apache.airavata.api.experiment.FullExperiment; +import org.apache.airavata.api.project.ProjectWithAccess; import org.apache.airavata.config.RequestContext; import org.apache.airavata.exception.ServiceAuthorizationException; import org.apache.airavata.exception.ServiceException; import org.apache.airavata.exception.ServiceNotFoundException; import org.apache.airavata.interfaces.AppCatalogRegistry; +import org.apache.airavata.interfaces.ComputeRegistry; +import org.apache.airavata.interfaces.DataProductInterface; +import org.apache.airavata.interfaces.DataReplicaLocationInterface; import org.apache.airavata.interfaces.ExperimentRegistry; +import org.apache.airavata.interfaces.ExperimentStoragePrep; import org.apache.airavata.interfaces.ProjectRegistry; import org.apache.airavata.interfaces.SharingFacade; +import org.apache.airavata.model.appcatalog.appdeployment.proto.ApplicationModule; +import org.apache.airavata.model.appcatalog.appinterface.proto.ApplicationInterfaceDescription; +import org.apache.airavata.model.appcatalog.computeresource.proto.ComputeResourceDescription; +import org.apache.airavata.model.application.io.proto.DataType; +import org.apache.airavata.model.application.io.proto.InputDataObjectType; import org.apache.airavata.model.application.io.proto.OutputDataObjectType; +import org.apache.airavata.model.commons.proto.AccessFlags; +import org.apache.airavata.model.data.replica.proto.DataProductModel; +import org.apache.airavata.model.data.replica.proto.DataProductType; +import org.apache.airavata.model.data.replica.proto.DataReplicaLocationModel; +import org.apache.airavata.model.data.replica.proto.ReplicaLocationCategory; +import org.apache.airavata.model.data.replica.proto.ReplicaPersistentType; import org.apache.airavata.model.experiment.proto.ExperimentModel; import org.apache.airavata.model.experiment.proto.ExperimentSearchFields; import org.apache.airavata.model.experiment.proto.ExperimentStatistics; @@ -69,10 +90,19 @@ public class ExperimentService { private final ExperimentRegistry experimentRegistry; private final AppCatalogRegistry appCatalogRegistry; private final ProjectRegistry projectRegistry; + private final ComputeRegistry computeRegistry; + private final DataProductInterface dataProductInterface; + private final DataReplicaLocationInterface dataReplicaLocationInterface; private final SharingFacade sharingHandler; + private final ProjectService projectService; private final java.util.Optional launchOrchestrator; private GroupResourceProfileListProvider groupResourceProfileListProvider; + // Filesystem-only launch-prep SPI (storage-service impl, setter-injected via composition in + // ServiceWiringConfig). Nullable: when unset, launchExperiment skips server-side prep so the + // thick SDK can keep prepping client-side during the migration (additive + idempotent). + private ExperimentStoragePrep storagePrep; + /** * Functional interface for providing accessible group resource profiles. * This decouples ExperimentService from the concrete GroupResourceProfileService @@ -88,12 +118,20 @@ public ExperimentService( ExperimentRegistry experimentRegistry, AppCatalogRegistry appCatalogRegistry, ProjectRegistry projectRegistry, + ComputeRegistry computeRegistry, + DataProductInterface dataProductInterface, + DataReplicaLocationInterface dataReplicaLocationInterface, SharingFacade sharingHandler, + ProjectService projectService, java.util.Optional launchOrchestrator) { this.experimentRegistry = experimentRegistry; this.appCatalogRegistry = appCatalogRegistry; this.projectRegistry = projectRegistry; + this.computeRegistry = computeRegistry; + this.dataProductInterface = dataProductInterface; + this.dataReplicaLocationInterface = dataReplicaLocationInterface; this.sharingHandler = sharingHandler; + this.projectService = projectService; this.launchOrchestrator = launchOrchestrator; } @@ -101,6 +139,10 @@ public void setGroupResourceProfileListProvider(GroupResourceProfileListProvider this.groupResourceProfileListProvider = groupResourceProfileListProvider; } + public void setExperimentStoragePrep(ExperimentStoragePrep storagePrep) { + this.storagePrep = storagePrep; + } + public String createExperiment(RequestContext ctx, ExperimentModel experiment) throws ServiceException { try { String experimentId = experimentRegistry.createExperiment(ctx.getGatewayId(), experiment); @@ -132,6 +174,116 @@ public String createExperiment(RequestContext ctx, ExperimentModel experiment) t } } + /** + * {@link #createExperiment} that returns the created experiment joined with the caller's access + * flags (additive). Delegates the create to {@code createExperiment}, then reuses {@code + * getExperimentWithAccess} as the single source of truth for the flags — the caller is the owner + * of what it just created, so {@code is_owner}/{@code user_has_write_access} are true by ownership. + */ + public ExperimentWithAccess createExperimentWithAccess(RequestContext ctx, ExperimentModel experiment) + throws ServiceException { + String experimentId = createExperiment(ctx, experiment); + return getExperimentWithAccess(ctx, experimentId); + } + + /** + * Creates a single experiment from a declarative {@link ExperimentSpec}. Fetches the app interface + * to wire spec inputs against declared interface inputs (unknown input names → IllegalArgumentException), + * copies the interface outputs, builds scheduling + user configuration, and delegates to + * {@link #createExperiment} before returning the WithAccess wrapper. + * + *

Empty {@code project_id} or {@code application_interface_id} in the spec → IllegalArgumentException + * (maps to INVALID_ARGUMENT via the gRPC adapter). Storage ids are left empty when the spec omits + * them — launch-time prep defaults them. + */ + public ExperimentWithAccess createExperimentFromSpec(RequestContext ctx, ExperimentSpec spec) + throws ServiceException { + if (spec.getProjectId().isEmpty()) { + throw new IllegalArgumentException("project_id must not be empty"); + } + if (spec.getApplicationInterfaceId().isEmpty()) { + throw new IllegalArgumentException("application_interface_id must not be empty"); + } + + try { + ApplicationInterfaceDescription appInterface = + appCatalogRegistry.getApplicationInterface(spec.getApplicationInterfaceId()); + + // Build a name-indexed map of declared interface inputs for fast lookup and validation. + Map declaredInputsByName = new java.util.LinkedHashMap<>(); + for (InputDataObjectType declared : appInterface.getApplicationInputsList()) { + declaredInputsByName.put(declared.getName(), declared); + } + + // Validate: every key in spec.inputs must be a declared input name. + for (String specInputName : spec.getInputsMap().keySet()) { + if (!declaredInputsByName.containsKey(specInputName)) { + throw new IllegalArgumentException( + "Input '" + specInputName + "' is not declared on application interface " + + spec.getApplicationInterfaceId()); + } + } + + // Wire spec input values onto declared inputs (declared order preserved; value only + // overridden when the spec supplies one for this input name). + List experimentInputs = new ArrayList<>(); + for (InputDataObjectType declared : appInterface.getApplicationInputsList()) { + String specValue = spec.getInputsMap().get(declared.getName()); + if (specValue != null) { + experimentInputs.add(declared.toBuilder().setValue(specValue).build()); + } else { + experimentInputs.add(declared); + } + } + + // Outputs: copy directly from the interface. + List experimentOutputs = + new ArrayList<>(appInterface.getApplicationOutputsList()); + + // Build scheduling model. + ComputationalResourceSchedulingModel scheduling = ComputationalResourceSchedulingModel.newBuilder() + .setResourceHostId(spec.getResource().getComputeResourceId()) + .setNodeCount(spec.getResource().getNodeCount()) + .setTotalCpuCount(spec.getResource().getTotalCpuCount()) + .setQueueName(spec.getResource().getQueueName()) + .setWallTimeLimit(spec.getResource().getWallTimeLimit()) + .build(); + + // Build user configuration. + UserConfigurationDataModel userConfig = UserConfigurationDataModel.newBuilder() + .setComputationalResourceScheduling(scheduling) + .setGroupResourceProfileId(spec.getResource().getGroupResourceProfileId()) + .setInputStorageResourceId(spec.getResource().getInputStorageResourceId()) + .setOutputStorageResourceId(spec.getResource().getOutputStorageResourceId()) + .setAiravataAutoSchedule(spec.getResource().getAutoSchedule()) + .build(); + + // Build the experiment model. + ExperimentModel experiment = ExperimentModel.newBuilder() + .setExperimentName(spec.getExperimentName()) + .setProjectId(spec.getProjectId()) + .setGatewayId(ctx.getGatewayId()) + .setUserName(ctx.getUserId()) + .setExecutionId(spec.getApplicationInterfaceId()) + .setExperimentType( + org.apache.airavata.model.experiment.proto.ExperimentType.SINGLE_APPLICATION) + .setDescription(spec.getDescription()) + .addAllExperimentInputs(experimentInputs) + .addAllExperimentOutputs(experimentOutputs) + .setUserConfigurationData(userConfig) + .build(); + + String experimentId = createExperiment(ctx, experiment); + return getExperimentWithAccess(ctx, experimentId); + } catch (IllegalArgumentException e) { + throw e; + } catch (ServiceException e) { + throw e; + } catch (Exception e) { + throw new ServiceException("Error while creating experiment from spec: " + e.getMessage(), e); + } + } + public ExperimentModel getExperiment(RequestContext ctx, String experimentId) throws ServiceException { try { ExperimentModel experiment = experimentRegistry.getExperiment(experimentId); @@ -163,6 +315,210 @@ public ExperimentModel getExperiment(RequestContext ctx, String experimentId) th } } + /** + * {@link #getExperiment} plus the caller's server-computed access flags (additive). Reuses + * {@code getExperiment} for READ enforcement so a caller can never self-authorize; the flags are + * derived from the same owner-field and {@link #userHasWriteAccess} sharing WRITE check the + * mutating operations use. + */ + public ExperimentWithAccess getExperimentWithAccess(RequestContext ctx, String experimentId) + throws ServiceException { + ExperimentModel experiment = getExperiment(ctx, experimentId); + if (experiment == null) { + // Sharing disabled and the caller is not the owner: no access. + throw new ServiceAuthorizationException("User does not have permission to access this resource"); + } + try { + boolean isOwner = ctx.getUserId().equals(experiment.getUserName()) + && ctx.getGatewayId().equals(experiment.getGatewayId()); + boolean userHasWriteAccess = isOwner; + if (!isOwner && SharingHelper.isSharingEnabled()) { + userHasWriteAccess = userHasWriteAccess(ctx, experimentId); + } + return ExperimentWithAccess.newBuilder() + .setExperiment(experiment) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(isOwner) + .setUserHasWriteAccess(userHasWriteAccess) + .build()) + .build(); + } catch (Exception e) { + throw new ServiceException("Error while computing experiment access: " + e.getMessage(), e); + } + } + + /** + * The experiment joined with every related entity a viewer needs in one round-trip — access + * flags, owning project, application module/interface, compute resource, resolved input/output + * data products, and job details (additive). This server-side composition replaces the multi-RPC + * join the Python SDK does today, so any client gets the same shaped result. READ enforcement and + * the access flags are inherited from {@link #getExperimentWithAccess}; every related reference is + * best-effort and left unset when it does not apply or cannot be resolved. + */ + public FullExperiment getFullExperiment(RequestContext ctx, String experimentId) throws ServiceException { + // READ enforcement + access flags (throws when the caller has no access). + ExperimentWithAccess experimentEnv = getExperimentWithAccess(ctx, experimentId); + ExperimentModel experiment = experimentEnv.getExperiment(); + try { + FullExperiment.Builder full = + FullExperiment.newBuilder().setExperiment(experiment).setAccess(experimentEnv.getAccess()); + + // Referenced data products: outputs first, then inputs (matches the SDK ordering). + full.addAllOutputDataProducts( + resolveDataProducts(ctx, collectOutputUris(experiment.getExperimentOutputsList()))); + full.addAllInputDataProducts( + resolveDataProducts(ctx, collectInputUris(experiment.getExperimentInputsList()))); + + // Application interface (execution id) → first module. + ApplicationInterfaceDescription applicationInterface = null; + try { + applicationInterface = appCatalogRegistry.getApplicationInterface(experiment.getExecutionId()); + } catch (Exception e) { + logger.debug( + "Could not resolve application interface {} for experiment {}", + experiment.getExecutionId(), + experimentId); + } + if (applicationInterface != null) { + full.setApplicationInterface(applicationInterface); + if (applicationInterface.getApplicationModulesCount() > 0) { + try { + ApplicationModule module = + appCatalogRegistry.getApplicationModule(applicationInterface.getApplicationModules(0)); + if (module != null) { + full.setApplicationModule(module); + } + } catch (Exception e) { + logger.debug("Could not resolve application module for experiment {}", experimentId); + } + } + } + + // Compute resource from the scheduling host id, when set. + if (experiment.hasUserConfigurationData() + && experiment.getUserConfigurationData().hasComputationalResourceScheduling()) { + String resourceHostId = experiment + .getUserConfigurationData() + .getComputationalResourceScheduling() + .getResourceHostId(); + if (!resourceHostId.isEmpty()) { + try { + ComputeResourceDescription computeResource = computeRegistry.getComputeResource(resourceHostId); + if (computeResource != null) { + full.setComputeResource(computeResource); + } + } catch (Exception e) { + logger.debug( + "Could not resolve compute resource {} for experiment {}", + resourceHostId, + experimentId); + } + } + } + + // Owning project, only when the caller may READ it (best-effort). + Project project = resolveReadableProject(ctx, experiment.getProjectId()); + if (project != null) { + full.setProject(project); + } + + // Flat job list. + full.addAllJobs(experimentRegistry.getJobDetails(experimentId)); + + return full.build(); + } catch (Exception e) { + throw new ServiceException("Error while composing full experiment: " + e.getMessage(), e); + } + } + + private List collectOutputUris(List outputs) { + List single = new ArrayList<>(); + List collection = new ArrayList<>(); + for (OutputDataObjectType o : outputs) { + collectUri(single, collection, o.getValue(), o.getType()); + } + single.addAll(collection); + return single; + } + + private List collectInputUris(List inputs) { + List single = new ArrayList<>(); + List collection = new ArrayList<>(); + for (InputDataObjectType i : inputs) { + collectUri(single, collection, i.getValue(), i.getType()); + } + single.addAll(collection); + return single; + } + + // airavata-dp URIs referenced by an IO proto: single-URI types (URI/STDOUT/STDERR) contribute + // their value; URI_COLLECTION contributes each comma-separated member. Single URIs precede + // collection members, matching the SDK ordering. + private void collectUri(List single, List collection, String value, DataType type) { + if (value == null || value.isEmpty() || !value.startsWith("airavata-dp")) { + return; + } + if (type == DataType.URI || type == DataType.STDOUT || type == DataType.STDERR) { + single.add(value); + } else if (type == DataType.URI_COLLECTION) { + for (String member : value.split(",")) { + if (!member.isEmpty()) { + collection.add(member); + } + } + } + } + + // The project if the caller may READ it (owner or sharing READ), else null. Mirrors the + // enforcement in getExperimentsInProject; swallows resolution errors for best-effort use. + private Project resolveReadableProject(RequestContext ctx, String projectId) { + try { + Project project = projectRegistry.getProject(projectId); + if (project == null) { + return null; + } + boolean isOwner = ctx.getUserId().equals(project.getOwner()) + && ctx.getGatewayId().equals(project.getGatewayId()); + if (isOwner || !SharingHelper.isSharingEnabled()) { + return project; + } + String qualifiedUserId = ctx.getUserId() + "@" + ctx.getGatewayId(); + if (sharingHandler.userHasAccess( + ctx.getGatewayId(), qualifiedUserId, projectId, ctx.getGatewayId() + ":READ")) { + return project; + } + return null; + } catch (Exception e) { + logger.debug("Could not resolve project {}: {}", projectId, e.getMessage()); + return null; + } + } + + private List resolveDataProducts(RequestContext ctx, List uris) { + List resolved = new ArrayList<>(); + for (String uri : uris) { + try { + DataProductModel product = dataProductInterface.getDataProduct(uri); + if (product == null) { + continue; + } + // No sharing entity exists for data products, so access falls back to ownership. + boolean isOwner = !product.getOwnerName().isEmpty() + && product.getOwnerName().equals(ctx.getUserId()); + resolved.add(DataProductWithAccess.newBuilder() + .setDataProduct(product) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(isOwner) + .setUserHasWriteAccess(isOwner) + .build()) + .build()); + } catch (Exception e) { + logger.debug("Could not resolve data product {}: {}", uri, e.getMessage()); + } + } + return resolved; + } + public boolean deleteExperiment(RequestContext ctx, String experimentId) throws ServiceException { try { ExperimentModel experiment = experimentRegistry.getExperiment(experimentId); @@ -294,6 +650,46 @@ public List searchExperiments( } } + /** + * {@link #searchExperiments} plus each item's caller-relative access flags (additive). Reuses + * {@code searchExperiments} for READ enforcement (it restricts results to sharing-accessible ids), + * then computes per-item flags against the CALLER ({@link RequestContext#getUserId()}/{@link + * RequestContext#getGatewayId()}): {@code is_owner} via the summary's owner fields, {@code + * user_has_write_access} via the same sharing WRITE check the mutating operations use. Per-item + * sharing calls run server-side, replacing N client round-trips. + */ + public List searchExperimentsWithAccess( + RequestContext ctx, + String gatewayId, + String userName, + Map filters, + int limit, + int offset) + throws ServiceException { + List summaries = searchExperiments(ctx, gatewayId, userName, filters, limit, offset); + try { + List results = new ArrayList<>(summaries.size()); + for (ExperimentSummaryModel summary : summaries) { + boolean isOwner = ctx.getUserId().equals(summary.getUserName()) + && ctx.getGatewayId().equals(summary.getGatewayId()); + boolean userHasWriteAccess = isOwner; + if (!isOwner && SharingHelper.isSharingEnabled()) { + userHasWriteAccess = userHasWriteAccess(ctx, summary.getExperimentId()); + } + results.add(ExperimentSummaryWithAccess.newBuilder() + .setSummary(summary) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(isOwner) + .setUserHasWriteAccess(userHasWriteAccess) + .build()) + .build()); + } + return results; + } catch (Exception e) { + throw new ServiceException("Error while computing experiment search access: " + e.getMessage(), e); + } + } + public ExperimentStatus getExperimentStatus(RequestContext ctx, String experimentId) throws ServiceException { try { return experimentRegistry.getExperimentStatus(experimentId); @@ -397,6 +793,142 @@ public String cloneExperiment( } } + /** + * Composite clone for thin clients: resolve a writable target project, reuse {@link #cloneExperiment} for + * the DB-level copy, copy each referenced input file into a fresh tmp upload (rewriting the input value, + * dropping inputs whose source file is gone), null the data dir, persist, and return the new experiment + * with the caller's access flags. Composes existing units (cloneExperiment / updateExperiment / + * getExperimentWithAccess / storage copyFile / data-product register) — mirrors the Python SDK's + * experiment_orchestration.clone(). + */ + public ExperimentWithAccess cloneExperimentWithInputFiles( + RequestContext ctx, String experimentId, String newExperimentName, String newExperimentProjectId) + throws ServiceException { + try { + ExperimentModel source = getExperiment(ctx, experimentId); + if (source == null) { + throw new ServiceNotFoundException("Experiment " + experimentId + " does not exist"); + } + String targetProjectId = resolveWritableProjectId(ctx, source, newExperimentProjectId); + String name = (newExperimentName != null && !newExperimentName.isEmpty()) + ? newExperimentName + : "Clone of " + source.getExperimentName(); + + String clonedId = cloneExperiment(ctx, experimentId, name, targetProjectId, false); + + ExperimentModel cloned = experimentRegistry.getExperiment(clonedId); + ExperimentModel withCopiedInputs = copyClonedExperimentInputUris(ctx, cloned); + // Null experiment_data_dir so a fresh one is created at launch time. + ExperimentModel finalModel = withCopiedInputs.toBuilder() + .setUserConfigurationData(withCopiedInputs.getUserConfigurationData().toBuilder() + .setExperimentDataDir("") + .build()) + .build(); + updateExperiment(ctx, clonedId, finalModel); + return getExperimentWithAccess(ctx, clonedId); + } catch (ServiceException e) { + throw e; + } catch (Exception e) { + throw new ServiceException("Error cloning experiment with input files: " + e.getMessage(), e); + } + } + + // The requested project when supplied (cloneExperiment verifies its WRITE access); else the source's + // project when writable; else the caller's most-recent writable project. Mirrors the SDK's + // _get_writeable_project. + private String resolveWritableProjectId(RequestContext ctx, ExperimentModel source, String requestedProjectId) + throws ServiceException { + if (requestedProjectId != null && !requestedProjectId.isEmpty()) { + return requestedProjectId; + } + String qualifiedUserId = ctx.getUserId() + "@" + ctx.getGatewayId(); + String sourceProjectId = source.getProjectId(); + try { + if (sharingHandler.userHasAccess( + ctx.getGatewayId(), qualifiedUserId, sourceProjectId, ctx.getGatewayId() + ":WRITE")) { + return sourceProjectId; + } + } catch (Exception e) { + logger.debug("Write-access check on source project {} failed: {}", sourceProjectId, e.getMessage()); + } + ProjectWithAccess writable = + projectService.getMostRecentWritableProject(ctx, ctx.getGatewayId(), ctx.getUserId()); + return writable.getProject().getProjectId(); + } + + // Rebuild the experiment inputs with each URI / URI_COLLECTION value copied into a fresh tmp upload + // (missing source files dropped for URI, omitted for URI_COLLECTION). Mirrors the SDK's + // _copy_cloned_experiment_input_uris. + private ExperimentModel copyClonedExperimentInputUris(RequestContext ctx, ExperimentModel cloned) { + ExperimentModel.Builder builder = cloned.toBuilder().clearExperimentInputs(); + for (InputDataObjectType input : cloned.getExperimentInputsList()) { + InputDataObjectType.Builder inputBuilder = input.toBuilder(); + String value = input.getValue(); + if (value != null && !value.isEmpty()) { + if (input.getType() == DataType.URI) { + String copied = copyExperimentInputUri(ctx, value); + inputBuilder.setValue(copied != null ? copied : ""); + } else if (input.getType() == DataType.URI_COLLECTION) { + List copiedUris = new java.util.ArrayList<>(); + for (String uri : value.split(",")) { + if (uri.isEmpty()) { + continue; + } + String copied = copyExperimentInputUri(ctx, uri); + if (copied != null) { + copiedUris.add(copied); + } + } + inputBuilder.setValue(String.join(",", copiedUris)); + } + } + builder.addExperimentInputs(inputBuilder.build()); + } + return builder.build(); + } + + // Copy one input data product's file into a fresh tmp upload (native storage copyFile, no + // download/upload round-trip) and register a new data product, returning its URI; null when the source + // file is gone. Mirrors the SDK's _copy_experiment_input_uri. + private String copyExperimentInputUri(RequestContext ctx, String dataProductUri) { + try { + DataProductModel source = dataProductInterface.getDataProduct(dataProductUri); + if (source == null) { + return null; + } + DataReplicaLocationModel replica = gatewayDataStoreReplica(source); + String srcPath = replicaFilesystemPath(replica); + String storageId = replica != null ? replica.getStorageResourceId() : ""; + if (srcPath == null || !storagePrep.fileExists(storageId, srcPath)) { + logger.warn("Could not find file for source data product {}; dropping cloned input", dataProductUri); + return null; + } + String fileName = !source.getProductName().isEmpty() ? source.getProductName() : basename(srcPath); + String destPath = joinStoragePath(TMP_INPUT_FILE_UPLOAD_DIR, fileName); + storagePrep.copyFile(storageId, srcPath, destPath); + + DataReplicaLocationModel newReplica = DataReplicaLocationModel.newBuilder() + .setStorageResourceId(storageId == null ? "" : storageId) + .setReplicaName(fileName + " gateway data store copy") + .setReplicaLocationCategory(ReplicaLocationCategory.GATEWAY_DATA_STORE) + .setReplicaPersistentType(ReplicaPersistentType.TRANSIENT) + .setFilePath(destPath) + .build(); + DataProductModel copy = DataProductModel.newBuilder() + .setGatewayId(ctx.getGatewayId()) + .setOwnerName(ctx.getUserId()) + .setProductName(fileName) + .setDataProductType(DataProductType.FILE) + .putAllProductMetadata(source.getProductMetadataMap()) + .addReplicaLocations(newReplica) + .build(); + return dataProductInterface.registerDataProduct(copy); + } catch (Exception e) { + logger.warn("Could not copy input data product {} for clone: {}", dataProductUri, e.getMessage()); + return null; + } + } + public ExperimentStatistics getExperimentStatistics( RequestContext ctx, String gatewayId, @@ -421,6 +953,9 @@ public List getExperimentsInProject(RequestContext ctx, String throws ServiceException { try { Project project = projectRegistry.getProject(projectId); + if (project == null) { + throw new ServiceNotFoundException("Project " + projectId + " does not exist"); + } if (SharingHelper.isSharingEnabled() && (!ctx.getUserId().equals(project.getOwner()) || !ctx.getGatewayId().equals(project.getGatewayId()))) { @@ -438,6 +973,40 @@ public List getExperimentsInProject(RequestContext ctx, String } } + /** + * {@link #getExperimentsInProject} plus each item's caller-relative access flags (additive). + * Reuses {@code getExperimentsInProject} for READ enforcement, then computes per-item flags + * against the CALLER ({@link RequestContext#getUserId()}/{@link RequestContext#getGatewayId()}): + * {@code is_owner} via the experiment's owner field, {@code user_has_write_access} via the same + * sharing WRITE check the mutating operations use. Per-item sharing calls run server-side, + * replacing N client round-trips; a batch optimization is a noted follow-up. + */ + public List getExperimentsInProjectWithAccess( + RequestContext ctx, String projectId, int limit, int offset) throws ServiceException { + List experiments = getExperimentsInProject(ctx, projectId, limit, offset); + try { + List results = new ArrayList<>(experiments.size()); + for (ExperimentModel experiment : experiments) { + boolean isOwner = ctx.getUserId().equals(experiment.getUserName()) + && ctx.getGatewayId().equals(experiment.getGatewayId()); + boolean userHasWriteAccess = isOwner; + if (!isOwner && SharingHelper.isSharingEnabled()) { + userHasWriteAccess = userHasWriteAccess(ctx, experiment.getExperimentId()); + } + results.add(ExperimentWithAccess.newBuilder() + .setExperiment(experiment) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(isOwner) + .setUserHasWriteAccess(userHasWriteAccess) + .build()) + .build()); + } + return results; + } catch (Exception e) { + throw new ServiceException("Error while computing experiment access in project: " + e.getMessage(), e); + } + } + public List getUserExperiments( RequestContext ctx, String gatewayId, String userName, int limit, int offset) throws ServiceException { try { @@ -488,6 +1057,17 @@ public void updateExperiment(RequestContext ctx, String experimentId, Experiment } } + /** + * {@link #updateExperiment} that returns the updated experiment joined with the caller's access + * flags (additive). Delegates the update (with its WRITE enforcement) to {@code updateExperiment}, + * then reuses {@code getExperimentWithAccess} as the single source of truth for the flags. + */ + public ExperimentWithAccess updateExperimentWithAccess( + RequestContext ctx, String experimentId, ExperimentModel experiment) throws ServiceException { + updateExperiment(ctx, experimentId, experiment); + return getExperimentWithAccess(ctx, experimentId); + } + public void updateExperimentConfiguration( RequestContext ctx, String experimentId, UserConfigurationDataModel userConfiguration) throws ServiceException { @@ -630,6 +1210,263 @@ public ProcessStatus getIntermediateOutputProcessStatus( } } + // Directory (relative to the user's storage root) where freshly uploaded input files land + // before they are moved into a launched experiment's data directory. Mirrors the SDK's + // TMP_INPUT_FILE_UPLOAD_DIR. + private static final String TMP_INPUT_FILE_UPLOAD_DIR = "tmp"; + + /** + * Server-side port of the Python SDK's pre-launch preparation + * ({@code _set_storage_id_and_data_dir} + {@code _move_tmp_input_file_uploads_to_data_dir}). + * Finalizes input/output storage ids and the experiment data dir on the user configuration, + * relocates any tmp-resident input uploads into the data dir (repointing the replica in place so + * the data-product URI — and thus the input value string — is preserved), persists the updated + * configuration, and returns the experiment refreshed with it. Additive and idempotent: empty + * fields are filled, already-set values are kept, and an already-moved file (present at the + * destination, absent at the source) is treated as a no-op move. + */ + private ExperimentModel prepareExperimentForLaunch(String experimentId, ExperimentModel experiment) + throws Exception { + UserConfigurationDataModel.Builder configBuilder = experiment.getUserConfigurationData().toBuilder(); + + // 3a STORAGE IDS: default input/output storage to the gateway default, but only when empty + // (idempotent; never clobber a non-empty value). Resolve the default LAZILY — only when a + // storage id is actually missing — so a fully pre-configured experiment can launch even on a + // gateway with no default storage preference. + if (configBuilder.getInputStorageResourceId().isEmpty() + || configBuilder.getOutputStorageResourceId().isEmpty()) { + String defaultId = storagePrep.getDefaultStorageResourceId(); + if (configBuilder.getInputStorageResourceId().isEmpty()) { + configBuilder.setInputStorageResourceId(defaultId); + } + if (configBuilder.getOutputStorageResourceId().isEmpty()) { + configBuilder.setOutputStorageResourceId(defaultId); + } + } + + // The experiment_data_dir and the relocated inputs live on the effective input storage. + String storageId = configBuilder.getInputStorageResourceId(); + + // 3b DATA DIR: derive "/" (sanitized) when unset, creating the directory + // and storing the BARE-RELATIVE path (DataStagingTask anchors it at staging time); if already + // set, ensure the existing dir exists and keep its value (never re-derive, never 2nd dir). + if (configBuilder.getExperimentDataDir().isEmpty()) { + Project project = projectRegistry.getProject(experiment.getProjectId()); + String relPath = sanitizePathComponent(project != null ? project.getName() : "") + "/" + + sanitizePathComponent(experiment.getExperimentName()); + String created = storagePrep.ensureDir(storageId, relPath); + configBuilder.setExperimentDataDir(created); + } else { + storagePrep.ensureDir(storageId, configBuilder.getExperimentDataDir()); + } + + // 3c RELOCATE TMP UPLOADS: move any URI / URI_COLLECTION input that is a tmp upload into the + // data dir, repointing the replica's file_path in place (preserving the data-product URI, so + // the input value string is unchanged). + String experimentDataDir = configBuilder.getExperimentDataDir(); + String inputStorageId = configBuilder.getInputStorageResourceId(); + for (InputDataObjectType input : experiment.getExperimentInputsList()) { + String value = input.getValue(); + if (value == null || value.isEmpty()) { + continue; + } + if (input.getType() == DataType.URI) { + if (value.startsWith(DataProductInterface.schema)) { + relocateTmpInputUpload(value, experimentDataDir, inputStorageId); + } + } else if (input.getType() == DataType.URI_COLLECTION) { + for (String member : value.split(",")) { + if (!member.isEmpty() && member.startsWith(DataProductInterface.schema)) { + relocateTmpInputUpload(member, experimentDataDir, inputStorageId); + } + } + } + } + + // 3d PERSIST: store the updated configuration and refresh the in-memory experiment. Input + // URI values are preserved (repoint-in-place), so no updateExperiment is needed. + UserConfigurationDataModel updatedConfig = configBuilder.build(); + experimentRegistry.updateExperimentConfiguration(experimentId, updatedConfig); + return experiment.toBuilder().setUserConfigurationData(updatedConfig).build(); + } + + /** + * If the data product referenced by {@code dataProductUri} is a tmp upload, relocate its bytes + * into the experiment data dir and repoint the replica's file_path in place. Best-effort: never + * fails the launch (a missing/unidentifiable replica is logged and skipped). + */ + private void relocateTmpInputUpload(String dataProductUri, String experimentDataDir, String storageId) { + try { + DataProductModel dataProduct = dataProductInterface.getDataProduct(dataProductUri); + if (dataProduct == null) { + return; + } + DataReplicaLocationModel replica = gatewayDataStoreReplica(dataProduct); + String srcPath = replicaFilesystemPath(replica); + if (srcPath == null) { + logger.warn("No replica file path for data product {}; skipping move", dataProductUri); + return; + } + // tmp upload iff the file's parent directory basename is the tmp upload dir. + boolean isTmp = TMP_INPUT_FILE_UPLOAD_DIR.equals(basename(dirname(srcPath))); + if (!isTmp) { + return; + } + + String fileName = + !dataProduct.getProductName().isEmpty() ? dataProduct.getProductName() : basename(srcPath); + String dstPath = joinStoragePath(experimentDataDir, fileName); + + // Idempotency guard: if the destination already exists and the source no longer does, + // the bytes were already moved by a prior (e.g. client-side) prep — just repoint. + boolean alreadyMoved = + storagePrep.fileExists(storageId, dstPath) && !storagePrep.fileExists(storageId, srcPath); + if (!alreadyMoved) { + storagePrep.moveFile(storageId, srcPath, dstPath); + } + + // Repoint the replica's file_path to the new location, preserving the data-product URI. + if (!replica.getReplicaId().isEmpty()) { + DataReplicaLocationModel updatedReplica = + replica.toBuilder().setFilePath(dstPath).build(); + dataReplicaLocationInterface.updateReplicaLocation(updatedReplica); + } else { + logger.warn( + "Replica for data product {} has no replica_id; moved bytes but could not repoint replica file_path", + dataProductUri); + } + } catch (Exception e) { + // Never fail launch on a single input relocation: log and continue. + logger.warn("Could not relocate tmp input upload {}: {}", dataProductUri, e.getMessage()); + } + } + + private static String sanitizePathComponent(String name) { + return (name == null ? "" : name).trim().replace(" ", "_"); + } + + // The GATEWAY_DATA_STORE replica, or the first replica, or null. + private static DataReplicaLocationModel gatewayDataStoreReplica(DataProductModel dataProduct) { + DataReplicaLocationModel first = null; + for (DataReplicaLocationModel replica : dataProduct.getReplicaLocationsList()) { + if (first == null) { + first = replica; + } + if (replica.getReplicaLocationCategory() == ReplicaLocationCategory.GATEWAY_DATA_STORE) { + return replica; + } + } + return first; + } + + // The plain filesystem path from a replica's file_path (which may be stored as + // file://: or URL-encoded). Ports the SDK's unquote(urlparse(path).path). + private static String replicaFilesystemPath(DataReplicaLocationModel replica) { + if (replica == null || replica.getFilePath().isEmpty()) { + return null; + } + return urlDecode(urlPath(replica.getFilePath())); + } + + // Extract the path component the way Python's urlparse(...).path does: for a value with a + // "scheme://netloc" prefix, drop the scheme and netloc (everything up to the first '/' after the + // "//"); for a bare path, return it unchanged. Query/fragment are not expected on storage paths. + private static String urlPath(String value) { + int schemeSep = value.indexOf("://"); + if (schemeSep < 0) { + return value; + } + int netlocStart = schemeSep + 3; + int pathStart = value.indexOf('/', netlocStart); + return pathStart < 0 ? "" : value.substring(pathStart); + } + + // Percent-decode like Python's urllib.parse.unquote: only %XX escapes are decoded (UTF-8); a + // literal '+' is preserved (unlike java.net.URLDecoder, which would turn it into a space and + // corrupt filenames containing '+'). + private static String urlDecode(String value) { + if (value.indexOf('%') < 0) { + return value; + } + java.io.ByteArrayOutputStream bytes = new java.io.ByteArrayOutputStream(); + for (int i = 0; i < value.length(); ) { + char c = value.charAt(i); + if (c == '%' && i + 2 < value.length()) { + int hi = Character.digit(value.charAt(i + 1), 16); + int lo = Character.digit(value.charAt(i + 2), 16); + if (hi >= 0 && lo >= 0) { + bytes.write((hi << 4) + lo); + i += 3; + continue; + } + } + // Not a valid escape: emit the character's UTF-8 bytes verbatim. + byte[] cb = String.valueOf(c).getBytes(java.nio.charset.StandardCharsets.UTF_8); + bytes.write(cb, 0, cb.length); + i++; + } + return new String(bytes.toByteArray(), java.nio.charset.StandardCharsets.UTF_8); + } + + // basename/dirname matching Python's os.path semantics for the forward-slash paths used here. + private static String basename(String path) { + if (path == null) { + return ""; + } + int slash = path.lastIndexOf('/'); + return slash < 0 ? path : path.substring(slash + 1); + } + + private static String dirname(String path) { + if (path == null) { + return ""; + } + int slash = path.lastIndexOf('/'); + return slash < 0 ? "" : path.substring(0, slash); + } + + private static String joinStoragePath(String directory, String name) { + if (directory == null || directory.isEmpty()) { + return name; + } + String trimmed = directory; + while (trimmed.endsWith("/")) { + trimmed = trimmed.substring(0, trimmed.length() - 1); + } + return trimmed + "/" + name; + } + + /** + * Composite launch for thin clients: when the experiment has email notifications enabled, override its + * recipients to the launching user's address ({@code notificationEmail}) before launching. The storage + * setup (default storage ids, data-dir creation, tmp-upload relocation) and all authorization run inside + * {@link #launchExperiment}, so this only adds the email override and delegates — replacing the portal's + * get/update/launch round-trip (Python SDK experiment_orchestration.launch()). + */ + public void launchExperimentWithStorageSetup( + RequestContext ctx, String experimentId, String gatewayId, String notificationEmail) + throws ServiceException { + try { + ExperimentModel experiment = experimentRegistry.getExperiment(experimentId); + if (experiment == null) { + throw new ServiceException("Experiment " + experimentId + " does not exist"); + } + if (experiment.getEnableEmailNotification() && notificationEmail != null && !notificationEmail.isEmpty()) { + experimentRegistry.updateExperiment( + experimentId, + experiment.toBuilder() + .clearEmailAddresses() + .addEmailAddresses(notificationEmail) + .build()); + } + launchExperiment(ctx, experimentId, gatewayId); + } catch (ServiceException e) { + throw e; + } catch (Exception e) { + throw new ServiceException("Error launching experiment " + experimentId + ": " + e.getMessage(), e); + } + } + public void launchExperiment(RequestContext ctx, String experimentId, String gatewayId) throws ServiceException { try { ExperimentModel experiment = experimentRegistry.getExperiment(experimentId); @@ -637,6 +1474,15 @@ public void launchExperiment(RequestContext ctx, String experimentId, String gat throw new ServiceException("Experiment " + experimentId + " does not exist"); } + // Server-side launch-prep: finalize storage ids + data dir and relocate tmp input + // uploads into the data dir, mirroring the Python SDK's pre-launch preparation. Runs + // before the GRP backfill so the orchestrator sees the finalized model. Guarded by a + // null check: during the SDK migration the thick SDK still preps client-side, so this + // must no-op (or repeat idempotently) when the work is already done. + if (storagePrep != null) { + experiment = prepareExperimentForLaunch(experimentId, experiment); + } + // For backwards compatibility, if there is no groupResourceProfileId, pick one if (experiment .getUserConfigurationData() diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ExperimentSetService.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ExperimentSetService.java new file mode 100644 index 00000000000..dcf23a917fd --- /dev/null +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ExperimentSetService.java @@ -0,0 +1,381 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.service; + +import com.google.protobuf.util.JsonFormat; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.stream.Stream; +import org.apache.airavata.api.experiment.ExperimentSpec; +import org.apache.airavata.api.experiment.ExperimentWithAccess; +import org.apache.airavata.api.experimentset.AggregateState; +import org.apache.airavata.api.experimentset.CreateExperimentSetRequest; +import org.apache.airavata.api.experimentset.ExperimentSet; +import org.apache.airavata.api.experimentset.ExperimentSetStatus; +import org.apache.airavata.api.experimentset.ExperimentStatusItem; +import org.apache.airavata.api.experimentset.SweepSpec; +import org.apache.airavata.api.experimentset.ValueList; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.exception.ServiceException; +import org.apache.airavata.model.experiment.proto.ExperimentModel; +import org.apache.airavata.model.process.proto.ProcessModel; +import org.apache.airavata.model.status.proto.ExperimentStatus; +import org.apache.airavata.research.model.ExperimentSetEntity; +import org.apache.airavata.research.model.ExperimentSetMemberEntity; +import org.apache.airavata.research.repository.ExperimentSetRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +@Service +public class ExperimentSetService { + + private static final Logger logger = LoggerFactory.getLogger(ExperimentSetService.class); + + private final ExperimentService experimentService; + private final ExperimentSetRepository experimentSetRepository; + + public ExperimentSetService(ExperimentService experimentService, ExperimentSetRepository experimentSetRepository) { + this.experimentService = experimentService; + this.experimentSetRepository = experimentSetRepository; + } + + /** + * Create an experiment set from a {@link CreateExperimentSetRequest}. + * + *

For {@code sweep} source: expands the axes (cartesian product), builds one {@link ExperimentSpec} + * per combination with overridden inputs and a name of {@code name_prefix + "_" + index}, calls + * {@link ExperimentService#createExperimentFromSpec} for each. If any call throws, all already-created + * child experiments are deleted (best-effort) and the exception is rethrown without persisting the set. + * + *

For {@code existing} source: validates each experiment id via {@link ExperimentService#getExperiment}, + * then groups them into a set. + */ + public ExperimentSet createExperimentSet(RequestContext ctx, CreateExperimentSetRequest req) + throws ServiceException { + return switch (req.getSourceCase()) { + case SWEEP -> createFromSweep(ctx, req.getSetName(), req.getSweep()); + case EXISTING -> createFromExisting(ctx, req.getSetName(), req.getExisting().getExperimentIdsList()); + default -> throw new IllegalArgumentException("CreateExperimentSetRequest must set a source (sweep or existing)"); + }; + } + + private ExperimentSet createFromSweep(RequestContext ctx, String setName, SweepSpec sweep) + throws ServiceException { + + // Build the base input map from the base spec + Map base = new LinkedHashMap<>(sweep.getBase().getInputsMap()); + + // Build axis map (preserving proto map iteration order is best-effort; LinkedHashMap from proto is unspecified, + // but the cartesian product is deterministic per run given the same axes order) + Map> axes = new LinkedHashMap<>(); + for (Map.Entry entry : sweep.getSweepAxesMap().entrySet()) { + axes.put(entry.getKey(), entry.getValue().getValuesList()); + } + + List> combinations = SweepExpander.expand(base, axes); + + String namePrefix = sweep.getNamePrefix(); + List createdIds = new ArrayList<>(combinations.size()); + + try { + for (int i = 0; i < combinations.size(); i++) { + Map combo = combinations.get(i); + ExperimentSpec spec = buildSpecFromCombo(sweep.getBase(), combo, namePrefix + "_" + i); + ExperimentWithAccess created = experimentService.createExperimentFromSpec(ctx, spec); + createdIds.add(created.getExperiment().getExperimentId()); + } + } catch (Exception e) { + // Rollback: delete already-created experiments best-effort + for (String id : createdIds) { + try { + experimentService.deleteExperiment(ctx, id); + } catch (Exception ex) { + logger.warn("Failed to delete experiment {} during sweep rollback: {}", id, ex.getMessage()); + } + } + if (e instanceof ServiceException se) { + throw se; + } + throw new ServiceException("Sweep expansion failed mid-way: " + e.getMessage(), e); + } + + // Serialize the sweep spec for auditing + String sweepSpecJson = ""; + try { + sweepSpecJson = JsonFormat.printer().print(sweep); + } catch (Exception e) { + logger.warn("Failed to serialize sweep spec to JSON: {}", e.getMessage()); + } + + ExperimentSetEntity entity = buildEntity(setName, ctx.getUserId(), ctx.getGatewayId(), createdIds, sweepSpecJson); + ExperimentSetEntity saved = experimentSetRepository.save(entity); + + return toProto(saved, sweep); + } + + private ExperimentSet createFromExisting(RequestContext ctx, String setName, List experimentIds) + throws ServiceException { + // Validate each id exists and is accessible + for (String id : experimentIds) { + experimentService.getExperiment(ctx, id); + } + + ExperimentSetEntity entity = buildEntity(setName, ctx.getUserId(), ctx.getGatewayId(), experimentIds, null); + ExperimentSetEntity saved = experimentSetRepository.save(entity); + + return toProto(saved, null); + } + + private ExperimentSpec buildSpecFromCombo(ExperimentSpec base, Map combo, String name) { + ExperimentSpec.Builder builder = base.toBuilder() + .setExperimentName(name) + .clearInputs(); + // Start with base inputs, then override with combo values + Map merged = new LinkedHashMap<>(base.getInputsMap()); + merged.putAll(combo); + builder.putAllInputs(merged); + return builder.build(); + } + + private ExperimentSetEntity buildEntity( + String setName, + String owner, + String gatewayId, + List experimentIds, + String sweepSpecJson) { + ExperimentSetEntity entity = new ExperimentSetEntity(); + entity.setSetName(setName); + entity.setOwner(owner); + entity.setGatewayId(gatewayId); + entity.setSweepSpecJson(sweepSpecJson); + + List members = new ArrayList<>(experimentIds.size()); + for (int i = 0; i < experimentIds.size(); i++) { + ExperimentSetMemberEntity member = new ExperimentSetMemberEntity(); + member.setExperimentId(experimentIds.get(i)); + member.setOrdinal(i); + member.setExperimentSet(entity); + members.add(member); + } + entity.setMembers(members); + return entity; + } + + /** + * Launch all member experiments in the set (best-effort). A failure on one child is logged + * and counted but does not abort the remaining launches or propagate to the caller. + * Owner-scoped: throws {@link NoSuchElementException} (→ NOT_FOUND) when the set does not + * exist or belongs to a different user. + */ + public ExperimentSet launchExperimentSet(RequestContext ctx, String setId, String notificationEmail) { + ExperimentSetEntity entity = loadOwned(ctx, setId); + int failures = 0; + for (ExperimentSetMemberEntity member : entity.getMembers()) { + String experimentId = member.getExperimentId(); + try { + experimentService.launchExperimentWithStorageSetup(ctx, experimentId, ctx.getGatewayId(), notificationEmail); + } catch (Exception e) { + failures++; + logger.warn("Failed to launch experiment {} in set {}: {}", experimentId, setId, e.getMessage()); + } + } + if (failures > 0) { + logger.info("Launched experiment set {} with {} child failure(s) out of {} members", + setId, failures, entity.getMembers().size()); + } + return toProto(entity, null); + } + + /** Owner-scoped fetch of a single experiment set. */ + public ExperimentSet getExperimentSet(RequestContext ctx, String setId) { + return toProto(loadOwned(ctx, setId), null); + } + + /** + * List all experiment sets owned by the caller in the current gateway, newest first. + * {@code limit <= 0} means no limit; {@code offset} skips that many leading results. + */ + public List listExperimentSets(RequestContext ctx, int limit, int offset) { + List all = experimentSetRepository.findByOwnerAndGatewayIdOrderByCreatedAtDesc( + ctx.getUserId(), ctx.getGatewayId()); + + Stream stream = all.stream().skip(Math.max(0, offset)); + if (limit > 0) { + stream = stream.limit(limit); + } + return stream.map(e -> toProto(e, null)).toList(); + } + + /** + * Delete an experiment set and its member rows (cascade). Does NOT delete the child experiments + * themselves — a set is a grouping, not an owner of the experiments. + */ + public void deleteExperimentSet(RequestContext ctx, String setId) { + loadOwned(ctx, setId); + experimentSetRepository.deleteById(setId); + } + + /** + * Return per-experiment states and an aggregate for the set. + * Owner-scoped. For each member, calls {@link ExperimentService#getExperiment} and reads the + * latest {@link ExperimentStatus} (last element of the list) to get the current state name. + */ + public ExperimentSetStatus getExperimentSetStatus(RequestContext ctx, String setId) throws ServiceException { + ExperimentSetEntity entity = loadOwned(ctx, setId); + + List stateNames = new ArrayList<>(); + Map countsByState = new LinkedHashMap<>(); + List items = new ArrayList<>(); + + for (ExperimentSetMemberEntity member : entity.getMembers()) { + String experimentId = member.getExperimentId(); + ExperimentModel experiment = experimentService.getExperiment(ctx, experimentId); + + // Latest status is the last element; fall back to UNKNOWN when the experiment is + // inaccessible (null) or has no statuses yet. + String stateName; + String processId = ""; + if (experiment == null) { + stateName = "EXPERIMENT_STATE_UNKNOWN"; + } else { + List statuses = experiment.getExperimentStatusList(); + if (statuses.isEmpty()) { + stateName = "EXPERIMENT_STATE_UNKNOWN"; + } else { + stateName = statuses.get(statuses.size() - 1).getState().name(); + } + // First process id, if any + if (experiment.getProcessesCount() > 0) { + processId = experiment.getProcesses(0).getProcessId(); + } + } + stateNames.add(stateName); + countsByState.merge(stateName, 1, Integer::sum); + + items.add(ExperimentStatusItem.newBuilder() + .setExperimentId(experimentId) + .setState(stateName) + .setProcessId(processId) + .build()); + } + + return ExperimentSetStatus.newBuilder() + .setExperimentSetId(setId) + .setTotal(items.size()) + .putAllCountsByState(countsByState) + .setAggregate(aggregate(stateNames)) + .addAllItems(items) + .build(); + } + + /** + * Compute an {@link AggregateState} from a list of {@code ExperimentState} enum name strings. + * + *

Bucket mapping (enum names from {@code org.apache.airavata.model.status.ExperimentState}): + *

    + *
  • TERMINAL_COMPLETE : EXPERIMENT_STATE_COMPLETED + *
  • TERMINAL_FAILURE : EXPERIMENT_STATE_FAILED, EXPERIMENT_STATE_CANCELED + *
  • RUNNING : EXPERIMENT_STATE_EXECUTING, EXPERIMENT_STATE_LAUNCHED, EXPERIMENT_STATE_SCHEDULED + *
  • PRE_RUN : EXPERIMENT_STATE_CREATED, EXPERIMENT_STATE_VALIDATED, EXPERIMENT_STATE_UNKNOWN, EXPERIMENT_STATE_CANCELING + *
+ * Rules (evaluated in order): + *
    + *
  1. empty list → QUEUED + *
  2. all TERMINAL_COMPLETE → COMPLETED + *
  3. all TERMINAL_FAILURE → FAILED + *
  4. any RUNNING (and no TERMINAL_COMPLETE, any mix of PRE_RUN / TERMINAL_FAILURE tolerated) → RUNNING + *
  5. all PRE_RUN (CREATED/VALIDATED/UNKNOWN) → QUEUED + *
  6. otherwise → MIXED + *
+ */ + public static AggregateState aggregate(List stateNames) { + if (stateNames.isEmpty()) { + return AggregateState.QUEUED; + } + + // Terminal-complete bucket + Set terminalComplete = Set.of("EXPERIMENT_STATE_COMPLETED"); + // Terminal-failure bucket + Set terminalFailure = Set.of("EXPERIMENT_STATE_FAILED", "EXPERIMENT_STATE_CANCELED"); + // Running bucket (executing, launched, or scheduled) + Set running = Set.of( + "EXPERIMENT_STATE_EXECUTING", + "EXPERIMENT_STATE_LAUNCHED", + "EXPERIMENT_STATE_SCHEDULED"); + + boolean hasComplete = stateNames.stream().anyMatch(terminalComplete::contains); + boolean hasFailure = stateNames.stream().anyMatch(terminalFailure::contains); + boolean hasRunning = stateNames.stream().anyMatch(running::contains); + boolean allComplete = stateNames.stream().allMatch(terminalComplete::contains); + boolean allFailure = stateNames.stream().allMatch(terminalFailure::contains); + boolean allPreRun = stateNames.stream().noneMatch(s -> + terminalComplete.contains(s) || terminalFailure.contains(s) || running.contains(s)); + + if (allComplete) return AggregateState.COMPLETED; + if (allFailure) return AggregateState.FAILED; + if (hasRunning && !hasComplete) return AggregateState.RUNNING; + if (allPreRun) return AggregateState.QUEUED; + return AggregateState.MIXED; + } + + /** Load a set by id and assert the caller owns it within the same gateway; throws {@link NoSuchElementException} otherwise. */ + private ExperimentSetEntity loadOwned(RequestContext ctx, String setId) { + ExperimentSetEntity entity = experimentSetRepository.findById(setId) + .orElseThrow(() -> new NoSuchElementException("ExperimentSet not found: " + setId)); + if (!entity.getOwner().equals(ctx.getUserId()) || !entity.getGatewayId().equals(ctx.getGatewayId())) { + throw new NoSuchElementException("ExperimentSet not found: " + setId); + } + return entity; + } + + private ExperimentSet toProto(ExperimentSetEntity entity, SweepSpec sweep) { + ExperimentSet.Builder builder = ExperimentSet.newBuilder() + .setExperimentSetId(entity.getId() != null ? entity.getId() : "") + .setSetName(entity.getSetName()) + .setOwner(entity.getOwner()) + .setGatewayId(entity.getGatewayId()); + + // Add experiment ids in ordinal order + List members = entity.getMembers(); + if (members != null) { + members.stream() + .sorted(java.util.Comparator.comparingInt(ExperimentSetMemberEntity::getOrdinal)) + .forEach(m -> builder.addExperimentIds(m.getExperimentId())); + } + + if (sweep != null) { + builder.setSweep(sweep); + } + + if (entity.getCreatedAt() != null) { + builder.setCreationTime(entity.getCreatedAt().toEpochMilli()); + } + if (entity.getUpdatedAt() != null) { + builder.setUpdatedTime(entity.getUpdatedAt().toEpochMilli()); + } + + return builder.build(); + } +} diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/NotificationService.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/NotificationService.java index 77242265455..b6bf56e1652 100644 --- a/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/NotificationService.java +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/NotificationService.java @@ -19,10 +19,14 @@ */ package org.apache.airavata.research.service; +import java.util.ArrayList; import java.util.List; +import org.apache.airavata.api.notification.GetAllNotificationsWithAccessResponse; +import org.apache.airavata.api.notification.NotificationWithAccess; import org.apache.airavata.config.RequestContext; import org.apache.airavata.exception.ServiceException; import org.apache.airavata.interfaces.ProjectRegistry; +import org.apache.airavata.model.commons.proto.AccessFlags; import org.apache.airavata.model.workspace.proto.Notification; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -80,4 +84,54 @@ public List getAllNotifications(RequestContext ctx, String gateway throw new ServiceException("Error while getting all notifications: " + e.getMessage(), e); } } + + /** + * {@link #getNotification} plus the caller's server-computed access flags (additive). Reuses + * {@code getNotification} for READ enforcement so a caller can never self-authorize. Notifications + * are gateway-level broadcast entities with no owner/sharing entity, so is_owner is always false + * and user_has_write_access reflects the caller's gateway-admin role. + */ + public NotificationWithAccess getNotificationWithAccess( + RequestContext ctx, String gatewayId, String notificationId) throws ServiceException { + Notification notification = getNotification(ctx, gatewayId, notificationId); + try { + return NotificationWithAccess.newBuilder() + .setNotification(notification) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(false) + .setUserHasWriteAccess(ctx.isGatewayAdmin()) + .build()) + .build(); + } catch (Exception e) { + throw new ServiceException("Error while computing notification access: " + e.getMessage(), e); + } + } + + /** + * {@link #getAllNotifications} plus each notification's caller-scoped access flags (additive). + * Reuses {@code getAllNotifications} for READ enforcement, then stamps the same gateway-admin + * flags for the CALLER ({@code ctx}) on every notification. + */ + public GetAllNotificationsWithAccessResponse getAllNotificationsWithAccess(RequestContext ctx, String gatewayId) + throws ServiceException { + List notifications = getAllNotifications(ctx, gatewayId); + try { + AccessFlags access = AccessFlags.newBuilder() + .setIsOwner(false) + .setUserHasWriteAccess(ctx.isGatewayAdmin()) + .build(); + List result = new ArrayList<>(notifications.size()); + for (Notification notification : notifications) { + result.add(NotificationWithAccess.newBuilder() + .setNotification(notification) + .setAccess(access) + .build()); + } + return GetAllNotificationsWithAccessResponse.newBuilder() + .addAllNotifications(result) + .build(); + } catch (Exception e) { + throw new ServiceException("Error while computing notification access: " + e.getMessage(), e); + } + } } diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ProjectService.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ProjectService.java index a688295d6b7..27df7b67c1f 100644 --- a/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ProjectService.java +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/ProjectService.java @@ -24,12 +24,14 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.apache.airavata.api.project.ProjectWithAccess; import org.apache.airavata.config.RequestContext; import org.apache.airavata.exception.ServiceAuthorizationException; import org.apache.airavata.exception.ServiceException; import org.apache.airavata.exception.ServiceNotFoundException; import org.apache.airavata.interfaces.ProjectRegistry; import org.apache.airavata.interfaces.SharingFacade; +import org.apache.airavata.model.commons.proto.AccessFlags; import org.apache.airavata.model.experiment.proto.ProjectSearchFields; import org.apache.airavata.model.workspace.proto.Project; import org.apache.airavata.sharing.registry.models.proto.EntitySearchField; @@ -84,6 +86,18 @@ public String createProject(RequestContext ctx, String gatewayId, Project projec } } + /** + * {@link #createProject} plus the new project's caller-scoped access flags (additive). Reuses + * {@code createProject} for the create + sharing-entity work, then reuses + * {@code getProjectWithAccess} to derive flags from a single source of truth. The creator is the + * owner, so the recomputed flags are {@code is_owner=true} / {@code user_has_write_access=true}. + */ + public ProjectWithAccess createProjectWithAccess(RequestContext ctx, String gatewayId, Project project) + throws ServiceException { + String projectId = createProject(ctx, gatewayId, project); + return getProjectWithAccess(ctx, projectId); + } + public void updateProject(RequestContext ctx, String projectId, Project updatedProject) throws ServiceException { try { Project existingProject = projectRegistry.getProject(projectId); @@ -121,6 +135,17 @@ public void updateProject(RequestContext ctx, String projectId, Project updatedP } } + /** + * {@link #updateProject} plus the project's caller-scoped access flags (additive). Reuses + * {@code updateProject} for the WRITE-enforced mutation, then reuses {@code getProjectWithAccess} + * to derive flags from a single source of truth. + */ + public ProjectWithAccess updateProjectWithAccess(RequestContext ctx, String projectId, Project updatedProject) + throws ServiceException { + updateProject(ctx, projectId, updatedProject); + return getProjectWithAccess(ctx, projectId); + } + public boolean deleteProject(RequestContext ctx, String projectId) throws ServiceException { try { Project existingProject = projectRegistry.getProject(projectId); @@ -180,8 +205,47 @@ public Project getProject(RequestContext ctx, String projectId) throws ServiceEx } } + /** + * {@link #getProject} plus the caller's server-computed access flags (additive). Reuses + * {@code getProject} for READ enforcement so a caller can never self-authorize; the flags are + * derived from the same owner-field and sharing WRITE checks the mutating operations use. + */ + public ProjectWithAccess getProjectWithAccess(RequestContext ctx, String projectId) throws ServiceException { + Project project = getProject(ctx, projectId); + if (project == null) { + // Sharing disabled and the caller is not the owner: no access. + throw new ServiceAuthorizationException("User does not have permission to access this resource"); + } + try { + boolean isOwner = ctx.getUserId().equals(project.getOwner()) + && ctx.getGatewayId().equals(project.getGatewayId()); + boolean userHasWriteAccess = isOwner; + if (!isOwner && SharingHelper.isSharingEnabled()) { + String qualifiedUserId = ctx.getUserId() + "@" + ctx.getGatewayId(); + userHasWriteAccess = sharingHandler.userHasAccess( + ctx.getGatewayId(), qualifiedUserId, projectId, ctx.getGatewayId() + ":WRITE"); + } + return ProjectWithAccess.newBuilder() + .setProject(project) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(isOwner) + .setUserHasWriteAccess(userHasWriteAccess) + .build()) + .build(); + } catch (ServiceException e) { + throw e; + } catch (Exception e) { + throw new ServiceException("Error while computing project access: " + e.getMessage(), e); + } + } + public List getUserProjects(RequestContext ctx, String gatewayId, String userName, int limit, int offset) throws ServiceException { + // Authorization is bound to the authenticated caller, never the request's user_name / gateway_id + // (which a caller could otherwise substitute to read another user's project list). The params are + // retained for API shape but the listing is always the caller's own accessible projects. + String callerId = ctx.getUserId(); + String callerGateway = ctx.getGatewayId(); try { if (SharingHelper.isSharingEnabled()) { List accessibleProjectIds = new ArrayList<>(); @@ -189,24 +253,108 @@ public List getUserProjects(RequestContext ctx, String gatewayId, Strin filters.add(SearchCriteria.newBuilder() .setSearchField(EntitySearchField.ENTITY_TYPE_ID) .setSearchCondition(SearchCondition.EQUAL) - .setValue(gatewayId + ":PROJECT") + .setValue(callerGateway + ":PROJECT") .build()); accessibleProjectIds.addAll( - sharingHandler.searchEntityIds(gatewayId, userName + "@" + gatewayId, filters, 0, -1)); + sharingHandler.searchEntityIds(callerGateway, callerId + "@" + callerGateway, filters, 0, -1)); if (accessibleProjectIds.isEmpty()) { return Collections.emptyList(); } return projectRegistry.searchProjects( - gatewayId, userName, accessibleProjectIds, new HashMap<>(), limit, offset); + callerGateway, callerId, accessibleProjectIds, new HashMap<>(), limit, offset); } else { - return projectRegistry.getUserProjects(gatewayId, userName, limit, offset); + return projectRegistry.getUserProjects(callerGateway, callerId, limit, offset); } } catch (Exception e) { throw new ServiceException("Error while retrieving projects: " + e.getMessage(), e); } } + /** + * {@link #getUserProjects} plus each project's caller-scoped access flags (additive). Reuses + * {@code getUserProjects} for READ enforcement, then computes flags for EACH project against the + * CALLER ({@code ctx}) — never against the path {@code userName} — so the flags describe the + * caller's own access. The portal calls this for the current user; when the path {@code userName} + * differs from {@code ctx.getUserId()} the per-item flags still reflect the caller, as intended. + */ + public List getUserProjectsWithAccess( + RequestContext ctx, String gatewayId, String userName, int limit, int offset) throws ServiceException { + List projects = getUserProjects(ctx, gatewayId, userName, limit, offset); + try { + List result = new ArrayList<>(projects.size()); + boolean sharingEnabled = SharingHelper.isSharingEnabled(); + String qualifiedUserId = ctx.getUserId() + "@" + ctx.getGatewayId(); + for (Project project : projects) { + boolean isOwner = ctx.getUserId().equals(project.getOwner()) + && ctx.getGatewayId().equals(project.getGatewayId()); + boolean userHasWriteAccess = isOwner; + if (!isOwner && sharingEnabled) { + userHasWriteAccess = sharingHandler.userHasAccess( + ctx.getGatewayId(), qualifiedUserId, project.getProjectId(), ctx.getGatewayId() + ":WRITE"); + } + result.add(ProjectWithAccess.newBuilder() + .setProject(project) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(isOwner) + .setUserHasWriteAccess(userHasWriteAccess) + .build()) + .build()); + } + return result; + } catch (Exception e) { + throw new ServiceException("Error while computing project access: " + e.getMessage(), e); + } + } + + /** + * The caller's most-recently-created WRITE-accessible project (additive). Reuses + * {@code getUserProjects} for the caller-bound candidate set, then keeps only projects the + * caller can WRITE — owner, or (sharing enabled) holder of a WRITE grant — and returns the one + * with the greatest creation time. Flags are always computed for the CALLER ({@code ctx}), never + * the path {@code userName}. Throws {@link ServiceNotFoundException} (maps to NOT_FOUND) when the + * caller has no writable project. + */ + public ProjectWithAccess getMostRecentWritableProject(RequestContext ctx, String gatewayId, String userName) + throws ServiceException { + // limit=-1 / offset=0 is the codebase's unbounded convention; (0, -1) would return zero rows. + List projects = getUserProjects(ctx, gatewayId, userName, -1, 0); + Project mostRecent = null; + boolean mostRecentIsOwner = false; + try { + boolean sharingEnabled = SharingHelper.isSharingEnabled(); + String qualifiedUserId = ctx.getUserId() + "@" + ctx.getGatewayId(); + for (Project project : projects) { + boolean isOwner = ctx.getUserId().equals(project.getOwner()) + && ctx.getGatewayId().equals(project.getGatewayId()); + boolean writeable = isOwner; + if (!isOwner && sharingEnabled) { + writeable = sharingHandler.userHasAccess( + ctx.getGatewayId(), qualifiedUserId, project.getProjectId(), ctx.getGatewayId() + ":WRITE"); + } + if (!writeable) { + continue; + } + if (mostRecent == null || project.getCreationTime() > mostRecent.getCreationTime()) { + mostRecent = project; + mostRecentIsOwner = isOwner; + } + } + } catch (Exception e) { + throw new ServiceException("Error while computing project access: " + e.getMessage(), e); + } + if (mostRecent == null) { + throw new ServiceNotFoundException("No writable project found for the caller"); + } + return ProjectWithAccess.newBuilder() + .setProject(mostRecent) + .setAccess(AccessFlags.newBuilder() + .setIsOwner(mostRecentIsOwner) + .setUserHasWriteAccess(true) + .build()) + .build(); + } + public List searchProjects( RequestContext ctx, String gatewayId, diff --git a/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/SweepExpander.java b/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/SweepExpander.java new file mode 100644 index 00000000000..5fc24468c78 --- /dev/null +++ b/airavata-api/research-service/src/main/java/org/apache/airavata/research/service/SweepExpander.java @@ -0,0 +1,79 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Pure cartesian-product expander for sweep axes. No Spring dependencies — trivially unit-testable. + * + *

{@link #expand} returns the cartesian product of all axis value lists, each combination merged + * onto a copy of the base map (axis values override base keys with the same name). Iteration order + * follows the insertion order of {@code axes} (matches Python's {@code itertools.product}). + */ +public class SweepExpander { + + private SweepExpander() {} + + /** + * Expand {@code axes} into all combinations, each merged onto a copy of {@code base}. + * + * @param base the baseline key-value map carried into every combination + * @param axes axis name → ordered list of values; must be a {@link java.util.LinkedHashMap} + * or any insertion-ordered map for deterministic product ordering + * @return list of maps, one per combination (axis values override matching base keys) + */ + public static List> expand(Map base, Map> axes) { + if (axes.isEmpty()) { + Map copy = new HashMap<>(base); + return List.of(copy); + } + + // Convert axes to parallel arrays for indexed iteration + List axisNames = new ArrayList<>(axes.keySet()); + List> axisValues = new ArrayList<>(); + for (String name : axisNames) { + axisValues.add(axes.get(name)); + } + + // Iterative cartesian product: start with one empty combo, extend one axis at a time + List> combos = new ArrayList<>(); + combos.add(new HashMap<>(base)); + + for (int i = 0; i < axisNames.size(); i++) { + String axisName = axisNames.get(i); + List values = axisValues.get(i); + List> expanded = new ArrayList<>(combos.size() * values.size()); + for (Map combo : combos) { + for (String value : values) { + Map next = new HashMap<>(combo); + next.put(axisName, value); + expanded.add(next); + } + } + combos = expanded; + } + + return combos; + } +} diff --git a/airavata-api/research-service/src/main/proto/application_catalog_service.proto b/airavata-api/research-service/src/main/proto/application_catalog_service.proto index 28a6b3bd0b3..ee63842a1fb 100644 --- a/airavata-api/research-service/src/main/proto/application_catalog_service.proto +++ b/airavata-api/research-service/src/main/proto/application_catalog_service.proto @@ -28,6 +28,7 @@ import "org/apache/airavata/model/appcatalog/appdeployment/app_deployment.proto" import "org/apache/airavata/model/appcatalog/appinterface/app_interface.proto"; import "org/apache/airavata/model/appcatalog/computeresource/compute_resource.proto"; import "org/apache/airavata/model/application/io/application_io.proto"; +import "org/apache/airavata/model/commons/commons.proto"; // ApplicationCatalogService provides RPCs for managing application modules, // deployments, and interfaces. @@ -48,6 +49,15 @@ service ApplicationCatalogService { }; } + // Additive: GetApplicationModule plus the caller's server-computed access flags, so a client + // does not recompute access from a separate round-trip. Application modules are gateway-admin- + // managed catalog entries (no sharing entity), so the flags reflect gateway-admin status. + rpc GetApplicationModuleWithAccess(GetApplicationModuleRequest) returns (ApplicationModuleWithAccess) { + option (google.api.http) = { + get: "/api/v1/app-modules/{app_module_id}:withAccess" + }; + } + rpc UpdateApplicationModule(UpdateApplicationModuleRequest) returns (google.protobuf.Empty) { option (google.api.http) = { put: "/api/v1/app-modules/{app_module_id}" @@ -67,12 +77,26 @@ service ApplicationCatalogService { }; } + // Additive: GetAllAppModules plus each module's caller-scoped access flags (see above). + rpc GetAllApplicationModulesWithAccess(GetAllAppModulesRequest) returns (GetAllApplicationModulesWithAccessResponse) { + option (google.api.http) = { + get: "/api/v1/app-modules:withAccess" + }; + } + rpc GetAccessibleAppModules(GetAccessibleAppModulesRequest) returns (GetAccessibleAppModulesResponse) { option (google.api.http) = { get: "/api/v1/app-modules:accessible" }; } + // Additive: GetAccessibleAppModules plus each module's caller-scoped access flags. + rpc GetAccessibleApplicationModulesWithAccess(GetAccessibleAppModulesRequest) returns (GetAccessibleApplicationModulesWithAccessResponse) { + option (google.api.http) = { + get: "/api/v1/app-modules:accessibleWithAccess" + }; + } + // --- Application Deployments --- rpc RegisterApplicationDeployment(RegisterApplicationDeploymentRequest) returns (RegisterApplicationDeploymentResponse) { @@ -88,6 +112,23 @@ service ApplicationCatalogService { }; } + // Additive: GetApplicationDeployment plus the caller's server-computed access + // flags, so a client does not recompute access from a separate sharing round-trip. + rpc GetApplicationDeploymentWithAccess(GetApplicationDeploymentRequest) returns (ApplicationDeploymentWithAccess) { + option (google.api.http) = { + get: "/api/v1/app-deployments/{app_deployment_id}:withAccess" + }; + } + + // The effective batch queues for this deployment: the deployment's compute resource's + // queues, with the deployment's default queue flagged and its default node/cpu/walltime + // overrides applied. Moves the queue-shaping join the portal does today onto the server. + rpc GetApplicationDeploymentQueues(GetApplicationDeploymentRequest) returns (GetApplicationDeploymentQueuesResponse) { + option (google.api.http) = { + get: "/api/v1/app-deployments/{app_deployment_id}/queues" + }; + } + rpc UpdateApplicationDeployment(UpdateApplicationDeploymentRequest) returns (google.protobuf.Empty) { option (google.api.http) = { put: "/api/v1/app-deployments/{app_deployment_id}" @@ -107,12 +148,29 @@ service ApplicationCatalogService { }; } + // Additive: GetAllApplicationDeployments plus each deployment's caller-scoped access flags (see + // GetApplicationDeploymentWithAccess). Deployments are sharing entities, so the per-item flags + // reflect the caller's sharing OWNER/WRITE grants on each deployment. + rpc GetAllApplicationDeploymentsWithAccess(GetAllApplicationDeploymentsRequest) returns (GetAllApplicationDeploymentsWithAccessResponse) { + option (google.api.http) = { + get: "/api/v1/app-deployments:withAccess" + }; + } + rpc GetAccessibleApplicationDeployments(GetAccessibleApplicationDeploymentsRequest) returns (GetAccessibleApplicationDeploymentsResponse) { option (google.api.http) = { get: "/api/v1/app-deployments:accessible" }; } + // Additive: GetAccessibleApplicationDeployments plus each deployment's caller-scoped access flags + // (see above). + rpc GetAccessibleApplicationDeploymentsWithAccess(GetAccessibleApplicationDeploymentsRequest) returns (GetAccessibleApplicationDeploymentsWithAccessResponse) { + option (google.api.http) = { + get: "/api/v1/app-deployments:accessibleWithAccess" + }; + } + rpc GetAppModuleDeployedResources(GetAppModuleDeployedResourcesRequest) returns (GetAppModuleDeployedResourcesResponse) { option (google.api.http) = { get: "/api/v1/app-modules/{app_module_id}/deployed-resources" @@ -146,6 +204,15 @@ service ApplicationCatalogService { }; } + // Additive: GetApplicationInterface plus the caller's server-computed access flags, so a client + // does not recompute access from a separate round-trip. Application interfaces are gateway-admin- + // managed catalog entries (no sharing entity), so the flags reflect gateway-admin status. + rpc GetApplicationInterfaceWithAccess(GetApplicationInterfaceRequest) returns (ApplicationInterfaceWithAccess) { + option (google.api.http) = { + get: "/api/v1/app-interfaces/{app_interface_id}:withAccess" + }; + } + rpc UpdateApplicationInterface(UpdateApplicationInterfaceRequest) returns (google.protobuf.Empty) { option (google.api.http) = { put: "/api/v1/app-interfaces/{app_interface_id}" @@ -171,6 +238,13 @@ service ApplicationCatalogService { }; } + // Additive: GetAllApplicationInterfaces plus each interface's caller-scoped access flags (see above). + rpc GetAllApplicationInterfacesWithAccess(GetAllApplicationInterfacesRequest) returns (GetAllApplicationInterfacesWithAccessResponse) { + option (google.api.http) = { + get: "/api/v1/app-interfaces:withAccess" + }; + } + rpc GetApplicationInputs(GetApplicationInputsRequest) returns (GetApplicationInputsResponse) { option (google.api.http) = { get: "/api/v1/app-interfaces/{app_interface_id}/inputs" @@ -222,6 +296,20 @@ message GetAllAppModulesResponse { repeated org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule application_modules = 1; } +// An ApplicationModule unioned with the caller's access flags (see commons.AccessFlags). +message ApplicationModuleWithAccess { + org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule application_module = 1; + org.apache.airavata.model.commons.AccessFlags access = 2; +} + +message GetAllApplicationModulesWithAccessResponse { + repeated ApplicationModuleWithAccess modules = 1; +} + +message GetAccessibleApplicationModulesWithAccessResponse { + repeated ApplicationModuleWithAccess modules = 1; +} + message GetAccessibleAppModulesRequest { string gateway_id = 1; } @@ -245,6 +333,18 @@ message GetApplicationDeploymentRequest { string app_deployment_id = 1; } +// An ApplicationDeploymentDescription unioned with the caller's access flags (see commons.AccessFlags). +message ApplicationDeploymentWithAccess { + org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription application_deployment = 1; + org.apache.airavata.model.commons.AccessFlags access = 2; +} + +// The deployment's effective batch queues (the compute resource's queues, with the +// deployment's default queue flagged and its default node/cpu/walltime overrides applied). +message GetApplicationDeploymentQueuesResponse { + repeated org.apache.airavata.model.appcatalog.computeresource.BatchQueue queues = 1; +} + message UpdateApplicationDeploymentRequest { string app_deployment_id = 1; org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription application_deployment = 2; @@ -262,6 +362,10 @@ message GetAllApplicationDeploymentsResponse { repeated org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription application_deployments = 1; } +message GetAllApplicationDeploymentsWithAccessResponse { + repeated ApplicationDeploymentWithAccess deployments = 1; +} + message GetAccessibleApplicationDeploymentsRequest { string gateway_id = 1; } @@ -270,6 +374,10 @@ message GetAccessibleApplicationDeploymentsResponse { repeated org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription application_deployments = 1; } +message GetAccessibleApplicationDeploymentsWithAccessResponse { + repeated ApplicationDeploymentWithAccess deployments = 1; +} + message GetAppModuleDeployedResourcesRequest { string app_module_id = 1; } @@ -337,6 +445,16 @@ message GetAllApplicationInterfacesResponse { repeated org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription application_interfaces = 1; } +// An ApplicationInterfaceDescription unioned with the caller's access flags (see commons.AccessFlags). +message ApplicationInterfaceWithAccess { + org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription application_interface = 1; + org.apache.airavata.model.commons.AccessFlags access = 2; +} + +message GetAllApplicationInterfacesWithAccessResponse { + repeated ApplicationInterfaceWithAccess interfaces = 1; +} + message GetApplicationInputsRequest { string app_interface_id = 1; } diff --git a/airavata-api/research-service/src/main/proto/experiment_service.proto b/airavata-api/research-service/src/main/proto/experiment_service.proto index a7714ffe336..0adf13acd77 100644 --- a/airavata-api/research-service/src/main/proto/experiment_service.proto +++ b/airavata-api/research-service/src/main/proto/experiment_service.proto @@ -29,6 +29,12 @@ 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"; +import "org/apache/airavata/model/commons/commons.proto"; +import "org/apache/airavata/model/data/replica/replica_catalog.proto"; +import "org/apache/airavata/model/appcatalog/appinterface/app_interface.proto"; +import "org/apache/airavata/model/appcatalog/appdeployment/app_deployment.proto"; +import "org/apache/airavata/model/appcatalog/computeresource/compute_resource.proto"; +import "org/apache/airavata/model/workspace/workspace.proto"; // ExperimentService provides RPCs for managing experiments. service ExperimentService { @@ -40,12 +46,40 @@ service ExperimentService { }; } + // Additive: CreateExperiment that returns the created experiment joined with the caller's + // server-computed access flags, so a client does not chain create -> get -> sharing. + rpc CreateExperimentWithAccess(CreateExperimentRequest) returns (ExperimentWithAccess) { + option (google.api.http) = { + post: "/api/v1/experiments:withAccess" + body: "experiment" + }; + } + rpc GetExperiment(GetExperimentRequest) returns (org.apache.airavata.model.experiment.ExperimentModel) { option (google.api.http) = { get: "/api/v1/experiments/{experiment_id}" }; } + // Additive: GetExperiment plus the caller's server-computed access flags, so a + // client does not recompute access from a separate sharing round-trip. + rpc GetExperimentWithAccess(GetExperimentRequest) returns (ExperimentWithAccess) { + option (google.api.http) = { + get: "/api/v1/experiments/{experiment_id}:withAccess" + }; + } + + // Additive: the experiment joined with every related entity a viewer needs in one + // round-trip — access flags, owning project, application module/interface, compute + // resource, resolved input/output data products, and job details. This server-side + // composition replaces the multi-RPC join the Python SDK does today, so any client + // (Python now, TypeScript later) gets the same shaped result for free. + rpc GetFullExperiment(GetExperimentRequest) returns (FullExperiment) { + option (google.api.http) = { + get: "/api/v1/experiments/{experiment_id}:full" + }; + } + rpc GetExperimentByAdmin(GetExperimentByAdminRequest) returns (org.apache.airavata.model.experiment.ExperimentModel) { option (google.api.http) = { get: "/api/v1/experiments/{experiment_id}:admin" @@ -59,6 +93,15 @@ service ExperimentService { }; } + // Additive: UpdateExperiment that returns the updated experiment joined with the caller's + // server-computed access flags, so a client does not chain update -> get -> sharing. + rpc UpdateExperimentWithAccess(UpdateExperimentRequest) returns (ExperimentWithAccess) { + option (google.api.http) = { + put: "/api/v1/experiments/{experiment_id}:withAccess" + body: "experiment" + }; + } + rpc DeleteExperiment(DeleteExperimentRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/api/v1/experiments/{experiment_id}" @@ -71,6 +114,14 @@ service ExperimentService { }; } + // Additive: SearchExperiments plus per-item server-computed access flags for the caller, + // so a client does not recompute access from N separate sharing round-trips. + rpc SearchExperimentsWithAccess(SearchExperimentsRequest) returns (SearchExperimentsWithAccessResponse) { + option (google.api.http) = { + get: "/api/v1/experiments:withAccess" + }; + } + rpc GetExperimentStatus(GetExperimentStatusRequest) returns (org.apache.airavata.model.status.ExperimentStatus) { option (google.api.http) = { get: "/api/v1/experiments/{experiment_id}/status" @@ -89,6 +140,14 @@ service ExperimentService { }; } + // Additive: GetExperimentsInProject plus per-item server-computed access flags for the + // caller, so a client does not recompute access from N separate sharing round-trips. + rpc GetExperimentsInProjectWithAccess(GetExperimentsInProjectRequest) returns (GetExperimentsInProjectWithAccessResponse) { + option (google.api.http) = { + get: "/api/v1/projects/{project_id}/experiments:withAccess" + }; + } + rpc GetUserExperiments(GetUserExperimentsRequest) returns (GetUserExperimentsResponse) { option (google.api.http) = { get: "/api/v1/gateways/{gateway_id}/users/{user_name}/experiments" @@ -127,6 +186,19 @@ service ExperimentService { }; } + // Composite launch for thin clients: when the experiment has email + // notifications enabled, override its recipients to the launching user's + // address (notification_email) before launching. Storage setup (default + // storage ids, data-dir creation, tmp-upload relocation) already runs + // server-side inside LaunchExperiment, so this replaces the portal's + // get/update/launch round-trip with one call. Mirrors the Python SDK's + // experiment_orchestration.launch(). + rpc LaunchExperimentWithStorageSetup(LaunchExperimentWithStorageSetupRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/api/v1/experiments/{experiment_id}:launch-with-storage" + }; + } + rpc TerminateExperiment(TerminateExperimentRequest) returns (google.protobuf.Empty) { option (google.api.http) = { post: "/api/v1/experiments/{experiment_id}:terminate" @@ -139,6 +211,18 @@ service ExperimentService { }; } + // Composite clone for thin clients: clone into a writable project (the given + // project, else the source's if writable, else the caller's most-recent + // writable), server-side copy each input file into a fresh tmp upload and + // rewrite the input value (dropping inputs whose source file is gone), null the + // data dir, persist; returns the new experiment joined with the caller's access + // flags. Mirrors the Python SDK's experiment_orchestration.clone(). + rpc CloneExperimentWithInputFiles(CloneExperimentWithInputFilesRequest) returns (ExperimentWithAccess) { + option (google.api.http) = { + post: "/api/v1/experiments/{experiment_id}:clone-with-files" + }; + } + rpc GetJobStatuses(GetJobStatusesRequest) returns (GetJobStatusesResponse) { option (google.api.http) = { get: "/api/v1/experiments/{experiment_id}/job-statuses" @@ -168,6 +252,10 @@ service ExperimentService { get: "/api/v1/experiment-statistics" }; } + + rpc CreateExperimentFromSpec(CreateExperimentFromSpecRequest) returns (ExperimentWithAccess) { + option (google.api.http) = { post: "/api/v1/experiments:fromSpec" body: "spec" }; + } } // Request/Response messages @@ -185,6 +273,33 @@ message GetExperimentRequest { string experiment_id = 1; } +// An ExperimentModel unioned with the caller's access flags (see commons.AccessFlags). +message ExperimentWithAccess { + org.apache.airavata.model.experiment.ExperimentModel experiment = 1; + org.apache.airavata.model.commons.AccessFlags access = 2; +} + +// A DataProductModel unioned with the caller's access flags (see commons.AccessFlags). +message DataProductWithAccess { + org.apache.airavata.model.data.replica.DataProductModel data_product = 1; + org.apache.airavata.model.commons.AccessFlags access = 2; +} + +// The experiment joined with every related entity a viewer needs in one round-trip. +// Related entities are best-effort: an entity that does not apply or cannot be resolved +// is simply left unset (e.g. an experiment with no execution id has no application_interface). +message FullExperiment { + org.apache.airavata.model.experiment.ExperimentModel experiment = 1; + org.apache.airavata.model.commons.AccessFlags access = 2; + org.apache.airavata.model.workspace.Project project = 3; + org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule application_module = 4; + org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription application_interface = 5; + org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription compute_resource = 6; + repeated DataProductWithAccess input_data_products = 7; + repeated DataProductWithAccess output_data_products = 8; + repeated org.apache.airavata.model.job.JobModel jobs = 9; +} + message GetExperimentByAdminRequest { string experiment_id = 1; } @@ -210,6 +325,16 @@ message SearchExperimentsResponse { repeated org.apache.airavata.model.experiment.ExperimentSummaryModel experiments = 1; } +// An ExperimentSummaryModel unioned with the caller's access flags (see commons.AccessFlags). +message ExperimentSummaryWithAccess { + org.apache.airavata.model.experiment.ExperimentSummaryModel summary = 1; + org.apache.airavata.model.commons.AccessFlags access = 2; +} + +message SearchExperimentsWithAccessResponse { + repeated ExperimentSummaryWithAccess experiments = 1; +} + message GetExperimentStatusRequest { string experiment_id = 1; } @@ -232,6 +357,10 @@ message GetExperimentsInProjectResponse { repeated org.apache.airavata.model.experiment.ExperimentModel experiments = 1; } +message GetExperimentsInProjectWithAccessResponse { + repeated ExperimentWithAccess experiments = 1; +} + message GetUserExperimentsRequest { string gateway_id = 1; string user_name = 2; @@ -271,6 +400,15 @@ message LaunchExperimentRequest { string gateway_id = 2; } +message LaunchExperimentWithStorageSetupRequest { + string experiment_id = 1; + string gateway_id = 2; + // The launching user's email; when the experiment has email notifications + // enabled the server overrides its recipients to this address. Empty leaves + // the experiment's configured recipients unchanged. + string notification_email = 3; +} + message TerminateExperimentRequest { string experiment_id = 1; string gateway_id = 2; @@ -286,6 +424,14 @@ message CloneExperimentResponse { string experiment_id = 1; } +message CloneExperimentWithInputFilesRequest { + string experiment_id = 1; + // Optional; when empty the server defaults to "Clone of ". + string new_experiment_name = 2; + // Optional; when empty the server resolves a writable project for the caller. + string new_experiment_project_id = 3; +} + message GetJobStatusesRequest { string experiment_id = 1; } @@ -321,3 +467,26 @@ message GetExperimentStatisticsRequest { int32 limit = 7; int32 offset = 8; } + +message CreateExperimentFromSpecRequest { ExperimentSpec spec = 1; } + +message ExperimentSpec { + string experiment_name = 1; + string project_id = 2; + string application_interface_id = 3; + string description = 4; + map inputs = 5; + ResourceSpec resource = 6; +} + +message ResourceSpec { + string compute_resource_id = 1; + string group_resource_profile_id = 2; + int32 node_count = 3; + int32 total_cpu_count = 4; + string queue_name = 5; + int32 wall_time_limit = 6; + string input_storage_resource_id = 7; + string output_storage_resource_id = 8; + bool auto_schedule = 9; +} diff --git a/airavata-api/research-service/src/main/proto/experiment_set_service.proto b/airavata-api/research-service/src/main/proto/experiment_set_service.proto new file mode 100644 index 00000000000..ddeb0c1da6f --- /dev/null +++ b/airavata-api/research-service/src/main/proto/experiment_set_service.proto @@ -0,0 +1,70 @@ +// 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.experimentset; + +option java_package = "org.apache.airavata.api.experimentset"; +option java_multiple_files = true; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "experiment_service.proto"; + +// ExperimentSetService provides RPCs for managing gridsearch experiment sets. +service ExperimentSetService { + rpc CreateExperimentSet (CreateExperimentSetRequest) returns (ExperimentSet) { + option (google.api.http) = { post: "/api/v1/experiment-sets" body: "*" }; } + rpc LaunchExperimentSet (LaunchExperimentSetRequest) returns (ExperimentSet) { + option (google.api.http) = { post: "/api/v1/experiment-sets/{experiment_set_id}:launch" }; } + rpc GetExperimentSet (GetExperimentSetRequest) returns (ExperimentSet) { + option (google.api.http) = { get: "/api/v1/experiment-sets/{experiment_set_id}" }; } + rpc ListExperimentSets (ListExperimentSetsRequest) returns (ListExperimentSetsResponse) { + option (google.api.http) = { get: "/api/v1/experiment-sets" }; } + rpc GetExperimentSetStatus (GetExperimentSetRequest) returns (ExperimentSetStatus) { + option (google.api.http) = { get: "/api/v1/experiment-sets/{experiment_set_id}/status" }; } + rpc DeleteExperimentSet (DeleteExperimentSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { delete: "/api/v1/experiment-sets/{experiment_set_id}" }; } +} + +message ValueList { repeated string values = 1; } +message SweepSpec { + org.apache.airavata.api.experiment.ExperimentSpec base = 1; + map sweep_axes = 2; + string name_prefix = 3; +} +message ExperimentIdList { repeated string experiment_ids = 1; } +message CreateExperimentSetRequest { + string set_name = 1; + oneof source { SweepSpec sweep = 2; ExperimentIdList existing = 3; } +} +message LaunchExperimentSetRequest { string experiment_set_id = 1; string notification_email = 2; } +message GetExperimentSetRequest { string experiment_set_id = 1; } +message DeleteExperimentSetRequest { string experiment_set_id = 1; } +message ListExperimentSetsRequest { int32 limit = 1; int32 offset = 2; } +message ExperimentSet { + string experiment_set_id = 1; string set_name = 2; string owner = 3; string gateway_id = 4; + repeated string experiment_ids = 5; SweepSpec sweep = 6; int64 creation_time = 7; int64 updated_time = 8; +} +message ListExperimentSetsResponse { repeated ExperimentSet experiment_sets = 1; } +enum AggregateState { QUEUED = 0; RUNNING = 1; COMPLETED = 2; FAILED = 3; MIXED = 4; } +message ExperimentStatusItem { string experiment_id = 1; string state = 2; string process_id = 3; } +message ExperimentSetStatus { + string experiment_set_id = 1; int32 total = 2; map counts_by_state = 3; + AggregateState aggregate = 4; repeated ExperimentStatusItem items = 5; +} diff --git a/airavata-api/research-service/src/main/proto/notification_service.proto b/airavata-api/research-service/src/main/proto/notification_service.proto index 237f8bb54e7..9a415146626 100644 --- a/airavata-api/research-service/src/main/proto/notification_service.proto +++ b/airavata-api/research-service/src/main/proto/notification_service.proto @@ -25,6 +25,7 @@ option java_multiple_files = true; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "org/apache/airavata/model/workspace/workspace.proto"; +import "org/apache/airavata/model/commons/commons.proto"; // NotificationService provides RPCs for managing notifications. service NotificationService { @@ -60,6 +61,24 @@ service NotificationService { get: "/api/v1/gateways/{gateway_id}/notifications" }; } + + // Additive: GetNotification plus the caller's server-computed access flags, so a + // client does not recompute access from a separate round-trip. Notifications are + // gateway-level broadcast entities with no owner/sharing, so is_owner is always + // false and user_has_write_access reflects the caller's gateway-admin role. + rpc GetNotificationWithAccess(GetNotificationRequest) returns (NotificationWithAccess) { + option (google.api.http) = { + get: "/api/v1/gateways/{gateway_id}/notifications/{notification_id}:withAccess" + }; + } + + // Additive: GetAllNotifications plus each notification's caller-scoped access flags, + // so a client does not recompute access per notification from separate round-trips. + rpc GetAllNotificationsWithAccess(GetAllNotificationsRequest) returns (GetAllNotificationsWithAccessResponse) { + option (google.api.http) = { + get: "/api/v1/gateways/{gateway_id}/notifications:withAccess" + }; + } } // Request/Response messages @@ -95,3 +114,13 @@ message GetAllNotificationsRequest { message GetAllNotificationsResponse { repeated org.apache.airavata.model.workspace.Notification notifications = 1; } + +// A Notification unioned with the caller's access flags (see commons.AccessFlags). +message NotificationWithAccess { + org.apache.airavata.model.workspace.Notification notification = 1; + org.apache.airavata.model.commons.AccessFlags access = 2; +} + +message GetAllNotificationsWithAccessResponse { + repeated NotificationWithAccess notifications = 1; +} diff --git a/airavata-api/research-service/src/main/proto/project_service.proto b/airavata-api/research-service/src/main/proto/project_service.proto index f91363e7a0d..a5fd3f6831b 100644 --- a/airavata-api/research-service/src/main/proto/project_service.proto +++ b/airavata-api/research-service/src/main/proto/project_service.proto @@ -25,6 +25,7 @@ option java_multiple_files = true; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "org/apache/airavata/model/workspace/workspace.proto"; +import "org/apache/airavata/model/commons/commons.proto"; // ProjectService provides RPCs for managing projects. service ProjectService { @@ -66,6 +67,49 @@ service ProjectService { get: "/api/v1/projects" }; } + + // Additive: GetProject plus the caller's server-computed access flags, so a + // client does not recompute access from a separate sharing round-trip. + rpc GetProjectWithAccess(GetProjectRequest) returns (ProjectWithAccess) { + option (google.api.http) = { + get: "/api/v1/projects/{project_id}:withAccess" + }; + } + + // Additive: GetUserProjects plus each project's caller-scoped access flags, so + // a client does not recompute access per project from separate sharing round-trips. + rpc GetUserProjectsWithAccess(GetUserProjectsRequest) returns (GetUserProjectsWithAccessResponse) { + option (google.api.http) = { + get: "/api/v1/gateways/{gateway_id}/users/{user_name}/projects:withAccess" + }; + } + + // Additive: the caller's most-recently-created WRITE-accessible project, returned + // as a ProjectWithAccess. Lets a client resolve a sensible default target project + // without listing all projects and recomputing access client-side. + rpc GetMostRecentWritableProject(GetUserProjectsRequest) returns (ProjectWithAccess) { + option (google.api.http) = { + get: "/api/v1/projects:mostRecentWritable" + }; + } + + // Additive: CreateProject that returns the new project's caller-scoped access flags + // (a ProjectWithAccess), so a client does not chain create -> get -> sharing. + rpc CreateProjectWithAccess(CreateProjectRequest) returns (ProjectWithAccess) { + option (google.api.http) = { + post: "/api/v1/projects:withAccess" + body: "project" + }; + } + + // Additive: UpdateProject that returns the project's caller-scoped access flags + // (a ProjectWithAccess), so a client does not chain update -> get -> sharing. + rpc UpdateProjectWithAccess(UpdateProjectRequest) returns (ProjectWithAccess) { + option (google.api.http) = { + put: "/api/v1/projects/{project_id}:withAccess" + body: "project" + }; + } } // Request/Response messages @@ -79,6 +123,12 @@ message CreateProjectResponse { string project_id = 1; } +// A Project unioned with the caller's access flags (see commons.AccessFlags). +message ProjectWithAccess { + org.apache.airavata.model.workspace.Project project = 1; + org.apache.airavata.model.commons.AccessFlags access = 2; +} + message GetProjectRequest { string project_id = 1; } @@ -103,6 +153,10 @@ message GetUserProjectsResponse { repeated org.apache.airavata.model.workspace.Project projects = 1; } +message GetUserProjectsWithAccessResponse { + repeated ProjectWithAccess projects = 1; +} + message SearchProjectsRequest { string gateway_id = 1; string user_name = 2; diff --git a/airavata-api/research-service/src/test/java/org/apache/airavata/research/repository/ExperimentSetRepositoryTest.java b/airavata-api/research-service/src/test/java/org/apache/airavata/research/repository/ExperimentSetRepositoryTest.java new file mode 100644 index 00000000000..b3427b5f8bd --- /dev/null +++ b/airavata-api/research-service/src/test/java/org/apache/airavata/research/repository/ExperimentSetRepositoryTest.java @@ -0,0 +1,143 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.repository; + +import static org.junit.jupiter.api.Assertions.*; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import org.apache.airavata.db.EntityManagerFactoryHolder; +import org.apache.airavata.research.model.ExperimentSetEntity; +import org.apache.airavata.research.model.ExperimentSetMemberEntity; +import org.apache.airavata.util.TestBase; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.springframework.data.jpa.repository.support.JpaRepositoryFactory; + +@Tag("integration") +public class ExperimentSetRepositoryTest extends TestBase { + + private ExperimentSetRepository repository; + + @BeforeEach + @Override + public void setUp() throws Exception { + super.setUp(); + repository = new JpaRepositoryFactory(EntityManagerFactoryHolder.getTestEntityManager()) + .getRepository(ExperimentSetRepository.class); + } + + private ExperimentSetEntity buildSet(String name, String owner, String gateway, int memberCount) { + ExperimentSetEntity set = new ExperimentSetEntity(); + set.setSetName(name); + set.setOwner(owner); + set.setGatewayId(gateway); + set.setSweepSpecJson("{\"param\":\"value\"}"); + // AuditingEntityListener requires a Spring context; supply timestamps manually in tests. + Instant now = Instant.now(); + set.setCreatedAt(now); + set.setUpdatedAt(now); + + List members = new ArrayList<>(); + for (int i = 0; i < memberCount; i++) { + ExperimentSetMemberEntity member = new ExperimentSetMemberEntity(); + member.setExperimentId("EXP-" + i); + member.setOrdinal(i); + member.setExperimentSet(set); + members.add(member); + } + set.setMembers(members); + return set; + } + + @Test + @DisplayName("persist set with 3 members and retrieve by id with members eager-loaded") + void persistAndFindById() { + ExperimentSetEntity set = buildSet("sweep-1", "user1", "gw1", 3); + ExperimentSetEntity saved = repository.saveAndFlush(set); + + assertNotNull(saved.getId()); + assertNotNull(saved.getCreatedAt()); + assertNotNull(saved.getUpdatedAt()); + + // Clear context to force a DB read + EntityManagerFactoryHolder.getTestEntityManager().clear(); + + ExperimentSetEntity found = repository.findById(saved.getId()).orElseThrow(); + assertEquals("sweep-1", found.getSetName()); + assertEquals("user1", found.getOwner()); + assertEquals("gw1", found.getGatewayId()); + assertEquals("{\"param\":\"value\"}", found.getSweepSpecJson()); + assertEquals(3, found.getMembers().size()); + // verify ordinals + found.getMembers().stream().forEach(m -> { + assertNotNull(m.getId()); + assertNotNull(m.getExperimentId()); + assertTrue(m.getOrdinal() >= 0 && m.getOrdinal() < 3); + }); + } + + @Test + @DisplayName("findByOwnerAndGatewayIdOrderByCreatedAtDesc returns the set") + void findByOwnerAndGateway() { + ExperimentSetEntity set = buildSet("sweep-2", "user2", "gw2", 2); + repository.saveAndFlush(set); + + EntityManagerFactoryHolder.getTestEntityManager().clear(); + + List results = + repository.findByOwnerAndGatewayIdOrderByCreatedAtDesc("user2", "gw2"); + assertEquals(1, results.size()); + assertEquals("sweep-2", results.get(0).getSetName()); + assertEquals(2, results.get(0).getMembers().size()); + } + + @Test + @DisplayName("deleting a set cascades to its members (member table becomes empty)") + void deleteSetCascadesMembers() { + ExperimentSetEntity set = buildSet("sweep-3", "user3", "gw3", 3); + ExperimentSetEntity saved = repository.saveAndFlush(set); + String setId = saved.getId(); + + // Verify members exist + EntityManagerFactoryHolder.getTestEntityManager().clear(); + assertEquals(3, repository.findById(setId).orElseThrow().getMembers().size()); + + repository.deleteById(setId); + repository.flush(); + + EntityManagerFactoryHolder.getTestEntityManager().clear(); + + // Set is gone + assertFalse(repository.existsById(setId)); + + // Members are gone (cascade removed them) + long memberCount = EntityManagerFactoryHolder.getTestEntityManager() + .createQuery( + "SELECT COUNT(m) FROM ExperimentSetMemberEntity m WHERE m.experimentSet.id = :setId", + Long.class) + .setParameter("setId", setId) + .getSingleResult(); + assertEquals(0L, memberCount); + } +} diff --git a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ApplicationCatalogServiceTest.java b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ApplicationCatalogServiceTest.java index 2816fb39176..f430fd25bec 100644 --- a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ApplicationCatalogServiceTest.java +++ b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ApplicationCatalogServiceTest.java @@ -25,10 +25,15 @@ import java.util.List; import java.util.Map; +import org.apache.airavata.api.appcatalog.ApplicationDeploymentWithAccess; +import org.apache.airavata.api.appcatalog.ApplicationInterfaceWithAccess; +import org.apache.airavata.api.appcatalog.ApplicationModuleWithAccess; +import org.apache.airavata.config.Constants; import org.apache.airavata.config.RequestContext; import org.apache.airavata.exception.ServiceException; import org.apache.airavata.iam.service.GatewayGroupsInitializer; import org.apache.airavata.interfaces.AppCatalogRegistry; +import org.apache.airavata.interfaces.ComputeRegistry; import org.apache.airavata.interfaces.CredentialProvider; import org.apache.airavata.interfaces.RegistryProvider; import org.apache.airavata.interfaces.ResourceProfileRegistry; @@ -36,8 +41,11 @@ import org.apache.airavata.model.appcatalog.appdeployment.proto.ApplicationDeploymentDescription; import org.apache.airavata.model.appcatalog.appdeployment.proto.ApplicationModule; import org.apache.airavata.model.appcatalog.appinterface.proto.ApplicationInterfaceDescription; +import org.apache.airavata.model.appcatalog.computeresource.proto.BatchQueue; +import org.apache.airavata.model.appcatalog.computeresource.proto.ComputeResourceDescription; import org.apache.airavata.model.application.io.proto.InputDataObjectType; import org.apache.airavata.model.application.io.proto.OutputDataObjectType; +import org.apache.airavata.model.group.proto.ResourcePermissionType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -53,6 +61,9 @@ class ApplicationCatalogServiceTest { @Mock AppCatalogRegistry appCatalogRegistry; + @Mock + ComputeRegistry computeRegistry; + @Mock ResourceProfileRegistry resourceProfileRegistry; @@ -80,6 +91,7 @@ void setUp() throws Exception { service = new ApplicationCatalogService( appCatalogRegistry, + computeRegistry, resourceProfileRegistry, registryProvider, sharingHandler, @@ -120,6 +132,65 @@ void getApplicationModule_delegatesToRegistry() throws Exception { verify(appCatalogRegistry).getApplicationModule("mod-1"); } + @Test + void getApplicationModuleWithAccess_stampsGatewayAdminWriteFalseForNonAdmin() throws Exception { + // Modules are not sharing entities: is_owner is always false and write follows gateway-admin + // status. The default ctx holds no roles, so the caller is not a gateway admin. + ApplicationModule module = + ApplicationModule.newBuilder().setAppModuleId("mod-1").build(); + when(appCatalogRegistry.getApplicationModule("mod-1")).thenReturn(module); + + ApplicationModuleWithAccess result = service.getApplicationModuleWithAccess(ctx, "mod-1"); + + assertEquals("mod-1", result.getApplicationModule().getAppModuleId()); + assertFalse(result.getAccess().getIsOwner()); + assertFalse(result.getAccess().getUserHasWriteAccess()); + verify(appCatalogRegistry).getApplicationModule("mod-1"); + } + + @Test + void getApplicationModuleWithAccess_stampsWriteTrueForGatewayAdmin() throws Exception { + ApplicationModule module = + ApplicationModule.newBuilder().setAppModuleId("mod-1").build(); + when(appCatalogRegistry.getApplicationModule("mod-1")).thenReturn(module); + RequestContext adminCtx = new RequestContext( + "adminUser", + "testGateway", + "token123", + Map.of("userName", "adminUser", "gatewayId", "testGateway"), + List.of(Constants.ROLE_GATEWAY_ADMIN)); + + ApplicationModuleWithAccess result = service.getApplicationModuleWithAccess(adminCtx, "mod-1"); + + assertFalse(result.getAccess().getIsOwner()); + assertTrue(result.getAccess().getUserHasWriteAccess()); + } + + @Test + void getAllApplicationModulesWithAccess_stampsSameFlagsForEveryModule() throws Exception { + ApplicationModule m1 = + ApplicationModule.newBuilder().setAppModuleId("mod-1").build(); + ApplicationModule m2 = + ApplicationModule.newBuilder().setAppModuleId("mod-2").build(); + when(appCatalogRegistry.getAllAppModules("testGateway")).thenReturn(List.of(m1, m2)); + RequestContext adminCtx = new RequestContext( + "adminUser", + "testGateway", + "token123", + Map.of("userName", "adminUser", "gatewayId", "testGateway"), + List.of(Constants.ROLE_GATEWAY_ADMIN)); + + List result = + service.getAllApplicationModulesWithAccess(adminCtx, "testGateway"); + + assertEquals(2, result.size()); + for (ApplicationModuleWithAccess m : result) { + assertFalse(m.getAccess().getIsOwner()); + assertTrue(m.getAccess().getUserHasWriteAccess()); + } + verify(appCatalogRegistry).getAllAppModules("testGateway"); + } + @Test void updateApplicationModule_delegatesToRegistry() throws Exception { ApplicationModule module = @@ -199,6 +270,52 @@ void getAppModuleDeployedResources_delegatesToRegistry() throws Exception { verify(appCatalogRegistry).getAppModuleDeployedResources("mod-1"); } + @Test + void getAllApplicationDeploymentsWithAccess_stampsPerDeploymentFlags() throws Exception { + // Sharing is enabled in this class (see setUp) and the stub grants every userHasAccess check, + // so each deployment's sharing OWNER/WRITE flags resolve true. + ApplicationDeploymentDescription d1 = ApplicationDeploymentDescription.newBuilder() + .setAppDeploymentId("dep-1") + .build(); + ApplicationDeploymentDescription d2 = ApplicationDeploymentDescription.newBuilder() + .setAppDeploymentId("dep-2") + .build(); + when(appCatalogRegistry.getAccessibleApplicationDeployments(eq("testGateway"), anyList(), anyList())) + .thenReturn(List.of(d1, d2)); + + List result = + service.getAllApplicationDeploymentsWithAccess(ctx, "testGateway"); + + assertEquals(2, result.size()); + for (ApplicationDeploymentWithAccess d : result) { + assertTrue(d.getAccess().getIsOwner()); + assertTrue(d.getAccess().getUserHasWriteAccess()); + } + assertEquals("dep-1", result.get(0).getApplicationDeployment().getAppDeploymentId()); + assertEquals("dep-2", result.get(1).getApplicationDeployment().getAppDeploymentId()); + } + + @Test + void getAccessibleApplicationDeploymentsWithAccess_stampsPerDeploymentFlags() throws Exception { + // Sharing is enabled in this class (see setUp) and the stub grants every userHasAccess check, + // so the deployment's sharing OWNER/WRITE flags resolve true. + ApplicationDeploymentDescription d1 = ApplicationDeploymentDescription.newBuilder() + .setAppDeploymentId("dep-1") + .build(); + when(appCatalogRegistry.getAccessibleApplicationDeployments(eq("testGateway"), anyList(), anyList())) + .thenReturn(List.of(d1)); + + List result = + service.getAccessibleApplicationDeploymentsWithAccess( + ctx, "testGateway", ResourcePermissionType.READ); + + assertEquals(1, result.size()); + assertEquals("dep-1", result.get(0).getApplicationDeployment().getAppDeploymentId()); + assertTrue(result.get(0).getAccess().getIsOwner()); + assertTrue(result.get(0).getAccess().getUserHasWriteAccess()); + verify(appCatalogRegistry).getAccessibleApplicationDeployments(eq("testGateway"), anyList(), anyList()); + } + // ------------------------------------------------------------------------- // Application Interfaces // ------------------------------------------------------------------------- @@ -230,6 +347,69 @@ void getApplicationInterface_delegatesToRegistry() throws Exception { assertEquals("iface-1", result.getApplicationInterfaceId()); } + @Test + void getApplicationInterfaceWithAccess_stampsGatewayAdminWriteFalseForNonAdmin() throws Exception { + // Interfaces are not sharing entities: is_owner is always false and write follows gateway-admin + // status. The default ctx holds no roles, so the caller is not a gateway admin. + ApplicationInterfaceDescription iface = ApplicationInterfaceDescription.newBuilder() + .setApplicationInterfaceId("iface-1") + .build(); + when(appCatalogRegistry.getApplicationInterface("iface-1")).thenReturn(iface); + + ApplicationInterfaceWithAccess result = service.getApplicationInterfaceWithAccess(ctx, "iface-1"); + + assertEquals("iface-1", result.getApplicationInterface().getApplicationInterfaceId()); + assertFalse(result.getAccess().getIsOwner()); + assertFalse(result.getAccess().getUserHasWriteAccess()); + verify(appCatalogRegistry).getApplicationInterface("iface-1"); + } + + @Test + void getApplicationInterfaceWithAccess_stampsWriteTrueForGatewayAdmin() throws Exception { + ApplicationInterfaceDescription iface = ApplicationInterfaceDescription.newBuilder() + .setApplicationInterfaceId("iface-1") + .build(); + when(appCatalogRegistry.getApplicationInterface("iface-1")).thenReturn(iface); + RequestContext adminCtx = new RequestContext( + "adminUser", + "testGateway", + "token123", + Map.of("userName", "adminUser", "gatewayId", "testGateway"), + List.of(Constants.ROLE_GATEWAY_ADMIN)); + + ApplicationInterfaceWithAccess result = service.getApplicationInterfaceWithAccess(adminCtx, "iface-1"); + + assertFalse(result.getAccess().getIsOwner()); + assertTrue(result.getAccess().getUserHasWriteAccess()); + } + + @Test + void getAllApplicationInterfacesWithAccess_stampsSameFlagsForEveryInterface() throws Exception { + ApplicationInterfaceDescription i1 = ApplicationInterfaceDescription.newBuilder() + .setApplicationInterfaceId("iface-1") + .build(); + ApplicationInterfaceDescription i2 = ApplicationInterfaceDescription.newBuilder() + .setApplicationInterfaceId("iface-2") + .build(); + when(appCatalogRegistry.getAllApplicationInterfaces("testGateway")).thenReturn(List.of(i1, i2)); + RequestContext adminCtx = new RequestContext( + "adminUser", + "testGateway", + "token123", + Map.of("userName", "adminUser", "gatewayId", "testGateway"), + List.of(Constants.ROLE_GATEWAY_ADMIN)); + + List result = + service.getAllApplicationInterfacesWithAccess(adminCtx, "testGateway"); + + assertEquals(2, result.size()); + for (ApplicationInterfaceWithAccess i : result) { + assertFalse(i.getAccess().getIsOwner()); + assertTrue(i.getAccess().getUserHasWriteAccess()); + } + verify(appCatalogRegistry).getAllApplicationInterfaces("testGateway"); + } + @Test void cloneApplicationInterface_throwsWhenSourceMissing() throws Exception { when(appCatalogRegistry.getApplicationInterface("iface-old")).thenReturn(null); @@ -285,4 +465,47 @@ void getApplicationOutputs_delegatesToRegistry() throws Exception { assertEquals(1, result.size()); verify(appCatalogRegistry).getApplicationOutputs("iface-1"); } + + @Test + void getApplicationDeploymentQueues_appliesDeploymentDefaultsToMatchingQueue() throws Exception { + ApplicationDeploymentDescription dep = ApplicationDeploymentDescription.newBuilder() + .setAppDeploymentId("dep-1") + .setComputeHostId("cr-1") + .setDefaultQueueName("gpu") + .setDefaultNodeCount(5) + .setDefaultCpuCount(40) + .setDefaultWalltime(120) + .build(); + when(appCatalogRegistry.getApplicationDeployment("dep-1")).thenReturn(dep); + + ComputeResourceDescription cr = ComputeResourceDescription.newBuilder() + .setComputeResourceId("cr-1") + .addBatchQueues(BatchQueue.newBuilder() + .setQueueName("normal") + .setIsDefaultQueue(true) + .build()) + .addBatchQueues( + BatchQueue.newBuilder().setQueueName("gpu").build()) + .build(); + when(computeRegistry.getComputeResource("cr-1")).thenReturn(cr); + + List queues = service.getApplicationDeploymentQueues(ctx, "dep-1"); + + assertEquals(2, queues.size()); + BatchQueue normal = queues.stream() + .filter(q -> q.getQueueName().equals("normal")) + .findFirst() + .orElseThrow(); + BatchQueue gpu = queues.stream() + .filter(q -> q.getQueueName().equals("gpu")) + .findFirst() + .orElseThrow(); + // The non-default queue is flagged off; the deployment's default queue is flagged on and + // carries the deployment's default node/cpu/walltime. + assertFalse(normal.getIsDefaultQueue()); + assertTrue(gpu.getIsDefaultQueue()); + assertEquals(5, gpu.getDefaultNodeCount()); + assertEquals(40, gpu.getDefaultCpuCount()); + assertEquals(120, gpu.getDefaultWalltime()); + } } diff --git a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentServiceFromSpecTest.java b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentServiceFromSpecTest.java new file mode 100644 index 00000000000..d54984e920b --- /dev/null +++ b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentServiceFromSpecTest.java @@ -0,0 +1,251 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.service; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +import java.util.List; +import java.util.Map; +import org.apache.airavata.api.experiment.ExperimentSpec; +import org.apache.airavata.api.experiment.ExperimentWithAccess; +import org.apache.airavata.api.experiment.ResourceSpec; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.interfaces.AppCatalogRegistry; +import org.apache.airavata.interfaces.ComputeRegistry; +import org.apache.airavata.interfaces.DataProductInterface; +import org.apache.airavata.interfaces.DataReplicaLocationInterface; +import org.apache.airavata.interfaces.ExperimentRegistry; +import org.apache.airavata.interfaces.ProjectRegistry; +import org.apache.airavata.interfaces.SharingFacade; +import org.apache.airavata.model.appcatalog.appinterface.proto.ApplicationInterfaceDescription; +import org.apache.airavata.model.application.io.proto.InputDataObjectType; +import org.apache.airavata.model.application.io.proto.OutputDataObjectType; +import org.apache.airavata.model.experiment.proto.ExperimentModel; +import org.apache.airavata.model.experiment.proto.ExperimentType; +import org.apache.airavata.model.scheduling.proto.ComputationalResourceSchedulingModel; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; + +@ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) +class ExperimentServiceFromSpecTest { + + @Mock + ExperimentRegistry experimentRegistry; + + @Mock + AppCatalogRegistry appCatalogRegistry; + + @Mock + ProjectRegistry projectRegistry; + + @Mock + ComputeRegistry computeRegistry; + + @Mock + DataProductInterface dataProductInterface; + + @Mock + DataReplicaLocationInterface dataReplicaLocationInterface; + + @Mock + SharingFacade sharingHandler; + + @Mock + ProjectService projectService; + + ExperimentService experimentService; + RequestContext ctx; + + @BeforeEach + void setUp() throws Exception { + when(sharingHandler.userHasAccess(anyString(), anyString(), anyString(), anyString())) + .thenReturn(true); + + experimentService = new ExperimentService( + experimentRegistry, + appCatalogRegistry, + projectRegistry, + computeRegistry, + dataProductInterface, + dataReplicaLocationInterface, + sharingHandler, + projectService, + java.util.Optional.empty()); + ctx = new RequestContext( + "testUser", + "testGateway", + "token123", + Map.of("userName", "testUser", "gatewayId", "testGateway"), + List.of("admin-rw")); + } + + @Test + void createExperimentFromSpec_buildsCorrectModel() throws Exception { + ApplicationInterfaceDescription appInterface = ApplicationInterfaceDescription.newBuilder() + .setApplicationInterfaceId("echo-app") + .addApplicationInputs(InputDataObjectType.newBuilder() + .setName("input1") + .build()) + .addApplicationOutputs(OutputDataObjectType.newBuilder() + .setName("output1") + .build()) + .build(); + + when(appCatalogRegistry.getApplicationInterface("echo-app")).thenReturn(appInterface); + when(experimentRegistry.createExperiment(eq("testGateway"), any(ExperimentModel.class))) + .thenReturn("exp-from-spec-1"); + + ExperimentModel createdModel = ExperimentModel.newBuilder() + .setExperimentId("exp-from-spec-1") + .setExperimentName("my-echo-run") + .setProjectId("proj-1") + .setGatewayId("testGateway") + .setUserName("testUser") + .setExecutionId("echo-app") + .setExperimentType(ExperimentType.SINGLE_APPLICATION) + .build(); + when(experimentRegistry.getExperiment("exp-from-spec-1")).thenReturn(createdModel); + + ExperimentSpec spec = ExperimentSpec.newBuilder() + .setExperimentName("my-echo-run") + .setProjectId("proj-1") + .setApplicationInterfaceId("echo-app") + .setDescription("test run") + .putInputs("input1", "hello-value") + .setResource(ResourceSpec.newBuilder() + .setComputeResourceId("stampede3") + .setGroupResourceProfileId("grp-1") + .setNodeCount(1) + .setTotalCpuCount(4) + .setQueueName("normal") + .setWallTimeLimit(60) + .build()) + .build(); + + ExperimentWithAccess result = experimentService.createExperimentFromSpec(ctx, spec); + + // Verify the returned wrapper + assertNotNull(result); + assertEquals("exp-from-spec-1", result.getExperiment().getExperimentId()); + assertTrue(result.getAccess().getIsOwner()); + + // Capture the ExperimentModel passed to createExperiment + ArgumentCaptor modelCaptor = ArgumentCaptor.forClass(ExperimentModel.class); + verify(experimentRegistry).createExperiment(eq("testGateway"), modelCaptor.capture()); + ExperimentModel built = modelCaptor.getValue(); + + assertEquals("my-echo-run", built.getExperimentName()); + assertEquals("proj-1", built.getProjectId()); + assertEquals("testGateway", built.getGatewayId()); + assertEquals("testUser", built.getUserName()); + assertEquals("echo-app", built.getExecutionId()); + assertEquals(ExperimentType.SINGLE_APPLICATION, built.getExperimentType()); + assertEquals("test run", built.getDescription()); + + // Scheduling + ComputationalResourceSchedulingModel scheduling = + built.getUserConfigurationData().getComputationalResourceScheduling(); + assertEquals("stampede3", scheduling.getResourceHostId()); + assertEquals(1, scheduling.getNodeCount()); + assertEquals(4, scheduling.getTotalCpuCount()); + assertEquals("normal", scheduling.getQueueName()); + assertEquals(60, scheduling.getWallTimeLimit()); + + // UserConfigurationData + assertEquals("grp-1", built.getUserConfigurationData().getGroupResourceProfileId()); + + // Input wiring: "input1" value should be "hello-value" + assertEquals(1, built.getExperimentInputsList().size()); + assertEquals("input1", built.getExperimentInputs(0).getName()); + assertEquals("hello-value", built.getExperimentInputs(0).getValue()); + + // Outputs copied from interface + assertEquals(1, built.getExperimentOutputsList().size()); + assertEquals("output1", built.getExperimentOutputs(0).getName()); + } + + @Test + void createExperimentFromSpec_undeclaredInputNameThrows() throws Exception { + ApplicationInterfaceDescription appInterface = ApplicationInterfaceDescription.newBuilder() + .setApplicationInterfaceId("echo-app") + .addApplicationInputs(InputDataObjectType.newBuilder() + .setName("input1") + .build()) + .build(); + + when(appCatalogRegistry.getApplicationInterface("echo-app")).thenReturn(appInterface); + + ExperimentSpec spec = ExperimentSpec.newBuilder() + .setExperimentName("my-echo-run") + .setProjectId("proj-1") + .setApplicationInterfaceId("echo-app") + .putInputs("input1", "val1") + .putInputs("undeclared-input", "val2") // not in the interface + .setResource(ResourceSpec.newBuilder() + .setComputeResourceId("stampede3") + .build()) + .build(); + + assertThrows( + IllegalArgumentException.class, + () -> experimentService.createExperimentFromSpec(ctx, spec)); + } + + @Test + void createExperimentFromSpec_emptyProjectIdThrows() throws Exception { + ExperimentSpec spec = ExperimentSpec.newBuilder() + .setExperimentName("my-echo-run") + .setProjectId("") // empty + .setApplicationInterfaceId("echo-app") + .setResource(ResourceSpec.newBuilder() + .setComputeResourceId("stampede3") + .build()) + .build(); + + assertThrows( + IllegalArgumentException.class, + () -> experimentService.createExperimentFromSpec(ctx, spec)); + } + + @Test + void createExperimentFromSpec_emptyApplicationInterfaceIdThrows() throws Exception { + ExperimentSpec spec = ExperimentSpec.newBuilder() + .setExperimentName("my-echo-run") + .setProjectId("proj-1") + .setApplicationInterfaceId("") // empty + .setResource(ResourceSpec.newBuilder() + .setComputeResourceId("stampede3") + .build()) + .build(); + + assertThrows( + IllegalArgumentException.class, + () -> experimentService.createExperimentFromSpec(ctx, spec)); + } +} diff --git a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentServiceLaunchPrepTest.java b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentServiceLaunchPrepTest.java new file mode 100644 index 00000000000..10f725dc329 --- /dev/null +++ b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentServiceLaunchPrepTest.java @@ -0,0 +1,408 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.service; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import org.apache.airavata.api.experiment.ExperimentWithAccess; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.interfaces.AppCatalogRegistry; +import org.apache.airavata.interfaces.ComputeRegistry; +import org.apache.airavata.interfaces.DataProductInterface; +import org.apache.airavata.interfaces.DataReplicaLocationInterface; +import org.apache.airavata.interfaces.ExperimentRegistry; +import org.apache.airavata.interfaces.ExperimentStoragePrep; +import org.apache.airavata.interfaces.ProjectRegistry; +import org.apache.airavata.interfaces.SharingFacade; +import org.apache.airavata.model.appcatalog.appdeployment.proto.ApplicationDeploymentDescription; +import org.apache.airavata.model.appcatalog.appinterface.proto.ApplicationInterfaceDescription; +import org.apache.airavata.model.application.io.proto.DataType; +import org.apache.airavata.model.application.io.proto.InputDataObjectType; +import org.apache.airavata.model.data.replica.proto.DataProductModel; +import org.apache.airavata.model.data.replica.proto.DataReplicaLocationModel; +import org.apache.airavata.model.data.replica.proto.ReplicaLocationCategory; +import org.apache.airavata.model.experiment.proto.ExperimentModel; +import org.apache.airavata.model.experiment.proto.UserConfigurationDataModel; +import org.apache.airavata.model.workspace.proto.Project; +import org.apache.airavata.orchestration.service.LaunchOrchestrator; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; + +/** + * Unit tests for the server-side launch-prep ported into {@link ExperimentService#launchExperiment}. + * Sharing is enabled via airavata-server.properties on the classpath (matching ExperimentServiceTest), + * so the sharing mock allows all access checks. The launch path past prep is greased so launch reaches + * the orchestrator: a group resource profile id is preset (skips the backfill), auto-schedule is on + * with no auto-scheduled list (skips app-deployment access checks), and a mock LaunchOrchestrator is + * provided. + */ +@ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) +class ExperimentServiceLaunchPrepTest { + + private static final String GATEWAY = "testGateway"; + private static final String USER = "testUser"; + private static final String EXP_ID = "exp-123"; + private static final String DEFAULT_STORAGE_ID = "storage-default"; + private static final String GRP_ID = "grp-1"; + private static final String EXEC_ID = "appiface-1"; + + @Mock + ExperimentRegistry experimentRegistry; + + @Mock + AppCatalogRegistry appCatalogRegistry; + + @Mock + ProjectRegistry projectRegistry; + + @Mock + ComputeRegistry computeRegistry; + + @Mock + DataProductInterface dataProductInterface; + + @Mock + DataReplicaLocationInterface dataReplicaLocationInterface; + + @Mock + SharingFacade sharingHandler; + + @Mock + ProjectService projectService; + + @Mock + LaunchOrchestrator launchOrchestrator; + + @Mock + ExperimentStoragePrep storagePrep; + + ExperimentService experimentService; + RequestContext ctx; + + @BeforeEach + void setUp() throws Exception { + when(sharingHandler.userHasAccess(anyString(), anyString(), anyString(), anyString())) + .thenReturn(true); + + experimentService = new ExperimentService( + experimentRegistry, + appCatalogRegistry, + projectRegistry, + computeRegistry, + dataProductInterface, + dataReplicaLocationInterface, + sharingHandler, + projectService, + Optional.of(launchOrchestrator)); + + ctx = new RequestContext( + USER, GATEWAY, "token123", Map.of("userName", USER, "gatewayId", GATEWAY), List.of("admin-rw")); + + // Grease the launch path past prep so it reaches the orchestrator. + ApplicationInterfaceDescription appIface = ApplicationInterfaceDescription.newBuilder() + .setApplicationInterfaceId(EXEC_ID) + .addApplicationModules("module-1") + .build(); + when(appCatalogRegistry.getApplicationInterface(EXEC_ID)).thenReturn(appIface); + when(appCatalogRegistry.getApplicationDeployments("module-1")) + .thenReturn(List.of(ApplicationDeploymentDescription.getDefaultInstance())); + } + + // A CREATED experiment with a preset GRP (skips backfill), auto-schedule on (skips deployment + // checks), and the given user configuration / inputs. + private ExperimentModel experimentWith(UserConfigurationDataModel.Builder config, InputDataObjectType... inputs) { + config.setGroupResourceProfileId(GRP_ID).setAiravataAutoSchedule(true); + ExperimentModel.Builder builder = ExperimentModel.newBuilder() + .setExperimentId(EXP_ID) + .setExperimentName("My Experiment") + .setUserName(USER) + .setGatewayId(GATEWAY) + .setProjectId("proj-1") + .setExecutionId(EXEC_ID) + .setUserConfigurationData(config.build()); + for (InputDataObjectType input : inputs) { + builder.addExperimentInputs(input); + } + return builder.build(); + } + + @Test + void launch_storagePrepNull_doesNoPrep() throws Exception { + // storagePrep is left unset (null) -> launch proceeds with no prep side-effects. + ExperimentModel experiment = + experimentWith(UserConfigurationDataModel.newBuilder().setExperimentDataDir("proj/exp")); + when(experimentRegistry.getExperiment(EXP_ID)).thenReturn(experiment); + + experimentService.launchExperiment(ctx, EXP_ID, GATEWAY); + + verifyNoInteractions(storagePrep); + verifyNoInteractions(dataProductInterface); + verifyNoInteractions(dataReplicaLocationInterface); + // No configuration was rewritten by prep. + verify(experimentRegistry, never()).updateExperimentConfiguration(anyString(), any()); + verify(launchOrchestrator).launchExperiment(EXP_ID, GATEWAY); + } + + @Test + void launch_setsStorageIdsAndDataDir_whenEmpty() throws Exception { + experimentService.setExperimentStoragePrep(storagePrep); + + // Empty storage ids and data dir -> all derived/filled. + ExperimentModel experiment = experimentWith(UserConfigurationDataModel.newBuilder()); + when(experimentRegistry.getExperiment(EXP_ID)).thenReturn(experiment); + when(storagePrep.getDefaultStorageResourceId()).thenReturn(DEFAULT_STORAGE_ID); + Project project = Project.newBuilder().setName("My Project").build(); + when(projectRegistry.getProject("proj-1")).thenReturn(project); + // "/" sanitized: spaces -> underscores. + String expectedRelPath = "My_Project/My_Experiment"; + when(storagePrep.ensureDir(DEFAULT_STORAGE_ID, expectedRelPath)) + .thenReturn("/storage/My_Project/My_Experiment"); + + experimentService.launchExperiment(ctx, EXP_ID, GATEWAY); + + verify(storagePrep).ensureDir(DEFAULT_STORAGE_ID, expectedRelPath); + + ArgumentCaptor captor = ArgumentCaptor.forClass(UserConfigurationDataModel.class); + verify(experimentRegistry).updateExperimentConfiguration(eq(EXP_ID), captor.capture()); + UserConfigurationDataModel persisted = captor.getValue(); + assertEquals(DEFAULT_STORAGE_ID, persisted.getInputStorageResourceId()); + assertEquals(DEFAULT_STORAGE_ID, persisted.getOutputStorageResourceId()); + assertEquals("/storage/My_Project/My_Experiment", persisted.getExperimentDataDir()); + + verify(launchOrchestrator).launchExperiment(EXP_ID, GATEWAY); + } + + @Test + void launch_keepsExistingStorageIdsAndDataDir() throws Exception { + experimentService.setExperimentStoragePrep(storagePrep); + + // Non-empty values must never be clobbered or re-derived. + ExperimentModel experiment = experimentWith(UserConfigurationDataModel.newBuilder() + .setInputStorageResourceId("preset-input") + .setOutputStorageResourceId("preset-output") + .setExperimentDataDir("preset/dir")); + when(experimentRegistry.getExperiment(EXP_ID)).thenReturn(experiment); + + experimentService.launchExperiment(ctx, EXP_ID, GATEWAY); + + // Storage fully pre-set: the gateway default is never resolved (lazy), the existing data dir is + // ensured-to-exist on the EFFECTIVE input storage but kept, and the project is never resolved. + verify(storagePrep, never()).getDefaultStorageResourceId(); + verify(storagePrep).ensureDir("preset-input", "preset/dir"); + verify(projectRegistry, never()).getProject(anyString()); + + ArgumentCaptor captor = ArgumentCaptor.forClass(UserConfigurationDataModel.class); + verify(experimentRegistry).updateExperimentConfiguration(eq(EXP_ID), captor.capture()); + UserConfigurationDataModel persisted = captor.getValue(); + assertEquals("preset-input", persisted.getInputStorageResourceId()); + assertEquals("preset-output", persisted.getOutputStorageResourceId()); + assertEquals("preset/dir", persisted.getExperimentDataDir()); + } + + @Test + void launch_movesTmpInput_andRepointsReplica_preservingUri() throws Exception { + experimentService.setExperimentStoragePrep(storagePrep); + + String uri = "airavata-dp://tmpinput"; + InputDataObjectType input = InputDataObjectType.newBuilder() + .setName("in1") + .setType(DataType.URI) + .setValue(uri) + .build(); + ExperimentModel experiment = + experimentWith(UserConfigurationDataModel.newBuilder().setExperimentDataDir("proj/exp"), input); + when(experimentRegistry.getExperiment(EXP_ID)).thenReturn(experiment); + when(storagePrep.getDefaultStorageResourceId()).thenReturn(DEFAULT_STORAGE_ID); + + // A tmp-resident replica (parent dir basename == "tmp"), with a replica id so it gets repointed. + DataReplicaLocationModel replica = DataReplicaLocationModel.newBuilder() + .setReplicaId("rep-1") + .setReplicaLocationCategory(ReplicaLocationCategory.GATEWAY_DATA_STORE) + .setStorageResourceId(DEFAULT_STORAGE_ID) + .setFilePath("data/tmp/input.dat") + .build(); + DataProductModel product = DataProductModel.newBuilder() + .setProductName("input.dat") + .addReplicaLocations(replica) + .build(); + when(dataProductInterface.getDataProduct(uri)).thenReturn(product); + // Source present, destination absent -> a real move happens (not the already-moved guard). + when(storagePrep.fileExists(DEFAULT_STORAGE_ID, "proj/exp/input.dat")).thenReturn(false); + when(storagePrep.fileExists(DEFAULT_STORAGE_ID, "data/tmp/input.dat")).thenReturn(true); + + experimentService.launchExperiment(ctx, EXP_ID, GATEWAY); + + // Bytes moved into the data dir under the product name. + verify(storagePrep).moveFile(DEFAULT_STORAGE_ID, "data/tmp/input.dat", "proj/exp/input.dat"); + + // Replica repointed to the destination, preserving the URI (no input value rewrite). + ArgumentCaptor replicaCaptor = + ArgumentCaptor.forClass(DataReplicaLocationModel.class); + verify(dataReplicaLocationInterface).updateReplicaLocation(replicaCaptor.capture()); + assertEquals("proj/exp/input.dat", replicaCaptor.getValue().getFilePath()); + assertEquals("rep-1", replicaCaptor.getValue().getReplicaId()); + + // The input value string is unchanged (URI preserved); no updateExperiment was issued. + verify(experimentRegistry, never()).updateExperiment(anyString(), any()); + } + + @Test + void launch_skipsNonTmpInput() throws Exception { + experimentService.setExperimentStoragePrep(storagePrep); + + String uri = "airavata-dp://notatmpinput"; + InputDataObjectType input = InputDataObjectType.newBuilder() + .setName("in1") + .setType(DataType.URI) + .setValue(uri) + .build(); + ExperimentModel experiment = + experimentWith(UserConfigurationDataModel.newBuilder().setExperimentDataDir("proj/exp"), input); + when(experimentRegistry.getExperiment(EXP_ID)).thenReturn(experiment); + when(storagePrep.getDefaultStorageResourceId()).thenReturn(DEFAULT_STORAGE_ID); + + // Parent dir basename is "inputs", not "tmp" -> not a tmp upload -> skipped. + DataReplicaLocationModel replica = DataReplicaLocationModel.newBuilder() + .setReplicaId("rep-2") + .setReplicaLocationCategory(ReplicaLocationCategory.GATEWAY_DATA_STORE) + .setStorageResourceId(DEFAULT_STORAGE_ID) + .setFilePath("/storage/proj/exp/inputs/keep.dat") + .build(); + DataProductModel product = DataProductModel.newBuilder() + .setProductName("keep.dat") + .addReplicaLocations(replica) + .build(); + when(dataProductInterface.getDataProduct(uri)).thenReturn(product); + + experimentService.launchExperiment(ctx, EXP_ID, GATEWAY); + + // No move, no repoint for a non-tmp input. + verify(storagePrep, never()).moveFile(anyString(), anyString(), anyString()); + verify(dataReplicaLocationInterface, never()).updateReplicaLocation(any()); + // The input URI value is unchanged. + assertEquals(uri, input.getValue()); + } + + private DataProductModel gatewayDataProduct(String name, String storageId, String filePath) { + return DataProductModel.newBuilder() + .setProductName(name) + .addReplicaLocations(DataReplicaLocationModel.newBuilder() + .setReplicaLocationCategory(ReplicaLocationCategory.GATEWAY_DATA_STORE) + .setStorageResourceId(storageId) + .setFilePath(filePath) + .build()) + .build(); + } + + @Test + void cloneExperimentWithInputFiles_copiesUriInputAndNullsDataDir() throws Exception { + ExperimentModel source = ExperimentModel.newBuilder() + .setExperimentName("src") + .setGatewayId(GATEWAY) + .setUserName(USER) + .setProjectId("proj-1") + .addExperimentInputs(InputDataObjectType.newBuilder() + .setName("in") + .setType(DataType.URI) + .setValue("airavata-dp://src") + .build()) + .build(); + ExperimentModel cloned = source.toBuilder() + .setExperimentId("clone-1") + .setUserConfigurationData( + UserConfigurationDataModel.newBuilder().setExperimentDataDir("stale/dir")) + .build(); + ExperimentWithAccess expected = + ExperimentWithAccess.newBuilder().setExperiment(cloned).build(); + + ExperimentService spy = spy(experimentService); + spy.setExperimentStoragePrep(storagePrep); + doReturn(source).when(spy).getExperiment(ctx, EXP_ID); + doReturn("clone-1").when(spy).cloneExperiment(ctx, EXP_ID, "Clone of src", "proj-1", false); + when(experimentRegistry.getExperiment("clone-1")).thenReturn(cloned); + doNothing().when(spy).updateExperiment(eq(ctx), eq("clone-1"), any()); + doReturn(expected).when(spy).getExperimentWithAccess(ctx, "clone-1"); + + when(dataProductInterface.getDataProduct("airavata-dp://src")) + .thenReturn(gatewayDataProduct("file.dat", "s1", "/storage/tmp/file.dat")); + when(storagePrep.fileExists("s1", "/storage/tmp/file.dat")).thenReturn(true); + when(dataProductInterface.registerDataProduct(any())).thenReturn("airavata-dp://copy"); + + ExperimentWithAccess result = spy.cloneExperimentWithInputFiles(ctx, EXP_ID, "", "proj-1"); + + // Native copy into the tmp upload dir (no download/upload round-trip). + verify(storagePrep).copyFile("s1", "/storage/tmp/file.dat", "tmp/file.dat"); + ArgumentCaptor captor = ArgumentCaptor.forClass(ExperimentModel.class); + verify(spy).updateExperiment(eq(ctx), eq("clone-1"), captor.capture()); + // Input rewritten to the freshly registered copy; data dir nulled for fresh creation at launch. + assertEquals( + "airavata-dp://copy", captor.getValue().getExperimentInputs(0).getValue()); + assertEquals("", captor.getValue().getUserConfigurationData().getExperimentDataDir()); + assertSame(expected, result); + } + + @Test + void cloneExperimentWithInputFiles_dropsUriInputWhenSourceFileMissing() throws Exception { + ExperimentModel source = ExperimentModel.newBuilder() + .setExperimentName("src") + .setGatewayId(GATEWAY) + .setUserName(USER) + .setProjectId("proj-1") + .addExperimentInputs(InputDataObjectType.newBuilder() + .setName("in") + .setType(DataType.URI) + .setValue("airavata-dp://gone") + .build()) + .build(); + ExperimentModel cloned = source.toBuilder().setExperimentId("clone-1").build(); + + ExperimentService spy = spy(experimentService); + spy.setExperimentStoragePrep(storagePrep); + doReturn(source).when(spy).getExperiment(ctx, EXP_ID); + doReturn("clone-1").when(spy).cloneExperiment(ctx, EXP_ID, "Clone of src", "proj-1", false); + when(experimentRegistry.getExperiment("clone-1")).thenReturn(cloned); + doNothing().when(spy).updateExperiment(eq(ctx), eq("clone-1"), any()); + doReturn(ExperimentWithAccess.getDefaultInstance()).when(spy).getExperimentWithAccess(ctx, "clone-1"); + + when(dataProductInterface.getDataProduct("airavata-dp://gone")) + .thenReturn(gatewayDataProduct("file.dat", "s1", "/storage/tmp/file.dat")); + when(storagePrep.fileExists("s1", "/storage/tmp/file.dat")).thenReturn(false); + + spy.cloneExperimentWithInputFiles(ctx, EXP_ID, "", "proj-1"); + + verify(storagePrep, never()).copyFile(anyString(), anyString(), anyString()); + ArgumentCaptor captor = ArgumentCaptor.forClass(ExperimentModel.class); + verify(spy).updateExperiment(eq(ctx), eq("clone-1"), captor.capture()); + // Missing source file -> input value dropped to empty. + assertEquals("", captor.getValue().getExperimentInputs(0).getValue()); + } +} diff --git a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentServiceTest.java b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentServiceTest.java index 3f0a1294049..90bfda61f5f 100644 --- a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentServiceTest.java +++ b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentServiceTest.java @@ -26,16 +26,23 @@ import java.util.List; import java.util.Map; +import org.apache.airavata.api.experiment.ExperimentSummaryWithAccess; +import org.apache.airavata.api.experiment.ExperimentWithAccess; import org.apache.airavata.config.RequestContext; import org.apache.airavata.exception.ServiceAuthorizationException; import org.apache.airavata.exception.ServiceException; import org.apache.airavata.interfaces.AppCatalogRegistry; +import org.apache.airavata.interfaces.ComputeRegistry; +import org.apache.airavata.interfaces.DataProductInterface; +import org.apache.airavata.interfaces.DataReplicaLocationInterface; import org.apache.airavata.interfaces.ExperimentRegistry; import org.apache.airavata.interfaces.ProjectRegistry; import org.apache.airavata.interfaces.SharingFacade; import org.apache.airavata.model.application.io.proto.OutputDataObjectType; import org.apache.airavata.model.experiment.proto.ExperimentModel; +import org.apache.airavata.model.experiment.proto.ExperimentSearchFields; import org.apache.airavata.model.experiment.proto.ExperimentStatistics; +import org.apache.airavata.model.experiment.proto.ExperimentSummaryModel; import org.apache.airavata.model.job.proto.JobModel; import org.apache.airavata.model.process.proto.ProcessModel; import org.apache.airavata.model.status.proto.ExperimentState; @@ -49,6 +56,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.junit.jupiter.MockitoSettings; @@ -67,9 +75,21 @@ class ExperimentServiceTest { @Mock ProjectRegistry projectRegistry; + @Mock + ComputeRegistry computeRegistry; + + @Mock + DataProductInterface dataProductInterface; + + @Mock + DataReplicaLocationInterface dataReplicaLocationInterface; + @Mock SharingFacade sharingHandler; + @Mock + ProjectService projectService; + ExperimentService experimentService; RequestContext ctx; @@ -83,7 +103,15 @@ void setUp() throws Exception { .thenReturn(true); experimentService = new ExperimentService( - experimentRegistry, appCatalogRegistry, projectRegistry, sharingHandler, java.util.Optional.empty()); + experimentRegistry, + appCatalogRegistry, + projectRegistry, + computeRegistry, + dataProductInterface, + dataReplicaLocationInterface, + sharingHandler, + projectService, + java.util.Optional.empty()); ctx = new RequestContext( "testUser", "testGateway", @@ -108,6 +136,28 @@ void createExperiment_returnsExperimentId() throws Exception { verify(experimentRegistry).createExperiment("testGateway", experiment); } + @Test + void createExperimentWithAccess_ownerGetsOwnerAndWriteFlags() throws Exception { + // Sharing is enabled in this class (see setUp). The caller owns what it just created, so the + // flags come from ownership and no sharing WRITE check is needed. + ExperimentModel experiment = ExperimentModel.newBuilder() + .setExperimentName("test-exp") + .setGatewayId("testGateway") + .setUserName("testUser") + .setProjectId("proj-1") + .build(); + + when(experimentRegistry.createExperiment("testGateway", experiment)).thenReturn("exp-123"); + when(experimentRegistry.getExperiment("exp-123")).thenReturn(experiment); + + ExperimentWithAccess result = experimentService.createExperimentWithAccess(ctx, experiment); + + assertEquals("test-exp", result.getExperiment().getExperimentName()); + assertTrue(result.getAccess().getIsOwner()); + assertTrue(result.getAccess().getUserHasWriteAccess()); + verify(experimentRegistry).createExperiment("testGateway", experiment); + } + @Test void getExperiment_ownerGetsAccess() throws Exception { ExperimentModel experiment = @@ -217,6 +267,73 @@ void updateExperiment_ownerCanUpdate() throws Exception { verify(experimentRegistry).updateExperiment("exp-123", updated); } + @Test + void updateExperimentWithAccess_ownerGetsOwnerAndWriteFlags() throws Exception { + // Sharing is enabled in this class (see setUp). The caller owns the experiment, so the update + // is allowed by ownership and the returned flags are owner+write by ownership. + ExperimentModel existing = ExperimentModel.newBuilder() + .setUserName("testUser") + .setGatewayId("testGateway") + .build(); + ExperimentModel updated = ExperimentModel.newBuilder() + .setExperimentName("new-name") + .setProjectId("proj-1") + .build(); + + // updateExperiment reads the existing row for its WRITE check; getExperimentWithAccess then + // re-reads it for the returned model + flags. + when(experimentRegistry.getExperiment("exp-123")).thenReturn(existing); + doNothing().when(experimentRegistry).updateExperiment("exp-123", updated); + + ExperimentWithAccess result = experimentService.updateExperimentWithAccess(ctx, "exp-123", updated); + + assertEquals("testUser", result.getExperiment().getUserName()); + assertTrue(result.getAccess().getIsOwner()); + assertTrue(result.getAccess().getUserHasWriteAccess()); + verify(experimentRegistry).updateExperiment("exp-123", updated); + } + + @Test + void searchExperimentsWithAccess_stampsCallerFlags() throws Exception { + // Sharing is enabled in this test class (see setUp). The caller owns exp-owned (owner+write + // by ownership, no sharing call), and has no sharing grant on the other user's exp-other, so + // it is neither owner nor writable. + ExperimentSummaryModel owned = ExperimentSummaryModel.newBuilder() + .setExperimentId("exp-owned") + .setUserName("testUser") + .setGatewayId("testGateway") + .build(); + ExperimentSummaryModel other = ExperimentSummaryModel.newBuilder() + .setExperimentId("exp-other") + .setUserName("otherUser") + .setGatewayId("testGateway") + .build(); + + // The caller has no WRITE/OWNER sharing grant on the other user's experiment. + when(sharingHandler.userHasAccess(anyString(), anyString(), eq("exp-other"), anyString())) + .thenReturn(false); + when(sharingHandler.searchEntityIds(anyString(), anyString(), anyList(), anyInt(), anyInt())) + .thenReturn(List.of("exp-owned", "exp-other")); + when(experimentRegistry.searchExperiments( + eq("testGateway"), eq("testUser"), anyList(), anyMap(), eq(10), eq(0))) + .thenReturn(List.of(owned, other)); + + List results = experimentService.searchExperimentsWithAccess( + ctx, "testGateway", "testUser", Map.of(), 10, 0); + + assertEquals(2, results.size()); + + ExperimentSummaryWithAccess ownedResult = results.get(0); + assertEquals("exp-owned", ownedResult.getSummary().getExperimentId()); + assertTrue(ownedResult.getAccess().getIsOwner()); + assertTrue(ownedResult.getAccess().getUserHasWriteAccess()); + + ExperimentSummaryWithAccess otherResult = results.get(1); + assertEquals("exp-other", otherResult.getSummary().getExperimentId()); + assertFalse(otherResult.getAccess().getIsOwner()); + assertFalse(otherResult.getAccess().getUserHasWriteAccess()); + } + @Test void getJobStatuses_delegatesToRegistry() throws Exception { Map statuses = Map.of("job-1", JobStatus.getDefaultInstance()); @@ -330,4 +447,52 @@ void getIntermediateOutputProcessStatus_returnsLatestStatus() throws Exception { assertEquals(ProcessState.PROCESS_STATE_EXECUTING, result.getState()); } + + private ExperimentModel experimentWithEmail(boolean enabled) { + return ExperimentModel.newBuilder() + .setExperimentName("e") + .setGatewayId("testGateway") + .setUserName("testUser") + .setEnableEmailNotification(enabled) + .addEmailAddresses("old@example.com") + .build(); + } + + @Test + void launchExperimentWithStorageSetup_overridesRecipientsWhenEnabled() throws Exception { + when(experimentRegistry.getExperiment("exp-1")).thenReturn(experimentWithEmail(true)); + ExperimentService spy = spy(experimentService); + doNothing().when(spy).launchExperiment(ctx, "exp-1", "testGateway"); + + spy.launchExperimentWithStorageSetup(ctx, "exp-1", "testGateway", "me@example.com"); + + ArgumentCaptor captor = ArgumentCaptor.forClass(ExperimentModel.class); + verify(experimentRegistry).updateExperiment(eq("exp-1"), captor.capture()); + assertEquals(List.of("me@example.com"), captor.getValue().getEmailAddressesList()); + verify(spy).launchExperiment(ctx, "exp-1", "testGateway"); + } + + @Test + void launchExperimentWithStorageSetup_noOverrideWhenNotificationsDisabled() throws Exception { + when(experimentRegistry.getExperiment("exp-1")).thenReturn(experimentWithEmail(false)); + ExperimentService spy = spy(experimentService); + doNothing().when(spy).launchExperiment(ctx, "exp-1", "testGateway"); + + spy.launchExperimentWithStorageSetup(ctx, "exp-1", "testGateway", "me@example.com"); + + verify(experimentRegistry, never()).updateExperiment(anyString(), any()); + verify(spy).launchExperiment(ctx, "exp-1", "testGateway"); + } + + @Test + void launchExperimentWithStorageSetup_noOverrideWhenEmailBlank() throws Exception { + when(experimentRegistry.getExperiment("exp-1")).thenReturn(experimentWithEmail(true)); + ExperimentService spy = spy(experimentService); + doNothing().when(spy).launchExperiment(ctx, "exp-1", "testGateway"); + + spy.launchExperimentWithStorageSetup(ctx, "exp-1", "testGateway", ""); + + verify(experimentRegistry, never()).updateExperiment(anyString(), any()); + verify(spy).launchExperiment(ctx, "exp-1", "testGateway"); + } } diff --git a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentSetIntegrationTest.java b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentSetIntegrationTest.java new file mode 100644 index 00000000000..e2e081f7a27 --- /dev/null +++ b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentSetIntegrationTest.java @@ -0,0 +1,216 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.service; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.*; + +import java.time.Instant; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import org.apache.airavata.api.experiment.ExperimentSpec; +import org.apache.airavata.api.experiment.ExperimentWithAccess; +import org.apache.airavata.api.experimentset.CreateExperimentSetRequest; +import org.apache.airavata.api.experimentset.ExperimentSet; +import org.apache.airavata.api.experimentset.SweepSpec; +import org.apache.airavata.api.experimentset.ValueList; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.db.EntityManagerFactoryHolder; +import org.apache.airavata.model.commons.proto.AccessFlags; +import org.apache.airavata.model.experiment.proto.ExperimentModel; +import org.apache.airavata.research.model.ExperimentSetEntity; +import org.apache.airavata.research.repository.ExperimentSetRepository; +import org.apache.airavata.util.TestBase; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; +import org.springframework.data.jpa.repository.support.JpaRepositoryFactory; + +@Tag("integration") +public class ExperimentSetIntegrationTest extends TestBase { + + private ExperimentSetRepository realRepository; + private ExperimentSetRepository repositorySpy; + private ExperimentService mockExperimentService; + private ExperimentSetService service; + private RequestContext ctx; + + @BeforeEach + @Override + public void setUp() throws Exception { + super.setUp(); + + realRepository = new JpaRepositoryFactory(EntityManagerFactoryHolder.getTestEntityManager()) + .getRepository(ExperimentSetRepository.class); + + // AuditingEntityListener does not fire in the bare-JPA test context. + // Intercept save() to stamp createdAt/updatedAt before delegating to the real repository. + repositorySpy = spy(realRepository); + doAnswer(inv -> { + ExperimentSetEntity entity = inv.getArgument(0); + Instant now = Instant.now(); + if (entity.getCreatedAt() == null) entity.setCreatedAt(now); + if (entity.getUpdatedAt() == null) entity.setUpdatedAt(now); + return realRepository.save(entity); + }).when(repositorySpy).save(any(ExperimentSetEntity.class)); + + mockExperimentService = mock(ExperimentService.class); + service = new ExperimentSetService(mockExperimentService, repositorySpy); + + ctx = new RequestContext("test-user", "test-gateway", "token", Map.of()); + } + + /** Returns a stub ExperimentWithAccess carrying the given experiment id. */ + private ExperimentWithAccess stubWith(String experimentId) { + ExperimentModel model = ExperimentModel.newBuilder() + .setExperimentId(experimentId) + .setUserName("test-user") + .setGatewayId("test-gateway") + .build(); + return ExperimentWithAccess.newBuilder() + .setExperiment(model) + .setAccess(AccessFlags.newBuilder().setIsOwner(true).build()) + .build(); + } + + /** Builds a 2×2 sweep request (axes: alpha=[a1,a2], beta=[b1,b2] → 4 combinations). */ + private CreateExperimentSetRequest build2x2SweepRequest() { + SweepSpec sweep = SweepSpec.newBuilder() + .setBase(ExperimentSpec.newBuilder() + .setExperimentName("base") + .setProjectId("proj-1") + .setApplicationInterfaceId("echo-app") + .putInputs("alpha", "a1") + .putInputs("beta", "b1") + .build()) + .putSweepAxes("alpha", ValueList.newBuilder().addValues("a1").addValues("a2").build()) + .putSweepAxes("beta", ValueList.newBuilder().addValues("b1").addValues("b2").build()) + .setNamePrefix("sweep-run") + .build(); + return CreateExperimentSetRequest.newBuilder() + .setSetName("integration-sweep") + .setSweep(sweep) + .build(); + } + + @Test + @DisplayName("createExperimentSet 2x2 sweep persists set with 4 members; getExperimentSet returns them") + void createAndGet() throws Exception { + AtomicInteger counter = new AtomicInteger(); + when(mockExperimentService.createExperimentFromSpec(eq(ctx), any(ExperimentSpec.class))) + .thenAnswer(inv -> stubWith("EXP-" + counter.getAndIncrement())); + + ExperimentSet created = service.createExperimentSet(ctx, build2x2SweepRequest()); + + assertNotNull(created.getExperimentSetId(), "set id must be assigned"); + assertFalse(created.getExperimentSetId().isBlank(), "set id must not be blank"); + assertEquals("integration-sweep", created.getSetName()); + assertEquals("test-user", created.getOwner()); + assertEquals("test-gateway", created.getGatewayId()); + assertEquals(4, created.getExperimentIdsCount(), "2×2 sweep must yield 4 member experiments"); + + // Flush to DB before clearing the L1 cache so subsequent em.find() sees the writes. + EntityManagerFactoryHolder.getTestEntityManager().flush(); + EntityManagerFactoryHolder.getTestEntityManager().clear(); + ExperimentSet reloaded = service.getExperimentSet(ctx, created.getExperimentSetId()); + + assertEquals(created.getExperimentSetId(), reloaded.getExperimentSetId()); + assertEquals("integration-sweep", reloaded.getSetName()); + assertEquals("test-user", reloaded.getOwner()); + assertEquals("test-gateway", reloaded.getGatewayId()); + assertEquals(4, reloaded.getExperimentIdsCount()); + assertTrue(reloaded.getExperimentIdsList().containsAll(List.of("EXP-0", "EXP-1", "EXP-2", "EXP-3"))); + + // sweepSpecJson was persisted + ExperimentSetEntity rawEntity = realRepository.findById(created.getExperimentSetId()).orElseThrow(); + assertNotNull(rawEntity.getSweepSpecJson()); + assertFalse(rawEntity.getSweepSpecJson().isBlank(), "sweepSpecJson must be non-empty"); + } + + @Test + @DisplayName("listExperimentSets returns the created set for the same owner+gateway") + void createAndList() throws Exception { + AtomicInteger counter = new AtomicInteger(); + when(mockExperimentService.createExperimentFromSpec(eq(ctx), any(ExperimentSpec.class))) + .thenAnswer(inv -> stubWith("EXP-" + counter.getAndIncrement())); + + ExperimentSet created = service.createExperimentSet(ctx, build2x2SweepRequest()); + + EntityManagerFactoryHolder.getTestEntityManager().flush(); + EntityManagerFactoryHolder.getTestEntityManager().clear(); + + List sets = service.listExperimentSets(ctx, 0, 0); + assertEquals(1, sets.size()); + assertEquals(created.getExperimentSetId(), sets.get(0).getExperimentSetId()); + assertEquals(4, sets.get(0).getExperimentIdsCount()); + + // Different owner sees nothing + RequestContext otherCtx = new RequestContext("other-user", "test-gateway", "token", Map.of()); + List otherSets = service.listExperimentSets(otherCtx, 0, 0); + assertTrue(otherSets.isEmpty(), "different owner must not see the set"); + } + + @Test + @DisplayName("deleteExperimentSet removes the set and cascades member rows; stubs experiments untouched") + void deleteSet() throws Exception { + AtomicInteger counter = new AtomicInteger(); + when(mockExperimentService.createExperimentFromSpec(eq(ctx), any(ExperimentSpec.class))) + .thenAnswer(inv -> stubWith("EXP-" + counter.getAndIncrement())); + + ExperimentSet created = service.createExperimentSet(ctx, build2x2SweepRequest()); + String setId = created.getExperimentSetId(); + + // Flush to DB before clearing the L1 cache so the JPQL member count query sees the writes. + EntityManagerFactoryHolder.getTestEntityManager().flush(); + EntityManagerFactoryHolder.getTestEntityManager().clear(); + + // Confirm members exist before delete + long membersBefore = EntityManagerFactoryHolder.getTestEntityManager() + .createQuery( + "SELECT COUNT(m) FROM ExperimentSetMemberEntity m WHERE m.experimentSet.id = :setId", + Long.class) + .setParameter("setId", setId) + .getSingleResult(); + assertEquals(4L, membersBefore, "4 member rows must exist before delete"); + + service.deleteExperimentSet(ctx, setId); + realRepository.flush(); + EntityManagerFactoryHolder.getTestEntityManager().clear(); + + // Set is gone + assertFalse(realRepository.existsById(setId), "set must not exist after delete"); + + // Member rows are gone (cascade) + long membersAfter = EntityManagerFactoryHolder.getTestEntityManager() + .createQuery( + "SELECT COUNT(m) FROM ExperimentSetMemberEntity m WHERE m.experimentSet.id = :setId", + Long.class) + .setParameter("setId", setId) + .getSingleResult(); + assertEquals(0L, membersAfter, "member rows must be cascaded on set delete"); + + // deleteExperiment was never called — set is a grouping, not an owner + verify(mockExperimentService, never()).deleteExperiment(any(), any()); + } +} diff --git a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentSetServiceStatusTest.java b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentSetServiceStatusTest.java new file mode 100644 index 00000000000..d2d9090a2fa --- /dev/null +++ b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentSetServiceStatusTest.java @@ -0,0 +1,450 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.service; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import org.apache.airavata.api.experimentset.AggregateState; +import org.apache.airavata.api.experimentset.ExperimentSet; +import org.apache.airavata.api.experimentset.ExperimentSetStatus; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.exception.ServiceException; +import org.apache.airavata.model.experiment.proto.ExperimentModel; +import org.apache.airavata.model.process.proto.ProcessModel; +import org.apache.airavata.model.status.proto.ExperimentState; +import org.apache.airavata.model.status.proto.ExperimentStatus; +import org.apache.airavata.research.model.ExperimentSetEntity; +import org.apache.airavata.research.model.ExperimentSetMemberEntity; +import org.apache.airavata.research.repository.ExperimentSetRepository; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; + +@ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) +class ExperimentSetServiceStatusTest { + + @Mock + ExperimentService experimentService; + + @Mock + ExperimentSetRepository experimentSetRepository; + + ExperimentSetService experimentSetService; + RequestContext ctx; + + @BeforeEach + void setUp() { + experimentSetService = new ExperimentSetService(experimentService, experimentSetRepository); + ctx = new RequestContext( + "testUser", + "testGateway", + "token123", + Map.of("userName", "testUser", "gatewayId", "testGateway"), + List.of("admin-rw")); + } + + // ---- helpers ---- + + private ExperimentSetEntity makeEntity(String setId, String... experimentIds) { + ExperimentSetEntity entity = new ExperimentSetEntity(); + entity.setId(setId); + entity.setSetName("test-set"); + entity.setOwner("testUser"); + entity.setGatewayId("testGateway"); + entity.setCreatedAt(Instant.now()); + entity.setUpdatedAt(Instant.now()); + + List members = new ArrayList<>(); + for (int i = 0; i < experimentIds.length; i++) { + ExperimentSetMemberEntity m = new ExperimentSetMemberEntity(); + m.setExperimentId(experimentIds[i]); + m.setOrdinal(i); + m.setExperimentSet(entity); + members.add(m); + } + entity.setMembers(members); + return entity; + } + + private ExperimentModel makeExperiment(String id, ExperimentState state) { + return ExperimentModel.newBuilder() + .setExperimentId(id) + .setUserName("testUser") + .setGatewayId("testGateway") + .addExperimentStatus(ExperimentStatus.newBuilder() + .setState(state) + .setTimeOfStateChange(System.currentTimeMillis()) + .build()) + .build(); + } + + private ExperimentModel makeExperimentWithProcess(String id, ExperimentState state, String processId) { + return ExperimentModel.newBuilder() + .setExperimentId(id) + .setUserName("testUser") + .setGatewayId("testGateway") + .addExperimentStatus(ExperimentStatus.newBuilder() + .setState(state) + .setTimeOfStateChange(System.currentTimeMillis()) + .build()) + .addProcesses(ProcessModel.newBuilder().setProcessId(processId).build()) + .build(); + } + + // ---- aggregate helper unit tests ---- + + @Test + void aggregate_empty_returnsQueued() { + assertEquals(AggregateState.QUEUED, ExperimentSetService.aggregate(List.of())); + } + + @Test + void aggregate_allCompleted_returnsCompleted() { + assertEquals( + AggregateState.COMPLETED, + ExperimentSetService.aggregate(List.of( + "EXPERIMENT_STATE_COMPLETED", + "EXPERIMENT_STATE_COMPLETED", + "EXPERIMENT_STATE_COMPLETED"))); + } + + @Test + void aggregate_allTerminalFailure_returnsFailed() { + assertEquals( + AggregateState.FAILED, + ExperimentSetService.aggregate(List.of( + "EXPERIMENT_STATE_FAILED", + "EXPERIMENT_STATE_CANCELED", + "EXPERIMENT_STATE_FAILED"))); + } + + @Test + void aggregate_mixedExecutingAndCreated_returnsRunning() { + assertEquals( + AggregateState.RUNNING, + ExperimentSetService.aggregate(List.of( + "EXPERIMENT_STATE_EXECUTING", + "EXPERIMENT_STATE_CREATED", + "EXPERIMENT_STATE_LAUNCHED"))); + } + + @Test + void aggregate_allCreated_returnsQueued() { + assertEquals( + AggregateState.QUEUED, + ExperimentSetService.aggregate(List.of( + "EXPERIMENT_STATE_CREATED", + "EXPERIMENT_STATE_VALIDATED", + "EXPERIMENT_STATE_CREATED"))); + } + + @Test + void aggregate_mixedCompletedAndFailed_returnsMixed() { + assertEquals( + AggregateState.MIXED, + ExperimentSetService.aggregate(List.of( + "EXPERIMENT_STATE_COMPLETED", + "EXPERIMENT_STATE_COMPLETED", + "EXPERIMENT_STATE_EXECUTING", + "EXPERIMENT_STATE_FAILED"))); + } + + // ---- getExperimentSetStatus tests ---- + + @Test + void getExperimentSetStatus_mixedStates_correctCountsAndMixed() throws Exception { + // 4 experiments: COMPLETED, COMPLETED, EXECUTING, FAILED → MIXED + ExperimentSetEntity entity = makeEntity("set-1", "e1", "e2", "e3", "e4"); + when(experimentSetRepository.findById("set-1")).thenReturn(Optional.of(entity)); + when(experimentService.getExperiment(ctx, "e1")).thenReturn(makeExperiment("e1", ExperimentState.EXPERIMENT_STATE_COMPLETED)); + when(experimentService.getExperiment(ctx, "e2")).thenReturn(makeExperiment("e2", ExperimentState.EXPERIMENT_STATE_COMPLETED)); + when(experimentService.getExperiment(ctx, "e3")).thenReturn(makeExperiment("e3", ExperimentState.EXPERIMENT_STATE_EXECUTING)); + when(experimentService.getExperiment(ctx, "e4")).thenReturn(makeExperiment("e4", ExperimentState.EXPERIMENT_STATE_FAILED)); + + ExperimentSetStatus status = experimentSetService.getExperimentSetStatus(ctx, "set-1"); + + assertEquals(4, status.getTotal()); + assertEquals(AggregateState.MIXED, status.getAggregate()); + assertEquals(2, status.getCountsByStateOrDefault("EXPERIMENT_STATE_COMPLETED", 0)); + assertEquals(1, status.getCountsByStateOrDefault("EXPERIMENT_STATE_EXECUTING", 0)); + assertEquals(1, status.getCountsByStateOrDefault("EXPERIMENT_STATE_FAILED", 0)); + assertEquals(4, status.getItemsCount()); + } + + @Test + void getExperimentSetStatus_allCompleted_returnsCompleted() throws Exception { + ExperimentSetEntity entity = makeEntity("set-2", "e1", "e2"); + when(experimentSetRepository.findById("set-2")).thenReturn(Optional.of(entity)); + when(experimentService.getExperiment(ctx, "e1")).thenReturn(makeExperiment("e1", ExperimentState.EXPERIMENT_STATE_COMPLETED)); + when(experimentService.getExperiment(ctx, "e2")).thenReturn(makeExperiment("e2", ExperimentState.EXPERIMENT_STATE_COMPLETED)); + + ExperimentSetStatus status = experimentSetService.getExperimentSetStatus(ctx, "set-2"); + + assertEquals(AggregateState.COMPLETED, status.getAggregate()); + assertEquals(2, status.getCountsByStateOrDefault("EXPERIMENT_STATE_COMPLETED", 0)); + } + + @Test + void getExperimentSetStatus_allFailedOrCanceled_returnsFailed() throws Exception { + ExperimentSetEntity entity = makeEntity("set-3", "e1", "e2"); + when(experimentSetRepository.findById("set-3")).thenReturn(Optional.of(entity)); + when(experimentService.getExperiment(ctx, "e1")).thenReturn(makeExperiment("e1", ExperimentState.EXPERIMENT_STATE_FAILED)); + when(experimentService.getExperiment(ctx, "e2")).thenReturn(makeExperiment("e2", ExperimentState.EXPERIMENT_STATE_CANCELED)); + + ExperimentSetStatus status = experimentSetService.getExperimentSetStatus(ctx, "set-3"); + + assertEquals(AggregateState.FAILED, status.getAggregate()); + } + + @Test + void getExperimentSetStatus_executingAndCreated_returnsRunning() throws Exception { + ExperimentSetEntity entity = makeEntity("set-4", "e1", "e2"); + when(experimentSetRepository.findById("set-4")).thenReturn(Optional.of(entity)); + when(experimentService.getExperiment(ctx, "e1")).thenReturn(makeExperiment("e1", ExperimentState.EXPERIMENT_STATE_EXECUTING)); + when(experimentService.getExperiment(ctx, "e2")).thenReturn(makeExperiment("e2", ExperimentState.EXPERIMENT_STATE_CREATED)); + + ExperimentSetStatus status = experimentSetService.getExperimentSetStatus(ctx, "set-4"); + + assertEquals(AggregateState.RUNNING, status.getAggregate()); + } + + @Test + void getExperimentSetStatus_allCreated_returnsQueued() throws Exception { + ExperimentSetEntity entity = makeEntity("set-5", "e1", "e2"); + when(experimentSetRepository.findById("set-5")).thenReturn(Optional.of(entity)); + when(experimentService.getExperiment(ctx, "e1")).thenReturn(makeExperiment("e1", ExperimentState.EXPERIMENT_STATE_CREATED)); + when(experimentService.getExperiment(ctx, "e2")).thenReturn(makeExperiment("e2", ExperimentState.EXPERIMENT_STATE_CREATED)); + + ExperimentSetStatus status = experimentSetService.getExperimentSetStatus(ctx, "set-5"); + + assertEquals(AggregateState.QUEUED, status.getAggregate()); + } + + @Test + void getExperimentSetStatus_includesProcessId_whenProcessPresent() throws Exception { + ExperimentSetEntity entity = makeEntity("set-6", "e1"); + when(experimentSetRepository.findById("set-6")).thenReturn(Optional.of(entity)); + when(experimentService.getExperiment(ctx, "e1")) + .thenReturn(makeExperimentWithProcess("e1", ExperimentState.EXPERIMENT_STATE_EXECUTING, "proc-42")); + + ExperimentSetStatus status = experimentSetService.getExperimentSetStatus(ctx, "set-6"); + + assertEquals(1, status.getItemsCount()); + assertEquals("proc-42", status.getItems(0).getProcessId()); + assertEquals("e1", status.getItems(0).getExperimentId()); + } + + @Test + void getExperimentSetStatus_wrongOwner_throwsNoSuchElement() throws Exception { + ExperimentSetEntity entity = makeEntity("set-7", "e1"); + entity.setOwner("otherUser"); + when(experimentSetRepository.findById("set-7")).thenReturn(Optional.of(entity)); + + assertThrows(java.util.NoSuchElementException.class, + () -> experimentSetService.getExperimentSetStatus(ctx, "set-7")); + } + + @Test + void getExperimentSetStatus_notFound_throwsNoSuchElement() { + when(experimentSetRepository.findById("set-x")).thenReturn(Optional.empty()); + + assertThrows(java.util.NoSuchElementException.class, + () -> experimentSetService.getExperimentSetStatus(ctx, "set-x")); + } + + // ---- launchExperimentSet tests ---- + + @Test + void launchExperimentSet_threeMembers_secondThrows_allThreeAttempted_doesNotThrow() throws Exception { + ExperimentSetEntity entity = makeEntity("set-launch", "e1", "e2", "e3"); + when(experimentSetRepository.findById("set-launch")).thenReturn(Optional.of(entity)); + + doNothing().when(experimentService).launchExperimentWithStorageSetup(ctx, "e1", "testGateway", "test@example.com"); + doThrow(new ServiceException("launch failed")).when(experimentService) + .launchExperimentWithStorageSetup(ctx, "e2", "testGateway", "test@example.com"); + doNothing().when(experimentService).launchExperimentWithStorageSetup(ctx, "e3", "testGateway", "test@example.com"); + + // Must NOT throw even though e2 failed + ExperimentSet result = assertDoesNotThrow( + () -> experimentSetService.launchExperimentSet(ctx, "set-launch", "test@example.com")); + + verify(experimentService, times(1)).launchExperimentWithStorageSetup(ctx, "e1", "testGateway", "test@example.com"); + verify(experimentService, times(1)).launchExperimentWithStorageSetup(ctx, "e2", "testGateway", "test@example.com"); + verify(experimentService, times(1)).launchExperimentWithStorageSetup(ctx, "e3", "testGateway", "test@example.com"); + + assertEquals("set-launch", result.getExperimentSetId()); + } + + @Test + void launchExperimentSet_wrongOwner_throwsNoSuchElement() { + ExperimentSetEntity entity = makeEntity("set-8", "e1"); + entity.setOwner("otherUser"); + when(experimentSetRepository.findById("set-8")).thenReturn(Optional.of(entity)); + + assertThrows(java.util.NoSuchElementException.class, + () -> experimentSetService.launchExperimentSet(ctx, "set-8", "test@example.com")); + } + + // ---- getExperimentSet tests ---- + + @Test + void getExperimentSet_ownerMatch_returnsProto() throws Exception { + ExperimentSetEntity entity = makeEntity("set-9", "e1", "e2"); + when(experimentSetRepository.findById("set-9")).thenReturn(Optional.of(entity)); + + ExperimentSet result = experimentSetService.getExperimentSet(ctx, "set-9"); + + assertEquals("set-9", result.getExperimentSetId()); + assertEquals(2, result.getExperimentIdsCount()); + } + + @Test + void getExperimentSet_wrongOwner_throwsNoSuchElement() { + ExperimentSetEntity entity = makeEntity("set-10", "e1"); + entity.setOwner("otherUser"); + when(experimentSetRepository.findById("set-10")).thenReturn(Optional.of(entity)); + + assertThrows(java.util.NoSuchElementException.class, + () -> experimentSetService.getExperimentSet(ctx, "set-10")); + } + + // ---- listExperimentSets tests ---- + + @Test + void listExperimentSets_limitsResults() throws Exception { + ExperimentSetEntity e1 = makeEntity("s1", "exp1"); + ExperimentSetEntity e2 = makeEntity("s2", "exp2"); + ExperimentSetEntity e3 = makeEntity("s3", "exp3"); + when(experimentSetRepository.findByOwnerAndGatewayIdOrderByCreatedAtDesc("testUser", "testGateway")) + .thenReturn(List.of(e1, e2, e3)); + + List result = experimentSetService.listExperimentSets(ctx, 2, 0); + + assertEquals(2, result.size()); + assertEquals("s1", result.get(0).getExperimentSetId()); + } + + @Test + void listExperimentSets_offsetAndLimit() throws Exception { + ExperimentSetEntity e1 = makeEntity("s1", "exp1"); + ExperimentSetEntity e2 = makeEntity("s2", "exp2"); + ExperimentSetEntity e3 = makeEntity("s3", "exp3"); + when(experimentSetRepository.findByOwnerAndGatewayIdOrderByCreatedAtDesc("testUser", "testGateway")) + .thenReturn(List.of(e1, e2, e3)); + + List result = experimentSetService.listExperimentSets(ctx, 2, 1); + + assertEquals(2, result.size()); + assertEquals("s2", result.get(0).getExperimentSetId()); + assertEquals("s3", result.get(1).getExperimentSetId()); + } + + @Test + void listExperimentSets_zeroLimit_returnsAll() throws Exception { + ExperimentSetEntity e1 = makeEntity("s1", "exp1"); + ExperimentSetEntity e2 = makeEntity("s2", "exp2"); + when(experimentSetRepository.findByOwnerAndGatewayIdOrderByCreatedAtDesc("testUser", "testGateway")) + .thenReturn(List.of(e1, e2)); + + List result = experimentSetService.listExperimentSets(ctx, 0, 0); + + assertEquals(2, result.size()); + } + + // ---- deleteExperimentSet tests ---- + + @Test + void deleteExperimentSet_ownerMatch_deletesById() throws Exception { + ExperimentSetEntity entity = makeEntity("set-del", "e1"); + when(experimentSetRepository.findById("set-del")).thenReturn(Optional.of(entity)); + + experimentSetService.deleteExperimentSet(ctx, "set-del"); + + verify(experimentSetRepository, times(1)).deleteById("set-del"); + } + + @Test + void deleteExperimentSet_wrongOwner_throwsNoSuchElement() { + ExperimentSetEntity entity = makeEntity("set-del2", "e1"); + entity.setOwner("otherUser"); + when(experimentSetRepository.findById("set-del2")).thenReturn(Optional.of(entity)); + + assertThrows(java.util.NoSuchElementException.class, + () -> experimentSetService.deleteExperimentSet(ctx, "set-del2")); + verify(experimentSetRepository, never()).deleteById(any()); + } + + // ---- Fix 1: gateway scoping in loadOwned ---- + + @Test + void getExperimentSet_wrongGateway_throwsNoSuchElement() { + // Same userId as ctx but different gatewayId — must be treated as not-found + ExperimentSetEntity entity = makeEntity("set-gw", "e1"); + entity.setGatewayId("otherGateway"); + when(experimentSetRepository.findById("set-gw")).thenReturn(Optional.of(entity)); + + assertThrows(java.util.NoSuchElementException.class, + () -> experimentSetService.getExperimentSet(ctx, "set-gw")); + } + + // ---- Fix 2: null guard in getExperimentSetStatus ---- + + @Test + void getExperimentSetStatus_nullExperiment_countedAsUnknown_noException() throws Exception { + // e1 returns null (e.g. experiment from another gateway that caller cannot read), + // e2 is a normal COMPLETED experiment. + ExperimentSetEntity entity = makeEntity("set-null", "e1", "e2"); + when(experimentSetRepository.findById("set-null")).thenReturn(Optional.of(entity)); + when(experimentService.getExperiment(ctx, "e1")).thenReturn(null); + when(experimentService.getExperiment(ctx, "e2")) + .thenReturn(makeExperiment("e2", ExperimentState.EXPERIMENT_STATE_COMPLETED)); + + ExperimentSetStatus status = assertDoesNotThrow( + () -> experimentSetService.getExperimentSetStatus(ctx, "set-null")); + + // Total includes all members — both e1 and e2 + assertEquals(2, status.getTotal()); + // e1 counted as UNKNOWN + assertEquals(1, status.getCountsByStateOrDefault("EXPERIMENT_STATE_UNKNOWN", 0)); + // e2 counted as COMPLETED + assertEquals(1, status.getCountsByStateOrDefault("EXPERIMENT_STATE_COMPLETED", 0)); + // Items list has both members + assertEquals(2, status.getItemsCount()); + // The unknown item has empty processId + var unknownItem = status.getItemsList().stream() + .filter(i -> i.getExperimentId().equals("e1")) + .findFirst() + .orElseThrow(); + assertEquals("EXPERIMENT_STATE_UNKNOWN", unknownItem.getState()); + assertEquals("", unknownItem.getProcessId()); + } +} diff --git a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentSetServiceTest.java b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentSetServiceTest.java new file mode 100644 index 00000000000..1ea18715a0e --- /dev/null +++ b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ExperimentSetServiceTest.java @@ -0,0 +1,195 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.service; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import org.apache.airavata.api.experiment.ExperimentSpec; +import org.apache.airavata.api.experiment.ExperimentWithAccess; +import org.apache.airavata.api.experimentset.CreateExperimentSetRequest; +import org.apache.airavata.api.experimentset.ExperimentSet; +import org.apache.airavata.api.experimentset.SweepSpec; +import org.apache.airavata.api.experimentset.ValueList; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.exception.ServiceException; +import org.apache.airavata.model.commons.proto.AccessFlags; +import org.apache.airavata.model.experiment.proto.ExperimentModel; +import org.apache.airavata.research.model.ExperimentSetEntity; +import org.apache.airavata.research.repository.ExperimentSetRepository; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; + +@ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) +class ExperimentSetServiceTest { + + @Mock + ExperimentService experimentService; + + @Mock + ExperimentSetRepository experimentSetRepository; + + ExperimentSetService experimentSetService; + RequestContext ctx; + + @BeforeEach + void setUp() { + experimentSetService = new ExperimentSetService(experimentService, experimentSetRepository); + ctx = new RequestContext( + "testUser", + "testGateway", + "token123", + Map.of("userName", "testUser", "gatewayId", "testGateway"), + List.of("admin-rw")); + } + + private ExperimentWithAccess stubExperimentWithId(String id) { + ExperimentModel model = ExperimentModel.newBuilder() + .setExperimentId(id) + .setUserName("testUser") + .setGatewayId("testGateway") + .build(); + return ExperimentWithAccess.newBuilder() + .setExperiment(model) + .setAccess(AccessFlags.newBuilder().setIsOwner(true).build()) + .build(); + } + + private ExperimentSetEntity savedEntityWithId(ExperimentSetEntity entity) { + entity.setId("set-1"); + return entity; + } + + @Test + void createExperimentSet_sweep_callsCreateFromSpecFourTimes_andPersistsSet() throws Exception { + // 2 x 2 sweep axes + SweepSpec sweep = SweepSpec.newBuilder() + .setBase(ExperimentSpec.newBuilder() + .setExperimentName("base-run") + .setProjectId("proj-1") + .setApplicationInterfaceId("echo-app") + .putInputs("temp", "300") + .putInputs("app", "echo") + .build()) + .putSweepAxes("temp", ValueList.newBuilder().addValues("300").addValues("400").build()) + .putSweepAxes("salt", ValueList.newBuilder().addValues("lo").addValues("hi").build()) + .setNamePrefix("run") + .build(); + + CreateExperimentSetRequest req = CreateExperimentSetRequest.newBuilder() + .setSetName("my-sweep") + .setSweep(sweep) + .build(); + + when(experimentService.createExperimentFromSpec(eq(ctx), any(ExperimentSpec.class))) + .thenReturn(stubExperimentWithId("exp-0")) + .thenReturn(stubExperimentWithId("exp-1")) + .thenReturn(stubExperimentWithId("exp-2")) + .thenReturn(stubExperimentWithId("exp-3")); + + when(experimentSetRepository.save(any(ExperimentSetEntity.class))).thenAnswer(inv -> { + ExperimentSetEntity e = inv.getArgument(0); + e.setId("set-1"); + return e; + }); + + ExperimentSet result = experimentSetService.createExperimentSet(ctx, req); + + // createExperimentFromSpec called exactly 4 times + ArgumentCaptor specCaptor = ArgumentCaptor.forClass(ExperimentSpec.class); + verify(experimentService, times(4)).createExperimentFromSpec(eq(ctx), specCaptor.capture()); + + List capturedSpecs = specCaptor.getAllValues(); + // Each spec should have the correct name suffix (run_0 through run_3) + Set names = capturedSpecs.stream().map(ExperimentSpec::getExperimentName).collect(Collectors.toSet()); + assertEquals(Set.of("run_0", "run_1", "run_2", "run_3"), names); + + // All specs carry the base "app" key + for (ExperimentSpec s : capturedSpecs) { + assertEquals("echo", s.getInputsMap().get("app")); + } + + // The sweep covers all temp x salt combinations + Set temps = capturedSpecs.stream() + .map(s -> s.getInputsMap().get("temp")) + .collect(Collectors.toSet()); + assertEquals(Set.of("300", "400"), temps); + + // Repository saved once + verify(experimentSetRepository, times(1)).save(any(ExperimentSetEntity.class)); + + // Result has 4 member ids + assertEquals(4, result.getExperimentIdsCount()); + assertTrue(result.getExperimentIdsList().containsAll(List.of("exp-0", "exp-1", "exp-2", "exp-3"))); + + // sweepSpecJson was stored (non-empty means it was serialized) + // We validate via the ArgumentCaptor on the saved entity + ArgumentCaptor entityCaptor = ArgumentCaptor.forClass(ExperimentSetEntity.class); + verify(experimentSetRepository).save(entityCaptor.capture()); + assertNotNull(entityCaptor.getValue().getSweepSpecJson()); + assertFalse(entityCaptor.getValue().getSweepSpecJson().isEmpty()); + } + + @Test + void createExperimentSet_sweep_thirdCallThrows_rollsBackAndDoesNotPersist() throws Exception { + SweepSpec sweep = SweepSpec.newBuilder() + .setBase(ExperimentSpec.newBuilder() + .setExperimentName("base-run") + .setProjectId("proj-1") + .setApplicationInterfaceId("echo-app") + .putInputs("temp", "300") + .build()) + .putSweepAxes("temp", ValueList.newBuilder().addValues("300").addValues("400").build()) + .putSweepAxes("salt", ValueList.newBuilder().addValues("lo").addValues("hi").build()) + .setNamePrefix("run") + .build(); + + CreateExperimentSetRequest req = CreateExperimentSetRequest.newBuilder() + .setSetName("failing-sweep") + .setSweep(sweep) + .build(); + + when(experimentService.createExperimentFromSpec(eq(ctx), any(ExperimentSpec.class))) + .thenReturn(stubExperimentWithId("exp-0")) + .thenReturn(stubExperimentWithId("exp-1")) + .thenThrow(new ServiceException("creation failed on 3rd")); + + assertThrows(ServiceException.class, () -> experimentSetService.createExperimentSet(ctx, req)); + + // The 2 already-created experiments should be deleted (cleanup) + verify(experimentService).deleteExperiment(ctx, "exp-0"); + verify(experimentService).deleteExperiment(ctx, "exp-1"); + + // Repository save must NOT have been called + verify(experimentSetRepository, never()).save(any()); + } +} diff --git a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/NotificationServiceTest.java b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/NotificationServiceTest.java index f06737b7e9b..b974b529b6f 100644 --- a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/NotificationServiceTest.java +++ b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/NotificationServiceTest.java @@ -24,6 +24,8 @@ import java.util.List; import java.util.Map; +import org.apache.airavata.api.notification.GetAllNotificationsWithAccessResponse; +import org.apache.airavata.api.notification.NotificationWithAccess; import org.apache.airavata.config.RequestContext; import org.apache.airavata.interfaces.ProjectRegistry; import org.apache.airavata.model.workspace.proto.Notification; @@ -112,4 +114,58 @@ void getAllNotifications_delegatesToRegistry() throws Exception { assertEquals(2, result.size()); verify(projectRegistry).getAllNotifications("testGateway"); } + + // Notifications are gateway-level broadcast entities with no owner/sharing entity, so this test + // class has no SharingFacade. The *WithAccess flags are is_owner=false and + // user_has_write_access=ctx.isGatewayAdmin(): a non-admin ctx (default setUp, no roles) yields + // false, an admin-rw ctx yields true. + @Test + void getNotificationWithAccess_nonAdmin_stampsNoWriteAccess() throws Exception { + Notification notification = + Notification.newBuilder().setNotificationId("notif-1").build(); + when(projectRegistry.getNotification("testGateway", "notif-1")).thenReturn(notification); + + NotificationWithAccess result = notificationService.getNotificationWithAccess(ctx, "testGateway", "notif-1"); + + assertEquals("notif-1", result.getNotification().getNotificationId()); + assertFalse(result.getAccess().getIsOwner()); + assertFalse(result.getAccess().getUserHasWriteAccess()); + verify(projectRegistry).getNotification("testGateway", "notif-1"); + } + + @Test + void getNotificationWithAccess_gatewayAdmin_stampsWriteAccess() throws Exception { + RequestContext adminCtx = new RequestContext( + "adminUser", + "testGateway", + "token123", + Map.of("userName", "adminUser", "gatewayId", "testGateway"), + List.of("admin-rw")); + Notification notification = + Notification.newBuilder().setNotificationId("notif-1").build(); + when(projectRegistry.getNotification("testGateway", "notif-1")).thenReturn(notification); + + NotificationWithAccess result = + notificationService.getNotificationWithAccess(adminCtx, "testGateway", "notif-1"); + + assertFalse(result.getAccess().getIsOwner()); + assertTrue(result.getAccess().getUserHasWriteAccess()); + } + + @Test + void getAllNotificationsWithAccess_stampsCallerFlags() throws Exception { + Notification n1 = Notification.newBuilder().setNotificationId("notif-1").build(); + Notification n2 = Notification.newBuilder().setNotificationId("notif-2").build(); + when(projectRegistry.getAllNotifications("testGateway")).thenReturn(List.of(n1, n2)); + + GetAllNotificationsWithAccessResponse result = + notificationService.getAllNotificationsWithAccess(ctx, "testGateway"); + + assertEquals(2, result.getNotificationsCount()); + for (NotificationWithAccess nwa : result.getNotificationsList()) { + assertFalse(nwa.getAccess().getIsOwner()); + assertFalse(nwa.getAccess().getUserHasWriteAccess()); + } + verify(projectRegistry).getAllNotifications("testGateway"); + } } diff --git a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ProjectServiceTest.java b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ProjectServiceTest.java index 974e57527ea..d4f79c776e0 100644 --- a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ProjectServiceTest.java +++ b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/ProjectServiceTest.java @@ -25,9 +25,11 @@ import java.util.List; import java.util.Map; +import org.apache.airavata.api.project.ProjectWithAccess; import org.apache.airavata.config.RequestContext; import org.apache.airavata.exception.ServiceAuthorizationException; import org.apache.airavata.exception.ServiceException; +import org.apache.airavata.exception.ServiceNotFoundException; import org.apache.airavata.interfaces.ProjectRegistry; import org.apache.airavata.interfaces.SharingFacade; import org.apache.airavata.model.workspace.proto.Project; @@ -150,6 +152,161 @@ void getUserProjects_delegatesToRegistry() throws Exception { assertEquals(2, result.size()); } + @Test + void getMostRecentWritableProject_picksNewestWritable() throws Exception { + // Caller-bound candidate set (sharing enabled path: searchEntityIds + searchProjects). + when(sharingHandler.searchEntityIds(eq("testGateway"), eq("testUser@testGateway"), anyList(), eq(0), eq(-1))) + .thenReturn(List.of("proj-old", "proj-new")); + + Project older = Project.newBuilder() + .setProjectId("proj-old") + .setOwner("testUser") + .setGatewayId("testGateway") + .setCreationTime(1000L) + .build(); + Project newer = Project.newBuilder() + .setProjectId("proj-new") + .setOwner("testUser") + .setGatewayId("testGateway") + .setCreationTime(2000L) + .build(); + when(projectRegistry.searchProjects(eq("testGateway"), eq("testUser"), anyList(), anyMap(), anyInt(), anyInt())) + .thenReturn(List.of(older, newer)); + + ProjectWithAccess result = projectService.getMostRecentWritableProject(ctx, "testGateway", "testUser"); + + assertEquals("proj-new", result.getProject().getProjectId()); + assertTrue(result.getAccess().getIsOwner()); + assertTrue(result.getAccess().getUserHasWriteAccess()); + } + + @Test + void getMostRecentWritableProject_usesWriteGrantForNonOwner() throws Exception { + when(sharingHandler.searchEntityIds(eq("testGateway"), eq("testUser@testGateway"), anyList(), eq(0), eq(-1))) + .thenReturn(List.of("proj-shared")); + + Project shared = Project.newBuilder() + .setProjectId("proj-shared") + .setOwner("otherUser") + .setGatewayId("testGateway") + .setCreationTime(5000L) + .build(); + when(projectRegistry.searchProjects(eq("testGateway"), eq("testUser"), anyList(), anyMap(), anyInt(), anyInt())) + .thenReturn(List.of(shared)); + // Sharing enabled: non-owner holds a WRITE grant. + when(sharingHandler.userHasAccess("testGateway", "testUser@testGateway", "proj-shared", "testGateway:WRITE")) + .thenReturn(true); + + ProjectWithAccess result = projectService.getMostRecentWritableProject(ctx, "testGateway", "testUser"); + + assertEquals("proj-shared", result.getProject().getProjectId()); + assertFalse(result.getAccess().getIsOwner()); + assertTrue(result.getAccess().getUserHasWriteAccess()); + } + + @Test + void getMostRecentWritableProject_throwsWhenNoneWritable() throws Exception { + // Empty caller-accessible set -> getUserProjects returns empty -> NOT_FOUND. + when(sharingHandler.searchEntityIds(eq("testGateway"), eq("testUser@testGateway"), anyList(), eq(0), eq(-1))) + .thenReturn(List.of()); + + assertThrows( + ServiceNotFoundException.class, + () -> projectService.getMostRecentWritableProject(ctx, "testGateway", "testUser")); + } + + @Test + void createProjectWithAccess_ownerGetsFullAccess() throws Exception { + Project project = Project.newBuilder() + .setName("test-proj") + .setGatewayId("testGateway") + .setOwner("testUser") + .build(); + + when(projectRegistry.createProject("testGateway", project)).thenReturn("proj-123"); + // getProjectWithAccess re-reads the new project to derive flags from a single source of truth. + Project created = project.toBuilder().setProjectId("proj-123").build(); + when(projectRegistry.getProject("proj-123")).thenReturn(created); + + ProjectWithAccess result = projectService.createProjectWithAccess(ctx, "testGateway", project); + + assertEquals("proj-123", result.getProject().getProjectId()); + assertTrue(result.getAccess().getIsOwner()); + assertTrue(result.getAccess().getUserHasWriteAccess()); + verify(projectRegistry).createProject("testGateway", project); + } + + @Test + void updateProjectWithAccess_ownerGetsFullAccess() throws Exception { + Project existing = Project.newBuilder() + .setProjectId("proj-123") + .setOwner("testUser") + .setGatewayId("testGateway") + .build(); + Project updated = Project.newBuilder() + .setProjectId("proj-123") + .setOwner("testUser") + .setGatewayId("testGateway") + .setName("renamed") + .build(); + + when(projectRegistry.getProject("proj-123")).thenReturn(existing); + + ProjectWithAccess result = projectService.updateProjectWithAccess(ctx, "proj-123", updated); + + assertEquals("proj-123", result.getProject().getProjectId()); + assertTrue(result.getAccess().getIsOwner()); + assertTrue(result.getAccess().getUserHasWriteAccess()); + verify(projectRegistry).updateProject("proj-123", updated); + } + + @Test + void updateProjectWithAccess_nonOwnerWithWriteGrant() throws Exception { + Project existing = Project.newBuilder() + .setProjectId("proj-123") + .setOwner("otherUser") + .setGatewayId("testGateway") + .build(); + Project updated = Project.newBuilder() + .setProjectId("proj-123") + .setOwner("otherUser") + .setGatewayId("testGateway") + .setName("renamed") + .build(); + + when(projectRegistry.getProject("proj-123")).thenReturn(existing); + // Sharing enabled: non-owner holds a WRITE grant on this project. + when(sharingHandler.userHasAccess("testGateway", "testUser@testGateway", "proj-123", "testGateway:WRITE")) + .thenReturn(true); + + ProjectWithAccess result = projectService.updateProjectWithAccess(ctx, "proj-123", updated); + + assertEquals("proj-123", result.getProject().getProjectId()); + assertFalse(result.getAccess().getIsOwner()); + assertTrue(result.getAccess().getUserHasWriteAccess()); + verify(projectRegistry).updateProject("proj-123", updated); + } + + @Test + void updateProjectWithAccess_rejectsOwnerChange() throws Exception { + Project existing = Project.newBuilder() + .setProjectId("proj-123") + .setOwner("testUser") + .setGatewayId("testGateway") + .build(); + Project updated = Project.newBuilder() + .setProjectId("proj-123") + .setOwner("newOwner") + .setGatewayId("testGateway") + .build(); + + when(projectRegistry.getProject("proj-123")).thenReturn(existing); + + assertThrows( + ServiceException.class, () -> projectService.updateProjectWithAccess(ctx, "proj-123", updated)); + verify(projectRegistry, never()).updateProject(anyString(), any()); + } + @Test void updateProject_rejectsOwnerChange() throws Exception { Project existing = Project.newBuilder().setOwner("testUser").build(); diff --git a/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/SweepExpanderTest.java b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/SweepExpanderTest.java new file mode 100644 index 00000000000..aca9c36c12e --- /dev/null +++ b/airavata-api/research-service/src/test/java/org/apache/airavata/research/service/SweepExpanderTest.java @@ -0,0 +1,50 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.service; + +import static java.util.stream.Collectors.toSet; +import static org.junit.jupiter.api.Assertions.*; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.junit.jupiter.api.Test; + +class SweepExpanderTest { + + @Test + void expand_is_cartesian_product_overriding_base() { + var base = Map.of("temp", "300", "app", "echo"); + var axes = new LinkedHashMap>(); + axes.put("temp", List.of("300", "400")); + axes.put("salt", List.of("lo", "hi")); + var out = SweepExpander.expand(base, axes); + assertEquals(4, out.size()); // 2 x 2 + assertEquals("echo", out.get(0).get("app")); // base carried + assertTrue(out.stream().anyMatch(m -> m.get("temp").equals("400") && m.get("salt").equals("hi"))); + assertEquals(Set.of("300", "400"), out.stream().map(m -> m.get("temp")).collect(toSet())); // axis overrides base + } + + @Test + void expand_no_axes_returns_single_base_copy() { + assertEquals(1, SweepExpander.expand(Map.of("a", "1"), Map.of()).size()); + } +} diff --git a/airavata-api/research-service/src/test/java/org/apache/airavata/research/util/SharedMariaDBLauncherSessionListener.java b/airavata-api/research-service/src/test/java/org/apache/airavata/research/util/SharedMariaDBLauncherSessionListener.java new file mode 100644 index 00000000000..084157fbac3 --- /dev/null +++ b/airavata-api/research-service/src/test/java/org/apache/airavata/research/util/SharedMariaDBLauncherSessionListener.java @@ -0,0 +1,43 @@ +/** +* +* 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. +*/ +package org.apache.airavata.research.util; + +import org.apache.airavata.util.SharedMariaDB; +import org.junit.platform.launcher.LauncherSession; +import org.junit.platform.launcher.LauncherSessionListener; + +/** + * Starts the singleton MariaDB container before any tests are discovered or executed, + * but only when integration tests are actually being run (i.e. the "integration" group + * is included via {@code -Dgroups=integration}). + * + *

Registered via META-INF/services/org.junit.platform.launcher.LauncherSessionListener. + */ +public class SharedMariaDBLauncherSessionListener implements LauncherSessionListener { + + @Override + public void launcherSessionOpened(LauncherSession session) { + String groups = System.getProperty("groups", ""); + String surefireGroups = System.getProperty("surefire.groups", ""); + if (groups.contains("integration") || surefireGroups.contains("integration")) { + SharedMariaDB.getInstance(); + } + } +} diff --git a/airavata-api/research-service/src/test/resources/META-INF/services/org.junit.platform.launcher.LauncherSessionListener b/airavata-api/research-service/src/test/resources/META-INF/services/org.junit.platform.launcher.LauncherSessionListener new file mode 100644 index 00000000000..bae386df057 --- /dev/null +++ b/airavata-api/research-service/src/test/resources/META-INF/services/org.junit.platform.launcher.LauncherSessionListener @@ -0,0 +1 @@ +org.apache.airavata.research.util.SharedMariaDBLauncherSessionListener diff --git a/airavata-api/src/main/java/org/apache/airavata/grpc/GrpcStatusMapper.java b/airavata-api/src/main/java/org/apache/airavata/grpc/GrpcStatusMapper.java index 327790f0157..29a14628e52 100644 --- a/airavata-api/src/main/java/org/apache/airavata/grpc/GrpcStatusMapper.java +++ b/airavata-api/src/main/java/org/apache/airavata/grpc/GrpcStatusMapper.java @@ -38,7 +38,7 @@ public static StatusRuntimeException toStatusException(Exception e) { Status status = switch (className) { - case "EntityNotFoundException" -> Status.NOT_FOUND; + case "EntityNotFoundException", "ServiceNotFoundException" -> Status.NOT_FOUND; case "AuthorizationException", "ServiceAuthorizationException" -> Status.PERMISSION_DENIED; case "AuthenticationException" -> Status.UNAUTHENTICATED; case "ValidationException" -> Status.INVALID_ARGUMENT; diff --git a/airavata-api/src/main/java/org/apache/airavata/interfaces/ExperimentStoragePrep.java b/airavata-api/src/main/java/org/apache/airavata/interfaces/ExperimentStoragePrep.java new file mode 100644 index 00000000000..7accf1a3dfa --- /dev/null +++ b/airavata-api/src/main/java/org/apache/airavata/interfaces/ExperimentStoragePrep.java @@ -0,0 +1,51 @@ +/** +* +* 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. +*/ +package org.apache.airavata.interfaces; + +/** + * Filesystem-only SPI for the storage work that experiment launch-prep needs (default storage + * resolution, directory creation, file existence, move/copy). Implemented in {@code storage-service} + * and setter-injected into {@code ExperimentService} via composition, so {@code research-service} + * never imports a storage-service type and no Maven cycle is introduced. + * + *

The request scope (gateway/user) and the chroot credential/login/root anchoring are resolved + * inside the implementation from the request-scoped {@code GrpcRequestContext.current()}; callers + * pass only filesystem coordinates. {@code storageResourceId} may be empty, in which case the impl + * resolves the gateway default. Paths follow the same anchoring rules as the storage facade: an + * absolute path is honored as-is, a bare-relative path is anchored under the storage resource's + * filesystem root. + */ +public interface ExperimentStoragePrep { + + /** The gateway's default storage resource id (first configured gateway storage preference). */ + String getDefaultStorageResourceId(); + + /** + * Idempotently create {@code relPath} (recursive) and return the resolved bare-relative directory + * ({@code resolvePath(relPath)}), suitable for persisting as the experiment data dir. + */ + String ensureDir(String storageResourceId, String relPath); + + boolean fileExists(String storageResourceId, String path); + + void moveFile(String storageResourceId, String src, String dst); + + void copyFile(String storageResourceId, String src, String dst); +} diff --git a/airavata-api/src/main/java/org/apache/airavata/interfaces/StorageResourceAdaptor.java b/airavata-api/src/main/java/org/apache/airavata/interfaces/StorageResourceAdaptor.java index 8816d5ce578..ea00f21ae03 100644 --- a/airavata-api/src/main/java/org/apache/airavata/interfaces/StorageResourceAdaptor.java +++ b/airavata-api/src/main/java/org/apache/airavata/interfaces/StorageResourceAdaptor.java @@ -47,6 +47,8 @@ public void downloadFile(String remoteFile, OutputStream localOutStream, FileMet public void moveFile(String sourcePath, String destinationPath) throws AgentException; + public void copyFile(String sourcePath, String destinationPath) throws AgentException; + public void createSymlink(String targetPath, String linkPath) throws AgentException; public List listDirectory(String path) throws AgentException; diff --git a/airavata-api/src/main/proto/org/apache/airavata/model/commons/commons.proto b/airavata-api/src/main/proto/org/apache/airavata/model/commons/commons.proto index 44d5c31de9d..8f660a352a4 100644 --- a/airavata-api/src/main/proto/org/apache/airavata/model/commons/commons.proto +++ b/airavata-api/src/main/proto/org/apache/airavata/model/commons/commons.proto @@ -44,3 +44,12 @@ message ValidationResults { bool validation_state = 1; repeated ValidatorResult validation_result_list = 2; } + +// The caller's sharing-access to a resource, computed and enforced server-side. +// Reused by every *WithAccess wrapper so clients never recompute access from +// extra sharing round-trips. is_owner = the caller owns the resource; +// user_has_write_access = is_owner OR the caller holds a WRITE sharing grant. +message AccessFlags { + bool is_owner = 1; + bool user_has_write_access = 2; +} diff --git a/airavata-api/src/test/resources/META-INF/persistence.xml b/airavata-api/src/test/resources/META-INF/persistence.xml index c7e536d590b..fee67c7fbb4 100644 --- a/airavata-api/src/test/resources/META-INF/persistence.xml +++ b/airavata-api/src/test/resources/META-INF/persistence.xml @@ -83,6 +83,8 @@ org.apache.airavata.research.model.DatasetResourceEntity org.apache.airavata.research.model.ExperimentEntity org.apache.airavata.research.model.ExperimentErrorEntity + org.apache.airavata.research.model.ExperimentSetEntity + org.apache.airavata.research.model.ExperimentSetMemberEntity org.apache.airavata.research.model.ExperimentStatusEntity org.apache.airavata.research.model.ExperimentSummaryEntity org.apache.airavata.research.model.NotificationEntity diff --git a/airavata-api/src/test/resources/db/migration/airavata/V1__Baseline_schema.sql b/airavata-api/src/test/resources/db/migration/airavata/V1__Baseline_schema.sql index fe7d6f0341c..d806fd633b4 100644 --- a/airavata-api/src/test/resources/db/migration/airavata/V1__Baseline_schema.sql +++ b/airavata-api/src/test/resources/db/migration/airavata/V1__Baseline_schema.sql @@ -942,4 +942,32 @@ CREATE TABLE `user_storage_preference` ( PRIMARY KEY (`GATEWAY_ID`,`STORAGE_RESOURCE_ID`,`USER_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; +CREATE TABLE `experiment_set` ( + `id` varchar(48) NOT NULL, + `createdAt` datetime(6) NOT NULL, + `gatewayId` varchar(255) NOT NULL, + `owner` varchar(255) NOT NULL, + `setName` varchar(255) NOT NULL, + `sweepSpecJson` longtext DEFAULT NULL, + `updatedAt` datetime(6) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; +CREATE TABLE `experiment_set_member` ( + `id` varchar(48) NOT NULL, + `experimentId` varchar(255) NOT NULL, + `ordinal` int(11) NOT NULL, + `experiment_set_id` varchar(48) NOT NULL, + PRIMARY KEY (`id`), + KEY `FK7jxgcnx5bslj9v24wr47r5j38` (`experiment_set_id`), + CONSTRAINT `FK7jxgcnx5bslj9v24wr47r5j38` FOREIGN KEY (`experiment_set_id`) REFERENCES `experiment_set` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; +CREATE TABLE `user_preferences` ( + `gatewayId` varchar(255) NOT NULL, + `userId` varchar(255) NOT NULL, + `preferencesJson` text DEFAULT NULL, + `createdAt` datetime(6) DEFAULT NULL, + `updatedAt` datetime(6) DEFAULT NULL, + PRIMARY KEY (`gatewayId`,`userId`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + SET FOREIGN_KEY_CHECKS=1; diff --git a/airavata-api/storage-service/src/main/java/org/apache/airavata/storage/ExperimentStoragePrepImpl.java b/airavata-api/storage-service/src/main/java/org/apache/airavata/storage/ExperimentStoragePrepImpl.java new file mode 100644 index 00000000000..8d9fbba50a3 --- /dev/null +++ b/airavata-api/storage-service/src/main/java/org/apache/airavata/storage/ExperimentStoragePrepImpl.java @@ -0,0 +1,131 @@ +/** +* +* 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. +*/ +package org.apache.airavata.storage; + +import java.util.List; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.grpc.GrpcRequestContext; +import org.apache.airavata.interfaces.ExperimentStoragePrep; +import org.apache.airavata.interfaces.GatewayStoragePreferenceProvider; +import org.apache.airavata.interfaces.StorageResourceAdaptor; +import org.apache.airavata.model.appcatalog.gatewayprofile.proto.StoragePreference; +import org.springframework.stereotype.Service; + +/** + * Storage-side implementation of {@link ExperimentStoragePrep}. Resolves the storage adaptor and + * paths through {@link StoragePathResolver} (so the chroot/fileSystemRootLocation anchoring matches + * the gRPC storage facade and {@code DataStagingTask.buildDestinationFilePath}) and performs the + * adaptor-level filesystem operations the launch-prep needs. + * + *

The request scope (gateway/user/credential) is read from {@link GrpcRequestContext#current()} + * inside {@code StoragePathResolver}, exactly as the gRPC handlers do, so this bean carries no + * per-request state. + */ +@Service +public class ExperimentStoragePrepImpl implements ExperimentStoragePrep { + + private final StoragePathResolver storagePathResolver; + private final GatewayStoragePreferenceProvider gatewayStoragePreferenceProvider; + + public ExperimentStoragePrepImpl( + StoragePathResolver storagePathResolver, + GatewayStoragePreferenceProvider gatewayStoragePreferenceProvider) { + this.storagePathResolver = storagePathResolver; + this.gatewayStoragePreferenceProvider = gatewayStoragePreferenceProvider; + } + + @Override + public String getDefaultStorageResourceId() { + try { + // Mirror UserStorageGrpcService.getDefaultStorageResourceId: the first configured + // gateway storage preference is the default. + RequestContext ctx = GrpcRequestContext.current(); + List prefs = + gatewayStoragePreferenceProvider.getAllGatewayStoragePreferences(ctx.getGatewayId()); + if (prefs == null || prefs.isEmpty()) { + throw new IllegalStateException( + "No storage preferences configured for gateway " + ctx.getGatewayId()); + } + return prefs.get(0).getStorageResourceId(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException("Failed to resolve default storage resource id: " + e.getMessage(), e); + } + } + + @Override + public String ensureDir(String storageResourceId, String relPath) { + try { + StorageResourceAdaptor adaptor = storagePathResolver.getStorageAdaptor(storageResourceId); + // Create the directory using the anchored absolute path, but return the bare-relative + // relPath. experiment_data_dir is stored bare-relative: DataStagingTask anchors it under + // the storage root at staging time, so persisting an absolute path would double-anchor. + String resolved = storagePathResolver.resolvePath(relPath, storageResourceId); + adaptor.createDirectory(resolved, true); + return relPath; + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException("Failed to ensure directory " + relPath + ": " + e.getMessage(), e); + } + } + + @Override + public boolean fileExists(String storageResourceId, String path) { + try { + StorageResourceAdaptor adaptor = storagePathResolver.getStorageAdaptor(storageResourceId); + String resolved = storagePathResolver.resolvePath(path, storageResourceId); + return adaptor.doesFileExist(resolved); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException("Failed to check existence of " + path + ": " + e.getMessage(), e); + } + } + + @Override + public void moveFile(String storageResourceId, String src, String dst) { + try { + StorageResourceAdaptor adaptor = storagePathResolver.getStorageAdaptor(storageResourceId); + String resolvedSrc = storagePathResolver.resolvePath(src, storageResourceId); + String resolvedDst = storagePathResolver.resolvePath(dst, storageResourceId); + adaptor.moveFile(resolvedSrc, resolvedDst); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException("Failed to move " + src + " to " + dst + ": " + e.getMessage(), e); + } + } + + @Override + public void copyFile(String storageResourceId, String src, String dst) { + try { + StorageResourceAdaptor adaptor = storagePathResolver.getStorageAdaptor(storageResourceId); + String resolvedSrc = storagePathResolver.resolvePath(src, storageResourceId); + String resolvedDst = storagePathResolver.resolvePath(dst, storageResourceId); + adaptor.copyFile(resolvedSrc, resolvedDst); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException("Failed to copy " + src + " to " + dst + ": " + e.getMessage(), e); + } + } +} diff --git a/airavata-api/storage-service/src/main/java/org/apache/airavata/storage/StoragePathResolver.java b/airavata-api/storage-service/src/main/java/org/apache/airavata/storage/StoragePathResolver.java new file mode 100644 index 00000000000..a6e08ad981e --- /dev/null +++ b/airavata-api/storage-service/src/main/java/org/apache/airavata/storage/StoragePathResolver.java @@ -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. +*/ +package org.apache.airavata.storage; + +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.grpc.GrpcRequestContext; +import org.apache.airavata.interfaces.GatewayStoragePreferenceProvider; +import org.apache.airavata.interfaces.StorageResourceAdaptor; +import org.apache.airavata.model.appcatalog.gatewayprofile.proto.StoragePreference; +import org.apache.airavata.task.AdaptorSupport; +import org.springframework.stereotype.Component; + +/** + * Resolves storage preferences, the effective storage resource id, the storage adaptor + * (with chroot credential/login overrides), and filesystem paths for storage operations. + * + *

Extracted verbatim from {@code UserStorageGrpcService} so the same path/credential/adaptor + * resolution can be shared by both the gRPC handler and the {@code ExperimentStoragePrep} SPI + * impl. The request scope (gateway/user/credential) is read from {@link GrpcRequestContext#current()} + * internally, exactly as the gRPC handler did. + */ +@Component +public class StoragePathResolver { + + private final AdaptorSupport adaptorSupport; + private final GatewayStoragePreferenceProvider gatewayStoragePreferenceProvider; + + public StoragePathResolver( + AdaptorSupport adaptorSupport, GatewayStoragePreferenceProvider gatewayStoragePreferenceProvider) { + this.adaptorSupport = adaptorSupport; + this.gatewayStoragePreferenceProvider = gatewayStoragePreferenceProvider; + } + + public StoragePreference resolveStoragePreference(String storageResourceId) throws Exception { + RequestContext ctx = GrpcRequestContext.current(); + var prefs = gatewayStoragePreferenceProvider.getAllGatewayStoragePreferences(ctx.getGatewayId()); + if (prefs == null || prefs.isEmpty()) { + return null; + } + String resolvedId = (storageResourceId != null && !storageResourceId.isEmpty()) + ? storageResourceId + : prefs.get(0).getStorageResourceId(); + for (var pref : prefs) { + if (pref.getStorageResourceId().equals(resolvedId)) { + return pref; + } + } + return prefs.get(0); + } + + /** Resolve the effective storage resource id: the request's, else the gateway default. */ + public String resolveStorageResourceId(String storageResourceId) throws Exception { + if (storageResourceId != null && !storageResourceId.isEmpty()) { + return storageResourceId; + } + StoragePreference pref = resolveStoragePreference(storageResourceId); + return pref != null ? pref.getStorageResourceId() : ""; + } + + public StorageResourceAdaptor getStorageAdaptor(String storageResourceId) throws Exception { + RequestContext ctx = GrpcRequestContext.current(); + String resolvedId = storageResourceId; + String credentialToken = ctx.getAccessToken(); // fallback + String loginUser = ctx.getUserId(); // fallback + + // Resolve storage resource, credential, and login user from gateway preferences + StoragePreference pref = resolveStoragePreference(storageResourceId); + if (pref != null) { + if (resolvedId == null || resolvedId.isEmpty()) { + resolvedId = pref.getStorageResourceId(); + } + String csToken = pref.getResourceSpecificCredentialStoreToken(); + if (csToken != null && !csToken.isEmpty()) { + credentialToken = csToken; + } + String prefUser = pref.getLoginUserName(); + if (prefUser != null && !prefUser.isEmpty()) { + loginUser = prefUser; + } + } + if (resolvedId == null || resolvedId.isEmpty()) { + throw new IllegalStateException("No storage resource configured for gateway " + ctx.getGatewayId()); + } + return adaptorSupport.fetchStorageAdaptor(ctx.getGatewayId(), resolvedId, credentialToken, loginUser); + } + + /** + * Resolve paths like "~/" or "~" to the storage preference's fileSystemRootLocation. + * SFTP doesn't support shell tilde expansion. + */ + public String resolvePath(String path, String storageResourceId) throws Exception { + if (path == null || path.isEmpty()) { + path = "~"; + } + // Absolute paths are honored as-is. The home shortcut (~) and bare relative + // paths both resolve against the storage resource's filesystem root: the SFTP + // session is chrooted and its starting directory (the chroot root) is not + // writable, so a bare "project/experiment" must be anchored under the root + // (e.g. /storage) rather than left to resolve against the chroot root. + if (path.startsWith("/")) { + return path; + } + StoragePreference pref = resolveStoragePreference(storageResourceId); + String root = (pref != null && !pref.getFileSystemRootLocation().isEmpty()) + ? pref.getFileSystemRootLocation() + : "/"; + if (!root.endsWith("/")) root += "/"; + String suffix; + if (path.startsWith("~/")) { + suffix = path.substring(2); + } else if (path.equals("~")) { + suffix = ""; + } else { + suffix = path; + } + return root + suffix; + } +} diff --git a/airavata-api/storage-service/src/main/java/org/apache/airavata/storage/grpc/UserStorageGrpcService.java b/airavata-api/storage-service/src/main/java/org/apache/airavata/storage/grpc/UserStorageGrpcService.java index 409f6128ae6..45478b81b77 100644 --- a/airavata-api/storage-service/src/main/java/org/apache/airavata/storage/grpc/UserStorageGrpcService.java +++ b/airavata-api/storage-service/src/main/java/org/apache/airavata/storage/grpc/UserStorageGrpcService.java @@ -37,9 +37,10 @@ import org.apache.airavata.interfaces.StorageResourceAdaptor; import org.apache.airavata.model.appcatalog.gatewayprofile.proto.StoragePreference; import org.apache.airavata.model.data.replica.proto.DataProductModel; +import org.apache.airavata.model.data.replica.proto.DataReplicaLocationModel; import org.apache.airavata.model.experiment.proto.ExperimentModel; import org.apache.airavata.model.experiment.proto.UserConfigurationDataModel; -import org.apache.airavata.task.AdaptorSupport; +import org.apache.airavata.storage.StoragePathResolver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -49,20 +50,20 @@ public class UserStorageGrpcService extends UserStorageServiceGrpc.UserStorageSe private static final Logger logger = LoggerFactory.getLogger(UserStorageGrpcService.class); - private final AdaptorSupport adaptorSupport; private final ExperimentRegistry experimentRegistry; private final GatewayStoragePreferenceProvider gatewayStoragePreferenceProvider; private final StorageProvider storageProvider; + private final StoragePathResolver storagePathResolver; public UserStorageGrpcService( - AdaptorSupport adaptorSupport, ExperimentRegistry experimentRegistry, GatewayStoragePreferenceProvider gatewayStoragePreferenceProvider, - StorageProvider storageProvider) { - this.adaptorSupport = adaptorSupport; + StorageProvider storageProvider, + StoragePathResolver storagePathResolver) { this.experimentRegistry = experimentRegistry; this.gatewayStoragePreferenceProvider = gatewayStoragePreferenceProvider; this.storageProvider = storageProvider; + this.storagePathResolver = storagePathResolver; } /** @@ -85,89 +86,17 @@ private String resolveDataProductUri(FileMetadata meta, String path, String stor } } - private StoragePreference resolveStoragePreference(String storageResourceId) throws Exception { - RequestContext ctx = GrpcRequestContext.current(); - var prefs = gatewayStoragePreferenceProvider.getAllGatewayStoragePreferences(ctx.getGatewayId()); - if (prefs == null || prefs.isEmpty()) { - return null; - } - String resolvedId = (storageResourceId != null && !storageResourceId.isEmpty()) - ? storageResourceId - : prefs.get(0).getStorageResourceId(); - for (var pref : prefs) { - if (pref.getStorageResourceId().equals(resolvedId)) { - return pref; - } - } - return prefs.get(0); - } - /** Resolve the effective storage resource id: the request's, else the gateway default. */ private String resolveStorageResourceId(String storageResourceId) throws Exception { - if (storageResourceId != null && !storageResourceId.isEmpty()) { - return storageResourceId; - } - StoragePreference pref = resolveStoragePreference(storageResourceId); - return pref != null ? pref.getStorageResourceId() : ""; + return storagePathResolver.resolveStorageResourceId(storageResourceId); } private StorageResourceAdaptor getStorageAdaptor(String storageResourceId) throws Exception { - RequestContext ctx = GrpcRequestContext.current(); - String resolvedId = storageResourceId; - String credentialToken = ctx.getAccessToken(); // fallback - String loginUser = ctx.getUserId(); // fallback - - // Resolve storage resource, credential, and login user from gateway preferences - StoragePreference pref = resolveStoragePreference(storageResourceId); - if (pref != null) { - if (resolvedId == null || resolvedId.isEmpty()) { - resolvedId = pref.getStorageResourceId(); - } - String csToken = pref.getResourceSpecificCredentialStoreToken(); - if (csToken != null && !csToken.isEmpty()) { - credentialToken = csToken; - } - String prefUser = pref.getLoginUserName(); - if (prefUser != null && !prefUser.isEmpty()) { - loginUser = prefUser; - } - } - if (resolvedId == null || resolvedId.isEmpty()) { - throw new IllegalStateException("No storage resource configured for gateway " + ctx.getGatewayId()); - } - return adaptorSupport.fetchStorageAdaptor(ctx.getGatewayId(), resolvedId, credentialToken, loginUser); + return storagePathResolver.getStorageAdaptor(storageResourceId); } - /** - * Resolve paths like "~/" or "~" to the storage preference's fileSystemRootLocation. - * SFTP doesn't support shell tilde expansion. - */ private String resolvePath(String path, String storageResourceId) throws Exception { - if (path == null || path.isEmpty()) { - path = "~"; - } - // Absolute paths are honored as-is. The home shortcut (~) and bare relative - // paths both resolve against the storage resource's filesystem root: the SFTP - // session is chrooted and its starting directory (the chroot root) is not - // writable, so a bare "project/experiment" must be anchored under the root - // (e.g. /storage) rather than left to resolve against the chroot root. - if (path.startsWith("/")) { - return path; - } - StoragePreference pref = resolveStoragePreference(storageResourceId); - String root = (pref != null && !pref.getFileSystemRootLocation().isEmpty()) - ? pref.getFileSystemRootLocation() - : "/"; - if (!root.endsWith("/")) root += "/"; - String suffix; - if (path.startsWith("~/")) { - suffix = path.substring(2); - } else if (path.equals("~")) { - suffix = ""; - } else { - suffix = path; - } - return root + suffix; + return storagePathResolver.resolvePath(path, storageResourceId); } @Override @@ -219,6 +148,55 @@ public void downloadFile(DownloadFileRequest request, StreamObserver observer) { + try { + DataProductModel product = storageProvider.getDataProduct(request.getProductUri()); + if (product == null) { + observer.onError(Status.NOT_FOUND + .withDescription("Data product " + request.getProductUri() + " does not exist") + .asRuntimeException()); + return; + } + if (product.getReplicaLocationsCount() == 0) { + observer.onError(Status.NOT_FOUND + .withDescription("No replica locations for data product " + request.getProductUri()) + .asRuntimeException()); + return; + } + DataReplicaLocationModel replica = product.getReplicaLocations(0); + String filePath = replica.getFilePath(); + if (filePath == null || filePath.isEmpty()) { + observer.onError(Status.NOT_FOUND + .withDescription("No replica file path for data product " + request.getProductUri()) + .asRuntimeException()); + return; + } + // Mirror the SDK's data_product_file_path: the storage facade expects a full path + // (absolute or ~/-prefixed); a bare relative replica path is anchored to the home root. + if (!filePath.startsWith("/") && !filePath.startsWith("~/")) { + filePath = "~/" + filePath; + } + + String storageResourceId = replica.getStorageResourceId(); + StorageResourceAdaptor adaptor = getStorageAdaptor(storageResourceId); + String remotePath = resolvePath(filePath, storageResourceId); + + FileMetadata metadata = adaptor.getFileMetadata(remotePath); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + adaptor.downloadFile(remotePath, outputStream, metadata); + + observer.onNext(DownloadFileResponse.newBuilder() + .setContent(com.google.protobuf.ByteString.copyFrom(outputStream.toByteArray())) + .setName(metadata.getName()) + .build()); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void fileExists(FileExistsRequest request, StreamObserver observer) { try { @@ -331,6 +309,26 @@ public void moveFile(MoveFileRequest request, StreamObserver o } } + @Override + public void copyFile(CopyFileRequest request, StreamObserver observer) { + try { + StorageResourceAdaptor adaptor = getStorageAdaptor(request.getStorageResourceId()); + String src = resolvePath(request.getSourcePath(), request.getStorageResourceId()); + String dst = resolvePath(request.getDestinationPath(), request.getStorageResourceId()); + adaptor.copyFile(src, dst); + + DataProductModel product = DataProductModel.newBuilder() + .setProductName(Paths.get(request.getDestinationPath()) + .getFileName() + .toString()) + .build(); + observer.onNext(product); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + @Override public void createDir(CreateDirRequest request, StreamObserver observer) { try { diff --git a/airavata-api/storage-service/src/main/proto/file_service.proto b/airavata-api/storage-service/src/main/proto/file_service.proto index b1cdbc89a4d..590d61404a4 100644 --- a/airavata-api/storage-service/src/main/proto/file_service.proto +++ b/airavata-api/storage-service/src/main/proto/file_service.proto @@ -42,6 +42,12 @@ service UserStorageService { }; } + rpc DownloadDataProduct(DownloadDataProductRequest) returns (DownloadFileResponse) { + option (google.api.http) = { + get: "/api/v1/user-storage/data-products:download" + }; + } + rpc FileExists(FileExistsRequest) returns (FileExistsResponse) { option (google.api.http) = { get: "/api/v1/user-storage/files:exists" @@ -79,6 +85,13 @@ service UserStorageService { }; } + rpc CopyFile(CopyFileRequest) returns (org.apache.airavata.model.data.replica.DataProductModel) { + option (google.api.http) = { + post: "/api/v1/user-storage/files:copy" + body: "*" + }; + } + rpc CreateDir(CreateDirRequest) returns (CreateDirResponse) { option (google.api.http) = { post: "/api/v1/user-storage/directories" @@ -147,6 +160,10 @@ message DownloadFileRequest { string path = 2; } +message DownloadDataProductRequest { + string product_uri = 1; +} + message DownloadFileResponse { bytes content = 1; string name = 2; @@ -197,6 +214,12 @@ message MoveFileRequest { string destination_path = 3; } +message CopyFileRequest { + string storage_resource_id = 1; + string source_path = 2; + string destination_path = 3; +} + message CreateDirRequest { string storage_resource_id = 1; string path = 2; diff --git a/airavata-api/storage-service/src/test/java/org/apache/airavata/storage/StoragePathResolverTest.java b/airavata-api/storage-service/src/test/java/org/apache/airavata/storage/StoragePathResolverTest.java new file mode 100644 index 00000000000..17072c8a402 --- /dev/null +++ b/airavata-api/storage-service/src/test/java/org/apache/airavata/storage/StoragePathResolverTest.java @@ -0,0 +1,127 @@ +/** +* +* 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. +*/ +package org.apache.airavata.storage; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + +import java.util.List; +import org.apache.airavata.config.Constants; +import org.apache.airavata.config.UserContext; +import org.apache.airavata.interfaces.GatewayStoragePreferenceProvider; +import org.apache.airavata.model.appcatalog.gatewayprofile.proto.StoragePreference; +import org.apache.airavata.model.security.proto.AuthzToken; +import org.apache.airavata.task.AdaptorSupport; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; + +/** + * Unit tests for {@link StoragePathResolver#resolvePath} — the load-bearing chroot anchoring that + * must keep matching {@code DataStagingTask.buildDestinationFilePath}: absolute paths are honored + * as-is, while {@code ~}, {@code ~/...}, and bare-relative paths are anchored under the storage + * resource's filesystem root. + */ +@ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) +class StoragePathResolverTest { + + private static final String GATEWAY = "testGateway"; + private static final String STORAGE_ID = "storage-1"; + + @Mock + AdaptorSupport adaptorSupport; + + @Mock + GatewayStoragePreferenceProvider gatewayStoragePreferenceProvider; + + StoragePathResolver resolver; + + @BeforeEach + void setUp() throws Exception { + resolver = new StoragePathResolver(adaptorSupport, gatewayStoragePreferenceProvider); + + // Populate the request-scoped UserContext that GrpcRequestContext.current() reads. + AuthzToken token = AuthzToken.newBuilder() + .setAccessToken("token123") + .putClaimsMap(Constants.USER_NAME, "testUser") + .putClaimsMap(Constants.GATEWAY_ID, GATEWAY) + .build(); + UserContext.setAuthzToken(token); + + StoragePreference pref = StoragePreference.newBuilder() + .setStorageResourceId(STORAGE_ID) + .setFileSystemRootLocation("/storage") + .build(); + when(gatewayStoragePreferenceProvider.getAllGatewayStoragePreferences(GATEWAY)) + .thenReturn(List.of(pref)); + } + + @AfterEach + void tearDown() { + UserContext.clear(); + } + + @Test + void resolvePath_absoluteHonoredAsIs() throws Exception { + assertEquals("/storage/project/exp", resolver.resolvePath("/storage/project/exp", STORAGE_ID)); + } + + @Test + void resolvePath_bareRelativeAnchoredUnderRoot() throws Exception { + // The chroot-anchoring case: a bare "project/exp" must be anchored under the root. + assertEquals("/storage/project/exp", resolver.resolvePath("project/exp", STORAGE_ID)); + } + + @Test + void resolvePath_homeShortcutAnchoredUnderRoot() throws Exception { + assertEquals("/storage/", resolver.resolvePath("~", STORAGE_ID)); + assertEquals("/storage/project/exp", resolver.resolvePath("~/project/exp", STORAGE_ID)); + } + + @Test + void resolvePath_nullOrEmptyResolvesToRoot() throws Exception { + assertEquals("/storage/", resolver.resolvePath(null, STORAGE_ID)); + assertEquals("/storage/", resolver.resolvePath("", STORAGE_ID)); + } + + @Test + void resolvePath_defaultsRootToSlashWhenNoPreference() throws Exception { + when(gatewayStoragePreferenceProvider.getAllGatewayStoragePreferences(GATEWAY)) + .thenReturn(List.of()); + // No preference -> root defaults to "/", so a bare relative path is anchored under it. + assertEquals("/project/exp", resolver.resolvePath("project/exp", STORAGE_ID)); + } + + @Test + void resolveStorageResourceId_returnsRequestIdWhenSet() throws Exception { + assertEquals(STORAGE_ID, resolver.resolveStorageResourceId(STORAGE_ID)); + } + + @Test + void resolveStorageResourceId_fallsBackToGatewayDefault() throws Exception { + assertEquals(STORAGE_ID, resolver.resolveStorageResourceId("")); + } +} diff --git a/airavata-python-sdk/.gitignore b/airavata-python-sdk/.gitignore index 123952ff99a..17e7cd71b1f 100644 --- a/airavata-python-sdk/.gitignore +++ b/airavata-python-sdk/.gitignore @@ -12,4 +12,6 @@ __pycache__/ results*/ plan.json settings*.ini -auth.state \ No newline at end of file +auth.state +# uv lock — dev artifact; this is a distributed library, deps resolve from pyproject +uv.lock diff --git a/airavata-python-sdk/Makefile b/airavata-python-sdk/Makefile deleted file mode 100644 index a3af2312a1e..00000000000 --- a/airavata-python-sdk/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -OUTDIR:=$(abspath $(dir $(lastword $(MAKEFILE_LIST)))) - -clean: - rm -rf $(OUTDIR)/dist - rm -rf $(OUTDIR)/build - rm -rf $(OUTDIR)/airavata.egg-info - -build: clean - python -m build - -deploy: build - twine upload --repository airavata dist/* diff --git a/airavata-python-sdk/airavata_sdk/__init__.py b/airavata-python-sdk/airavata/__init__.py similarity index 97% rename from airavata-python-sdk/airavata_sdk/__init__.py rename to airavata-python-sdk/airavata/__init__.py index 15726f3787a..37e9dee46dd 100644 --- a/airavata-python-sdk/airavata_sdk/__init__.py +++ b/airavata-python-sdk/airavata/__init__.py @@ -109,6 +109,4 @@ def SFTP_PORT(self): return int(os.getenv("SFTP_PORT", 9000)) -from airavata_sdk.client import AiravataClient - -__all__ = ["Settings", "AiravataClient"] +__all__ = ["Settings"] diff --git a/airavata-python-sdk/airavata/auth/__init__.py b/airavata-python-sdk/airavata/auth/__init__.py new file mode 100644 index 00000000000..72c664deef9 --- /dev/null +++ b/airavata-python-sdk/airavata/auth/__init__.py @@ -0,0 +1,11 @@ +"""Python-centric auth for Airavata clients. + +The hand-written gRPC wrapper (``airavata`` facade/helpers/clients) is being +retired in favour of the raw generated stubs; auth is one of the two pieces that +rightfully stays in Python. :func:`authenticated_channel` yields a channel that +Bearer-authenticates every call, so a client builds raw stubs from it directly. +""" + +from airavata.auth.channel import BearerAuthInterceptor, authenticated_channel + +__all__ = ["BearerAuthInterceptor", "authenticated_channel"] diff --git a/airavata-python-sdk/airavata/auth/channel.py b/airavata-python-sdk/airavata/auth/channel.py new file mode 100644 index 00000000000..2631a5487b5 --- /dev/null +++ b/airavata-python-sdk/airavata/auth/channel.py @@ -0,0 +1,94 @@ +"""Authenticated gRPC channel for talking to the Airavata server. + +Auth is the one Python-centric concern that stays in the SDK while the rest of +the hand-written wrapper is retired in favour of the raw generated stubs. A +client interceptor injects ``authorization: Bearer `` into every outbound +call, so call sites are pure ``stub.Method(request)`` with no per-call metadata +threading. The interceptor (not channel call-credentials) is used because call +credentials are rejected on plaintext channels, and the portal reaches the +in-cluster server over plaintext gRPC. +""" + +from __future__ import annotations + +import collections + +import grpc + + +class _ClientCallDetails( + collections.namedtuple( + "_ClientCallDetails", + ("method", "timeout", "metadata", "credentials", "wait_for_ready", "compression"), + ), + grpc.ClientCallDetails, +): + pass + + +class BearerAuthInterceptor( + grpc.UnaryUnaryClientInterceptor, + grpc.UnaryStreamClientInterceptor, + grpc.StreamUnaryClientInterceptor, + grpc.StreamStreamClientInterceptor, +): + """Adds ``authorization: Bearer `` to every call's metadata. + + The server verifies the token and derives identity (user + gateway) from it; + no client-asserted identity is sent. + """ + + def __init__(self, access_token: str): + self._auth = ("authorization", f"Bearer {access_token}") + + def _augment(self, client_call_details: grpc.ClientCallDetails) -> _ClientCallDetails: + metadata = list(client_call_details.metadata or []) + metadata.append(self._auth) + return _ClientCallDetails( + client_call_details.method, + client_call_details.timeout, + metadata, + client_call_details.credentials, + client_call_details.wait_for_ready, + client_call_details.compression, + ) + + def intercept_unary_unary(self, continuation, client_call_details, request): + return continuation(self._augment(client_call_details), request) + + def intercept_unary_stream(self, continuation, client_call_details, request): + return continuation(self._augment(client_call_details), request) + + def intercept_stream_unary(self, continuation, client_call_details, request_iterator): + return continuation(self._augment(client_call_details), request_iterator) + + def intercept_stream_stream(self, continuation, client_call_details, request_iterator): + return continuation(self._augment(client_call_details), request_iterator) + + +# 64KB metadata ceiling matches the server's large-error-message budget. +_DEFAULT_OPTIONS = [("grpc.max_metadata_size", 64 * 1024)] + + +def authenticated_channel( + host: str, + port: int, + access_token: str, + *, + secure: bool = False, + options: list[tuple[str, object]] | None = None, +) -> grpc.Channel: + """Return a gRPC channel that Bearer-authenticates every call. + + Build the raw generated stubs directly from the returned channel, e.g. + ``ProjectServiceStub(authenticated_channel(...))``; each call carries the + token automatically. + """ + target = f"{host}:{port}" + opts = _DEFAULT_OPTIONS + list(options or []) + base = ( + grpc.secure_channel(target, grpc.ssl_channel_credentials(), opts) + if secure + else grpc.insecure_channel(target, opts) + ) + return grpc.intercept_channel(base, BearerAuthInterceptor(access_token)) diff --git a/airavata-python-sdk/airavata_auth/device_auth.py b/airavata-python-sdk/airavata/auth/device_auth.py similarity index 98% rename from airavata-python-sdk/airavata_auth/device_auth.py rename to airavata-python-sdk/airavata/auth/device_auth.py index 944055ad268..8b0f1ce6dfb 100644 --- a/airavata-python-sdk/airavata_auth/device_auth.py +++ b/airavata-python-sdk/airavata/auth/device_auth.py @@ -4,7 +4,7 @@ import requests from rich.console import Console -from airavata_sdk import Settings +from airavata import Settings # Load environment variables from .env file diff --git a/airavata-python-sdk/airavata_experiments/__init__.py b/airavata-python-sdk/airavata/experiments/__init__.py similarity index 99% rename from airavata-python-sdk/airavata_experiments/__init__.py rename to airavata-python-sdk/airavata/experiments/__init__.py index bb5e33a0ddd..20c6009f79c 100644 --- a/airavata-python-sdk/airavata_experiments/__init__.py +++ b/airavata-python-sdk/airavata/experiments/__init__.py @@ -17,7 +17,7 @@ from __future__ import annotations from . import base, plan -from airavata_auth.device_auth import AuthContext +from airavata.auth.device_auth import AuthContext from .runtime import find_runtimes, Runtime from typing import Any from . import md, neuro diff --git a/airavata-python-sdk/airavata/experiments/_apiserver.py b/airavata-python-sdk/airavata/experiments/_apiserver.py new file mode 100644 index 00000000000..073dea9d652 --- /dev/null +++ b/airavata-python-sdk/airavata/experiments/_apiserver.py @@ -0,0 +1,222 @@ +# 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. +# + +"""airavata.experiments' own thin gRPC client over the raw generated stubs. + +The Airavata Python SDK ships only the protoc-generated stubs +(``airavata``) and the Bearer-auth channel helper +(``airavata.auth``); the hand-written ``airavata.clients`` facade is gone. +This module is the small replacement that lives with its sole consumer: it +builds the seven service stubs ``AiravataOperator`` needs from a single +``authenticated_channel`` (whose interceptor injects ``authorization: Bearer +`` on every call, so no per-call metadata threading) and exposes exactly +the request-building wrappers the operator calls. Method names, signatures, and +the returned protobuf responses match the old facade, so the operator's call +sites are unchanged. +""" + +from airavata import Settings +from airavata.auth import authenticated_channel +from airavata.services import ( + application_catalog_service_pb2 as appcat_pb2, + application_catalog_service_pb2_grpc as appcat_grpc, + data_product_service_pb2 as dp_pb2, + data_product_service_pb2_grpc as dp_grpc, + experiment_service_pb2 as exp_pb2, + experiment_service_pb2_grpc as exp_grpc, + experiment_set_service_pb2 as set_pb2, + experiment_set_service_pb2_grpc as set_grpc, + gateway_resource_profile_service_pb2 as gwp_pb2, + gateway_resource_profile_service_pb2_grpc as gwp_grpc, + group_resource_profile_service_pb2 as grp_pb2, + group_resource_profile_service_pb2_grpc as grp_grpc, + project_service_pb2 as proj_pb2, + project_service_pb2_grpc as proj_grpc, + resource_service_pb2 as res_pb2, + resource_service_pb2_grpc as res_grpc, +) + + +class APIServerClient: + """The subset of Airavata gRPC services ``AiravataOperator`` uses, over an + ``authenticated_channel``. Each method builds the request proto and returns + the full response proto from the stub (callers extract the fields).""" + + def __init__(self, access_token: str): + s = Settings() + self.channel = authenticated_channel( + s.API_SERVER_HOSTNAME, + s.API_SERVER_PORT, + access_token, + secure=s.API_SERVER_SECURE, + ) + self._experiment = exp_grpc.ExperimentServiceStub(self.channel) + self._experiment_set = set_grpc.ExperimentSetServiceStub(self.channel) + self._app_catalog = appcat_grpc.ApplicationCatalogServiceStub(self.channel) + self._resource = res_grpc.ResourceServiceStub(self.channel) + self._gw_profile = gwp_grpc.GatewayResourceProfileServiceStub(self.channel) + self._grp_profile = grp_grpc.GroupResourceProfileServiceStub(self.channel) + self._project = proj_grpc.ProjectServiceStub(self.channel) + self._data_product = dp_grpc.DataProductServiceStub(self.channel) + + def close(self): + self.channel.close() + + # ---------------------------------------------------------------- Experiment + def create_experiment(self, gateway_id, experiment): + return self._experiment.CreateExperiment( + exp_pb2.CreateExperimentRequest(gateway_id=gateway_id, experiment=experiment) + ) + + def get_experiment(self, experiment_id): + return self._experiment.GetExperiment( + exp_pb2.GetExperimentRequest(experiment_id=experiment_id) + ) + + def get_detailed_experiment_tree(self, experiment_id): + return self._experiment.GetDetailedExperimentTree( + exp_pb2.GetDetailedExperimentTreeRequest(experiment_id=experiment_id) + ) + + def get_experiment_status(self, experiment_id): + return self._experiment.GetExperimentStatus( + exp_pb2.GetExperimentStatusRequest(experiment_id=experiment_id) + ) + + def get_job_statuses(self, experiment_id): + return self._experiment.GetJobStatuses( + exp_pb2.GetJobStatusesRequest(experiment_id=experiment_id) + ) + + def launch_experiment(self, experiment_id, gateway_id): + return self._experiment.LaunchExperiment( + exp_pb2.LaunchExperimentRequest(experiment_id=experiment_id, gateway_id=gateway_id) + ) + + def terminate_experiment(self, experiment_id, gateway_id): + return self._experiment.TerminateExperiment( + exp_pb2.TerminateExperimentRequest(experiment_id=experiment_id, gateway_id=gateway_id) + ) + + # ------------------------------------------------------- Application Catalog + def get_all_application_interfaces(self, gateway_id): + return self._app_catalog.GetAllApplicationInterfaces( + appcat_pb2.GetAllApplicationInterfacesRequest(gateway_id=gateway_id) + ) + + def get_application_inputs(self, app_interface_id): + return self._app_catalog.GetApplicationInputs( + appcat_pb2.GetApplicationInputsRequest(app_interface_id=app_interface_id) + ) + + def get_application_outputs(self, app_interface_id): + return self._app_catalog.GetApplicationOutputs( + appcat_pb2.GetApplicationOutputsRequest(app_interface_id=app_interface_id) + ) + + def get_application_deployments_for_app_module_and_group_resource_profile( + self, app_module_id, group_resource_profile_id + ): + return self._app_catalog.GetDeploymentsForModuleAndProfile( + appcat_pb2.GetDeploymentsForModuleAndProfileRequest( + app_module_id=app_module_id, + group_resource_profile_id=group_resource_profile_id, + ) + ) + + # -------------------------------------------------------------------- Resource + def get_compute_resource(self, compute_resource_id): + return self._resource.GetComputeResource( + res_pb2.GetComputeResourceRequest(compute_resource_id=compute_resource_id) + ) + + def get_all_compute_resource_names(self): + return self._resource.GetAllComputeResourceNames( + res_pb2.GetAllComputeResourceNamesRequest() + ) + + def get_storage_resource(self, storage_resource_id): + return self._resource.GetStorageResource( + res_pb2.GetStorageResourceRequest(storage_resource_id=storage_resource_id) + ) + + def get_all_storage_resource_names(self): + return self._resource.GetAllStorageResourceNames( + res_pb2.GetAllStorageResourceNamesRequest() + ) + + # ----------------------------------------------- Gateway Resource Profile + def get_gateway_storage_preference(self, gateway_id, storage_resource_id): + return self._gw_profile.GetStoragePreference( + gwp_pb2.GetStoragePreferenceRequest( + gateway_id=gateway_id, storage_resource_id=storage_resource_id + ) + ) + + # ------------------------------------------------- Group Resource Profile + def get_group_resource_profile(self, group_resource_profile_id): + return self._grp_profile.GetGroupResourceProfile( + grp_pb2.GetGroupResourceProfileRequest( + group_resource_profile_id=group_resource_profile_id + ) + ) + + def get_group_resource_list(self): + return self._grp_profile.GetGroupResourceList( + grp_pb2.GetGroupResourceListRequest() + ) + + # --------------------------------------------------------------------- Project + def get_user_projects(self, gateway_id, user_name, limit=-1, offset=0): + return self._project.GetUserProjects( + proj_pb2.GetUserProjectsRequest( + gateway_id=gateway_id, user_name=user_name, limit=limit, offset=offset + ) + ) + + # --------------------------------------------------------------- Data Product + def register_data_product(self, data_product): + return self._data_product.RegisterDataProduct( + dp_pb2.RegisterDataProductRequest(data_product=data_product) + ) + + # --------------------------------------------------------- Experiment Set + def create_experiment_set(self, request): + """Pass a prebuilt ``CreateExperimentSetRequest`` through to the stub.""" + return self._experiment_set.CreateExperimentSet(request) + + def launch_experiment_set(self, set_id, notification_email=""): + return self._experiment_set.LaunchExperimentSet( + set_pb2.LaunchExperimentSetRequest( + experiment_set_id=set_id, + notification_email=notification_email, + ) + ) + + def get_experiment_set(self, set_id): + return self._experiment_set.GetExperimentSet( + set_pb2.GetExperimentSetRequest(experiment_set_id=set_id) + ) + + def get_experiment_set_status(self, set_id): + return self._experiment_set.GetExperimentSetStatus( + set_pb2.GetExperimentSetRequest(experiment_set_id=set_id) + ) + + def list_experiment_sets(self, limit=0, offset=0): + return self._experiment_set.ListExperimentSets( + set_pb2.ListExperimentSetsRequest(limit=limit, offset=offset) + ) diff --git a/airavata-python-sdk/airavata_experiments/airavata.py b/airavata-python-sdk/airavata/experiments/airavata.py similarity index 96% rename from airavata-python-sdk/airavata_experiments/airavata.py rename to airavata-python-sdk/airavata/experiments/airavata.py index 3210bb974d4..c4f90047956 100644 --- a/airavata-python-sdk/airavata_experiments/airavata.py +++ b/airavata-python-sdk/airavata/experiments/airavata.py @@ -18,8 +18,8 @@ from pathlib import Path from typing import Literal, NamedTuple -from airavata_sdk import Settings -from airavata_sdk.clients.api_server_client import APIServerClient +from airavata import Settings +from ._apiserver import APIServerClient from .sftp import SFTPConnector import time @@ -31,16 +31,16 @@ import base64 import jwt -from airavata_sdk.generated.org.apache.airavata.model.security.security_pb2 import AuthzToken -from airavata_sdk.generated.org.apache.airavata.model.experiment.experiment_pb2 import ExperimentModel, ExperimentType, UserConfigurationDataModel -from airavata_sdk.generated.org.apache.airavata.model.scheduling.scheduling_pb2 import ComputationalResourceSchedulingModel -from airavata_sdk.generated.org.apache.airavata.model.data.replica.replica_catalog_pb2 import DataProductModel, DataProductType, DataReplicaLocationModel, ReplicaLocationCategory -from airavata_sdk.generated.org.apache.airavata.model.appcatalog.groupresourceprofile.group_resource_profile_pb2 import GroupResourceProfile, ResourceType -from airavata_sdk.generated.org.apache.airavata.model.appcatalog.computeresource.compute_resource_pb2 import ComputeResourceDescription -from airavata_sdk.generated.org.apache.airavata.model.status.status_pb2 import JobStatus, JobState, ExperimentStatus, ExperimentState +from airavata.model.security.security_pb2 import AuthzToken +from airavata.model.experiment.experiment_pb2 import ExperimentModel, ExperimentType, UserConfigurationDataModel +from airavata.model.scheduling.scheduling_pb2 import ComputationalResourceSchedulingModel +from airavata.model.data.replica.replica_catalog_pb2 import DataProductModel, DataProductType, DataReplicaLocationModel, ReplicaLocationCategory +from airavata.model.appcatalog.groupresourceprofile.group_resource_profile_pb2 import GroupResourceProfile, ResourceType +from airavata.model.appcatalog.computeresource.compute_resource_pb2 import ComputeResourceDescription +from airavata.model.status.status_pb2 import JobStatus, JobState, ExperimentStatus, ExperimentState warnings.filterwarnings("ignore", category=DeprecationWarning) -logger = logging.getLogger("airavata_sdk.clients") +logger = logging.getLogger("airavata.experiments") logger.setLevel(logging.INFO) LaunchState = NamedTuple("LaunchState", [ diff --git a/airavata-python-sdk/airavata_experiments/base.py b/airavata-python-sdk/airavata/experiments/base.py similarity index 100% rename from airavata-python-sdk/airavata_experiments/base.py rename to airavata-python-sdk/airavata/experiments/base.py diff --git a/airavata-python-sdk/airavata/experiments/gridsearch.py b/airavata-python-sdk/airavata/experiments/gridsearch.py new file mode 100644 index 00000000000..3f2fbd66ecb --- /dev/null +++ b/airavata-python-sdk/airavata/experiments/gridsearch.py @@ -0,0 +1,101 @@ +# 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. +# + +"""High-level gridsearch helper for the ExperimentSetService. + +``gridsearch()`` builds a ``CreateExperimentSetRequest`` from a base experiment +spec + a parameter sweep grid and submits it via the ``AiravataOperator``'s +``api_server_client``. It is deliberately a standalone function rather than a +method on ``Experiment`` / ``Plan`` so it does not touch the existing +``/api/v1/plan`` REST path, which remains unchanged. +""" + +from __future__ import annotations + +from airavata.services import ( + experiment_service_pb2 as exp_pb2, + experiment_set_service_pb2 as set_pb2, +) + + +def gridsearch( + operator, + set_name: str, + project_id: str, + application_interface_id: str, + inputs: dict[str, str], + resource: dict, + sweep_axes: dict[str, list[str]], + description: str = "", +) -> set_pb2.ExperimentSet: + """Submit a gridsearch experiment set to the Airavata server. + + Args: + operator: An ``AiravataOperator`` instance (provides ``api_server_client``). + set_name: Human-readable name for the experiment set. + project_id: Airavata project ID for the base experiment. + application_interface_id: App-interface ID; inputs are keyed by input name. + inputs: Base input values (``{input_name: string_value}``). The server + expands sweep axes over these, so omit swept keys or supply the + default value — the sweep axis values take precedence per experiment. + resource: Mapping with compute resource fields: + ``compute_resource_id``, ``group_resource_profile_id``, + ``node_count``, ``total_cpu_count``, ``queue_name``, + ``wall_time_limit`` (and optionally ``input_storage_resource_id``, + ``output_storage_resource_id``). + sweep_axes: ``{input_name: [val1, val2, ...]}`` — the Cartesian product + is expanded by the server. + description: Optional experiment description. + + Returns: + The ``ExperimentSet`` proto returned by the server (contains the new + ``experiment_set_id`` and the list of spawned experiment IDs). + """ + resource_spec = exp_pb2.ResourceSpec( + compute_resource_id=resource.get("compute_resource_id", ""), + group_resource_profile_id=resource.get("group_resource_profile_id", ""), + node_count=resource.get("node_count", 1), + total_cpu_count=resource.get("total_cpu_count", 1), + queue_name=resource.get("queue_name", ""), + wall_time_limit=resource.get("wall_time_limit", 0), + input_storage_resource_id=resource.get("input_storage_resource_id", ""), + output_storage_resource_id=resource.get("output_storage_resource_id", ""), + ) + + base_spec = exp_pb2.ExperimentSpec( + experiment_name=set_name, + project_id=project_id, + application_interface_id=application_interface_id, + description=description, + inputs=inputs, + resource=resource_spec, + ) + + sweep_spec = set_pb2.SweepSpec( + base=base_spec, + sweep_axes={ + k: set_pb2.ValueList(values=v) + for k, v in sweep_axes.items() + }, + name_prefix=set_name, + ) + + req = set_pb2.CreateExperimentSetRequest( + set_name=set_name, + sweep=sweep_spec, + ) + + return operator.api_server_client.create_experiment_set(req) diff --git a/airavata-python-sdk/airavata_experiments/md/__init__.py b/airavata-python-sdk/airavata/experiments/md/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_experiments/md/__init__.py rename to airavata-python-sdk/airavata/experiments/md/__init__.py diff --git a/airavata-python-sdk/airavata_experiments/md/applications.py b/airavata-python-sdk/airavata/experiments/md/applications.py similarity index 100% rename from airavata-python-sdk/airavata_experiments/md/applications.py rename to airavata-python-sdk/airavata/experiments/md/applications.py diff --git a/airavata-python-sdk/airavata_experiments/neuro/__init__.py b/airavata-python-sdk/airavata/experiments/neuro/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_experiments/neuro/__init__.py rename to airavata-python-sdk/airavata/experiments/neuro/__init__.py diff --git a/airavata-python-sdk/airavata_experiments/neuro/applications.py b/airavata-python-sdk/airavata/experiments/neuro/applications.py similarity index 100% rename from airavata-python-sdk/airavata_experiments/neuro/applications.py rename to airavata-python-sdk/airavata/experiments/neuro/applications.py diff --git a/airavata-python-sdk/airavata_experiments/plan.py b/airavata-python-sdk/airavata/experiments/plan.py similarity index 98% rename from airavata-python-sdk/airavata_experiments/plan.py rename to airavata-python-sdk/airavata/experiments/plan.py index b03267dd7b7..7c859922bba 100644 --- a/airavata-python-sdk/airavata_experiments/plan.py +++ b/airavata-python-sdk/airavata/experiments/plan.py @@ -25,11 +25,11 @@ from .runtime import is_terminal_state from .task import Task import uuid -from airavata_auth.device_auth import AuthContext +from airavata.auth.device_auth import AuthContext from .airavata import AiravataOperator -from airavata_sdk import Settings +from airavata import Settings class Plan(pydantic.BaseModel): diff --git a/airavata-python-sdk/airavata_experiments/runtime.py b/airavata-python-sdk/airavata/experiments/runtime.py similarity index 98% rename from airavata-python-sdk/airavata_experiments/runtime.py rename to airavata-python-sdk/airavata/experiments/runtime.py index 874cd3f818e..d35fdf50b22 100644 --- a/airavata-python-sdk/airavata_experiments/runtime.py +++ b/airavata-python-sdk/airavata/experiments/runtime.py @@ -21,7 +21,7 @@ import pydantic -from airavata_auth.device_auth import AuthContext +from airavata.auth.device_auth import AuthContext # from .task import Task Task = Any @@ -220,7 +220,7 @@ def status(self, task: Task) -> tuple[str, States]: assert task.agent_ref is not None from .airavata import AiravataOperator - from airavata_sdk.generated.org.apache.airavata.model.status.status_pb2 import JobState, ExperimentState + from airavata.model.status.status_pb2 import JobState, ExperimentState av = AiravataOperator(AuthContext.get_access_token()) # prioritize job state, fallback to experiment state job_id, job_state = av.get_task_status(task.ref) diff --git a/airavata-python-sdk/airavata_experiments/scripter.py b/airavata-python-sdk/airavata/experiments/scripter.py similarity index 100% rename from airavata-python-sdk/airavata_experiments/scripter.py rename to airavata-python-sdk/airavata/experiments/scripter.py diff --git a/airavata-python-sdk/airavata_experiments/sftp.py b/airavata-python-sdk/airavata/experiments/sftp.py similarity index 100% rename from airavata-python-sdk/airavata_experiments/sftp.py rename to airavata-python-sdk/airavata/experiments/sftp.py diff --git a/airavata-python-sdk/airavata_experiments/task.py b/airavata-python-sdk/airavata/experiments/task.py similarity index 100% rename from airavata-python-sdk/airavata_experiments/task.py rename to airavata-python-sdk/airavata/experiments/task.py diff --git a/airavata-python-sdk/airavata_jupyter_magic/__init__.py b/airavata-python-sdk/airavata/jupyter/__init__.py similarity index 99% rename from airavata-python-sdk/airavata_jupyter_magic/__init__.py rename to airavata-python-sdk/airavata/jupyter/__init__.py index b30f924f3ca..ba7f7f42bd7 100644 --- a/airavata-python-sdk/airavata_jupyter_magic/__init__.py +++ b/airavata-python-sdk/airavata/jupyter/__init__.py @@ -42,9 +42,9 @@ from jupyter_client.blocking.client import BlockingKernelClient -from airavata_auth.device_auth import AuthContext -from airavata_experiments.plan import Plan -from airavata_sdk import Settings +from airavata.auth.device_auth import AuthContext +from airavata.experiments.plan import Plan +from airavata import Settings # ======================================================================== # DATA STRUCTURES @@ -516,7 +516,7 @@ def submit_agent_job( assert Path(plan_file).exists(), f"Plan {plan_file} does not exist" assert Path(plan_file).is_file(), f"Plan {plan_file} is not a file" with open(Path(plan_file), "r") as f: - from airavata_experiments.base import Plan + from airavata.experiments.base import Plan plan = Plan(**json.load(f)) for task in plan.tasks: plan_cluster = str(task.runtime.args.get("cluster", "N/A")) @@ -1571,7 +1571,7 @@ def open_web_terminal(line: str): ipython = get_ipython() if ipython is None: - raise RuntimeError("airavata_jupyter_magic requires an ipython session") + raise RuntimeError("airavata.jupyter requires an ipython session") assert ipython is not None MSG_NOT_INITIALIZED = r"Runtime not found. Please run %request_runtime name= cluster= cpu= memory= queue= walltime= group= to request one." @@ -1786,7 +1786,7 @@ async def run_cell_async( version = importlib.metadata.version("airavata-python-sdk") print(rf""" -Loaded airavata_jupyter_magic ({version}) +Loaded airavata.jupyter ({version}) (current runtime = local) %authenticate -- Authenticate to access high-performance runtimes. diff --git a/airavata-python-sdk/airavata_sdk/clients/__init__.py b/airavata-python-sdk/airavata/model/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/clients/__init__.py rename to airavata-python-sdk/airavata/model/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/__init__.py b/airavata-python-sdk/airavata/model/appcatalog/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/__init__.py rename to airavata-python-sdk/airavata/model/appcatalog/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/__init__.py b/airavata-python-sdk/airavata/model/appcatalog/accountprovisioning/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/__init__.py rename to airavata-python-sdk/airavata/model/appcatalog/accountprovisioning/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2.py b/airavata-python-sdk/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2.py similarity index 94% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2.py rename to airavata-python-sdk/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2.py index 645e8897a1f..bb87f89a03e 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2.py +++ b/airavata-python-sdk/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.appcatalog.accountprovisioning.account_provisioning_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.appcatalog.accountprovisioning.account_provisioning_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n>org.apache.airavata.model.appcatalog.accountprovisioning.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2.pyi b/airavata-python-sdk/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2.pyi rename to airavata-python-sdk/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2_grpc.py b/airavata-python-sdk/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2_grpc.py rename to airavata-python-sdk/airavata/model/appcatalog/accountprovisioning/account_provisioning_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/__init__.py b/airavata-python-sdk/airavata/model/appcatalog/appdeployment/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/__init__.py rename to airavata-python-sdk/airavata/model/appcatalog/appdeployment/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appdeployment/app_deployment_pb2.py b/airavata-python-sdk/airavata/model/appcatalog/appdeployment/app_deployment_pb2.py similarity index 93% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appdeployment/app_deployment_pb2.py rename to airavata-python-sdk/airavata/model/appcatalog/appdeployment/app_deployment_pb2.py index b87df2946e8..3f1409c4c01 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appdeployment/app_deployment_pb2.py +++ b/airavata-python-sdk/airavata/model/appcatalog/appdeployment/app_deployment_pb2.py @@ -22,14 +22,14 @@ _sym_db = _symbol_database.Default() -from org.apache.airavata.model.parallelism import parallelism_pb2 as org_dot_apache_dot_airavata_dot_model_dot_parallelism_dot_parallelism__pb2 +from airavata.model.parallelism import parallelism_pb2 as org_dot_apache_dot_airavata_dot_model_dot_parallelism_dot_parallelism__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nGorg/apache/airavata/model/appcatalog/appdeployment/app_deployment.proto\x12\x32org.apache.airavata.model.appcatalog.appdeployment\x1a\x37org/apache/airavata/model/parallelism/parallelism.proto\"B\n\x0bSetEnvPaths\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x16\n\x0e\x65nv_path_order\x18\x03 \x01(\x05\"7\n\rCommandObject\x12\x0f\n\x07\x63ommand\x18\x01 \x01(\t\x12\x15\n\rcommand_order\x18\x02 \x01(\x05\"\x7f\n\x11\x41pplicationModule\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\x12\x17\n\x0f\x61pp_module_name\x18\x02 \x01(\t\x12\x1a\n\x12\x61pp_module_version\x18\x03 \x01(\t\x12\x1e\n\x16\x61pp_module_description\x18\x04 \x01(\t\"\xb2\x07\n ApplicationDeploymentDescription\x12\x19\n\x11\x61pp_deployment_id\x18\x01 \x01(\t\x12\x15\n\rapp_module_id\x18\x02 \x01(\t\x12\x17\n\x0f\x63ompute_host_id\x18\x03 \x01(\t\x12\x17\n\x0f\x65xecutable_path\x18\x04 \x01(\t\x12V\n\x0bparallelism\x18\x05 \x01(\x0e\x32\x41.org.apache.airavata.model.parallelism.ApplicationParallelismType\x12\"\n\x1a\x61pp_deployment_description\x18\x06 \x01(\t\x12[\n\x10module_load_cmds\x18\x07 \x03(\x0b\x32\x41.org.apache.airavata.model.appcatalog.appdeployment.CommandObject\x12Z\n\x11lib_prepend_paths\x18\x08 \x03(\x0b\x32?.org.apache.airavata.model.appcatalog.appdeployment.SetEnvPaths\x12Y\n\x10lib_append_paths\x18\t \x03(\x0b\x32?.org.apache.airavata.model.appcatalog.appdeployment.SetEnvPaths\x12X\n\x0fset_environment\x18\n \x03(\x0b\x32?.org.apache.airavata.model.appcatalog.appdeployment.SetEnvPaths\x12[\n\x10pre_job_commands\x18\x0b \x03(\x0b\x32\x41.org.apache.airavata.model.appcatalog.appdeployment.CommandObject\x12\\\n\x11post_job_commands\x18\x0c \x03(\x0b\x32\x41.org.apache.airavata.model.appcatalog.appdeployment.CommandObject\x12\x1a\n\x12\x64\x65\x66\x61ult_queue_name\x18\r \x01(\t\x12\x1a\n\x12\x64\x65\x66\x61ult_node_count\x18\x0e \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_cpu_count\x18\x0f \x01(\x05\x12\x18\n\x10\x64\x65\x66\x61ult_walltime\x18\x10 \x01(\x05\x12\x18\n\x10\x65\x64itable_by_user\x18\x11 \x01(\x08\x42<\n8org.apache.airavata.model.appcatalog.appdeployment.protoP\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.appcatalog.appdeployment.app_deployment_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.appcatalog.appdeployment.app_deployment_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n8org.apache.airavata.model.appcatalog.appdeployment.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appdeployment/app_deployment_pb2.pyi b/airavata-python-sdk/airavata/model/appcatalog/appdeployment/app_deployment_pb2.pyi similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appdeployment/app_deployment_pb2.pyi rename to airavata-python-sdk/airavata/model/appcatalog/appdeployment/app_deployment_pb2.pyi index 2735641f8cf..298398bfa1a 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appdeployment/app_deployment_pb2.pyi +++ b/airavata-python-sdk/airavata/model/appcatalog/appdeployment/app_deployment_pb2.pyi @@ -1,4 +1,4 @@ -from org.apache.airavata.model.parallelism import parallelism_pb2 as _parallelism_pb2 +from airavata.model.parallelism import parallelism_pb2 as _parallelism_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appdeployment/app_deployment_pb2_grpc.py b/airavata-python-sdk/airavata/model/appcatalog/appdeployment/app_deployment_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appdeployment/app_deployment_pb2_grpc.py rename to airavata-python-sdk/airavata/model/appcatalog/appdeployment/app_deployment_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/__init__.py b/airavata-python-sdk/airavata/model/appcatalog/appinterface/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/__init__.py rename to airavata-python-sdk/airavata/model/appcatalog/appinterface/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appinterface/app_interface_pb2.py b/airavata-python-sdk/airavata/model/appcatalog/appinterface/app_interface_pb2.py similarity index 88% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appinterface/app_interface_pb2.py rename to airavata-python-sdk/airavata/model/appcatalog/appinterface/app_interface_pb2.py index b251b2c7cfc..eba853ee1b6 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appinterface/app_interface_pb2.py +++ b/airavata-python-sdk/airavata/model/appcatalog/appinterface/app_interface_pb2.py @@ -22,14 +22,14 @@ _sym_db = _symbol_database.Default() -from org.apache.airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 +from airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nEorg/apache/airavata/model/appcatalog/appinterface/app_interface.proto\x12\x31org.apache.airavata.model.appcatalog.appinterface\x1a=org/apache/airavata/model/application/io/application_io.proto\"\xb4\x03\n\x1f\x41pplicationInterfaceDescription\x12 \n\x18\x61pplication_interface_id\x18\x01 \x01(\t\x12\x18\n\x10\x61pplication_name\x18\x02 \x01(\t\x12\x1f\n\x17\x61pplication_description\x18\x03 \x01(\t\x12\x1b\n\x13\x61pplication_modules\x18\x04 \x03(\t\x12Y\n\x12\x61pplication_inputs\x18\x05 \x03(\x0b\x32=.org.apache.airavata.model.application.io.InputDataObjectType\x12[\n\x13\x61pplication_outputs\x18\x06 \x03(\x0b\x32>.org.apache.airavata.model.application.io.OutputDataObjectType\x12!\n\x19\x61rchive_working_directory\x18\x07 \x01(\x08\x12 \n\x18has_optional_file_inputs\x18\x08 \x01(\x08\x12\x1a\n\x12\x63lean_after_staged\x18\t \x01(\x08\x42;\n7org.apache.airavata.model.appcatalog.appinterface.protoP\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.appcatalog.appinterface.app_interface_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.appcatalog.appinterface.app_interface_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n7org.apache.airavata.model.appcatalog.appinterface.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appinterface/app_interface_pb2.pyi b/airavata-python-sdk/airavata/model/appcatalog/appinterface/app_interface_pb2.pyi similarity index 95% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appinterface/app_interface_pb2.pyi rename to airavata-python-sdk/airavata/model/appcatalog/appinterface/app_interface_pb2.pyi index d58c68d4833..97881b0e6e5 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appinterface/app_interface_pb2.pyi +++ b/airavata-python-sdk/airavata/model/appcatalog/appinterface/app_interface_pb2.pyi @@ -1,4 +1,4 @@ -from org.apache.airavata.model.application.io import application_io_pb2 as _application_io_pb2 +from airavata.model.application.io import application_io_pb2 as _application_io_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appinterface/app_interface_pb2_grpc.py b/airavata-python-sdk/airavata/model/appcatalog/appinterface/app_interface_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appinterface/app_interface_pb2_grpc.py rename to airavata-python-sdk/airavata/model/appcatalog/appinterface/app_interface_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/__init__.py b/airavata-python-sdk/airavata/model/appcatalog/computeresource/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/__init__.py rename to airavata-python-sdk/airavata/model/appcatalog/computeresource/__init__.py diff --git a/airavata-python-sdk/airavata/model/appcatalog/computeresource/compute_resource_pb2.py b/airavata-python-sdk/airavata/model/appcatalog/computeresource/compute_resource_pb2.py new file mode 100644 index 00000000000..7fde6404d9d --- /dev/null +++ b/airavata-python-sdk/airavata/model/appcatalog/computeresource/compute_resource_pb2.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: org/apache/airavata/model/appcatalog/computeresource/compute_resource.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'org/apache/airavata/model/appcatalog/computeresource/compute_resource.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nKorg/apache/airavata/model/appcatalog/computeresource/compute_resource.proto\x12\x34org.apache.airavata.model.appcatalog.computeresource\"\xd8\x04\n\x12ResourceJobManager\x12\x1f\n\x17resource_job_manager_id\x18\x01 \x01(\t\x12o\n\x19resource_job_manager_type\x18\x02 \x01(\x0e\x32L.org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType\x12 \n\x18push_monitoring_endpoint\x18\x03 \x01(\t\x12\x1c\n\x14job_manager_bin_path\x18\x04 \x01(\t\x12~\n\x14job_manager_commands\x18\x05 \x03(\x0b\x32`.org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager.JobManagerCommandsEntry\x12{\n\x12parallelism_prefix\x18\x06 \x03(\x0b\x32_.org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager.ParallelismPrefixEntry\x1a\x39\n\x17JobManagerCommandsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16ParallelismPrefixEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcb\x02\n\nBatchQueue\x12\x12\n\nqueue_name\x18\x01 \x01(\t\x12\x19\n\x11queue_description\x18\x02 \x01(\t\x12\x14\n\x0cmax_run_time\x18\x03 \x01(\x05\x12\x11\n\tmax_nodes\x18\x04 \x01(\x05\x12\x16\n\x0emax_processors\x18\x05 \x01(\x05\x12\x19\n\x11max_jobs_in_queue\x18\x06 \x01(\x05\x12\x12\n\nmax_memory\x18\x07 \x01(\x05\x12\x14\n\x0c\x63pu_per_node\x18\x08 \x01(\x05\x12\x1a\n\x12\x64\x65\x66\x61ult_node_count\x18\t \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_cpu_count\x18\n \x01(\x05\x12\x18\n\x10\x64\x65\x66\x61ult_walltime\x18\x0b \x01(\x05\x12\x1d\n\x15queue_specific_macros\x18\x0c \x01(\t\x12\x18\n\x10is_default_queue\x18\r \x01(\x08\"\xa5\x06\n\x1a\x43omputeResourceDescription\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x11\n\thost_name\x18\x02 \x01(\t\x12\x14\n\x0chost_aliases\x18\x03 \x03(\t\x12\x14\n\x0cip_addresses\x18\x04 \x03(\t\x12\x1c\n\x14resource_description\x18\x05 \x01(\t\x12\x0f\n\x07\x65nabled\x18\x06 \x01(\x08\x12V\n\x0c\x62\x61tch_queues\x18\x07 \x03(\x0b\x32@.org.apache.airavata.model.appcatalog.computeresource.BatchQueue\x12w\n\x0c\x66ile_systems\x18\x08 \x03(\x0b\x32\x61.org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription.FileSystemsEntry\x12\x1b\n\x13max_memory_per_node\x18\x0b \x01(\x05\x12\x1f\n\x17gateway_usage_reporting\x18\x0c \x01(\x08\x12)\n!gateway_usage_module_load_command\x18\r \x01(\t\x12 \n\x18gateway_usage_executable\x18\x0e \x01(\t\x12\x15\n\rcpus_per_node\x18\x0f \x01(\x05\x12\x1a\n\x12\x64\x65\x66\x61ult_node_count\x18\x10 \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_cpu_count\x18\x11 \x01(\x05\x12\x18\n\x10\x64\x65\x66\x61ult_walltime\x18\x12 \x01(\x05\x12\x10\n\x08ssh_port\x18\x13 \x01(\x05\x12\x66\n\x14resource_job_manager\x18\x14 \x01(\x0b\x32H.org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager\x1a\x32\n\x10\x46ileSystemsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01J\x04\x08\t\x10\nJ\x04\x08\n\x10\x0b*\x9d\x01\n\x16ResourceJobManagerType\x12%\n!RESOURCE_JOB_MANAGER_TYPE_UNKNOWN\x10\x00\x12\x08\n\x04\x46ORK\x10\x01\x12\x07\n\x03PBS\x10\x02\x12\t\n\x05SLURM\x10\x03\x12\x07\n\x03LSF\x10\x04\x12\x07\n\x03UGE\x10\x05\x12\t\n\x05\x43LOUD\x10\x06\x12\x13\n\x0f\x41IRAVATA_CUSTOM\x10\x07\x12\x0c\n\x08HTCONDOR\x10\x08*\xfc\x01\n\x11JobManagerCommand\x12\x1f\n\x1bJOB_MANAGER_COMMAND_UNKNOWN\x10\x00\x12\x0e\n\nSUBMISSION\x10\x01\x12\x12\n\x0eJOB_MONITORING\x10\x02\x12\x0c\n\x08\x44\x45LETION\x10\x03\x12\r\n\tCHECK_JOB\x10\x04\x12\x0e\n\nSHOW_QUEUE\x10\x05\x12\x14\n\x10SHOW_RESERVATION\x10\x06\x12\x0e\n\nSHOW_START\x10\x07\x12\x15\n\x11SHOW_CLUSTER_INFO\x10\x08\x12\x1b\n\x17SHOW_NO_OF_RUNNING_JOBS\x10\t\x12\x1b\n\x17SHOW_NO_OF_PENDING_JOBS\x10\n*c\n\x0b\x46ileSystems\x12\x18\n\x14\x46ILE_SYSTEMS_UNKNOWN\x10\x00\x12\x08\n\x04HOME\x10\x01\x12\x08\n\x04WORK\x10\x02\x12\x0c\n\x08LOCALTMP\x10\x03\x12\x0b\n\x07SCRATCH\x10\x04\x12\x0b\n\x07\x41RCHIVE\x10\x05\x42>\n:org.apache.airavata.model.appcatalog.computeresource.protoP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.appcatalog.computeresource.compute_resource_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n:org.apache.airavata.model.appcatalog.computeresource.protoP\001' + _globals['_RESOURCEJOBMANAGER_JOBMANAGERCOMMANDSENTRY']._loaded_options = None + _globals['_RESOURCEJOBMANAGER_JOBMANAGERCOMMANDSENTRY']._serialized_options = b'8\001' + _globals['_RESOURCEJOBMANAGER_PARALLELISMPREFIXENTRY']._loaded_options = None + _globals['_RESOURCEJOBMANAGER_PARALLELISMPREFIXENTRY']._serialized_options = b'8\001' + _globals['_COMPUTERESOURCEDESCRIPTION_FILESYSTEMSENTRY']._loaded_options = None + _globals['_COMPUTERESOURCEDESCRIPTION_FILESYSTEMSENTRY']._serialized_options = b'8\001' + _globals['_RESOURCEJOBMANAGERTYPE']._serialized_start=1879 + _globals['_RESOURCEJOBMANAGERTYPE']._serialized_end=2036 + _globals['_JOBMANAGERCOMMAND']._serialized_start=2039 + _globals['_JOBMANAGERCOMMAND']._serialized_end=2291 + _globals['_FILESYSTEMS']._serialized_start=2293 + _globals['_FILESYSTEMS']._serialized_end=2392 + _globals['_RESOURCEJOBMANAGER']._serialized_start=134 + _globals['_RESOURCEJOBMANAGER']._serialized_end=734 + _globals['_RESOURCEJOBMANAGER_JOBMANAGERCOMMANDSENTRY']._serialized_start=619 + _globals['_RESOURCEJOBMANAGER_JOBMANAGERCOMMANDSENTRY']._serialized_end=676 + _globals['_RESOURCEJOBMANAGER_PARALLELISMPREFIXENTRY']._serialized_start=678 + _globals['_RESOURCEJOBMANAGER_PARALLELISMPREFIXENTRY']._serialized_end=734 + _globals['_BATCHQUEUE']._serialized_start=737 + _globals['_BATCHQUEUE']._serialized_end=1068 + _globals['_COMPUTERESOURCEDESCRIPTION']._serialized_start=1071 + _globals['_COMPUTERESOURCEDESCRIPTION']._serialized_end=1876 + _globals['_COMPUTERESOURCEDESCRIPTION_FILESYSTEMSENTRY']._serialized_start=1814 + _globals['_COMPUTERESOURCEDESCRIPTION_FILESYSTEMSENTRY']._serialized_end=1864 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/computeresource/compute_resource_pb2.pyi b/airavata-python-sdk/airavata/model/appcatalog/computeresource/compute_resource_pb2.pyi similarity index 50% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/computeresource/compute_resource_pb2.pyi rename to airavata-python-sdk/airavata/model/appcatalog/computeresource/compute_resource_pb2.pyi index e61a91f839f..d23e47b8218 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/computeresource/compute_resource_pb2.pyi +++ b/airavata-python-sdk/airavata/model/appcatalog/computeresource/compute_resource_pb2.pyi @@ -1,5 +1,3 @@ -from org.apache.airavata.model.parallelism import parallelism_pb2 as _parallelism_pb2 -from org.apache.airavata.model.data.movement import data_movement_pb2 as _data_movement_pb2 from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor @@ -43,40 +41,6 @@ class FileSystems(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): LOCALTMP: _ClassVar[FileSystems] SCRATCH: _ClassVar[FileSystems] ARCHIVE: _ClassVar[FileSystems] - -class JobSubmissionProtocol(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - JOB_SUBMISSION_PROTOCOL_UNKNOWN: _ClassVar[JobSubmissionProtocol] - LOCAL: _ClassVar[JobSubmissionProtocol] - SSH: _ClassVar[JobSubmissionProtocol] - GLOBUS: _ClassVar[JobSubmissionProtocol] - UNICORE: _ClassVar[JobSubmissionProtocol] - JSP_CLOUD: _ClassVar[JobSubmissionProtocol] - SSH_FORK: _ClassVar[JobSubmissionProtocol] - LOCAL_FORK: _ClassVar[JobSubmissionProtocol] - -class MonitorMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - MONITOR_MODE_UNKNOWN: _ClassVar[MonitorMode] - POLL_JOB_MANAGER: _ClassVar[MonitorMode] - CLOUD_JOB_MONITOR: _ClassVar[MonitorMode] - JOB_EMAIL_NOTIFICATION_MONITOR: _ClassVar[MonitorMode] - XSEDE_AMQP_SUBSCRIBE: _ClassVar[MonitorMode] - MONITOR_FORK: _ClassVar[MonitorMode] - MONITOR_LOCAL: _ClassVar[MonitorMode] - -class DMType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - DM_TYPE_UNKNOWN: _ClassVar[DMType] - COMPUTE_RESOURCE: _ClassVar[DMType] - STORAGE_RESOURCE: _ClassVar[DMType] - -class ProviderName(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - PROVIDER_NAME_UNKNOWN: _ClassVar[ProviderName] - EC2: _ClassVar[ProviderName] - AWSEC2: _ClassVar[ProviderName] - RACKSPACE: _ClassVar[ProviderName] RESOURCE_JOB_MANAGER_TYPE_UNKNOWN: ResourceJobManagerType FORK: ResourceJobManagerType PBS: ResourceJobManagerType @@ -103,28 +67,6 @@ WORK: FileSystems LOCALTMP: FileSystems SCRATCH: FileSystems ARCHIVE: FileSystems -JOB_SUBMISSION_PROTOCOL_UNKNOWN: JobSubmissionProtocol -LOCAL: JobSubmissionProtocol -SSH: JobSubmissionProtocol -GLOBUS: JobSubmissionProtocol -UNICORE: JobSubmissionProtocol -JSP_CLOUD: JobSubmissionProtocol -SSH_FORK: JobSubmissionProtocol -LOCAL_FORK: JobSubmissionProtocol -MONITOR_MODE_UNKNOWN: MonitorMode -POLL_JOB_MANAGER: MonitorMode -CLOUD_JOB_MONITOR: MonitorMode -JOB_EMAIL_NOTIFICATION_MONITOR: MonitorMode -XSEDE_AMQP_SUBSCRIBE: MonitorMode -MONITOR_FORK: MonitorMode -MONITOR_LOCAL: MonitorMode -DM_TYPE_UNKNOWN: DMType -COMPUTE_RESOURCE: DMType -STORAGE_RESOURCE: DMType -PROVIDER_NAME_UNKNOWN: ProviderName -EC2: ProviderName -AWSEC2: ProviderName -RACKSPACE: ProviderName class ResourceJobManager(_message.Message): __slots__ = ("resource_job_manager_id", "resource_job_manager_type", "push_monitoring_endpoint", "job_manager_bin_path", "job_manager_commands", "parallelism_prefix") @@ -186,82 +128,8 @@ class BatchQueue(_message.Message): is_default_queue: bool def __init__(self, queue_name: _Optional[str] = ..., queue_description: _Optional[str] = ..., max_run_time: _Optional[int] = ..., max_nodes: _Optional[int] = ..., max_processors: _Optional[int] = ..., max_jobs_in_queue: _Optional[int] = ..., max_memory: _Optional[int] = ..., cpu_per_node: _Optional[int] = ..., default_node_count: _Optional[int] = ..., default_cpu_count: _Optional[int] = ..., default_walltime: _Optional[int] = ..., queue_specific_macros: _Optional[str] = ..., is_default_queue: bool = ...) -> None: ... -class LOCALSubmission(_message.Message): - __slots__ = ("job_submission_interface_id", "resource_job_manager", "security_protocol") - JOB_SUBMISSION_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] - RESOURCE_JOB_MANAGER_FIELD_NUMBER: _ClassVar[int] - SECURITY_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - job_submission_interface_id: str - resource_job_manager: ResourceJobManager - security_protocol: _data_movement_pb2.SecurityProtocol - def __init__(self, job_submission_interface_id: _Optional[str] = ..., resource_job_manager: _Optional[_Union[ResourceJobManager, _Mapping]] = ..., security_protocol: _Optional[_Union[_data_movement_pb2.SecurityProtocol, str]] = ...) -> None: ... - -class SSHJobSubmission(_message.Message): - __slots__ = ("job_submission_interface_id", "security_protocol", "resource_job_manager", "alternative_ssh_host_name", "ssh_port", "monitor_mode", "batch_queue_email_senders") - JOB_SUBMISSION_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] - SECURITY_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - RESOURCE_JOB_MANAGER_FIELD_NUMBER: _ClassVar[int] - ALTERNATIVE_SSH_HOST_NAME_FIELD_NUMBER: _ClassVar[int] - SSH_PORT_FIELD_NUMBER: _ClassVar[int] - MONITOR_MODE_FIELD_NUMBER: _ClassVar[int] - BATCH_QUEUE_EMAIL_SENDERS_FIELD_NUMBER: _ClassVar[int] - job_submission_interface_id: str - security_protocol: _data_movement_pb2.SecurityProtocol - resource_job_manager: ResourceJobManager - alternative_ssh_host_name: str - ssh_port: int - monitor_mode: MonitorMode - batch_queue_email_senders: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, job_submission_interface_id: _Optional[str] = ..., security_protocol: _Optional[_Union[_data_movement_pb2.SecurityProtocol, str]] = ..., resource_job_manager: _Optional[_Union[ResourceJobManager, _Mapping]] = ..., alternative_ssh_host_name: _Optional[str] = ..., ssh_port: _Optional[int] = ..., monitor_mode: _Optional[_Union[MonitorMode, str]] = ..., batch_queue_email_senders: _Optional[_Iterable[str]] = ...) -> None: ... - -class GlobusJobSubmission(_message.Message): - __slots__ = ("job_submission_interface_id", "security_protocol", "globus_gate_keeper_end_point") - JOB_SUBMISSION_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] - SECURITY_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - GLOBUS_GATE_KEEPER_END_POINT_FIELD_NUMBER: _ClassVar[int] - job_submission_interface_id: str - security_protocol: _data_movement_pb2.SecurityProtocol - globus_gate_keeper_end_point: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, job_submission_interface_id: _Optional[str] = ..., security_protocol: _Optional[_Union[_data_movement_pb2.SecurityProtocol, str]] = ..., globus_gate_keeper_end_point: _Optional[_Iterable[str]] = ...) -> None: ... - -class UnicoreJobSubmission(_message.Message): - __slots__ = ("job_submission_interface_id", "security_protocol", "unicore_end_point_url") - JOB_SUBMISSION_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] - SECURITY_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - UNICORE_END_POINT_URL_FIELD_NUMBER: _ClassVar[int] - job_submission_interface_id: str - security_protocol: _data_movement_pb2.SecurityProtocol - unicore_end_point_url: str - def __init__(self, job_submission_interface_id: _Optional[str] = ..., security_protocol: _Optional[_Union[_data_movement_pb2.SecurityProtocol, str]] = ..., unicore_end_point_url: _Optional[str] = ...) -> None: ... - -class CloudJobSubmission(_message.Message): - __slots__ = ("job_submission_interface_id", "security_protocol", "node_id", "executable_type", "provider_name", "user_account_name") - JOB_SUBMISSION_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] - SECURITY_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - NODE_ID_FIELD_NUMBER: _ClassVar[int] - EXECUTABLE_TYPE_FIELD_NUMBER: _ClassVar[int] - PROVIDER_NAME_FIELD_NUMBER: _ClassVar[int] - USER_ACCOUNT_NAME_FIELD_NUMBER: _ClassVar[int] - job_submission_interface_id: str - security_protocol: _data_movement_pb2.SecurityProtocol - node_id: str - executable_type: str - provider_name: ProviderName - user_account_name: str - def __init__(self, job_submission_interface_id: _Optional[str] = ..., security_protocol: _Optional[_Union[_data_movement_pb2.SecurityProtocol, str]] = ..., node_id: _Optional[str] = ..., executable_type: _Optional[str] = ..., provider_name: _Optional[_Union[ProviderName, str]] = ..., user_account_name: _Optional[str] = ...) -> None: ... - -class JobSubmissionInterface(_message.Message): - __slots__ = ("job_submission_interface_id", "job_submission_protocol", "priority_order") - JOB_SUBMISSION_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] - JOB_SUBMISSION_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - PRIORITY_ORDER_FIELD_NUMBER: _ClassVar[int] - job_submission_interface_id: str - job_submission_protocol: JobSubmissionProtocol - priority_order: int - def __init__(self, job_submission_interface_id: _Optional[str] = ..., job_submission_protocol: _Optional[_Union[JobSubmissionProtocol, str]] = ..., priority_order: _Optional[int] = ...) -> None: ... - class ComputeResourceDescription(_message.Message): - __slots__ = ("compute_resource_id", "host_name", "host_aliases", "ip_addresses", "resource_description", "enabled", "batch_queues", "file_systems", "job_submission_interfaces", "data_movement_interfaces", "max_memory_per_node", "gateway_usage_reporting", "gateway_usage_module_load_command", "gateway_usage_executable", "cpus_per_node", "default_node_count", "default_cpu_count", "default_walltime") + __slots__ = ("compute_resource_id", "host_name", "host_aliases", "ip_addresses", "resource_description", "enabled", "batch_queues", "file_systems", "max_memory_per_node", "gateway_usage_reporting", "gateway_usage_module_load_command", "gateway_usage_executable", "cpus_per_node", "default_node_count", "default_cpu_count", "default_walltime", "ssh_port", "resource_job_manager") class FileSystemsEntry(_message.Message): __slots__ = ("key", "value") KEY_FIELD_NUMBER: _ClassVar[int] @@ -277,8 +145,6 @@ class ComputeResourceDescription(_message.Message): ENABLED_FIELD_NUMBER: _ClassVar[int] BATCH_QUEUES_FIELD_NUMBER: _ClassVar[int] FILE_SYSTEMS_FIELD_NUMBER: _ClassVar[int] - JOB_SUBMISSION_INTERFACES_FIELD_NUMBER: _ClassVar[int] - DATA_MOVEMENT_INTERFACES_FIELD_NUMBER: _ClassVar[int] MAX_MEMORY_PER_NODE_FIELD_NUMBER: _ClassVar[int] GATEWAY_USAGE_REPORTING_FIELD_NUMBER: _ClassVar[int] GATEWAY_USAGE_MODULE_LOAD_COMMAND_FIELD_NUMBER: _ClassVar[int] @@ -287,6 +153,8 @@ class ComputeResourceDescription(_message.Message): DEFAULT_NODE_COUNT_FIELD_NUMBER: _ClassVar[int] DEFAULT_CPU_COUNT_FIELD_NUMBER: _ClassVar[int] DEFAULT_WALLTIME_FIELD_NUMBER: _ClassVar[int] + SSH_PORT_FIELD_NUMBER: _ClassVar[int] + RESOURCE_JOB_MANAGER_FIELD_NUMBER: _ClassVar[int] compute_resource_id: str host_name: str host_aliases: _containers.RepeatedScalarFieldContainer[str] @@ -295,8 +163,6 @@ class ComputeResourceDescription(_message.Message): enabled: bool batch_queues: _containers.RepeatedCompositeFieldContainer[BatchQueue] file_systems: _containers.ScalarMap[int, str] - job_submission_interfaces: _containers.RepeatedCompositeFieldContainer[JobSubmissionInterface] - data_movement_interfaces: _containers.RepeatedCompositeFieldContainer[_data_movement_pb2.DataMovementInterface] max_memory_per_node: int gateway_usage_reporting: bool gateway_usage_module_load_command: str @@ -305,4 +171,6 @@ class ComputeResourceDescription(_message.Message): default_node_count: int default_cpu_count: int default_walltime: int - def __init__(self, compute_resource_id: _Optional[str] = ..., host_name: _Optional[str] = ..., host_aliases: _Optional[_Iterable[str]] = ..., ip_addresses: _Optional[_Iterable[str]] = ..., resource_description: _Optional[str] = ..., enabled: bool = ..., batch_queues: _Optional[_Iterable[_Union[BatchQueue, _Mapping]]] = ..., file_systems: _Optional[_Mapping[int, str]] = ..., job_submission_interfaces: _Optional[_Iterable[_Union[JobSubmissionInterface, _Mapping]]] = ..., data_movement_interfaces: _Optional[_Iterable[_Union[_data_movement_pb2.DataMovementInterface, _Mapping]]] = ..., max_memory_per_node: _Optional[int] = ..., gateway_usage_reporting: bool = ..., gateway_usage_module_load_command: _Optional[str] = ..., gateway_usage_executable: _Optional[str] = ..., cpus_per_node: _Optional[int] = ..., default_node_count: _Optional[int] = ..., default_cpu_count: _Optional[int] = ..., default_walltime: _Optional[int] = ...) -> None: ... + ssh_port: int + resource_job_manager: ResourceJobManager + def __init__(self, compute_resource_id: _Optional[str] = ..., host_name: _Optional[str] = ..., host_aliases: _Optional[_Iterable[str]] = ..., ip_addresses: _Optional[_Iterable[str]] = ..., resource_description: _Optional[str] = ..., enabled: bool = ..., batch_queues: _Optional[_Iterable[_Union[BatchQueue, _Mapping]]] = ..., file_systems: _Optional[_Mapping[int, str]] = ..., max_memory_per_node: _Optional[int] = ..., gateway_usage_reporting: bool = ..., gateway_usage_module_load_command: _Optional[str] = ..., gateway_usage_executable: _Optional[str] = ..., cpus_per_node: _Optional[int] = ..., default_node_count: _Optional[int] = ..., default_cpu_count: _Optional[int] = ..., default_walltime: _Optional[int] = ..., ssh_port: _Optional[int] = ..., resource_job_manager: _Optional[_Union[ResourceJobManager, _Mapping]] = ...) -> None: ... diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/computeresource/compute_resource_pb2_grpc.py b/airavata-python-sdk/airavata/model/appcatalog/computeresource/compute_resource_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/computeresource/compute_resource_pb2_grpc.py rename to airavata-python-sdk/airavata/model/appcatalog/computeresource/compute_resource_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/accountprovisioning/__init__.py b/airavata-python-sdk/airavata/model/appcatalog/gatewaygroups/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/accountprovisioning/__init__.py rename to airavata-python-sdk/airavata/model/appcatalog/gatewaygroups/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2.py b/airavata-python-sdk/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2.py similarity index 92% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2.py rename to airavata-python-sdk/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2.py index ce58f09084e..114b1ffb835 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2.py +++ b/airavata-python-sdk/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.appcatalog.gatewaygroups.gateway_groups_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.appcatalog.gatewaygroups.gateway_groups_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n8org.apache.airavata.model.appcatalog.gatewaygroups.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2.pyi b/airavata-python-sdk/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2.pyi rename to airavata-python-sdk/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2_grpc.py b/airavata-python-sdk/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2_grpc.py rename to airavata-python-sdk/airavata/model/appcatalog/gatewaygroups/gateway_groups_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appdeployment/__init__.py b/airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appdeployment/__init__.py rename to airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/__init__.py diff --git a/airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2.py b/airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2.py new file mode 100644 index 00000000000..f759a0d4916 --- /dev/null +++ b/airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nIorg/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile.proto\x12\x33org.apache.airavata.model.appcatalog.gatewayprofile\"\xcc\x05\n\x19\x43omputeResourcePreference\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x1c\n\x14override_by_airavata\x18\x02 \x01(\x08\x12\x17\n\x0flogin_user_name\x18\x03 \x01(\t\x12\x1d\n\x15preferred_batch_queue\x18\x06 \x01(\t\x12\x18\n\x10scratch_location\x18\x07 \x01(\t\x12!\n\x19\x61llocation_project_number\x18\x08 \x01(\t\x12\x30\n(resource_specific_credential_store_token\x18\t \x01(\t\x12\"\n\x1ausage_reporting_gateway_id\x18\n \x01(\t\x12\x1a\n\x12quality_of_service\x18\x0b \x01(\t\x12\x13\n\x0breservation\x18\x0c \x01(\t\x12\x1e\n\x16reservation_start_time\x18\r \x01(\x03\x12\x1c\n\x14reservation_end_time\x18\x0e \x01(\x03\x12\x1f\n\x17ssh_account_provisioner\x18\x0f \x01(\t\x12\x97\x01\n\x1essh_account_provisioner_config\x18\x10 \x03(\x0b\x32o.org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference.SshAccountProvisionerConfigEntry\x12/\n\'ssh_account_provisioner_additional_info\x18\x11 \x01(\t\x1a\x42\n SshAccountProvisionerConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06\"\x9e\x01\n\x11StoragePreference\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x17\n\x0flogin_user_name\x18\x02 \x01(\t\x12!\n\x19\x66ile_system_root_location\x18\x03 \x01(\t\x12\x30\n(resource_specific_credential_store_token\x18\x04 \x01(\t\"\xef\x02\n\x16GatewayResourceProfile\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1e\n\x16\x63redential_store_token\x18\x02 \x01(\t\x12t\n\x1c\x63ompute_resource_preferences\x18\x03 \x03(\x0b\x32N.org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference\x12\x63\n\x13storage_preferences\x18\x04 \x03(\x0b\x32\x46.org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference\x12\x1e\n\x16identity_server_tenant\x18\x05 \x01(\t\x12&\n\x1eidentity_server_pwd_cred_token\x18\x06 \x01(\tB=\n9org.apache.airavata.model.appcatalog.gatewayprofile.protoP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.appcatalog.gatewayprofile.gateway_profile_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n9org.apache.airavata.model.appcatalog.gatewayprofile.protoP\001' + _globals['_COMPUTERESOURCEPREFERENCE_SSHACCOUNTPROVISIONERCONFIGENTRY']._loaded_options = None + _globals['_COMPUTERESOURCEPREFERENCE_SSHACCOUNTPROVISIONERCONFIGENTRY']._serialized_options = b'8\001' + _globals['_COMPUTERESOURCEPREFERENCE']._serialized_start=131 + _globals['_COMPUTERESOURCEPREFERENCE']._serialized_end=847 + _globals['_COMPUTERESOURCEPREFERENCE_SSHACCOUNTPROVISIONERCONFIGENTRY']._serialized_start=769 + _globals['_COMPUTERESOURCEPREFERENCE_SSHACCOUNTPROVISIONERCONFIGENTRY']._serialized_end=835 + _globals['_STORAGEPREFERENCE']._serialized_start=850 + _globals['_STORAGEPREFERENCE']._serialized_end=1008 + _globals['_GATEWAYRESOURCEPROFILE']._serialized_start=1011 + _globals['_GATEWAYRESOURCEPROFILE']._serialized_end=1378 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2.pyi b/airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2.pyi similarity index 71% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2.pyi rename to airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2.pyi index b2560fcd18d..b2809a1a671 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2.pyi +++ b/airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2.pyi @@ -1,5 +1,3 @@ -from org.apache.airavata.model.appcatalog.computeresource import compute_resource_pb2 as _compute_resource_pb2 -from org.apache.airavata.model.data.movement import data_movement_pb2 as _data_movement_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -9,7 +7,7 @@ from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor class ComputeResourcePreference(_message.Message): - __slots__ = ("compute_resource_id", "override_by_airavata", "login_user_name", "preferred_job_submission_protocol", "preferred_data_movement_protocol", "preferred_batch_queue", "scratch_location", "allocation_project_number", "resource_specific_credential_store_token", "usage_reporting_gateway_id", "quality_of_service", "reservation", "reservation_start_time", "reservation_end_time", "ssh_account_provisioner", "ssh_account_provisioner_config", "ssh_account_provisioner_additional_info") + __slots__ = ("compute_resource_id", "override_by_airavata", "login_user_name", "preferred_batch_queue", "scratch_location", "allocation_project_number", "resource_specific_credential_store_token", "usage_reporting_gateway_id", "quality_of_service", "reservation", "reservation_start_time", "reservation_end_time", "ssh_account_provisioner", "ssh_account_provisioner_config", "ssh_account_provisioner_additional_info") class SshAccountProvisionerConfigEntry(_message.Message): __slots__ = ("key", "value") KEY_FIELD_NUMBER: _ClassVar[int] @@ -20,8 +18,6 @@ class ComputeResourcePreference(_message.Message): COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] OVERRIDE_BY_AIRAVATA_FIELD_NUMBER: _ClassVar[int] LOGIN_USER_NAME_FIELD_NUMBER: _ClassVar[int] - PREFERRED_JOB_SUBMISSION_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - PREFERRED_DATA_MOVEMENT_PROTOCOL_FIELD_NUMBER: _ClassVar[int] PREFERRED_BATCH_QUEUE_FIELD_NUMBER: _ClassVar[int] SCRATCH_LOCATION_FIELD_NUMBER: _ClassVar[int] ALLOCATION_PROJECT_NUMBER_FIELD_NUMBER: _ClassVar[int] @@ -37,8 +33,6 @@ class ComputeResourcePreference(_message.Message): compute_resource_id: str override_by_airavata: bool login_user_name: str - preferred_job_submission_protocol: _compute_resource_pb2.JobSubmissionProtocol - preferred_data_movement_protocol: _data_movement_pb2.DataMovementProtocol preferred_batch_queue: str scratch_location: str allocation_project_number: str @@ -51,7 +45,7 @@ class ComputeResourcePreference(_message.Message): ssh_account_provisioner: str ssh_account_provisioner_config: _containers.ScalarMap[str, str] ssh_account_provisioner_additional_info: str - def __init__(self, compute_resource_id: _Optional[str] = ..., override_by_airavata: bool = ..., login_user_name: _Optional[str] = ..., preferred_job_submission_protocol: _Optional[_Union[_compute_resource_pb2.JobSubmissionProtocol, str]] = ..., preferred_data_movement_protocol: _Optional[_Union[_data_movement_pb2.DataMovementProtocol, str]] = ..., preferred_batch_queue: _Optional[str] = ..., scratch_location: _Optional[str] = ..., allocation_project_number: _Optional[str] = ..., resource_specific_credential_store_token: _Optional[str] = ..., usage_reporting_gateway_id: _Optional[str] = ..., quality_of_service: _Optional[str] = ..., reservation: _Optional[str] = ..., reservation_start_time: _Optional[int] = ..., reservation_end_time: _Optional[int] = ..., ssh_account_provisioner: _Optional[str] = ..., ssh_account_provisioner_config: _Optional[_Mapping[str, str]] = ..., ssh_account_provisioner_additional_info: _Optional[str] = ...) -> None: ... + def __init__(self, compute_resource_id: _Optional[str] = ..., override_by_airavata: bool = ..., login_user_name: _Optional[str] = ..., preferred_batch_queue: _Optional[str] = ..., scratch_location: _Optional[str] = ..., allocation_project_number: _Optional[str] = ..., resource_specific_credential_store_token: _Optional[str] = ..., usage_reporting_gateway_id: _Optional[str] = ..., quality_of_service: _Optional[str] = ..., reservation: _Optional[str] = ..., reservation_start_time: _Optional[int] = ..., reservation_end_time: _Optional[int] = ..., ssh_account_provisioner: _Optional[str] = ..., ssh_account_provisioner_config: _Optional[_Mapping[str, str]] = ..., ssh_account_provisioner_additional_info: _Optional[str] = ...) -> None: ... class StoragePreference(_message.Message): __slots__ = ("storage_resource_id", "login_user_name", "file_system_root_location", "resource_specific_credential_store_token") diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2_grpc.py b/airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2_grpc.py rename to airavata-python-sdk/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appinterface/__init__.py b/airavata-python-sdk/airavata/model/appcatalog/groupresourceprofile/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/appinterface/__init__.py rename to airavata-python-sdk/airavata/model/appcatalog/groupresourceprofile/__init__.py diff --git a/airavata-python-sdk/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2.py b/airavata-python-sdk/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2.py new file mode 100644 index 00000000000..8a7ba1c6cae --- /dev/null +++ b/airavata-python-sdk/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nVorg/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile.proto\x12\x39org.apache.airavata.model.appcatalog.groupresourceprofile\"\x85\x01\n GroupAccountSSHProvisionerConfig\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x02 \x01(\t\x12\x13\n\x0b\x63onfig_name\x18\x03 \x01(\t\x12\x14\n\x0c\x63onfig_value\x18\x04 \x01(\t\"\x89\x01\n\x1a\x43omputeResourceReservation\x12\x16\n\x0ereservation_id\x18\x01 \x01(\t\x12\x18\n\x10reservation_name\x18\x02 \x01(\t\x12\x13\n\x0bqueue_names\x18\x03 \x03(\t\x12\x12\n\nstart_time\x18\x04 \x01(\x03\x12\x10\n\x08\x65nd_time\x18\x05 \x01(\x03\"\xee\x03\n\x1eSlurmComputeResourcePreference\x12!\n\x19\x61llocation_project_number\x18\x01 \x01(\t\x12\x1d\n\x15preferred_batch_queue\x18\x02 \x01(\t\x12\x1a\n\x12quality_of_service\x18\x03 \x01(\t\x12\"\n\x1ausage_reporting_gateway_id\x18\x04 \x01(\t\x12\x1f\n\x17ssh_account_provisioner\x18\x05 \x01(\t\x12\x8a\x01\n%group_ssh_account_provisioner_configs\x18\x06 \x03(\x0b\x32[.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupAccountSSHProvisionerConfig\x12/\n\'ssh_account_provisioner_additional_info\x18\x07 \x01(\t\x12k\n\x0creservations\x18\x08 \x03(\x0b\x32U.org.apache.airavata.model.appcatalog.groupresourceprofile.ComputeResourceReservation\"i\n\x1c\x41wsComputeResourcePreference\x12\x0e\n\x06region\x18\x01 \x01(\t\x12\x18\n\x10preferred_ami_id\x18\x02 \x01(\t\x12\x1f\n\x17preferred_instance_type\x18\x03 \x01(\t\"\x83\x02\n\x1e\x45nvironmentSpecificPreferences\x12j\n\x05slurm\x18\x01 \x01(\x0b\x32Y.org.apache.airavata.model.appcatalog.groupresourceprofile.SlurmComputeResourcePreferenceH\x00\x12\x66\n\x03\x61ws\x18\x02 \x01(\x0b\x32W.org.apache.airavata.model.appcatalog.groupresourceprofile.AwsComputeResourcePreferenceH\x00\x42\r\n\x0bpreferences\"\xc8\x03\n\x1eGroupComputeResourcePreference\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x02 \x01(\t\x12\x1c\n\x14override_by_airavata\x18\x03 \x01(\x08\x12\x17\n\x0flogin_user_name\x18\x04 \x01(\t\x12\x18\n\x10scratch_location\x18\x05 \x01(\t\x12\x30\n(resource_specific_credential_store_token\x18\x08 \x01(\t\x12^\n\rresource_type\x18\t \x01(\x0e\x32G.org.apache.airavata.model.appcatalog.groupresourceprofile.ResourceType\x12w\n\x14specific_preferences\x18\n \x01(\x0b\x32Y.org.apache.airavata.model.appcatalog.groupresourceprofile.EnvironmentSpecificPreferencesJ\x04\x08\x06\x10\x07J\x04\x08\x07\x10\x08\"\x91\x01\n\x15\x43omputeResourcePolicy\x12\x1a\n\x12resource_policy_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x03 \x01(\t\x12\x1c\n\x14\x61llowed_batch_queues\x18\x04 \x03(\t\"\xdd\x01\n\x18\x42\x61tchQueueResourcePolicy\x12\x1a\n\x12resource_policy_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x03 \x01(\t\x12\x11\n\tqueuename\x18\x04 \x01(\t\x12\x19\n\x11max_allowed_nodes\x18\x05 \x01(\x05\x12\x19\n\x11max_allowed_cores\x18\x06 \x01(\x05\x12\x1c\n\x14max_allowed_walltime\x18\x07 \x01(\x05\"\xb0\x04\n\x14GroupResourceProfile\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x02 \x01(\t\x12#\n\x1bgroup_resource_profile_name\x18\x03 \x01(\t\x12v\n\x13\x63ompute_preferences\x18\x04 \x03(\x0b\x32Y.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupComputeResourcePreference\x12s\n\x19\x63ompute_resource_policies\x18\x05 \x03(\x0b\x32P.org.apache.airavata.model.appcatalog.groupresourceprofile.ComputeResourcePolicy\x12z\n\x1d\x62\x61tch_queue_resource_policies\x18\x06 \x03(\x0b\x32S.org.apache.airavata.model.appcatalog.groupresourceprofile.BatchQueueResourcePolicy\x12\x15\n\rcreation_time\x18\x07 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x08 \x01(\x03\x12&\n\x1e\x64\x65\x66\x61ult_credential_store_token\x18\t \x01(\t*=\n\x0cResourceType\x12\x19\n\x15RESOURCE_TYPE_UNKNOWN\x10\x00\x12\t\n\x05SLURM\x10\x01\x12\x07\n\x03\x41WS\x10\x02\x42\x43\n?org.apache.airavata.model.appcatalog.groupresourceprofile.protoP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.appcatalog.groupresourceprofile.group_resource_profile_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n?org.apache.airavata.model.appcatalog.groupresourceprofile.protoP\001' + _globals['_RESOURCETYPE']._serialized_start=2685 + _globals['_RESOURCETYPE']._serialized_end=2746 + _globals['_GROUPACCOUNTSSHPROVISIONERCONFIG']._serialized_start=150 + _globals['_GROUPACCOUNTSSHPROVISIONERCONFIG']._serialized_end=283 + _globals['_COMPUTERESOURCERESERVATION']._serialized_start=286 + _globals['_COMPUTERESOURCERESERVATION']._serialized_end=423 + _globals['_SLURMCOMPUTERESOURCEPREFERENCE']._serialized_start=426 + _globals['_SLURMCOMPUTERESOURCEPREFERENCE']._serialized_end=920 + _globals['_AWSCOMPUTERESOURCEPREFERENCE']._serialized_start=922 + _globals['_AWSCOMPUTERESOURCEPREFERENCE']._serialized_end=1027 + _globals['_ENVIRONMENTSPECIFICPREFERENCES']._serialized_start=1030 + _globals['_ENVIRONMENTSPECIFICPREFERENCES']._serialized_end=1289 + _globals['_GROUPCOMPUTERESOURCEPREFERENCE']._serialized_start=1292 + _globals['_GROUPCOMPUTERESOURCEPREFERENCE']._serialized_end=1748 + _globals['_COMPUTERESOURCEPOLICY']._serialized_start=1751 + _globals['_COMPUTERESOURCEPOLICY']._serialized_end=1896 + _globals['_BATCHQUEUERESOURCEPOLICY']._serialized_start=1899 + _globals['_BATCHQUEUERESOURCEPOLICY']._serialized_end=2120 + _globals['_GROUPRESOURCEPROFILE']._serialized_start=2123 + _globals['_GROUPRESOURCEPROFILE']._serialized_end=2683 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2.pyi b/airavata-python-sdk/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2.pyi similarity index 89% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2.pyi rename to airavata-python-sdk/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2.pyi index 25503667e70..a77ff8f0ba4 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2.pyi +++ b/airavata-python-sdk/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2.pyi @@ -1,5 +1,3 @@ -from org.apache.airavata.model.appcatalog.computeresource import compute_resource_pb2 as _compute_resource_pb2 -from org.apache.airavata.model.data.movement import data_movement_pb2 as _data_movement_pb2 from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor @@ -83,14 +81,12 @@ class EnvironmentSpecificPreferences(_message.Message): def __init__(self, slurm: _Optional[_Union[SlurmComputeResourcePreference, _Mapping]] = ..., aws: _Optional[_Union[AwsComputeResourcePreference, _Mapping]] = ...) -> None: ... class GroupComputeResourcePreference(_message.Message): - __slots__ = ("compute_resource_id", "group_resource_profile_id", "override_by_airavata", "login_user_name", "scratch_location", "preferred_job_submission_protocol", "preferred_data_movement_protocol", "resource_specific_credential_store_token", "resource_type", "specific_preferences") + __slots__ = ("compute_resource_id", "group_resource_profile_id", "override_by_airavata", "login_user_name", "scratch_location", "resource_specific_credential_store_token", "resource_type", "specific_preferences") COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] GROUP_RESOURCE_PROFILE_ID_FIELD_NUMBER: _ClassVar[int] OVERRIDE_BY_AIRAVATA_FIELD_NUMBER: _ClassVar[int] LOGIN_USER_NAME_FIELD_NUMBER: _ClassVar[int] SCRATCH_LOCATION_FIELD_NUMBER: _ClassVar[int] - PREFERRED_JOB_SUBMISSION_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - PREFERRED_DATA_MOVEMENT_PROTOCOL_FIELD_NUMBER: _ClassVar[int] RESOURCE_SPECIFIC_CREDENTIAL_STORE_TOKEN_FIELD_NUMBER: _ClassVar[int] RESOURCE_TYPE_FIELD_NUMBER: _ClassVar[int] SPECIFIC_PREFERENCES_FIELD_NUMBER: _ClassVar[int] @@ -99,12 +95,10 @@ class GroupComputeResourcePreference(_message.Message): override_by_airavata: bool login_user_name: str scratch_location: str - preferred_job_submission_protocol: _compute_resource_pb2.JobSubmissionProtocol - preferred_data_movement_protocol: _data_movement_pb2.DataMovementProtocol resource_specific_credential_store_token: str resource_type: ResourceType specific_preferences: EnvironmentSpecificPreferences - def __init__(self, compute_resource_id: _Optional[str] = ..., group_resource_profile_id: _Optional[str] = ..., override_by_airavata: bool = ..., login_user_name: _Optional[str] = ..., scratch_location: _Optional[str] = ..., preferred_job_submission_protocol: _Optional[_Union[_compute_resource_pb2.JobSubmissionProtocol, str]] = ..., preferred_data_movement_protocol: _Optional[_Union[_data_movement_pb2.DataMovementProtocol, str]] = ..., resource_specific_credential_store_token: _Optional[str] = ..., resource_type: _Optional[_Union[ResourceType, str]] = ..., specific_preferences: _Optional[_Union[EnvironmentSpecificPreferences, _Mapping]] = ...) -> None: ... + def __init__(self, compute_resource_id: _Optional[str] = ..., group_resource_profile_id: _Optional[str] = ..., override_by_airavata: bool = ..., login_user_name: _Optional[str] = ..., scratch_location: _Optional[str] = ..., resource_specific_credential_store_token: _Optional[str] = ..., resource_type: _Optional[_Union[ResourceType, str]] = ..., specific_preferences: _Optional[_Union[EnvironmentSpecificPreferences, _Mapping]] = ...) -> None: ... class ComputeResourcePolicy(_message.Message): __slots__ = ("resource_policy_id", "compute_resource_id", "group_resource_profile_id", "allowed_batch_queues") diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2_grpc.py b/airavata-python-sdk/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2_grpc.py rename to airavata-python-sdk/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/computeresource/__init__.py b/airavata-python-sdk/airavata/model/appcatalog/parser/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/computeresource/__init__.py rename to airavata-python-sdk/airavata/model/appcatalog/parser/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/parser/parser_pb2.py b/airavata-python-sdk/airavata/model/appcatalog/parser/parser_pb2.py similarity index 97% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/parser/parser_pb2.py rename to airavata-python-sdk/airavata/model/appcatalog/parser/parser_pb2.py index 6239e145d64..b8e8f2417c4 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/parser/parser_pb2.py +++ b/airavata-python-sdk/airavata/model/appcatalog/parser/parser_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.appcatalog.parser.parser_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.appcatalog.parser.parser_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n1org.apache.airavata.model.appcatalog.parser.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/parser/parser_pb2.pyi b/airavata-python-sdk/airavata/model/appcatalog/parser/parser_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/parser/parser_pb2.pyi rename to airavata-python-sdk/airavata/model/appcatalog/parser/parser_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/parser/parser_pb2_grpc.py b/airavata-python-sdk/airavata/model/appcatalog/parser/parser_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/parser/parser_pb2_grpc.py rename to airavata-python-sdk/airavata/model/appcatalog/parser/parser_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewaygroups/__init__.py b/airavata-python-sdk/airavata/model/appcatalog/storageresource/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewaygroups/__init__.py rename to airavata-python-sdk/airavata/model/appcatalog/storageresource/__init__.py diff --git a/airavata-python-sdk/airavata/model/appcatalog/storageresource/storage_resource_pb2.py b/airavata-python-sdk/airavata/model/appcatalog/storageresource/storage_resource_pb2.py new file mode 100644 index 00000000000..3f5c1c0ae7e --- /dev/null +++ b/airavata-python-sdk/airavata/model/appcatalog/storageresource/storage_resource_pb2.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: org/apache/airavata/model/appcatalog/storageresource/storage_resource.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'org/apache/airavata/model/appcatalog/storageresource/storage_resource.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nKorg/apache/airavata/model/appcatalog/storageresource/storage_resource.proto\x12\x34org.apache.airavata.model.appcatalog.storageresource\"\xc8\x01\n\x1aStorageResourceDescription\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x11\n\thost_name\x18\x02 \x01(\t\x12$\n\x1cstorage_resource_description\x18\x03 \x01(\t\x12\x0f\n\x07\x65nabled\x18\x04 \x01(\x08\x12\x15\n\rcreation_time\x18\x06 \x01(\x03\x12\x13\n\x0bupdate_time\x18\x07 \x01(\x03\x12\x11\n\tsftp_port\x18\x08 \x01(\x05J\x04\x08\x05\x10\x06\"\xf9\x01\n\x11StorageVolumeInfo\x12\x12\n\ntotal_size\x18\x01 \x01(\t\x12\x11\n\tused_size\x18\x02 \x01(\t\x12\x16\n\x0e\x61vailable_size\x18\x03 \x01(\t\x12\x1d\n\x15total_size_byte_count\x18\x04 \x01(\x03\x12\x1c\n\x14used_size_byte_count\x18\x05 \x01(\x03\x12!\n\x19\x61vailable_size_byte_count\x18\x06 \x01(\x03\x12\x17\n\x0fpercentage_used\x18\x07 \x01(\x01\x12\x13\n\x0bmount_point\x18\x08 \x01(\t\x12\x17\n\x0f\x66ilesystem_type\x18\t \x01(\t\"I\n\x14StorageDirectoryInfo\x12\x12\n\ntotal_size\x18\x01 \x01(\t\x12\x1d\n\x15total_size_byte_count\x18\x02 \x01(\x03\x42>\n:org.apache.airavata.model.appcatalog.storageresource.protoP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.appcatalog.storageresource.storage_resource_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n:org.apache.airavata.model.appcatalog.storageresource.protoP\001' + _globals['_STORAGERESOURCEDESCRIPTION']._serialized_start=134 + _globals['_STORAGERESOURCEDESCRIPTION']._serialized_end=334 + _globals['_STORAGEVOLUMEINFO']._serialized_start=337 + _globals['_STORAGEVOLUMEINFO']._serialized_end=586 + _globals['_STORAGEDIRECTORYINFO']._serialized_start=588 + _globals['_STORAGEDIRECTORYINFO']._serialized_end=661 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/storageresource/storage_resource_pb2.pyi b/airavata-python-sdk/airavata/model/appcatalog/storageresource/storage_resource_pb2.pyi similarity index 75% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/storageresource/storage_resource_pb2.pyi rename to airavata-python-sdk/airavata/model/appcatalog/storageresource/storage_resource_pb2.pyi index 5f91ce598d8..76e28af63a7 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/storageresource/storage_resource_pb2.pyi +++ b/airavata-python-sdk/airavata/model/appcatalog/storageresource/storage_resource_pb2.pyi @@ -1,29 +1,26 @@ -from org.apache.airavata.model.data.movement import data_movement_pb2 as _data_movement_pb2 -from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union +from typing import ClassVar as _ClassVar, Optional as _Optional DESCRIPTOR: _descriptor.FileDescriptor class StorageResourceDescription(_message.Message): - __slots__ = ("storage_resource_id", "host_name", "storage_resource_description", "enabled", "data_movement_interfaces", "creation_time", "update_time") + __slots__ = ("storage_resource_id", "host_name", "storage_resource_description", "enabled", "creation_time", "update_time", "sftp_port") STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] HOST_NAME_FIELD_NUMBER: _ClassVar[int] STORAGE_RESOURCE_DESCRIPTION_FIELD_NUMBER: _ClassVar[int] ENABLED_FIELD_NUMBER: _ClassVar[int] - DATA_MOVEMENT_INTERFACES_FIELD_NUMBER: _ClassVar[int] CREATION_TIME_FIELD_NUMBER: _ClassVar[int] UPDATE_TIME_FIELD_NUMBER: _ClassVar[int] + SFTP_PORT_FIELD_NUMBER: _ClassVar[int] storage_resource_id: str host_name: str storage_resource_description: str enabled: bool - data_movement_interfaces: _containers.RepeatedCompositeFieldContainer[_data_movement_pb2.DataMovementInterface] creation_time: int update_time: int - def __init__(self, storage_resource_id: _Optional[str] = ..., host_name: _Optional[str] = ..., storage_resource_description: _Optional[str] = ..., enabled: bool = ..., data_movement_interfaces: _Optional[_Iterable[_Union[_data_movement_pb2.DataMovementInterface, _Mapping]]] = ..., creation_time: _Optional[int] = ..., update_time: _Optional[int] = ...) -> None: ... + sftp_port: int + def __init__(self, storage_resource_id: _Optional[str] = ..., host_name: _Optional[str] = ..., storage_resource_description: _Optional[str] = ..., enabled: bool = ..., creation_time: _Optional[int] = ..., update_time: _Optional[int] = ..., sftp_port: _Optional[int] = ...) -> None: ... class StorageVolumeInfo(_message.Message): __slots__ = ("total_size", "used_size", "available_size", "total_size_byte_count", "used_size_byte_count", "available_size_byte_count", "percentage_used", "mount_point", "filesystem_type") diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/storageresource/storage_resource_pb2_grpc.py b/airavata-python-sdk/airavata/model/appcatalog/storageresource/storage_resource_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/storageresource/storage_resource_pb2_grpc.py rename to airavata-python-sdk/airavata/model/appcatalog/storageresource/storage_resource_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewayprofile/__init__.py b/airavata-python-sdk/airavata/model/appcatalog/userresourceprofile/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewayprofile/__init__.py rename to airavata-python-sdk/airavata/model/appcatalog/userresourceprofile/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2.py b/airavata-python-sdk/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2.py similarity index 95% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2.py rename to airavata-python-sdk/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2.py index e5531509c13..f7d52edfc8a 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2.py +++ b/airavata-python-sdk/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.appcatalog.userresourceprofile.user_resource_profile_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.appcatalog.userresourceprofile.user_resource_profile_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n>org.apache.airavata.model.appcatalog.userresourceprofile.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2.pyi b/airavata-python-sdk/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2.pyi rename to airavata-python-sdk/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2_grpc.py b/airavata-python-sdk/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2_grpc.py rename to airavata-python-sdk/airavata/model/appcatalog/userresourceprofile/user_resource_profile_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/groupresourceprofile/__init__.py b/airavata-python-sdk/airavata/model/application/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/groupresourceprofile/__init__.py rename to airavata-python-sdk/airavata/model/application/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/parser/__init__.py b/airavata-python-sdk/airavata/model/application/io/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/parser/__init__.py rename to airavata-python-sdk/airavata/model/application/io/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/application/io/application_io_pb2.py b/airavata-python-sdk/airavata/model/application/io/application_io_pb2.py similarity index 96% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/application/io/application_io_pb2.py rename to airavata-python-sdk/airavata/model/application/io/application_io_pb2.py index a37a44b5a08..1bf902585b4 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/application/io/application_io_pb2.py +++ b/airavata-python-sdk/airavata/model/application/io/application_io_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.application.io.application_io_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.application.io.application_io_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n.org.apache.airavata.model.application.io.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/application/io/application_io_pb2.pyi b/airavata-python-sdk/airavata/model/application/io/application_io_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/application/io/application_io_pb2.pyi rename to airavata-python-sdk/airavata/model/application/io/application_io_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/application/io/application_io_pb2_grpc.py b/airavata-python-sdk/airavata/model/application/io/application_io_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/application/io/application_io_pb2_grpc.py rename to airavata-python-sdk/airavata/model/application/io/application_io_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/storageresource/__init__.py b/airavata-python-sdk/airavata/model/commons/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/storageresource/__init__.py rename to airavata-python-sdk/airavata/model/commons/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/commons/commons_pb2.py b/airavata-python-sdk/airavata/model/commons/commons_pb2.py similarity index 84% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/commons/commons_pb2.py rename to airavata-python-sdk/airavata/model/commons/commons_pb2.py index 209bdcef2e4..ffcff748c87 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/commons/commons_pb2.py +++ b/airavata-python-sdk/airavata/model/commons/commons_pb2.py @@ -24,11 +24,11 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/org/apache/airavata/model/commons/commons.proto\x12!org.apache.airavata.model.commons\"\xb5\x01\n\nErrorModel\x12\x10\n\x08\x65rror_id\x18\x01 \x01(\t\x12\x15\n\rcreation_time\x18\x02 \x01(\x03\x12\x1c\n\x14\x61\x63tual_error_message\x18\x03 \x01(\t\x12\x1d\n\x15user_friendly_message\x18\x04 \x01(\t\x12\x1f\n\x17transient_or_persistent\x18\x05 \x01(\x08\x12 \n\x18root_cause_error_id_list\x18\x06 \x03(\t\"8\n\x0fValidatorResult\x12\x0e\n\x06result\x18\x01 \x01(\x08\x12\x15\n\rerror_details\x18\x02 \x01(\t\"\x81\x01\n\x11ValidationResults\x12\x18\n\x10validation_state\x18\x01 \x01(\x08\x12R\n\x16validation_result_list\x18\x02 \x03(\x0b\x32\x32.org.apache.airavata.model.commons.ValidatorResultB+\n\'org.apache.airavata.model.commons.protoP\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/org/apache/airavata/model/commons/commons.proto\x12!org.apache.airavata.model.commons\"\xb5\x01\n\nErrorModel\x12\x10\n\x08\x65rror_id\x18\x01 \x01(\t\x12\x15\n\rcreation_time\x18\x02 \x01(\x03\x12\x1c\n\x14\x61\x63tual_error_message\x18\x03 \x01(\t\x12\x1d\n\x15user_friendly_message\x18\x04 \x01(\t\x12\x1f\n\x17transient_or_persistent\x18\x05 \x01(\x08\x12 \n\x18root_cause_error_id_list\x18\x06 \x03(\t\"8\n\x0fValidatorResult\x12\x0e\n\x06result\x18\x01 \x01(\x08\x12\x15\n\rerror_details\x18\x02 \x01(\t\"\x81\x01\n\x11ValidationResults\x12\x18\n\x10validation_state\x18\x01 \x01(\x08\x12R\n\x16validation_result_list\x18\x02 \x03(\x0b\x32\x32.org.apache.airavata.model.commons.ValidatorResult\">\n\x0b\x41\x63\x63\x65ssFlags\x12\x10\n\x08is_owner\x18\x01 \x01(\x08\x12\x1d\n\x15user_has_write_access\x18\x02 \x01(\x08\x42+\n\'org.apache.airavata.model.commons.protoP\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.commons.commons_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.commons.commons_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n\'org.apache.airavata.model.commons.protoP\001' @@ -38,4 +38,6 @@ _globals['_VALIDATORRESULT']._serialized_end=326 _globals['_VALIDATIONRESULTS']._serialized_start=329 _globals['_VALIDATIONRESULTS']._serialized_end=458 + _globals['_ACCESSFLAGS']._serialized_start=460 + _globals['_ACCESSFLAGS']._serialized_end=522 # @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/commons/commons_pb2.pyi b/airavata-python-sdk/airavata/model/commons/commons_pb2.pyi similarity index 86% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/commons/commons_pb2.pyi rename to airavata-python-sdk/airavata/model/commons/commons_pb2.pyi index 9adc68005b2..26c3d66f889 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/commons/commons_pb2.pyi +++ b/airavata-python-sdk/airavata/model/commons/commons_pb2.pyi @@ -37,3 +37,11 @@ class ValidationResults(_message.Message): validation_state: bool validation_result_list: _containers.RepeatedCompositeFieldContainer[ValidatorResult] def __init__(self, validation_state: bool = ..., validation_result_list: _Optional[_Iterable[_Union[ValidatorResult, _Mapping]]] = ...) -> None: ... + +class AccessFlags(_message.Message): + __slots__ = ("is_owner", "user_has_write_access") + IS_OWNER_FIELD_NUMBER: _ClassVar[int] + USER_HAS_WRITE_ACCESS_FIELD_NUMBER: _ClassVar[int] + is_owner: bool + user_has_write_access: bool + def __init__(self, is_owner: bool = ..., user_has_write_access: bool = ...) -> None: ... diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/commons/commons_pb2_grpc.py b/airavata-python-sdk/airavata/model/commons/commons_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/commons/commons_pb2_grpc.py rename to airavata-python-sdk/airavata/model/commons/commons_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/userresourceprofile/__init__.py b/airavata-python-sdk/airavata/model/credential/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/userresourceprofile/__init__.py rename to airavata-python-sdk/airavata/model/credential/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/application/__init__.py b/airavata-python-sdk/airavata/model/credential/store/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/application/__init__.py rename to airavata-python-sdk/airavata/model/credential/store/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/credential/store/credential_store_pb2.py b/airavata-python-sdk/airavata/model/credential/store/credential_store_pb2.py similarity index 76% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/credential/store/credential_store_pb2.py rename to airavata-python-sdk/airavata/model/credential/store/credential_store_pb2.py index 4c1fb5417b5..61410a69508 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/credential/store/credential_store_pb2.py +++ b/airavata-python-sdk/airavata/model/credential/store/credential_store_pb2.py @@ -24,16 +24,16 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nAorg/apache/airavata/model/credential/store/credential_store.proto\x12*org.apache.airavata.model.credential.store\"\xae\x01\n\rSSHCredential\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x12\n\npassphrase\x18\x03 \x01(\t\x12\x12\n\npublic_key\x18\x04 \x01(\t\x12\x13\n\x0bprivate_key\x18\x05 \x01(\t\x12\x16\n\x0epersisted_time\x18\x06 \x01(\x03\x12\r\n\x05token\x18\x07 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x08 \x01(\t\"\xd0\x01\n\x11\x43redentialSummary\x12\x45\n\x04type\x18\x01 \x01(\x0e\x32\x37.org.apache.airavata.model.credential.store.SummaryType\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x10\n\x08username\x18\x03 \x01(\t\x12\x12\n\npublic_key\x18\x04 \x01(\t\x12\x16\n\x0epersisted_time\x18\x05 \x01(\x03\x12\r\n\x05token\x18\x06 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\"K\n\rCommunityUser\x12\x14\n\x0cgateway_name\x18\x01 \x01(\t\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x12\n\nuser_email\x18\x03 \x01(\t\"\xf3\x01\n\x15\x43\x65rtificateCredential\x12Q\n\x0e\x63ommunity_user\x18\x01 \x01(\x0b\x32\x39.org.apache.airavata.model.credential.store.CommunityUser\x12\x11\n\tx509_cert\x18\x02 \x01(\t\x12\x11\n\tnot_after\x18\x03 \x01(\t\x12\x13\n\x0bprivate_key\x18\x04 \x01(\t\x12\x11\n\tlife_time\x18\x05 \x01(\x03\x12\x12\n\nnot_before\x18\x06 \x01(\t\x12\x16\n\x0epersisted_time\x18\x07 \x01(\x03\x12\r\n\x05token\x18\x08 \x01(\t\"\xa9\x01\n\x12PasswordCredential\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x18\n\x10portal_user_name\x18\x02 \x01(\t\x12\x17\n\x0flogin_user_name\x18\x03 \x01(\t\x12\x10\n\x08password\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\x16\n\x0epersisted_time\x18\x06 \x01(\x03\x12\r\n\x05token\x18\x07 \x01(\t*F\n\x0bSummaryType\x12\x18\n\x14SUMMARY_TYPE_UNKNOWN\x10\x00\x12\x07\n\x03SSH\x10\x01\x12\n\n\x06PASSWD\x10\x02\x12\x08\n\x04\x43\x45RT\x10\x03\x42\x34\n0org.apache.airavata.model.credential.store.protoP\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nAorg/apache/airavata/model/credential/store/credential_store.proto\x12*org.apache.airavata.model.credential.store\"\xae\x01\n\rSSHCredential\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x12\n\npassphrase\x18\x03 \x01(\t\x12\x12\n\npublic_key\x18\x04 \x01(\t\x12\x13\n\x0bprivate_key\x18\x05 \x01(\t\x12\x16\n\x0epersisted_time\x18\x06 \x01(\x03\x12\r\n\x05token\x18\x07 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x08 \x01(\t\"\xd0\x01\n\x11\x43redentialSummary\x12\x45\n\x04type\x18\x01 \x01(\x0e\x32\x37.org.apache.airavata.model.credential.store.SummaryType\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x10\n\x08username\x18\x03 \x01(\t\x12\x12\n\npublic_key\x18\x04 \x01(\t\x12\x16\n\x0epersisted_time\x18\x05 \x01(\x03\x12\r\n\x05token\x18\x06 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\"K\n\rCommunityUser\x12\x14\n\x0cgateway_name\x18\x01 \x01(\t\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x12\n\nuser_email\x18\x03 \x01(\t\"\xf3\x01\n\x15\x43\x65rtificateCredential\x12Q\n\x0e\x63ommunity_user\x18\x01 \x01(\x0b\x32\x39.org.apache.airavata.model.credential.store.CommunityUser\x12\x11\n\tx509_cert\x18\x02 \x01(\t\x12\x11\n\tnot_after\x18\x03 \x01(\t\x12\x13\n\x0bprivate_key\x18\x04 \x01(\t\x12\x11\n\tlife_time\x18\x05 \x01(\x03\x12\x12\n\nnot_before\x18\x06 \x01(\t\x12\x16\n\x0epersisted_time\x18\x07 \x01(\x03\x12\r\n\x05token\x18\x08 \x01(\t\"\xa9\x01\n\x12PasswordCredential\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x18\n\x10portal_user_name\x18\x02 \x01(\t\x12\x17\n\x0flogin_user_name\x18\x03 \x01(\t\x12\x10\n\x08password\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\x16\n\x0epersisted_time\x18\x06 \x01(\x03\x12\r\n\x05token\x18\x07 \x01(\t\"\xb9\x02\n\x10StoredCredential\x12S\n\x0essh_credential\x18\x01 \x01(\x0b\x32\x39.org.apache.airavata.model.credential.store.SSHCredentialH\x00\x12]\n\x13password_credential\x18\x02 \x01(\x0b\x32>.org.apache.airavata.model.credential.store.PasswordCredentialH\x00\x12\x63\n\x16\x63\x65rtificate_credential\x18\x03 \x01(\x0b\x32\x41.org.apache.airavata.model.credential.store.CertificateCredentialH\x00\x42\x0c\n\ncredential*F\n\x0bSummaryType\x12\x18\n\x14SUMMARY_TYPE_UNKNOWN\x10\x00\x12\x07\n\x03SSH\x10\x01\x12\n\n\x06PASSWD\x10\x02\x12\x08\n\x04\x43\x45RT\x10\x03\x42\x34\n0org.apache.airavata.model.credential.store.protoP\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.credential.store.credential_store_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.credential.store.credential_store_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n0org.apache.airavata.model.credential.store.protoP\001' - _globals['_SUMMARYTYPE']._serialized_start=996 - _globals['_SUMMARYTYPE']._serialized_end=1066 + _globals['_SUMMARYTYPE']._serialized_start=1312 + _globals['_SUMMARYTYPE']._serialized_end=1382 _globals['_SSHCREDENTIAL']._serialized_start=114 _globals['_SSHCREDENTIAL']._serialized_end=288 _globals['_CREDENTIALSUMMARY']._serialized_start=291 @@ -44,4 +44,6 @@ _globals['_CERTIFICATECREDENTIAL']._serialized_end=822 _globals['_PASSWORDCREDENTIAL']._serialized_start=825 _globals['_PASSWORDCREDENTIAL']._serialized_end=994 + _globals['_STOREDCREDENTIAL']._serialized_start=997 + _globals['_STOREDCREDENTIAL']._serialized_end=1310 # @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/credential/store/credential_store_pb2.pyi b/airavata-python-sdk/airavata/model/credential/store/credential_store_pb2.pyi similarity index 87% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/credential/store/credential_store_pb2.pyi rename to airavata-python-sdk/airavata/model/credential/store/credential_store_pb2.pyi index 0193c8c0a58..02857f2c71f 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/credential/store/credential_store_pb2.pyi +++ b/airavata-python-sdk/airavata/model/credential/store/credential_store_pb2.pyi @@ -102,3 +102,13 @@ class PasswordCredential(_message.Message): persisted_time: int token: str def __init__(self, gateway_id: _Optional[str] = ..., portal_user_name: _Optional[str] = ..., login_user_name: _Optional[str] = ..., password: _Optional[str] = ..., description: _Optional[str] = ..., persisted_time: _Optional[int] = ..., token: _Optional[str] = ...) -> None: ... + +class StoredCredential(_message.Message): + __slots__ = ("ssh_credential", "password_credential", "certificate_credential") + SSH_CREDENTIAL_FIELD_NUMBER: _ClassVar[int] + PASSWORD_CREDENTIAL_FIELD_NUMBER: _ClassVar[int] + CERTIFICATE_CREDENTIAL_FIELD_NUMBER: _ClassVar[int] + ssh_credential: SSHCredential + password_credential: PasswordCredential + certificate_credential: CertificateCredential + def __init__(self, ssh_credential: _Optional[_Union[SSHCredential, _Mapping]] = ..., password_credential: _Optional[_Union[PasswordCredential, _Mapping]] = ..., certificate_credential: _Optional[_Union[CertificateCredential, _Mapping]] = ...) -> None: ... diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/credential/store/credential_store_pb2_grpc.py b/airavata-python-sdk/airavata/model/credential/store/credential_store_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/credential/store/credential_store_pb2_grpc.py rename to airavata-python-sdk/airavata/model/credential/store/credential_store_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/application/io/__init__.py b/airavata-python-sdk/airavata/model/data/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/application/io/__init__.py rename to airavata-python-sdk/airavata/model/data/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/commons/__init__.py b/airavata-python-sdk/airavata/model/data/movement/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/commons/__init__.py rename to airavata-python-sdk/airavata/model/data/movement/__init__.py diff --git a/airavata-python-sdk/airavata/model/data/movement/data_movement_pb2.py b/airavata-python-sdk/airavata/model/data/movement/data_movement_pb2.py new file mode 100644 index 00000000000..0d2ddea82cb --- /dev/null +++ b/airavata-python-sdk/airavata/model/data/movement/data_movement_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: org/apache/airavata/model/data/movement/data_movement.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'org/apache/airavata/model/data/movement/data_movement.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n;org/apache/airavata/model/data/movement/data_movement.proto\x12\'org.apache.airavata.model.data.movement*I\n\x06\x44MType\x12\x13\n\x0f\x44M_TYPE_UNKNOWN\x10\x00\x12\x14\n\x10\x43OMPUTE_RESOURCE\x10\x01\x12\x14\n\x10STORAGE_RESOURCE\x10\x02\x42\x31\n-org.apache.airavata.model.data.movement.protoP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.data.movement.data_movement_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n-org.apache.airavata.model.data.movement.protoP\001' + _globals['_DMTYPE']._serialized_start=104 + _globals['_DMTYPE']._serialized_end=177 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata/model/data/movement/data_movement_pb2.pyi b/airavata-python-sdk/airavata/model/data/movement/data_movement_pb2.pyi new file mode 100644 index 00000000000..d8a142f855f --- /dev/null +++ b/airavata-python-sdk/airavata/model/data/movement/data_movement_pb2.pyi @@ -0,0 +1,14 @@ +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from typing import ClassVar as _ClassVar + +DESCRIPTOR: _descriptor.FileDescriptor + +class DMType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + DM_TYPE_UNKNOWN: _ClassVar[DMType] + COMPUTE_RESOURCE: _ClassVar[DMType] + STORAGE_RESOURCE: _ClassVar[DMType] +DM_TYPE_UNKNOWN: DMType +COMPUTE_RESOURCE: DMType +STORAGE_RESOURCE: DMType diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/movement/data_movement_pb2_grpc.py b/airavata-python-sdk/airavata/model/data/movement/data_movement_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/movement/data_movement_pb2_grpc.py rename to airavata-python-sdk/airavata/model/data/movement/data_movement_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/credential/__init__.py b/airavata-python-sdk/airavata/model/data/replica/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/credential/__init__.py rename to airavata-python-sdk/airavata/model/data/replica/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/replica/replica_catalog_pb2.py b/airavata-python-sdk/airavata/model/data/replica/replica_catalog_pb2.py similarity index 97% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/replica/replica_catalog_pb2.py rename to airavata-python-sdk/airavata/model/data/replica/replica_catalog_pb2.py index 7f8d0699a22..0e9af1f3740 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/replica/replica_catalog_pb2.py +++ b/airavata-python-sdk/airavata/model/data/replica/replica_catalog_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.data.replica.replica_catalog_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.data.replica.replica_catalog_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n,org.apache.airavata.model.data.replica.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/replica/replica_catalog_pb2.pyi b/airavata-python-sdk/airavata/model/data/replica/replica_catalog_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/replica/replica_catalog_pb2.pyi rename to airavata-python-sdk/airavata/model/data/replica/replica_catalog_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/replica/replica_catalog_pb2_grpc.py b/airavata-python-sdk/airavata/model/data/replica/replica_catalog_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/replica/replica_catalog_pb2_grpc.py rename to airavata-python-sdk/airavata/model/data/replica/replica_catalog_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/credential/store/__init__.py b/airavata-python-sdk/airavata/model/dbevent/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/credential/store/__init__.py rename to airavata-python-sdk/airavata/model/dbevent/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/dbevent/db_event_pb2.py b/airavata-python-sdk/airavata/model/dbevent/db_event_pb2.py similarity index 97% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/dbevent/db_event_pb2.py rename to airavata-python-sdk/airavata/model/dbevent/db_event_pb2.py index 94afcd131f7..35b519d2979 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/dbevent/db_event_pb2.py +++ b/airavata-python-sdk/airavata/model/dbevent/db_event_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.dbevent.db_event_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.dbevent.db_event_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n\'org.apache.airavata.model.dbevent.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/dbevent/db_event_pb2.pyi b/airavata-python-sdk/airavata/model/dbevent/db_event_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/dbevent/db_event_pb2.pyi rename to airavata-python-sdk/airavata/model/dbevent/db_event_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/dbevent/db_event_pb2_grpc.py b/airavata-python-sdk/airavata/model/dbevent/db_event_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/dbevent/db_event_pb2_grpc.py rename to airavata-python-sdk/airavata/model/dbevent/db_event_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/__init__.py b/airavata-python-sdk/airavata/model/error/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/__init__.py rename to airavata-python-sdk/airavata/model/error/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/error/errors_pb2.py b/airavata-python-sdk/airavata/model/error/errors_pb2.py similarity index 97% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/error/errors_pb2.py rename to airavata-python-sdk/airavata/model/error/errors_pb2.py index a9f720f2360..6c9fc5056ab 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/error/errors_pb2.py +++ b/airavata-python-sdk/airavata/model/error/errors_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.error.errors_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.error.errors_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n%org.apache.airavata.model.error.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/error/errors_pb2.pyi b/airavata-python-sdk/airavata/model/error/errors_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/error/errors_pb2.pyi rename to airavata-python-sdk/airavata/model/error/errors_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/error/errors_pb2_grpc.py b/airavata-python-sdk/airavata/model/error/errors_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/error/errors_pb2_grpc.py rename to airavata-python-sdk/airavata/model/error/errors_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/movement/__init__.py b/airavata-python-sdk/airavata/model/experiment/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/movement/__init__.py rename to airavata-python-sdk/airavata/model/experiment/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/experiment/experiment_pb2.py b/airavata-python-sdk/airavata/model/experiment/experiment_pb2.py similarity index 88% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/experiment/experiment_pb2.py rename to airavata-python-sdk/airavata/model/experiment/experiment_pb2.py index 3123ca9de64..20408cec6e3 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/experiment/experiment_pb2.py +++ b/airavata-python-sdk/airavata/model/experiment/experiment_pb2.py @@ -22,19 +22,19 @@ _sym_db = _symbol_database.Default() -from org.apache.airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 -from org.apache.airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 -from org.apache.airavata.model.scheduling import scheduling_pb2 as org_dot_apache_dot_airavata_dot_model_dot_scheduling_dot_scheduling__pb2 -from org.apache.airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 -from org.apache.airavata.model.process import process_pb2 as org_dot_apache_dot_airavata_dot_model_dot_process_dot_process__pb2 -from org.apache.airavata.model.workflow import workflow_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workflow_dot_workflow__pb2 +from airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 +from airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 +from airavata.model.scheduling import scheduling_pb2 as org_dot_apache_dot_airavata_dot_model_dot_scheduling_dot_scheduling__pb2 +from airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 +from airavata.model.process import process_pb2 as org_dot_apache_dot_airavata_dot_model_dot_process_dot_process__pb2 +from airavata.model.workflow import workflow_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workflow_dot_workflow__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n5org/apache/airavata/model/experiment/experiment.proto\x12$org.apache.airavata.model.experiment\x1a/org/apache/airavata/model/commons/commons.proto\x1a=org/apache/airavata/model/application/io/application_io.proto\x1a\x35org/apache/airavata/model/scheduling/scheduling.proto\x1a-org/apache/airavata/model/status/status.proto\x1a/org/apache/airavata/model/process/process.proto\x1a\x31org/apache/airavata/model/workflow/workflow.proto\"\xcc\x04\n\x1aUserConfigurationDataModel\x12\x1e\n\x16\x61iravata_auto_schedule\x18\x01 \x01(\x08\x12(\n override_manual_scheduled_params\x18\x02 \x01(\x08\x12!\n\x19share_experiment_publicly\x18\x03 \x01(\x08\x12u\n!computational_resource_scheduling\x18\x04 \x01(\x0b\x32J.org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel\x12\x1a\n\x12throttle_resources\x18\x05 \x01(\x08\x12!\n\x19input_storage_resource_id\x18\x08 \x01(\t\x12\"\n\x1aoutput_storage_resource_id\x18\t \x01(\t\x12\x1b\n\x13\x65xperiment_data_dir\x18\n \x01(\t\x12\x18\n\x10use_user_cr_pref\x18\x0b \x01(\x08\x12!\n\x19group_resource_profile_id\x18\x0c \x01(\t\x12\x80\x01\n,auto_scheduled_comp_resource_scheduling_list\x18\r \x03(\x0b\x32J.org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModelJ\x04\x08\x06\x10\x07J\x04\x08\x07\x10\x08\"\x93\x08\n\x0f\x45xperimentModel\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\x12\n\nproject_id\x18\x02 \x01(\t\x12\x12\n\ngateway_id\x18\x03 \x01(\t\x12M\n\x0f\x65xperiment_type\x18\x04 \x01(\x0e\x32\x34.org.apache.airavata.model.experiment.ExperimentType\x12\x11\n\tuser_name\x18\x05 \x01(\t\x12\x17\n\x0f\x65xperiment_name\x18\x06 \x01(\t\x12\x15\n\rcreation_time\x18\x07 \x01(\x03\x12\x13\n\x0b\x64\x65scription\x18\x08 \x01(\t\x12\x14\n\x0c\x65xecution_id\x18\t \x01(\t\x12\x1c\n\x14gateway_execution_id\x18\n \x01(\t\x12\x1b\n\x13gateway_instance_id\x18\x0b \x01(\t\x12!\n\x19\x65nable_email_notification\x18\x0c \x01(\x08\x12\x17\n\x0f\x65mail_addresses\x18\r \x03(\t\x12\x61\n\x17user_configuration_data\x18\x0e \x01(\x0b\x32@.org.apache.airavata.model.experiment.UserConfigurationDataModel\x12X\n\x11\x65xperiment_inputs\x18\x0f \x03(\x0b\x32=.org.apache.airavata.model.application.io.InputDataObjectType\x12Z\n\x12\x65xperiment_outputs\x18\x10 \x03(\x0b\x32>.org.apache.airavata.model.application.io.OutputDataObjectType\x12M\n\x11\x65xperiment_status\x18\x11 \x03(\x0b\x32\x32.org.apache.airavata.model.status.ExperimentStatus\x12=\n\x06\x65rrors\x18\x12 \x03(\x0b\x32-.org.apache.airavata.model.commons.ErrorModel\x12\x42\n\tprocesses\x18\x13 \x03(\x0b\x32/.org.apache.airavata.model.process.ProcessModel\x12\x46\n\x08workflow\x18\x14 \x01(\x0b\x32\x34.org.apache.airavata.model.workflow.AiravataWorkflow\x12Z\n\x11\x63lean_up_strategy\x18\x15 \x01(\x0e\x32?.org.apache.airavata.model.experiment.ExperimentCleanupStrategy\"\x8b\x02\n\x16\x45xperimentSummaryModel\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\x12\n\nproject_id\x18\x02 \x01(\t\x12\x12\n\ngateway_id\x18\x03 \x01(\t\x12\x15\n\rcreation_time\x18\x04 \x01(\x03\x12\x11\n\tuser_name\x18\x05 \x01(\t\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x14\n\x0c\x65xecution_id\x18\x08 \x01(\t\x12\x18\n\x10resource_host_id\x18\t \x01(\t\x12\x19\n\x11\x65xperiment_status\x18\n \x01(\t\x12\x1a\n\x12status_update_time\x18\x0c \x01(\x03\"\x82\x06\n\x14\x45xperimentStatistics\x12\x1c\n\x14\x61ll_experiment_count\x18\x01 \x01(\x05\x12\"\n\x1a\x63ompleted_experiment_count\x18\x02 \x01(\x05\x12\"\n\x1a\x63\x61ncelled_experiment_count\x18\x03 \x01(\x05\x12\x1f\n\x17\x66\x61iled_experiment_count\x18\x04 \x01(\x05\x12 \n\x18\x63reated_experiment_count\x18\x05 \x01(\x05\x12 \n\x18running_experiment_count\x18\x06 \x01(\x05\x12U\n\x0f\x61ll_experiments\x18\x07 \x03(\x0b\x32<.org.apache.airavata.model.experiment.ExperimentSummaryModel\x12[\n\x15\x63ompleted_experiments\x18\x08 \x03(\x0b\x32<.org.apache.airavata.model.experiment.ExperimentSummaryModel\x12X\n\x12\x66\x61iled_experiments\x18\t \x03(\x0b\x32<.org.apache.airavata.model.experiment.ExperimentSummaryModel\x12[\n\x15\x63\x61ncelled_experiments\x18\n \x03(\x0b\x32<.org.apache.airavata.model.experiment.ExperimentSummaryModel\x12Y\n\x13\x63reated_experiments\x18\x0b \x03(\x0b\x32<.org.apache.airavata.model.experiment.ExperimentSummaryModel\x12Y\n\x13running_experiments\x18\x0c \x03(\x0b\x32<.org.apache.airavata.model.experiment.ExperimentSummaryModel*S\n\x0e\x45xperimentType\x12\x1b\n\x17\x45XPERIMENT_TYPE_UNKNOWN\x10\x00\x12\x16\n\x12SINGLE_APPLICATION\x10\x01\x12\x0c\n\x08WORKFLOW\x10\x02*\xcf\x01\n\x16\x45xperimentSearchFields\x12$\n EXPERIMENT_SEARCH_FIELDS_UNKNOWN\x10\x00\x12\x13\n\x0f\x45XPERIMENT_NAME\x10\x01\x12\x13\n\x0f\x45XPERIMENT_DESC\x10\x02\x12\x12\n\x0e\x41PPLICATION_ID\x10\x03\x12\r\n\tFROM_DATE\x10\x04\x12\x0b\n\x07TO_DATE\x10\x05\x12\n\n\x06STATUS\x10\x06\x12\x0e\n\nPROJECT_ID\x10\x07\x12\r\n\tUSER_NAME\x10\x08\x12\n\n\x06JOB_ID\x10\t*c\n\x13ProjectSearchFields\x12!\n\x1dPROJECT_SEARCH_FIELDS_UNKNOWN\x10\x00\x12\x10\n\x0cPROJECT_NAME\x10\x01\x12\x17\n\x13PROJECT_DESCRIPTION\x10\x02*\x7f\n\x19\x45xperimentCleanupStrategy\x12\'\n#EXPERIMENT_CLEANUP_STRATEGY_UNKNOWN\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\n\n\x06\x41LWAYS\x10\x02\x12\x12\n\x0eONLY_COMPLETED\x10\x03\x12\x0f\n\x0bONLY_FAILED\x10\x04\x42.\n*org.apache.airavata.model.experiment.protoP\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.experiment.experiment_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.experiment.experiment_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n*org.apache.airavata.model.experiment.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/experiment/experiment_pb2.pyi b/airavata-python-sdk/airavata/model/experiment/experiment_pb2.pyi similarity index 96% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/experiment/experiment_pb2.pyi rename to airavata-python-sdk/airavata/model/experiment/experiment_pb2.pyi index b1c0c20a003..74a0916a26b 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/experiment/experiment_pb2.pyi +++ b/airavata-python-sdk/airavata/model/experiment/experiment_pb2.pyi @@ -1,9 +1,9 @@ -from org.apache.airavata.model.commons import commons_pb2 as _commons_pb2 -from org.apache.airavata.model.application.io import application_io_pb2 as _application_io_pb2 -from org.apache.airavata.model.scheduling import scheduling_pb2 as _scheduling_pb2 -from org.apache.airavata.model.status import status_pb2 as _status_pb2 -from org.apache.airavata.model.process import process_pb2 as _process_pb2 -from org.apache.airavata.model.workflow import workflow_pb2 as _workflow_pb2 +from airavata.model.commons import commons_pb2 as _commons_pb2 +from airavata.model.application.io import application_io_pb2 as _application_io_pb2 +from airavata.model.scheduling import scheduling_pb2 as _scheduling_pb2 +from airavata.model.status import status_pb2 as _status_pb2 +from airavata.model.process import process_pb2 as _process_pb2 +from airavata.model.workflow import workflow_pb2 as _workflow_pb2 from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/experiment/experiment_pb2_grpc.py b/airavata-python-sdk/airavata/model/experiment/experiment_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/experiment/experiment_pb2_grpc.py rename to airavata-python-sdk/airavata/model/experiment/experiment_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/replica/__init__.py b/airavata-python-sdk/airavata/model/group/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/replica/__init__.py rename to airavata-python-sdk/airavata/model/group/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/group/group_manager_pb2.py b/airavata-python-sdk/airavata/model/group/group_manager_pb2.py similarity index 95% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/group/group_manager_pb2.py rename to airavata-python-sdk/airavata/model/group/group_manager_pb2.py index 90b91aa6a88..7ed2cb645fc 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/group/group_manager_pb2.py +++ b/airavata-python-sdk/airavata/model/group/group_manager_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.group.group_manager_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.group.group_manager_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n%org.apache.airavata.model.group.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/group/group_manager_pb2.pyi b/airavata-python-sdk/airavata/model/group/group_manager_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/group/group_manager_pb2.pyi rename to airavata-python-sdk/airavata/model/group/group_manager_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/group/group_manager_pb2_grpc.py b/airavata-python-sdk/airavata/model/group/group_manager_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/group/group_manager_pb2_grpc.py rename to airavata-python-sdk/airavata/model/group/group_manager_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/dbevent/__init__.py b/airavata-python-sdk/airavata/model/job/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/dbevent/__init__.py rename to airavata-python-sdk/airavata/model/job/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/job/job_pb2.py b/airavata-python-sdk/airavata/model/job/job_pb2.py similarity index 89% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/job/job_pb2.py rename to airavata-python-sdk/airavata/model/job/job_pb2.py index 846153ebbfc..b0e83ee747e 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/job/job_pb2.py +++ b/airavata-python-sdk/airavata/model/job/job_pb2.py @@ -22,14 +22,14 @@ _sym_db = _symbol_database.Default() -from org.apache.airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 +from airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'org/apache/airavata/model/job/job.proto\x12\x1dorg.apache.airavata.model.job\x1a-org/apache/airavata/model/status/status.proto\"\xb1\x02\n\x08JobModel\x12\x0e\n\x06job_id\x18\x01 \x01(\t\x12\x0f\n\x07task_id\x18\x02 \x01(\t\x12\x12\n\nprocess_id\x18\x03 \x01(\t\x12\x17\n\x0fjob_description\x18\x04 \x01(\t\x12\x15\n\rcreation_time\x18\x05 \x01(\x03\x12\x41\n\x0cjob_statuses\x18\x06 \x03(\x0b\x32+.org.apache.airavata.model.status.JobStatus\x12!\n\x19\x63ompute_resource_consumed\x18\x07 \x01(\t\x12\x10\n\x08job_name\x18\x08 \x01(\t\x12\x13\n\x0bworking_dir\x18\t \x01(\t\x12\x0f\n\x07std_out\x18\n \x01(\t\x12\x0f\n\x07std_err\x18\x0b \x01(\t\x12\x11\n\texit_code\x18\x0c \x01(\x05\x42\'\n#org.apache.airavata.model.job.protoP\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.job.job_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.job.job_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n#org.apache.airavata.model.job.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/job/job_pb2.pyi b/airavata-python-sdk/airavata/model/job/job_pb2.pyi similarity index 96% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/job/job_pb2.pyi rename to airavata-python-sdk/airavata/model/job/job_pb2.pyi index f4ee16742aa..9ee4f91f8ce 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/job/job_pb2.pyi +++ b/airavata-python-sdk/airavata/model/job/job_pb2.pyi @@ -1,4 +1,4 @@ -from org.apache.airavata.model.status import status_pb2 as _status_pb2 +from airavata.model.status import status_pb2 as _status_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/job/job_pb2_grpc.py b/airavata-python-sdk/airavata/model/job/job_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/job/job_pb2_grpc.py rename to airavata-python-sdk/airavata/model/job/job_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/error/__init__.py b/airavata-python-sdk/airavata/model/parallelism/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/error/__init__.py rename to airavata-python-sdk/airavata/model/parallelism/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/parallelism/parallelism_pb2.py b/airavata-python-sdk/airavata/model/parallelism/parallelism_pb2.py similarity index 93% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/parallelism/parallelism_pb2.py rename to airavata-python-sdk/airavata/model/parallelism/parallelism_pb2.py index 1df67e9702b..6e412f84495 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/parallelism/parallelism_pb2.py +++ b/airavata-python-sdk/airavata/model/parallelism/parallelism_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.parallelism.parallelism_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.parallelism.parallelism_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n+org.apache.airavata.model.parallelism.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/parallelism/parallelism_pb2.pyi b/airavata-python-sdk/airavata/model/parallelism/parallelism_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/parallelism/parallelism_pb2.pyi rename to airavata-python-sdk/airavata/model/parallelism/parallelism_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/parallelism/parallelism_pb2_grpc.py b/airavata-python-sdk/airavata/model/parallelism/parallelism_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/parallelism/parallelism_pb2_grpc.py rename to airavata-python-sdk/airavata/model/parallelism/parallelism_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/experiment/__init__.py b/airavata-python-sdk/airavata/model/process/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/experiment/__init__.py rename to airavata-python-sdk/airavata/model/process/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/process/process_pb2.py b/airavata-python-sdk/airavata/model/process/process_pb2.py similarity index 80% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/process/process_pb2.py rename to airavata-python-sdk/airavata/model/process/process_pb2.py index b24129ae9b4..9623d3938df 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/process/process_pb2.py +++ b/airavata-python-sdk/airavata/model/process/process_pb2.py @@ -22,18 +22,18 @@ _sym_db = _symbol_database.Default() -from org.apache.airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 -from org.apache.airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 -from org.apache.airavata.model.scheduling import scheduling_pb2 as org_dot_apache_dot_airavata_dot_model_dot_scheduling_dot_scheduling__pb2 -from org.apache.airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 -from org.apache.airavata.model.task import task_pb2 as org_dot_apache_dot_airavata_dot_model_dot_task_dot_task__pb2 +from airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 +from airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 +from airavata.model.scheduling import scheduling_pb2 as org_dot_apache_dot_airavata_dot_model_dot_scheduling_dot_scheduling__pb2 +from airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 +from airavata.model.task import task_pb2 as org_dot_apache_dot_airavata_dot_model_dot_task_dot_task__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/org/apache/airavata/model/process/process.proto\x12!org.apache.airavata.model.process\x1a/org/apache/airavata/model/commons/commons.proto\x1a=org/apache/airavata/model/application/io/application_io.proto\x1a\x35org/apache/airavata/model/scheduling/scheduling.proto\x1a-org/apache/airavata/model/status/status.proto\x1a)org/apache/airavata/model/task/task.proto\"\x81\x08\n\x0cProcessModel\x12\x12\n\nprocess_id\x18\x01 \x01(\t\x12\x15\n\rexperiment_id\x18\x02 \x01(\t\x12\x15\n\rcreation_time\x18\x03 \x01(\x03\x12\x18\n\x10last_update_time\x18\x04 \x01(\x03\x12I\n\x10process_statuses\x18\x05 \x03(\x0b\x32/.org.apache.airavata.model.status.ProcessStatus\x12\x16\n\x0eprocess_detail\x18\x06 \x01(\t\x12 \n\x18\x61pplication_interface_id\x18\x07 \x01(\t\x12!\n\x19\x61pplication_deployment_id\x18\x08 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\t \x01(\t\x12U\n\x0eprocess_inputs\x18\n \x03(\x0b\x32=.org.apache.airavata.model.application.io.InputDataObjectType\x12W\n\x0fprocess_outputs\x18\x0b \x03(\x0b\x32>.org.apache.airavata.model.application.io.OutputDataObjectType\x12m\n\x19process_resource_schedule\x18\x0c \x01(\x0b\x32J.org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel\x12\x38\n\x05tasks\x18\r \x03(\x0b\x32).org.apache.airavata.model.task.TaskModel\x12\x10\n\x08task_dag\x18\x0e \x01(\t\x12\x45\n\x0eprocess_errors\x18\x0f \x03(\x0b\x32-.org.apache.airavata.model.commons.ErrorModel\x12\x1c\n\x14gateway_execution_id\x18\x10 \x01(\t\x12!\n\x19\x65nable_email_notification\x18\x11 \x01(\x08\x12\x17\n\x0f\x65mail_addresses\x18\x12 \x03(\t\x12!\n\x19input_storage_resource_id\x18\x13 \x01(\t\x12\"\n\x1aoutput_storage_resource_id\x18\x14 \x01(\t\x12\x1b\n\x13\x65xperiment_data_dir\x18\x17 \x01(\t\x12\x11\n\tuser_name\x18\x18 \x01(\t\x12\x18\n\x10use_user_cr_pref\x18\x19 \x01(\x08\x12!\n\x19group_resource_profile_id\x18\x1a \x01(\tJ\x04\x08\x15\x10\x16J\x04\x08\x16\x10\x17J\x04\x08\x1b\x10\x1c\x42+\n\'org.apache.airavata.model.process.protoP\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.process.process_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.process.process_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n\'org.apache.airavata.model.process.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/process/process_pb2.pyi b/airavata-python-sdk/airavata/model/process/process_pb2.pyi similarity index 92% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/process/process_pb2.pyi rename to airavata-python-sdk/airavata/model/process/process_pb2.pyi index 518a14b844a..1587f87218c 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/process/process_pb2.pyi +++ b/airavata-python-sdk/airavata/model/process/process_pb2.pyi @@ -1,8 +1,8 @@ -from org.apache.airavata.model.commons import commons_pb2 as _commons_pb2 -from org.apache.airavata.model.application.io import application_io_pb2 as _application_io_pb2 -from org.apache.airavata.model.scheduling import scheduling_pb2 as _scheduling_pb2 -from org.apache.airavata.model.status import status_pb2 as _status_pb2 -from org.apache.airavata.model.task import task_pb2 as _task_pb2 +from airavata.model.commons import commons_pb2 as _commons_pb2 +from airavata.model.application.io import application_io_pb2 as _application_io_pb2 +from airavata.model.scheduling import scheduling_pb2 as _scheduling_pb2 +from airavata.model.status import status_pb2 as _status_pb2 +from airavata.model.task import task_pb2 as _task_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/process/process_pb2_grpc.py b/airavata-python-sdk/airavata/model/process/process_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/process/process_pb2_grpc.py rename to airavata-python-sdk/airavata/model/process/process_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/group/__init__.py b/airavata-python-sdk/airavata/model/scheduling/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/group/__init__.py rename to airavata-python-sdk/airavata/model/scheduling/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/scheduling/scheduling_pb2.py b/airavata-python-sdk/airavata/model/scheduling/scheduling_pb2.py similarity index 94% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/scheduling/scheduling_pb2.py rename to airavata-python-sdk/airavata/model/scheduling/scheduling_pb2.py index e08ae74e42f..30fe24d1f95 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/scheduling/scheduling_pb2.py +++ b/airavata-python-sdk/airavata/model/scheduling/scheduling_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.scheduling.scheduling_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.scheduling.scheduling_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n*org.apache.airavata.model.scheduling.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/scheduling/scheduling_pb2.pyi b/airavata-python-sdk/airavata/model/scheduling/scheduling_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/scheduling/scheduling_pb2.pyi rename to airavata-python-sdk/airavata/model/scheduling/scheduling_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/scheduling/scheduling_pb2_grpc.py b/airavata-python-sdk/airavata/model/scheduling/scheduling_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/scheduling/scheduling_pb2_grpc.py rename to airavata-python-sdk/airavata/model/scheduling/scheduling_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/job/__init__.py b/airavata-python-sdk/airavata/model/security/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/job/__init__.py rename to airavata-python-sdk/airavata/model/security/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/security/security_pb2.py b/airavata-python-sdk/airavata/model/security/security_pb2.py similarity index 94% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/security/security_pb2.py rename to airavata-python-sdk/airavata/model/security/security_pb2.py index c769cde096c..66bbab73930 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/security/security_pb2.py +++ b/airavata-python-sdk/airavata/model/security/security_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.security.security_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.security.security_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n(org.apache.airavata.model.security.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/security/security_pb2.pyi b/airavata-python-sdk/airavata/model/security/security_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/security/security_pb2.pyi rename to airavata-python-sdk/airavata/model/security/security_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/security/security_pb2_grpc.py b/airavata-python-sdk/airavata/model/security/security_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/security/security_pb2_grpc.py rename to airavata-python-sdk/airavata/model/security/security_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/messaging/__init__.py b/airavata-python-sdk/airavata/model/sharing/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/messaging/__init__.py rename to airavata-python-sdk/airavata/model/sharing/__init__.py diff --git a/airavata-python-sdk/airavata/model/sharing/sharing_pb2.py b/airavata-python-sdk/airavata/model/sharing/sharing_pb2.py new file mode 100644 index 00000000000..4baa12d3de8 --- /dev/null +++ b/airavata-python-sdk/airavata/model/sharing/sharing_pb2.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: org/apache/airavata/model/sharing/sharing.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'org/apache/airavata/model/sharing/sharing.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/org/apache/airavata/model/sharing/sharing.proto\x12+org.apache.airavata.sharing.registry.models\"\x89\x01\n\x06\x44omain\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x14\n\x0c\x63reated_time\x18\x04 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x05 \x01(\x03\x12\x1d\n\x15initial_user_group_id\x18\x06 \x01(\t\"\x81\x01\n\x04User\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x11\n\tuser_name\x18\x03 \x01(\t\x12\x14\n\x0c\x63reated_time\x18\x08 \x01(\x03\x12\x14\n\x0cupdated_time\x18\t \x01(\x03J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07J\x04\x08\x07\x10\x08\"C\n\nGroupAdmin\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x10\n\x08\x61\x64min_id\x18\x03 \x01(\t\"\x86\x03\n\tUserGroup\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x10\n\x08owner_id\x18\x05 \x01(\t\x12J\n\ngroup_type\x18\x06 \x01(\x0e\x32\x36.org.apache.airavata.sharing.registry.models.GroupType\x12X\n\x11group_cardinality\x18\x07 \x01(\x0e\x32=.org.apache.airavata.sharing.registry.models.GroupCardinality\x12\x14\n\x0c\x63reated_time\x18\x08 \x01(\x03\x12\x14\n\x0cupdated_time\x18\t \x01(\x03\x12M\n\x0cgroup_admins\x18\n \x03(\x0b\x32\x37.org.apache.airavata.sharing.registry.models.GroupAdmin\"\xc6\x01\n\x0fGroupMembership\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x10\n\x08\x63hild_id\x18\x02 \x01(\t\x12\x11\n\tdomain_id\x18\x03 \x01(\t\x12O\n\nchild_type\x18\x04 \x01(\x0e\x32;.org.apache.airavata.sharing.registry.models.GroupChildType\x12\x14\n\x0c\x63reated_time\x18\x05 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x06 \x01(\x03\"\x86\x01\n\nEntityType\x12\x16\n\x0e\x65ntity_type_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x14\n\x0c\x63reated_time\x18\x05 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x06 \x01(\x03\"\xcd\x01\n\x0eSearchCriteria\x12T\n\x0csearch_field\x18\x01 \x01(\x0e\x32>.org.apache.airavata.sharing.registry.models.EntitySearchField\x12\r\n\x05value\x18\x02 \x01(\t\x12V\n\x10search_condition\x18\x03 \x01(\x0e\x32<.org.apache.airavata.sharing.registry.models.SearchCondition\"\xa6\x02\n\x06\x45ntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x16\n\x0e\x65ntity_type_id\x18\x03 \x01(\t\x12\x10\n\x08owner_id\x18\x04 \x01(\t\x12\x18\n\x10parent_entity_id\x18\x05 \x01(\t\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x13\n\x0b\x62inary_data\x18\x08 \x01(\x0c\x12\x11\n\tfull_text\x18\t \x01(\t\x12\x14\n\x0cshared_count\x18\n \x01(\x03\x12%\n\x1doriginal_entity_creation_time\x18\x0b \x01(\x03\x12\x14\n\x0c\x63reated_time\x18\x0c \x01(\x03\x12\x14\n\x0cupdated_time\x18\r \x01(\x03\"\x8e\x01\n\x0ePermissionType\x12\x1a\n\x12permission_type_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x14\n\x0c\x63reated_time\x18\x05 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x06 \x01(\x03\"\xf6\x01\n\x07Sharing\x12\x1a\n\x12permission_type_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x10\n\x08group_id\x18\x03 \x01(\t\x12N\n\x0csharing_type\x18\x04 \x01(\x0e\x32\x38.org.apache.airavata.sharing.registry.models.SharingType\x12\x11\n\tdomain_id\x18\x05 \x01(\t\x12\x1b\n\x13inherited_parent_id\x18\x06 \x01(\t\x12\x14\n\x0c\x63reated_time\x18\x07 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x08 \x01(\x03*R\n\x10GroupCardinality\x12\x1d\n\x19GROUP_CARDINALITY_UNKNOWN\x10\x00\x12\x0f\n\x0bSINGLE_USER\x10\x01\x12\x0e\n\nMULTI_USER\x10\x02*Q\n\tGroupType\x12\x16\n\x12GROUP_TYPE_UNKNOWN\x10\x00\x12\x16\n\x12\x44OMAIN_LEVEL_GROUP\x10\x01\x12\x14\n\x10USER_LEVEL_GROUP\x10\x02*C\n\x0eGroupChildType\x12\x1c\n\x18GROUP_CHILD_TYPE_UNKNOWN\x10\x00\x12\x08\n\x04USER\x10\x01\x12\t\n\x05GROUP\x10\x02*\xe5\x01\n\x11\x45ntitySearchField\x12\x1f\n\x1b\x45NTITY_SEARCH_FIELD_UNKNOWN\x10\x00\x12\x08\n\x04NAME\x10\x01\x12\x0f\n\x0b\x44\x45SCRIPTION\x10\x02\x12\r\n\tFULL_TEXT\x10\x03\x12\x15\n\x11PARRENT_ENTITY_ID\x10\x04\x12\x0c\n\x08OWNER_ID\x10\x05\x12\x16\n\x12PERMISSION_TYPE_ID\x10\x06\x12\x10\n\x0c\x43REATED_TIME\x10\x07\x12\x10\n\x0cUPDATED_TIME\x10\x08\x12\x12\n\x0e\x45NTITY_TYPE_ID\x10\t\x12\x10\n\x0cSHARED_COUNT\x10\n*u\n\x0fSearchCondition\x12\x1c\n\x18SEARCH_CONDITION_UNKNOWN\x10\x00\x12\t\n\x05\x45QUAL\x10\x01\x12\x08\n\x04LIKE\x10\x02\x12\x14\n\x10\x46ULL_TEXT_SEARCH\x10\x03\x12\x07\n\x03GTE\x10\x04\x12\x07\n\x03LTE\x10\x05\x12\x07\n\x03NOT\x10\x06*o\n\x0bSharingType\x12\x18\n\x14SHARING_TYPE_UNKNOWN\x10\x00\x12\x18\n\x14\x44IRECT_NON_CASCADING\x10\x01\x12\x14\n\x10\x44IRECT_CASCADING\x10\x02\x12\x16\n\x12INDIRECT_CASCADING\x10\x03\x42\x35\n1org.apache.airavata.sharing.registry.models.protoP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.sharing.sharing_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n1org.apache.airavata.sharing.registry.models.protoP\001' + _globals['_GROUPCARDINALITY']._serialized_start=2067 + _globals['_GROUPCARDINALITY']._serialized_end=2149 + _globals['_GROUPTYPE']._serialized_start=2151 + _globals['_GROUPTYPE']._serialized_end=2232 + _globals['_GROUPCHILDTYPE']._serialized_start=2234 + _globals['_GROUPCHILDTYPE']._serialized_end=2301 + _globals['_ENTITYSEARCHFIELD']._serialized_start=2304 + _globals['_ENTITYSEARCHFIELD']._serialized_end=2533 + _globals['_SEARCHCONDITION']._serialized_start=2535 + _globals['_SEARCHCONDITION']._serialized_end=2652 + _globals['_SHARINGTYPE']._serialized_start=2654 + _globals['_SHARINGTYPE']._serialized_end=2765 + _globals['_DOMAIN']._serialized_start=97 + _globals['_DOMAIN']._serialized_end=234 + _globals['_USER']._serialized_start=237 + _globals['_USER']._serialized_end=366 + _globals['_GROUPADMIN']._serialized_start=368 + _globals['_GROUPADMIN']._serialized_end=435 + _globals['_USERGROUP']._serialized_start=438 + _globals['_USERGROUP']._serialized_end=828 + _globals['_GROUPMEMBERSHIP']._serialized_start=831 + _globals['_GROUPMEMBERSHIP']._serialized_end=1029 + _globals['_ENTITYTYPE']._serialized_start=1032 + _globals['_ENTITYTYPE']._serialized_end=1166 + _globals['_SEARCHCRITERIA']._serialized_start=1169 + _globals['_SEARCHCRITERIA']._serialized_end=1374 + _globals['_ENTITY']._serialized_start=1377 + _globals['_ENTITY']._serialized_end=1671 + _globals['_PERMISSIONTYPE']._serialized_start=1674 + _globals['_PERMISSIONTYPE']._serialized_end=1816 + _globals['_SHARING']._serialized_start=1819 + _globals['_SHARING']._serialized_end=2065 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/sharing/sharing_pb2.pyi b/airavata-python-sdk/airavata/model/sharing/sharing_pb2.pyi similarity index 94% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/sharing/sharing_pb2.pyi rename to airavata-python-sdk/airavata/model/sharing/sharing_pb2.pyi index 12b580a7e13..56e06483379 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/sharing/sharing_pb2.pyi +++ b/airavata-python-sdk/airavata/model/sharing/sharing_pb2.pyi @@ -104,26 +104,18 @@ class Domain(_message.Message): def __init__(self, domain_id: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., created_time: _Optional[int] = ..., updated_time: _Optional[int] = ..., initial_user_group_id: _Optional[str] = ...) -> None: ... class User(_message.Message): - __slots__ = ("user_id", "domain_id", "user_name", "first_name", "last_name", "email", "icon", "created_time", "updated_time") + __slots__ = ("user_id", "domain_id", "user_name", "created_time", "updated_time") USER_ID_FIELD_NUMBER: _ClassVar[int] DOMAIN_ID_FIELD_NUMBER: _ClassVar[int] USER_NAME_FIELD_NUMBER: _ClassVar[int] - FIRST_NAME_FIELD_NUMBER: _ClassVar[int] - LAST_NAME_FIELD_NUMBER: _ClassVar[int] - EMAIL_FIELD_NUMBER: _ClassVar[int] - ICON_FIELD_NUMBER: _ClassVar[int] CREATED_TIME_FIELD_NUMBER: _ClassVar[int] UPDATED_TIME_FIELD_NUMBER: _ClassVar[int] user_id: str domain_id: str user_name: str - first_name: str - last_name: str - email: str - icon: bytes created_time: int updated_time: int - def __init__(self, user_id: _Optional[str] = ..., domain_id: _Optional[str] = ..., user_name: _Optional[str] = ..., first_name: _Optional[str] = ..., last_name: _Optional[str] = ..., email: _Optional[str] = ..., icon: _Optional[bytes] = ..., created_time: _Optional[int] = ..., updated_time: _Optional[int] = ...) -> None: ... + def __init__(self, user_id: _Optional[str] = ..., domain_id: _Optional[str] = ..., user_name: _Optional[str] = ..., created_time: _Optional[int] = ..., updated_time: _Optional[int] = ...) -> None: ... class GroupAdmin(_message.Message): __slots__ = ("group_id", "domain_id", "admin_id") diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/sharing/sharing_pb2_grpc.py b/airavata-python-sdk/airavata/model/sharing/sharing_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/sharing/sharing_pb2_grpc.py rename to airavata-python-sdk/airavata/model/sharing/sharing_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/parallelism/__init__.py b/airavata-python-sdk/airavata/model/status/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/parallelism/__init__.py rename to airavata-python-sdk/airavata/model/status/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/status/status_pb2.py b/airavata-python-sdk/airavata/model/status/status_pb2.py similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/status/status_pb2.py rename to airavata-python-sdk/airavata/model/status/status_pb2.py index 7b767a411a1..39e039f7897 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/status/status_pb2.py +++ b/airavata-python-sdk/airavata/model/status/status_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.status.status_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.status.status_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n&org.apache.airavata.model.status.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/status/status_pb2.pyi b/airavata-python-sdk/airavata/model/status/status_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/status/status_pb2.pyi rename to airavata-python-sdk/airavata/model/status/status_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/status/status_pb2_grpc.py b/airavata-python-sdk/airavata/model/status/status_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/status/status_pb2_grpc.py rename to airavata-python-sdk/airavata/model/status/status_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/process/__init__.py b/airavata-python-sdk/airavata/model/task/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/process/__init__.py rename to airavata-python-sdk/airavata/model/task/__init__.py diff --git a/airavata-python-sdk/airavata/model/task/task_pb2.py b/airavata-python-sdk/airavata/model/task/task_pb2.py new file mode 100644 index 00000000000..41a81a49384 --- /dev/null +++ b/airavata-python-sdk/airavata/model/task/task_pb2.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: org/apache/airavata/model/task/task.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'org/apache/airavata/model/task/task.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 +from airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 +from airavata.model.job import job_pb2 as org_dot_apache_dot_airavata_dot_model_dot_job_dot_job__pb2 +from airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)org/apache/airavata/model/task/task.proto\x12\x1eorg.apache.airavata.model.task\x1a/org/apache/airavata/model/commons/commons.proto\x1a=org/apache/airavata/model/application/io/application_io.proto\x1a\'org/apache/airavata/model/job/job.proto\x1a-org/apache/airavata/model/status/status.proto\"\xbd\x03\n\tTaskModel\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12<\n\ttask_type\x18\x02 \x01(\x0e\x32).org.apache.airavata.model.task.TaskTypes\x12\x19\n\x11parent_process_id\x18\x03 \x01(\t\x12\x15\n\rcreation_time\x18\x04 \x01(\x03\x12\x18\n\x10last_update_time\x18\x05 \x01(\x03\x12\x43\n\rtask_statuses\x18\x06 \x03(\x0b\x32,.org.apache.airavata.model.status.TaskStatus\x12\x13\n\x0btask_detail\x18\x07 \x01(\t\x12\x16\n\x0esub_task_model\x18\x08 \x01(\x0c\x12\x42\n\x0btask_errors\x18\t \x03(\x0b\x32-.org.apache.airavata.model.commons.ErrorModel\x12\x35\n\x04jobs\x18\n \x03(\x0b\x32\'.org.apache.airavata.model.job.JobModel\x12\x11\n\tmax_retry\x18\x0b \x01(\x05\x12\x15\n\rcurrent_retry\x18\x0c \x01(\x05\"\xf5\x02\n\x14\x44\x61taStagingTaskModel\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\t\x12;\n\x04type\x18\x03 \x01(\x0e\x32-.org.apache.airavata.model.task.DataStageType\x12\x1b\n\x13transfer_start_time\x18\x04 \x01(\x03\x12\x19\n\x11transfer_end_time\x18\x05 \x01(\x03\x12\x15\n\rtransfer_rate\x18\x06 \x01(\t\x12T\n\rprocess_input\x18\x07 \x01(\x0b\x32=.org.apache.airavata.model.application.io.InputDataObjectType\x12V\n\x0eprocess_output\x18\x08 \x01(\x0b\x32>.org.apache.airavata.model.application.io.OutputDataObjectType\"3\n\x19\x45nvironmentSetupTaskModel\x12\x10\n\x08location\x18\x01 \x01(\tJ\x04\x08\x02\x10\x03\"7\n\x16JobSubmissionTaskModel\x12\x11\n\twall_time\x18\x03 \x01(\x05J\x04\x08\x01\x10\x02J\x04\x08\x02\x10\x03\"\x18\n\x10MonitorTaskModelJ\x04\x08\x01\x10\x02*\x8e\x01\n\tTaskTypes\x12\x16\n\x12TASK_TYPES_UNKNOWN\x10\x00\x12\r\n\tENV_SETUP\x10\x01\x12\x10\n\x0c\x44\x41TA_STAGING\x10\x02\x12\x12\n\x0eJOB_SUBMISSION\x10\x03\x12\x0f\n\x0b\x45NV_CLEANUP\x10\x04\x12\x0e\n\nMONITORING\x10\x05\x12\x13\n\x0fOUTPUT_FETCHING\x10\x06*V\n\rDataStageType\x12\x1b\n\x17\x44\x41TA_STAGE_TYPE_UNKNOWN\x10\x00\x12\t\n\x05INPUT\x10\x01\x12\t\n\x05OUPUT\x10\x02\x12\x12\n\x0e\x41RCHIVE_OUTPUT\x10\x03\x42(\n$org.apache.airavata.model.task.protoP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.task.task_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n$org.apache.airavata.model.task.protoP\001' + _globals['_TASKTYPES']._serialized_start=1238 + _globals['_TASKTYPES']._serialized_end=1380 + _globals['_DATASTAGETYPE']._serialized_start=1382 + _globals['_DATASTAGETYPE']._serialized_end=1468 + _globals['_TASKMODEL']._serialized_start=278 + _globals['_TASKMODEL']._serialized_end=723 + _globals['_DATASTAGINGTASKMODEL']._serialized_start=726 + _globals['_DATASTAGINGTASKMODEL']._serialized_end=1099 + _globals['_ENVIRONMENTSETUPTASKMODEL']._serialized_start=1101 + _globals['_ENVIRONMENTSETUPTASKMODEL']._serialized_end=1152 + _globals['_JOBSUBMISSIONTASKMODEL']._serialized_start=1154 + _globals['_JOBSUBMISSIONTASKMODEL']._serialized_end=1209 + _globals['_MONITORTASKMODEL']._serialized_start=1211 + _globals['_MONITORTASKMODEL']._serialized_end=1235 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/task/task_pb2.pyi b/airavata-python-sdk/airavata/model/task/task_pb2.pyi similarity index 75% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/task/task_pb2.pyi rename to airavata-python-sdk/airavata/model/task/task_pb2.pyi index 1bc26321b64..3cbd5aaaa3b 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/task/task_pb2.pyi +++ b/airavata-python-sdk/airavata/model/task/task_pb2.pyi @@ -1,9 +1,7 @@ -from org.apache.airavata.model.commons import commons_pb2 as _commons_pb2 -from org.apache.airavata.model.application.io import application_io_pb2 as _application_io_pb2 -from org.apache.airavata.model.appcatalog.computeresource import compute_resource_pb2 as _compute_resource_pb2 -from org.apache.airavata.model.data.movement import data_movement_pb2 as _data_movement_pb2 -from org.apache.airavata.model.job import job_pb2 as _job_pb2 -from org.apache.airavata.model.status import status_pb2 as _status_pb2 +from airavata.model.commons import commons_pb2 as _commons_pb2 +from airavata.model.application.io import application_io_pb2 as _application_io_pb2 +from airavata.model.job import job_pb2 as _job_pb2 +from airavata.model.status import status_pb2 as _status_pb2 from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor @@ -90,25 +88,17 @@ class DataStagingTaskModel(_message.Message): def __init__(self, source: _Optional[str] = ..., destination: _Optional[str] = ..., type: _Optional[_Union[DataStageType, str]] = ..., transfer_start_time: _Optional[int] = ..., transfer_end_time: _Optional[int] = ..., transfer_rate: _Optional[str] = ..., process_input: _Optional[_Union[_application_io_pb2.InputDataObjectType, _Mapping]] = ..., process_output: _Optional[_Union[_application_io_pb2.OutputDataObjectType, _Mapping]] = ...) -> None: ... class EnvironmentSetupTaskModel(_message.Message): - __slots__ = ("location", "protocol") + __slots__ = ("location",) LOCATION_FIELD_NUMBER: _ClassVar[int] - PROTOCOL_FIELD_NUMBER: _ClassVar[int] location: str - protocol: _data_movement_pb2.SecurityProtocol - def __init__(self, location: _Optional[str] = ..., protocol: _Optional[_Union[_data_movement_pb2.SecurityProtocol, str]] = ...) -> None: ... + def __init__(self, location: _Optional[str] = ...) -> None: ... class JobSubmissionTaskModel(_message.Message): - __slots__ = ("job_submission_protocol", "monitor_mode", "wall_time") - JOB_SUBMISSION_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - MONITOR_MODE_FIELD_NUMBER: _ClassVar[int] + __slots__ = ("wall_time",) WALL_TIME_FIELD_NUMBER: _ClassVar[int] - job_submission_protocol: _compute_resource_pb2.JobSubmissionProtocol - monitor_mode: _compute_resource_pb2.MonitorMode wall_time: int - def __init__(self, job_submission_protocol: _Optional[_Union[_compute_resource_pb2.JobSubmissionProtocol, str]] = ..., monitor_mode: _Optional[_Union[_compute_resource_pb2.MonitorMode, str]] = ..., wall_time: _Optional[int] = ...) -> None: ... + def __init__(self, wall_time: _Optional[int] = ...) -> None: ... class MonitorTaskModel(_message.Message): - __slots__ = ("monitor_mode",) - MONITOR_MODE_FIELD_NUMBER: _ClassVar[int] - monitor_mode: _compute_resource_pb2.MonitorMode - def __init__(self, monitor_mode: _Optional[_Union[_compute_resource_pb2.MonitorMode, str]] = ...) -> None: ... + __slots__ = () + def __init__(self) -> None: ... diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/task/task_pb2_grpc.py b/airavata-python-sdk/airavata/model/task/task_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/task/task_pb2_grpc.py rename to airavata-python-sdk/airavata/model/task/task_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/scheduling/__init__.py b/airavata-python-sdk/airavata/model/tenant/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/scheduling/__init__.py rename to airavata-python-sdk/airavata/model/tenant/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/tenant/tenant_profile_pb2.py b/airavata-python-sdk/airavata/model/tenant/tenant_profile_pb2.py similarity index 96% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/tenant/tenant_profile_pb2.py rename to airavata-python-sdk/airavata/model/tenant/tenant_profile_pb2.py index 532febe550d..863f78bfbaa 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/tenant/tenant_profile_pb2.py +++ b/airavata-python-sdk/airavata/model/tenant/tenant_profile_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.tenant.tenant_profile_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.tenant.tenant_profile_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n&org.apache.airavata.model.tenant.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/tenant/tenant_profile_pb2.pyi b/airavata-python-sdk/airavata/model/tenant/tenant_profile_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/tenant/tenant_profile_pb2.pyi rename to airavata-python-sdk/airavata/model/tenant/tenant_profile_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/tenant/tenant_profile_pb2_grpc.py b/airavata-python-sdk/airavata/model/tenant/tenant_profile_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/tenant/tenant_profile_pb2_grpc.py rename to airavata-python-sdk/airavata/model/tenant/tenant_profile_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/security/__init__.py b/airavata-python-sdk/airavata/model/user/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/security/__init__.py rename to airavata-python-sdk/airavata/model/user/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/user/user_profile_pb2.py b/airavata-python-sdk/airavata/model/user/user_profile_pb2.py similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/user/user_profile_pb2.py rename to airavata-python-sdk/airavata/model/user/user_profile_pb2.py index 7d3b75e2217..5109ddc2dc7 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/user/user_profile_pb2.py +++ b/airavata-python-sdk/airavata/model/user/user_profile_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.user.user_profile_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.user.user_profile_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n$org.apache.airavata.model.user.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/user/user_profile_pb2.pyi b/airavata-python-sdk/airavata/model/user/user_profile_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/user/user_profile_pb2.pyi rename to airavata-python-sdk/airavata/model/user/user_profile_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/user/user_profile_pb2_grpc.py b/airavata-python-sdk/airavata/model/user/user_profile_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/user/user_profile_pb2_grpc.py rename to airavata-python-sdk/airavata/model/user/user_profile_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/sharing/__init__.py b/airavata-python-sdk/airavata/model/workflow/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/sharing/__init__.py rename to airavata-python-sdk/airavata/model/workflow/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workflow/workflow_pb2.py b/airavata-python-sdk/airavata/model/workflow/workflow_pb2.py similarity index 95% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workflow/workflow_pb2.py rename to airavata-python-sdk/airavata/model/workflow/workflow_pb2.py index 8c25fd1be31..e0ee93356cf 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workflow/workflow_pb2.py +++ b/airavata-python-sdk/airavata/model/workflow/workflow_pb2.py @@ -22,15 +22,15 @@ _sym_db = _symbol_database.Default() -from org.apache.airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 -from org.apache.airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 +from airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 +from airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1org/apache/airavata/model/workflow/workflow.proto\x12\"org.apache.airavata.model.workflow\x1a/org/apache/airavata/model/commons/commons.proto\x1a=org/apache/airavata/model/application/io/application_io.proto\"\x8d\x01\n\x11\x41pplicationStatus\x12\n\n\x02id\x18\x01 \x01(\t\x12\x43\n\x05state\x18\x02 \x01(\x0e\x32\x34.org.apache.airavata.model.workflow.ApplicationState\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x12\n\nupdated_at\x18\x04 \x01(\x03\"\x92\x03\n\x13WorkflowApplication\x12\n\n\x02id\x18\x01 \x01(\t\x12\x12\n\nprocess_id\x18\x02 \x01(\t\x12 \n\x18\x61pplication_interface_id\x18\x03 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x04 \x01(\t\x12\x12\n\nqueue_name\x18\x05 \x01(\t\x12\x12\n\nnode_count\x18\x06 \x01(\x05\x12\x12\n\ncore_count\x18\x07 \x01(\x05\x12\x17\n\x0fwall_time_limit\x18\x08 \x01(\x05\x12\x17\n\x0fphysical_memory\x18\t \x01(\x05\x12G\n\x08statuses\x18\n \x03(\x0b\x32\x35.org.apache.airavata.model.workflow.ApplicationStatus\x12=\n\x06\x65rrors\x18\x0b \x03(\x0b\x32-.org.apache.airavata.model.commons.ErrorModel\x12\x12\n\ncreated_at\x18\x0c \x01(\x03\x12\x12\n\nupdated_at\x18\r \x01(\x03\"\x90\x01\n\tDataBlock\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12@\n\x04type\x18\x03 \x01(\x0e\x32\x32.org.apache.airavata.model.application.io.DataType\x12\x12\n\ncreated_at\x18\x04 \x01(\x03\x12\x12\n\nupdated_at\x18\x05 \x01(\x03\"\xe6\x02\n\x12WorkflowConnection\x12\n\n\x02id\x18\x01 \x01(\t\x12\x41\n\ndata_block\x18\x02 \x01(\x0b\x32-.org.apache.airavata.model.workflow.DataBlock\x12\x44\n\tfrom_type\x18\x03 \x01(\x0e\x32\x31.org.apache.airavata.model.workflow.ComponentType\x12\x0f\n\x07\x66rom_id\x18\x04 \x01(\t\x12\x18\n\x10\x66rom_output_name\x18\x05 \x01(\t\x12\x42\n\x07to_type\x18\x06 \x01(\x0e\x32\x31.org.apache.airavata.model.workflow.ComponentType\x12\r\n\x05to_id\x18\x07 \x01(\t\x12\x15\n\rto_input_name\x18\x08 \x01(\t\x12\x12\n\ncreated_at\x18\t \x01(\x03\x12\x12\n\nupdated_at\x18\n \x01(\x03\"\x85\x01\n\rHandlerStatus\x12\n\n\x02id\x18\x01 \x01(\t\x12?\n\x05state\x18\x02 \x01(\x0e\x32\x30.org.apache.airavata.model.workflow.HandlerState\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x12\n\nupdated_at\x18\x04 \x01(\x03\"\xa8\x03\n\x0fWorkflowHandler\x12\n\n\x02id\x18\x01 \x01(\t\x12=\n\x04type\x18\x02 \x01(\x0e\x32/.org.apache.airavata.model.workflow.HandlerType\x12M\n\x06inputs\x18\x03 \x03(\x0b\x32=.org.apache.airavata.model.application.io.InputDataObjectType\x12O\n\x07outputs\x18\x04 \x03(\x0b\x32>.org.apache.airavata.model.application.io.OutputDataObjectType\x12\x43\n\x08statuses\x18\x05 \x03(\x0b\x32\x31.org.apache.airavata.model.workflow.HandlerStatus\x12=\n\x06\x65rrors\x18\x06 \x03(\x0b\x32-.org.apache.airavata.model.commons.ErrorModel\x12\x12\n\ncreated_at\x18\x07 \x01(\x03\x12\x12\n\nupdated_at\x18\x08 \x01(\x03\"\x87\x01\n\x0eWorkflowStatus\x12\n\n\x02id\x18\x01 \x01(\t\x12@\n\x05state\x18\x02 \x01(\x0e\x32\x31.org.apache.airavata.model.workflow.WorkflowState\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x12\n\nupdated_at\x18\x04 \x01(\x03\"\xda\x03\n\x10\x41iravataWorkflow\x12\n\n\x02id\x18\x01 \x01(\t\x12\x15\n\rexperiment_id\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12M\n\x0c\x61pplications\x18\x04 \x03(\x0b\x32\x37.org.apache.airavata.model.workflow.WorkflowApplication\x12\x45\n\x08handlers\x18\x05 \x03(\x0b\x32\x33.org.apache.airavata.model.workflow.WorkflowHandler\x12K\n\x0b\x63onnections\x18\x06 \x03(\x0b\x32\x36.org.apache.airavata.model.workflow.WorkflowConnection\x12\x44\n\x08statuses\x18\x07 \x03(\x0b\x32\x32.org.apache.airavata.model.workflow.WorkflowStatus\x12=\n\x06\x65rrors\x18\x08 \x03(\x0b\x32-.org.apache.airavata.model.commons.ErrorModel\x12\x12\n\ncreated_at\x18\t \x01(\x03\x12\x12\n\nupdated_at\x18\n \x01(\x03*\xd3\x02\n\x10\x41pplicationState\x12\x1d\n\x19\x41PPLICATION_STATE_UNKNOWN\x10\x00\x12\x1d\n\x19\x41PPLICATION_STATE_CREATED\x10\x01\x12\x1f\n\x1b\x41PPLICATION_STATE_VALIDATED\x10\x02\x12\x1f\n\x1b\x41PPLICATION_STATE_SCHEDULED\x10\x03\x12\x1e\n\x1a\x41PPLICATION_STATE_LAUNCHED\x10\x04\x12\x1f\n\x1b\x41PPLICATION_STATE_EXECUTING\x10\x05\x12\x1f\n\x1b\x41PPLICATION_STATE_CANCELING\x10\x06\x12\x1e\n\x1a\x41PPLICATION_STATE_CANCELED\x10\x07\x12\x1f\n\x1b\x41PPLICATION_STATE_COMPLETED\x10\x08\x12\x1c\n\x18\x41PPLICATION_STATE_FAILED\x10\t*I\n\rComponentType\x12\x1a\n\x16\x43OMPONENT_TYPE_UNKNOWN\x10\x00\x12\x0f\n\x0b\x41PPLICATION\x10\x01\x12\x0b\n\x07HANDLER\x10\x02*N\n\x0bHandlerType\x12\x18\n\x14HANDLER_TYPE_UNKNOWN\x10\x00\x12\x10\n\x0c\x46LOW_STARTER\x10\x01\x12\x13\n\x0f\x46LOW_TERMINATOR\x10\x02*\xa7\x02\n\x0cHandlerState\x12\x19\n\x15HANDLER_STATE_UNKNOWN\x10\x00\x12\x19\n\x15HANDLER_STATE_CREATED\x10\x01\x12\x1b\n\x17HANDLER_STATE_VALIDATED\x10\x02\x12\x1b\n\x17HANDLER_STATE_SCHEDULED\x10\x03\x12\x1a\n\x16HANDLER_STATE_LAUNCHED\x10\x04\x12\x1b\n\x17HANDLER_STATE_EXECUTING\x10\x05\x12\x1b\n\x17HANDLER_STATE_CANCELING\x10\x06\x12\x1a\n\x16HANDLER_STATE_CANCELED\x10\x07\x12\x1b\n\x17HANDLER_STATE_COMPLETED\x10\x08\x12\x18\n\x14HANDLER_STATE_FAILED\x10\t*\x88\x03\n\rWorkflowState\x12\x1a\n\x16WORKFLOW_STATE_UNKNOWN\x10\x00\x12\x1a\n\x16WORKFLOW_STATE_CREATED\x10\x01\x12\x1c\n\x18WORKFLOW_STATE_VALIDATED\x10\x02\x12\x1c\n\x18WORKFLOW_STATE_SCHEDULED\x10\x03\x12\x1b\n\x17WORKFLOW_STATE_LAUNCHED\x10\x04\x12\x1c\n\x18WORKFLOW_STATE_EXECUTING\x10\x05\x12\x1a\n\x16WORKFLOW_STATE_PAUSING\x10\x06\x12\x19\n\x15WORKFLOW_STATE_PAUSED\x10\x07\x12\x1d\n\x19WORKFLOW_STATE_RESTARTING\x10\x08\x12\x1c\n\x18WORKFLOW_STATE_CANCELING\x10\t\x12\x1b\n\x17WORKFLOW_STATE_CANCELED\x10\n\x12\x1c\n\x18WORKFLOW_STATE_COMPLETED\x10\x0b\x12\x19\n\x15WORKFLOW_STATE_FAILED\x10\x0c\x42,\n(org.apache.airavata.model.workflow.protoP\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.workflow.workflow_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.workflow.workflow_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n(org.apache.airavata.model.workflow.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workflow/workflow_pb2.pyi b/airavata-python-sdk/airavata/model/workflow/workflow_pb2.pyi similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workflow/workflow_pb2.pyi rename to airavata-python-sdk/airavata/model/workflow/workflow_pb2.pyi index a3c1594e6ce..3c28e905130 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workflow/workflow_pb2.pyi +++ b/airavata-python-sdk/airavata/model/workflow/workflow_pb2.pyi @@ -1,5 +1,5 @@ -from org.apache.airavata.model.commons import commons_pb2 as _commons_pb2 -from org.apache.airavata.model.application.io import application_io_pb2 as _application_io_pb2 +from airavata.model.commons import commons_pb2 as _commons_pb2 +from airavata.model.application.io import application_io_pb2 as _application_io_pb2 from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workflow/workflow_pb2_grpc.py b/airavata-python-sdk/airavata/model/workflow/workflow_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workflow/workflow_pb2_grpc.py rename to airavata-python-sdk/airavata/model/workflow/workflow_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/status/__init__.py b/airavata-python-sdk/airavata/model/workspace/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/status/__init__.py rename to airavata-python-sdk/airavata/model/workspace/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workspace/workspace_pb2.py b/airavata-python-sdk/airavata/model/workspace/workspace_pb2.py similarity index 97% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workspace/workspace_pb2.py rename to airavata-python-sdk/airavata/model/workspace/workspace_pb2.py index 147514f5e32..acf9b10805a 100644 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workspace/workspace_pb2.py +++ b/airavata-python-sdk/airavata/model/workspace/workspace_pb2.py @@ -28,7 +28,7 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.workspace.workspace_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.model.workspace.workspace_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n)org.apache.airavata.model.workspace.protoP\001' diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workspace/workspace_pb2.pyi b/airavata-python-sdk/airavata/model/workspace/workspace_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workspace/workspace_pb2.pyi rename to airavata-python-sdk/airavata/model/workspace/workspace_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workspace/workspace_pb2_grpc.py b/airavata-python-sdk/airavata/model/workspace/workspace_pb2_grpc.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workspace/workspace_pb2_grpc.py rename to airavata-python-sdk/airavata/model/workspace/workspace_pb2_grpc.py diff --git a/airavata-python-sdk/airavata_sdk/samples/__init__.py b/airavata-python-sdk/airavata/samples/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/samples/__init__.py rename to airavata-python-sdk/airavata/samples/__init__.py diff --git a/airavata-python-sdk/airavata/samples/read_with_raw_stubs.py b/airavata-python-sdk/airavata/samples/read_with_raw_stubs.py new file mode 100644 index 00000000000..9b812b776ac --- /dev/null +++ b/airavata-python-sdk/airavata/samples/read_with_raw_stubs.py @@ -0,0 +1,61 @@ +# 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. +# + +"""Call Airavata directly through the generated gRPC stubs. + +``airavata`` ships only the protoc-generated stubs (``airavata``). +Build a Bearer-authenticated channel with ``airavata.auth.authenticated_channel`` +and construct any service stub on it; the channel's interceptor attaches the +access token to every call, so there is no per-call metadata to thread. This is +exactly how the Django portal and ``airavata.experiments`` talk to the server — +no hand-written client wrapper in between. + + python -m airavata.samples.read_with_raw_stubs +""" + +from airavata.auth import authenticated_channel +from airavata.auth.device_auth import AuthContext +from airavata import Settings +from airavata.services import ( + application_catalog_service_pb2, + application_catalog_service_pb2_grpc, +) + + +def main() -> None: + settings = Settings() + # Device-code login; caches the token in CS_ACCESS_TOKEN. + access_token = AuthContext.get_access_token() + + channel = authenticated_channel( + settings.API_SERVER_HOSTNAME, + settings.API_SERVER_PORT, + access_token, + secure=settings.API_SERVER_SECURE, + ) + catalog = application_catalog_service_pb2_grpc.ApplicationCatalogServiceStub(channel) + + response = catalog.GetAllApplicationInterfaces( + application_catalog_service_pb2.GetAllApplicationInterfacesRequest( + gateway_id=settings.GATEWAY_ID, + ) + ) + for interface in response.application_interfaces: + print(interface.application_interface_id, "-", interface.application_name) + + +if __name__ == "__main__": + main() diff --git a/airavata-python-sdk/airavata_sdk/samples/resources/__init__.py b/airavata-python-sdk/airavata/samples/resources/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/samples/resources/__init__.py rename to airavata-python-sdk/airavata/samples/resources/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/samples/resources/incommon_rsa_server_ca.pem b/airavata-python-sdk/airavata/samples/resources/incommon_rsa_server_ca.pem similarity index 100% rename from airavata-python-sdk/airavata_sdk/samples/resources/incommon_rsa_server_ca.pem rename to airavata-python-sdk/airavata/samples/resources/incommon_rsa_server_ca.pem diff --git a/airavata-python-sdk/airavata/samples/run_experiment.py b/airavata-python-sdk/airavata/samples/run_experiment.py new file mode 100644 index 00000000000..ed031dceaae --- /dev/null +++ b/airavata-python-sdk/airavata/samples/run_experiment.py @@ -0,0 +1,59 @@ +# 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. +# + +"""Define and launch an experiment with the high-level ``airavata.experiments`` API. + +This is the recommended way to run HPC jobs through Airavata from Python. The +experiment-orchestration logic (input staging, scheduling, status polling) lives +in ``airavata.experiments``, layered on top of the protoc-generated gRPC stubs +that ``airavata`` ships. Authentication is the browser device-code flow +(``airavata.experiments.login``). + +Run it as a script after editing the runtime selection and input file paths: + + python -m airavata.samples.run_experiment +""" + +import airavata.experiments as ae +from airavata.experiments.md import NAMD + + +def main() -> None: + # Browser device-code login (a no-op if CS_ACCESS_TOKEN is already set). + ae.login() + + # Discover the runtimes (a cluster + an allocation group) available to you. + runtimes = ae.find_runtimes(cluster="example-cluster", group="Default Gateway Profile") + + # Define a NAMD molecular-dynamics experiment from its input files. + experiment = NAMD.initialize( + name="namd-demo", + config_file="./inputs/equilibrate.conf", + pdb_file="./inputs/structure.pdb", + psf_file="./inputs/structure.psf", + ffp_files=["./inputs/par_all27_prot_lipid.prm"], + ) + + # Schedule one run on a discovered runtime, then build, launch, and await it. + experiment.add_run(use=runtimes, cpus=16, nodes=1, walltime=30) + plan = experiment.plan() + plan.launch() + plan.wait_for_completion() + plan.download(local_dir="./results") + + +if __name__ == "__main__": + main() diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/task/__init__.py b/airavata-python-sdk/airavata/services/__init__.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/task/__init__.py rename to airavata-python-sdk/airavata/services/__init__.py diff --git a/airavata-python-sdk/airavata_sdk/generated/services/agent_communication_pb2.py b/airavata-python-sdk/airavata/services/agent_communication_pb2.py similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/services/agent_communication_pb2.py rename to airavata-python-sdk/airavata/services/agent_communication_pb2.py index a125f88c443..b110c0d2856 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/agent_communication_pb2.py +++ b/airavata-python-sdk/airavata/services/agent_communication_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE -# source: services/agent-communication.proto +# source: services/agent_communication.proto # Protobuf Python Version: 6.31.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor @@ -15,7 +15,7 @@ 31, 1, '', - 'services/agent-communication.proto' + 'services/agent_communication.proto' ) # @@protoc_insertion_point(imports) @@ -24,7 +24,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"services/agent-communication.proto\x12\x19org.apache.airavata.agent\"\x1c\n\tAgentPing\x12\x0f\n\x07\x61gentId\x18\x01 \x01(\t\"\"\n\x0fShutdownRequest\x12\x0f\n\x07\x61gentId\x18\x01 \x01(\t\"s\n\x12\x43reateAgentRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x61gentId\x18\x02 \x01(\t\x12\x13\n\x0b\x63ontainerId\x18\x03 \x01(\t\x12\x12\n\nworkingDir\x18\x04 \x01(\t\x12\x0e\n\x06mounts\x18\x05 \x03(\t\"K\n\x13\x43reateAgentResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x61gentId\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\"=\n\x15TerminateAgentRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x61gentId\x18\x02 \x01(\t\"N\n\x16TerminateAgentResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x61gentId\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\"W\n\x0f\x45nvSetupRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x65nvName\x18\x02 \x01(\t\x12\x11\n\tlibraries\x18\x03 \x03(\t\x12\x0b\n\x03pip\x18\x04 \x03(\t\"7\n\x10\x45nvSetupResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"f\n\x17\x43ommandExecutionRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x65nvName\x18\x02 \x01(\t\x12\x12\n\nworkingDir\x18\x03 \x01(\t\x12\x11\n\targuments\x18\x04 \x03(\t\"G\n\x18\x43ommandExecutionResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x16\n\x0eresponseString\x18\x02 \x01(\t\"k\n\x1c\x41syncCommandExecutionRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x65nvName\x18\x02 \x01(\t\x12\x12\n\nworkingDir\x18\x03 \x01(\t\x12\x11\n\targuments\x18\x04 \x03(\t\"]\n\x1d\x41syncCommandExecutionResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x11\n\tprocessId\x18\x02 \x01(\x05\x12\x14\n\x0c\x65rrorMessage\x18\x03 \x01(\t\".\n\x17\x41syncCommandListRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\"4\n\x0c\x41syncCommand\x12\x11\n\tprocessId\x18\x01 \x01(\x05\x12\x11\n\targuments\x18\x04 \x03(\t\"j\n\x18\x41syncCommandListResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x39\n\x08\x63ommands\x18\x02 \x03(\x0b\x32\'.org.apache.airavata.agent.AsyncCommand\"F\n\x1c\x41syncCommandTerminateRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x11\n\tprocessId\x18\x02 \x01(\x05\"D\n\x1d\x41syncCommandTerminateResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"`\n\x16PythonExecutionRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x65nvName\x18\x02 \x01(\t\x12\x12\n\nworkingDir\x18\x03 \x01(\t\x12\x0c\n\x04\x63ode\x18\x04 \x01(\t\"F\n\x17PythonExecutionResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x16\n\x0eresponseString\x18\x02 \x01(\t\"M\n\x17JupyterExecutionRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x65nvName\x18\x02 \x01(\t\x12\x0c\n\x04\x63ode\x18\x03 \x01(\t\"G\n\x18JupyterExecutionResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x16\n\x0eresponseString\x18\x02 \x01(\t\"<\n\x14KernelRestartRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x65nvName\x18\x02 \x01(\t\"<\n\x15KernelRestartResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"\xc1\x01\n\x15TunnelCreationRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x11\n\tlocalPort\x18\x02 \x01(\x05\x12\x15\n\rlocalBindHost\x18\x03 \x01(\t\x12\x18\n\x10tunnelServerHost\x18\x04 \x01(\t\x12\x18\n\x10tunnelServerPort\x18\x05 \x01(\x05\x12\x1a\n\x12tunnelServerApiUrl\x18\x06 \x01(\t\x12\x19\n\x11tunnelServerToken\x18\x07 \x01(\t\"w\n\x16TunnelCreationResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\ntunnelHost\x18\x03 \x01(\t\x12\x12\n\ntunnelPort\x18\x04 \x01(\x05\x12\x10\n\x08tunnelId\x18\x05 \x01(\t\"A\n\x18TunnelTerminationRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x10\n\x08tunnelId\x18\x02 \x01(\t\"@\n\x19TunnelTerminationResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"\xec\x08\n\x0c\x41gentMessage\x12\x39\n\tagentPing\x18\x01 \x01(\x0b\x32$.org.apache.airavata.agent.AgentPingH\x00\x12M\n\x13\x63reateAgentResponse\x18\x02 \x01(\x0b\x32..org.apache.airavata.agent.CreateAgentResponseH\x00\x12S\n\x16terminateAgentResponse\x18\x03 \x01(\x0b\x32\x31.org.apache.airavata.agent.TerminateAgentResponseH\x00\x12G\n\x10\x65nvSetupResponse\x18\x04 \x01(\x0b\x32+.org.apache.airavata.agent.EnvSetupResponseH\x00\x12W\n\x18\x63ommandExecutionResponse\x18\x05 \x01(\x0b\x32\x33.org.apache.airavata.agent.CommandExecutionResponseH\x00\x12U\n\x17pythonExecutionResponse\x18\x06 \x01(\x0b\x32\x32.org.apache.airavata.agent.PythonExecutionResponseH\x00\x12W\n\x18jupyterExecutionResponse\x18\x07 \x01(\x0b\x32\x33.org.apache.airavata.agent.JupyterExecutionResponseH\x00\x12Q\n\x15kernelRestartResponse\x18\x08 \x01(\x0b\x32\x30.org.apache.airavata.agent.KernelRestartResponseH\x00\x12S\n\x16tunnelCreationResponse\x18\t \x01(\x0b\x32\x31.org.apache.airavata.agent.TunnelCreationResponseH\x00\x12Y\n\x19tunnelTerminationResponse\x18\n \x01(\x0b\x32\x34.org.apache.airavata.agent.TunnelTerminationResponseH\x00\x12\x61\n\x1d\x61syncCommandExecutionResponse\x18\x0b \x01(\x0b\x32\x38.org.apache.airavata.agent.AsyncCommandExecutionResponseH\x00\x12W\n\x18\x61syncCommandListResponse\x18\x0c \x01(\x0b\x32\x33.org.apache.airavata.agent.AsyncCommandListResponseH\x00\x12\x61\n\x1d\x61syncCommandTerminateResponse\x18\r \x01(\x0b\x32\x38.org.apache.airavata.agent.AsyncCommandTerminateResponseH\x00\x42\t\n\x07message\"\xe1\x08\n\rServerMessage\x12\x45\n\x0fshutdownRequest\x18\x01 \x01(\x0b\x32*.org.apache.airavata.agent.ShutdownRequestH\x00\x12K\n\x12\x63reateAgentRequest\x18\x02 \x01(\x0b\x32-.org.apache.airavata.agent.CreateAgentRequestH\x00\x12Q\n\x15terminateAgentRequest\x18\x03 \x01(\x0b\x32\x30.org.apache.airavata.agent.TerminateAgentRequestH\x00\x12\x45\n\x0f\x65nvSetupRequest\x18\x04 \x01(\x0b\x32*.org.apache.airavata.agent.EnvSetupRequestH\x00\x12U\n\x17\x63ommandExecutionRequest\x18\x05 \x01(\x0b\x32\x32.org.apache.airavata.agent.CommandExecutionRequestH\x00\x12S\n\x16pythonExecutionRequest\x18\x06 \x01(\x0b\x32\x31.org.apache.airavata.agent.PythonExecutionRequestH\x00\x12U\n\x17jupyterExecutionRequest\x18\x07 \x01(\x0b\x32\x32.org.apache.airavata.agent.JupyterExecutionRequestH\x00\x12O\n\x14kernelRestartRequest\x18\x08 \x01(\x0b\x32/.org.apache.airavata.agent.KernelRestartRequestH\x00\x12Q\n\x15tunnelCreationRequest\x18\t \x01(\x0b\x32\x30.org.apache.airavata.agent.TunnelCreationRequestH\x00\x12W\n\x18tunnelTerminationRequest\x18\n \x01(\x0b\x32\x33.org.apache.airavata.agent.TunnelTerminationRequestH\x00\x12_\n\x1c\x61syncCommandExecutionRequest\x18\x0b \x01(\x0b\x32\x37.org.apache.airavata.agent.AsyncCommandExecutionRequestH\x00\x12U\n\x17\x61syncCommandListRequest\x18\x0c \x01(\x0b\x32\x32.org.apache.airavata.agent.AsyncCommandListRequestH\x00\x12_\n\x1c\x61syncCommandTerminateRequest\x18\r \x01(\x0b\x32\x37.org.apache.airavata.agent.AsyncCommandTerminateRequestH\x00\x42\t\n\x07message2\x86\x01\n\x19\x41gentCommunicationService\x12i\n\x10\x63reateMessageBus\x12\'.org.apache.airavata.agent.AgentMessage\x1a(.org.apache.airavata.agent.ServerMessage(\x01\x30\x01\x42?\n\x19org.apache.airavata.agentB\x17\x41gentCommunicationProtoP\x01Z\x07protos/b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"services/agent_communication.proto\x12\x19org.apache.airavata.agent\"\x1c\n\tAgentPing\x12\x0f\n\x07\x61gentId\x18\x01 \x01(\t\"\"\n\x0fShutdownRequest\x12\x0f\n\x07\x61gentId\x18\x01 \x01(\t\"s\n\x12\x43reateAgentRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x61gentId\x18\x02 \x01(\t\x12\x13\n\x0b\x63ontainerId\x18\x03 \x01(\t\x12\x12\n\nworkingDir\x18\x04 \x01(\t\x12\x0e\n\x06mounts\x18\x05 \x03(\t\"K\n\x13\x43reateAgentResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x61gentId\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\"=\n\x15TerminateAgentRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x61gentId\x18\x02 \x01(\t\"N\n\x16TerminateAgentResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x61gentId\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\"W\n\x0f\x45nvSetupRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x65nvName\x18\x02 \x01(\t\x12\x11\n\tlibraries\x18\x03 \x03(\t\x12\x0b\n\x03pip\x18\x04 \x03(\t\"7\n\x10\x45nvSetupResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"f\n\x17\x43ommandExecutionRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x65nvName\x18\x02 \x01(\t\x12\x12\n\nworkingDir\x18\x03 \x01(\t\x12\x11\n\targuments\x18\x04 \x03(\t\"G\n\x18\x43ommandExecutionResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x16\n\x0eresponseString\x18\x02 \x01(\t\"k\n\x1c\x41syncCommandExecutionRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x65nvName\x18\x02 \x01(\t\x12\x12\n\nworkingDir\x18\x03 \x01(\t\x12\x11\n\targuments\x18\x04 \x03(\t\"]\n\x1d\x41syncCommandExecutionResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x11\n\tprocessId\x18\x02 \x01(\x05\x12\x14\n\x0c\x65rrorMessage\x18\x03 \x01(\t\".\n\x17\x41syncCommandListRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\"4\n\x0c\x41syncCommand\x12\x11\n\tprocessId\x18\x01 \x01(\x05\x12\x11\n\targuments\x18\x04 \x03(\t\"j\n\x18\x41syncCommandListResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x39\n\x08\x63ommands\x18\x02 \x03(\x0b\x32\'.org.apache.airavata.agent.AsyncCommand\"F\n\x1c\x41syncCommandTerminateRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x11\n\tprocessId\x18\x02 \x01(\x05\"D\n\x1d\x41syncCommandTerminateResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"`\n\x16PythonExecutionRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x65nvName\x18\x02 \x01(\t\x12\x12\n\nworkingDir\x18\x03 \x01(\t\x12\x0c\n\x04\x63ode\x18\x04 \x01(\t\"F\n\x17PythonExecutionResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x16\n\x0eresponseString\x18\x02 \x01(\t\"M\n\x17JupyterExecutionRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x65nvName\x18\x02 \x01(\t\x12\x0c\n\x04\x63ode\x18\x03 \x01(\t\"G\n\x18JupyterExecutionResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x16\n\x0eresponseString\x18\x02 \x01(\t\"<\n\x14KernelRestartRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0f\n\x07\x65nvName\x18\x02 \x01(\t\"<\n\x15KernelRestartResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"\xc1\x01\n\x15TunnelCreationRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x11\n\tlocalPort\x18\x02 \x01(\x05\x12\x15\n\rlocalBindHost\x18\x03 \x01(\t\x12\x18\n\x10tunnelServerHost\x18\x04 \x01(\t\x12\x18\n\x10tunnelServerPort\x18\x05 \x01(\x05\x12\x1a\n\x12tunnelServerApiUrl\x18\x06 \x01(\t\x12\x19\n\x11tunnelServerToken\x18\x07 \x01(\t\"w\n\x16TunnelCreationResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x12\n\ntunnelHost\x18\x03 \x01(\t\x12\x12\n\ntunnelPort\x18\x04 \x01(\x05\x12\x10\n\x08tunnelId\x18\x05 \x01(\t\"A\n\x18TunnelTerminationRequest\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x10\n\x08tunnelId\x18\x02 \x01(\t\"@\n\x19TunnelTerminationResponse\x12\x13\n\x0b\x65xecutionId\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"\xec\x08\n\x0c\x41gentMessage\x12\x39\n\tagentPing\x18\x01 \x01(\x0b\x32$.org.apache.airavata.agent.AgentPingH\x00\x12M\n\x13\x63reateAgentResponse\x18\x02 \x01(\x0b\x32..org.apache.airavata.agent.CreateAgentResponseH\x00\x12S\n\x16terminateAgentResponse\x18\x03 \x01(\x0b\x32\x31.org.apache.airavata.agent.TerminateAgentResponseH\x00\x12G\n\x10\x65nvSetupResponse\x18\x04 \x01(\x0b\x32+.org.apache.airavata.agent.EnvSetupResponseH\x00\x12W\n\x18\x63ommandExecutionResponse\x18\x05 \x01(\x0b\x32\x33.org.apache.airavata.agent.CommandExecutionResponseH\x00\x12U\n\x17pythonExecutionResponse\x18\x06 \x01(\x0b\x32\x32.org.apache.airavata.agent.PythonExecutionResponseH\x00\x12W\n\x18jupyterExecutionResponse\x18\x07 \x01(\x0b\x32\x33.org.apache.airavata.agent.JupyterExecutionResponseH\x00\x12Q\n\x15kernelRestartResponse\x18\x08 \x01(\x0b\x32\x30.org.apache.airavata.agent.KernelRestartResponseH\x00\x12S\n\x16tunnelCreationResponse\x18\t \x01(\x0b\x32\x31.org.apache.airavata.agent.TunnelCreationResponseH\x00\x12Y\n\x19tunnelTerminationResponse\x18\n \x01(\x0b\x32\x34.org.apache.airavata.agent.TunnelTerminationResponseH\x00\x12\x61\n\x1d\x61syncCommandExecutionResponse\x18\x0b \x01(\x0b\x32\x38.org.apache.airavata.agent.AsyncCommandExecutionResponseH\x00\x12W\n\x18\x61syncCommandListResponse\x18\x0c \x01(\x0b\x32\x33.org.apache.airavata.agent.AsyncCommandListResponseH\x00\x12\x61\n\x1d\x61syncCommandTerminateResponse\x18\r \x01(\x0b\x32\x38.org.apache.airavata.agent.AsyncCommandTerminateResponseH\x00\x42\t\n\x07message\"\xe1\x08\n\rServerMessage\x12\x45\n\x0fshutdownRequest\x18\x01 \x01(\x0b\x32*.org.apache.airavata.agent.ShutdownRequestH\x00\x12K\n\x12\x63reateAgentRequest\x18\x02 \x01(\x0b\x32-.org.apache.airavata.agent.CreateAgentRequestH\x00\x12Q\n\x15terminateAgentRequest\x18\x03 \x01(\x0b\x32\x30.org.apache.airavata.agent.TerminateAgentRequestH\x00\x12\x45\n\x0f\x65nvSetupRequest\x18\x04 \x01(\x0b\x32*.org.apache.airavata.agent.EnvSetupRequestH\x00\x12U\n\x17\x63ommandExecutionRequest\x18\x05 \x01(\x0b\x32\x32.org.apache.airavata.agent.CommandExecutionRequestH\x00\x12S\n\x16pythonExecutionRequest\x18\x06 \x01(\x0b\x32\x31.org.apache.airavata.agent.PythonExecutionRequestH\x00\x12U\n\x17jupyterExecutionRequest\x18\x07 \x01(\x0b\x32\x32.org.apache.airavata.agent.JupyterExecutionRequestH\x00\x12O\n\x14kernelRestartRequest\x18\x08 \x01(\x0b\x32/.org.apache.airavata.agent.KernelRestartRequestH\x00\x12Q\n\x15tunnelCreationRequest\x18\t \x01(\x0b\x32\x30.org.apache.airavata.agent.TunnelCreationRequestH\x00\x12W\n\x18tunnelTerminationRequest\x18\n \x01(\x0b\x32\x33.org.apache.airavata.agent.TunnelTerminationRequestH\x00\x12_\n\x1c\x61syncCommandExecutionRequest\x18\x0b \x01(\x0b\x32\x37.org.apache.airavata.agent.AsyncCommandExecutionRequestH\x00\x12U\n\x17\x61syncCommandListRequest\x18\x0c \x01(\x0b\x32\x32.org.apache.airavata.agent.AsyncCommandListRequestH\x00\x12_\n\x1c\x61syncCommandTerminateRequest\x18\r \x01(\x0b\x32\x37.org.apache.airavata.agent.AsyncCommandTerminateRequestH\x00\x42\t\n\x07message2\x86\x01\n\x19\x41gentCommunicationService\x12i\n\x10\x63reateMessageBus\x12\'.org.apache.airavata.agent.AgentMessage\x1a(.org.apache.airavata.agent.ServerMessage(\x01\x30\x01\x42?\n\x19org.apache.airavata.agentB\x17\x41gentCommunicationProtoP\x01Z\x07protos/b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/agent_communication_pb2.pyi b/airavata-python-sdk/airavata/services/agent_communication_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/services/agent_communication_pb2.pyi rename to airavata-python-sdk/airavata/services/agent_communication_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/services/agent_communication_pb2_grpc.py b/airavata-python-sdk/airavata/services/agent_communication_pb2_grpc.py similarity index 97% rename from airavata-python-sdk/airavata_sdk/generated/services/agent_communication_pb2_grpc.py rename to airavata-python-sdk/airavata/services/agent_communication_pb2_grpc.py index aa1bbf73619..b3eb5458163 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/agent_communication_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/agent_communication_pb2_grpc.py @@ -3,7 +3,7 @@ import grpc import warnings -from services import agent_communication_pb2 as services_dot_agent__communication__pb2 +from airavata.services import agent_communication_pb2 as services_dot_agent__communication__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ diff --git a/airavata-python-sdk/airavata_sdk/generated/services/agent_service_pb2.py b/airavata-python-sdk/airavata/services/agent_service_pb2.py similarity index 99% rename from airavata-python-sdk/airavata_sdk/generated/services/agent_service_pb2.py rename to airavata-python-sdk/airavata/services/agent_service_pb2.py index 9003074bfaf..560a718622a 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/agent_service_pb2.py +++ b/airavata-python-sdk/airavata/services/agent_service_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE -# source: services/agent-service.proto +# source: services/agent_service.proto # Protobuf Python Version: 6.31.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor @@ -15,7 +15,7 @@ 31, 1, '', - 'services/agent-service.proto' + 'services/agent_service.proto' ) # @@protoc_insertion_point(imports) @@ -26,7 +26,7 @@ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cservices/agent-service.proto\x12!org.apache.airavata.agent.service\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\":\n\x11\x41gentInfoResponse\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x13\n\x0bis_agent_up\x18\x02 \x01(\x08\"8\n\x11\x41gentExecutionAck\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"Z\n\x14\x41gentEnvSetupRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nv_name\x18\x02 \x01(\t\x12\x11\n\tlibraries\x18\x03 \x03(\t\x12\x0b\n\x03pip\x18\x04 \x03(\t\"L\n\x15\x41gentEnvSetupResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\r\n\x05setup\x18\x02 \x01(\x08\x12\x0e\n\x06status\x18\x03 \x01(\t\"j\n\x1c\x41gentCommandExecutionRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nv_name\x18\x02 \x01(\t\x12\x13\n\x0bworking_dir\x18\x03 \x01(\t\x12\x11\n\targuments\x18\x04 \x03(\t\"`\n\x1d\x41gentCommandExecutionResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x10\n\x08\x65xecuted\x18\x02 \x01(\x08\x12\x17\n\x0fresponse_string\x18\x03 \x01(\t\"o\n!AgentAsyncCommandExecutionRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nv_name\x18\x02 \x01(\t\x12\x13\n\x0bworking_dir\x18\x03 \x01(\t\x12\x11\n\targuments\x18\x04 \x03(\t\"e\n\"AgentAsyncCommandExecutionResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x12\n\nprocess_id\x18\x02 \x01(\x05\x12\x15\n\rerror_message\x18\x03 \x01(\t\"0\n\x1c\x41gentAsyncCommandListRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\":\n\x11\x41gentAsyncCommand\x12\x12\n\nprocess_id\x18\x01 \x01(\x05\x12\x11\n\targuments\x18\x02 \x03(\t\"\x8c\x01\n\x1d\x41gentAsyncCommandListResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x46\n\x08\x63ommands\x18\x02 \x03(\x0b\x32\x34.org.apache.airavata.agent.service.AgentAsyncCommand\x12\r\n\x05\x65rror\x18\x03 \x01(\t\"I\n!AgentAsyncCommandTerminateRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x12\n\nprocess_id\x18\x02 \x01(\x05\"J\n\"AgentAsyncCommandTerminateResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"P\n\x1c\x41gentJupyterExecutionRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nv_name\x18\x02 \x01(\t\x12\x0c\n\x04\x63ode\x18\x03 \x01(\t\"`\n\x1d\x41gentJupyterExecutionResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x10\n\x08\x65xecuted\x18\x02 \x01(\x08\x12\x17\n\x0fresponse_string\x18\x03 \x01(\t\"d\n\x1b\x41gentPythonExecutionRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nv_name\x18\x02 \x01(\t\x12\x13\n\x0bworking_dir\x18\x03 \x01(\t\x12\x0c\n\x04\x63ode\x18\x04 \x01(\t\"_\n\x1c\x41gentPythonExecutionResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x10\n\x08\x65xecuted\x18\x02 \x01(\x08\x12\x17\n\x0fresponse_string\x18\x03 \x01(\t\"?\n\x19\x41gentKernelRestartRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nv_name\x18\x02 \x01(\t\"U\n\x1a\x41gentKernelRestartResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x11\n\trestarted\x18\x03 \x01(\x08\"Y\n\x18\x41gentTunnelCreateRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x12\n\nlocal_port\x18\x02 \x01(\x05\x12\x17\n\x0flocal_bind_host\x18\x03 \x01(\t\"E\n\x0e\x41gentTunnelAck\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\x05\x12\r\n\x05\x65rror\x18\x03 \x01(\t\"|\n\x19\x41gentTunnelCreateResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x11\n\ttunnel_id\x18\x02 \x01(\t\x12\x12\n\nproxy_port\x18\x03 \x01(\x05\x12\x12\n\nproxy_host\x18\x04 \x01(\t\x12\x0e\n\x06status\x18\x05 \x01(\t\"B\n\x1b\x41gentTunnelTerminateRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x11\n\ttunnel_id\x18\x02 \x01(\t\"\'\n\x13GetAgentInfoRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\"3\n\x1bGetExecutionResponseRequest\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\"D\n\x0fSavePlanRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12%\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"K\n\x11UpdatePlanRequest\x12\x0f\n\x07plan_id\x18\x01 \x01(\t\x12%\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"!\n\x0eGetPlanRequest\x12\x0f\n\x07plan_id\x18\x01 \x01(\t\"\x17\n\x15GetPlansByUserRequest\"W\n\x16GetPlansByUserResponse\x12=\n\x05plans\x18\x01 \x03(\x0b\x32..org.apache.airavata.agent.service.PlanMessage\"L\n\x0bPlanMessage\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\x12\x12\n\ngateway_id\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t2\x91\x1e\n\x17\x41gentInteractionService\x12\x9e\x01\n\x0cGetAgentInfo\x12\x36.org.apache.airavata.agent.service.GetAgentInfoRequest\x1a\x34.org.apache.airavata.agent.service.AgentInfoResponse\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/api/v1/agent/{agent_id}\x12\xa4\x01\n\x0bSetupTunnel\x12;.org.apache.airavata.agent.service.AgentTunnelCreateRequest\x1a\x31.org.apache.airavata.agent.service.AgentTunnelAck\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/api/v1/agent/setup/tunnel:\x01*\x12\xc4\x01\n\x11GetTunnelResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a<.org.apache.airavata.agent.service.AgentTunnelCreateResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/agent/setup/tunnel/{execution_id}\x12\xaf\x01\n\x0fTerminateTunnel\x12>.org.apache.airavata.agent.service.AgentTunnelTerminateRequest\x1a\x31.org.apache.airavata.agent.service.AgentTunnelAck\")\x82\xd3\xe4\x93\x02#\"\x1e/api/v1/agent/terminate/tunnel:\x01*\x12\x9d\x01\n\x08SetupEnv\x12\x37.org.apache.airavata.agent.service.AgentEnvSetupRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"\"\x82\xd3\xe4\x93\x02\x1c\"\x17/api/v1/agent/setup/env:\x01*\x12\xbf\x01\n\x13GetEnvSetupResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a\x38.org.apache.airavata.agent.service.AgentEnvSetupResponse\".\x82\xd3\xe4\x93\x02(\x12&/api/v1/agent/setup/env/{execution_id}\x12\xab\x01\n\rRestartKernel\x12<.org.apache.airavata.agent.service.AgentKernelRestartRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"&\x82\xd3\xe4\x93\x02 \"\x1b/api/v1/agent/setup/restart:\x01*\x12\xcd\x01\n\x18GetKernelRestartResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a=.org.apache.airavata.agent.service.AgentKernelRestartResponse\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/agent/setup/restart/{execution_id}\x12\xaf\x01\n\x0e\x45xecuteCommand\x12?.org.apache.airavata.agent.service.AgentCommandExecutionRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"&\x82\xd3\xe4\x93\x02 \"\x1b/api/v1/agent/execute/shell:\x01*\x12\xca\x01\n\x12GetCommandResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a@.org.apache.airavata.agent.service.AgentCommandExecutionResponse\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/agent/execute/shell/{execution_id}\x12\xbe\x01\n\x13\x45xecuteAsyncCommand\x12\x44.org.apache.airavata.agent.service.AgentAsyncCommandExecutionRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"+\x82\xd3\xe4\x93\x02%\" /api/v1/agent/execute/asyncshell:\x01*\x12\xd9\x01\n\x17GetAsyncCommandResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a\x45.org.apache.airavata.agent.service.AgentAsyncCommandExecutionResponse\"7\x82\xd3\xe4\x93\x02\x31\x12//api/v1/agent/execute/asyncshell/{execution_id}\x12\xb4\x01\n\x11ListAsyncCommands\x12?.org.apache.airavata.agent.service.AgentAsyncCommandListRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"(\x82\xd3\xe4\x93\x02\"\"\x1d/api/v1/agent/list/asyncshell:\x01*\x12\xd5\x01\n\x1bGetAsyncCommandListResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a@.org.apache.airavata.agent.service.AgentAsyncCommandListResponse\"4\x82\xd3\xe4\x93\x02.\x12,/api/v1/agent/list/asyncshell/{execution_id}\x12\xc2\x01\n\x15TerminateAsyncCommand\x12\x44.org.apache.airavata.agent.service.AgentAsyncCommandTerminateRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"-\x82\xd3\xe4\x93\x02\'\"\"/api/v1/agent/terminate/asyncshell:\x01*\x12\xe4\x01\n GetAsyncCommandTerminateResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a\x45.org.apache.airavata.agent.service.AgentAsyncCommandTerminateResponse\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/api/v1/agent/terminate/asyncshell/{execution_id}\x12\xb1\x01\n\x0e\x45xecuteJupyter\x12?.org.apache.airavata.agent.service.AgentJupyterExecutionRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"(\x82\xd3\xe4\x93\x02\"\"\x1d/api/v1/agent/execute/jupyter:\x01*\x12\xcc\x01\n\x12GetJupyterResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a@.org.apache.airavata.agent.service.AgentJupyterExecutionResponse\"4\x82\xd3\xe4\x93\x02.\x12,/api/v1/agent/execute/jupyter/{execution_id}\x12\xae\x01\n\rExecutePython\x12>.org.apache.airavata.agent.service.AgentPythonExecutionRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"\'\x82\xd3\xe4\x93\x02!\"\x1c/api/v1/agent/execute/python:\x01*\x12\xc9\x01\n\x11GetPythonResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a?.org.apache.airavata.agent.service.AgentPythonExecutionResponse\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/agent/execute/python/{execution_id}2\xe1\x04\n\x0bPlanService\x12\x87\x01\n\x08SavePlan\x12\x32.org.apache.airavata.agent.service.SavePlanRequest\x1a..org.apache.airavata.agent.service.PlanMessage\"\x17\x82\xd3\xe4\x93\x02\x11\"\x0c/api/v1/plan:\x01*\x12\xa0\x01\n\x0eGetPlansByUser\x12\x38.org.apache.airavata.agent.service.GetPlansByUserRequest\x1a\x39.org.apache.airavata.agent.service.GetPlansByUserResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/api/v1/plan/user\x12\x8c\x01\n\x07GetPlan\x12\x31.org.apache.airavata.agent.service.GetPlanRequest\x1a..org.apache.airavata.agent.service.PlanMessage\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/api/v1/plan/{plan_id}\x12\x95\x01\n\nUpdatePlan\x12\x34.org.apache.airavata.agent.service.UpdatePlanRequest\x1a..org.apache.airavata.agent.service.PlanMessage\"!\x82\xd3\xe4\x93\x02\x1b\x1a\x16/api/v1/plan/{plan_id}:\x01*B8\n!org.apache.airavata.agent.serviceB\x11\x41gentServiceProtoP\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cservices/agent_service.proto\x12!org.apache.airavata.agent.service\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\":\n\x11\x41gentInfoResponse\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x13\n\x0bis_agent_up\x18\x02 \x01(\x08\"8\n\x11\x41gentExecutionAck\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"Z\n\x14\x41gentEnvSetupRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nv_name\x18\x02 \x01(\t\x12\x11\n\tlibraries\x18\x03 \x03(\t\x12\x0b\n\x03pip\x18\x04 \x03(\t\"L\n\x15\x41gentEnvSetupResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\r\n\x05setup\x18\x02 \x01(\x08\x12\x0e\n\x06status\x18\x03 \x01(\t\"j\n\x1c\x41gentCommandExecutionRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nv_name\x18\x02 \x01(\t\x12\x13\n\x0bworking_dir\x18\x03 \x01(\t\x12\x11\n\targuments\x18\x04 \x03(\t\"`\n\x1d\x41gentCommandExecutionResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x10\n\x08\x65xecuted\x18\x02 \x01(\x08\x12\x17\n\x0fresponse_string\x18\x03 \x01(\t\"o\n!AgentAsyncCommandExecutionRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nv_name\x18\x02 \x01(\t\x12\x13\n\x0bworking_dir\x18\x03 \x01(\t\x12\x11\n\targuments\x18\x04 \x03(\t\"e\n\"AgentAsyncCommandExecutionResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x12\n\nprocess_id\x18\x02 \x01(\x05\x12\x15\n\rerror_message\x18\x03 \x01(\t\"0\n\x1c\x41gentAsyncCommandListRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\":\n\x11\x41gentAsyncCommand\x12\x12\n\nprocess_id\x18\x01 \x01(\x05\x12\x11\n\targuments\x18\x02 \x03(\t\"\x8c\x01\n\x1d\x41gentAsyncCommandListResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x46\n\x08\x63ommands\x18\x02 \x03(\x0b\x32\x34.org.apache.airavata.agent.service.AgentAsyncCommand\x12\r\n\x05\x65rror\x18\x03 \x01(\t\"I\n!AgentAsyncCommandTerminateRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x12\n\nprocess_id\x18\x02 \x01(\x05\"J\n\"AgentAsyncCommandTerminateResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"P\n\x1c\x41gentJupyterExecutionRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nv_name\x18\x02 \x01(\t\x12\x0c\n\x04\x63ode\x18\x03 \x01(\t\"`\n\x1d\x41gentJupyterExecutionResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x10\n\x08\x65xecuted\x18\x02 \x01(\x08\x12\x17\n\x0fresponse_string\x18\x03 \x01(\t\"d\n\x1b\x41gentPythonExecutionRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nv_name\x18\x02 \x01(\t\x12\x13\n\x0bworking_dir\x18\x03 \x01(\t\x12\x0c\n\x04\x63ode\x18\x04 \x01(\t\"_\n\x1c\x41gentPythonExecutionResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x10\n\x08\x65xecuted\x18\x02 \x01(\x08\x12\x17\n\x0fresponse_string\x18\x03 \x01(\t\"?\n\x19\x41gentKernelRestartRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x10\n\x08\x65nv_name\x18\x02 \x01(\t\"U\n\x1a\x41gentKernelRestartResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x11\n\trestarted\x18\x03 \x01(\x08\"Y\n\x18\x41gentTunnelCreateRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x12\n\nlocal_port\x18\x02 \x01(\x05\x12\x17\n\x0flocal_bind_host\x18\x03 \x01(\t\"E\n\x0e\x41gentTunnelAck\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\x05\x12\r\n\x05\x65rror\x18\x03 \x01(\t\"|\n\x19\x41gentTunnelCreateResponse\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\x12\x11\n\ttunnel_id\x18\x02 \x01(\t\x12\x12\n\nproxy_port\x18\x03 \x01(\x05\x12\x12\n\nproxy_host\x18\x04 \x01(\t\x12\x0e\n\x06status\x18\x05 \x01(\t\"B\n\x1b\x41gentTunnelTerminateRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\x12\x11\n\ttunnel_id\x18\x02 \x01(\t\"\'\n\x13GetAgentInfoRequest\x12\x10\n\x08\x61gent_id\x18\x01 \x01(\t\"3\n\x1bGetExecutionResponseRequest\x12\x14\n\x0c\x65xecution_id\x18\x01 \x01(\t\"D\n\x0fSavePlanRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12%\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"K\n\x11UpdatePlanRequest\x12\x0f\n\x07plan_id\x18\x01 \x01(\t\x12%\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"!\n\x0eGetPlanRequest\x12\x0f\n\x07plan_id\x18\x01 \x01(\t\"\x17\n\x15GetPlansByUserRequest\"W\n\x16GetPlansByUserResponse\x12=\n\x05plans\x18\x01 \x03(\x0b\x32..org.apache.airavata.agent.service.PlanMessage\"L\n\x0bPlanMessage\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\x12\x12\n\ngateway_id\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t2\x91\x1e\n\x17\x41gentInteractionService\x12\x9e\x01\n\x0cGetAgentInfo\x12\x36.org.apache.airavata.agent.service.GetAgentInfoRequest\x1a\x34.org.apache.airavata.agent.service.AgentInfoResponse\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/api/v1/agent/{agent_id}\x12\xa4\x01\n\x0bSetupTunnel\x12;.org.apache.airavata.agent.service.AgentTunnelCreateRequest\x1a\x31.org.apache.airavata.agent.service.AgentTunnelAck\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/api/v1/agent/setup/tunnel:\x01*\x12\xc4\x01\n\x11GetTunnelResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a<.org.apache.airavata.agent.service.AgentTunnelCreateResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/agent/setup/tunnel/{execution_id}\x12\xaf\x01\n\x0fTerminateTunnel\x12>.org.apache.airavata.agent.service.AgentTunnelTerminateRequest\x1a\x31.org.apache.airavata.agent.service.AgentTunnelAck\")\x82\xd3\xe4\x93\x02#\"\x1e/api/v1/agent/terminate/tunnel:\x01*\x12\x9d\x01\n\x08SetupEnv\x12\x37.org.apache.airavata.agent.service.AgentEnvSetupRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"\"\x82\xd3\xe4\x93\x02\x1c\"\x17/api/v1/agent/setup/env:\x01*\x12\xbf\x01\n\x13GetEnvSetupResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a\x38.org.apache.airavata.agent.service.AgentEnvSetupResponse\".\x82\xd3\xe4\x93\x02(\x12&/api/v1/agent/setup/env/{execution_id}\x12\xab\x01\n\rRestartKernel\x12<.org.apache.airavata.agent.service.AgentKernelRestartRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"&\x82\xd3\xe4\x93\x02 \"\x1b/api/v1/agent/setup/restart:\x01*\x12\xcd\x01\n\x18GetKernelRestartResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a=.org.apache.airavata.agent.service.AgentKernelRestartResponse\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/agent/setup/restart/{execution_id}\x12\xaf\x01\n\x0e\x45xecuteCommand\x12?.org.apache.airavata.agent.service.AgentCommandExecutionRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"&\x82\xd3\xe4\x93\x02 \"\x1b/api/v1/agent/execute/shell:\x01*\x12\xca\x01\n\x12GetCommandResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a@.org.apache.airavata.agent.service.AgentCommandExecutionResponse\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/agent/execute/shell/{execution_id}\x12\xbe\x01\n\x13\x45xecuteAsyncCommand\x12\x44.org.apache.airavata.agent.service.AgentAsyncCommandExecutionRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"+\x82\xd3\xe4\x93\x02%\" /api/v1/agent/execute/asyncshell:\x01*\x12\xd9\x01\n\x17GetAsyncCommandResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a\x45.org.apache.airavata.agent.service.AgentAsyncCommandExecutionResponse\"7\x82\xd3\xe4\x93\x02\x31\x12//api/v1/agent/execute/asyncshell/{execution_id}\x12\xb4\x01\n\x11ListAsyncCommands\x12?.org.apache.airavata.agent.service.AgentAsyncCommandListRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"(\x82\xd3\xe4\x93\x02\"\"\x1d/api/v1/agent/list/asyncshell:\x01*\x12\xd5\x01\n\x1bGetAsyncCommandListResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a@.org.apache.airavata.agent.service.AgentAsyncCommandListResponse\"4\x82\xd3\xe4\x93\x02.\x12,/api/v1/agent/list/asyncshell/{execution_id}\x12\xc2\x01\n\x15TerminateAsyncCommand\x12\x44.org.apache.airavata.agent.service.AgentAsyncCommandTerminateRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"-\x82\xd3\xe4\x93\x02\'\"\"/api/v1/agent/terminate/asyncshell:\x01*\x12\xe4\x01\n GetAsyncCommandTerminateResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a\x45.org.apache.airavata.agent.service.AgentAsyncCommandTerminateResponse\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/api/v1/agent/terminate/asyncshell/{execution_id}\x12\xb1\x01\n\x0e\x45xecuteJupyter\x12?.org.apache.airavata.agent.service.AgentJupyterExecutionRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"(\x82\xd3\xe4\x93\x02\"\"\x1d/api/v1/agent/execute/jupyter:\x01*\x12\xcc\x01\n\x12GetJupyterResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a@.org.apache.airavata.agent.service.AgentJupyterExecutionResponse\"4\x82\xd3\xe4\x93\x02.\x12,/api/v1/agent/execute/jupyter/{execution_id}\x12\xae\x01\n\rExecutePython\x12>.org.apache.airavata.agent.service.AgentPythonExecutionRequest\x1a\x34.org.apache.airavata.agent.service.AgentExecutionAck\"\'\x82\xd3\xe4\x93\x02!\"\x1c/api/v1/agent/execute/python:\x01*\x12\xc9\x01\n\x11GetPythonResponse\x12>.org.apache.airavata.agent.service.GetExecutionResponseRequest\x1a?.org.apache.airavata.agent.service.AgentPythonExecutionResponse\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/agent/execute/python/{execution_id}2\xe1\x04\n\x0bPlanService\x12\x87\x01\n\x08SavePlan\x12\x32.org.apache.airavata.agent.service.SavePlanRequest\x1a..org.apache.airavata.agent.service.PlanMessage\"\x17\x82\xd3\xe4\x93\x02\x11\"\x0c/api/v1/plan:\x01*\x12\xa0\x01\n\x0eGetPlansByUser\x12\x38.org.apache.airavata.agent.service.GetPlansByUserRequest\x1a\x39.org.apache.airavata.agent.service.GetPlansByUserResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/api/v1/plan/user\x12\x8c\x01\n\x07GetPlan\x12\x31.org.apache.airavata.agent.service.GetPlanRequest\x1a..org.apache.airavata.agent.service.PlanMessage\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/api/v1/plan/{plan_id}\x12\x95\x01\n\nUpdatePlan\x12\x34.org.apache.airavata.agent.service.UpdatePlanRequest\x1a..org.apache.airavata.agent.service.PlanMessage\"!\x82\xd3\xe4\x93\x02\x1b\x1a\x16/api/v1/plan/{plan_id}:\x01*B8\n!org.apache.airavata.agent.serviceB\x11\x41gentServiceProtoP\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/agent_service_pb2.pyi b/airavata-python-sdk/airavata/services/agent_service_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/services/agent_service_pb2.pyi rename to airavata-python-sdk/airavata/services/agent_service_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/services/agent_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/agent_service_pb2_grpc.py similarity index 99% rename from airavata-python-sdk/airavata_sdk/generated/services/agent_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/agent_service_pb2_grpc.py index c6a8ab8cf46..caef603e9d9 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/agent_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/agent_service_pb2_grpc.py @@ -3,7 +3,7 @@ import grpc import warnings -from services import agent_service_pb2 as services_dot_agent__service__pb2 +from airavata.services import agent_service_pb2 as services_dot_agent__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ diff --git a/airavata-python-sdk/airavata/services/application_catalog_service_pb2.py b/airavata-python-sdk/airavata/services/application_catalog_service_pb2.py new file mode 100644 index 00000000000..18ab5d326ac --- /dev/null +++ b/airavata-python-sdk/airavata/services/application_catalog_service_pb2.py @@ -0,0 +1,214 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/application_catalog_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/application_catalog_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.appcatalog.appdeployment import app_deployment_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appdeployment_dot_app__deployment__pb2 +from airavata.model.appcatalog.appinterface import app_interface_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appinterface_dot_app__interface__pb2 +from airavata.model.appcatalog.computeresource import compute_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2 +from airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 +from airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*services/application_catalog_service.proto\x12\"org.apache.airavata.api.appcatalog\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1aGorg/apache/airavata/model/appcatalog/appdeployment/app_deployment.proto\x1a\x45org/apache/airavata/model/appcatalog/appinterface/app_interface.proto\x1aKorg/apache/airavata/model/appcatalog/computeresource/compute_resource.proto\x1a=org/apache/airavata/model/application/io/application_io.proto\x1a/org/apache/airavata/model/commons/commons.proto\"\x99\x01\n RegisterApplicationModuleRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x61\n\x12\x61pplication_module\x18\x02 \x01(\x0b\x32\x45.org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule\":\n!RegisterApplicationModuleResponse\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\"4\n\x1bGetApplicationModuleRequest\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\"\x9a\x01\n\x1eUpdateApplicationModuleRequest\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\x12\x61\n\x12\x61pplication_module\x18\x02 \x01(\x0b\x32\x45.org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule\"7\n\x1e\x44\x65leteApplicationModuleRequest\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\"-\n\x17GetAllAppModulesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"~\n\x18GetAllAppModulesResponse\x12\x62\n\x13\x61pplication_modules\x18\x01 \x03(\x0b\x32\x45.org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule\"\xc0\x01\n\x1b\x41pplicationModuleWithAccess\x12\x61\n\x12\x61pplication_module\x18\x01 \x01(\x0b\x32\x45.org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule\x12>\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32..org.apache.airavata.model.commons.AccessFlags\"~\n*GetAllApplicationModulesWithAccessResponse\x12P\n\x07modules\x18\x01 \x03(\x0b\x32?.org.apache.airavata.api.appcatalog.ApplicationModuleWithAccess\"\x85\x01\n1GetAccessibleApplicationModulesWithAccessResponse\x12P\n\x07modules\x18\x01 \x03(\x0b\x32?.org.apache.airavata.api.appcatalog.ApplicationModuleWithAccess\"4\n\x1eGetAccessibleAppModulesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\x85\x01\n\x1fGetAccessibleAppModulesResponse\x12\x62\n\x13\x61pplication_modules\x18\x01 \x03(\x0b\x32\x45.org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule\"\xb0\x01\n$RegisterApplicationDeploymentRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12t\n\x16\x61pplication_deployment\x18\x02 \x01(\x0b\x32T.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\"B\n%RegisterApplicationDeploymentResponse\x12\x19\n\x11\x61pp_deployment_id\x18\x01 \x01(\t\"<\n\x1fGetApplicationDeploymentRequest\x12\x19\n\x11\x61pp_deployment_id\x18\x01 \x01(\t\"\xd7\x01\n\x1f\x41pplicationDeploymentWithAccess\x12t\n\x16\x61pplication_deployment\x18\x01 \x01(\x0b\x32T.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\x12>\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32..org.apache.airavata.model.commons.AccessFlags\"z\n&GetApplicationDeploymentQueuesResponse\x12P\n\x06queues\x18\x01 \x03(\x0b\x32@.org.apache.airavata.model.appcatalog.computeresource.BatchQueue\"\xb5\x01\n\"UpdateApplicationDeploymentRequest\x12\x19\n\x11\x61pp_deployment_id\x18\x01 \x01(\t\x12t\n\x16\x61pplication_deployment\x18\x02 \x01(\x0b\x32T.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\"?\n\"DeleteApplicationDeploymentRequest\x12\x19\n\x11\x61pp_deployment_id\x18\x01 \x01(\t\"9\n#GetAllApplicationDeploymentsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\x9d\x01\n$GetAllApplicationDeploymentsResponse\x12u\n\x17\x61pplication_deployments\x18\x01 \x03(\x0b\x32T.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\"\x8a\x01\n.GetAllApplicationDeploymentsWithAccessResponse\x12X\n\x0b\x64\x65ployments\x18\x01 \x03(\x0b\x32\x43.org.apache.airavata.api.appcatalog.ApplicationDeploymentWithAccess\"@\n*GetAccessibleApplicationDeploymentsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\xa4\x01\n+GetAccessibleApplicationDeploymentsResponse\x12u\n\x17\x61pplication_deployments\x18\x01 \x03(\x0b\x32T.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\"\x91\x01\n5GetAccessibleApplicationDeploymentsWithAccessResponse\x12X\n\x0b\x64\x65ployments\x18\x01 \x03(\x0b\x32\x43.org.apache.airavata.api.appcatalog.ApplicationDeploymentWithAccess\"=\n$GetAppModuleDeployedResourcesRequest\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\"E\n%GetAppModuleDeployedResourcesResponse\x12\x1c\n\x14\x63ompute_resource_ids\x18\x01 \x03(\t\"d\n(GetDeploymentsForModuleAndProfileRequest\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x02 \x01(\t\"\xa2\x01\n)GetDeploymentsForModuleAndProfileResponse\x12u\n\x17\x61pplication_deployments\x18\x01 \x03(\x0b\x32T.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\"\xac\x01\n#RegisterApplicationInterfaceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12q\n\x15\x61pplication_interface\x18\x02 \x01(\x0b\x32R.org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription\"@\n$RegisterApplicationInterfaceResponse\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\"n\n CloneApplicationInterfaceRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\x12\x1c\n\x14new_application_name\x18\x02 \x01(\t\x12\x12\n\ngateway_id\x18\x03 \x01(\t\"=\n!CloneApplicationInterfaceResponse\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\":\n\x1eGetApplicationInterfaceRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\"\xb0\x01\n!UpdateApplicationInterfaceRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\x12q\n\x15\x61pplication_interface\x18\x02 \x01(\x0b\x32R.org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription\"=\n!DeleteApplicationInterfaceRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\"<\n&GetAllApplicationInterfaceNamesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\xfd\x01\n\'GetAllApplicationInterfaceNamesResponse\x12\x8f\x01\n\x1b\x61pplication_interface_names\x18\x01 \x03(\x0b\x32j.org.apache.airavata.api.appcatalog.GetAllApplicationInterfaceNamesResponse.ApplicationInterfaceNamesEntry\x1a@\n\x1e\x41pplicationInterfaceNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"8\n\"GetAllApplicationInterfacesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\x99\x01\n#GetAllApplicationInterfacesResponse\x12r\n\x16\x61pplication_interfaces\x18\x01 \x03(\x0b\x32R.org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription\"\xd3\x01\n\x1e\x41pplicationInterfaceWithAccess\x12q\n\x15\x61pplication_interface\x18\x01 \x01(\x0b\x32R.org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription\x12>\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32..org.apache.airavata.model.commons.AccessFlags\"\x87\x01\n-GetAllApplicationInterfacesWithAccessResponse\x12V\n\ninterfaces\x18\x01 \x03(\x0b\x32\x42.org.apache.airavata.api.appcatalog.ApplicationInterfaceWithAccess\"7\n\x1bGetApplicationInputsRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\"y\n\x1cGetApplicationInputsResponse\x12Y\n\x12\x61pplication_inputs\x18\x01 \x03(\x0b\x32=.org.apache.airavata.model.application.io.InputDataObjectType\"8\n\x1cGetApplicationOutputsRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\"|\n\x1dGetApplicationOutputsResponse\x12[\n\x13\x61pplication_outputs\x18\x01 \x03(\x0b\x32>.org.apache.airavata.model.application.io.OutputDataObjectType\"?\n#GetAvailableComputeResourcesRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\"\xe8\x01\n$GetAvailableComputeResourcesResponse\x12\x82\x01\n\x16\x63ompute_resource_names\x18\x01 \x03(\x0b\x32\x62.org.apache.airavata.api.appcatalog.GetAvailableComputeResourcesResponse.ComputeResourceNamesEntry\x1a;\n\x19\x43omputeResourceNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x32\xe2\x39\n\x19\x41pplicationCatalogService\x12\xd9\x01\n\x19RegisterApplicationModule\x12\x44.org.apache.airavata.api.appcatalog.RegisterApplicationModuleRequest\x1a\x45.org.apache.airavata.api.appcatalog.RegisterApplicationModuleResponse\"/\x82\xd3\xe4\x93\x02)\"\x13/api/v1/app-modules:\x12\x61pplication_module\x12\xcb\x01\n\x14GetApplicationModule\x12?.org.apache.airavata.api.appcatalog.GetApplicationModuleRequest\x1a\x45.org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/app-modules/{app_module_id}\x12\xda\x01\n\x1eGetApplicationModuleWithAccess\x12?.org.apache.airavata.api.appcatalog.GetApplicationModuleRequest\x1a?.org.apache.airavata.api.appcatalog.ApplicationModuleWithAccess\"6\x82\xd3\xe4\x93\x02\x30\x12./api/v1/app-modules/{app_module_id}:withAccess\x12\xb6\x01\n\x17UpdateApplicationModule\x12\x42.org.apache.airavata.api.appcatalog.UpdateApplicationModuleRequest\x1a\x16.google.protobuf.Empty\"?\x82\xd3\xe4\x93\x02\x39\x1a#/api/v1/app-modules/{app_module_id}:\x12\x61pplication_module\x12\xa2\x01\n\x17\x44\x65leteApplicationModule\x12\x42.org.apache.airavata.api.appcatalog.DeleteApplicationModuleRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%*#/api/v1/app-modules/{app_module_id}\x12\xaa\x01\n\x10GetAllAppModules\x12;.org.apache.airavata.api.appcatalog.GetAllAppModulesRequest\x1a<.org.apache.airavata.api.appcatalog.GetAllAppModulesResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/api/v1/app-modules\x12\xd9\x01\n\"GetAllApplicationModulesWithAccess\x12;.org.apache.airavata.api.appcatalog.GetAllAppModulesRequest\x1aN.org.apache.airavata.api.appcatalog.GetAllApplicationModulesWithAccessResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/app-modules:withAccess\x12\xca\x01\n\x17GetAccessibleAppModules\x12\x42.org.apache.airavata.api.appcatalog.GetAccessibleAppModulesRequest\x1a\x43.org.apache.airavata.api.appcatalog.GetAccessibleAppModulesResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/app-modules:accessible\x12\xf8\x01\n)GetAccessibleApplicationModulesWithAccess\x12\x42.org.apache.airavata.api.appcatalog.GetAccessibleAppModulesRequest\x1aU.org.apache.airavata.api.appcatalog.GetAccessibleApplicationModulesWithAccessResponse\"0\x82\xd3\xe4\x93\x02*\x12(/api/v1/app-modules:accessibleWithAccess\x12\xed\x01\n\x1dRegisterApplicationDeployment\x12H.org.apache.airavata.api.appcatalog.RegisterApplicationDeploymentRequest\x1aI.org.apache.airavata.api.appcatalog.RegisterApplicationDeploymentResponse\"7\x82\xd3\xe4\x93\x02\x31\"\x17/api/v1/app-deployments:\x16\x61pplication_deployment\x12\xea\x01\n\x18GetApplicationDeployment\x12\x43.org.apache.airavata.api.appcatalog.GetApplicationDeploymentRequest\x1aT.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/app-deployments/{app_deployment_id}\x12\xee\x01\n\"GetApplicationDeploymentWithAccess\x12\x43.org.apache.airavata.api.appcatalog.GetApplicationDeploymentRequest\x1a\x43.org.apache.airavata.api.appcatalog.ApplicationDeploymentWithAccess\">\x82\xd3\xe4\x93\x02\x38\x12\x36/api/v1/app-deployments/{app_deployment_id}:withAccess\x12\xed\x01\n\x1eGetApplicationDeploymentQueues\x12\x43.org.apache.airavata.api.appcatalog.GetApplicationDeploymentRequest\x1aJ.org.apache.airavata.api.appcatalog.GetApplicationDeploymentQueuesResponse\":\x82\xd3\xe4\x93\x02\x34\x12\x32/api/v1/app-deployments/{app_deployment_id}/queues\x12\xca\x01\n\x1bUpdateApplicationDeployment\x12\x46.org.apache.airavata.api.appcatalog.UpdateApplicationDeploymentRequest\x1a\x16.google.protobuf.Empty\"K\x82\xd3\xe4\x93\x02\x45\x1a+/api/v1/app-deployments/{app_deployment_id}:\x16\x61pplication_deployment\x12\xb2\x01\n\x1b\x44\x65leteApplicationDeployment\x12\x46.org.apache.airavata.api.appcatalog.DeleteApplicationDeploymentRequest\x1a\x16.google.protobuf.Empty\"3\x82\xd3\xe4\x93\x02-*+/api/v1/app-deployments/{app_deployment_id}\x12\xd2\x01\n\x1cGetAllApplicationDeployments\x12G.org.apache.airavata.api.appcatalog.GetAllApplicationDeploymentsRequest\x1aH.org.apache.airavata.api.appcatalog.GetAllApplicationDeploymentsResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/api/v1/app-deployments\x12\xf1\x01\n&GetAllApplicationDeploymentsWithAccess\x12G.org.apache.airavata.api.appcatalog.GetAllApplicationDeploymentsRequest\x1aR.org.apache.airavata.api.appcatalog.GetAllApplicationDeploymentsWithAccessResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/api/v1/app-deployments:withAccess\x12\xf2\x01\n#GetAccessibleApplicationDeployments\x12N.org.apache.airavata.api.appcatalog.GetAccessibleApplicationDeploymentsRequest\x1aO.org.apache.airavata.api.appcatalog.GetAccessibleApplicationDeploymentsResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/api/v1/app-deployments:accessible\x12\x90\x02\n-GetAccessibleApplicationDeploymentsWithAccess\x12N.org.apache.airavata.api.appcatalog.GetAccessibleApplicationDeploymentsRequest\x1aY.org.apache.airavata.api.appcatalog.GetAccessibleApplicationDeploymentsWithAccessResponse\"4\x82\xd3\xe4\x93\x02.\x12,/api/v1/app-deployments:accessibleWithAccess\x12\xf4\x01\n\x1dGetAppModuleDeployedResources\x12H.org.apache.airavata.api.appcatalog.GetAppModuleDeployedResourcesRequest\x1aI.org.apache.airavata.api.appcatalog.GetAppModuleDeployedResourcesResponse\">\x82\xd3\xe4\x93\x02\x38\x12\x36/api/v1/app-modules/{app_module_id}/deployed-resources\x12\x9e\x02\n!GetDeploymentsForModuleAndProfile\x12L.org.apache.airavata.api.appcatalog.GetDeploymentsForModuleAndProfileRequest\x1aM.org.apache.airavata.api.appcatalog.GetDeploymentsForModuleAndProfileResponse\"\\\x82\xd3\xe4\x93\x02V\x12T/api/v1/app-modules/{app_module_id}/profiles/{group_resource_profile_id}/deployments\x12\xe8\x01\n\x1cRegisterApplicationInterface\x12G.org.apache.airavata.api.appcatalog.RegisterApplicationInterfaceRequest\x1aH.org.apache.airavata.api.appcatalog.RegisterApplicationInterfaceResponse\"5\x82\xd3\xe4\x93\x02/\"\x16/api/v1/app-interfaces:\x15\x61pplication_interface\x12\xe1\x01\n\x19\x43loneApplicationInterface\x12\x44.org.apache.airavata.api.appcatalog.CloneApplicationInterfaceRequest\x1a\x45.org.apache.airavata.api.appcatalog.CloneApplicationInterfaceResponse\"7\x82\xd3\xe4\x93\x02\x31\"//api/v1/app-interfaces/{app_interface_id}:clone\x12\xe4\x01\n\x17GetApplicationInterface\x12\x42.org.apache.airavata.api.appcatalog.GetApplicationInterfaceRequest\x1aR.org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/app-interfaces/{app_interface_id}\x12\xe9\x01\n!GetApplicationInterfaceWithAccess\x12\x42.org.apache.airavata.api.appcatalog.GetApplicationInterfaceRequest\x1a\x42.org.apache.airavata.api.appcatalog.ApplicationInterfaceWithAccess\"<\x82\xd3\xe4\x93\x02\x36\x12\x34/api/v1/app-interfaces/{app_interface_id}:withAccess\x12\xc5\x01\n\x1aUpdateApplicationInterface\x12\x45.org.apache.airavata.api.appcatalog.UpdateApplicationInterfaceRequest\x1a\x16.google.protobuf.Empty\"H\x82\xd3\xe4\x93\x02\x42\x1a)/api/v1/app-interfaces/{app_interface_id}:\x15\x61pplication_interface\x12\xae\x01\n\x1a\x44\x65leteApplicationInterface\x12\x45.org.apache.airavata.api.appcatalog.DeleteApplicationInterfaceRequest\x1a\x16.google.protobuf.Empty\"1\x82\xd3\xe4\x93\x02+*)/api/v1/app-interfaces/{app_interface_id}\x12\xe0\x01\n\x1fGetAllApplicationInterfaceNames\x12J.org.apache.airavata.api.appcatalog.GetAllApplicationInterfaceNamesRequest\x1aK.org.apache.airavata.api.appcatalog.GetAllApplicationInterfaceNamesResponse\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/api/v1/app-interfaces:names\x12\xce\x01\n\x1bGetAllApplicationInterfaces\x12\x46.org.apache.airavata.api.appcatalog.GetAllApplicationInterfacesRequest\x1aG.org.apache.airavata.api.appcatalog.GetAllApplicationInterfacesResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/api/v1/app-interfaces\x12\xed\x01\n%GetAllApplicationInterfacesWithAccess\x12\x46.org.apache.airavata.api.appcatalog.GetAllApplicationInterfacesRequest\x1aQ.org.apache.airavata.api.appcatalog.GetAllApplicationInterfacesWithAccessResponse\")\x82\xd3\xe4\x93\x02#\x12!/api/v1/app-interfaces:withAccess\x12\xd3\x01\n\x14GetApplicationInputs\x12?.org.apache.airavata.api.appcatalog.GetApplicationInputsRequest\x1a@.org.apache.airavata.api.appcatalog.GetApplicationInputsResponse\"8\x82\xd3\xe4\x93\x02\x32\x12\x30/api/v1/app-interfaces/{app_interface_id}/inputs\x12\xd7\x01\n\x15GetApplicationOutputs\x12@.org.apache.airavata.api.appcatalog.GetApplicationOutputsRequest\x1a\x41.org.apache.airavata.api.appcatalog.GetApplicationOutputsResponse\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/api/v1/app-interfaces/{app_interface_id}/outputs\x12\xf6\x01\n\x1cGetAvailableComputeResources\x12G.org.apache.airavata.api.appcatalog.GetAvailableComputeResourcesRequest\x1aH.org.apache.airavata.api.appcatalog.GetAvailableComputeResourcesResponse\"C\x82\xd3\xe4\x93\x02=\x12;/api/v1/app-interfaces/{app_interface_id}/compute-resourcesB&\n\"org.apache.airavata.api.appcatalogP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.application_catalog_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\"org.apache.airavata.api.appcatalogP\001' + _globals['_GETALLAPPLICATIONINTERFACENAMESRESPONSE_APPLICATIONINTERFACENAMESENTRY']._loaded_options = None + _globals['_GETALLAPPLICATIONINTERFACENAMESRESPONSE_APPLICATIONINTERFACENAMESENTRY']._serialized_options = b'8\001' + _globals['_GETAVAILABLECOMPUTERESOURCESRESPONSE_COMPUTERESOURCENAMESENTRY']._loaded_options = None + _globals['_GETAVAILABLECOMPUTERESOURCESRESPONSE_COMPUTERESOURCENAMESENTRY']._serialized_options = b'8\001' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['RegisterApplicationModule']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['RegisterApplicationModule']._serialized_options = b'\202\323\344\223\002)\"\023/api/v1/app-modules:\022application_module' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationModule']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationModule']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/app-modules/{app_module_id}' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationModuleWithAccess']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationModuleWithAccess']._serialized_options = b'\202\323\344\223\0020\022./api/v1/app-modules/{app_module_id}:withAccess' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['UpdateApplicationModule']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['UpdateApplicationModule']._serialized_options = b'\202\323\344\223\0029\032#/api/v1/app-modules/{app_module_id}:\022application_module' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['DeleteApplicationModule']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['DeleteApplicationModule']._serialized_options = b'\202\323\344\223\002%*#/api/v1/app-modules/{app_module_id}' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllAppModules']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllAppModules']._serialized_options = b'\202\323\344\223\002\025\022\023/api/v1/app-modules' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationModulesWithAccess']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationModulesWithAccess']._serialized_options = b'\202\323\344\223\002 \022\036/api/v1/app-modules:withAccess' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAccessibleAppModules']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAccessibleAppModules']._serialized_options = b'\202\323\344\223\002 \022\036/api/v1/app-modules:accessible' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAccessibleApplicationModulesWithAccess']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAccessibleApplicationModulesWithAccess']._serialized_options = b'\202\323\344\223\002*\022(/api/v1/app-modules:accessibleWithAccess' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['RegisterApplicationDeployment']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['RegisterApplicationDeployment']._serialized_options = b'\202\323\344\223\0021\"\027/api/v1/app-deployments:\026application_deployment' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationDeployment']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationDeployment']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/app-deployments/{app_deployment_id}' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationDeploymentWithAccess']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationDeploymentWithAccess']._serialized_options = b'\202\323\344\223\0028\0226/api/v1/app-deployments/{app_deployment_id}:withAccess' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationDeploymentQueues']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationDeploymentQueues']._serialized_options = b'\202\323\344\223\0024\0222/api/v1/app-deployments/{app_deployment_id}/queues' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['UpdateApplicationDeployment']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['UpdateApplicationDeployment']._serialized_options = b'\202\323\344\223\002E\032+/api/v1/app-deployments/{app_deployment_id}:\026application_deployment' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['DeleteApplicationDeployment']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['DeleteApplicationDeployment']._serialized_options = b'\202\323\344\223\002-*+/api/v1/app-deployments/{app_deployment_id}' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationDeployments']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationDeployments']._serialized_options = b'\202\323\344\223\002\031\022\027/api/v1/app-deployments' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationDeploymentsWithAccess']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationDeploymentsWithAccess']._serialized_options = b'\202\323\344\223\002$\022\"/api/v1/app-deployments:withAccess' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAccessibleApplicationDeployments']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAccessibleApplicationDeployments']._serialized_options = b'\202\323\344\223\002$\022\"/api/v1/app-deployments:accessible' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAccessibleApplicationDeploymentsWithAccess']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAccessibleApplicationDeploymentsWithAccess']._serialized_options = b'\202\323\344\223\002.\022,/api/v1/app-deployments:accessibleWithAccess' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAppModuleDeployedResources']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAppModuleDeployedResources']._serialized_options = b'\202\323\344\223\0028\0226/api/v1/app-modules/{app_module_id}/deployed-resources' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetDeploymentsForModuleAndProfile']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetDeploymentsForModuleAndProfile']._serialized_options = b'\202\323\344\223\002V\022T/api/v1/app-modules/{app_module_id}/profiles/{group_resource_profile_id}/deployments' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['RegisterApplicationInterface']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['RegisterApplicationInterface']._serialized_options = b'\202\323\344\223\002/\"\026/api/v1/app-interfaces:\025application_interface' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['CloneApplicationInterface']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['CloneApplicationInterface']._serialized_options = b'\202\323\344\223\0021\"//api/v1/app-interfaces/{app_interface_id}:clone' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationInterface']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationInterface']._serialized_options = b'\202\323\344\223\002+\022)/api/v1/app-interfaces/{app_interface_id}' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationInterfaceWithAccess']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationInterfaceWithAccess']._serialized_options = b'\202\323\344\223\0026\0224/api/v1/app-interfaces/{app_interface_id}:withAccess' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['UpdateApplicationInterface']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['UpdateApplicationInterface']._serialized_options = b'\202\323\344\223\002B\032)/api/v1/app-interfaces/{app_interface_id}:\025application_interface' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['DeleteApplicationInterface']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['DeleteApplicationInterface']._serialized_options = b'\202\323\344\223\002+*)/api/v1/app-interfaces/{app_interface_id}' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationInterfaceNames']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationInterfaceNames']._serialized_options = b'\202\323\344\223\002\036\022\034/api/v1/app-interfaces:names' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationInterfaces']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationInterfaces']._serialized_options = b'\202\323\344\223\002\030\022\026/api/v1/app-interfaces' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationInterfacesWithAccess']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationInterfacesWithAccess']._serialized_options = b'\202\323\344\223\002#\022!/api/v1/app-interfaces:withAccess' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationInputs']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationInputs']._serialized_options = b'\202\323\344\223\0022\0220/api/v1/app-interfaces/{app_interface_id}/inputs' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationOutputs']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationOutputs']._serialized_options = b'\202\323\344\223\0023\0221/api/v1/app-interfaces/{app_interface_id}/outputs' + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAvailableComputeResources']._loaded_options = None + _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAvailableComputeResources']._serialized_options = b'\202\323\344\223\002=\022;/api/v1/app-interfaces/{app_interface_id}/compute-resources' + _globals['_REGISTERAPPLICATIONMODULEREQUEST']._serialized_start=475 + _globals['_REGISTERAPPLICATIONMODULEREQUEST']._serialized_end=628 + _globals['_REGISTERAPPLICATIONMODULERESPONSE']._serialized_start=630 + _globals['_REGISTERAPPLICATIONMODULERESPONSE']._serialized_end=688 + _globals['_GETAPPLICATIONMODULEREQUEST']._serialized_start=690 + _globals['_GETAPPLICATIONMODULEREQUEST']._serialized_end=742 + _globals['_UPDATEAPPLICATIONMODULEREQUEST']._serialized_start=745 + _globals['_UPDATEAPPLICATIONMODULEREQUEST']._serialized_end=899 + _globals['_DELETEAPPLICATIONMODULEREQUEST']._serialized_start=901 + _globals['_DELETEAPPLICATIONMODULEREQUEST']._serialized_end=956 + _globals['_GETALLAPPMODULESREQUEST']._serialized_start=958 + _globals['_GETALLAPPMODULESREQUEST']._serialized_end=1003 + _globals['_GETALLAPPMODULESRESPONSE']._serialized_start=1005 + _globals['_GETALLAPPMODULESRESPONSE']._serialized_end=1131 + _globals['_APPLICATIONMODULEWITHACCESS']._serialized_start=1134 + _globals['_APPLICATIONMODULEWITHACCESS']._serialized_end=1326 + _globals['_GETALLAPPLICATIONMODULESWITHACCESSRESPONSE']._serialized_start=1328 + _globals['_GETALLAPPLICATIONMODULESWITHACCESSRESPONSE']._serialized_end=1454 + _globals['_GETACCESSIBLEAPPLICATIONMODULESWITHACCESSRESPONSE']._serialized_start=1457 + _globals['_GETACCESSIBLEAPPLICATIONMODULESWITHACCESSRESPONSE']._serialized_end=1590 + _globals['_GETACCESSIBLEAPPMODULESREQUEST']._serialized_start=1592 + _globals['_GETACCESSIBLEAPPMODULESREQUEST']._serialized_end=1644 + _globals['_GETACCESSIBLEAPPMODULESRESPONSE']._serialized_start=1647 + _globals['_GETACCESSIBLEAPPMODULESRESPONSE']._serialized_end=1780 + _globals['_REGISTERAPPLICATIONDEPLOYMENTREQUEST']._serialized_start=1783 + _globals['_REGISTERAPPLICATIONDEPLOYMENTREQUEST']._serialized_end=1959 + _globals['_REGISTERAPPLICATIONDEPLOYMENTRESPONSE']._serialized_start=1961 + _globals['_REGISTERAPPLICATIONDEPLOYMENTRESPONSE']._serialized_end=2027 + _globals['_GETAPPLICATIONDEPLOYMENTREQUEST']._serialized_start=2029 + _globals['_GETAPPLICATIONDEPLOYMENTREQUEST']._serialized_end=2089 + _globals['_APPLICATIONDEPLOYMENTWITHACCESS']._serialized_start=2092 + _globals['_APPLICATIONDEPLOYMENTWITHACCESS']._serialized_end=2307 + _globals['_GETAPPLICATIONDEPLOYMENTQUEUESRESPONSE']._serialized_start=2309 + _globals['_GETAPPLICATIONDEPLOYMENTQUEUESRESPONSE']._serialized_end=2431 + _globals['_UPDATEAPPLICATIONDEPLOYMENTREQUEST']._serialized_start=2434 + _globals['_UPDATEAPPLICATIONDEPLOYMENTREQUEST']._serialized_end=2615 + _globals['_DELETEAPPLICATIONDEPLOYMENTREQUEST']._serialized_start=2617 + _globals['_DELETEAPPLICATIONDEPLOYMENTREQUEST']._serialized_end=2680 + _globals['_GETALLAPPLICATIONDEPLOYMENTSREQUEST']._serialized_start=2682 + _globals['_GETALLAPPLICATIONDEPLOYMENTSREQUEST']._serialized_end=2739 + _globals['_GETALLAPPLICATIONDEPLOYMENTSRESPONSE']._serialized_start=2742 + _globals['_GETALLAPPLICATIONDEPLOYMENTSRESPONSE']._serialized_end=2899 + _globals['_GETALLAPPLICATIONDEPLOYMENTSWITHACCESSRESPONSE']._serialized_start=2902 + _globals['_GETALLAPPLICATIONDEPLOYMENTSWITHACCESSRESPONSE']._serialized_end=3040 + _globals['_GETACCESSIBLEAPPLICATIONDEPLOYMENTSREQUEST']._serialized_start=3042 + _globals['_GETACCESSIBLEAPPLICATIONDEPLOYMENTSREQUEST']._serialized_end=3106 + _globals['_GETACCESSIBLEAPPLICATIONDEPLOYMENTSRESPONSE']._serialized_start=3109 + _globals['_GETACCESSIBLEAPPLICATIONDEPLOYMENTSRESPONSE']._serialized_end=3273 + _globals['_GETACCESSIBLEAPPLICATIONDEPLOYMENTSWITHACCESSRESPONSE']._serialized_start=3276 + _globals['_GETACCESSIBLEAPPLICATIONDEPLOYMENTSWITHACCESSRESPONSE']._serialized_end=3421 + _globals['_GETAPPMODULEDEPLOYEDRESOURCESREQUEST']._serialized_start=3423 + _globals['_GETAPPMODULEDEPLOYEDRESOURCESREQUEST']._serialized_end=3484 + _globals['_GETAPPMODULEDEPLOYEDRESOURCESRESPONSE']._serialized_start=3486 + _globals['_GETAPPMODULEDEPLOYEDRESOURCESRESPONSE']._serialized_end=3555 + _globals['_GETDEPLOYMENTSFORMODULEANDPROFILEREQUEST']._serialized_start=3557 + _globals['_GETDEPLOYMENTSFORMODULEANDPROFILEREQUEST']._serialized_end=3657 + _globals['_GETDEPLOYMENTSFORMODULEANDPROFILERESPONSE']._serialized_start=3660 + _globals['_GETDEPLOYMENTSFORMODULEANDPROFILERESPONSE']._serialized_end=3822 + _globals['_REGISTERAPPLICATIONINTERFACEREQUEST']._serialized_start=3825 + _globals['_REGISTERAPPLICATIONINTERFACEREQUEST']._serialized_end=3997 + _globals['_REGISTERAPPLICATIONINTERFACERESPONSE']._serialized_start=3999 + _globals['_REGISTERAPPLICATIONINTERFACERESPONSE']._serialized_end=4063 + _globals['_CLONEAPPLICATIONINTERFACEREQUEST']._serialized_start=4065 + _globals['_CLONEAPPLICATIONINTERFACEREQUEST']._serialized_end=4175 + _globals['_CLONEAPPLICATIONINTERFACERESPONSE']._serialized_start=4177 + _globals['_CLONEAPPLICATIONINTERFACERESPONSE']._serialized_end=4238 + _globals['_GETAPPLICATIONINTERFACEREQUEST']._serialized_start=4240 + _globals['_GETAPPLICATIONINTERFACEREQUEST']._serialized_end=4298 + _globals['_UPDATEAPPLICATIONINTERFACEREQUEST']._serialized_start=4301 + _globals['_UPDATEAPPLICATIONINTERFACEREQUEST']._serialized_end=4477 + _globals['_DELETEAPPLICATIONINTERFACEREQUEST']._serialized_start=4479 + _globals['_DELETEAPPLICATIONINTERFACEREQUEST']._serialized_end=4540 + _globals['_GETALLAPPLICATIONINTERFACENAMESREQUEST']._serialized_start=4542 + _globals['_GETALLAPPLICATIONINTERFACENAMESREQUEST']._serialized_end=4602 + _globals['_GETALLAPPLICATIONINTERFACENAMESRESPONSE']._serialized_start=4605 + _globals['_GETALLAPPLICATIONINTERFACENAMESRESPONSE']._serialized_end=4858 + _globals['_GETALLAPPLICATIONINTERFACENAMESRESPONSE_APPLICATIONINTERFACENAMESENTRY']._serialized_start=4794 + _globals['_GETALLAPPLICATIONINTERFACENAMESRESPONSE_APPLICATIONINTERFACENAMESENTRY']._serialized_end=4858 + _globals['_GETALLAPPLICATIONINTERFACESREQUEST']._serialized_start=4860 + _globals['_GETALLAPPLICATIONINTERFACESREQUEST']._serialized_end=4916 + _globals['_GETALLAPPLICATIONINTERFACESRESPONSE']._serialized_start=4919 + _globals['_GETALLAPPLICATIONINTERFACESRESPONSE']._serialized_end=5072 + _globals['_APPLICATIONINTERFACEWITHACCESS']._serialized_start=5075 + _globals['_APPLICATIONINTERFACEWITHACCESS']._serialized_end=5286 + _globals['_GETALLAPPLICATIONINTERFACESWITHACCESSRESPONSE']._serialized_start=5289 + _globals['_GETALLAPPLICATIONINTERFACESWITHACCESSRESPONSE']._serialized_end=5424 + _globals['_GETAPPLICATIONINPUTSREQUEST']._serialized_start=5426 + _globals['_GETAPPLICATIONINPUTSREQUEST']._serialized_end=5481 + _globals['_GETAPPLICATIONINPUTSRESPONSE']._serialized_start=5483 + _globals['_GETAPPLICATIONINPUTSRESPONSE']._serialized_end=5604 + _globals['_GETAPPLICATIONOUTPUTSREQUEST']._serialized_start=5606 + _globals['_GETAPPLICATIONOUTPUTSREQUEST']._serialized_end=5662 + _globals['_GETAPPLICATIONOUTPUTSRESPONSE']._serialized_start=5664 + _globals['_GETAPPLICATIONOUTPUTSRESPONSE']._serialized_end=5788 + _globals['_GETAVAILABLECOMPUTERESOURCESREQUEST']._serialized_start=5790 + _globals['_GETAVAILABLECOMPUTERESOURCESREQUEST']._serialized_end=5853 + _globals['_GETAVAILABLECOMPUTERESOURCESRESPONSE']._serialized_start=5856 + _globals['_GETAVAILABLECOMPUTERESOURCESRESPONSE']._serialized_end=6088 + _globals['_GETAVAILABLECOMPUTERESOURCESRESPONSE_COMPUTERESOURCENAMESENTRY']._serialized_start=6029 + _globals['_GETAVAILABLECOMPUTERESOURCESRESPONSE_COMPUTERESOURCENAMESENTRY']._serialized_end=6088 + _globals['_APPLICATIONCATALOGSERVICE']._serialized_start=6091 + _globals['_APPLICATIONCATALOGSERVICE']._serialized_end=13485 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/application_catalog_service_pb2.pyi b/airavata-python-sdk/airavata/services/application_catalog_service_pb2.pyi similarity index 77% rename from airavata-python-sdk/airavata_sdk/generated/services/application_catalog_service_pb2.pyi rename to airavata-python-sdk/airavata/services/application_catalog_service_pb2.pyi index 251c4aa3531..8ccd3e81278 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/application_catalog_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/application_catalog_service_pb2.pyi @@ -1,9 +1,10 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.appcatalog.appdeployment import app_deployment_pb2 as _app_deployment_pb2 -from org.apache.airavata.model.appcatalog.appinterface import app_interface_pb2 as _app_interface_pb2 -from org.apache.airavata.model.appcatalog.computeresource import compute_resource_pb2 as _compute_resource_pb2 -from org.apache.airavata.model.application.io import application_io_pb2 as _application_io_pb2 +from airavata.model.appcatalog.appdeployment import app_deployment_pb2 as _app_deployment_pb2 +from airavata.model.appcatalog.appinterface import app_interface_pb2 as _app_interface_pb2 +from airavata.model.appcatalog.computeresource import compute_resource_pb2 as _compute_resource_pb2 +from airavata.model.application.io import application_io_pb2 as _application_io_pb2 +from airavata.model.commons import commons_pb2 as _commons_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -58,6 +59,26 @@ class GetAllAppModulesResponse(_message.Message): application_modules: _containers.RepeatedCompositeFieldContainer[_app_deployment_pb2.ApplicationModule] def __init__(self, application_modules: _Optional[_Iterable[_Union[_app_deployment_pb2.ApplicationModule, _Mapping]]] = ...) -> None: ... +class ApplicationModuleWithAccess(_message.Message): + __slots__ = ("application_module", "access") + APPLICATION_MODULE_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + application_module: _app_deployment_pb2.ApplicationModule + access: _commons_pb2.AccessFlags + def __init__(self, application_module: _Optional[_Union[_app_deployment_pb2.ApplicationModule, _Mapping]] = ..., access: _Optional[_Union[_commons_pb2.AccessFlags, _Mapping]] = ...) -> None: ... + +class GetAllApplicationModulesWithAccessResponse(_message.Message): + __slots__ = ("modules",) + MODULES_FIELD_NUMBER: _ClassVar[int] + modules: _containers.RepeatedCompositeFieldContainer[ApplicationModuleWithAccess] + def __init__(self, modules: _Optional[_Iterable[_Union[ApplicationModuleWithAccess, _Mapping]]] = ...) -> None: ... + +class GetAccessibleApplicationModulesWithAccessResponse(_message.Message): + __slots__ = ("modules",) + MODULES_FIELD_NUMBER: _ClassVar[int] + modules: _containers.RepeatedCompositeFieldContainer[ApplicationModuleWithAccess] + def __init__(self, modules: _Optional[_Iterable[_Union[ApplicationModuleWithAccess, _Mapping]]] = ...) -> None: ... + class GetAccessibleAppModulesRequest(_message.Message): __slots__ = ("gateway_id",) GATEWAY_ID_FIELD_NUMBER: _ClassVar[int] @@ -90,6 +111,20 @@ class GetApplicationDeploymentRequest(_message.Message): app_deployment_id: str def __init__(self, app_deployment_id: _Optional[str] = ...) -> None: ... +class ApplicationDeploymentWithAccess(_message.Message): + __slots__ = ("application_deployment", "access") + APPLICATION_DEPLOYMENT_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + application_deployment: _app_deployment_pb2.ApplicationDeploymentDescription + access: _commons_pb2.AccessFlags + def __init__(self, application_deployment: _Optional[_Union[_app_deployment_pb2.ApplicationDeploymentDescription, _Mapping]] = ..., access: _Optional[_Union[_commons_pb2.AccessFlags, _Mapping]] = ...) -> None: ... + +class GetApplicationDeploymentQueuesResponse(_message.Message): + __slots__ = ("queues",) + QUEUES_FIELD_NUMBER: _ClassVar[int] + queues: _containers.RepeatedCompositeFieldContainer[_compute_resource_pb2.BatchQueue] + def __init__(self, queues: _Optional[_Iterable[_Union[_compute_resource_pb2.BatchQueue, _Mapping]]] = ...) -> None: ... + class UpdateApplicationDeploymentRequest(_message.Message): __slots__ = ("app_deployment_id", "application_deployment") APP_DEPLOYMENT_ID_FIELD_NUMBER: _ClassVar[int] @@ -116,6 +151,12 @@ class GetAllApplicationDeploymentsResponse(_message.Message): application_deployments: _containers.RepeatedCompositeFieldContainer[_app_deployment_pb2.ApplicationDeploymentDescription] def __init__(self, application_deployments: _Optional[_Iterable[_Union[_app_deployment_pb2.ApplicationDeploymentDescription, _Mapping]]] = ...) -> None: ... +class GetAllApplicationDeploymentsWithAccessResponse(_message.Message): + __slots__ = ("deployments",) + DEPLOYMENTS_FIELD_NUMBER: _ClassVar[int] + deployments: _containers.RepeatedCompositeFieldContainer[ApplicationDeploymentWithAccess] + def __init__(self, deployments: _Optional[_Iterable[_Union[ApplicationDeploymentWithAccess, _Mapping]]] = ...) -> None: ... + class GetAccessibleApplicationDeploymentsRequest(_message.Message): __slots__ = ("gateway_id",) GATEWAY_ID_FIELD_NUMBER: _ClassVar[int] @@ -128,6 +169,12 @@ class GetAccessibleApplicationDeploymentsResponse(_message.Message): application_deployments: _containers.RepeatedCompositeFieldContainer[_app_deployment_pb2.ApplicationDeploymentDescription] def __init__(self, application_deployments: _Optional[_Iterable[_Union[_app_deployment_pb2.ApplicationDeploymentDescription, _Mapping]]] = ...) -> None: ... +class GetAccessibleApplicationDeploymentsWithAccessResponse(_message.Message): + __slots__ = ("deployments",) + DEPLOYMENTS_FIELD_NUMBER: _ClassVar[int] + deployments: _containers.RepeatedCompositeFieldContainer[ApplicationDeploymentWithAccess] + def __init__(self, deployments: _Optional[_Iterable[_Union[ApplicationDeploymentWithAccess, _Mapping]]] = ...) -> None: ... + class GetAppModuleDeployedResourcesRequest(_message.Message): __slots__ = ("app_module_id",) APP_MODULE_ID_FIELD_NUMBER: _ClassVar[int] @@ -235,6 +282,20 @@ class GetAllApplicationInterfacesResponse(_message.Message): application_interfaces: _containers.RepeatedCompositeFieldContainer[_app_interface_pb2.ApplicationInterfaceDescription] def __init__(self, application_interfaces: _Optional[_Iterable[_Union[_app_interface_pb2.ApplicationInterfaceDescription, _Mapping]]] = ...) -> None: ... +class ApplicationInterfaceWithAccess(_message.Message): + __slots__ = ("application_interface", "access") + APPLICATION_INTERFACE_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + application_interface: _app_interface_pb2.ApplicationInterfaceDescription + access: _commons_pb2.AccessFlags + def __init__(self, application_interface: _Optional[_Union[_app_interface_pb2.ApplicationInterfaceDescription, _Mapping]] = ..., access: _Optional[_Union[_commons_pb2.AccessFlags, _Mapping]] = ...) -> None: ... + +class GetAllApplicationInterfacesWithAccessResponse(_message.Message): + __slots__ = ("interfaces",) + INTERFACES_FIELD_NUMBER: _ClassVar[int] + interfaces: _containers.RepeatedCompositeFieldContainer[ApplicationInterfaceWithAccess] + def __init__(self, interfaces: _Optional[_Iterable[_Union[ApplicationInterfaceWithAccess, _Mapping]]] = ...) -> None: ... + class GetApplicationInputsRequest(_message.Message): __slots__ = ("app_interface_id",) APP_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] diff --git a/airavata-python-sdk/airavata_sdk/generated/services/application_catalog_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/application_catalog_service_pb2_grpc.py similarity index 70% rename from airavata-python-sdk/airavata_sdk/generated/services/application_catalog_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/application_catalog_service_pb2_grpc.py index 9693e0dc438..541926227a0 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/application_catalog_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/application_catalog_service_pb2_grpc.py @@ -4,9 +4,9 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.appcatalog.appdeployment import app_deployment_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appdeployment_dot_app__deployment__pb2 -from org.apache.airavata.model.appcatalog.appinterface import app_interface_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appinterface_dot_app__interface__pb2 -from services import application_catalog_service_pb2 as services_dot_application__catalog__service__pb2 +from airavata.model.appcatalog.appdeployment import app_deployment_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appdeployment_dot_app__deployment__pb2 +from airavata.model.appcatalog.appinterface import app_interface_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appinterface_dot_app__interface__pb2 +from airavata.services import application_catalog_service_pb2 as services_dot_application__catalog__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ @@ -49,6 +49,11 @@ def __init__(self, channel): request_serializer=services_dot_application__catalog__service__pb2.GetApplicationModuleRequest.SerializeToString, response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appdeployment_dot_app__deployment__pb2.ApplicationModule.FromString, _registered_method=True) + self.GetApplicationModuleWithAccess = channel.unary_unary( + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetApplicationModuleWithAccess', + request_serializer=services_dot_application__catalog__service__pb2.GetApplicationModuleRequest.SerializeToString, + response_deserializer=services_dot_application__catalog__service__pb2.ApplicationModuleWithAccess.FromString, + _registered_method=True) self.UpdateApplicationModule = channel.unary_unary( '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/UpdateApplicationModule', request_serializer=services_dot_application__catalog__service__pb2.UpdateApplicationModuleRequest.SerializeToString, @@ -64,11 +69,21 @@ def __init__(self, channel): request_serializer=services_dot_application__catalog__service__pb2.GetAllAppModulesRequest.SerializeToString, response_deserializer=services_dot_application__catalog__service__pb2.GetAllAppModulesResponse.FromString, _registered_method=True) + self.GetAllApplicationModulesWithAccess = channel.unary_unary( + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAllApplicationModulesWithAccess', + request_serializer=services_dot_application__catalog__service__pb2.GetAllAppModulesRequest.SerializeToString, + response_deserializer=services_dot_application__catalog__service__pb2.GetAllApplicationModulesWithAccessResponse.FromString, + _registered_method=True) self.GetAccessibleAppModules = channel.unary_unary( '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAccessibleAppModules', request_serializer=services_dot_application__catalog__service__pb2.GetAccessibleAppModulesRequest.SerializeToString, response_deserializer=services_dot_application__catalog__service__pb2.GetAccessibleAppModulesResponse.FromString, _registered_method=True) + self.GetAccessibleApplicationModulesWithAccess = channel.unary_unary( + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAccessibleApplicationModulesWithAccess', + request_serializer=services_dot_application__catalog__service__pb2.GetAccessibleAppModulesRequest.SerializeToString, + response_deserializer=services_dot_application__catalog__service__pb2.GetAccessibleApplicationModulesWithAccessResponse.FromString, + _registered_method=True) self.RegisterApplicationDeployment = channel.unary_unary( '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/RegisterApplicationDeployment', request_serializer=services_dot_application__catalog__service__pb2.RegisterApplicationDeploymentRequest.SerializeToString, @@ -79,6 +94,16 @@ def __init__(self, channel): request_serializer=services_dot_application__catalog__service__pb2.GetApplicationDeploymentRequest.SerializeToString, response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appdeployment_dot_app__deployment__pb2.ApplicationDeploymentDescription.FromString, _registered_method=True) + self.GetApplicationDeploymentWithAccess = channel.unary_unary( + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetApplicationDeploymentWithAccess', + request_serializer=services_dot_application__catalog__service__pb2.GetApplicationDeploymentRequest.SerializeToString, + response_deserializer=services_dot_application__catalog__service__pb2.ApplicationDeploymentWithAccess.FromString, + _registered_method=True) + self.GetApplicationDeploymentQueues = channel.unary_unary( + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetApplicationDeploymentQueues', + request_serializer=services_dot_application__catalog__service__pb2.GetApplicationDeploymentRequest.SerializeToString, + response_deserializer=services_dot_application__catalog__service__pb2.GetApplicationDeploymentQueuesResponse.FromString, + _registered_method=True) self.UpdateApplicationDeployment = channel.unary_unary( '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/UpdateApplicationDeployment', request_serializer=services_dot_application__catalog__service__pb2.UpdateApplicationDeploymentRequest.SerializeToString, @@ -94,11 +119,21 @@ def __init__(self, channel): request_serializer=services_dot_application__catalog__service__pb2.GetAllApplicationDeploymentsRequest.SerializeToString, response_deserializer=services_dot_application__catalog__service__pb2.GetAllApplicationDeploymentsResponse.FromString, _registered_method=True) + self.GetAllApplicationDeploymentsWithAccess = channel.unary_unary( + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAllApplicationDeploymentsWithAccess', + request_serializer=services_dot_application__catalog__service__pb2.GetAllApplicationDeploymentsRequest.SerializeToString, + response_deserializer=services_dot_application__catalog__service__pb2.GetAllApplicationDeploymentsWithAccessResponse.FromString, + _registered_method=True) self.GetAccessibleApplicationDeployments = channel.unary_unary( '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAccessibleApplicationDeployments', request_serializer=services_dot_application__catalog__service__pb2.GetAccessibleApplicationDeploymentsRequest.SerializeToString, response_deserializer=services_dot_application__catalog__service__pb2.GetAccessibleApplicationDeploymentsResponse.FromString, _registered_method=True) + self.GetAccessibleApplicationDeploymentsWithAccess = channel.unary_unary( + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAccessibleApplicationDeploymentsWithAccess', + request_serializer=services_dot_application__catalog__service__pb2.GetAccessibleApplicationDeploymentsRequest.SerializeToString, + response_deserializer=services_dot_application__catalog__service__pb2.GetAccessibleApplicationDeploymentsWithAccessResponse.FromString, + _registered_method=True) self.GetAppModuleDeployedResources = channel.unary_unary( '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAppModuleDeployedResources', request_serializer=services_dot_application__catalog__service__pb2.GetAppModuleDeployedResourcesRequest.SerializeToString, @@ -124,6 +159,11 @@ def __init__(self, channel): request_serializer=services_dot_application__catalog__service__pb2.GetApplicationInterfaceRequest.SerializeToString, response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appinterface_dot_app__interface__pb2.ApplicationInterfaceDescription.FromString, _registered_method=True) + self.GetApplicationInterfaceWithAccess = channel.unary_unary( + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetApplicationInterfaceWithAccess', + request_serializer=services_dot_application__catalog__service__pb2.GetApplicationInterfaceRequest.SerializeToString, + response_deserializer=services_dot_application__catalog__service__pb2.ApplicationInterfaceWithAccess.FromString, + _registered_method=True) self.UpdateApplicationInterface = channel.unary_unary( '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/UpdateApplicationInterface', request_serializer=services_dot_application__catalog__service__pb2.UpdateApplicationInterfaceRequest.SerializeToString, @@ -144,6 +184,11 @@ def __init__(self, channel): request_serializer=services_dot_application__catalog__service__pb2.GetAllApplicationInterfacesRequest.SerializeToString, response_deserializer=services_dot_application__catalog__service__pb2.GetAllApplicationInterfacesResponse.FromString, _registered_method=True) + self.GetAllApplicationInterfacesWithAccess = channel.unary_unary( + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAllApplicationInterfacesWithAccess', + request_serializer=services_dot_application__catalog__service__pb2.GetAllApplicationInterfacesRequest.SerializeToString, + response_deserializer=services_dot_application__catalog__service__pb2.GetAllApplicationInterfacesWithAccessResponse.FromString, + _registered_method=True) self.GetApplicationInputs = channel.unary_unary( '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetApplicationInputs', request_serializer=services_dot_application__catalog__service__pb2.GetApplicationInputsRequest.SerializeToString, @@ -180,6 +225,15 @@ def GetApplicationModule(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetApplicationModuleWithAccess(self, request, context): + """Additive: GetApplicationModule plus the caller's server-computed access flags, so a client + does not recompute access from a separate round-trip. Application modules are gateway-admin- + managed catalog entries (no sharing entity), so the flags reflect gateway-admin status. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def UpdateApplicationModule(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -198,12 +252,26 @@ def GetAllAppModules(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetAllApplicationModulesWithAccess(self, request, context): + """Additive: GetAllAppModules plus each module's caller-scoped access flags (see above). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetAccessibleAppModules(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetAccessibleApplicationModulesWithAccess(self, request, context): + """Additive: GetAccessibleAppModules plus each module's caller-scoped access flags. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def RegisterApplicationDeployment(self, request, context): """--- Application Deployments --- @@ -218,6 +286,23 @@ def GetApplicationDeployment(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetApplicationDeploymentWithAccess(self, request, context): + """Additive: GetApplicationDeployment plus the caller's server-computed access + flags, so a client does not recompute access from a separate sharing round-trip. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetApplicationDeploymentQueues(self, request, context): + """The effective batch queues for this deployment: the deployment's compute resource's + queues, with the deployment's default queue flagged and its default node/cpu/walltime + overrides applied. Moves the queue-shaping join the portal does today onto the server. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def UpdateApplicationDeployment(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -236,12 +321,29 @@ def GetAllApplicationDeployments(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetAllApplicationDeploymentsWithAccess(self, request, context): + """Additive: GetAllApplicationDeployments plus each deployment's caller-scoped access flags (see + GetApplicationDeploymentWithAccess). Deployments are sharing entities, so the per-item flags + reflect the caller's sharing OWNER/WRITE grants on each deployment. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetAccessibleApplicationDeployments(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetAccessibleApplicationDeploymentsWithAccess(self, request, context): + """Additive: GetAccessibleApplicationDeployments plus each deployment's caller-scoped access flags + (see above). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetAppModuleDeployedResources(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -274,6 +376,15 @@ def GetApplicationInterface(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetApplicationInterfaceWithAccess(self, request, context): + """Additive: GetApplicationInterface plus the caller's server-computed access flags, so a client + does not recompute access from a separate round-trip. Application interfaces are gateway-admin- + managed catalog entries (no sharing entity), so the flags reflect gateway-admin status. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def UpdateApplicationInterface(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -298,6 +409,13 @@ def GetAllApplicationInterfaces(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetAllApplicationInterfacesWithAccess(self, request, context): + """Additive: GetAllApplicationInterfaces plus each interface's caller-scoped access flags (see above). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetApplicationInputs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -329,6 +447,11 @@ def add_ApplicationCatalogServiceServicer_to_server(servicer, server): request_deserializer=services_dot_application__catalog__service__pb2.GetApplicationModuleRequest.FromString, response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appdeployment_dot_app__deployment__pb2.ApplicationModule.SerializeToString, ), + 'GetApplicationModuleWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetApplicationModuleWithAccess, + request_deserializer=services_dot_application__catalog__service__pb2.GetApplicationModuleRequest.FromString, + response_serializer=services_dot_application__catalog__service__pb2.ApplicationModuleWithAccess.SerializeToString, + ), 'UpdateApplicationModule': grpc.unary_unary_rpc_method_handler( servicer.UpdateApplicationModule, request_deserializer=services_dot_application__catalog__service__pb2.UpdateApplicationModuleRequest.FromString, @@ -344,11 +467,21 @@ def add_ApplicationCatalogServiceServicer_to_server(servicer, server): request_deserializer=services_dot_application__catalog__service__pb2.GetAllAppModulesRequest.FromString, response_serializer=services_dot_application__catalog__service__pb2.GetAllAppModulesResponse.SerializeToString, ), + 'GetAllApplicationModulesWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetAllApplicationModulesWithAccess, + request_deserializer=services_dot_application__catalog__service__pb2.GetAllAppModulesRequest.FromString, + response_serializer=services_dot_application__catalog__service__pb2.GetAllApplicationModulesWithAccessResponse.SerializeToString, + ), 'GetAccessibleAppModules': grpc.unary_unary_rpc_method_handler( servicer.GetAccessibleAppModules, request_deserializer=services_dot_application__catalog__service__pb2.GetAccessibleAppModulesRequest.FromString, response_serializer=services_dot_application__catalog__service__pb2.GetAccessibleAppModulesResponse.SerializeToString, ), + 'GetAccessibleApplicationModulesWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetAccessibleApplicationModulesWithAccess, + request_deserializer=services_dot_application__catalog__service__pb2.GetAccessibleAppModulesRequest.FromString, + response_serializer=services_dot_application__catalog__service__pb2.GetAccessibleApplicationModulesWithAccessResponse.SerializeToString, + ), 'RegisterApplicationDeployment': grpc.unary_unary_rpc_method_handler( servicer.RegisterApplicationDeployment, request_deserializer=services_dot_application__catalog__service__pb2.RegisterApplicationDeploymentRequest.FromString, @@ -359,6 +492,16 @@ def add_ApplicationCatalogServiceServicer_to_server(servicer, server): request_deserializer=services_dot_application__catalog__service__pb2.GetApplicationDeploymentRequest.FromString, response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appdeployment_dot_app__deployment__pb2.ApplicationDeploymentDescription.SerializeToString, ), + 'GetApplicationDeploymentWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetApplicationDeploymentWithAccess, + request_deserializer=services_dot_application__catalog__service__pb2.GetApplicationDeploymentRequest.FromString, + response_serializer=services_dot_application__catalog__service__pb2.ApplicationDeploymentWithAccess.SerializeToString, + ), + 'GetApplicationDeploymentQueues': grpc.unary_unary_rpc_method_handler( + servicer.GetApplicationDeploymentQueues, + request_deserializer=services_dot_application__catalog__service__pb2.GetApplicationDeploymentRequest.FromString, + response_serializer=services_dot_application__catalog__service__pb2.GetApplicationDeploymentQueuesResponse.SerializeToString, + ), 'UpdateApplicationDeployment': grpc.unary_unary_rpc_method_handler( servicer.UpdateApplicationDeployment, request_deserializer=services_dot_application__catalog__service__pb2.UpdateApplicationDeploymentRequest.FromString, @@ -374,11 +517,21 @@ def add_ApplicationCatalogServiceServicer_to_server(servicer, server): request_deserializer=services_dot_application__catalog__service__pb2.GetAllApplicationDeploymentsRequest.FromString, response_serializer=services_dot_application__catalog__service__pb2.GetAllApplicationDeploymentsResponse.SerializeToString, ), + 'GetAllApplicationDeploymentsWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetAllApplicationDeploymentsWithAccess, + request_deserializer=services_dot_application__catalog__service__pb2.GetAllApplicationDeploymentsRequest.FromString, + response_serializer=services_dot_application__catalog__service__pb2.GetAllApplicationDeploymentsWithAccessResponse.SerializeToString, + ), 'GetAccessibleApplicationDeployments': grpc.unary_unary_rpc_method_handler( servicer.GetAccessibleApplicationDeployments, request_deserializer=services_dot_application__catalog__service__pb2.GetAccessibleApplicationDeploymentsRequest.FromString, response_serializer=services_dot_application__catalog__service__pb2.GetAccessibleApplicationDeploymentsResponse.SerializeToString, ), + 'GetAccessibleApplicationDeploymentsWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetAccessibleApplicationDeploymentsWithAccess, + request_deserializer=services_dot_application__catalog__service__pb2.GetAccessibleApplicationDeploymentsRequest.FromString, + response_serializer=services_dot_application__catalog__service__pb2.GetAccessibleApplicationDeploymentsWithAccessResponse.SerializeToString, + ), 'GetAppModuleDeployedResources': grpc.unary_unary_rpc_method_handler( servicer.GetAppModuleDeployedResources, request_deserializer=services_dot_application__catalog__service__pb2.GetAppModuleDeployedResourcesRequest.FromString, @@ -404,6 +557,11 @@ def add_ApplicationCatalogServiceServicer_to_server(servicer, server): request_deserializer=services_dot_application__catalog__service__pb2.GetApplicationInterfaceRequest.FromString, response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appinterface_dot_app__interface__pb2.ApplicationInterfaceDescription.SerializeToString, ), + 'GetApplicationInterfaceWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetApplicationInterfaceWithAccess, + request_deserializer=services_dot_application__catalog__service__pb2.GetApplicationInterfaceRequest.FromString, + response_serializer=services_dot_application__catalog__service__pb2.ApplicationInterfaceWithAccess.SerializeToString, + ), 'UpdateApplicationInterface': grpc.unary_unary_rpc_method_handler( servicer.UpdateApplicationInterface, request_deserializer=services_dot_application__catalog__service__pb2.UpdateApplicationInterfaceRequest.FromString, @@ -424,6 +582,11 @@ def add_ApplicationCatalogServiceServicer_to_server(servicer, server): request_deserializer=services_dot_application__catalog__service__pb2.GetAllApplicationInterfacesRequest.FromString, response_serializer=services_dot_application__catalog__service__pb2.GetAllApplicationInterfacesResponse.SerializeToString, ), + 'GetAllApplicationInterfacesWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetAllApplicationInterfacesWithAccess, + request_deserializer=services_dot_application__catalog__service__pb2.GetAllApplicationInterfacesRequest.FromString, + response_serializer=services_dot_application__catalog__service__pb2.GetAllApplicationInterfacesWithAccessResponse.SerializeToString, + ), 'GetApplicationInputs': grpc.unary_unary_rpc_method_handler( servicer.GetApplicationInputs, request_deserializer=services_dot_application__catalog__service__pb2.GetApplicationInputsRequest.FromString, @@ -506,6 +669,33 @@ def GetApplicationModule(request, metadata, _registered_method=True) + @staticmethod + def GetApplicationModuleWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetApplicationModuleWithAccess', + services_dot_application__catalog__service__pb2.GetApplicationModuleRequest.SerializeToString, + services_dot_application__catalog__service__pb2.ApplicationModuleWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def UpdateApplicationModule(request, target, @@ -587,6 +777,33 @@ def GetAllAppModules(request, metadata, _registered_method=True) + @staticmethod + def GetAllApplicationModulesWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAllApplicationModulesWithAccess', + services_dot_application__catalog__service__pb2.GetAllAppModulesRequest.SerializeToString, + services_dot_application__catalog__service__pb2.GetAllApplicationModulesWithAccessResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetAccessibleAppModules(request, target, @@ -614,6 +831,33 @@ def GetAccessibleAppModules(request, metadata, _registered_method=True) + @staticmethod + def GetAccessibleApplicationModulesWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAccessibleApplicationModulesWithAccess', + services_dot_application__catalog__service__pb2.GetAccessibleAppModulesRequest.SerializeToString, + services_dot_application__catalog__service__pb2.GetAccessibleApplicationModulesWithAccessResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def RegisterApplicationDeployment(request, target, @@ -668,6 +912,60 @@ def GetApplicationDeployment(request, metadata, _registered_method=True) + @staticmethod + def GetApplicationDeploymentWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetApplicationDeploymentWithAccess', + services_dot_application__catalog__service__pb2.GetApplicationDeploymentRequest.SerializeToString, + services_dot_application__catalog__service__pb2.ApplicationDeploymentWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetApplicationDeploymentQueues(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetApplicationDeploymentQueues', + services_dot_application__catalog__service__pb2.GetApplicationDeploymentRequest.SerializeToString, + services_dot_application__catalog__service__pb2.GetApplicationDeploymentQueuesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def UpdateApplicationDeployment(request, target, @@ -749,6 +1047,33 @@ def GetAllApplicationDeployments(request, metadata, _registered_method=True) + @staticmethod + def GetAllApplicationDeploymentsWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAllApplicationDeploymentsWithAccess', + services_dot_application__catalog__service__pb2.GetAllApplicationDeploymentsRequest.SerializeToString, + services_dot_application__catalog__service__pb2.GetAllApplicationDeploymentsWithAccessResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetAccessibleApplicationDeployments(request, target, @@ -776,6 +1101,33 @@ def GetAccessibleApplicationDeployments(request, metadata, _registered_method=True) + @staticmethod + def GetAccessibleApplicationDeploymentsWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAccessibleApplicationDeploymentsWithAccess', + services_dot_application__catalog__service__pb2.GetAccessibleApplicationDeploymentsRequest.SerializeToString, + services_dot_application__catalog__service__pb2.GetAccessibleApplicationDeploymentsWithAccessResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetAppModuleDeployedResources(request, target, @@ -911,6 +1263,33 @@ def GetApplicationInterface(request, metadata, _registered_method=True) + @staticmethod + def GetApplicationInterfaceWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetApplicationInterfaceWithAccess', + services_dot_application__catalog__service__pb2.GetApplicationInterfaceRequest.SerializeToString, + services_dot_application__catalog__service__pb2.ApplicationInterfaceWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def UpdateApplicationInterface(request, target, @@ -1019,6 +1398,33 @@ def GetAllApplicationInterfaces(request, metadata, _registered_method=True) + @staticmethod + def GetAllApplicationInterfacesWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.appcatalog.ApplicationCatalogService/GetAllApplicationInterfacesWithAccess', + services_dot_application__catalog__service__pb2.GetAllApplicationInterfacesRequest.SerializeToString, + services_dot_application__catalog__service__pb2.GetAllApplicationInterfacesWithAccessResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetApplicationInputs(request, target, diff --git a/airavata-python-sdk/airavata/services/credential_service_pb2.py b/airavata-python-sdk/airavata/services/credential_service_pb2.py new file mode 100644 index 00000000000..00bb8884974 --- /dev/null +++ b/airavata-python-sdk/airavata/services/credential_service_pb2.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/credential_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/credential_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.credential.store import credential_store_pb2 as org_dot_apache_dot_airavata_dot_model_dot_credential_dot_store_dot_credential__store__pb2 +from airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!services/credential_service.proto\x12\"org.apache.airavata.api.credential\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x41org/apache/airavata/model/credential/store/credential_store.proto\x1a/org/apache/airavata/model/commons/commons.proto\"^\n!GenerateAndRegisterSSHKeysRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"3\n\"GenerateAndRegisterSSHKeysResponse\x12\r\n\x05token\x18\x01 \x01(\t\"\x8f\x01\n\x1cRegisterPwdCredentialRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12[\n\x13password_credential\x18\x02 \x01(\x0b\x32>.org.apache.airavata.model.credential.store.PasswordCredential\".\n\x1dRegisterPwdCredentialResponse\x12\r\n\x05token\x18\x01 \x01(\t\"C\n\x1bGetCredentialSummaryRequest\x12\x10\n\x08token_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"\xb8\x01\n\x1b\x43redentialSummaryWithAccess\x12Y\n\x12\x63redential_summary\x18\x01 \x01(\x0b\x32=.org.apache.airavata.model.credential.store.CredentialSummary\x12>\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32..org.apache.airavata.model.commons.AccessFlags\"}\n GetAllCredentialSummariesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x45\n\x04type\x18\x02 \x01(\x0e\x32\x37.org.apache.airavata.model.credential.store.SummaryType\"\x80\x01\n!GetAllCredentialSummariesResponse\x12[\n\x14\x63redential_summaries\x18\x01 \x03(\x0b\x32=.org.apache.airavata.model.credential.store.CredentialSummary\">\n\x16\x44\x65leteSSHPubKeyRequest\x12\x10\n\x08token_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"B\n\x1a\x44\x65letePWDCredentialRequest\x12\x10\n\x08token_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"b\n\x1d\x44oesUserHaveSSHAccountRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x10\n\x08username\x18\x03 \x01(\t\"5\n\x1e\x44oesUserHaveSSHAccountResponse\x12\x13\n\x0bhas_account\x18\x01 \x01(\x08\"^\n\x19IsSSHSetupCompleteRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x10\n\x08username\x18\x03 \x01(\t\"1\n\x1aIsSSHSetupCompleteResponse\x12\x13\n\x0bis_complete\x18\x01 \x01(\x08\"[\n\x16SetupSSHAccountRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x10\n\x08username\x18\x03 \x01(\t\"*\n\x17SetupSSHAccountResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x32\xf0\x0f\n\x11\x43redentialService\x12\xd4\x01\n\x1aGenerateAndRegisterSSHKeys\x12\x45.org.apache.airavata.api.credential.GenerateAndRegisterSSHKeysRequest\x1a\x46.org.apache.airavata.api.credential.GenerateAndRegisterSSHKeysResponse\"\'\x82\xd3\xe4\x93\x02!\"\x1c/api/v1/credentials/ssh-keys:\x01*\x12\xc6\x01\n\x15RegisterPwdCredential\x12@.org.apache.airavata.api.credential.RegisterPwdCredentialRequest\x1a\x41.org.apache.airavata.api.credential.RegisterPwdCredentialResponse\"(\x82\xd3\xe4\x93\x02\"\"\x1d/api/v1/credentials/passwords:\x01*\x12\xbe\x01\n\x14GetCredentialSummary\x12?.org.apache.airavata.api.credential.GetCredentialSummaryRequest\x1a=.org.apache.airavata.model.credential.store.CredentialSummary\"&\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/credentials/{token_id}\x12\xd5\x01\n\x1eGetCredentialSummaryWithAccess\x12?.org.apache.airavata.api.credential.GetCredentialSummaryRequest\x1a?.org.apache.airavata.api.credential.CredentialSummaryWithAccess\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/credentials/{token_id}:withAccess\x12\xc5\x01\n\x19GetAllCredentialSummaries\x12\x44.org.apache.airavata.api.credential.GetAllCredentialSummariesRequest\x1a\x45.org.apache.airavata.api.credential.GetAllCredentialSummariesResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/api/v1/credentials\x12\x96\x01\n\x0f\x44\x65leteSSHPubKey\x12:.org.apache.airavata.api.credential.DeleteSSHPubKeyRequest\x1a\x16.google.protobuf.Empty\"/\x82\xd3\xe4\x93\x02)*\'/api/v1/credentials/ssh-keys/{token_id}\x12\x9f\x01\n\x13\x44\x65letePWDCredential\x12>.org.apache.airavata.api.credential.DeletePWDCredentialRequest\x1a\x16.google.protobuf.Empty\"0\x82\xd3\xe4\x93\x02**(/api/v1/credentials/passwords/{token_id}\x12\xe5\x01\n\x16\x44oesUserHaveSSHAccount\x12\x41.org.apache.airavata.api.credential.DoesUserHaveSSHAccountRequest\x1a\x42.org.apache.airavata.api.credential.DoesUserHaveSSHAccountResponse\"D\x82\xd3\xe4\x93\x02>\x12.org.apache.airavata.api.credential.IsSSHSetupCompleteResponse\"K\x82\xd3\xe4\x93\x02\x45\x12\x43/api/v1/credentials/ssh-accounts/{compute_resource_id}:setup-status\x12\xd3\x01\n\x0fSetupSSHAccount\x12:.org.apache.airavata.api.credential.SetupSSHAccountRequest\x1a;.org.apache.airavata.api.credential.SetupSSHAccountResponse\"G\x82\xd3\xe4\x93\x02\x41\"\022 None: ... +class CredentialSummaryWithAccess(_message.Message): + __slots__ = ("credential_summary", "access") + CREDENTIAL_SUMMARY_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + credential_summary: _credential_store_pb2.CredentialSummary + access: _commons_pb2.AccessFlags + def __init__(self, credential_summary: _Optional[_Union[_credential_store_pb2.CredentialSummary, _Mapping]] = ..., access: _Optional[_Union[_commons_pb2.AccessFlags, _Mapping]] = ...) -> None: ... + class GetAllCredentialSummariesRequest(_message.Message): __slots__ = ("gateway_id", "type") GATEWAY_ID_FIELD_NUMBER: _ClassVar[int] diff --git a/airavata-python-sdk/airavata_sdk/generated/services/credential_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/credential_service_pb2_grpc.py similarity index 89% rename from airavata-python-sdk/airavata_sdk/generated/services/credential_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/credential_service_pb2_grpc.py index 972c8418d49..c94f5f4df02 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/credential_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/credential_service_pb2_grpc.py @@ -4,8 +4,8 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.credential.store import credential_store_pb2 as org_dot_apache_dot_airavata_dot_model_dot_credential_dot_store_dot_credential__store__pb2 -from services import credential_service_pb2 as services_dot_credential__service__pb2 +from airavata.model.credential.store import credential_store_pb2 as org_dot_apache_dot_airavata_dot_model_dot_credential_dot_store_dot_credential__store__pb2 +from airavata.services import credential_service_pb2 as services_dot_credential__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ @@ -53,6 +53,11 @@ def __init__(self, channel): request_serializer=services_dot_credential__service__pb2.GetCredentialSummaryRequest.SerializeToString, response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_credential_dot_store_dot_credential__store__pb2.CredentialSummary.FromString, _registered_method=True) + self.GetCredentialSummaryWithAccess = channel.unary_unary( + '/org.apache.airavata.api.credential.CredentialService/GetCredentialSummaryWithAccess', + request_serializer=services_dot_credential__service__pb2.GetCredentialSummaryRequest.SerializeToString, + response_deserializer=services_dot_credential__service__pb2.CredentialSummaryWithAccess.FromString, + _registered_method=True) self.GetAllCredentialSummaries = channel.unary_unary( '/org.apache.airavata.api.credential.CredentialService/GetAllCredentialSummaries', request_serializer=services_dot_credential__service__pb2.GetAllCredentialSummariesRequest.SerializeToString, @@ -108,6 +113,15 @@ def GetCredentialSummary(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetCredentialSummaryWithAccess(self, request, context): + """Additive: GetCredentialSummary plus the caller's server-computed access + flags, so a client does not recompute access from a separate sharing + round-trip. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetAllCredentialSummaries(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -162,6 +176,11 @@ def add_CredentialServiceServicer_to_server(servicer, server): request_deserializer=services_dot_credential__service__pb2.GetCredentialSummaryRequest.FromString, response_serializer=org_dot_apache_dot_airavata_dot_model_dot_credential_dot_store_dot_credential__store__pb2.CredentialSummary.SerializeToString, ), + 'GetCredentialSummaryWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetCredentialSummaryWithAccess, + request_deserializer=services_dot_credential__service__pb2.GetCredentialSummaryRequest.FromString, + response_serializer=services_dot_credential__service__pb2.CredentialSummaryWithAccess.SerializeToString, + ), 'GetAllCredentialSummaries': grpc.unary_unary_rpc_method_handler( servicer.GetAllCredentialSummaries, request_deserializer=services_dot_credential__service__pb2.GetAllCredentialSummariesRequest.FromString, @@ -286,6 +305,33 @@ def GetCredentialSummary(request, metadata, _registered_method=True) + @staticmethod + def GetCredentialSummaryWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.credential.CredentialService/GetCredentialSummaryWithAccess', + services_dot_credential__service__pb2.GetCredentialSummaryRequest.SerializeToString, + services_dot_credential__service__pb2.CredentialSummaryWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetAllCredentialSummaries(request, target, diff --git a/airavata-python-sdk/airavata_sdk/generated/services/data_product_service_pb2.py b/airavata-python-sdk/airavata/services/data_product_service_pb2.py similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/services/data_product_service_pb2.py rename to airavata-python-sdk/airavata/services/data_product_service_pb2.py index e29ccb3bf2a..aa810b163bb 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/data_product_service_pb2.py +++ b/airavata-python-sdk/airavata/services/data_product_service_pb2.py @@ -24,7 +24,7 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.data.replica import replica_catalog_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2 +from airavata.model.data.replica import replica_catalog_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#services/data_product_service.proto\x12#org.apache.airavata.api.dataproduct\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a.org.apache.airavata.api.dataproduct.GetReplicaLocationRequest\x1a@.org.apache.airavata.model.data.replica.DataReplicaLocationModel\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/data-products/replicas/{replica_id}\x12\xb9\x01\n\x15UpdateReplicaLocation\x12\x41.org.apache.airavata.api.dataproduct.UpdateReplicaLocationRequest\x1a\x16.google.protobuf.Empty\"E\x82\xd3\xe4\x93\x02?\x1a+/api/v1/data-products/replicas/{replica_id}:\x10replica_location\x12\xa7\x01\n\x15\x44\x65leteReplicaLocation\x12\x41.org.apache.airavata.api.dataproduct.DeleteReplicaLocationRequest\x1a\x16.google.protobuf.Empty\"3\x82\xd3\xe4\x93\x02-*+/api/v1/data-products/replicas/{replica_id}B\'\n#org.apache.airavata.api.dataproductP\x01\x62\x06proto3') diff --git a/airavata-python-sdk/airavata_sdk/generated/services/data_product_service_pb2.pyi b/airavata-python-sdk/airavata/services/data_product_service_pb2.pyi similarity index 97% rename from airavata-python-sdk/airavata_sdk/generated/services/data_product_service_pb2.pyi rename to airavata-python-sdk/airavata/services/data_product_service_pb2.pyi index b37d032aa39..a8c799c7a72 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/data_product_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/data_product_service_pb2.pyi @@ -1,6 +1,6 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.data.replica import replica_catalog_pb2 as _replica_catalog_pb2 +from airavata.model.data.replica import replica_catalog_pb2 as _replica_catalog_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message diff --git a/airavata-python-sdk/airavata_sdk/generated/services/data_product_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/data_product_service_pb2_grpc.py similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/services/data_product_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/data_product_service_pb2_grpc.py index c103fcf2ab2..e6d1822668c 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/data_product_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/data_product_service_pb2_grpc.py @@ -4,8 +4,8 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.data.replica import replica_catalog_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2 -from services import data_product_service_pb2 as services_dot_data__product__service__pb2 +from airavata.model.data.replica import replica_catalog_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2 +from airavata.services import data_product_service_pb2 as services_dot_data__product__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ diff --git a/airavata-python-sdk/airavata_sdk/generated/services/experiment_management_service_pb2.py b/airavata-python-sdk/airavata/services/experiment_management_service_pb2.py similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/services/experiment_management_service_pb2.py rename to airavata-python-sdk/airavata/services/experiment_management_service_pb2.py diff --git a/airavata-python-sdk/airavata_sdk/generated/services/experiment_management_service_pb2.pyi b/airavata-python-sdk/airavata/services/experiment_management_service_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/services/experiment_management_service_pb2.pyi rename to airavata-python-sdk/airavata/services/experiment_management_service_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/services/experiment_management_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/experiment_management_service_pb2_grpc.py similarity index 99% rename from airavata-python-sdk/airavata_sdk/generated/services/experiment_management_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/experiment_management_service_pb2_grpc.py index 711f18fbfa3..d01e7594ee7 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/experiment_management_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/experiment_management_service_pb2_grpc.py @@ -3,7 +3,7 @@ import grpc import warnings -from services import experiment_management_service_pb2 as services_dot_experiment__management__service__pb2 +from airavata.services import experiment_management_service_pb2 as services_dot_experiment__management__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ diff --git a/airavata-python-sdk/airavata/services/experiment_service_pb2.py b/airavata-python-sdk/airavata/services/experiment_service_pb2.py new file mode 100644 index 00000000000..db88cca63e5 --- /dev/null +++ b/airavata-python-sdk/airavata/services/experiment_service_pb2.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/experiment_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/experiment_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.experiment import experiment_pb2 as org_dot_apache_dot_airavata_dot_model_dot_experiment_dot_experiment__pb2 +from airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 +from airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 +from airavata.model.job import job_pb2 as org_dot_apache_dot_airavata_dot_model_dot_job_dot_job__pb2 +from airavata.model.scheduling import scheduling_pb2 as org_dot_apache_dot_airavata_dot_model_dot_scheduling_dot_scheduling__pb2 +from airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 +from airavata.model.data.replica import replica_catalog_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2 +from airavata.model.appcatalog.appinterface import app_interface_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appinterface_dot_app__interface__pb2 +from airavata.model.appcatalog.appdeployment import app_deployment_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appdeployment_dot_app__deployment__pb2 +from airavata.model.appcatalog.computeresource import compute_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2 +from airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!services/experiment_service.proto\x12\"org.apache.airavata.api.experiment\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x35org/apache/airavata/model/experiment/experiment.proto\x1a-org/apache/airavata/model/status/status.proto\x1a=org/apache/airavata/model/application/io/application_io.proto\x1a\'org/apache/airavata/model/job/job.proto\x1a\x35org/apache/airavata/model/scheduling/scheduling.proto\x1a/org/apache/airavata/model/commons/commons.proto\x1a\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32..org.apache.airavata.model.commons.AccessFlags\"\xa7\x01\n\x15\x44\x61taProductWithAccess\x12N\n\x0c\x64\x61ta_product\x18\x01 \x01(\x0b\x32\x38.org.apache.airavata.model.data.replica.DataProductModel\x12>\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32..org.apache.airavata.model.commons.AccessFlags\"\x84\x06\n\x0e\x46ullExperiment\x12I\n\nexperiment\x18\x01 \x01(\x0b\x32\x35.org.apache.airavata.model.experiment.ExperimentModel\x12>\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32..org.apache.airavata.model.commons.AccessFlags\x12=\n\x07project\x18\x03 \x01(\x0b\x32,.org.apache.airavata.model.workspace.Project\x12\x61\n\x12\x61pplication_module\x18\x04 \x01(\x0b\x32\x45.org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule\x12q\n\x15\x61pplication_interface\x18\x05 \x01(\x0b\x32R.org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription\x12j\n\x10\x63ompute_resource\x18\x06 \x01(\x0b\x32P.org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription\x12V\n\x13input_data_products\x18\x07 \x03(\x0b\x32\x39.org.apache.airavata.api.experiment.DataProductWithAccess\x12W\n\x14output_data_products\x18\x08 \x03(\x0b\x32\x39.org.apache.airavata.api.experiment.DataProductWithAccess\x12\x35\n\x04jobs\x18\t \x03(\x0b\x32\'.org.apache.airavata.model.job.JobModel\"4\n\x1bGetExperimentByAdminRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"{\n\x17UpdateExperimentRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12I\n\nexperiment\x18\x02 \x01(\x0b\x32\x35.org.apache.airavata.model.experiment.ExperimentModel\"0\n\x17\x44\x65leteExperimentRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"\xec\x01\n\x18SearchExperimentsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x11\n\tuser_name\x18\x02 \x01(\t\x12Z\n\x07\x66ilters\x18\x03 \x03(\x0b\x32I.org.apache.airavata.api.experiment.SearchExperimentsRequest.FiltersEntry\x12\r\n\x05limit\x18\x04 \x01(\x05\x12\x0e\n\x06offset\x18\x05 \x01(\x05\x1a.\n\x0c\x46iltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"n\n\x19SearchExperimentsResponse\x12Q\n\x0b\x65xperiments\x18\x01 \x03(\x0b\x32<.org.apache.airavata.model.experiment.ExperimentSummaryModel\"\xac\x01\n\x1b\x45xperimentSummaryWithAccess\x12M\n\x07summary\x18\x01 \x01(\x0b\x32<.org.apache.airavata.model.experiment.ExperimentSummaryModel\x12>\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32..org.apache.airavata.model.commons.AccessFlags\"{\n#SearchExperimentsWithAccessResponse\x12T\n\x0b\x65xperiments\x18\x01 \x03(\x0b\x32?.org.apache.airavata.api.experiment.ExperimentSummaryWithAccess\"3\n\x1aGetExperimentStatusRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"4\n\x1bGetExperimentOutputsRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"o\n\x1cGetExperimentOutputsResponse\x12O\n\x07outputs\x18\x01 \x03(\x0b\x32>.org.apache.airavata.model.application.io.OutputDataObjectType\"S\n\x1eGetExperimentsInProjectRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x0e\n\x06offset\x18\x03 \x01(\x05\"m\n\x1fGetExperimentsInProjectResponse\x12J\n\x0b\x65xperiments\x18\x01 \x03(\x0b\x32\x35.org.apache.airavata.model.experiment.ExperimentModel\"z\n)GetExperimentsInProjectWithAccessResponse\x12M\n\x0b\x65xperiments\x18\x01 \x03(\x0b\x32\x38.org.apache.airavata.api.experiment.ExperimentWithAccess\"a\n\x19GetUserExperimentsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x11\n\tuser_name\x18\x02 \x01(\t\x12\r\n\x05limit\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x05\"h\n\x1aGetUserExperimentsResponse\x12J\n\x0b\x65xperiments\x18\x01 \x03(\x0b\x32\x35.org.apache.airavata.model.experiment.ExperimentModel\"9\n GetDetailedExperimentTreeRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"\x96\x01\n$UpdateExperimentConfigurationRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12W\n\rconfiguration\x18\x02 \x01(\x0b\x32@.org.apache.airavata.model.experiment.UserConfigurationDataModel\"\x98\x01\n\x1fUpdateResourceSchedulingRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12^\n\nscheduling\x18\x02 \x01(\x0b\x32J.org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel\"2\n\x19ValidateExperimentRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"I\n\x1aValidateExperimentResponse\x12\x10\n\x08is_valid\x18\x01 \x01(\x08\x12\x19\n\x11validation_errors\x18\x02 \x03(\t\"D\n\x17LaunchExperimentRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"p\n\'LaunchExperimentWithStorageSetupRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x1a\n\x12notification_email\x18\x03 \x01(\t\"G\n\x1aTerminateExperimentRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"o\n\x16\x43loneExperimentRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\x1b\n\x13new_experiment_name\x18\x02 \x01(\t\x12!\n\x19new_experiment_project_id\x18\x03 \x01(\t\"0\n\x17\x43loneExperimentResponse\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"}\n$CloneExperimentWithInputFilesRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\x1b\n\x13new_experiment_name\x18\x02 \x01(\t\x12!\n\x19new_experiment_project_id\x18\x03 \x01(\t\".\n\x15GetJobStatusesRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"\xdc\x01\n\x16GetJobStatusesResponse\x12\x61\n\x0cjob_statuses\x18\x01 \x03(\x0b\x32K.org.apache.airavata.api.experiment.GetJobStatusesResponse.JobStatusesEntry\x1a_\n\x10JobStatusesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.apache.airavata.model.status.JobStatus:\x02\x38\x01\"-\n\x14GetJobDetailsRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"N\n\x15GetJobDetailsResponse\x12\x35\n\x04jobs\x18\x01 \x03(\x0b\x32\'.org.apache.airavata.model.job.JobModel\"N\n\x1f\x46\x65tchIntermediateOutputsRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\x14\n\x0coutput_names\x18\x02 \x03(\t\"B\n)GetIntermediateOutputProcessStatusRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"\xc0\x01\n\x1eGetExperimentStatisticsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x11\n\tfrom_time\x18\x02 \x01(\x03\x12\x0f\n\x07to_time\x18\x03 \x01(\x03\x12\x11\n\tuser_name\x18\x04 \x01(\t\x12\x18\n\x10\x61pplication_name\x18\x05 \x01(\t\x12\x1a\n\x12resource_host_name\x18\x06 \x01(\t\x12\r\n\x05limit\x18\x07 \x01(\x05\x12\x0e\n\x06offset\x18\x08 \x01(\x05\"c\n\x1f\x43reateExperimentFromSpecRequest\x12@\n\x04spec\x18\x01 \x01(\x0b\x32\x32.org.apache.airavata.api.experiment.ExperimentSpec\"\xb7\x02\n\x0e\x45xperimentSpec\x12\x17\n\x0f\x65xperiment_name\x18\x01 \x01(\t\x12\x12\n\nproject_id\x18\x02 \x01(\t\x12 \n\x18\x61pplication_interface_id\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12N\n\x06inputs\x18\x05 \x03(\x0b\x32>.org.apache.airavata.api.experiment.ExperimentSpec.InputsEntry\x12\x42\n\x08resource\x18\x06 \x01(\x0b\x32\x30.org.apache.airavata.api.experiment.ResourceSpec\x1a-\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x86\x02\n\x0cResourceSpec\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x02 \x01(\t\x12\x12\n\nnode_count\x18\x03 \x01(\x05\x12\x17\n\x0ftotal_cpu_count\x18\x04 \x01(\x05\x12\x12\n\nqueue_name\x18\x05 \x01(\t\x12\x17\n\x0fwall_time_limit\x18\x06 \x01(\x05\x12!\n\x19input_storage_resource_id\x18\x07 \x01(\t\x12\"\n\x1aoutput_storage_resource_id\x18\x08 \x01(\t\x12\x15\n\rauto_schedule\x18\t \x01(\x08\x32\xd8/\n\x11\x45xperimentService\x12\xb6\x01\n\x10\x43reateExperiment\x12;.org.apache.airavata.api.experiment.CreateExperimentRequest\x1a<.org.apache.airavata.api.experiment.CreateExperimentResponse\"\'\x82\xd3\xe4\x93\x02!\"\x13/api/v1/experiments:\nexperiment\x12\xc7\x01\n\x1a\x43reateExperimentWithAccess\x12;.org.apache.airavata.api.experiment.CreateExperimentRequest\x1a\x38.org.apache.airavata.api.experiment.ExperimentWithAccess\"2\x82\xd3\xe4\x93\x02,\"\x1e/api/v1/experiments:withAccess:\nexperiment\x12\xad\x01\n\rGetExperiment\x12\x38.org.apache.airavata.api.experiment.GetExperimentRequest\x1a\x35.org.apache.airavata.model.experiment.ExperimentModel\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/experiments/{experiment_id}\x12\xc5\x01\n\x17GetExperimentWithAccess\x12\x38.org.apache.airavata.api.experiment.GetExperimentRequest\x1a\x38.org.apache.airavata.api.experiment.ExperimentWithAccess\"6\x82\xd3\xe4\x93\x02\x30\x12./api/v1/experiments/{experiment_id}:withAccess\x12\xb3\x01\n\x11GetFullExperiment\x12\x38.org.apache.airavata.api.experiment.GetExperimentRequest\x1a\x32.org.apache.airavata.api.experiment.FullExperiment\"0\x82\xd3\xe4\x93\x02*\x12(/api/v1/experiments/{experiment_id}:full\x12\xc1\x01\n\x14GetExperimentByAdmin\x12?.org.apache.airavata.api.experiment.GetExperimentByAdminRequest\x1a\x35.org.apache.airavata.model.experiment.ExperimentModel\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/experiments/{experiment_id}:admin\x12\xa0\x01\n\x10UpdateExperiment\x12;.org.apache.airavata.api.experiment.UpdateExperimentRequest\x1a\x16.google.protobuf.Empty\"7\x82\xd3\xe4\x93\x02\x31\x1a#/api/v1/experiments/{experiment_id}:\nexperiment\x12\xd7\x01\n\x1aUpdateExperimentWithAccess\x12;.org.apache.airavata.api.experiment.UpdateExperimentRequest\x1a\x38.org.apache.airavata.api.experiment.ExperimentWithAccess\"B\x82\xd3\xe4\x93\x02<\x1a./api/v1/experiments/{experiment_id}:withAccess:\nexperiment\x12\x94\x01\n\x10\x44\x65leteExperiment\x12;.org.apache.airavata.api.experiment.DeleteExperimentRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%*#/api/v1/experiments/{experiment_id}\x12\xad\x01\n\x11SearchExperiments\x12<.org.apache.airavata.api.experiment.SearchExperimentsRequest\x1a=.org.apache.airavata.api.experiment.SearchExperimentsResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/api/v1/experiments\x12\xcc\x01\n\x1bSearchExperimentsWithAccess\x12<.org.apache.airavata.api.experiment.SearchExperimentsRequest\x1aG.org.apache.airavata.api.experiment.SearchExperimentsWithAccessResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/experiments:withAccess\x12\xbd\x01\n\x13GetExperimentStatus\x12>.org.apache.airavata.api.experiment.GetExperimentStatusRequest\x1a\x32.org.apache.airavata.model.status.ExperimentStatus\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/experiments/{experiment_id}/status\x12\xce\x01\n\x14GetExperimentOutputs\x12?.org.apache.airavata.api.experiment.GetExperimentOutputsRequest\x1a@.org.apache.airavata.api.experiment.GetExperimentOutputsResponse\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/experiments/{experiment_id}/outputs\x12\xd5\x01\n\x17GetExperimentsInProject\x12\x42.org.apache.airavata.api.experiment.GetExperimentsInProjectRequest\x1a\x43.org.apache.airavata.api.experiment.GetExperimentsInProjectResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/projects/{project_id}/experiments\x12\xf4\x01\n!GetExperimentsInProjectWithAccess\x12\x42.org.apache.airavata.api.experiment.GetExperimentsInProjectRequest\x1aM.org.apache.airavata.api.experiment.GetExperimentsInProjectWithAccessResponse\"<\x82\xd3\xe4\x93\x02\x36\x12\x34/api/v1/projects/{project_id}/experiments:withAccess\x12\xd8\x01\n\x12GetUserExperiments\x12=.org.apache.airavata.api.experiment.GetUserExperimentsRequest\x1a>.org.apache.airavata.api.experiment.GetUserExperimentsResponse\"C\x82\xd3\xe4\x93\x02=\x12;/api/v1/gateways/{gateway_id}/users/{user_name}/experiments\x12\xce\x01\n\x19GetDetailedExperimentTree\x12\x44.org.apache.airavata.api.experiment.GetDetailedExperimentTreeRequest\x1a\x35.org.apache.airavata.model.experiment.ExperimentModel\"4\x82\xd3\xe4\x93\x02.\x12,/api/v1/experiments/{experiment_id}:detailed\x12\xcb\x01\n\x1dUpdateExperimentConfiguration\x12H.org.apache.airavata.api.experiment.UpdateExperimentConfigurationRequest\x1a\x16.google.protobuf.Empty\"H\x82\xd3\xe4\x93\x02\x42\x1a\x31/api/v1/experiments/{experiment_id}/configuration:\rconfiguration\x12\xbb\x01\n\x18UpdateResourceScheduling\x12\x43.org.apache.airavata.api.experiment.UpdateResourceSchedulingRequest\x1a\x16.google.protobuf.Empty\"B\x82\xd3\xe4\x93\x02<\x1a./api/v1/experiments/{experiment_id}/scheduling:\nscheduling\x12\xc9\x01\n\x12ValidateExperiment\x12=.org.apache.airavata.api.experiment.ValidateExperimentRequest\x1a>.org.apache.airavata.api.experiment.ValidateExperimentResponse\"4\x82\xd3\xe4\x93\x02.\",/api/v1/experiments/{experiment_id}:validate\x12\x9b\x01\n\x10LaunchExperiment\x12;.org.apache.airavata.api.experiment.LaunchExperimentRequest\x1a\x16.google.protobuf.Empty\"2\x82\xd3\xe4\x93\x02,\"*/api/v1/experiments/{experiment_id}:launch\x12\xc8\x01\n LaunchExperimentWithStorageSetup\x12K.org.apache.airavata.api.experiment.LaunchExperimentWithStorageSetupRequest\x1a\x16.google.protobuf.Empty\"?\x82\xd3\xe4\x93\x02\x39\"7/api/v1/experiments/{experiment_id}:launch-with-storage\x12\xa4\x01\n\x13TerminateExperiment\x12>.org.apache.airavata.api.experiment.TerminateExperimentRequest\x1a\x16.google.protobuf.Empty\"5\x82\xd3\xe4\x93\x02/\"-/api/v1/experiments/{experiment_id}:terminate\x12\xbd\x01\n\x0f\x43loneExperiment\x12:.org.apache.airavata.api.experiment.CloneExperimentRequest\x1a;.org.apache.airavata.api.experiment.CloneExperimentResponse\"1\x82\xd3\xe4\x93\x02+\")/api/v1/experiments/{experiment_id}:clone\x12\xe1\x01\n\x1d\x43loneExperimentWithInputFiles\x12H.org.apache.airavata.api.experiment.CloneExperimentWithInputFilesRequest\x1a\x38.org.apache.airavata.api.experiment.ExperimentWithAccess\"<\x82\xd3\xe4\x93\x02\x36\"4/api/v1/experiments/{experiment_id}:clone-with-files\x12\xc1\x01\n\x0eGetJobStatuses\x12\x39.org.apache.airavata.api.experiment.GetJobStatusesRequest\x1a:.org.apache.airavata.api.experiment.GetJobStatusesResponse\"8\x82\xd3\xe4\x93\x02\x32\x12\x30/api/v1/experiments/{experiment_id}/job-statuses\x12\xb6\x01\n\rGetJobDetails\x12\x38.org.apache.airavata.api.experiment.GetJobDetailsRequest\x1a\x39.org.apache.airavata.api.experiment.GetJobDetailsResponse\"0\x82\xd3\xe4\x93\x02*\x12(/api/v1/experiments/{experiment_id}/jobs\x12\xb2\x01\n\x18\x46\x65tchIntermediateOutputs\x12\x43.org.apache.airavata.api.experiment.FetchIntermediateOutputsRequest\x1a\x16.google.protobuf.Empty\"9\x82\xd3\xe4\x93\x02\x33\"1/api/v1/experiments/{experiment_id}:fetch-outputs\x12\xe5\x01\n\"GetIntermediateOutputProcessStatus\x12M.org.apache.airavata.api.experiment.GetIntermediateOutputProcessStatusRequest\x1a/.org.apache.airavata.model.status.ProcessStatus\"?\x82\xd3\xe4\x93\x02\x39\x12\x37/api/v1/experiments/{experiment_id}/intermediate-status\x12\xc0\x01\n\x17GetExperimentStatistics\x12\x42.org.apache.airavata.api.experiment.GetExperimentStatisticsRequest\x1a:.org.apache.airavata.model.experiment.ExperimentStatistics\"%\x82\xd3\xe4\x93\x02\x1f\x12\x1d/api/v1/experiment-statistics\x12\xc5\x01\n\x18\x43reateExperimentFromSpec\x12\x43.org.apache.airavata.api.experiment.CreateExperimentFromSpecRequest\x1a\x38.org.apache.airavata.api.experiment.ExperimentWithAccess\"*\x82\xd3\xe4\x93\x02$\"\x1c/api/v1/experiments:fromSpec:\x04specB&\n\"org.apache.airavata.api.experimentP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.experiment_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\"org.apache.airavata.api.experimentP\001' + _globals['_SEARCHEXPERIMENTSREQUEST_FILTERSENTRY']._loaded_options = None + _globals['_SEARCHEXPERIMENTSREQUEST_FILTERSENTRY']._serialized_options = b'8\001' + _globals['_GETJOBSTATUSESRESPONSE_JOBSTATUSESENTRY']._loaded_options = None + _globals['_GETJOBSTATUSESRESPONSE_JOBSTATUSESENTRY']._serialized_options = b'8\001' + _globals['_EXPERIMENTSPEC_INPUTSENTRY']._loaded_options = None + _globals['_EXPERIMENTSPEC_INPUTSENTRY']._serialized_options = b'8\001' + _globals['_EXPERIMENTSERVICE'].methods_by_name['CreateExperiment']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['CreateExperiment']._serialized_options = b'\202\323\344\223\002!\"\023/api/v1/experiments:\nexperiment' + _globals['_EXPERIMENTSERVICE'].methods_by_name['CreateExperimentWithAccess']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['CreateExperimentWithAccess']._serialized_options = b'\202\323\344\223\002,\"\036/api/v1/experiments:withAccess:\nexperiment' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperiment']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperiment']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/experiments/{experiment_id}' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentWithAccess']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentWithAccess']._serialized_options = b'\202\323\344\223\0020\022./api/v1/experiments/{experiment_id}:withAccess' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetFullExperiment']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetFullExperiment']._serialized_options = b'\202\323\344\223\002*\022(/api/v1/experiments/{experiment_id}:full' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentByAdmin']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentByAdmin']._serialized_options = b'\202\323\344\223\002+\022)/api/v1/experiments/{experiment_id}:admin' + _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateExperiment']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateExperiment']._serialized_options = b'\202\323\344\223\0021\032#/api/v1/experiments/{experiment_id}:\nexperiment' + _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateExperimentWithAccess']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateExperimentWithAccess']._serialized_options = b'\202\323\344\223\002<\032./api/v1/experiments/{experiment_id}:withAccess:\nexperiment' + _globals['_EXPERIMENTSERVICE'].methods_by_name['DeleteExperiment']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['DeleteExperiment']._serialized_options = b'\202\323\344\223\002%*#/api/v1/experiments/{experiment_id}' + _globals['_EXPERIMENTSERVICE'].methods_by_name['SearchExperiments']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['SearchExperiments']._serialized_options = b'\202\323\344\223\002\025\022\023/api/v1/experiments' + _globals['_EXPERIMENTSERVICE'].methods_by_name['SearchExperimentsWithAccess']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['SearchExperimentsWithAccess']._serialized_options = b'\202\323\344\223\002 \022\036/api/v1/experiments:withAccess' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentStatus']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentStatus']._serialized_options = b'\202\323\344\223\002,\022*/api/v1/experiments/{experiment_id}/status' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentOutputs']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentOutputs']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/experiments/{experiment_id}/outputs' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentsInProject']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentsInProject']._serialized_options = b'\202\323\344\223\002+\022)/api/v1/projects/{project_id}/experiments' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentsInProjectWithAccess']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentsInProjectWithAccess']._serialized_options = b'\202\323\344\223\0026\0224/api/v1/projects/{project_id}/experiments:withAccess' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetUserExperiments']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetUserExperiments']._serialized_options = b'\202\323\344\223\002=\022;/api/v1/gateways/{gateway_id}/users/{user_name}/experiments' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetDetailedExperimentTree']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetDetailedExperimentTree']._serialized_options = b'\202\323\344\223\002.\022,/api/v1/experiments/{experiment_id}:detailed' + _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateExperimentConfiguration']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateExperimentConfiguration']._serialized_options = b'\202\323\344\223\002B\0321/api/v1/experiments/{experiment_id}/configuration:\rconfiguration' + _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateResourceScheduling']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateResourceScheduling']._serialized_options = b'\202\323\344\223\002<\032./api/v1/experiments/{experiment_id}/scheduling:\nscheduling' + _globals['_EXPERIMENTSERVICE'].methods_by_name['ValidateExperiment']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['ValidateExperiment']._serialized_options = b'\202\323\344\223\002.\",/api/v1/experiments/{experiment_id}:validate' + _globals['_EXPERIMENTSERVICE'].methods_by_name['LaunchExperiment']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['LaunchExperiment']._serialized_options = b'\202\323\344\223\002,\"*/api/v1/experiments/{experiment_id}:launch' + _globals['_EXPERIMENTSERVICE'].methods_by_name['LaunchExperimentWithStorageSetup']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['LaunchExperimentWithStorageSetup']._serialized_options = b'\202\323\344\223\0029\"7/api/v1/experiments/{experiment_id}:launch-with-storage' + _globals['_EXPERIMENTSERVICE'].methods_by_name['TerminateExperiment']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['TerminateExperiment']._serialized_options = b'\202\323\344\223\002/\"-/api/v1/experiments/{experiment_id}:terminate' + _globals['_EXPERIMENTSERVICE'].methods_by_name['CloneExperiment']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['CloneExperiment']._serialized_options = b'\202\323\344\223\002+\")/api/v1/experiments/{experiment_id}:clone' + _globals['_EXPERIMENTSERVICE'].methods_by_name['CloneExperimentWithInputFiles']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['CloneExperimentWithInputFiles']._serialized_options = b'\202\323\344\223\0026\"4/api/v1/experiments/{experiment_id}:clone-with-files' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetJobStatuses']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetJobStatuses']._serialized_options = b'\202\323\344\223\0022\0220/api/v1/experiments/{experiment_id}/job-statuses' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetJobDetails']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetJobDetails']._serialized_options = b'\202\323\344\223\002*\022(/api/v1/experiments/{experiment_id}/jobs' + _globals['_EXPERIMENTSERVICE'].methods_by_name['FetchIntermediateOutputs']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['FetchIntermediateOutputs']._serialized_options = b'\202\323\344\223\0023\"1/api/v1/experiments/{experiment_id}:fetch-outputs' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetIntermediateOutputProcessStatus']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetIntermediateOutputProcessStatus']._serialized_options = b'\202\323\344\223\0029\0227/api/v1/experiments/{experiment_id}/intermediate-status' + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentStatistics']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentStatistics']._serialized_options = b'\202\323\344\223\002\037\022\035/api/v1/experiment-statistics' + _globals['_EXPERIMENTSERVICE'].methods_by_name['CreateExperimentFromSpec']._loaded_options = None + _globals['_EXPERIMENTSERVICE'].methods_by_name['CreateExperimentFromSpec']._serialized_options = b'\202\323\344\223\002$\"\034/api/v1/experiments:fromSpec:\004spec' + _globals['_CREATEEXPERIMENTREQUEST']._serialized_start=778 + _globals['_CREATEEXPERIMENTREQUEST']._serialized_end=898 + _globals['_CREATEEXPERIMENTRESPONSE']._serialized_start=900 + _globals['_CREATEEXPERIMENTRESPONSE']._serialized_end=949 + _globals['_GETEXPERIMENTREQUEST']._serialized_start=951 + _globals['_GETEXPERIMENTREQUEST']._serialized_end=996 + _globals['_EXPERIMENTWITHACCESS']._serialized_start=999 + _globals['_EXPERIMENTWITHACCESS']._serialized_end=1160 + _globals['_DATAPRODUCTWITHACCESS']._serialized_start=1163 + _globals['_DATAPRODUCTWITHACCESS']._serialized_end=1330 + _globals['_FULLEXPERIMENT']._serialized_start=1333 + _globals['_FULLEXPERIMENT']._serialized_end=2105 + _globals['_GETEXPERIMENTBYADMINREQUEST']._serialized_start=2107 + _globals['_GETEXPERIMENTBYADMINREQUEST']._serialized_end=2159 + _globals['_UPDATEEXPERIMENTREQUEST']._serialized_start=2161 + _globals['_UPDATEEXPERIMENTREQUEST']._serialized_end=2284 + _globals['_DELETEEXPERIMENTREQUEST']._serialized_start=2286 + _globals['_DELETEEXPERIMENTREQUEST']._serialized_end=2334 + _globals['_SEARCHEXPERIMENTSREQUEST']._serialized_start=2337 + _globals['_SEARCHEXPERIMENTSREQUEST']._serialized_end=2573 + _globals['_SEARCHEXPERIMENTSREQUEST_FILTERSENTRY']._serialized_start=2527 + _globals['_SEARCHEXPERIMENTSREQUEST_FILTERSENTRY']._serialized_end=2573 + _globals['_SEARCHEXPERIMENTSRESPONSE']._serialized_start=2575 + _globals['_SEARCHEXPERIMENTSRESPONSE']._serialized_end=2685 + _globals['_EXPERIMENTSUMMARYWITHACCESS']._serialized_start=2688 + _globals['_EXPERIMENTSUMMARYWITHACCESS']._serialized_end=2860 + _globals['_SEARCHEXPERIMENTSWITHACCESSRESPONSE']._serialized_start=2862 + _globals['_SEARCHEXPERIMENTSWITHACCESSRESPONSE']._serialized_end=2985 + _globals['_GETEXPERIMENTSTATUSREQUEST']._serialized_start=2987 + _globals['_GETEXPERIMENTSTATUSREQUEST']._serialized_end=3038 + _globals['_GETEXPERIMENTOUTPUTSREQUEST']._serialized_start=3040 + _globals['_GETEXPERIMENTOUTPUTSREQUEST']._serialized_end=3092 + _globals['_GETEXPERIMENTOUTPUTSRESPONSE']._serialized_start=3094 + _globals['_GETEXPERIMENTOUTPUTSRESPONSE']._serialized_end=3205 + _globals['_GETEXPERIMENTSINPROJECTREQUEST']._serialized_start=3207 + _globals['_GETEXPERIMENTSINPROJECTREQUEST']._serialized_end=3290 + _globals['_GETEXPERIMENTSINPROJECTRESPONSE']._serialized_start=3292 + _globals['_GETEXPERIMENTSINPROJECTRESPONSE']._serialized_end=3401 + _globals['_GETEXPERIMENTSINPROJECTWITHACCESSRESPONSE']._serialized_start=3403 + _globals['_GETEXPERIMENTSINPROJECTWITHACCESSRESPONSE']._serialized_end=3525 + _globals['_GETUSEREXPERIMENTSREQUEST']._serialized_start=3527 + _globals['_GETUSEREXPERIMENTSREQUEST']._serialized_end=3624 + _globals['_GETUSEREXPERIMENTSRESPONSE']._serialized_start=3626 + _globals['_GETUSEREXPERIMENTSRESPONSE']._serialized_end=3730 + _globals['_GETDETAILEDEXPERIMENTTREEREQUEST']._serialized_start=3732 + _globals['_GETDETAILEDEXPERIMENTTREEREQUEST']._serialized_end=3789 + _globals['_UPDATEEXPERIMENTCONFIGURATIONREQUEST']._serialized_start=3792 + _globals['_UPDATEEXPERIMENTCONFIGURATIONREQUEST']._serialized_end=3942 + _globals['_UPDATERESOURCESCHEDULINGREQUEST']._serialized_start=3945 + _globals['_UPDATERESOURCESCHEDULINGREQUEST']._serialized_end=4097 + _globals['_VALIDATEEXPERIMENTREQUEST']._serialized_start=4099 + _globals['_VALIDATEEXPERIMENTREQUEST']._serialized_end=4149 + _globals['_VALIDATEEXPERIMENTRESPONSE']._serialized_start=4151 + _globals['_VALIDATEEXPERIMENTRESPONSE']._serialized_end=4224 + _globals['_LAUNCHEXPERIMENTREQUEST']._serialized_start=4226 + _globals['_LAUNCHEXPERIMENTREQUEST']._serialized_end=4294 + _globals['_LAUNCHEXPERIMENTWITHSTORAGESETUPREQUEST']._serialized_start=4296 + _globals['_LAUNCHEXPERIMENTWITHSTORAGESETUPREQUEST']._serialized_end=4408 + _globals['_TERMINATEEXPERIMENTREQUEST']._serialized_start=4410 + _globals['_TERMINATEEXPERIMENTREQUEST']._serialized_end=4481 + _globals['_CLONEEXPERIMENTREQUEST']._serialized_start=4483 + _globals['_CLONEEXPERIMENTREQUEST']._serialized_end=4594 + _globals['_CLONEEXPERIMENTRESPONSE']._serialized_start=4596 + _globals['_CLONEEXPERIMENTRESPONSE']._serialized_end=4644 + _globals['_CLONEEXPERIMENTWITHINPUTFILESREQUEST']._serialized_start=4646 + _globals['_CLONEEXPERIMENTWITHINPUTFILESREQUEST']._serialized_end=4771 + _globals['_GETJOBSTATUSESREQUEST']._serialized_start=4773 + _globals['_GETJOBSTATUSESREQUEST']._serialized_end=4819 + _globals['_GETJOBSTATUSESRESPONSE']._serialized_start=4822 + _globals['_GETJOBSTATUSESRESPONSE']._serialized_end=5042 + _globals['_GETJOBSTATUSESRESPONSE_JOBSTATUSESENTRY']._serialized_start=4947 + _globals['_GETJOBSTATUSESRESPONSE_JOBSTATUSESENTRY']._serialized_end=5042 + _globals['_GETJOBDETAILSREQUEST']._serialized_start=5044 + _globals['_GETJOBDETAILSREQUEST']._serialized_end=5089 + _globals['_GETJOBDETAILSRESPONSE']._serialized_start=5091 + _globals['_GETJOBDETAILSRESPONSE']._serialized_end=5169 + _globals['_FETCHINTERMEDIATEOUTPUTSREQUEST']._serialized_start=5171 + _globals['_FETCHINTERMEDIATEOUTPUTSREQUEST']._serialized_end=5249 + _globals['_GETINTERMEDIATEOUTPUTPROCESSSTATUSREQUEST']._serialized_start=5251 + _globals['_GETINTERMEDIATEOUTPUTPROCESSSTATUSREQUEST']._serialized_end=5317 + _globals['_GETEXPERIMENTSTATISTICSREQUEST']._serialized_start=5320 + _globals['_GETEXPERIMENTSTATISTICSREQUEST']._serialized_end=5512 + _globals['_CREATEEXPERIMENTFROMSPECREQUEST']._serialized_start=5514 + _globals['_CREATEEXPERIMENTFROMSPECREQUEST']._serialized_end=5613 + _globals['_EXPERIMENTSPEC']._serialized_start=5616 + _globals['_EXPERIMENTSPEC']._serialized_end=5927 + _globals['_EXPERIMENTSPEC_INPUTSENTRY']._serialized_start=5882 + _globals['_EXPERIMENTSPEC_INPUTSENTRY']._serialized_end=5927 + _globals['_RESOURCESPEC']._serialized_start=5930 + _globals['_RESOURCESPEC']._serialized_end=6192 + _globals['_EXPERIMENTSERVICE']._serialized_start=6195 + _globals['_EXPERIMENTSERVICE']._serialized_end=12299 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/experiment_service_pb2.pyi b/airavata-python-sdk/airavata/services/experiment_service_pb2.pyi similarity index 58% rename from airavata-python-sdk/airavata_sdk/generated/services/experiment_service_pb2.pyi rename to airavata-python-sdk/airavata/services/experiment_service_pb2.pyi index 7816b1659ff..8ae5c9daf3e 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/experiment_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/experiment_service_pb2.pyi @@ -1,10 +1,16 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.experiment import experiment_pb2 as _experiment_pb2 -from org.apache.airavata.model.status import status_pb2 as _status_pb2 -from org.apache.airavata.model.application.io import application_io_pb2 as _application_io_pb2 -from org.apache.airavata.model.job import job_pb2 as _job_pb2 -from org.apache.airavata.model.scheduling import scheduling_pb2 as _scheduling_pb2 +from airavata.model.experiment import experiment_pb2 as _experiment_pb2 +from airavata.model.status import status_pb2 as _status_pb2 +from airavata.model.application.io import application_io_pb2 as _application_io_pb2 +from airavata.model.job import job_pb2 as _job_pb2 +from airavata.model.scheduling import scheduling_pb2 as _scheduling_pb2 +from airavata.model.commons import commons_pb2 as _commons_pb2 +from airavata.model.data.replica import replica_catalog_pb2 as _replica_catalog_pb2 +from airavata.model.appcatalog.appinterface import app_interface_pb2 as _app_interface_pb2 +from airavata.model.appcatalog.appdeployment import app_deployment_pb2 as _app_deployment_pb2 +from airavata.model.appcatalog.computeresource import compute_resource_pb2 as _compute_resource_pb2 +from airavata.model.workspace import workspace_pb2 as _workspace_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -33,6 +39,44 @@ class GetExperimentRequest(_message.Message): experiment_id: str def __init__(self, experiment_id: _Optional[str] = ...) -> None: ... +class ExperimentWithAccess(_message.Message): + __slots__ = ("experiment", "access") + EXPERIMENT_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + experiment: _experiment_pb2.ExperimentModel + access: _commons_pb2.AccessFlags + def __init__(self, experiment: _Optional[_Union[_experiment_pb2.ExperimentModel, _Mapping]] = ..., access: _Optional[_Union[_commons_pb2.AccessFlags, _Mapping]] = ...) -> None: ... + +class DataProductWithAccess(_message.Message): + __slots__ = ("data_product", "access") + DATA_PRODUCT_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + data_product: _replica_catalog_pb2.DataProductModel + access: _commons_pb2.AccessFlags + def __init__(self, data_product: _Optional[_Union[_replica_catalog_pb2.DataProductModel, _Mapping]] = ..., access: _Optional[_Union[_commons_pb2.AccessFlags, _Mapping]] = ...) -> None: ... + +class FullExperiment(_message.Message): + __slots__ = ("experiment", "access", "project", "application_module", "application_interface", "compute_resource", "input_data_products", "output_data_products", "jobs") + EXPERIMENT_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + PROJECT_FIELD_NUMBER: _ClassVar[int] + APPLICATION_MODULE_FIELD_NUMBER: _ClassVar[int] + APPLICATION_INTERFACE_FIELD_NUMBER: _ClassVar[int] + COMPUTE_RESOURCE_FIELD_NUMBER: _ClassVar[int] + INPUT_DATA_PRODUCTS_FIELD_NUMBER: _ClassVar[int] + OUTPUT_DATA_PRODUCTS_FIELD_NUMBER: _ClassVar[int] + JOBS_FIELD_NUMBER: _ClassVar[int] + experiment: _experiment_pb2.ExperimentModel + access: _commons_pb2.AccessFlags + project: _workspace_pb2.Project + application_module: _app_deployment_pb2.ApplicationModule + application_interface: _app_interface_pb2.ApplicationInterfaceDescription + compute_resource: _compute_resource_pb2.ComputeResourceDescription + input_data_products: _containers.RepeatedCompositeFieldContainer[DataProductWithAccess] + output_data_products: _containers.RepeatedCompositeFieldContainer[DataProductWithAccess] + jobs: _containers.RepeatedCompositeFieldContainer[_job_pb2.JobModel] + def __init__(self, experiment: _Optional[_Union[_experiment_pb2.ExperimentModel, _Mapping]] = ..., access: _Optional[_Union[_commons_pb2.AccessFlags, _Mapping]] = ..., project: _Optional[_Union[_workspace_pb2.Project, _Mapping]] = ..., application_module: _Optional[_Union[_app_deployment_pb2.ApplicationModule, _Mapping]] = ..., application_interface: _Optional[_Union[_app_interface_pb2.ApplicationInterfaceDescription, _Mapping]] = ..., compute_resource: _Optional[_Union[_compute_resource_pb2.ComputeResourceDescription, _Mapping]] = ..., input_data_products: _Optional[_Iterable[_Union[DataProductWithAccess, _Mapping]]] = ..., output_data_products: _Optional[_Iterable[_Union[DataProductWithAccess, _Mapping]]] = ..., jobs: _Optional[_Iterable[_Union[_job_pb2.JobModel, _Mapping]]] = ...) -> None: ... + class GetExperimentByAdminRequest(_message.Message): __slots__ = ("experiment_id",) EXPERIMENT_ID_FIELD_NUMBER: _ClassVar[int] @@ -80,6 +124,20 @@ class SearchExperimentsResponse(_message.Message): experiments: _containers.RepeatedCompositeFieldContainer[_experiment_pb2.ExperimentSummaryModel] def __init__(self, experiments: _Optional[_Iterable[_Union[_experiment_pb2.ExperimentSummaryModel, _Mapping]]] = ...) -> None: ... +class ExperimentSummaryWithAccess(_message.Message): + __slots__ = ("summary", "access") + SUMMARY_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + summary: _experiment_pb2.ExperimentSummaryModel + access: _commons_pb2.AccessFlags + def __init__(self, summary: _Optional[_Union[_experiment_pb2.ExperimentSummaryModel, _Mapping]] = ..., access: _Optional[_Union[_commons_pb2.AccessFlags, _Mapping]] = ...) -> None: ... + +class SearchExperimentsWithAccessResponse(_message.Message): + __slots__ = ("experiments",) + EXPERIMENTS_FIELD_NUMBER: _ClassVar[int] + experiments: _containers.RepeatedCompositeFieldContainer[ExperimentSummaryWithAccess] + def __init__(self, experiments: _Optional[_Iterable[_Union[ExperimentSummaryWithAccess, _Mapping]]] = ...) -> None: ... + class GetExperimentStatusRequest(_message.Message): __slots__ = ("experiment_id",) EXPERIMENT_ID_FIELD_NUMBER: _ClassVar[int] @@ -114,6 +172,12 @@ class GetExperimentsInProjectResponse(_message.Message): experiments: _containers.RepeatedCompositeFieldContainer[_experiment_pb2.ExperimentModel] def __init__(self, experiments: _Optional[_Iterable[_Union[_experiment_pb2.ExperimentModel, _Mapping]]] = ...) -> None: ... +class GetExperimentsInProjectWithAccessResponse(_message.Message): + __slots__ = ("experiments",) + EXPERIMENTS_FIELD_NUMBER: _ClassVar[int] + experiments: _containers.RepeatedCompositeFieldContainer[ExperimentWithAccess] + def __init__(self, experiments: _Optional[_Iterable[_Union[ExperimentWithAccess, _Mapping]]] = ...) -> None: ... + class GetUserExperimentsRequest(_message.Message): __slots__ = ("gateway_id", "user_name", "limit", "offset") GATEWAY_ID_FIELD_NUMBER: _ClassVar[int] @@ -176,6 +240,16 @@ class LaunchExperimentRequest(_message.Message): gateway_id: str def __init__(self, experiment_id: _Optional[str] = ..., gateway_id: _Optional[str] = ...) -> None: ... +class LaunchExperimentWithStorageSetupRequest(_message.Message): + __slots__ = ("experiment_id", "gateway_id", "notification_email") + EXPERIMENT_ID_FIELD_NUMBER: _ClassVar[int] + GATEWAY_ID_FIELD_NUMBER: _ClassVar[int] + NOTIFICATION_EMAIL_FIELD_NUMBER: _ClassVar[int] + experiment_id: str + gateway_id: str + notification_email: str + def __init__(self, experiment_id: _Optional[str] = ..., gateway_id: _Optional[str] = ..., notification_email: _Optional[str] = ...) -> None: ... + class TerminateExperimentRequest(_message.Message): __slots__ = ("experiment_id", "gateway_id") EXPERIMENT_ID_FIELD_NUMBER: _ClassVar[int] @@ -200,6 +274,16 @@ class CloneExperimentResponse(_message.Message): experiment_id: str def __init__(self, experiment_id: _Optional[str] = ...) -> None: ... +class CloneExperimentWithInputFilesRequest(_message.Message): + __slots__ = ("experiment_id", "new_experiment_name", "new_experiment_project_id") + EXPERIMENT_ID_FIELD_NUMBER: _ClassVar[int] + NEW_EXPERIMENT_NAME_FIELD_NUMBER: _ClassVar[int] + NEW_EXPERIMENT_PROJECT_ID_FIELD_NUMBER: _ClassVar[int] + experiment_id: str + new_experiment_name: str + new_experiment_project_id: str + def __init__(self, experiment_id: _Optional[str] = ..., new_experiment_name: _Optional[str] = ..., new_experiment_project_id: _Optional[str] = ...) -> None: ... + class GetJobStatusesRequest(_message.Message): __slots__ = ("experiment_id",) EXPERIMENT_ID_FIELD_NUMBER: _ClassVar[int] @@ -264,3 +348,54 @@ class GetExperimentStatisticsRequest(_message.Message): limit: int offset: int def __init__(self, gateway_id: _Optional[str] = ..., from_time: _Optional[int] = ..., to_time: _Optional[int] = ..., user_name: _Optional[str] = ..., application_name: _Optional[str] = ..., resource_host_name: _Optional[str] = ..., limit: _Optional[int] = ..., offset: _Optional[int] = ...) -> None: ... + +class CreateExperimentFromSpecRequest(_message.Message): + __slots__ = ("spec",) + SPEC_FIELD_NUMBER: _ClassVar[int] + spec: ExperimentSpec + def __init__(self, spec: _Optional[_Union[ExperimentSpec, _Mapping]] = ...) -> None: ... + +class ExperimentSpec(_message.Message): + __slots__ = ("experiment_name", "project_id", "application_interface_id", "description", "inputs", "resource") + class InputsEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: str + def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... + EXPERIMENT_NAME_FIELD_NUMBER: _ClassVar[int] + PROJECT_ID_FIELD_NUMBER: _ClassVar[int] + APPLICATION_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] + DESCRIPTION_FIELD_NUMBER: _ClassVar[int] + INPUTS_FIELD_NUMBER: _ClassVar[int] + RESOURCE_FIELD_NUMBER: _ClassVar[int] + experiment_name: str + project_id: str + application_interface_id: str + description: str + inputs: _containers.ScalarMap[str, str] + resource: ResourceSpec + def __init__(self, experiment_name: _Optional[str] = ..., project_id: _Optional[str] = ..., application_interface_id: _Optional[str] = ..., description: _Optional[str] = ..., inputs: _Optional[_Mapping[str, str]] = ..., resource: _Optional[_Union[ResourceSpec, _Mapping]] = ...) -> None: ... + +class ResourceSpec(_message.Message): + __slots__ = ("compute_resource_id", "group_resource_profile_id", "node_count", "total_cpu_count", "queue_name", "wall_time_limit", "input_storage_resource_id", "output_storage_resource_id", "auto_schedule") + COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + GROUP_RESOURCE_PROFILE_ID_FIELD_NUMBER: _ClassVar[int] + NODE_COUNT_FIELD_NUMBER: _ClassVar[int] + TOTAL_CPU_COUNT_FIELD_NUMBER: _ClassVar[int] + QUEUE_NAME_FIELD_NUMBER: _ClassVar[int] + WALL_TIME_LIMIT_FIELD_NUMBER: _ClassVar[int] + INPUT_STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + OUTPUT_STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + AUTO_SCHEDULE_FIELD_NUMBER: _ClassVar[int] + compute_resource_id: str + group_resource_profile_id: str + node_count: int + total_cpu_count: int + queue_name: str + wall_time_limit: int + input_storage_resource_id: str + output_storage_resource_id: str + auto_schedule: bool + def __init__(self, compute_resource_id: _Optional[str] = ..., group_resource_profile_id: _Optional[str] = ..., node_count: _Optional[int] = ..., total_cpu_count: _Optional[int] = ..., queue_name: _Optional[str] = ..., wall_time_limit: _Optional[int] = ..., input_storage_resource_id: _Optional[str] = ..., output_storage_resource_id: _Optional[str] = ..., auto_schedule: bool = ...) -> None: ... diff --git a/airavata-python-sdk/airavata_sdk/generated/services/experiment_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/experiment_service_pb2_grpc.py similarity index 69% rename from airavata-python-sdk/airavata_sdk/generated/services/experiment_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/experiment_service_pb2_grpc.py index 77f0d165041..daab48f15e8 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/experiment_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/experiment_service_pb2_grpc.py @@ -4,9 +4,9 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.experiment import experiment_pb2 as org_dot_apache_dot_airavata_dot_model_dot_experiment_dot_experiment__pb2 -from org.apache.airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 -from services import experiment_service_pb2 as services_dot_experiment__service__pb2 +from airavata.model.experiment import experiment_pb2 as org_dot_apache_dot_airavata_dot_model_dot_experiment_dot_experiment__pb2 +from airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 +from airavata.services import experiment_service_pb2 as services_dot_experiment__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ @@ -43,11 +43,26 @@ def __init__(self, channel): request_serializer=services_dot_experiment__service__pb2.CreateExperimentRequest.SerializeToString, response_deserializer=services_dot_experiment__service__pb2.CreateExperimentResponse.FromString, _registered_method=True) + self.CreateExperimentWithAccess = channel.unary_unary( + '/org.apache.airavata.api.experiment.ExperimentService/CreateExperimentWithAccess', + request_serializer=services_dot_experiment__service__pb2.CreateExperimentRequest.SerializeToString, + response_deserializer=services_dot_experiment__service__pb2.ExperimentWithAccess.FromString, + _registered_method=True) self.GetExperiment = channel.unary_unary( '/org.apache.airavata.api.experiment.ExperimentService/GetExperiment', request_serializer=services_dot_experiment__service__pb2.GetExperimentRequest.SerializeToString, response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_experiment_dot_experiment__pb2.ExperimentModel.FromString, _registered_method=True) + self.GetExperimentWithAccess = channel.unary_unary( + '/org.apache.airavata.api.experiment.ExperimentService/GetExperimentWithAccess', + request_serializer=services_dot_experiment__service__pb2.GetExperimentRequest.SerializeToString, + response_deserializer=services_dot_experiment__service__pb2.ExperimentWithAccess.FromString, + _registered_method=True) + self.GetFullExperiment = channel.unary_unary( + '/org.apache.airavata.api.experiment.ExperimentService/GetFullExperiment', + request_serializer=services_dot_experiment__service__pb2.GetExperimentRequest.SerializeToString, + response_deserializer=services_dot_experiment__service__pb2.FullExperiment.FromString, + _registered_method=True) self.GetExperimentByAdmin = channel.unary_unary( '/org.apache.airavata.api.experiment.ExperimentService/GetExperimentByAdmin', request_serializer=services_dot_experiment__service__pb2.GetExperimentByAdminRequest.SerializeToString, @@ -58,6 +73,11 @@ def __init__(self, channel): request_serializer=services_dot_experiment__service__pb2.UpdateExperimentRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) + self.UpdateExperimentWithAccess = channel.unary_unary( + '/org.apache.airavata.api.experiment.ExperimentService/UpdateExperimentWithAccess', + request_serializer=services_dot_experiment__service__pb2.UpdateExperimentRequest.SerializeToString, + response_deserializer=services_dot_experiment__service__pb2.ExperimentWithAccess.FromString, + _registered_method=True) self.DeleteExperiment = channel.unary_unary( '/org.apache.airavata.api.experiment.ExperimentService/DeleteExperiment', request_serializer=services_dot_experiment__service__pb2.DeleteExperimentRequest.SerializeToString, @@ -68,6 +88,11 @@ def __init__(self, channel): request_serializer=services_dot_experiment__service__pb2.SearchExperimentsRequest.SerializeToString, response_deserializer=services_dot_experiment__service__pb2.SearchExperimentsResponse.FromString, _registered_method=True) + self.SearchExperimentsWithAccess = channel.unary_unary( + '/org.apache.airavata.api.experiment.ExperimentService/SearchExperimentsWithAccess', + request_serializer=services_dot_experiment__service__pb2.SearchExperimentsRequest.SerializeToString, + response_deserializer=services_dot_experiment__service__pb2.SearchExperimentsWithAccessResponse.FromString, + _registered_method=True) self.GetExperimentStatus = channel.unary_unary( '/org.apache.airavata.api.experiment.ExperimentService/GetExperimentStatus', request_serializer=services_dot_experiment__service__pb2.GetExperimentStatusRequest.SerializeToString, @@ -83,6 +108,11 @@ def __init__(self, channel): request_serializer=services_dot_experiment__service__pb2.GetExperimentsInProjectRequest.SerializeToString, response_deserializer=services_dot_experiment__service__pb2.GetExperimentsInProjectResponse.FromString, _registered_method=True) + self.GetExperimentsInProjectWithAccess = channel.unary_unary( + '/org.apache.airavata.api.experiment.ExperimentService/GetExperimentsInProjectWithAccess', + request_serializer=services_dot_experiment__service__pb2.GetExperimentsInProjectRequest.SerializeToString, + response_deserializer=services_dot_experiment__service__pb2.GetExperimentsInProjectWithAccessResponse.FromString, + _registered_method=True) self.GetUserExperiments = channel.unary_unary( '/org.apache.airavata.api.experiment.ExperimentService/GetUserExperiments', request_serializer=services_dot_experiment__service__pb2.GetUserExperimentsRequest.SerializeToString, @@ -113,6 +143,11 @@ def __init__(self, channel): request_serializer=services_dot_experiment__service__pb2.LaunchExperimentRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) + self.LaunchExperimentWithStorageSetup = channel.unary_unary( + '/org.apache.airavata.api.experiment.ExperimentService/LaunchExperimentWithStorageSetup', + request_serializer=services_dot_experiment__service__pb2.LaunchExperimentWithStorageSetupRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) self.TerminateExperiment = channel.unary_unary( '/org.apache.airavata.api.experiment.ExperimentService/TerminateExperiment', request_serializer=services_dot_experiment__service__pb2.TerminateExperimentRequest.SerializeToString, @@ -123,6 +158,11 @@ def __init__(self, channel): request_serializer=services_dot_experiment__service__pb2.CloneExperimentRequest.SerializeToString, response_deserializer=services_dot_experiment__service__pb2.CloneExperimentResponse.FromString, _registered_method=True) + self.CloneExperimentWithInputFiles = channel.unary_unary( + '/org.apache.airavata.api.experiment.ExperimentService/CloneExperimentWithInputFiles', + request_serializer=services_dot_experiment__service__pb2.CloneExperimentWithInputFilesRequest.SerializeToString, + response_deserializer=services_dot_experiment__service__pb2.ExperimentWithAccess.FromString, + _registered_method=True) self.GetJobStatuses = channel.unary_unary( '/org.apache.airavata.api.experiment.ExperimentService/GetJobStatuses', request_serializer=services_dot_experiment__service__pb2.GetJobStatusesRequest.SerializeToString, @@ -148,6 +188,11 @@ def __init__(self, channel): request_serializer=services_dot_experiment__service__pb2.GetExperimentStatisticsRequest.SerializeToString, response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_experiment_dot_experiment__pb2.ExperimentStatistics.FromString, _registered_method=True) + self.CreateExperimentFromSpec = channel.unary_unary( + '/org.apache.airavata.api.experiment.ExperimentService/CreateExperimentFromSpec', + request_serializer=services_dot_experiment__service__pb2.CreateExperimentFromSpecRequest.SerializeToString, + response_deserializer=services_dot_experiment__service__pb2.ExperimentWithAccess.FromString, + _registered_method=True) class ExperimentServiceServicer(object): @@ -160,12 +205,39 @@ def CreateExperiment(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def CreateExperimentWithAccess(self, request, context): + """Additive: CreateExperiment that returns the created experiment joined with the caller's + server-computed access flags, so a client does not chain create -> get -> sharing. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetExperiment(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetExperimentWithAccess(self, request, context): + """Additive: GetExperiment plus the caller's server-computed access flags, so a + client does not recompute access from a separate sharing round-trip. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetFullExperiment(self, request, context): + """Additive: the experiment joined with every related entity a viewer needs in one + round-trip — access flags, owning project, application module/interface, compute + resource, resolved input/output data products, and job details. This server-side + composition replaces the multi-RPC join the Python SDK does today, so any client + (Python now, TypeScript later) gets the same shaped result for free. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetExperimentByAdmin(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -178,6 +250,14 @@ def UpdateExperiment(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def UpdateExperimentWithAccess(self, request, context): + """Additive: UpdateExperiment that returns the updated experiment joined with the caller's + server-computed access flags, so a client does not chain update -> get -> sharing. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def DeleteExperiment(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -190,6 +270,14 @@ def SearchExperiments(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def SearchExperimentsWithAccess(self, request, context): + """Additive: SearchExperiments plus per-item server-computed access flags for the caller, + so a client does not recompute access from N separate sharing round-trips. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetExperimentStatus(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -208,6 +296,14 @@ def GetExperimentsInProject(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetExperimentsInProjectWithAccess(self, request, context): + """Additive: GetExperimentsInProject plus per-item server-computed access flags for the + caller, so a client does not recompute access from N separate sharing round-trips. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetUserExperiments(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -244,6 +340,19 @@ def LaunchExperiment(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def LaunchExperimentWithStorageSetup(self, request, context): + """Composite launch for thin clients: when the experiment has email + notifications enabled, override its recipients to the launching user's + address (notification_email) before launching. Storage setup (default + storage ids, data-dir creation, tmp-upload relocation) already runs + server-side inside LaunchExperiment, so this replaces the portal's + get/update/launch round-trip with one call. Mirrors the Python SDK's + experiment_orchestration.launch(). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def TerminateExperiment(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -256,6 +365,18 @@ def CloneExperiment(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def CloneExperimentWithInputFiles(self, request, context): + """Composite clone for thin clients: clone into a writable project (the given + project, else the source's if writable, else the caller's most-recent + writable), server-side copy each input file into a fresh tmp upload and + rewrite the input value (dropping inputs whose source file is gone), null the + data dir, persist; returns the new experiment joined with the caller's access + flags. Mirrors the Python SDK's experiment_orchestration.clone(). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetJobStatuses(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -286,6 +407,12 @@ def GetExperimentStatistics(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def CreateExperimentFromSpec(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_ExperimentServiceServicer_to_server(servicer, server): rpc_method_handlers = { @@ -294,11 +421,26 @@ def add_ExperimentServiceServicer_to_server(servicer, server): request_deserializer=services_dot_experiment__service__pb2.CreateExperimentRequest.FromString, response_serializer=services_dot_experiment__service__pb2.CreateExperimentResponse.SerializeToString, ), + 'CreateExperimentWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.CreateExperimentWithAccess, + request_deserializer=services_dot_experiment__service__pb2.CreateExperimentRequest.FromString, + response_serializer=services_dot_experiment__service__pb2.ExperimentWithAccess.SerializeToString, + ), 'GetExperiment': grpc.unary_unary_rpc_method_handler( servicer.GetExperiment, request_deserializer=services_dot_experiment__service__pb2.GetExperimentRequest.FromString, response_serializer=org_dot_apache_dot_airavata_dot_model_dot_experiment_dot_experiment__pb2.ExperimentModel.SerializeToString, ), + 'GetExperimentWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetExperimentWithAccess, + request_deserializer=services_dot_experiment__service__pb2.GetExperimentRequest.FromString, + response_serializer=services_dot_experiment__service__pb2.ExperimentWithAccess.SerializeToString, + ), + 'GetFullExperiment': grpc.unary_unary_rpc_method_handler( + servicer.GetFullExperiment, + request_deserializer=services_dot_experiment__service__pb2.GetExperimentRequest.FromString, + response_serializer=services_dot_experiment__service__pb2.FullExperiment.SerializeToString, + ), 'GetExperimentByAdmin': grpc.unary_unary_rpc_method_handler( servicer.GetExperimentByAdmin, request_deserializer=services_dot_experiment__service__pb2.GetExperimentByAdminRequest.FromString, @@ -309,6 +451,11 @@ def add_ExperimentServiceServicer_to_server(servicer, server): request_deserializer=services_dot_experiment__service__pb2.UpdateExperimentRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), + 'UpdateExperimentWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.UpdateExperimentWithAccess, + request_deserializer=services_dot_experiment__service__pb2.UpdateExperimentRequest.FromString, + response_serializer=services_dot_experiment__service__pb2.ExperimentWithAccess.SerializeToString, + ), 'DeleteExperiment': grpc.unary_unary_rpc_method_handler( servicer.DeleteExperiment, request_deserializer=services_dot_experiment__service__pb2.DeleteExperimentRequest.FromString, @@ -319,6 +466,11 @@ def add_ExperimentServiceServicer_to_server(servicer, server): request_deserializer=services_dot_experiment__service__pb2.SearchExperimentsRequest.FromString, response_serializer=services_dot_experiment__service__pb2.SearchExperimentsResponse.SerializeToString, ), + 'SearchExperimentsWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.SearchExperimentsWithAccess, + request_deserializer=services_dot_experiment__service__pb2.SearchExperimentsRequest.FromString, + response_serializer=services_dot_experiment__service__pb2.SearchExperimentsWithAccessResponse.SerializeToString, + ), 'GetExperimentStatus': grpc.unary_unary_rpc_method_handler( servicer.GetExperimentStatus, request_deserializer=services_dot_experiment__service__pb2.GetExperimentStatusRequest.FromString, @@ -334,6 +486,11 @@ def add_ExperimentServiceServicer_to_server(servicer, server): request_deserializer=services_dot_experiment__service__pb2.GetExperimentsInProjectRequest.FromString, response_serializer=services_dot_experiment__service__pb2.GetExperimentsInProjectResponse.SerializeToString, ), + 'GetExperimentsInProjectWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetExperimentsInProjectWithAccess, + request_deserializer=services_dot_experiment__service__pb2.GetExperimentsInProjectRequest.FromString, + response_serializer=services_dot_experiment__service__pb2.GetExperimentsInProjectWithAccessResponse.SerializeToString, + ), 'GetUserExperiments': grpc.unary_unary_rpc_method_handler( servicer.GetUserExperiments, request_deserializer=services_dot_experiment__service__pb2.GetUserExperimentsRequest.FromString, @@ -364,6 +521,11 @@ def add_ExperimentServiceServicer_to_server(servicer, server): request_deserializer=services_dot_experiment__service__pb2.LaunchExperimentRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), + 'LaunchExperimentWithStorageSetup': grpc.unary_unary_rpc_method_handler( + servicer.LaunchExperimentWithStorageSetup, + request_deserializer=services_dot_experiment__service__pb2.LaunchExperimentWithStorageSetupRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), 'TerminateExperiment': grpc.unary_unary_rpc_method_handler( servicer.TerminateExperiment, request_deserializer=services_dot_experiment__service__pb2.TerminateExperimentRequest.FromString, @@ -374,6 +536,11 @@ def add_ExperimentServiceServicer_to_server(servicer, server): request_deserializer=services_dot_experiment__service__pb2.CloneExperimentRequest.FromString, response_serializer=services_dot_experiment__service__pb2.CloneExperimentResponse.SerializeToString, ), + 'CloneExperimentWithInputFiles': grpc.unary_unary_rpc_method_handler( + servicer.CloneExperimentWithInputFiles, + request_deserializer=services_dot_experiment__service__pb2.CloneExperimentWithInputFilesRequest.FromString, + response_serializer=services_dot_experiment__service__pb2.ExperimentWithAccess.SerializeToString, + ), 'GetJobStatuses': grpc.unary_unary_rpc_method_handler( servicer.GetJobStatuses, request_deserializer=services_dot_experiment__service__pb2.GetJobStatusesRequest.FromString, @@ -399,6 +566,11 @@ def add_ExperimentServiceServicer_to_server(servicer, server): request_deserializer=services_dot_experiment__service__pb2.GetExperimentStatisticsRequest.FromString, response_serializer=org_dot_apache_dot_airavata_dot_model_dot_experiment_dot_experiment__pb2.ExperimentStatistics.SerializeToString, ), + 'CreateExperimentFromSpec': grpc.unary_unary_rpc_method_handler( + servicer.CreateExperimentFromSpec, + request_deserializer=services_dot_experiment__service__pb2.CreateExperimentFromSpecRequest.FromString, + response_serializer=services_dot_experiment__service__pb2.ExperimentWithAccess.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'org.apache.airavata.api.experiment.ExperimentService', rpc_method_handlers) @@ -438,6 +610,33 @@ def CreateExperiment(request, metadata, _registered_method=True) + @staticmethod + def CreateExperimentWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experiment.ExperimentService/CreateExperimentWithAccess', + services_dot_experiment__service__pb2.CreateExperimentRequest.SerializeToString, + services_dot_experiment__service__pb2.ExperimentWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetExperiment(request, target, @@ -465,6 +664,60 @@ def GetExperiment(request, metadata, _registered_method=True) + @staticmethod + def GetExperimentWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experiment.ExperimentService/GetExperimentWithAccess', + services_dot_experiment__service__pb2.GetExperimentRequest.SerializeToString, + services_dot_experiment__service__pb2.ExperimentWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetFullExperiment(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experiment.ExperimentService/GetFullExperiment', + services_dot_experiment__service__pb2.GetExperimentRequest.SerializeToString, + services_dot_experiment__service__pb2.FullExperiment.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetExperimentByAdmin(request, target, @@ -519,6 +772,33 @@ def UpdateExperiment(request, metadata, _registered_method=True) + @staticmethod + def UpdateExperimentWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experiment.ExperimentService/UpdateExperimentWithAccess', + services_dot_experiment__service__pb2.UpdateExperimentRequest.SerializeToString, + services_dot_experiment__service__pb2.ExperimentWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def DeleteExperiment(request, target, @@ -573,6 +853,33 @@ def SearchExperiments(request, metadata, _registered_method=True) + @staticmethod + def SearchExperimentsWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experiment.ExperimentService/SearchExperimentsWithAccess', + services_dot_experiment__service__pb2.SearchExperimentsRequest.SerializeToString, + services_dot_experiment__service__pb2.SearchExperimentsWithAccessResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetExperimentStatus(request, target, @@ -654,6 +961,33 @@ def GetExperimentsInProject(request, metadata, _registered_method=True) + @staticmethod + def GetExperimentsInProjectWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experiment.ExperimentService/GetExperimentsInProjectWithAccess', + services_dot_experiment__service__pb2.GetExperimentsInProjectRequest.SerializeToString, + services_dot_experiment__service__pb2.GetExperimentsInProjectWithAccessResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetUserExperiments(request, target, @@ -816,6 +1150,33 @@ def LaunchExperiment(request, metadata, _registered_method=True) + @staticmethod + def LaunchExperimentWithStorageSetup(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experiment.ExperimentService/LaunchExperimentWithStorageSetup', + services_dot_experiment__service__pb2.LaunchExperimentWithStorageSetupRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def TerminateExperiment(request, target, @@ -870,6 +1231,33 @@ def CloneExperiment(request, metadata, _registered_method=True) + @staticmethod + def CloneExperimentWithInputFiles(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experiment.ExperimentService/CloneExperimentWithInputFiles', + services_dot_experiment__service__pb2.CloneExperimentWithInputFilesRequest.SerializeToString, + services_dot_experiment__service__pb2.ExperimentWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetJobStatuses(request, target, @@ -1004,3 +1392,30 @@ def GetExperimentStatistics(request, timeout, metadata, _registered_method=True) + + @staticmethod + def CreateExperimentFromSpec(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experiment.ExperimentService/CreateExperimentFromSpec', + services_dot_experiment__service__pb2.CreateExperimentFromSpecRequest.SerializeToString, + services_dot_experiment__service__pb2.ExperimentWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/airavata-python-sdk/airavata/services/experiment_set_service_pb2.py b/airavata-python-sdk/airavata/services/experiment_set_service_pb2.py new file mode 100644 index 00000000000..602ff5c9995 --- /dev/null +++ b/airavata-python-sdk/airavata/services/experiment_set_service_pb2.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/experiment_set_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/experiment_set_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.services import experiment_service_pb2 as services_dot_experiment__service__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%services/experiment_set_service.proto\x12%org.apache.airavata.api.experimentset\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a!services/experiment_service.proto\"\x1b\n\tValueList\x12\x0e\n\x06values\x18\x01 \x03(\t\"\x9b\x02\n\tSweepSpec\x12@\n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x32.org.apache.airavata.api.experiment.ExperimentSpec\x12S\n\nsweep_axes\x18\x02 \x03(\x0b\x32?.org.apache.airavata.api.experimentset.SweepSpec.SweepAxesEntry\x12\x13\n\x0bname_prefix\x18\x03 \x01(\t\x1a\x62\n\x0eSweepAxesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.org.apache.airavata.api.experimentset.ValueList:\x02\x38\x01\"*\n\x10\x45xperimentIdList\x12\x16\n\x0e\x65xperiment_ids\x18\x01 \x03(\t\"\xc8\x01\n\x1a\x43reateExperimentSetRequest\x12\x10\n\x08set_name\x18\x01 \x01(\t\x12\x41\n\x05sweep\x18\x02 \x01(\x0b\x32\x30.org.apache.airavata.api.experimentset.SweepSpecH\x00\x12K\n\x08\x65xisting\x18\x03 \x01(\x0b\x32\x37.org.apache.airavata.api.experimentset.ExperimentIdListH\x00\x42\x08\n\x06source\"S\n\x1aLaunchExperimentSetRequest\x12\x19\n\x11\x65xperiment_set_id\x18\x01 \x01(\t\x12\x1a\n\x12notification_email\x18\x02 \x01(\t\"4\n\x17GetExperimentSetRequest\x12\x19\n\x11\x65xperiment_set_id\x18\x01 \x01(\t\"7\n\x1a\x44\x65leteExperimentSetRequest\x12\x19\n\x11\x65xperiment_set_id\x18\x01 \x01(\t\":\n\x19ListExperimentSetsRequest\x12\r\n\x05limit\x18\x01 \x01(\x05\x12\x0e\n\x06offset\x18\x02 \x01(\x05\"\xe5\x01\n\rExperimentSet\x12\x19\n\x11\x65xperiment_set_id\x18\x01 \x01(\t\x12\x10\n\x08set_name\x18\x02 \x01(\t\x12\r\n\x05owner\x18\x03 \x01(\t\x12\x12\n\ngateway_id\x18\x04 \x01(\t\x12\x16\n\x0e\x65xperiment_ids\x18\x05 \x03(\t\x12?\n\x05sweep\x18\x06 \x01(\x0b\x32\x30.org.apache.airavata.api.experimentset.SweepSpec\x12\x15\n\rcreation_time\x18\x07 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x08 \x01(\x03\"k\n\x1aListExperimentSetsResponse\x12M\n\x0f\x65xperiment_sets\x18\x01 \x03(\x0b\x32\x34.org.apache.airavata.api.experimentset.ExperimentSet\"P\n\x14\x45xperimentStatusItem\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\r\n\x05state\x18\x02 \x01(\t\x12\x12\n\nprocess_id\x18\x03 \x01(\t\"\xf3\x02\n\x13\x45xperimentSetStatus\x12\x19\n\x11\x65xperiment_set_id\x18\x01 \x01(\t\x12\r\n\x05total\x18\x02 \x01(\x05\x12\x66\n\x0f\x63ounts_by_state\x18\x03 \x03(\x0b\x32M.org.apache.airavata.api.experimentset.ExperimentSetStatus.CountsByStateEntry\x12H\n\taggregate\x18\x04 \x01(\x0e\x32\x35.org.apache.airavata.api.experimentset.AggregateState\x12J\n\x05items\x18\x05 \x03(\x0b\x32;.org.apache.airavata.api.experimentset.ExperimentStatusItem\x1a\x34\n\x12\x43ountsByStateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01*O\n\x0e\x41ggregateState\x12\n\n\x06QUEUED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tCOMPLETED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\t\n\x05MIXED\x10\x04\x32\x90\t\n\x14\x45xperimentSetService\x12\xb2\x01\n\x13\x43reateExperimentSet\x12\x41.org.apache.airavata.api.experimentset.CreateExperimentSetRequest\x1a\x34.org.apache.airavata.api.experimentset.ExperimentSet\"\"\x82\xd3\xe4\x93\x02\x1c\"\x17/api/v1/experiment-sets:\x01*\x12\xca\x01\n\x13LaunchExperimentSet\x12\x41.org.apache.airavata.api.experimentset.LaunchExperimentSetRequest\x1a\x34.org.apache.airavata.api.experimentset.ExperimentSet\":\x82\xd3\xe4\x93\x02\x34\"2/api/v1/experiment-sets/{experiment_set_id}:launch\x12\xbd\x01\n\x10GetExperimentSet\x12>.org.apache.airavata.api.experimentset.GetExperimentSetRequest\x1a\x34.org.apache.airavata.api.experimentset.ExperimentSet\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/experiment-sets/{experiment_set_id}\x12\xba\x01\n\x12ListExperimentSets\x12@.org.apache.airavata.api.experimentset.ListExperimentSetsRequest\x1a\x41.org.apache.airavata.api.experimentset.ListExperimentSetsResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/api/v1/experiment-sets\x12\xd0\x01\n\x16GetExperimentSetStatus\x12>.org.apache.airavata.api.experimentset.GetExperimentSetRequest\x1a:.org.apache.airavata.api.experimentset.ExperimentSetStatus\":\x82\xd3\xe4\x93\x02\x34\x12\x32/api/v1/experiment-sets/{experiment_set_id}/status\x12\xa5\x01\n\x13\x44\x65leteExperimentSet\x12\x41.org.apache.airavata.api.experimentset.DeleteExperimentSetRequest\x1a\x16.google.protobuf.Empty\"3\x82\xd3\xe4\x93\x02-*+/api/v1/experiment-sets/{experiment_set_id}B)\n%org.apache.airavata.api.experimentsetP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.experiment_set_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n%org.apache.airavata.api.experimentsetP\001' + _globals['_SWEEPSPEC_SWEEPAXESENTRY']._loaded_options = None + _globals['_SWEEPSPEC_SWEEPAXESENTRY']._serialized_options = b'8\001' + _globals['_EXPERIMENTSETSTATUS_COUNTSBYSTATEENTRY']._loaded_options = None + _globals['_EXPERIMENTSETSTATUS_COUNTSBYSTATEENTRY']._serialized_options = b'8\001' + _globals['_EXPERIMENTSETSERVICE'].methods_by_name['CreateExperimentSet']._loaded_options = None + _globals['_EXPERIMENTSETSERVICE'].methods_by_name['CreateExperimentSet']._serialized_options = b'\202\323\344\223\002\034\"\027/api/v1/experiment-sets:\001*' + _globals['_EXPERIMENTSETSERVICE'].methods_by_name['LaunchExperimentSet']._loaded_options = None + _globals['_EXPERIMENTSETSERVICE'].methods_by_name['LaunchExperimentSet']._serialized_options = b'\202\323\344\223\0024\"2/api/v1/experiment-sets/{experiment_set_id}:launch' + _globals['_EXPERIMENTSETSERVICE'].methods_by_name['GetExperimentSet']._loaded_options = None + _globals['_EXPERIMENTSETSERVICE'].methods_by_name['GetExperimentSet']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/experiment-sets/{experiment_set_id}' + _globals['_EXPERIMENTSETSERVICE'].methods_by_name['ListExperimentSets']._loaded_options = None + _globals['_EXPERIMENTSETSERVICE'].methods_by_name['ListExperimentSets']._serialized_options = b'\202\323\344\223\002\031\022\027/api/v1/experiment-sets' + _globals['_EXPERIMENTSETSERVICE'].methods_by_name['GetExperimentSetStatus']._loaded_options = None + _globals['_EXPERIMENTSETSERVICE'].methods_by_name['GetExperimentSetStatus']._serialized_options = b'\202\323\344\223\0024\0222/api/v1/experiment-sets/{experiment_set_id}/status' + _globals['_EXPERIMENTSETSERVICE'].methods_by_name['DeleteExperimentSet']._loaded_options = None + _globals['_EXPERIMENTSETSERVICE'].methods_by_name['DeleteExperimentSet']._serialized_options = b'\202\323\344\223\002-*+/api/v1/experiment-sets/{experiment_set_id}' + _globals['_AGGREGATESTATE']._serialized_start=1789 + _globals['_AGGREGATESTATE']._serialized_end=1868 + _globals['_VALUELIST']._serialized_start=174 + _globals['_VALUELIST']._serialized_end=201 + _globals['_SWEEPSPEC']._serialized_start=204 + _globals['_SWEEPSPEC']._serialized_end=487 + _globals['_SWEEPSPEC_SWEEPAXESENTRY']._serialized_start=389 + _globals['_SWEEPSPEC_SWEEPAXESENTRY']._serialized_end=487 + _globals['_EXPERIMENTIDLIST']._serialized_start=489 + _globals['_EXPERIMENTIDLIST']._serialized_end=531 + _globals['_CREATEEXPERIMENTSETREQUEST']._serialized_start=534 + _globals['_CREATEEXPERIMENTSETREQUEST']._serialized_end=734 + _globals['_LAUNCHEXPERIMENTSETREQUEST']._serialized_start=736 + _globals['_LAUNCHEXPERIMENTSETREQUEST']._serialized_end=819 + _globals['_GETEXPERIMENTSETREQUEST']._serialized_start=821 + _globals['_GETEXPERIMENTSETREQUEST']._serialized_end=873 + _globals['_DELETEEXPERIMENTSETREQUEST']._serialized_start=875 + _globals['_DELETEEXPERIMENTSETREQUEST']._serialized_end=930 + _globals['_LISTEXPERIMENTSETSREQUEST']._serialized_start=932 + _globals['_LISTEXPERIMENTSETSREQUEST']._serialized_end=990 + _globals['_EXPERIMENTSET']._serialized_start=993 + _globals['_EXPERIMENTSET']._serialized_end=1222 + _globals['_LISTEXPERIMENTSETSRESPONSE']._serialized_start=1224 + _globals['_LISTEXPERIMENTSETSRESPONSE']._serialized_end=1331 + _globals['_EXPERIMENTSTATUSITEM']._serialized_start=1333 + _globals['_EXPERIMENTSTATUSITEM']._serialized_end=1413 + _globals['_EXPERIMENTSETSTATUS']._serialized_start=1416 + _globals['_EXPERIMENTSETSTATUS']._serialized_end=1787 + _globals['_EXPERIMENTSETSTATUS_COUNTSBYSTATEENTRY']._serialized_start=1735 + _globals['_EXPERIMENTSETSTATUS_COUNTSBYSTATEENTRY']._serialized_end=1787 + _globals['_EXPERIMENTSETSERVICE']._serialized_start=1871 + _globals['_EXPERIMENTSETSERVICE']._serialized_end=3039 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata/services/experiment_set_service_pb2.pyi b/airavata-python-sdk/airavata/services/experiment_set_service_pb2.pyi new file mode 100644 index 00000000000..b0e10024456 --- /dev/null +++ b/airavata-python-sdk/airavata/services/experiment_set_service_pb2.pyi @@ -0,0 +1,148 @@ +from google.api import annotations_pb2 as _annotations_pb2 +from google.protobuf import empty_pb2 as _empty_pb2 +from airavata.services import experiment_service_pb2 as _experiment_service_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Iterable as _Iterable, Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class AggregateState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + QUEUED: _ClassVar[AggregateState] + RUNNING: _ClassVar[AggregateState] + COMPLETED: _ClassVar[AggregateState] + FAILED: _ClassVar[AggregateState] + MIXED: _ClassVar[AggregateState] +QUEUED: AggregateState +RUNNING: AggregateState +COMPLETED: AggregateState +FAILED: AggregateState +MIXED: AggregateState + +class ValueList(_message.Message): + __slots__ = ("values",) + VALUES_FIELD_NUMBER: _ClassVar[int] + values: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, values: _Optional[_Iterable[str]] = ...) -> None: ... + +class SweepSpec(_message.Message): + __slots__ = ("base", "sweep_axes", "name_prefix") + class SweepAxesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: ValueList + def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[ValueList, _Mapping]] = ...) -> None: ... + BASE_FIELD_NUMBER: _ClassVar[int] + SWEEP_AXES_FIELD_NUMBER: _ClassVar[int] + NAME_PREFIX_FIELD_NUMBER: _ClassVar[int] + base: _experiment_service_pb2.ExperimentSpec + sweep_axes: _containers.MessageMap[str, ValueList] + name_prefix: str + def __init__(self, base: _Optional[_Union[_experiment_service_pb2.ExperimentSpec, _Mapping]] = ..., sweep_axes: _Optional[_Mapping[str, ValueList]] = ..., name_prefix: _Optional[str] = ...) -> None: ... + +class ExperimentIdList(_message.Message): + __slots__ = ("experiment_ids",) + EXPERIMENT_IDS_FIELD_NUMBER: _ClassVar[int] + experiment_ids: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, experiment_ids: _Optional[_Iterable[str]] = ...) -> None: ... + +class CreateExperimentSetRequest(_message.Message): + __slots__ = ("set_name", "sweep", "existing") + SET_NAME_FIELD_NUMBER: _ClassVar[int] + SWEEP_FIELD_NUMBER: _ClassVar[int] + EXISTING_FIELD_NUMBER: _ClassVar[int] + set_name: str + sweep: SweepSpec + existing: ExperimentIdList + def __init__(self, set_name: _Optional[str] = ..., sweep: _Optional[_Union[SweepSpec, _Mapping]] = ..., existing: _Optional[_Union[ExperimentIdList, _Mapping]] = ...) -> None: ... + +class LaunchExperimentSetRequest(_message.Message): + __slots__ = ("experiment_set_id", "notification_email") + EXPERIMENT_SET_ID_FIELD_NUMBER: _ClassVar[int] + NOTIFICATION_EMAIL_FIELD_NUMBER: _ClassVar[int] + experiment_set_id: str + notification_email: str + def __init__(self, experiment_set_id: _Optional[str] = ..., notification_email: _Optional[str] = ...) -> None: ... + +class GetExperimentSetRequest(_message.Message): + __slots__ = ("experiment_set_id",) + EXPERIMENT_SET_ID_FIELD_NUMBER: _ClassVar[int] + experiment_set_id: str + def __init__(self, experiment_set_id: _Optional[str] = ...) -> None: ... + +class DeleteExperimentSetRequest(_message.Message): + __slots__ = ("experiment_set_id",) + EXPERIMENT_SET_ID_FIELD_NUMBER: _ClassVar[int] + experiment_set_id: str + def __init__(self, experiment_set_id: _Optional[str] = ...) -> None: ... + +class ListExperimentSetsRequest(_message.Message): + __slots__ = ("limit", "offset") + LIMIT_FIELD_NUMBER: _ClassVar[int] + OFFSET_FIELD_NUMBER: _ClassVar[int] + limit: int + offset: int + def __init__(self, limit: _Optional[int] = ..., offset: _Optional[int] = ...) -> None: ... + +class ExperimentSet(_message.Message): + __slots__ = ("experiment_set_id", "set_name", "owner", "gateway_id", "experiment_ids", "sweep", "creation_time", "updated_time") + EXPERIMENT_SET_ID_FIELD_NUMBER: _ClassVar[int] + SET_NAME_FIELD_NUMBER: _ClassVar[int] + OWNER_FIELD_NUMBER: _ClassVar[int] + GATEWAY_ID_FIELD_NUMBER: _ClassVar[int] + EXPERIMENT_IDS_FIELD_NUMBER: _ClassVar[int] + SWEEP_FIELD_NUMBER: _ClassVar[int] + CREATION_TIME_FIELD_NUMBER: _ClassVar[int] + UPDATED_TIME_FIELD_NUMBER: _ClassVar[int] + experiment_set_id: str + set_name: str + owner: str + gateway_id: str + experiment_ids: _containers.RepeatedScalarFieldContainer[str] + sweep: SweepSpec + creation_time: int + updated_time: int + def __init__(self, experiment_set_id: _Optional[str] = ..., set_name: _Optional[str] = ..., owner: _Optional[str] = ..., gateway_id: _Optional[str] = ..., experiment_ids: _Optional[_Iterable[str]] = ..., sweep: _Optional[_Union[SweepSpec, _Mapping]] = ..., creation_time: _Optional[int] = ..., updated_time: _Optional[int] = ...) -> None: ... + +class ListExperimentSetsResponse(_message.Message): + __slots__ = ("experiment_sets",) + EXPERIMENT_SETS_FIELD_NUMBER: _ClassVar[int] + experiment_sets: _containers.RepeatedCompositeFieldContainer[ExperimentSet] + def __init__(self, experiment_sets: _Optional[_Iterable[_Union[ExperimentSet, _Mapping]]] = ...) -> None: ... + +class ExperimentStatusItem(_message.Message): + __slots__ = ("experiment_id", "state", "process_id") + EXPERIMENT_ID_FIELD_NUMBER: _ClassVar[int] + STATE_FIELD_NUMBER: _ClassVar[int] + PROCESS_ID_FIELD_NUMBER: _ClassVar[int] + experiment_id: str + state: str + process_id: str + def __init__(self, experiment_id: _Optional[str] = ..., state: _Optional[str] = ..., process_id: _Optional[str] = ...) -> None: ... + +class ExperimentSetStatus(_message.Message): + __slots__ = ("experiment_set_id", "total", "counts_by_state", "aggregate", "items") + class CountsByStateEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: int + def __init__(self, key: _Optional[str] = ..., value: _Optional[int] = ...) -> None: ... + EXPERIMENT_SET_ID_FIELD_NUMBER: _ClassVar[int] + TOTAL_FIELD_NUMBER: _ClassVar[int] + COUNTS_BY_STATE_FIELD_NUMBER: _ClassVar[int] + AGGREGATE_FIELD_NUMBER: _ClassVar[int] + ITEMS_FIELD_NUMBER: _ClassVar[int] + experiment_set_id: str + total: int + counts_by_state: _containers.ScalarMap[str, int] + aggregate: AggregateState + items: _containers.RepeatedCompositeFieldContainer[ExperimentStatusItem] + def __init__(self, experiment_set_id: _Optional[str] = ..., total: _Optional[int] = ..., counts_by_state: _Optional[_Mapping[str, int]] = ..., aggregate: _Optional[_Union[AggregateState, str]] = ..., items: _Optional[_Iterable[_Union[ExperimentStatusItem, _Mapping]]] = ...) -> None: ... diff --git a/airavata-python-sdk/airavata/services/experiment_set_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/experiment_set_service_pb2_grpc.py new file mode 100644 index 00000000000..9456bcd142f --- /dev/null +++ b/airavata-python-sdk/airavata/services/experiment_set_service_pb2_grpc.py @@ -0,0 +1,316 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.services import experiment_set_service_pb2 as services_dot_experiment__set__service__pb2 + +GRPC_GENERATED_VERSION = '1.80.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in services/experiment_set_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class ExperimentSetServiceStub(object): + """ExperimentSetService provides RPCs for managing gridsearch experiment sets. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.CreateExperimentSet = channel.unary_unary( + '/org.apache.airavata.api.experimentset.ExperimentSetService/CreateExperimentSet', + request_serializer=services_dot_experiment__set__service__pb2.CreateExperimentSetRequest.SerializeToString, + response_deserializer=services_dot_experiment__set__service__pb2.ExperimentSet.FromString, + _registered_method=True) + self.LaunchExperimentSet = channel.unary_unary( + '/org.apache.airavata.api.experimentset.ExperimentSetService/LaunchExperimentSet', + request_serializer=services_dot_experiment__set__service__pb2.LaunchExperimentSetRequest.SerializeToString, + response_deserializer=services_dot_experiment__set__service__pb2.ExperimentSet.FromString, + _registered_method=True) + self.GetExperimentSet = channel.unary_unary( + '/org.apache.airavata.api.experimentset.ExperimentSetService/GetExperimentSet', + request_serializer=services_dot_experiment__set__service__pb2.GetExperimentSetRequest.SerializeToString, + response_deserializer=services_dot_experiment__set__service__pb2.ExperimentSet.FromString, + _registered_method=True) + self.ListExperimentSets = channel.unary_unary( + '/org.apache.airavata.api.experimentset.ExperimentSetService/ListExperimentSets', + request_serializer=services_dot_experiment__set__service__pb2.ListExperimentSetsRequest.SerializeToString, + response_deserializer=services_dot_experiment__set__service__pb2.ListExperimentSetsResponse.FromString, + _registered_method=True) + self.GetExperimentSetStatus = channel.unary_unary( + '/org.apache.airavata.api.experimentset.ExperimentSetService/GetExperimentSetStatus', + request_serializer=services_dot_experiment__set__service__pb2.GetExperimentSetRequest.SerializeToString, + response_deserializer=services_dot_experiment__set__service__pb2.ExperimentSetStatus.FromString, + _registered_method=True) + self.DeleteExperimentSet = channel.unary_unary( + '/org.apache.airavata.api.experimentset.ExperimentSetService/DeleteExperimentSet', + request_serializer=services_dot_experiment__set__service__pb2.DeleteExperimentSetRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + + +class ExperimentSetServiceServicer(object): + """ExperimentSetService provides RPCs for managing gridsearch experiment sets. + """ + + def CreateExperimentSet(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def LaunchExperimentSet(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetExperimentSet(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListExperimentSets(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetExperimentSetStatus(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteExperimentSet(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_ExperimentSetServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'CreateExperimentSet': grpc.unary_unary_rpc_method_handler( + servicer.CreateExperimentSet, + request_deserializer=services_dot_experiment__set__service__pb2.CreateExperimentSetRequest.FromString, + response_serializer=services_dot_experiment__set__service__pb2.ExperimentSet.SerializeToString, + ), + 'LaunchExperimentSet': grpc.unary_unary_rpc_method_handler( + servicer.LaunchExperimentSet, + request_deserializer=services_dot_experiment__set__service__pb2.LaunchExperimentSetRequest.FromString, + response_serializer=services_dot_experiment__set__service__pb2.ExperimentSet.SerializeToString, + ), + 'GetExperimentSet': grpc.unary_unary_rpc_method_handler( + servicer.GetExperimentSet, + request_deserializer=services_dot_experiment__set__service__pb2.GetExperimentSetRequest.FromString, + response_serializer=services_dot_experiment__set__service__pb2.ExperimentSet.SerializeToString, + ), + 'ListExperimentSets': grpc.unary_unary_rpc_method_handler( + servicer.ListExperimentSets, + request_deserializer=services_dot_experiment__set__service__pb2.ListExperimentSetsRequest.FromString, + response_serializer=services_dot_experiment__set__service__pb2.ListExperimentSetsResponse.SerializeToString, + ), + 'GetExperimentSetStatus': grpc.unary_unary_rpc_method_handler( + servicer.GetExperimentSetStatus, + request_deserializer=services_dot_experiment__set__service__pb2.GetExperimentSetRequest.FromString, + response_serializer=services_dot_experiment__set__service__pb2.ExperimentSetStatus.SerializeToString, + ), + 'DeleteExperimentSet': grpc.unary_unary_rpc_method_handler( + servicer.DeleteExperimentSet, + request_deserializer=services_dot_experiment__set__service__pb2.DeleteExperimentSetRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'org.apache.airavata.api.experimentset.ExperimentSetService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('org.apache.airavata.api.experimentset.ExperimentSetService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class ExperimentSetService(object): + """ExperimentSetService provides RPCs for managing gridsearch experiment sets. + """ + + @staticmethod + def CreateExperimentSet(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experimentset.ExperimentSetService/CreateExperimentSet', + services_dot_experiment__set__service__pb2.CreateExperimentSetRequest.SerializeToString, + services_dot_experiment__set__service__pb2.ExperimentSet.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def LaunchExperimentSet(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experimentset.ExperimentSetService/LaunchExperimentSet', + services_dot_experiment__set__service__pb2.LaunchExperimentSetRequest.SerializeToString, + services_dot_experiment__set__service__pb2.ExperimentSet.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetExperimentSet(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experimentset.ExperimentSetService/GetExperimentSet', + services_dot_experiment__set__service__pb2.GetExperimentSetRequest.SerializeToString, + services_dot_experiment__set__service__pb2.ExperimentSet.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListExperimentSets(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experimentset.ExperimentSetService/ListExperimentSets', + services_dot_experiment__set__service__pb2.ListExperimentSetsRequest.SerializeToString, + services_dot_experiment__set__service__pb2.ListExperimentSetsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetExperimentSetStatus(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experimentset.ExperimentSetService/GetExperimentSetStatus', + services_dot_experiment__set__service__pb2.GetExperimentSetRequest.SerializeToString, + services_dot_experiment__set__service__pb2.ExperimentSetStatus.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteExperimentSet(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.experimentset.ExperimentSetService/DeleteExperimentSet', + services_dot_experiment__set__service__pb2.DeleteExperimentSetRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/airavata-python-sdk/airavata/services/file_service_pb2.py b/airavata-python-sdk/airavata/services/file_service_pb2.py new file mode 100644 index 00000000000..053643d1446 --- /dev/null +++ b/airavata-python-sdk/airavata/services/file_service_pb2.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/file_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/file_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.data.replica import replica_catalog_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bservices/file_service.proto\x12\x1corg.apache.airavata.api.file\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\n\x11\x46ileExistsRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\"$\n\x12\x46ileExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"=\n\x10\x44irExistsRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\"#\n\x11\x44irExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\";\n\x0eListDirRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\"\x9d\x01\n\x0fListDirResponse\x12G\n\x0b\x64irectories\x18\x01 \x03(\x0b\x32\x32.org.apache.airavata.api.file.FileMetadataResponse\x12\x41\n\x05\x66iles\x18\x02 \x03(\x0b\x32\x32.org.apache.airavata.api.file.FileMetadataResponse\">\n\x11\x44\x65leteFileRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\"=\n\x10\x44\x65leteDirRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\"]\n\x0fMoveFileRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x13\n\x0bsource_path\x18\x02 \x01(\t\x12\x18\n\x10\x64\x65stination_path\x18\x03 \x01(\t\"]\n\x0f\x43opyFileRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x13\n\x0bsource_path\x18\x02 \x01(\t\x12\x18\n\x10\x64\x65stination_path\x18\x03 \x01(\t\"=\n\x10\x43reateDirRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\")\n\x11\x43reateDirResponse\x12\x14\n\x0c\x63reated_path\x18\x01 \x01(\t\"]\n\x14\x43reateSymlinkRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x13\n\x0bsource_path\x18\x02 \x01(\t\x12\x13\n\x0btarget_path\x18\x03 \x01(\t\"C\n\x16GetFileMetadataRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\"1\n\x18ListExperimentDirRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"$\n\"GetDefaultStorageResourceIdRequest\"B\n#GetDefaultStorageResourceIdResponse\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t2\x9b\x13\n\x12UserStorageService\x12\x9e\x01\n\nUploadFile\x12/.org.apache.airavata.api.file.UploadFileRequest\x1a\x38.org.apache.airavata.model.data.replica.DataProductModel\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/api/v1/user-storage/files:\x01*\x12\xa2\x01\n\x0c\x44ownloadFile\x12\x31.org.apache.airavata.api.file.DownloadFileRequest\x1a\x32.org.apache.airavata.api.file.DownloadFileResponse\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/user-storage/files:download\x12\xb8\x01\n\x13\x44ownloadDataProduct\x12\x38.org.apache.airavata.api.file.DownloadDataProductRequest\x1a\x32.org.apache.airavata.api.file.DownloadFileResponse\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/user-storage/data-products:download\x12\x9a\x01\n\nFileExists\x12/.org.apache.airavata.api.file.FileExistsRequest\x1a\x30.org.apache.airavata.api.file.FileExistsResponse\")\x82\xd3\xe4\x93\x02#\x12!/api/v1/user-storage/files:exists\x12\x9d\x01\n\tDirExists\x12..org.apache.airavata.api.file.DirExistsRequest\x1a/.org.apache.airavata.api.file.DirExistsResponse\"/\x82\xd3\xe4\x93\x02)\x12\'/api/v1/user-storage/directories:exists\x12\x95\x01\n\x07ListDir\x12,.org.apache.airavata.api.file.ListDirRequest\x1a-.org.apache.airavata.api.file.ListDirResponse\"-\x82\xd3\xe4\x93\x02\'\x12%/api/v1/user-storage/directories:list\x12y\n\nDeleteFile\x12/.org.apache.airavata.api.file.DeleteFileRequest\x1a\x16.google.protobuf.Empty\"\"\x82\xd3\xe4\x93\x02\x1c*\x1a/api/v1/user-storage/files\x12}\n\tDeleteDir\x12..org.apache.airavata.api.file.DeleteDirRequest\x1a\x16.google.protobuf.Empty\"(\x82\xd3\xe4\x93\x02\"* /api/v1/user-storage/directories\x12\x9f\x01\n\x08MoveFile\x12-.org.apache.airavata.api.file.MoveFileRequest\x1a\x38.org.apache.airavata.model.data.replica.DataProductModel\"*\x82\xd3\xe4\x93\x02$\"\x1f/api/v1/user-storage/files:move:\x01*\x12\x9f\x01\n\x08\x43opyFile\x12-.org.apache.airavata.api.file.CopyFileRequest\x1a\x38.org.apache.airavata.model.data.replica.DataProductModel\"*\x82\xd3\xe4\x93\x02$\"\x1f/api/v1/user-storage/files:copy:\x01*\x12\x99\x01\n\tCreateDir\x12..org.apache.airavata.api.file.CreateDirRequest\x1a/.org.apache.airavata.api.file.CreateDirResponse\"+\x82\xd3\xe4\x93\x02%\" /api/v1/user-storage/directories:\x01*\x12\x85\x01\n\rCreateSymlink\x12\x32.org.apache.airavata.api.file.CreateSymlinkRequest\x1a\x16.google.protobuf.Empty\"(\x82\xd3\xe4\x93\x02\"\"\x1d/api/v1/user-storage/symlinks:\x01*\x12\xa8\x01\n\x0fGetFileMetadata\x12\x34.org.apache.airavata.api.file.GetFileMetadataRequest\x1a\x32.org.apache.airavata.api.file.FileMetadataResponse\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/user-storage/files:metadata\x12\xc5\x01\n\x11ListExperimentDir\x12\x36.org.apache.airavata.api.file.ListExperimentDirRequest\x1a-.org.apache.airavata.api.file.ListDirResponse\"I\x82\xd3\xe4\x93\x02\x43\x12\x41/api/v1/user-storage/experiments/{experiment_id}/directories:list\x12\xd9\x01\n\x1bGetDefaultStorageResourceId\x12@.org.apache.airavata.api.file.GetDefaultStorageResourceIdRequest\x1a\x41.org.apache.airavata.api.file.GetDefaultStorageResourceIdResponse\"5\x82\xd3\xe4\x93\x02/\x12-/api/v1/user-storage/default-storage-resourceB \n\x1corg.apache.airavata.api.fileP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.file_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\034org.apache.airavata.api.fileP\001' + _globals['_USERSTORAGESERVICE'].methods_by_name['UploadFile']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['UploadFile']._serialized_options = b'\202\323\344\223\002\037\"\032/api/v1/user-storage/files:\001*' + _globals['_USERSTORAGESERVICE'].methods_by_name['DownloadFile']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['DownloadFile']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/user-storage/files:download' + _globals['_USERSTORAGESERVICE'].methods_by_name['DownloadDataProduct']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['DownloadDataProduct']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/user-storage/data-products:download' + _globals['_USERSTORAGESERVICE'].methods_by_name['FileExists']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['FileExists']._serialized_options = b'\202\323\344\223\002#\022!/api/v1/user-storage/files:exists' + _globals['_USERSTORAGESERVICE'].methods_by_name['DirExists']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['DirExists']._serialized_options = b'\202\323\344\223\002)\022\'/api/v1/user-storage/directories:exists' + _globals['_USERSTORAGESERVICE'].methods_by_name['ListDir']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['ListDir']._serialized_options = b'\202\323\344\223\002\'\022%/api/v1/user-storage/directories:list' + _globals['_USERSTORAGESERVICE'].methods_by_name['DeleteFile']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['DeleteFile']._serialized_options = b'\202\323\344\223\002\034*\032/api/v1/user-storage/files' + _globals['_USERSTORAGESERVICE'].methods_by_name['DeleteDir']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['DeleteDir']._serialized_options = b'\202\323\344\223\002\"* /api/v1/user-storage/directories' + _globals['_USERSTORAGESERVICE'].methods_by_name['MoveFile']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['MoveFile']._serialized_options = b'\202\323\344\223\002$\"\037/api/v1/user-storage/files:move:\001*' + _globals['_USERSTORAGESERVICE'].methods_by_name['CopyFile']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['CopyFile']._serialized_options = b'\202\323\344\223\002$\"\037/api/v1/user-storage/files:copy:\001*' + _globals['_USERSTORAGESERVICE'].methods_by_name['CreateDir']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['CreateDir']._serialized_options = b'\202\323\344\223\002%\" /api/v1/user-storage/directories:\001*' + _globals['_USERSTORAGESERVICE'].methods_by_name['CreateSymlink']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['CreateSymlink']._serialized_options = b'\202\323\344\223\002\"\"\035/api/v1/user-storage/symlinks:\001*' + _globals['_USERSTORAGESERVICE'].methods_by_name['GetFileMetadata']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['GetFileMetadata']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/user-storage/files:metadata' + _globals['_USERSTORAGESERVICE'].methods_by_name['ListExperimentDir']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['ListExperimentDir']._serialized_options = b'\202\323\344\223\002C\022A/api/v1/user-storage/experiments/{experiment_id}/directories:list' + _globals['_USERSTORAGESERVICE'].methods_by_name['GetDefaultStorageResourceId']._loaded_options = None + _globals['_USERSTORAGESERVICE'].methods_by_name['GetDefaultStorageResourceId']._serialized_options = b'\202\323\344\223\002/\022-/api/v1/user-storage/default-storage-resource' + _globals['_FILEUPLOADRESPONSE']._serialized_start=182 + _globals['_FILEUPLOADRESPONSE']._serialized_end=257 + _globals['_FILEMETADATARESPONSE']._serialized_start=260 + _globals['_FILEMETADATARESPONSE']._serialized_end=439 + _globals['_UPLOADFILEREQUEST']._serialized_start=441 + _globals['_UPLOADFILEREQUEST']._serialized_end=556 + _globals['_DOWNLOADFILEREQUEST']._serialized_start=558 + _globals['_DOWNLOADFILEREQUEST']._serialized_end=622 + _globals['_DOWNLOADDATAPRODUCTREQUEST']._serialized_start=624 + _globals['_DOWNLOADDATAPRODUCTREQUEST']._serialized_end=673 + _globals['_DOWNLOADFILERESPONSE']._serialized_start=675 + _globals['_DOWNLOADFILERESPONSE']._serialized_end=750 + _globals['_FILEEXISTSREQUEST']._serialized_start=752 + _globals['_FILEEXISTSREQUEST']._serialized_end=814 + _globals['_FILEEXISTSRESPONSE']._serialized_start=816 + _globals['_FILEEXISTSRESPONSE']._serialized_end=852 + _globals['_DIREXISTSREQUEST']._serialized_start=854 + _globals['_DIREXISTSREQUEST']._serialized_end=915 + _globals['_DIREXISTSRESPONSE']._serialized_start=917 + _globals['_DIREXISTSRESPONSE']._serialized_end=952 + _globals['_LISTDIRREQUEST']._serialized_start=954 + _globals['_LISTDIRREQUEST']._serialized_end=1013 + _globals['_LISTDIRRESPONSE']._serialized_start=1016 + _globals['_LISTDIRRESPONSE']._serialized_end=1173 + _globals['_DELETEFILEREQUEST']._serialized_start=1175 + _globals['_DELETEFILEREQUEST']._serialized_end=1237 + _globals['_DELETEDIRREQUEST']._serialized_start=1239 + _globals['_DELETEDIRREQUEST']._serialized_end=1300 + _globals['_MOVEFILEREQUEST']._serialized_start=1302 + _globals['_MOVEFILEREQUEST']._serialized_end=1395 + _globals['_COPYFILEREQUEST']._serialized_start=1397 + _globals['_COPYFILEREQUEST']._serialized_end=1490 + _globals['_CREATEDIRREQUEST']._serialized_start=1492 + _globals['_CREATEDIRREQUEST']._serialized_end=1553 + _globals['_CREATEDIRRESPONSE']._serialized_start=1555 + _globals['_CREATEDIRRESPONSE']._serialized_end=1596 + _globals['_CREATESYMLINKREQUEST']._serialized_start=1598 + _globals['_CREATESYMLINKREQUEST']._serialized_end=1691 + _globals['_GETFILEMETADATAREQUEST']._serialized_start=1693 + _globals['_GETFILEMETADATAREQUEST']._serialized_end=1760 + _globals['_LISTEXPERIMENTDIRREQUEST']._serialized_start=1762 + _globals['_LISTEXPERIMENTDIRREQUEST']._serialized_end=1811 + _globals['_GETDEFAULTSTORAGERESOURCEIDREQUEST']._serialized_start=1813 + _globals['_GETDEFAULTSTORAGERESOURCEIDREQUEST']._serialized_end=1849 + _globals['_GETDEFAULTSTORAGERESOURCEIDRESPONSE']._serialized_start=1851 + _globals['_GETDEFAULTSTORAGERESOURCEIDRESPONSE']._serialized_end=1917 + _globals['_USERSTORAGESERVICE']._serialized_start=1920 + _globals['_USERSTORAGESERVICE']._serialized_end=4379 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/file_service_pb2.pyi b/airavata-python-sdk/airavata/services/file_service_pb2.pyi similarity index 91% rename from airavata-python-sdk/airavata_sdk/generated/services/file_service_pb2.pyi rename to airavata-python-sdk/airavata/services/file_service_pb2.pyi index ac2224585fd..4f2dbd6d6d7 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/file_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/file_service_pb2.pyi @@ -1,6 +1,6 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.data.replica import replica_catalog_pb2 as _replica_catalog_pb2 +from airavata.model.data.replica import replica_catalog_pb2 as _replica_catalog_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -63,6 +63,12 @@ class DownloadFileRequest(_message.Message): path: str def __init__(self, storage_resource_id: _Optional[str] = ..., path: _Optional[str] = ...) -> None: ... +class DownloadDataProductRequest(_message.Message): + __slots__ = ("product_uri",) + PRODUCT_URI_FIELD_NUMBER: _ClassVar[int] + product_uri: str + def __init__(self, product_uri: _Optional[str] = ...) -> None: ... + class DownloadFileResponse(_message.Message): __slots__ = ("content", "name", "content_type") CONTENT_FIELD_NUMBER: _ClassVar[int] @@ -143,6 +149,16 @@ class MoveFileRequest(_message.Message): destination_path: str def __init__(self, storage_resource_id: _Optional[str] = ..., source_path: _Optional[str] = ..., destination_path: _Optional[str] = ...) -> None: ... +class CopyFileRequest(_message.Message): + __slots__ = ("storage_resource_id", "source_path", "destination_path") + STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + SOURCE_PATH_FIELD_NUMBER: _ClassVar[int] + DESTINATION_PATH_FIELD_NUMBER: _ClassVar[int] + storage_resource_id: str + source_path: str + destination_path: str + def __init__(self, storage_resource_id: _Optional[str] = ..., source_path: _Optional[str] = ..., destination_path: _Optional[str] = ...) -> None: ... + class CreateDirRequest(_message.Message): __slots__ = ("storage_resource_id", "path") STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] diff --git a/airavata-python-sdk/airavata_sdk/generated/services/file_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/file_service_pb2_grpc.py similarity index 86% rename from airavata-python-sdk/airavata_sdk/generated/services/file_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/file_service_pb2_grpc.py index 36f2df24c5a..96ce3a1b3bb 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/file_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/file_service_pb2_grpc.py @@ -4,8 +4,8 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.data.replica import replica_catalog_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2 -from services import file_service_pb2 as services_dot_file__service__pb2 +from airavata.model.data.replica import replica_catalog_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2 +from airavata.services import file_service_pb2 as services_dot_file__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ @@ -47,6 +47,11 @@ def __init__(self, channel): request_serializer=services_dot_file__service__pb2.DownloadFileRequest.SerializeToString, response_deserializer=services_dot_file__service__pb2.DownloadFileResponse.FromString, _registered_method=True) + self.DownloadDataProduct = channel.unary_unary( + '/org.apache.airavata.api.file.UserStorageService/DownloadDataProduct', + request_serializer=services_dot_file__service__pb2.DownloadDataProductRequest.SerializeToString, + response_deserializer=services_dot_file__service__pb2.DownloadFileResponse.FromString, + _registered_method=True) self.FileExists = channel.unary_unary( '/org.apache.airavata.api.file.UserStorageService/FileExists', request_serializer=services_dot_file__service__pb2.FileExistsRequest.SerializeToString, @@ -77,6 +82,11 @@ def __init__(self, channel): request_serializer=services_dot_file__service__pb2.MoveFileRequest.SerializeToString, response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2.DataProductModel.FromString, _registered_method=True) + self.CopyFile = channel.unary_unary( + '/org.apache.airavata.api.file.UserStorageService/CopyFile', + request_serializer=services_dot_file__service__pb2.CopyFileRequest.SerializeToString, + response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2.DataProductModel.FromString, + _registered_method=True) self.CreateDir = channel.unary_unary( '/org.apache.airavata.api.file.UserStorageService/CreateDir', request_serializer=services_dot_file__service__pb2.CreateDirRequest.SerializeToString, @@ -120,6 +130,12 @@ def DownloadFile(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def DownloadDataProduct(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def FileExists(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -156,6 +172,12 @@ def MoveFile(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def CopyFile(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def CreateDir(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -199,6 +221,11 @@ def add_UserStorageServiceServicer_to_server(servicer, server): request_deserializer=services_dot_file__service__pb2.DownloadFileRequest.FromString, response_serializer=services_dot_file__service__pb2.DownloadFileResponse.SerializeToString, ), + 'DownloadDataProduct': grpc.unary_unary_rpc_method_handler( + servicer.DownloadDataProduct, + request_deserializer=services_dot_file__service__pb2.DownloadDataProductRequest.FromString, + response_serializer=services_dot_file__service__pb2.DownloadFileResponse.SerializeToString, + ), 'FileExists': grpc.unary_unary_rpc_method_handler( servicer.FileExists, request_deserializer=services_dot_file__service__pb2.FileExistsRequest.FromString, @@ -229,6 +256,11 @@ def add_UserStorageServiceServicer_to_server(servicer, server): request_deserializer=services_dot_file__service__pb2.MoveFileRequest.FromString, response_serializer=org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2.DataProductModel.SerializeToString, ), + 'CopyFile': grpc.unary_unary_rpc_method_handler( + servicer.CopyFile, + request_deserializer=services_dot_file__service__pb2.CopyFileRequest.FromString, + response_serializer=org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2.DataProductModel.SerializeToString, + ), 'CreateDir': grpc.unary_unary_rpc_method_handler( servicer.CreateDir, request_deserializer=services_dot_file__service__pb2.CreateDirRequest.FromString, @@ -320,6 +352,33 @@ def DownloadFile(request, metadata, _registered_method=True) + @staticmethod + def DownloadDataProduct(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.file.UserStorageService/DownloadDataProduct', + services_dot_file__service__pb2.DownloadDataProductRequest.SerializeToString, + services_dot_file__service__pb2.DownloadFileResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def FileExists(request, target, @@ -482,6 +541,33 @@ def MoveFile(request, metadata, _registered_method=True) + @staticmethod + def CopyFile(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.file.UserStorageService/CopyFile', + services_dot_file__service__pb2.CopyFileRequest.SerializeToString, + org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2.DataProductModel.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def CreateDir(request, target, diff --git a/airavata-python-sdk/airavata/services/gateway_resource_profile_service_pb2.py b/airavata-python-sdk/airavata/services/gateway_resource_profile_service_pb2.py new file mode 100644 index 00000000000..2061e1ef4ad --- /dev/null +++ b/airavata-python-sdk/airavata/services/gateway_resource_profile_service_pb2.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/gateway_resource_profile_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/gateway_resource_profile_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.appcatalog.gatewayprofile import gateway_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_gatewayprofile_dot_gateway__profile__pb2 +from airavata.model.appcatalog.accountprovisioning import account_provisioning_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_accountprovisioning_dot_account__provisioning__pb2 +from airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/services/gateway_resource_profile_service.proto\x12&org.apache.airavata.api.gatewayprofile\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1aIorg/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile.proto\x1aSorg/apache/airavata/model/appcatalog/accountprovisioning/account_provisioning.proto\x1a/org/apache/airavata/model/commons/commons.proto\"\x96\x01\n%RegisterGatewayResourceProfileRequest\x12m\n\x18gateway_resource_profile\x18\x01 \x01(\x0b\x32K.org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile\"<\n&RegisterGatewayResourceProfileResponse\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"6\n GetGatewayResourceProfileRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\xd1\x01\n GatewayResourceProfileWithAccess\x12m\n\x18gateway_resource_profile\x18\x01 \x01(\x0b\x32K.org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile\x12>\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32..org.apache.airavata.model.commons.AccessFlags\"\xa8\x01\n#UpdateGatewayResourceProfileRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12m\n\x18gateway_resource_profile\x18\x02 \x01(\x0b\x32K.org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile\"9\n#DeleteGatewayResourceProfileRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"&\n$GetAllGatewayResourceProfilesRequest\"\x97\x01\n%GetAllGatewayResourceProfilesResponse\x12n\n\x19gateway_resource_profiles\x18\x01 \x03(\x0b\x32K.org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile\"\xc3\x01\n\x1b\x41\x64\x64\x43omputePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\x12s\n\x1b\x63ompute_resource_preference\x18\x03 \x01(\x0b\x32N.org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference\"N\n\x1bGetComputePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\"\xc6\x01\n\x1eUpdateComputePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\x12s\n\x1b\x63ompute_resource_preference\x18\x03 \x01(\x0b\x32N.org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference\"Q\n\x1e\x44\x65leteComputePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\"5\n\x1fGetAllComputePreferencesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\x98\x01\n GetAllComputePreferencesResponse\x12t\n\x1c\x63ompute_resource_preferences\x18\x01 \x03(\x0b\x32N.org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference\"\xb2\x01\n\x1b\x41\x64\x64StoragePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13storage_resource_id\x18\x02 \x01(\t\x12\x62\n\x12storage_preference\x18\x03 \x01(\x0b\x32\x46.org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference\"N\n\x1bGetStoragePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13storage_resource_id\x18\x02 \x01(\t\"\xb5\x01\n\x1eUpdateStoragePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13storage_resource_id\x18\x02 \x01(\t\x12\x62\n\x12storage_preference\x18\x03 \x01(\x0b\x32\x46.org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference\"Q\n\x1e\x44\x65leteStoragePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13storage_resource_id\x18\x02 \x01(\t\"5\n\x1fGetAllStoragePreferencesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\x87\x01\n GetAllStoragePreferencesResponse\x12\x63\n\x13storage_preferences\x18\x01 \x03(\x0b\x32\x46.org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference\"\"\n GetSSHAccountProvisionersRequest\"\x96\x01\n!GetSSHAccountProvisionersResponse\x12q\n\x18ssh_account_provisioners\x18\x01 \x03(\x0b\x32O.org.apache.airavata.model.appcatalog.accountprovisioning.SSHAccountProvisioner2\xcd\x1e\n\x1dGatewayResourceProfileService\x12\xfb\x01\n\x1eRegisterGatewayResourceProfile\x12M.org.apache.airavata.api.gatewayprofile.RegisterGatewayResourceProfileRequest\x1aN.org.apache.airavata.api.gatewayprofile.RegisterGatewayResourceProfileResponse\":\x82\xd3\xe4\x93\x02\x34\"\x18/api/v1/gateway-profiles:\x18gateway_resource_profile\x12\xe1\x01\n\x19GetGatewayResourceProfile\x12H.org.apache.airavata.api.gatewayprofile.GetGatewayResourceProfileRequest\x1aK.org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile\"-\x82\xd3\xe4\x93\x02\'\x12%/api/v1/gateway-profiles/{gateway_id}\x12\xf3\x01\n#GetGatewayResourceProfileWithAccess\x12H.org.apache.airavata.api.gatewayprofile.GetGatewayResourceProfileRequest\x1aH.org.apache.airavata.api.gatewayprofile.GatewayResourceProfileWithAccess\"8\x82\xd3\xe4\x93\x02\x32\x12\x30/api/v1/gateway-profiles/{gateway_id}:withAccess\x12\xcc\x01\n\x1cUpdateGatewayResourceProfile\x12K.org.apache.airavata.api.gatewayprofile.UpdateGatewayResourceProfileRequest\x1a\x16.google.protobuf.Empty\"G\x82\xd3\xe4\x93\x02\x41\x1a%/api/v1/gateway-profiles/{gateway_id}:\x18gateway_resource_profile\x12\xb2\x01\n\x1c\x44\x65leteGatewayResourceProfile\x12K.org.apache.airavata.api.gatewayprofile.DeleteGatewayResourceProfileRequest\x1a\x16.google.protobuf.Empty\"-\x82\xd3\xe4\x93\x02\'*%/api/v1/gateway-profiles/{gateway_id}\x12\xde\x01\n\x1dGetAllGatewayResourceProfiles\x12L.org.apache.airavata.api.gatewayprofile.GetAllGatewayResourceProfilesRequest\x1aM.org.apache.airavata.api.gatewayprofile.GetAllGatewayResourceProfilesResponse\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/api/v1/gateway-profiles\x12\xd3\x01\n\x14\x41\x64\x64\x43omputePreference\x12\x43.org.apache.airavata.api.gatewayprofile.AddComputePreferenceRequest\x1a\x16.google.protobuf.Empty\"^\x82\xd3\xe4\x93\x02X\"9/api/v1/gateway-profiles/{gateway_id}/compute-preferences:\x1b\x63ompute_resource_preference\x12\x84\x02\n\x14GetComputePreference\x12\x43.org.apache.airavata.api.gatewayprofile.GetComputePreferenceRequest\x1aN.org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference\"W\x82\xd3\xe4\x93\x02Q\x12O/api/v1/gateway-profiles/{gateway_id}/compute-preferences/{compute_resource_id}\x12\xef\x01\n\x17UpdateComputePreference\x12\x46.org.apache.airavata.api.gatewayprofile.UpdateComputePreferenceRequest\x1a\x16.google.protobuf.Empty\"t\x82\xd3\xe4\x93\x02n\x1aO/api/v1/gateway-profiles/{gateway_id}/compute-preferences/{compute_resource_id}:\x1b\x63ompute_resource_preference\x12\xd2\x01\n\x17\x44\x65leteComputePreference\x12\x46.org.apache.airavata.api.gatewayprofile.DeleteComputePreferenceRequest\x1a\x16.google.protobuf.Empty\"W\x82\xd3\xe4\x93\x02Q*O/api/v1/gateway-profiles/{gateway_id}/compute-preferences/{compute_resource_id}\x12\xf0\x01\n\x18GetAllComputePreferences\x12G.org.apache.airavata.api.gatewayprofile.GetAllComputePreferencesRequest\x1aH.org.apache.airavata.api.gatewayprofile.GetAllComputePreferencesResponse\"A\x82\xd3\xe4\x93\x02;\x12\x39/api/v1/gateway-profiles/{gateway_id}/compute-preferences\x12\xca\x01\n\x14\x41\x64\x64StoragePreference\x12\x43.org.apache.airavata.api.gatewayprofile.AddStoragePreferenceRequest\x1a\x16.google.protobuf.Empty\"U\x82\xd3\xe4\x93\x02O\"9/api/v1/gateway-profiles/{gateway_id}/storage-preferences:\x12storage_preference\x12\xfc\x01\n\x14GetStoragePreference\x12\x43.org.apache.airavata.api.gatewayprofile.GetStoragePreferenceRequest\x1a\x46.org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference\"W\x82\xd3\xe4\x93\x02Q\x12O/api/v1/gateway-profiles/{gateway_id}/storage-preferences/{storage_resource_id}\x12\xe6\x01\n\x17UpdateStoragePreference\x12\x46.org.apache.airavata.api.gatewayprofile.UpdateStoragePreferenceRequest\x1a\x16.google.protobuf.Empty\"k\x82\xd3\xe4\x93\x02\x65\x1aO/api/v1/gateway-profiles/{gateway_id}/storage-preferences/{storage_resource_id}:\x12storage_preference\x12\xd2\x01\n\x17\x44\x65leteStoragePreference\x12\x46.org.apache.airavata.api.gatewayprofile.DeleteStoragePreferenceRequest\x1a\x16.google.protobuf.Empty\"W\x82\xd3\xe4\x93\x02Q*O/api/v1/gateway-profiles/{gateway_id}/storage-preferences/{storage_resource_id}\x12\xf0\x01\n\x18GetAllStoragePreferences\x12G.org.apache.airavata.api.gatewayprofile.GetAllStoragePreferencesRequest\x1aH.org.apache.airavata.api.gatewayprofile.GetAllStoragePreferencesResponse\"A\x82\xd3\xe4\x93\x02;\x12\x39/api/v1/gateway-profiles/{gateway_id}/storage-preferences\x12\xda\x01\n\x19GetSSHAccountProvisioners\x12H.org.apache.airavata.api.gatewayprofile.GetSSHAccountProvisionersRequest\x1aI.org.apache.airavata.api.gatewayprofile.GetSSHAccountProvisionersResponse\"(\x82\xd3\xe4\x93\x02\"\x12 /api/v1/ssh-account-provisionersB*\n&org.apache.airavata.api.gatewayprofileP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.gateway_resource_profile_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n&org.apache.airavata.api.gatewayprofileP\001' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['RegisterGatewayResourceProfile']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['RegisterGatewayResourceProfile']._serialized_options = b'\202\323\344\223\0024\"\030/api/v1/gateway-profiles:\030gateway_resource_profile' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetGatewayResourceProfile']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetGatewayResourceProfile']._serialized_options = b'\202\323\344\223\002\'\022%/api/v1/gateway-profiles/{gateway_id}' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetGatewayResourceProfileWithAccess']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetGatewayResourceProfileWithAccess']._serialized_options = b'\202\323\344\223\0022\0220/api/v1/gateway-profiles/{gateway_id}:withAccess' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['UpdateGatewayResourceProfile']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['UpdateGatewayResourceProfile']._serialized_options = b'\202\323\344\223\002A\032%/api/v1/gateway-profiles/{gateway_id}:\030gateway_resource_profile' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['DeleteGatewayResourceProfile']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['DeleteGatewayResourceProfile']._serialized_options = b'\202\323\344\223\002\'*%/api/v1/gateway-profiles/{gateway_id}' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetAllGatewayResourceProfiles']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetAllGatewayResourceProfiles']._serialized_options = b'\202\323\344\223\002\032\022\030/api/v1/gateway-profiles' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['AddComputePreference']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['AddComputePreference']._serialized_options = b'\202\323\344\223\002X\"9/api/v1/gateway-profiles/{gateway_id}/compute-preferences:\033compute_resource_preference' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetComputePreference']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetComputePreference']._serialized_options = b'\202\323\344\223\002Q\022O/api/v1/gateway-profiles/{gateway_id}/compute-preferences/{compute_resource_id}' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['UpdateComputePreference']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['UpdateComputePreference']._serialized_options = b'\202\323\344\223\002n\032O/api/v1/gateway-profiles/{gateway_id}/compute-preferences/{compute_resource_id}:\033compute_resource_preference' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['DeleteComputePreference']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['DeleteComputePreference']._serialized_options = b'\202\323\344\223\002Q*O/api/v1/gateway-profiles/{gateway_id}/compute-preferences/{compute_resource_id}' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetAllComputePreferences']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetAllComputePreferences']._serialized_options = b'\202\323\344\223\002;\0229/api/v1/gateway-profiles/{gateway_id}/compute-preferences' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['AddStoragePreference']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['AddStoragePreference']._serialized_options = b'\202\323\344\223\002O\"9/api/v1/gateway-profiles/{gateway_id}/storage-preferences:\022storage_preference' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetStoragePreference']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetStoragePreference']._serialized_options = b'\202\323\344\223\002Q\022O/api/v1/gateway-profiles/{gateway_id}/storage-preferences/{storage_resource_id}' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['UpdateStoragePreference']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['UpdateStoragePreference']._serialized_options = b'\202\323\344\223\002e\032O/api/v1/gateway-profiles/{gateway_id}/storage-preferences/{storage_resource_id}:\022storage_preference' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['DeleteStoragePreference']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['DeleteStoragePreference']._serialized_options = b'\202\323\344\223\002Q*O/api/v1/gateway-profiles/{gateway_id}/storage-preferences/{storage_resource_id}' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetAllStoragePreferences']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetAllStoragePreferences']._serialized_options = b'\202\323\344\223\002;\0229/api/v1/gateway-profiles/{gateway_id}/storage-preferences' + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetSSHAccountProvisioners']._loaded_options = None + _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetSSHAccountProvisioners']._serialized_options = b'\202\323\344\223\002\"\022 /api/v1/ssh-account-provisioners' + _globals['_REGISTERGATEWAYRESOURCEPROFILEREQUEST']._serialized_start=360 + _globals['_REGISTERGATEWAYRESOURCEPROFILEREQUEST']._serialized_end=510 + _globals['_REGISTERGATEWAYRESOURCEPROFILERESPONSE']._serialized_start=512 + _globals['_REGISTERGATEWAYRESOURCEPROFILERESPONSE']._serialized_end=572 + _globals['_GETGATEWAYRESOURCEPROFILEREQUEST']._serialized_start=574 + _globals['_GETGATEWAYRESOURCEPROFILEREQUEST']._serialized_end=628 + _globals['_GATEWAYRESOURCEPROFILEWITHACCESS']._serialized_start=631 + _globals['_GATEWAYRESOURCEPROFILEWITHACCESS']._serialized_end=840 + _globals['_UPDATEGATEWAYRESOURCEPROFILEREQUEST']._serialized_start=843 + _globals['_UPDATEGATEWAYRESOURCEPROFILEREQUEST']._serialized_end=1011 + _globals['_DELETEGATEWAYRESOURCEPROFILEREQUEST']._serialized_start=1013 + _globals['_DELETEGATEWAYRESOURCEPROFILEREQUEST']._serialized_end=1070 + _globals['_GETALLGATEWAYRESOURCEPROFILESREQUEST']._serialized_start=1072 + _globals['_GETALLGATEWAYRESOURCEPROFILESREQUEST']._serialized_end=1110 + _globals['_GETALLGATEWAYRESOURCEPROFILESRESPONSE']._serialized_start=1113 + _globals['_GETALLGATEWAYRESOURCEPROFILESRESPONSE']._serialized_end=1264 + _globals['_ADDCOMPUTEPREFERENCEREQUEST']._serialized_start=1267 + _globals['_ADDCOMPUTEPREFERENCEREQUEST']._serialized_end=1462 + _globals['_GETCOMPUTEPREFERENCEREQUEST']._serialized_start=1464 + _globals['_GETCOMPUTEPREFERENCEREQUEST']._serialized_end=1542 + _globals['_UPDATECOMPUTEPREFERENCEREQUEST']._serialized_start=1545 + _globals['_UPDATECOMPUTEPREFERENCEREQUEST']._serialized_end=1743 + _globals['_DELETECOMPUTEPREFERENCEREQUEST']._serialized_start=1745 + _globals['_DELETECOMPUTEPREFERENCEREQUEST']._serialized_end=1826 + _globals['_GETALLCOMPUTEPREFERENCESREQUEST']._serialized_start=1828 + _globals['_GETALLCOMPUTEPREFERENCESREQUEST']._serialized_end=1881 + _globals['_GETALLCOMPUTEPREFERENCESRESPONSE']._serialized_start=1884 + _globals['_GETALLCOMPUTEPREFERENCESRESPONSE']._serialized_end=2036 + _globals['_ADDSTORAGEPREFERENCEREQUEST']._serialized_start=2039 + _globals['_ADDSTORAGEPREFERENCEREQUEST']._serialized_end=2217 + _globals['_GETSTORAGEPREFERENCEREQUEST']._serialized_start=2219 + _globals['_GETSTORAGEPREFERENCEREQUEST']._serialized_end=2297 + _globals['_UPDATESTORAGEPREFERENCEREQUEST']._serialized_start=2300 + _globals['_UPDATESTORAGEPREFERENCEREQUEST']._serialized_end=2481 + _globals['_DELETESTORAGEPREFERENCEREQUEST']._serialized_start=2483 + _globals['_DELETESTORAGEPREFERENCEREQUEST']._serialized_end=2564 + _globals['_GETALLSTORAGEPREFERENCESREQUEST']._serialized_start=2566 + _globals['_GETALLSTORAGEPREFERENCESREQUEST']._serialized_end=2619 + _globals['_GETALLSTORAGEPREFERENCESRESPONSE']._serialized_start=2622 + _globals['_GETALLSTORAGEPREFERENCESRESPONSE']._serialized_end=2757 + _globals['_GETSSHACCOUNTPROVISIONERSREQUEST']._serialized_start=2759 + _globals['_GETSSHACCOUNTPROVISIONERSREQUEST']._serialized_end=2793 + _globals['_GETSSHACCOUNTPROVISIONERSRESPONSE']._serialized_start=2796 + _globals['_GETSSHACCOUNTPROVISIONERSRESPONSE']._serialized_end=2946 + _globals['_GATEWAYRESOURCEPROFILESERVICE']._serialized_start=2949 + _globals['_GATEWAYRESOURCEPROFILESERVICE']._serialized_end=6866 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/gateway_resource_profile_service_pb2.pyi b/airavata-python-sdk/airavata/services/gateway_resource_profile_service_pb2.pyi similarity index 91% rename from airavata-python-sdk/airavata_sdk/generated/services/gateway_resource_profile_service_pb2.pyi rename to airavata-python-sdk/airavata/services/gateway_resource_profile_service_pb2.pyi index 3ee1c5bb8cc..54f0371db4a 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/gateway_resource_profile_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/gateway_resource_profile_service_pb2.pyi @@ -1,7 +1,8 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.appcatalog.gatewayprofile import gateway_profile_pb2 as _gateway_profile_pb2 -from org.apache.airavata.model.appcatalog.accountprovisioning import account_provisioning_pb2 as _account_provisioning_pb2 +from airavata.model.appcatalog.gatewayprofile import gateway_profile_pb2 as _gateway_profile_pb2 +from airavata.model.appcatalog.accountprovisioning import account_provisioning_pb2 as _account_provisioning_pb2 +from airavata.model.commons import commons_pb2 as _commons_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -28,6 +29,14 @@ class GetGatewayResourceProfileRequest(_message.Message): gateway_id: str def __init__(self, gateway_id: _Optional[str] = ...) -> None: ... +class GatewayResourceProfileWithAccess(_message.Message): + __slots__ = ("gateway_resource_profile", "access") + GATEWAY_RESOURCE_PROFILE_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + gateway_resource_profile: _gateway_profile_pb2.GatewayResourceProfile + access: _commons_pb2.AccessFlags + def __init__(self, gateway_resource_profile: _Optional[_Union[_gateway_profile_pb2.GatewayResourceProfile, _Mapping]] = ..., access: _Optional[_Union[_commons_pb2.AccessFlags, _Mapping]] = ...) -> None: ... + class UpdateGatewayResourceProfileRequest(_message.Message): __slots__ = ("gateway_id", "gateway_resource_profile") GATEWAY_ID_FIELD_NUMBER: _ClassVar[int] diff --git a/airavata-python-sdk/airavata_sdk/generated/services/gateway_resource_profile_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/gateway_resource_profile_service_pb2_grpc.py similarity index 93% rename from airavata-python-sdk/airavata_sdk/generated/services/gateway_resource_profile_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/gateway_resource_profile_service_pb2_grpc.py index b76403b20bf..19b51706daf 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/gateway_resource_profile_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/gateway_resource_profile_service_pb2_grpc.py @@ -4,8 +4,8 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.appcatalog.gatewayprofile import gateway_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_gatewayprofile_dot_gateway__profile__pb2 -from services import gateway_resource_profile_service_pb2 as services_dot_gateway__resource__profile__service__pb2 +from airavata.model.appcatalog.gatewayprofile import gateway_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_gatewayprofile_dot_gateway__profile__pb2 +from airavata.services import gateway_resource_profile_service_pb2 as services_dot_gateway__resource__profile__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ @@ -48,6 +48,11 @@ def __init__(self, channel): request_serializer=services_dot_gateway__resource__profile__service__pb2.GetGatewayResourceProfileRequest.SerializeToString, response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_gatewayprofile_dot_gateway__profile__pb2.GatewayResourceProfile.FromString, _registered_method=True) + self.GetGatewayResourceProfileWithAccess = channel.unary_unary( + '/org.apache.airavata.api.gatewayprofile.GatewayResourceProfileService/GetGatewayResourceProfileWithAccess', + request_serializer=services_dot_gateway__resource__profile__service__pb2.GetGatewayResourceProfileRequest.SerializeToString, + response_deserializer=services_dot_gateway__resource__profile__service__pb2.GatewayResourceProfileWithAccess.FromString, + _registered_method=True) self.UpdateGatewayResourceProfile = channel.unary_unary( '/org.apache.airavata.api.gatewayprofile.GatewayResourceProfileService/UpdateGatewayResourceProfile', request_serializer=services_dot_gateway__resource__profile__service__pb2.UpdateGatewayResourceProfileRequest.SerializeToString, @@ -139,6 +144,14 @@ def GetGatewayResourceProfile(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetGatewayResourceProfileWithAccess(self, request, context): + """Additive: GetGatewayResourceProfile plus the caller's server-computed access + flags, so a client does not recompute access from a separate sharing round-trip. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def UpdateGatewayResourceProfile(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -242,6 +255,11 @@ def add_GatewayResourceProfileServiceServicer_to_server(servicer, server): request_deserializer=services_dot_gateway__resource__profile__service__pb2.GetGatewayResourceProfileRequest.FromString, response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_gatewayprofile_dot_gateway__profile__pb2.GatewayResourceProfile.SerializeToString, ), + 'GetGatewayResourceProfileWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetGatewayResourceProfileWithAccess, + request_deserializer=services_dot_gateway__resource__profile__service__pb2.GetGatewayResourceProfileRequest.FromString, + response_serializer=services_dot_gateway__resource__profile__service__pb2.GatewayResourceProfileWithAccess.SerializeToString, + ), 'UpdateGatewayResourceProfile': grpc.unary_unary_rpc_method_handler( servicer.UpdateGatewayResourceProfile, request_deserializer=services_dot_gateway__resource__profile__service__pb2.UpdateGatewayResourceProfileRequest.FromString, @@ -379,6 +397,33 @@ def GetGatewayResourceProfile(request, metadata, _registered_method=True) + @staticmethod + def GetGatewayResourceProfileWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.gatewayprofile.GatewayResourceProfileService/GetGatewayResourceProfileWithAccess', + services_dot_gateway__resource__profile__service__pb2.GetGatewayResourceProfileRequest.SerializeToString, + services_dot_gateway__resource__profile__service__pb2.GatewayResourceProfileWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def UpdateGatewayResourceProfile(request, target, diff --git a/airavata-python-sdk/airavata_sdk/generated/services/gateway_service_pb2.py b/airavata-python-sdk/airavata/services/gateway_service_pb2.py similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/services/gateway_service_pb2.py rename to airavata-python-sdk/airavata/services/gateway_service_pb2.py index fe6f9f2fd7c..b01e801aca8 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/gateway_service_pb2.py +++ b/airavata-python-sdk/airavata/services/gateway_service_pb2.py @@ -24,7 +24,7 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 +from airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1eservices/gateway_service.proto\x12\x1forg.apache.airavata.api.gateway\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x33org/apache/airavata/model/workspace/workspace.proto\"R\n\x11\x41\x64\x64GatewayRequest\x12=\n\x07gateway\x18\x01 \x01(\x0b\x32,.org.apache.airavata.model.workspace.Gateway\"(\n\x12\x41\x64\x64GatewayResponse\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\'\n\x11GetGatewayRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"i\n\x14UpdateGatewayRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12=\n\x07gateway\x18\x02 \x01(\x0b\x32,.org.apache.airavata.model.workspace.Gateway\"*\n\x14\x44\x65leteGatewayRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\x17\n\x15GetAllGatewaysRequest\"X\n\x16GetAllGatewaysResponse\x12>\n\x08gateways\x18\x01 \x03(\x0b\x32,.org.apache.airavata.model.workspace.Gateway\"+\n\x15IsGatewayExistRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"(\n\x16IsGatewayExistResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"1\n\x1bGetAllUsersInGatewayRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"2\n\x1cGetAllUsersInGatewayResponse\x12\x12\n\nuser_names\x18\x01 \x03(\t\"<\n\x13IsUserExistsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x11\n\tuser_name\x18\x02 \x01(\t\"&\n\x14IsUserExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\x32\xad\n\n\x0eGatewayService\x12\x98\x01\n\nAddGateway\x12\x32.org.apache.airavata.api.gateway.AddGatewayRequest\x1a\x33.org.apache.airavata.api.gateway.AddGatewayResponse\"!\x82\xd3\xe4\x93\x02\x1b\"\x10/api/v1/gateways:\x07gateway\x12\x95\x01\n\nGetGateway\x12\x32.org.apache.airavata.api.gateway.GetGatewayRequest\x1a,.org.apache.airavata.model.workspace.Gateway\"%\x82\xd3\xe4\x93\x02\x1f\x12\x1d/api/v1/gateways/{gateway_id}\x12\x8e\x01\n\rUpdateGateway\x12\x35.org.apache.airavata.api.gateway.UpdateGatewayRequest\x1a\x16.google.protobuf.Empty\".\x82\xd3\xe4\x93\x02(\x1a\x1d/api/v1/gateways/{gateway_id}:\x07gateway\x12\x85\x01\n\rDeleteGateway\x12\x35.org.apache.airavata.api.gateway.DeleteGatewayRequest\x1a\x16.google.protobuf.Empty\"%\x82\xd3\xe4\x93\x02\x1f*\x1d/api/v1/gateways/{gateway_id}\x12\x9b\x01\n\x0eGetAllGateways\x12\x36.org.apache.airavata.api.gateway.GetAllGatewaysRequest\x1a\x37.org.apache.airavata.api.gateway.GetAllGatewaysResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/api/v1/gateways\x12\xaf\x01\n\x0eIsGatewayExist\x12\x36.org.apache.airavata.api.gateway.IsGatewayExistRequest\x1a\x37.org.apache.airavata.api.gateway.IsGatewayExistResponse\",\x82\xd3\xe4\x93\x02&\x12$/api/v1/gateways/{gateway_id}:exists\x12\xc0\x01\n\x14GetAllUsersInGateway\x12<.org.apache.airavata.api.gateway.GetAllUsersInGatewayRequest\x1a=.org.apache.airavata.api.gateway.GetAllUsersInGatewayResponse\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/gateways/{gateway_id}/users\x12\xbb\x01\n\x0cIsUserExists\x12\x34.org.apache.airavata.api.gateway.IsUserExistsRequest\x1a\x35.org.apache.airavata.api.gateway.IsUserExistsResponse\">\x82\xd3\xe4\x93\x02\x38\x12\x36/api/v1/gateways/{gateway_id}/users/{user_name}:existsB#\n\x1forg.apache.airavata.api.gatewayP\x01\x62\x06proto3') diff --git a/airavata-python-sdk/airavata_sdk/generated/services/gateway_service_pb2.pyi b/airavata-python-sdk/airavata/services/gateway_service_pb2.pyi similarity index 97% rename from airavata-python-sdk/airavata_sdk/generated/services/gateway_service_pb2.pyi rename to airavata-python-sdk/airavata/services/gateway_service_pb2.pyi index 3a6618fe5b0..91483156ff3 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/gateway_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/gateway_service_pb2.pyi @@ -1,6 +1,6 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.workspace import workspace_pb2 as _workspace_pb2 +from airavata.model.workspace import workspace_pb2 as _workspace_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message diff --git a/airavata-python-sdk/airavata_sdk/generated/services/gateway_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/gateway_service_pb2_grpc.py similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/services/gateway_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/gateway_service_pb2_grpc.py index aff913cf4c4..a01767310f1 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/gateway_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/gateway_service_pb2_grpc.py @@ -4,8 +4,8 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 -from services import gateway_service_pb2 as services_dot_gateway__service__pb2 +from airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 +from airavata.services import gateway_service_pb2 as services_dot_gateway__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ diff --git a/airavata-python-sdk/airavata/services/group_manager_service_pb2.py b/airavata-python-sdk/airavata/services/group_manager_service_pb2.py new file mode 100644 index 00000000000..e41c97aba86 --- /dev/null +++ b/airavata-python-sdk/airavata/services/group_manager_service_pb2.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/group_manager_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/group_manager_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.group import group_manager_pb2 as org_dot_apache_dot_airavata_dot_model_dot_group_dot_group__manager__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$services/group_manager_service.proto\x12(org.apache.airavata.api.iam.groupmanager\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x33org/apache/airavata/model/group/group_manager.proto\"P\n\x12\x43reateGroupRequest\x12:\n\x05group\x18\x01 \x01(\x0b\x32+.org.apache.airavata.model.group.GroupModel\"\'\n\x13\x43reateGroupResponse\x12\x10\n\x08group_id\x18\x01 \x01(\t\"P\n\x12UpdateGroupRequest\x12:\n\x05group\x18\x01 \x01(\x0b\x32+.org.apache.airavata.model.group.GroupModel\"8\n\x12\x44\x65leteGroupRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x10\n\x08owner_id\x18\x02 \x01(\t\"#\n\x0fGetGroupRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\"\xbd\x01\n\x10GroupAccessFlags\x12\x10\n\x08is_admin\x18\x01 \x01(\x08\x12\x10\n\x08is_owner\x18\x02 \x01(\x08\x12\x11\n\tis_member\x18\x03 \x01(\x08\x12\x1f\n\x17is_gateway_admins_group\x18\x04 \x01(\x08\x12)\n!is_read_only_gateway_admins_group\x18\x05 \x01(\x08\x12&\n\x1eis_default_gateway_users_group\x18\x06 \x01(\x08\"\x99\x01\n\x0fGroupWithAccess\x12:\n\x05group\x18\x01 \x01(\x0b\x32+.org.apache.airavata.model.group.GroupModel\x12J\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32:.org.apache.airavata.api.iam.groupmanager.GroupAccessFlags\"\x12\n\x10GetGroupsRequest\"P\n\x11GetGroupsResponse\x12;\n\x06groups\x18\x01 \x03(\x0b\x32+.org.apache.airavata.model.group.GroupModel\"h\n\x1bGetGroupsWithAccessResponse\x12I\n\x06groups\x18\x01 \x03(\x0b\x32\x39.org.apache.airavata.api.iam.groupmanager.GroupWithAccess\"3\n\x1eGetAllGroupsUserBelongsRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\"^\n\x1fGetAllGroupsUserBelongsResponse\x12;\n\x06groups\x18\x01 \x03(\x0b\x32+.org.apache.airavata.model.group.GroupModel\"<\n\x16\x41\x64\x64UsersToGroupRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x10\n\x08user_ids\x18\x02 \x03(\t\"A\n\x1bRemoveUsersFromGroupRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x10\n\x08user_ids\x18\x02 \x03(\t\"G\n\x1dTransferGroupOwnershipRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x14\n\x0cnew_owner_id\x18\x02 \x01(\t\"<\n\x15\x41\x64\x64GroupAdminsRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x11\n\tadmin_ids\x18\x02 \x03(\t\"?\n\x18RemoveGroupAdminsRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x11\n\tadmin_ids\x18\x02 \x03(\t\";\n\x15HasAdminAccessRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x10\n\x08\x61\x64min_id\x18\x02 \x01(\t\",\n\x16HasAdminAccessResponse\x12\x12\n\nhas_access\x18\x01 \x01(\x08\";\n\x15HasOwnerAccessRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x10\n\x08owner_id\x18\x02 \x01(\t\",\n\x16HasOwnerAccessResponse\x12\x12\n\nhas_access\x18\x01 \x01(\x08\x32\x94\x19\n\x13GroupManagerService\x12\xa9\x01\n\x0b\x43reateGroup\x12<.org.apache.airavata.api.iam.groupmanager.CreateGroupRequest\x1a=.org.apache.airavata.api.iam.groupmanager.CreateGroupResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\"\x0e/api/v1/groups:\x05group\x12\x8d\x01\n\x0bUpdateGroup\x12<.org.apache.airavata.api.iam.groupmanager.UpdateGroupRequest\x1a\x16.google.protobuf.Empty\"(\x82\xd3\xe4\x93\x02\"\x1a\x19/api/v1/groups/{group.id}:\x05group\x12\xb9\x01\n\x15\x43reateGroupReconciled\x12<.org.apache.airavata.api.iam.groupmanager.CreateGroupRequest\x1a\x39.org.apache.airavata.api.iam.groupmanager.GroupWithAccess\"\'\x82\xd3\xe4\x93\x02!\"\x18/api/v1/groups:reconcile:\x05group\x12\xc4\x01\n\x15UpdateGroupReconciled\x12<.org.apache.airavata.api.iam.groupmanager.UpdateGroupRequest\x1a\x39.org.apache.airavata.api.iam.groupmanager.GroupWithAccess\"2\x82\xd3\xe4\x93\x02,\x1a#/api/v1/groups/{group.id}:reconcile:\x05group\x12\x86\x01\n\x0b\x44\x65leteGroup\x12<.org.apache.airavata.api.iam.groupmanager.DeleteGroupRequest\x1a\x16.google.protobuf.Empty\"!\x82\xd3\xe4\x93\x02\x1b*\x19/api/v1/groups/{group_id}\x12\x95\x01\n\x08GetGroup\x12\x39.org.apache.airavata.api.iam.groupmanager.GetGroupRequest\x1a+.org.apache.airavata.model.group.GroupModel\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/api/v1/groups/{group_id}\x12\xb8\x01\n\x12GetGroupWithAccess\x12\x39.org.apache.airavata.api.iam.groupmanager.GetGroupRequest\x1a\x39.org.apache.airavata.api.iam.groupmanager.GroupWithAccess\",\x82\xd3\xe4\x93\x02&\x12$/api/v1/groups/{group_id}:withAccess\x12\x9c\x01\n\tGetGroups\x12:.org.apache.airavata.api.iam.groupmanager.GetGroupsRequest\x1a;.org.apache.airavata.api.iam.groupmanager.GetGroupsResponse\"\x16\x82\xd3\xe4\x93\x02\x10\x12\x0e/api/v1/groups\x12\xbb\x01\n\x13GetGroupsWithAccess\x12:.org.apache.airavata.api.iam.groupmanager.GetGroupsRequest\x1a\x45.org.apache.airavata.api.iam.groupmanager.GetGroupsWithAccessResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/api/v1/groups:withAccess\x12\xd7\x01\n\x17GetAllGroupsUserBelongs\x12H.org.apache.airavata.api.iam.groupmanager.GetAllGroupsUserBelongsRequest\x1aI.org.apache.airavata.api.iam.groupmanager.GetAllGroupsUserBelongsResponse\"\'\x82\xd3\xe4\x93\x02!\x12\x1f/api/v1/groups/user/{user_name}\x12\xe8\x01\n!GetAllGroupsUserBelongsWithAccess\x12H.org.apache.airavata.api.iam.groupmanager.GetAllGroupsUserBelongsRequest\x1a\x45.org.apache.airavata.api.iam.groupmanager.GetGroupsWithAccessResponse\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/groups/user/{user_name}:withAccess\x12\x99\x01\n\x0f\x41\x64\x64UsersToGroup\x12@.org.apache.airavata.api.iam.groupmanager.AddUsersToGroupRequest\x1a\x16.google.protobuf.Empty\",\x82\xd3\xe4\x93\x02&\"!/api/v1/groups/{group_id}/members:\x01*\x12\xa0\x01\n\x14RemoveUsersFromGroup\x12\x45.org.apache.airavata.api.iam.groupmanager.RemoveUsersFromGroupRequest\x1a\x16.google.protobuf.Empty\")\x82\xd3\xe4\x93\x02#*!/api/v1/groups/{group_id}/members\x12\xa9\x01\n\x16TransferGroupOwnership\x12G.org.apache.airavata.api.iam.groupmanager.TransferGroupOwnershipRequest\x1a\x16.google.protobuf.Empty\".\x82\xd3\xe4\x93\x02(\"#/api/v1/groups/{group_id}/ownership:\x01*\x12\x96\x01\n\x0e\x41\x64\x64GroupAdmins\x12?.org.apache.airavata.api.iam.groupmanager.AddGroupAdminsRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%\" /api/v1/groups/{group_id}/admins:\x01*\x12\x99\x01\n\x11RemoveGroupAdmins\x12\x42.org.apache.airavata.api.iam.groupmanager.RemoveGroupAdminsRequest\x1a\x16.google.protobuf.Empty\"(\x82\xd3\xe4\x93\x02\"* /api/v1/groups/{group_id}/admins\x12\xce\x01\n\x0eHasAdminAccess\x12?.org.apache.airavata.api.iam.groupmanager.HasAdminAccessRequest\x1a@.org.apache.airavata.api.iam.groupmanager.HasAdminAccessResponse\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/api/v1/groups/{group_id}/admins/{admin_id}:check\x12\xce\x01\n\x0eHasOwnerAccess\x12?.org.apache.airavata.api.iam.groupmanager.HasOwnerAccessRequest\x1a@.org.apache.airavata.api.iam.groupmanager.HasOwnerAccessResponse\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/api/v1/groups/{group_id}/owners/{owner_id}:checkB,\n(org.apache.airavata.api.iam.groupmanagerP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.group_manager_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n(org.apache.airavata.api.iam.groupmanagerP\001' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['CreateGroup']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['CreateGroup']._serialized_options = b'\202\323\344\223\002\027\"\016/api/v1/groups:\005group' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['UpdateGroup']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['UpdateGroup']._serialized_options = b'\202\323\344\223\002\"\032\031/api/v1/groups/{group.id}:\005group' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['CreateGroupReconciled']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['CreateGroupReconciled']._serialized_options = b'\202\323\344\223\002!\"\030/api/v1/groups:reconcile:\005group' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['UpdateGroupReconciled']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['UpdateGroupReconciled']._serialized_options = b'\202\323\344\223\002,\032#/api/v1/groups/{group.id}:reconcile:\005group' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['DeleteGroup']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['DeleteGroup']._serialized_options = b'\202\323\344\223\002\033*\031/api/v1/groups/{group_id}' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetGroup']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetGroup']._serialized_options = b'\202\323\344\223\002\033\022\031/api/v1/groups/{group_id}' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetGroupWithAccess']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetGroupWithAccess']._serialized_options = b'\202\323\344\223\002&\022$/api/v1/groups/{group_id}:withAccess' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetGroups']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetGroups']._serialized_options = b'\202\323\344\223\002\020\022\016/api/v1/groups' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetGroupsWithAccess']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetGroupsWithAccess']._serialized_options = b'\202\323\344\223\002\033\022\031/api/v1/groups:withAccess' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetAllGroupsUserBelongs']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetAllGroupsUserBelongs']._serialized_options = b'\202\323\344\223\002!\022\037/api/v1/groups/user/{user_name}' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetAllGroupsUserBelongsWithAccess']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetAllGroupsUserBelongsWithAccess']._serialized_options = b'\202\323\344\223\002,\022*/api/v1/groups/user/{user_name}:withAccess' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['AddUsersToGroup']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['AddUsersToGroup']._serialized_options = b'\202\323\344\223\002&\"!/api/v1/groups/{group_id}/members:\001*' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['RemoveUsersFromGroup']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['RemoveUsersFromGroup']._serialized_options = b'\202\323\344\223\002#*!/api/v1/groups/{group_id}/members' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['TransferGroupOwnership']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['TransferGroupOwnership']._serialized_options = b'\202\323\344\223\002(\"#/api/v1/groups/{group_id}/ownership:\001*' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['AddGroupAdmins']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['AddGroupAdmins']._serialized_options = b'\202\323\344\223\002%\" /api/v1/groups/{group_id}/admins:\001*' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['RemoveGroupAdmins']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['RemoveGroupAdmins']._serialized_options = b'\202\323\344\223\002\"* /api/v1/groups/{group_id}/admins' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['HasAdminAccess']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['HasAdminAccess']._serialized_options = b'\202\323\344\223\0023\0221/api/v1/groups/{group_id}/admins/{admin_id}:check' + _globals['_GROUPMANAGERSERVICE'].methods_by_name['HasOwnerAccess']._loaded_options = None + _globals['_GROUPMANAGERSERVICE'].methods_by_name['HasOwnerAccess']._serialized_options = b'\202\323\344\223\0023\0221/api/v1/groups/{group_id}/owners/{owner_id}:check' + _globals['_CREATEGROUPREQUEST']._serialized_start=194 + _globals['_CREATEGROUPREQUEST']._serialized_end=274 + _globals['_CREATEGROUPRESPONSE']._serialized_start=276 + _globals['_CREATEGROUPRESPONSE']._serialized_end=315 + _globals['_UPDATEGROUPREQUEST']._serialized_start=317 + _globals['_UPDATEGROUPREQUEST']._serialized_end=397 + _globals['_DELETEGROUPREQUEST']._serialized_start=399 + _globals['_DELETEGROUPREQUEST']._serialized_end=455 + _globals['_GETGROUPREQUEST']._serialized_start=457 + _globals['_GETGROUPREQUEST']._serialized_end=492 + _globals['_GROUPACCESSFLAGS']._serialized_start=495 + _globals['_GROUPACCESSFLAGS']._serialized_end=684 + _globals['_GROUPWITHACCESS']._serialized_start=687 + _globals['_GROUPWITHACCESS']._serialized_end=840 + _globals['_GETGROUPSREQUEST']._serialized_start=842 + _globals['_GETGROUPSREQUEST']._serialized_end=860 + _globals['_GETGROUPSRESPONSE']._serialized_start=862 + _globals['_GETGROUPSRESPONSE']._serialized_end=942 + _globals['_GETGROUPSWITHACCESSRESPONSE']._serialized_start=944 + _globals['_GETGROUPSWITHACCESSRESPONSE']._serialized_end=1048 + _globals['_GETALLGROUPSUSERBELONGSREQUEST']._serialized_start=1050 + _globals['_GETALLGROUPSUSERBELONGSREQUEST']._serialized_end=1101 + _globals['_GETALLGROUPSUSERBELONGSRESPONSE']._serialized_start=1103 + _globals['_GETALLGROUPSUSERBELONGSRESPONSE']._serialized_end=1197 + _globals['_ADDUSERSTOGROUPREQUEST']._serialized_start=1199 + _globals['_ADDUSERSTOGROUPREQUEST']._serialized_end=1259 + _globals['_REMOVEUSERSFROMGROUPREQUEST']._serialized_start=1261 + _globals['_REMOVEUSERSFROMGROUPREQUEST']._serialized_end=1326 + _globals['_TRANSFERGROUPOWNERSHIPREQUEST']._serialized_start=1328 + _globals['_TRANSFERGROUPOWNERSHIPREQUEST']._serialized_end=1399 + _globals['_ADDGROUPADMINSREQUEST']._serialized_start=1401 + _globals['_ADDGROUPADMINSREQUEST']._serialized_end=1461 + _globals['_REMOVEGROUPADMINSREQUEST']._serialized_start=1463 + _globals['_REMOVEGROUPADMINSREQUEST']._serialized_end=1526 + _globals['_HASADMINACCESSREQUEST']._serialized_start=1528 + _globals['_HASADMINACCESSREQUEST']._serialized_end=1587 + _globals['_HASADMINACCESSRESPONSE']._serialized_start=1589 + _globals['_HASADMINACCESSRESPONSE']._serialized_end=1633 + _globals['_HASOWNERACCESSREQUEST']._serialized_start=1635 + _globals['_HASOWNERACCESSREQUEST']._serialized_end=1694 + _globals['_HASOWNERACCESSRESPONSE']._serialized_start=1696 + _globals['_HASOWNERACCESSRESPONSE']._serialized_end=1740 + _globals['_GROUPMANAGERSERVICE']._serialized_start=1743 + _globals['_GROUPMANAGERSERVICE']._serialized_end=4963 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/group_manager_service_pb2.pyi b/airavata-python-sdk/airavata/services/group_manager_service_pb2.pyi similarity index 76% rename from airavata-python-sdk/airavata_sdk/generated/services/group_manager_service_pb2.pyi rename to airavata-python-sdk/airavata/services/group_manager_service_pb2.pyi index faec0f2fc99..431f08d9fb7 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/group_manager_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/group_manager_service_pb2.pyi @@ -1,6 +1,6 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.group import group_manager_pb2 as _group_manager_pb2 +from airavata.model.group import group_manager_pb2 as _group_manager_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -41,6 +41,30 @@ class GetGroupRequest(_message.Message): group_id: str def __init__(self, group_id: _Optional[str] = ...) -> None: ... +class GroupAccessFlags(_message.Message): + __slots__ = ("is_admin", "is_owner", "is_member", "is_gateway_admins_group", "is_read_only_gateway_admins_group", "is_default_gateway_users_group") + IS_ADMIN_FIELD_NUMBER: _ClassVar[int] + IS_OWNER_FIELD_NUMBER: _ClassVar[int] + IS_MEMBER_FIELD_NUMBER: _ClassVar[int] + IS_GATEWAY_ADMINS_GROUP_FIELD_NUMBER: _ClassVar[int] + IS_READ_ONLY_GATEWAY_ADMINS_GROUP_FIELD_NUMBER: _ClassVar[int] + IS_DEFAULT_GATEWAY_USERS_GROUP_FIELD_NUMBER: _ClassVar[int] + is_admin: bool + is_owner: bool + is_member: bool + is_gateway_admins_group: bool + is_read_only_gateway_admins_group: bool + is_default_gateway_users_group: bool + def __init__(self, is_admin: bool = ..., is_owner: bool = ..., is_member: bool = ..., is_gateway_admins_group: bool = ..., is_read_only_gateway_admins_group: bool = ..., is_default_gateway_users_group: bool = ...) -> None: ... + +class GroupWithAccess(_message.Message): + __slots__ = ("group", "access") + GROUP_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + group: _group_manager_pb2.GroupModel + access: GroupAccessFlags + def __init__(self, group: _Optional[_Union[_group_manager_pb2.GroupModel, _Mapping]] = ..., access: _Optional[_Union[GroupAccessFlags, _Mapping]] = ...) -> None: ... + class GetGroupsRequest(_message.Message): __slots__ = () def __init__(self) -> None: ... @@ -51,6 +75,12 @@ class GetGroupsResponse(_message.Message): groups: _containers.RepeatedCompositeFieldContainer[_group_manager_pb2.GroupModel] def __init__(self, groups: _Optional[_Iterable[_Union[_group_manager_pb2.GroupModel, _Mapping]]] = ...) -> None: ... +class GetGroupsWithAccessResponse(_message.Message): + __slots__ = ("groups",) + GROUPS_FIELD_NUMBER: _ClassVar[int] + groups: _containers.RepeatedCompositeFieldContainer[GroupWithAccess] + def __init__(self, groups: _Optional[_Iterable[_Union[GroupWithAccess, _Mapping]]] = ...) -> None: ... + class GetAllGroupsUserBelongsRequest(_message.Message): __slots__ = ("user_name",) USER_NAME_FIELD_NUMBER: _ClassVar[int] diff --git a/airavata-python-sdk/airavata_sdk/generated/services/group_manager_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/group_manager_service_pb2_grpc.py similarity index 69% rename from airavata-python-sdk/airavata_sdk/generated/services/group_manager_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/group_manager_service_pb2_grpc.py index 2b9175870e6..f5a8be115a6 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/group_manager_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/group_manager_service_pb2_grpc.py @@ -4,8 +4,8 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.group import group_manager_pb2 as org_dot_apache_dot_airavata_dot_model_dot_group_dot_group__manager__pb2 -from services import group_manager_service_pb2 as services_dot_group__manager__service__pb2 +from airavata.model.group import group_manager_pb2 as org_dot_apache_dot_airavata_dot_model_dot_group_dot_group__manager__pb2 +from airavata.services import group_manager_service_pb2 as services_dot_group__manager__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ @@ -47,6 +47,16 @@ def __init__(self, channel): request_serializer=services_dot_group__manager__service__pb2.UpdateGroupRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) + self.CreateGroupReconciled = channel.unary_unary( + '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/CreateGroupReconciled', + request_serializer=services_dot_group__manager__service__pb2.CreateGroupRequest.SerializeToString, + response_deserializer=services_dot_group__manager__service__pb2.GroupWithAccess.FromString, + _registered_method=True) + self.UpdateGroupReconciled = channel.unary_unary( + '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/UpdateGroupReconciled', + request_serializer=services_dot_group__manager__service__pb2.UpdateGroupRequest.SerializeToString, + response_deserializer=services_dot_group__manager__service__pb2.GroupWithAccess.FromString, + _registered_method=True) self.DeleteGroup = channel.unary_unary( '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/DeleteGroup', request_serializer=services_dot_group__manager__service__pb2.DeleteGroupRequest.SerializeToString, @@ -57,16 +67,31 @@ def __init__(self, channel): request_serializer=services_dot_group__manager__service__pb2.GetGroupRequest.SerializeToString, response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_group_dot_group__manager__pb2.GroupModel.FromString, _registered_method=True) + self.GetGroupWithAccess = channel.unary_unary( + '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/GetGroupWithAccess', + request_serializer=services_dot_group__manager__service__pb2.GetGroupRequest.SerializeToString, + response_deserializer=services_dot_group__manager__service__pb2.GroupWithAccess.FromString, + _registered_method=True) self.GetGroups = channel.unary_unary( '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/GetGroups', request_serializer=services_dot_group__manager__service__pb2.GetGroupsRequest.SerializeToString, response_deserializer=services_dot_group__manager__service__pb2.GetGroupsResponse.FromString, _registered_method=True) + self.GetGroupsWithAccess = channel.unary_unary( + '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/GetGroupsWithAccess', + request_serializer=services_dot_group__manager__service__pb2.GetGroupsRequest.SerializeToString, + response_deserializer=services_dot_group__manager__service__pb2.GetGroupsWithAccessResponse.FromString, + _registered_method=True) self.GetAllGroupsUserBelongs = channel.unary_unary( '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/GetAllGroupsUserBelongs', request_serializer=services_dot_group__manager__service__pb2.GetAllGroupsUserBelongsRequest.SerializeToString, response_deserializer=services_dot_group__manager__service__pb2.GetAllGroupsUserBelongsResponse.FromString, _registered_method=True) + self.GetAllGroupsUserBelongsWithAccess = channel.unary_unary( + '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/GetAllGroupsUserBelongsWithAccess', + request_serializer=services_dot_group__manager__service__pb2.GetAllGroupsUserBelongsRequest.SerializeToString, + response_deserializer=services_dot_group__manager__service__pb2.GetGroupsWithAccessResponse.FromString, + _registered_method=True) self.AddUsersToGroup = channel.unary_unary( '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/AddUsersToGroup', request_serializer=services_dot_group__manager__service__pb2.AddUsersToGroupRequest.SerializeToString, @@ -120,6 +145,26 @@ def UpdateGroup(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def CreateGroupReconciled(self, request, context): + """Additive declarative create: the client sends the desired full members + admins lists in + GroupModel and the server reconciles (computes add/remove deltas) in one call. Unlike CreateGroup + (which persists only metadata and ignores members/admins), this rpc also applies the roster, so a + thin client need not diff and fan out the membership/admin mutator rpcs itself. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateGroupReconciled(self, request, context): + """Additive declarative update: the client sends the desired full members + admins lists in + GroupModel and the server reconciles current vs desired (add/remove members and admins, promoting + admins-not-yet-members to members) plus the metadata, in one call. Unlike UpdateGroup (which + persists only metadata and ignores members/admins), this rpc reconciles the roster server-side. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def DeleteGroup(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -132,18 +177,46 @@ def GetGroup(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetGroupWithAccess(self, request, context): + """Additive: GetGroup plus the caller's six server-computed group-access flags (and the + group's members), so a client does not recompute group access from separate + GroupManager / gateway-groups round-trips. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetGroups(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetGroupsWithAccess(self, request, context): + """Additive: the list analogue of GetGroupWithAccess. Each group is unioned with the + caller's six server-computed group-access flags; members/admins are populated only for + insiders (see GetGroupWithAccess) so non-members do not see the roster. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetAllGroupsUserBelongs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetAllGroupsUserBelongsWithAccess(self, request, context): + """Additive: the with-access analogue of GetAllGroupsUserBelongs. Each group the + user belongs to is unioned with the caller's six server-computed group-access + flags (members/admins populated for insiders, as GetGroupsWithAccess), so the + portal no longer fans out per-group HasAdminAccess / GetGatewayGroups lookups. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def AddUsersToGroup(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -199,6 +272,16 @@ def add_GroupManagerServiceServicer_to_server(servicer, server): request_deserializer=services_dot_group__manager__service__pb2.UpdateGroupRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), + 'CreateGroupReconciled': grpc.unary_unary_rpc_method_handler( + servicer.CreateGroupReconciled, + request_deserializer=services_dot_group__manager__service__pb2.CreateGroupRequest.FromString, + response_serializer=services_dot_group__manager__service__pb2.GroupWithAccess.SerializeToString, + ), + 'UpdateGroupReconciled': grpc.unary_unary_rpc_method_handler( + servicer.UpdateGroupReconciled, + request_deserializer=services_dot_group__manager__service__pb2.UpdateGroupRequest.FromString, + response_serializer=services_dot_group__manager__service__pb2.GroupWithAccess.SerializeToString, + ), 'DeleteGroup': grpc.unary_unary_rpc_method_handler( servicer.DeleteGroup, request_deserializer=services_dot_group__manager__service__pb2.DeleteGroupRequest.FromString, @@ -209,16 +292,31 @@ def add_GroupManagerServiceServicer_to_server(servicer, server): request_deserializer=services_dot_group__manager__service__pb2.GetGroupRequest.FromString, response_serializer=org_dot_apache_dot_airavata_dot_model_dot_group_dot_group__manager__pb2.GroupModel.SerializeToString, ), + 'GetGroupWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetGroupWithAccess, + request_deserializer=services_dot_group__manager__service__pb2.GetGroupRequest.FromString, + response_serializer=services_dot_group__manager__service__pb2.GroupWithAccess.SerializeToString, + ), 'GetGroups': grpc.unary_unary_rpc_method_handler( servicer.GetGroups, request_deserializer=services_dot_group__manager__service__pb2.GetGroupsRequest.FromString, response_serializer=services_dot_group__manager__service__pb2.GetGroupsResponse.SerializeToString, ), + 'GetGroupsWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetGroupsWithAccess, + request_deserializer=services_dot_group__manager__service__pb2.GetGroupsRequest.FromString, + response_serializer=services_dot_group__manager__service__pb2.GetGroupsWithAccessResponse.SerializeToString, + ), 'GetAllGroupsUserBelongs': grpc.unary_unary_rpc_method_handler( servicer.GetAllGroupsUserBelongs, request_deserializer=services_dot_group__manager__service__pb2.GetAllGroupsUserBelongsRequest.FromString, response_serializer=services_dot_group__manager__service__pb2.GetAllGroupsUserBelongsResponse.SerializeToString, ), + 'GetAllGroupsUserBelongsWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetAllGroupsUserBelongsWithAccess, + request_deserializer=services_dot_group__manager__service__pb2.GetAllGroupsUserBelongsRequest.FromString, + response_serializer=services_dot_group__manager__service__pb2.GetGroupsWithAccessResponse.SerializeToString, + ), 'AddUsersToGroup': grpc.unary_unary_rpc_method_handler( servicer.AddUsersToGroup, request_deserializer=services_dot_group__manager__service__pb2.AddUsersToGroupRequest.FromString, @@ -320,6 +418,60 @@ def UpdateGroup(request, metadata, _registered_method=True) + @staticmethod + def CreateGroupReconciled(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/CreateGroupReconciled', + services_dot_group__manager__service__pb2.CreateGroupRequest.SerializeToString, + services_dot_group__manager__service__pb2.GroupWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateGroupReconciled(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/UpdateGroupReconciled', + services_dot_group__manager__service__pb2.UpdateGroupRequest.SerializeToString, + services_dot_group__manager__service__pb2.GroupWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def DeleteGroup(request, target, @@ -374,6 +526,33 @@ def GetGroup(request, metadata, _registered_method=True) + @staticmethod + def GetGroupWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/GetGroupWithAccess', + services_dot_group__manager__service__pb2.GetGroupRequest.SerializeToString, + services_dot_group__manager__service__pb2.GroupWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetGroups(request, target, @@ -401,6 +580,33 @@ def GetGroups(request, metadata, _registered_method=True) + @staticmethod + def GetGroupsWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/GetGroupsWithAccess', + services_dot_group__manager__service__pb2.GetGroupsRequest.SerializeToString, + services_dot_group__manager__service__pb2.GetGroupsWithAccessResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetAllGroupsUserBelongs(request, target, @@ -428,6 +634,33 @@ def GetAllGroupsUserBelongs(request, metadata, _registered_method=True) + @staticmethod + def GetAllGroupsUserBelongsWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.iam.groupmanager.GroupManagerService/GetAllGroupsUserBelongsWithAccess', + services_dot_group__manager__service__pb2.GetAllGroupsUserBelongsRequest.SerializeToString, + services_dot_group__manager__service__pb2.GetGroupsWithAccessResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def AddUsersToGroup(request, target, diff --git a/airavata-python-sdk/airavata/services/group_resource_profile_service_pb2.py b/airavata-python-sdk/airavata/services/group_resource_profile_service_pb2.py new file mode 100644 index 00000000000..62fbebe0ce0 --- /dev/null +++ b/airavata-python-sdk/airavata/services/group_resource_profile_service_pb2.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/group_resource_profile_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/group_resource_profile_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.appcatalog.groupresourceprofile import group_resource_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_groupresourceprofile_dot_group__resource__profile__pb2 +from airavata.model.appcatalog.gatewaygroups import gateway_groups_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_gatewaygroups_dot_gateway__groups__pb2 +from airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-services/group_resource_profile_service.proto\x12$org.apache.airavata.api.groupprofile\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1aVorg/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile.proto\x1aGorg/apache/airavata/model/appcatalog/gatewaygroups/gateway_groups.proto\x1a/org/apache/airavata/model/commons/commons.proto\"\x94\x01\n!CreateGroupResourceProfileRequest\x12o\n\x16group_resource_profile\x18\x01 \x01(\x0b\x32O.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile\"C\n\x1eGetGroupResourceProfileRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\"\xd1\x01\n\x1eGroupResourceProfileWithAccess\x12o\n\x16group_resource_profile\x18\x01 \x01(\x0b\x32O.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile\x12>\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32..org.apache.airavata.model.commons.AccessFlags\"\xb7\x01\n!UpdateGroupResourceProfileRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\x12o\n\x16group_resource_profile\x18\x02 \x01(\x0b\x32O.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile\"F\n!RemoveGroupResourceProfileRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\"\x1d\n\x1bGetGroupResourceListRequest\"\x90\x01\n\x1cGetGroupResourceListResponse\x12p\n\x17group_resource_profiles\x18\x01 \x03(\x0b\x32O.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile\"\x80\x01\n&GetGroupResourceListWithAccessResponse\x12V\n\x08profiles\x18\x01 \x03(\x0b\x32\x44.org.apache.airavata.api.groupprofile.GroupResourceProfileWithAccess\"b\n GetGroupComputePreferenceRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\"`\n\x1eRemoveGroupComputePrefsRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\"C\n\x1eGetGroupComputePrefListRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\"\xa9\x01\n\x1fGetGroupComputePrefListResponse\x12\x85\x01\n\"group_compute_resource_preferences\x18\x01 \x03(\x0b\x32Y.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupComputeResourcePreference\"B\n$GetGroupComputeResourcePolicyRequest\x12\x1a\n\x12resource_policy_id\x18\x01 \x01(\t\"E\n\'RemoveGroupComputeResourcePolicyRequest\x12\x1a\n\x12resource_policy_id\x18\x01 \x01(\t\"M\n(GetGroupComputeResourcePolicyListRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\"\xa0\x01\n)GetGroupComputeResourcePolicyListResponse\x12s\n\x19\x63ompute_resource_policies\x18\x01 \x03(\x0b\x32P.org.apache.airavata.model.appcatalog.groupresourceprofile.ComputeResourcePolicy\"@\n\"GetBatchQueueResourcePolicyRequest\x12\x1a\n\x12resource_policy_id\x18\x01 \x01(\t\"H\n*RemoveGroupBatchQueueResourcePolicyRequest\x12\x1a\n\x12resource_policy_id\x18\x01 \x01(\t\"H\n#GetGroupBatchQueuePolicyListRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\"\xa2\x01\n$GetGroupBatchQueuePolicyListResponse\x12z\n\x1d\x62\x61tch_queue_resource_policies\x18\x01 \x03(\x0b\x32S.org.apache.airavata.model.appcatalog.groupresourceprofile.BatchQueueResourcePolicy\"\x19\n\x17GetGatewayGroupsRequest2\x9d!\n\x1bGroupResourceProfileService\x12\xee\x01\n\x1a\x43reateGroupResourceProfile\x12G.org.apache.airavata.api.groupprofile.CreateGroupResourceProfileRequest\x1aO.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile\"6\x82\xd3\xe4\x93\x02\x30\"\x16/api/v1/group-profiles:\x16group_resource_profile\x12\xec\x01\n\x17GetGroupResourceProfile\x12\x44.org.apache.airavata.api.groupprofile.GetGroupResourceProfileRequest\x1aO.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile\":\x82\xd3\xe4\x93\x02\x34\x12\x32/api/v1/group-profiles/{group_resource_profile_id}\x12\xf6\x01\n!GetGroupResourceProfileWithAccess\x12\x44.org.apache.airavata.api.groupprofile.GetGroupResourceProfileRequest\x1a\x44.org.apache.airavata.api.groupprofile.GroupResourceProfileWithAccess\"E\x82\xd3\xe4\x93\x02?\x12=/api/v1/group-profiles/{group_resource_profile_id}:withAccess\x12\xd1\x01\n\x1aUpdateGroupResourceProfile\x12G.org.apache.airavata.api.groupprofile.UpdateGroupResourceProfileRequest\x1a\x16.google.protobuf.Empty\"R\x82\xd3\xe4\x93\x02L\x1a\x32/api/v1/group-profiles/{group_resource_profile_id}:\x16group_resource_profile\x12\x94\x02\n$UpdateGroupResourceProfileReconciled\x12G.org.apache.airavata.api.groupprofile.UpdateGroupResourceProfileRequest\x1a\x44.org.apache.airavata.api.groupprofile.GroupResourceProfileWithAccess\"]\x82\xd3\xe4\x93\x02W\x1a=/api/v1/group-profiles/{group_resource_profile_id}:reconciled:\x16group_resource_profile\x12\xb9\x01\n\x1aRemoveGroupResourceProfile\x12G.org.apache.airavata.api.groupprofile.RemoveGroupResourceProfileRequest\x1a\x16.google.protobuf.Empty\":\x82\xd3\xe4\x93\x02\x34*2/api/v1/group-profiles/{group_resource_profile_id}\x12\xbd\x01\n\x14GetGroupResourceList\x12\x41.org.apache.airavata.api.groupprofile.GetGroupResourceListRequest\x1a\x42.org.apache.airavata.api.groupprofile.GetGroupResourceListResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/api/v1/group-profiles\x12\xdc\x01\n\x1eGetGroupResourceListWithAccess\x12\x41.org.apache.airavata.api.groupprofile.GetGroupResourceListRequest\x1aL.org.apache.airavata.api.groupprofile.GetGroupResourceListWithAccessResponse\")\x82\xd3\xe4\x93\x02#\x12!/api/v1/group-profiles:withAccess\x12\xa4\x02\n\x19GetGroupComputePreference\x12\x46.org.apache.airavata.api.groupprofile.GetGroupComputePreferenceRequest\x1aY.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupComputeResourcePreference\"d\x82\xd3\xe4\x93\x02^\x12\\/api/v1/group-profiles/{group_resource_profile_id}/compute-preferences/{compute_resource_id}\x12\xdd\x01\n\x17RemoveGroupComputePrefs\x12\x44.org.apache.airavata.api.groupprofile.RemoveGroupComputePrefsRequest\x1a\x16.google.protobuf.Empty\"d\x82\xd3\xe4\x93\x02^*\\/api/v1/group-profiles/{group_resource_profile_id}/compute-preferences/{compute_resource_id}\x12\xf6\x01\n\x17GetGroupComputePrefList\x12\x44.org.apache.airavata.api.groupprofile.GetGroupComputePrefListRequest\x1a\x45.org.apache.airavata.api.groupprofile.GetGroupComputePrefListResponse\"N\x82\xd3\xe4\x93\x02H\x12\x46/api/v1/group-profiles/{group_resource_profile_id}/compute-preferences\x12\xfa\x01\n\x1dGetGroupComputeResourcePolicy\x12J.org.apache.airavata.api.groupprofile.GetGroupComputeResourcePolicyRequest\x1aP.org.apache.airavata.model.appcatalog.groupresourceprofile.ComputeResourcePolicy\";\x82\xd3\xe4\x93\x02\x35\x12\x33/api/v1/group-compute-policies/{resource_policy_id}\x12\xc6\x01\n RemoveGroupComputeResourcePolicy\x12M.org.apache.airavata.api.groupprofile.RemoveGroupComputeResourcePolicyRequest\x1a\x16.google.protobuf.Empty\";\x82\xd3\xe4\x93\x02\x35*3/api/v1/group-compute-policies/{resource_policy_id}\x12\x91\x02\n!GetGroupComputeResourcePolicyList\x12N.org.apache.airavata.api.groupprofile.GetGroupComputeResourcePolicyListRequest\x1aO.org.apache.airavata.api.groupprofile.GetGroupComputeResourcePolicyListResponse\"K\x82\xd3\xe4\x93\x02\x45\x12\x43/api/v1/group-profiles/{group_resource_profile_id}/compute-policies\x12\xf7\x01\n\x1bGetBatchQueueResourcePolicy\x12H.org.apache.airavata.api.groupprofile.GetBatchQueueResourcePolicyRequest\x1aS.org.apache.airavata.model.appcatalog.groupresourceprofile.BatchQueueResourcePolicy\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/api/v1/batch-queue-policies/{resource_policy_id}\x12\xca\x01\n#RemoveGroupBatchQueueResourcePolicy\x12P.org.apache.airavata.api.groupprofile.RemoveGroupBatchQueueResourcePolicyRequest\x1a\x16.google.protobuf.Empty\"9\x82\xd3\xe4\x93\x02\x33*1/api/v1/batch-queue-policies/{resource_policy_id}\x12\x86\x02\n\x1cGetGroupBatchQueuePolicyList\x12I.org.apache.airavata.api.groupprofile.GetGroupBatchQueuePolicyListRequest\x1aJ.org.apache.airavata.api.groupprofile.GetGroupBatchQueuePolicyListResponse\"O\x82\xd3\xe4\x93\x02I\x12G/api/v1/group-profiles/{group_resource_profile_id}/batch-queue-policies\x12\xb4\x01\n\x10GetGatewayGroups\x12=.org.apache.airavata.api.groupprofile.GetGatewayGroupsRequest\x1a\x41.org.apache.airavata.model.appcatalog.gatewaygroups.GatewayGroups\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/api/v1/gateway-groupsB(\n$org.apache.airavata.api.groupprofileP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.group_resource_profile_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n$org.apache.airavata.api.groupprofileP\001' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['CreateGroupResourceProfile']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['CreateGroupResourceProfile']._serialized_options = b'\202\323\344\223\0020\"\026/api/v1/group-profiles:\026group_resource_profile' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupResourceProfile']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupResourceProfile']._serialized_options = b'\202\323\344\223\0024\0222/api/v1/group-profiles/{group_resource_profile_id}' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupResourceProfileWithAccess']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupResourceProfileWithAccess']._serialized_options = b'\202\323\344\223\002?\022=/api/v1/group-profiles/{group_resource_profile_id}:withAccess' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['UpdateGroupResourceProfile']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['UpdateGroupResourceProfile']._serialized_options = b'\202\323\344\223\002L\0322/api/v1/group-profiles/{group_resource_profile_id}:\026group_resource_profile' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['UpdateGroupResourceProfileReconciled']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['UpdateGroupResourceProfileReconciled']._serialized_options = b'\202\323\344\223\002W\032=/api/v1/group-profiles/{group_resource_profile_id}:reconciled:\026group_resource_profile' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupResourceProfile']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupResourceProfile']._serialized_options = b'\202\323\344\223\0024*2/api/v1/group-profiles/{group_resource_profile_id}' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupResourceList']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupResourceList']._serialized_options = b'\202\323\344\223\002\030\022\026/api/v1/group-profiles' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupResourceListWithAccess']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupResourceListWithAccess']._serialized_options = b'\202\323\344\223\002#\022!/api/v1/group-profiles:withAccess' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputePreference']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputePreference']._serialized_options = b'\202\323\344\223\002^\022\\/api/v1/group-profiles/{group_resource_profile_id}/compute-preferences/{compute_resource_id}' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupComputePrefs']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupComputePrefs']._serialized_options = b'\202\323\344\223\002^*\\/api/v1/group-profiles/{group_resource_profile_id}/compute-preferences/{compute_resource_id}' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputePrefList']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputePrefList']._serialized_options = b'\202\323\344\223\002H\022F/api/v1/group-profiles/{group_resource_profile_id}/compute-preferences' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputeResourcePolicy']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputeResourcePolicy']._serialized_options = b'\202\323\344\223\0025\0223/api/v1/group-compute-policies/{resource_policy_id}' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupComputeResourcePolicy']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupComputeResourcePolicy']._serialized_options = b'\202\323\344\223\0025*3/api/v1/group-compute-policies/{resource_policy_id}' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputeResourcePolicyList']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputeResourcePolicyList']._serialized_options = b'\202\323\344\223\002E\022C/api/v1/group-profiles/{group_resource_profile_id}/compute-policies' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetBatchQueueResourcePolicy']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetBatchQueueResourcePolicy']._serialized_options = b'\202\323\344\223\0023\0221/api/v1/batch-queue-policies/{resource_policy_id}' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupBatchQueueResourcePolicy']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupBatchQueueResourcePolicy']._serialized_options = b'\202\323\344\223\0023*1/api/v1/batch-queue-policies/{resource_policy_id}' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupBatchQueuePolicyList']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupBatchQueuePolicyList']._serialized_options = b'\202\323\344\223\002I\022G/api/v1/group-profiles/{group_resource_profile_id}/batch-queue-policies' + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGatewayGroups']._loaded_options = None + _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGatewayGroups']._serialized_options = b'\202\323\344\223\002\030\022\026/api/v1/gateway-groups' + _globals['_CREATEGROUPRESOURCEPROFILEREQUEST']._serialized_start=357 + _globals['_CREATEGROUPRESOURCEPROFILEREQUEST']._serialized_end=505 + _globals['_GETGROUPRESOURCEPROFILEREQUEST']._serialized_start=507 + _globals['_GETGROUPRESOURCEPROFILEREQUEST']._serialized_end=574 + _globals['_GROUPRESOURCEPROFILEWITHACCESS']._serialized_start=577 + _globals['_GROUPRESOURCEPROFILEWITHACCESS']._serialized_end=786 + _globals['_UPDATEGROUPRESOURCEPROFILEREQUEST']._serialized_start=789 + _globals['_UPDATEGROUPRESOURCEPROFILEREQUEST']._serialized_end=972 + _globals['_REMOVEGROUPRESOURCEPROFILEREQUEST']._serialized_start=974 + _globals['_REMOVEGROUPRESOURCEPROFILEREQUEST']._serialized_end=1044 + _globals['_GETGROUPRESOURCELISTREQUEST']._serialized_start=1046 + _globals['_GETGROUPRESOURCELISTREQUEST']._serialized_end=1075 + _globals['_GETGROUPRESOURCELISTRESPONSE']._serialized_start=1078 + _globals['_GETGROUPRESOURCELISTRESPONSE']._serialized_end=1222 + _globals['_GETGROUPRESOURCELISTWITHACCESSRESPONSE']._serialized_start=1225 + _globals['_GETGROUPRESOURCELISTWITHACCESSRESPONSE']._serialized_end=1353 + _globals['_GETGROUPCOMPUTEPREFERENCEREQUEST']._serialized_start=1355 + _globals['_GETGROUPCOMPUTEPREFERENCEREQUEST']._serialized_end=1453 + _globals['_REMOVEGROUPCOMPUTEPREFSREQUEST']._serialized_start=1455 + _globals['_REMOVEGROUPCOMPUTEPREFSREQUEST']._serialized_end=1551 + _globals['_GETGROUPCOMPUTEPREFLISTREQUEST']._serialized_start=1553 + _globals['_GETGROUPCOMPUTEPREFLISTREQUEST']._serialized_end=1620 + _globals['_GETGROUPCOMPUTEPREFLISTRESPONSE']._serialized_start=1623 + _globals['_GETGROUPCOMPUTEPREFLISTRESPONSE']._serialized_end=1792 + _globals['_GETGROUPCOMPUTERESOURCEPOLICYREQUEST']._serialized_start=1794 + _globals['_GETGROUPCOMPUTERESOURCEPOLICYREQUEST']._serialized_end=1860 + _globals['_REMOVEGROUPCOMPUTERESOURCEPOLICYREQUEST']._serialized_start=1862 + _globals['_REMOVEGROUPCOMPUTERESOURCEPOLICYREQUEST']._serialized_end=1931 + _globals['_GETGROUPCOMPUTERESOURCEPOLICYLISTREQUEST']._serialized_start=1933 + _globals['_GETGROUPCOMPUTERESOURCEPOLICYLISTREQUEST']._serialized_end=2010 + _globals['_GETGROUPCOMPUTERESOURCEPOLICYLISTRESPONSE']._serialized_start=2013 + _globals['_GETGROUPCOMPUTERESOURCEPOLICYLISTRESPONSE']._serialized_end=2173 + _globals['_GETBATCHQUEUERESOURCEPOLICYREQUEST']._serialized_start=2175 + _globals['_GETBATCHQUEUERESOURCEPOLICYREQUEST']._serialized_end=2239 + _globals['_REMOVEGROUPBATCHQUEUERESOURCEPOLICYREQUEST']._serialized_start=2241 + _globals['_REMOVEGROUPBATCHQUEUERESOURCEPOLICYREQUEST']._serialized_end=2313 + _globals['_GETGROUPBATCHQUEUEPOLICYLISTREQUEST']._serialized_start=2315 + _globals['_GETGROUPBATCHQUEUEPOLICYLISTREQUEST']._serialized_end=2387 + _globals['_GETGROUPBATCHQUEUEPOLICYLISTRESPONSE']._serialized_start=2390 + _globals['_GETGROUPBATCHQUEUEPOLICYLISTRESPONSE']._serialized_end=2552 + _globals['_GETGATEWAYGROUPSREQUEST']._serialized_start=2554 + _globals['_GETGATEWAYGROUPSREQUEST']._serialized_end=2579 + _globals['_GROUPRESOURCEPROFILESERVICE']._serialized_start=2582 + _globals['_GROUPRESOURCEPROFILESERVICE']._serialized_end=6835 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/group_resource_profile_service_pb2.pyi b/airavata-python-sdk/airavata/services/group_resource_profile_service_pb2.pyi similarity index 85% rename from airavata-python-sdk/airavata_sdk/generated/services/group_resource_profile_service_pb2.pyi rename to airavata-python-sdk/airavata/services/group_resource_profile_service_pb2.pyi index b7b52546343..7b429984e0d 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/group_resource_profile_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/group_resource_profile_service_pb2.pyi @@ -1,7 +1,8 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.appcatalog.groupresourceprofile import group_resource_profile_pb2 as _group_resource_profile_pb2 -from org.apache.airavata.model.appcatalog.gatewaygroups import gateway_groups_pb2 as _gateway_groups_pb2 +from airavata.model.appcatalog.groupresourceprofile import group_resource_profile_pb2 as _group_resource_profile_pb2 +from airavata.model.appcatalog.gatewaygroups import gateway_groups_pb2 as _gateway_groups_pb2 +from airavata.model.commons import commons_pb2 as _commons_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -22,6 +23,14 @@ class GetGroupResourceProfileRequest(_message.Message): group_resource_profile_id: str def __init__(self, group_resource_profile_id: _Optional[str] = ...) -> None: ... +class GroupResourceProfileWithAccess(_message.Message): + __slots__ = ("group_resource_profile", "access") + GROUP_RESOURCE_PROFILE_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + group_resource_profile: _group_resource_profile_pb2.GroupResourceProfile + access: _commons_pb2.AccessFlags + def __init__(self, group_resource_profile: _Optional[_Union[_group_resource_profile_pb2.GroupResourceProfile, _Mapping]] = ..., access: _Optional[_Union[_commons_pb2.AccessFlags, _Mapping]] = ...) -> None: ... + class UpdateGroupResourceProfileRequest(_message.Message): __slots__ = ("group_resource_profile_id", "group_resource_profile") GROUP_RESOURCE_PROFILE_ID_FIELD_NUMBER: _ClassVar[int] @@ -46,6 +55,12 @@ class GetGroupResourceListResponse(_message.Message): group_resource_profiles: _containers.RepeatedCompositeFieldContainer[_group_resource_profile_pb2.GroupResourceProfile] def __init__(self, group_resource_profiles: _Optional[_Iterable[_Union[_group_resource_profile_pb2.GroupResourceProfile, _Mapping]]] = ...) -> None: ... +class GetGroupResourceListWithAccessResponse(_message.Message): + __slots__ = ("profiles",) + PROFILES_FIELD_NUMBER: _ClassVar[int] + profiles: _containers.RepeatedCompositeFieldContainer[GroupResourceProfileWithAccess] + def __init__(self, profiles: _Optional[_Iterable[_Union[GroupResourceProfileWithAccess, _Mapping]]] = ...) -> None: ... + class GetGroupComputePreferenceRequest(_message.Message): __slots__ = ("group_resource_profile_id", "compute_resource_id") GROUP_RESOURCE_PROFILE_ID_FIELD_NUMBER: _ClassVar[int] diff --git a/airavata-python-sdk/airavata_sdk/generated/services/group_resource_profile_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/group_resource_profile_service_pb2_grpc.py similarity index 82% rename from airavata-python-sdk/airavata_sdk/generated/services/group_resource_profile_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/group_resource_profile_service_pb2_grpc.py index a47d6bc1fc2..3aacfa215fb 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/group_resource_profile_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/group_resource_profile_service_pb2_grpc.py @@ -4,9 +4,9 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.appcatalog.gatewaygroups import gateway_groups_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_gatewaygroups_dot_gateway__groups__pb2 -from org.apache.airavata.model.appcatalog.groupresourceprofile import group_resource_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_groupresourceprofile_dot_group__resource__profile__pb2 -from services import group_resource_profile_service_pb2 as services_dot_group__resource__profile__service__pb2 +from airavata.model.appcatalog.gatewaygroups import gateway_groups_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_gatewaygroups_dot_gateway__groups__pb2 +from airavata.model.appcatalog.groupresourceprofile import group_resource_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_groupresourceprofile_dot_group__resource__profile__pb2 +from airavata.services import group_resource_profile_service_pb2 as services_dot_group__resource__profile__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ @@ -49,11 +49,21 @@ def __init__(self, channel): request_serializer=services_dot_group__resource__profile__service__pb2.GetGroupResourceProfileRequest.SerializeToString, response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_groupresourceprofile_dot_group__resource__profile__pb2.GroupResourceProfile.FromString, _registered_method=True) + self.GetGroupResourceProfileWithAccess = channel.unary_unary( + '/org.apache.airavata.api.groupprofile.GroupResourceProfileService/GetGroupResourceProfileWithAccess', + request_serializer=services_dot_group__resource__profile__service__pb2.GetGroupResourceProfileRequest.SerializeToString, + response_deserializer=services_dot_group__resource__profile__service__pb2.GroupResourceProfileWithAccess.FromString, + _registered_method=True) self.UpdateGroupResourceProfile = channel.unary_unary( '/org.apache.airavata.api.groupprofile.GroupResourceProfileService/UpdateGroupResourceProfile', request_serializer=services_dot_group__resource__profile__service__pb2.UpdateGroupResourceProfileRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) + self.UpdateGroupResourceProfileReconciled = channel.unary_unary( + '/org.apache.airavata.api.groupprofile.GroupResourceProfileService/UpdateGroupResourceProfileReconciled', + request_serializer=services_dot_group__resource__profile__service__pb2.UpdateGroupResourceProfileRequest.SerializeToString, + response_deserializer=services_dot_group__resource__profile__service__pb2.GroupResourceProfileWithAccess.FromString, + _registered_method=True) self.RemoveGroupResourceProfile = channel.unary_unary( '/org.apache.airavata.api.groupprofile.GroupResourceProfileService/RemoveGroupResourceProfile', request_serializer=services_dot_group__resource__profile__service__pb2.RemoveGroupResourceProfileRequest.SerializeToString, @@ -64,6 +74,11 @@ def __init__(self, channel): request_serializer=services_dot_group__resource__profile__service__pb2.GetGroupResourceListRequest.SerializeToString, response_deserializer=services_dot_group__resource__profile__service__pb2.GetGroupResourceListResponse.FromString, _registered_method=True) + self.GetGroupResourceListWithAccess = channel.unary_unary( + '/org.apache.airavata.api.groupprofile.GroupResourceProfileService/GetGroupResourceListWithAccess', + request_serializer=services_dot_group__resource__profile__service__pb2.GetGroupResourceListRequest.SerializeToString, + response_deserializer=services_dot_group__resource__profile__service__pb2.GetGroupResourceListWithAccessResponse.FromString, + _registered_method=True) self.GetGroupComputePreference = channel.unary_unary( '/org.apache.airavata.api.groupprofile.GroupResourceProfileService/GetGroupComputePreference', request_serializer=services_dot_group__resource__profile__service__pb2.GetGroupComputePreferenceRequest.SerializeToString, @@ -135,12 +150,30 @@ def GetGroupResourceProfile(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetGroupResourceProfileWithAccess(self, request, context): + """Additive: GetGroupResourceProfile plus the caller's server-computed access + flags, so a client does not recompute access from a separate sharing round-trip. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def UpdateGroupResourceProfile(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def UpdateGroupResourceProfileReconciled(self, request, context): + """Reconcile-then-update for thin clients: removes the child compute preferences / + resource policies / batch-queue policies absent from the incoming profile, applies + the update, and returns the refreshed profile with the caller's access flags — + replacing the SDK helper's client-side reconcile loop. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def RemoveGroupResourceProfile(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -153,6 +186,14 @@ def GetGroupResourceList(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetGroupResourceListWithAccess(self, request, context): + """Additive: GetGroupResourceList plus each profile's server-computed access flags + for the caller, so a client does not recompute access from a separate sharing round-trip. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def GetGroupComputePreference(self, request, context): """--- Group Compute Preferences --- @@ -234,11 +275,21 @@ def add_GroupResourceProfileServiceServicer_to_server(servicer, server): request_deserializer=services_dot_group__resource__profile__service__pb2.GetGroupResourceProfileRequest.FromString, response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_groupresourceprofile_dot_group__resource__profile__pb2.GroupResourceProfile.SerializeToString, ), + 'GetGroupResourceProfileWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetGroupResourceProfileWithAccess, + request_deserializer=services_dot_group__resource__profile__service__pb2.GetGroupResourceProfileRequest.FromString, + response_serializer=services_dot_group__resource__profile__service__pb2.GroupResourceProfileWithAccess.SerializeToString, + ), 'UpdateGroupResourceProfile': grpc.unary_unary_rpc_method_handler( servicer.UpdateGroupResourceProfile, request_deserializer=services_dot_group__resource__profile__service__pb2.UpdateGroupResourceProfileRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), + 'UpdateGroupResourceProfileReconciled': grpc.unary_unary_rpc_method_handler( + servicer.UpdateGroupResourceProfileReconciled, + request_deserializer=services_dot_group__resource__profile__service__pb2.UpdateGroupResourceProfileRequest.FromString, + response_serializer=services_dot_group__resource__profile__service__pb2.GroupResourceProfileWithAccess.SerializeToString, + ), 'RemoveGroupResourceProfile': grpc.unary_unary_rpc_method_handler( servicer.RemoveGroupResourceProfile, request_deserializer=services_dot_group__resource__profile__service__pb2.RemoveGroupResourceProfileRequest.FromString, @@ -249,6 +300,11 @@ def add_GroupResourceProfileServiceServicer_to_server(servicer, server): request_deserializer=services_dot_group__resource__profile__service__pb2.GetGroupResourceListRequest.FromString, response_serializer=services_dot_group__resource__profile__service__pb2.GetGroupResourceListResponse.SerializeToString, ), + 'GetGroupResourceListWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetGroupResourceListWithAccess, + request_deserializer=services_dot_group__resource__profile__service__pb2.GetGroupResourceListRequest.FromString, + response_serializer=services_dot_group__resource__profile__service__pb2.GetGroupResourceListWithAccessResponse.SerializeToString, + ), 'GetGroupComputePreference': grpc.unary_unary_rpc_method_handler( servicer.GetGroupComputePreference, request_deserializer=services_dot_group__resource__profile__service__pb2.GetGroupComputePreferenceRequest.FromString, @@ -366,6 +422,33 @@ def GetGroupResourceProfile(request, metadata, _registered_method=True) + @staticmethod + def GetGroupResourceProfileWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.groupprofile.GroupResourceProfileService/GetGroupResourceProfileWithAccess', + services_dot_group__resource__profile__service__pb2.GetGroupResourceProfileRequest.SerializeToString, + services_dot_group__resource__profile__service__pb2.GroupResourceProfileWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def UpdateGroupResourceProfile(request, target, @@ -393,6 +476,33 @@ def UpdateGroupResourceProfile(request, metadata, _registered_method=True) + @staticmethod + def UpdateGroupResourceProfileReconciled(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.groupprofile.GroupResourceProfileService/UpdateGroupResourceProfileReconciled', + services_dot_group__resource__profile__service__pb2.UpdateGroupResourceProfileRequest.SerializeToString, + services_dot_group__resource__profile__service__pb2.GroupResourceProfileWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def RemoveGroupResourceProfile(request, target, @@ -447,6 +557,33 @@ def GetGroupResourceList(request, metadata, _registered_method=True) + @staticmethod + def GetGroupResourceListWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.groupprofile.GroupResourceProfileService/GetGroupResourceListWithAccess', + services_dot_group__resource__profile__service__pb2.GetGroupResourceListRequest.SerializeToString, + services_dot_group__resource__profile__service__pb2.GetGroupResourceListWithAccessResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def GetGroupComputePreference(request, target, diff --git a/airavata-python-sdk/airavata_sdk/generated/services/iam_admin_service_pb2.py b/airavata-python-sdk/airavata/services/iam_admin_service_pb2.py similarity index 97% rename from airavata-python-sdk/airavata_sdk/generated/services/iam_admin_service_pb2.py rename to airavata-python-sdk/airavata/services/iam_admin_service_pb2.py index d219eea6b94..1a6667258b5 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/iam_admin_service_pb2.py +++ b/airavata-python-sdk/airavata/services/iam_admin_service_pb2.py @@ -24,8 +24,8 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.user import user_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_user_dot_user__profile__pb2 -from org.apache.airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 +from airavata.model.user import user_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_user_dot_user__profile__pb2 +from airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n services/iam_admin_service.proto\x12\x1borg.apache.airavata.api.iam\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x31org/apache/airavata/model/user/user_profile.proto\x1a\x33org/apache/airavata/model/workspace/workspace.proto\"T\n\x13SetUpGatewayRequest\x12=\n\x07gateway\x18\x01 \x01(\x0b\x32,.org.apache.airavata.model.workspace.Gateway\".\n\x1aIsUsernameAvailableRequest\x12\x10\n\x08username\x18\x01 \x01(\t\"0\n\x1bIsUsernameAvailableResponse\x12\x11\n\tavailable\x18\x01 \x01(\x08\"{\n\x13RegisterUserRequest\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x15\n\remail_address\x18\x02 \x01(\t\x12\x12\n\nfirst_name\x18\x03 \x01(\t\x12\x11\n\tlast_name\x18\x04 \x01(\t\x12\x14\n\x0cnew_password\x18\x05 \x01(\t\"%\n\x11\x45nableUserRequest\x12\x10\n\x08username\x18\x01 \x01(\t\"(\n\x14IsUserEnabledRequest\x12\x10\n\x08username\x18\x01 \x01(\t\"(\n\x15IsUserEnabledResponse\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\"&\n\x12IsUserExistRequest\x12\x10\n\x08username\x18\x01 \x01(\t\"%\n\x13IsUserExistResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"%\n\x11GetIamUserRequest\x12\x10\n\x08username\x18\x01 \x01(\t\"C\n\x12GetIamUsersRequest\x12\x0e\n\x06offset\x18\x01 \x01(\x05\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x0e\n\x06search\x18\x03 \x01(\t\"Q\n\x13GetIamUsersResponse\x12:\n\x05users\x18\x01 \x03(\x0b\x32+.org.apache.airavata.model.user.UserProfile\"B\n\x18ResetUserPasswordRequest\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x14\n\x0cnew_password\x18\x02 \x01(\t\"2\n\x10\x46indUsersRequest\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\"O\n\x11\x46indUsersResponse\x12:\n\x05users\x18\x01 \x03(\x0b\x32+.org.apache.airavata.model.user.UserProfile\"`\n\x1bUpdateIamUserProfileRequest\x12\x41\n\x0cuser_details\x18\x01 \x01(\x0b\x32+.org.apache.airavata.model.user.UserProfile\"%\n\x11\x44\x65leteUserRequest\x12\x10\n\x08username\x18\x01 \x01(\t\";\n\x14\x41\x64\x64RoleToUserRequest\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x11\n\trole_name\x18\x02 \x01(\t\"@\n\x19RemoveRoleFromUserRequest\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x11\n\trole_name\x18\x02 \x01(\t\",\n\x17GetUsersWithRoleRequest\x12\x11\n\trole_name\x18\x01 \x01(\t\"V\n\x18GetUsersWithRoleResponse\x12:\n\x05users\x18\x01 \x03(\x0b\x32+.org.apache.airavata.model.user.UserProfile2\xe7\x11\n\x0fIamAdminService\x12\x94\x01\n\x0cSetUpGateway\x12\x30.org.apache.airavata.api.iam.SetUpGatewayRequest\x1a,.org.apache.airavata.model.workspace.Gateway\"$\x82\xd3\xe4\x93\x02\x1e\"\x13/api/v1/iam/gateway:\x07gateway\x12\xb8\x01\n\x13IsUsernameAvailable\x12\x37.org.apache.airavata.api.iam.IsUsernameAvailableRequest\x1a\x38.org.apache.airavata.api.iam.IsUsernameAvailableResponse\".\x82\xd3\xe4\x93\x02(\x12&/api/v1/iam/users/{username}:available\x12v\n\x0cRegisterUser\x12\x30.org.apache.airavata.api.iam.RegisterUserRequest\x1a\x16.google.protobuf.Empty\"\x1c\x82\xd3\xe4\x93\x02\x16\"\x11/api/v1/iam/users:\x01*\x12\x81\x01\n\nEnableUser\x12..org.apache.airavata.api.iam.EnableUserRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%\"#/api/v1/iam/users/{username}:enable\x12\xa4\x01\n\rIsUserEnabled\x12\x31.org.apache.airavata.api.iam.IsUserEnabledRequest\x1a\x32.org.apache.airavata.api.iam.IsUserEnabledResponse\",\x82\xd3\xe4\x93\x02&\x12$/api/v1/iam/users/{username}:enabled\x12\x9d\x01\n\x0bIsUserExist\x12/.org.apache.airavata.api.iam.IsUserExistRequest\x1a\x30.org.apache.airavata.api.iam.IsUserExistResponse\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/iam/users/{username}:exists\x12\x8c\x01\n\x07GetUser\x12..org.apache.airavata.api.iam.GetIamUserRequest\x1a+.org.apache.airavata.model.user.UserProfile\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/api/v1/iam/users/{username}\x12\x88\x01\n\x08GetUsers\x12/.org.apache.airavata.api.iam.GetIamUsersRequest\x1a\x30.org.apache.airavata.api.iam.GetIamUsersResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/api/v1/iam/users\x12\x99\x01\n\x11ResetUserPassword\x12\x35.org.apache.airavata.api.iam.ResetUserPasswordRequest\x1a\x16.google.protobuf.Empty\"5\x82\xd3\xe4\x93\x02/\"*/api/v1/iam/users/{username}:resetPassword:\x01*\x12\x8a\x01\n\tFindUsers\x12-.org.apache.airavata.api.iam.FindUsersRequest\x1a..org.apache.airavata.api.iam.FindUsersResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/api/v1/iam/users:find\x12\xa5\x01\n\x11UpdateUserProfile\x12\x38.org.apache.airavata.api.iam.UpdateIamUserProfileRequest\x1a\x16.google.protobuf.Empty\">\x82\xd3\xe4\x93\x02\x38\x1a(/api/v1/iam/users/{user_details.user_id}:\x0cuser_details\x12z\n\nDeleteUser\x12..org.apache.airavata.api.iam.DeleteUserRequest\x1a\x16.google.protobuf.Empty\"$\x82\xd3\xe4\x93\x02\x1e*\x1c/api/v1/iam/users/{username}\x12\x89\x01\n\rAddRoleToUser\x12\x31.org.apache.airavata.api.iam.AddRoleToUserRequest\x1a\x16.google.protobuf.Empty\"-\x82\xd3\xe4\x93\x02\'\"\"/api/v1/iam/users/{username}/roles:\x01*\x12\x9c\x01\n\x12RemoveRoleFromUser\x12\x36.org.apache.airavata.api.iam.RemoveRoleFromUserRequest\x1a\x16.google.protobuf.Empty\"6\x82\xd3\xe4\x93\x02\x30*./api/v1/iam/users/{username}/roles/{role_name}\x12\xac\x01\n\x10GetUsersWithRole\x12\x34.org.apache.airavata.api.iam.GetUsersWithRoleRequest\x1a\x35.org.apache.airavata.api.iam.GetUsersWithRoleResponse\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/iam/roles/{role_name}/usersB\x1f\n\x1borg.apache.airavata.api.iamP\x01\x62\x06proto3') diff --git a/airavata-python-sdk/airavata_sdk/generated/services/iam_admin_service_pb2.pyi b/airavata-python-sdk/airavata/services/iam_admin_service_pb2.pyi similarity index 97% rename from airavata-python-sdk/airavata_sdk/generated/services/iam_admin_service_pb2.pyi rename to airavata-python-sdk/airavata/services/iam_admin_service_pb2.pyi index 0a05f07f7f5..f3b94e6ec10 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/iam_admin_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/iam_admin_service_pb2.pyi @@ -1,7 +1,7 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.user import user_profile_pb2 as _user_profile_pb2 -from org.apache.airavata.model.workspace import workspace_pb2 as _workspace_pb2 +from airavata.model.user import user_profile_pb2 as _user_profile_pb2 +from airavata.model.workspace import workspace_pb2 as _workspace_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message diff --git a/airavata-python-sdk/airavata_sdk/generated/services/iam_admin_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/iam_admin_service_pb2_grpc.py similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/services/iam_admin_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/iam_admin_service_pb2_grpc.py index 39341a5ee18..aaf3ce61b99 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/iam_admin_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/iam_admin_service_pb2_grpc.py @@ -4,9 +4,9 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.user import user_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_user_dot_user__profile__pb2 -from org.apache.airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 -from services import iam_admin_service_pb2 as services_dot_iam__admin__service__pb2 +from airavata.model.user import user_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_user_dot_user__profile__pb2 +from airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 +from airavata.services import iam_admin_service_pb2 as services_dot_iam__admin__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ diff --git a/airavata-python-sdk/airavata/services/notification_service_pb2.py b/airavata-python-sdk/airavata/services/notification_service_pb2.py new file mode 100644 index 00000000000..87c512c894b --- /dev/null +++ b/airavata-python-sdk/airavata/services/notification_service_pb2.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/notification_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/notification_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 +from airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#services/notification_service.proto\x12$org.apache.airavata.api.notification\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x33org/apache/airavata/model/workspace/workspace.proto\x1a/org/apache/airavata/model/commons/commons.proto\"x\n\x19\x43reateNotificationRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12G\n\x0cnotification\x18\x02 \x01(\x0b\x32\x31.org.apache.airavata.model.workspace.Notification\"5\n\x1a\x43reateNotificationResponse\x12\x17\n\x0fnotification_id\x18\x01 \x01(\t\"}\n\x19UpdateNotificationRequest\x12\x17\n\x0fnotification_id\x18\x01 \x01(\t\x12G\n\x0cnotification\x18\x02 \x01(\x0b\x32\x31.org.apache.airavata.model.workspace.Notification\"H\n\x19\x44\x65leteNotificationRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x17\n\x0fnotification_id\x18\x02 \x01(\t\"E\n\x16GetNotificationRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x17\n\x0fnotification_id\x18\x02 \x01(\t\"0\n\x1aGetAllNotificationsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"g\n\x1bGetAllNotificationsResponse\x12H\n\rnotifications\x18\x01 \x03(\x0b\x32\x31.org.apache.airavata.model.workspace.Notification\"\xa1\x01\n\x16NotificationWithAccess\x12G\n\x0cnotification\x18\x01 \x01(\x0b\x32\x31.org.apache.airavata.model.workspace.Notification\x12>\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32..org.apache.airavata.model.commons.AccessFlags\"|\n%GetAllNotificationsWithAccessResponse\x12S\n\rnotifications\x18\x01 \x03(\x0b\x32<.org.apache.airavata.api.notification.NotificationWithAccess2\xbd\x0b\n\x13NotificationService\x12\xc4\x01\n\x12\x43reateNotification\x12?.org.apache.airavata.api.notification.CreateNotificationRequest\x1a@.org.apache.airavata.api.notification.CreateNotificationResponse\"+\x82\xd3\xe4\x93\x02%\"\x15/api/v1/notifications:\x0cnotification\x12\xac\x01\n\x12UpdateNotification\x12?.org.apache.airavata.api.notification.UpdateNotificationRequest\x1a\x16.google.protobuf.Empty\"=\x82\xd3\xe4\x93\x02\x37\x1a\'/api/v1/notifications/{notification_id}:\x0cnotification\x12\xb4\x01\n\x12\x44\x65leteNotification\x12?.org.apache.airavata.api.notification.DeleteNotificationRequest\x1a\x16.google.protobuf.Empty\"E\x82\xd3\xe4\x93\x02?*=/api/v1/gateways/{gateway_id}/notifications/{notification_id}\x12\xc9\x01\n\x0fGetNotification\x12<.org.apache.airavata.api.notification.GetNotificationRequest\x1a\x31.org.apache.airavata.model.workspace.Notification\"E\x82\xd3\xe4\x93\x02?\x12=/api/v1/gateways/{gateway_id}/notifications/{notification_id}\x12\xcf\x01\n\x13GetAllNotifications\x12@.org.apache.airavata.api.notification.GetAllNotificationsRequest\x1a\x41.org.apache.airavata.api.notification.GetAllNotificationsResponse\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/gateways/{gateway_id}/notifications\x12\xe9\x01\n\x19GetNotificationWithAccess\x12<.org.apache.airavata.api.notification.GetNotificationRequest\x1a<.org.apache.airavata.api.notification.NotificationWithAccess\"P\x82\xd3\xe4\x93\x02J\x12H/api/v1/gateways/{gateway_id}/notifications/{notification_id}:withAccess\x12\xee\x01\n\x1dGetAllNotificationsWithAccess\x12@.org.apache.airavata.api.notification.GetAllNotificationsRequest\x1aK.org.apache.airavata.api.notification.GetAllNotificationsWithAccessResponse\">\x82\xd3\xe4\x93\x02\x38\x12\x36/api/v1/gateways/{gateway_id}/notifications:withAccessB(\n$org.apache.airavata.api.notificationP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.notification_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n$org.apache.airavata.api.notificationP\001' + _globals['_NOTIFICATIONSERVICE'].methods_by_name['CreateNotification']._loaded_options = None + _globals['_NOTIFICATIONSERVICE'].methods_by_name['CreateNotification']._serialized_options = b'\202\323\344\223\002%\"\025/api/v1/notifications:\014notification' + _globals['_NOTIFICATIONSERVICE'].methods_by_name['UpdateNotification']._loaded_options = None + _globals['_NOTIFICATIONSERVICE'].methods_by_name['UpdateNotification']._serialized_options = b'\202\323\344\223\0027\032\'/api/v1/notifications/{notification_id}:\014notification' + _globals['_NOTIFICATIONSERVICE'].methods_by_name['DeleteNotification']._loaded_options = None + _globals['_NOTIFICATIONSERVICE'].methods_by_name['DeleteNotification']._serialized_options = b'\202\323\344\223\002?*=/api/v1/gateways/{gateway_id}/notifications/{notification_id}' + _globals['_NOTIFICATIONSERVICE'].methods_by_name['GetNotification']._loaded_options = None + _globals['_NOTIFICATIONSERVICE'].methods_by_name['GetNotification']._serialized_options = b'\202\323\344\223\002?\022=/api/v1/gateways/{gateway_id}/notifications/{notification_id}' + _globals['_NOTIFICATIONSERVICE'].methods_by_name['GetAllNotifications']._loaded_options = None + _globals['_NOTIFICATIONSERVICE'].methods_by_name['GetAllNotifications']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/gateways/{gateway_id}/notifications' + _globals['_NOTIFICATIONSERVICE'].methods_by_name['GetNotificationWithAccess']._loaded_options = None + _globals['_NOTIFICATIONSERVICE'].methods_by_name['GetNotificationWithAccess']._serialized_options = b'\202\323\344\223\002J\022H/api/v1/gateways/{gateway_id}/notifications/{notification_id}:withAccess' + _globals['_NOTIFICATIONSERVICE'].methods_by_name['GetAllNotificationsWithAccess']._loaded_options = None + _globals['_NOTIFICATIONSERVICE'].methods_by_name['GetAllNotificationsWithAccess']._serialized_options = b'\202\323\344\223\0028\0226/api/v1/gateways/{gateway_id}/notifications:withAccess' + _globals['_CREATENOTIFICATIONREQUEST']._serialized_start=238 + _globals['_CREATENOTIFICATIONREQUEST']._serialized_end=358 + _globals['_CREATENOTIFICATIONRESPONSE']._serialized_start=360 + _globals['_CREATENOTIFICATIONRESPONSE']._serialized_end=413 + _globals['_UPDATENOTIFICATIONREQUEST']._serialized_start=415 + _globals['_UPDATENOTIFICATIONREQUEST']._serialized_end=540 + _globals['_DELETENOTIFICATIONREQUEST']._serialized_start=542 + _globals['_DELETENOTIFICATIONREQUEST']._serialized_end=614 + _globals['_GETNOTIFICATIONREQUEST']._serialized_start=616 + _globals['_GETNOTIFICATIONREQUEST']._serialized_end=685 + _globals['_GETALLNOTIFICATIONSREQUEST']._serialized_start=687 + _globals['_GETALLNOTIFICATIONSREQUEST']._serialized_end=735 + _globals['_GETALLNOTIFICATIONSRESPONSE']._serialized_start=737 + _globals['_GETALLNOTIFICATIONSRESPONSE']._serialized_end=840 + _globals['_NOTIFICATIONWITHACCESS']._serialized_start=843 + _globals['_NOTIFICATIONWITHACCESS']._serialized_end=1004 + _globals['_GETALLNOTIFICATIONSWITHACCESSRESPONSE']._serialized_start=1006 + _globals['_GETALLNOTIFICATIONSWITHACCESSRESPONSE']._serialized_end=1130 + _globals['_NOTIFICATIONSERVICE']._serialized_start=1133 + _globals['_NOTIFICATIONSERVICE']._serialized_end=2602 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/notification_service_pb2.pyi b/airavata-python-sdk/airavata/services/notification_service_pb2.pyi similarity index 75% rename from airavata-python-sdk/airavata_sdk/generated/services/notification_service_pb2.pyi rename to airavata-python-sdk/airavata/services/notification_service_pb2.pyi index 1b1bac11422..acf3577d8cc 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/notification_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/notification_service_pb2.pyi @@ -1,6 +1,7 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.workspace import workspace_pb2 as _workspace_pb2 +from airavata.model.workspace import workspace_pb2 as _workspace_pb2 +from airavata.model.commons import commons_pb2 as _commons_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -58,3 +59,17 @@ class GetAllNotificationsResponse(_message.Message): NOTIFICATIONS_FIELD_NUMBER: _ClassVar[int] notifications: _containers.RepeatedCompositeFieldContainer[_workspace_pb2.Notification] def __init__(self, notifications: _Optional[_Iterable[_Union[_workspace_pb2.Notification, _Mapping]]] = ...) -> None: ... + +class NotificationWithAccess(_message.Message): + __slots__ = ("notification", "access") + NOTIFICATION_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + notification: _workspace_pb2.Notification + access: _commons_pb2.AccessFlags + def __init__(self, notification: _Optional[_Union[_workspace_pb2.Notification, _Mapping]] = ..., access: _Optional[_Union[_commons_pb2.AccessFlags, _Mapping]] = ...) -> None: ... + +class GetAllNotificationsWithAccessResponse(_message.Message): + __slots__ = ("notifications",) + NOTIFICATIONS_FIELD_NUMBER: _ClassVar[int] + notifications: _containers.RepeatedCompositeFieldContainer[NotificationWithAccess] + def __init__(self, notifications: _Optional[_Iterable[_Union[NotificationWithAccess, _Mapping]]] = ...) -> None: ... diff --git a/airavata-python-sdk/airavata_sdk/generated/services/notification_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/notification_service_pb2_grpc.py similarity index 71% rename from airavata-python-sdk/airavata_sdk/generated/services/notification_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/notification_service_pb2_grpc.py index f3cc916899b..4c497480e5b 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/notification_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/notification_service_pb2_grpc.py @@ -4,8 +4,8 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 -from services import notification_service_pb2 as services_dot_notification__service__pb2 +from airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 +from airavata.services import notification_service_pb2 as services_dot_notification__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ @@ -62,6 +62,16 @@ def __init__(self, channel): request_serializer=services_dot_notification__service__pb2.GetAllNotificationsRequest.SerializeToString, response_deserializer=services_dot_notification__service__pb2.GetAllNotificationsResponse.FromString, _registered_method=True) + self.GetNotificationWithAccess = channel.unary_unary( + '/org.apache.airavata.api.notification.NotificationService/GetNotificationWithAccess', + request_serializer=services_dot_notification__service__pb2.GetNotificationRequest.SerializeToString, + response_deserializer=services_dot_notification__service__pb2.NotificationWithAccess.FromString, + _registered_method=True) + self.GetAllNotificationsWithAccess = channel.unary_unary( + '/org.apache.airavata.api.notification.NotificationService/GetAllNotificationsWithAccess', + request_serializer=services_dot_notification__service__pb2.GetAllNotificationsRequest.SerializeToString, + response_deserializer=services_dot_notification__service__pb2.GetAllNotificationsWithAccessResponse.FromString, + _registered_method=True) class NotificationServiceServicer(object): @@ -98,6 +108,24 @@ def GetAllNotifications(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetNotificationWithAccess(self, request, context): + """Additive: GetNotification plus the caller's server-computed access flags, so a + client does not recompute access from a separate round-trip. Notifications are + gateway-level broadcast entities with no owner/sharing, so is_owner is always + false and user_has_write_access reflects the caller's gateway-admin role. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetAllNotificationsWithAccess(self, request, context): + """Additive: GetAllNotifications plus each notification's caller-scoped access flags, + so a client does not recompute access per notification from separate round-trips. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_NotificationServiceServicer_to_server(servicer, server): rpc_method_handlers = { @@ -126,6 +154,16 @@ def add_NotificationServiceServicer_to_server(servicer, server): request_deserializer=services_dot_notification__service__pb2.GetAllNotificationsRequest.FromString, response_serializer=services_dot_notification__service__pb2.GetAllNotificationsResponse.SerializeToString, ), + 'GetNotificationWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetNotificationWithAccess, + request_deserializer=services_dot_notification__service__pb2.GetNotificationRequest.FromString, + response_serializer=services_dot_notification__service__pb2.NotificationWithAccess.SerializeToString, + ), + 'GetAllNotificationsWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetAllNotificationsWithAccess, + request_deserializer=services_dot_notification__service__pb2.GetAllNotificationsRequest.FromString, + response_serializer=services_dot_notification__service__pb2.GetAllNotificationsWithAccessResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'org.apache.airavata.api.notification.NotificationService', rpc_method_handlers) @@ -272,3 +310,57 @@ def GetAllNotifications(request, timeout, metadata, _registered_method=True) + + @staticmethod + def GetNotificationWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.notification.NotificationService/GetNotificationWithAccess', + services_dot_notification__service__pb2.GetNotificationRequest.SerializeToString, + services_dot_notification__service__pb2.NotificationWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetAllNotificationsWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.notification.NotificationService/GetAllNotificationsWithAccess', + services_dot_notification__service__pb2.GetAllNotificationsRequest.SerializeToString, + services_dot_notification__service__pb2.GetAllNotificationsWithAccessResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/parser_service_pb2.py b/airavata-python-sdk/airavata/services/parser_service_pb2.py similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/services/parser_service_pb2.py rename to airavata-python-sdk/airavata/services/parser_service_pb2.py index ca026c3e336..b64c6b1b545 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/parser_service_pb2.py +++ b/airavata-python-sdk/airavata/services/parser_service_pb2.py @@ -24,7 +24,7 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.appcatalog.parser import parser_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_parser_dot_parser__pb2 +from airavata.model.appcatalog.parser import parser_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_parser_dot_parser__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dservices/parser_service.proto\x12\x1eorg.apache.airavata.api.parser\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x38org/apache/airavata/model/appcatalog/parser/parser.proto\"X\n\x11SaveParserRequest\x12\x43\n\x06parser\x18\x01 \x01(\x0b\x32\x33.org.apache.airavata.model.appcatalog.parser.Parser\"\'\n\x12SaveParserResponse\x12\x11\n\tparser_id\x18\x01 \x01(\t\"9\n\x10GetParserRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x11\n\tparser_id\x18\x02 \x01(\t\"+\n\x15ListAllParsersRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"^\n\x16ListAllParsersResponse\x12\x44\n\x07parsers\x18\x01 \x03(\x0b\x32\x33.org.apache.airavata.model.appcatalog.parser.Parser\"<\n\x13RemoveParserRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x11\n\tparser_id\x18\x02 \x01(\t\"t\n\x1aSaveParsingTemplateRequest\x12V\n\x10parsing_template\x18\x01 \x01(\x0b\x32<.org.apache.airavata.model.appcatalog.parser.ParsingTemplate\"2\n\x1bSaveParsingTemplateResponse\x12\x13\n\x0btemplate_id\x18\x01 \x01(\t\"D\n\x19GetParsingTemplateRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x13\n\x0btemplate_id\x18\x02 \x01(\t\"T\n\'GetParsingTemplatesForExperimentRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x15\n\rexperiment_id\x18\x02 \x01(\t\"\x83\x01\n(GetParsingTemplatesForExperimentResponse\x12W\n\x11parsing_templates\x18\x01 \x03(\x0b\x32<.org.apache.airavata.model.appcatalog.parser.ParsingTemplate\"4\n\x1eListAllParsingTemplatesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"z\n\x1fListAllParsingTemplatesResponse\x12W\n\x11parsing_templates\x18\x01 \x03(\x0b\x32<.org.apache.airavata.model.appcatalog.parser.ParsingTemplate\"G\n\x1cRemoveParsingTemplateRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x13\n\x0btemplate_id\x18\x02 \x01(\t2\xd7\r\n\rParserService\x12\x94\x01\n\nSaveParser\x12\x31.org.apache.airavata.api.parser.SaveParserRequest\x1a\x32.org.apache.airavata.api.parser.SaveParserResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x0f/api/v1/parsers:\x06parser\x12\xad\x01\n\tGetParser\x12\x30.org.apache.airavata.api.parser.GetParserRequest\x1a\x33.org.apache.airavata.model.appcatalog.parser.Parser\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/api/v1/gateways/{gateway_id}/parsers/{parser_id}\x12\xae\x01\n\x0eListAllParsers\x12\x35.org.apache.airavata.api.parser.ListAllParsersRequest\x1a\x36.org.apache.airavata.api.parser.ListAllParsersResponse\"-\x82\xd3\xe4\x93\x02\'\x12%/api/v1/gateways/{gateway_id}/parsers\x12\x96\x01\n\x0cRemoveParser\x12\x33.org.apache.airavata.api.parser.RemoveParserRequest\x1a\x16.google.protobuf.Empty\"9\x82\xd3\xe4\x93\x02\x33*1/api/v1/gateways/{gateway_id}/parsers/{parser_id}\x12\xc3\x01\n\x13SaveParsingTemplate\x12:.org.apache.airavata.api.parser.SaveParsingTemplateRequest\x1a;.org.apache.airavata.api.parser.SaveParsingTemplateResponse\"3\x82\xd3\xe4\x93\x02-\"\x19/api/v1/parsing-templates:\x10parsing_template\x12\xd4\x01\n\x12GetParsingTemplate\x12\x39.org.apache.airavata.api.parser.GetParsingTemplateRequest\x1a<.org.apache.airavata.model.appcatalog.parser.ParsingTemplate\"E\x82\xd3\xe4\x93\x02?\x12=/api/v1/gateways/{gateway_id}/parsing-templates/{template_id}\x12\x8a\x02\n GetParsingTemplatesForExperiment\x12G.org.apache.airavata.api.parser.GetParsingTemplatesForExperimentRequest\x1aH.org.apache.airavata.api.parser.GetParsingTemplatesForExperimentResponse\"S\x82\xd3\xe4\x93\x02M\x12K/api/v1/gateways/{gateway_id}/experiments/{experiment_id}/parsing-templates\x12\xd3\x01\n\x17ListAllParsingTemplates\x12>.org.apache.airavata.api.parser.ListAllParsingTemplatesRequest\x1a?.org.apache.airavata.api.parser.ListAllParsingTemplatesResponse\"7\x82\xd3\xe4\x93\x02\x31\x12//api/v1/gateways/{gateway_id}/parsing-templates\x12\xb4\x01\n\x15RemoveParsingTemplate\x12<.org.apache.airavata.api.parser.RemoveParsingTemplateRequest\x1a\x16.google.protobuf.Empty\"E\x82\xd3\xe4\x93\x02?*=/api/v1/gateways/{gateway_id}/parsing-templates/{template_id}B\"\n\x1eorg.apache.airavata.api.parserP\x01\x62\x06proto3') diff --git a/airavata-python-sdk/airavata_sdk/generated/services/parser_service_pb2.pyi b/airavata-python-sdk/airavata/services/parser_service_pb2.pyi similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/services/parser_service_pb2.pyi rename to airavata-python-sdk/airavata/services/parser_service_pb2.pyi index 84e9a7cc46d..4a135893fdc 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/parser_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/parser_service_pb2.pyi @@ -1,6 +1,6 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.appcatalog.parser import parser_pb2 as _parser_pb2 +from airavata.model.appcatalog.parser import parser_pb2 as _parser_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message diff --git a/airavata-python-sdk/airavata_sdk/generated/services/parser_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/parser_service_pb2_grpc.py similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/services/parser_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/parser_service_pb2_grpc.py index 6186722ab2b..5361d7e9ff5 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/parser_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/parser_service_pb2_grpc.py @@ -4,8 +4,8 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.appcatalog.parser import parser_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_parser_dot_parser__pb2 -from services import parser_service_pb2 as services_dot_parser__service__pb2 +from airavata.model.appcatalog.parser import parser_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_parser_dot_parser__pb2 +from airavata.services import parser_service_pb2 as services_dot_parser__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ diff --git a/airavata-python-sdk/airavata/services/project_service_pb2.py b/airavata-python-sdk/airavata/services/project_service_pb2.py new file mode 100644 index 00000000000..b25d1515e5e --- /dev/null +++ b/airavata-python-sdk/airavata/services/project_service_pb2.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/project_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/project_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 +from airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1eservices/project_service.proto\x12\x1forg.apache.airavata.api.project\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x33org/apache/airavata/model/workspace/workspace.proto\x1a/org/apache/airavata/model/commons/commons.proto\"i\n\x14\x43reateProjectRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12=\n\x07project\x18\x02 \x01(\x0b\x32,.org.apache.airavata.model.workspace.Project\"+\n\x15\x43reateProjectResponse\x12\x12\n\nproject_id\x18\x01 \x01(\t\"\x92\x01\n\x11ProjectWithAccess\x12=\n\x07project\x18\x01 \x01(\x0b\x32,.org.apache.airavata.model.workspace.Project\x12>\n\x06\x61\x63\x63\x65ss\x18\x02 \x01(\x0b\x32..org.apache.airavata.model.commons.AccessFlags\"\'\n\x11GetProjectRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\"i\n\x14UpdateProjectRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12=\n\x07project\x18\x02 \x01(\x0b\x32,.org.apache.airavata.model.workspace.Project\"*\n\x14\x44\x65leteProjectRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\"^\n\x16GetUserProjectsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x11\n\tuser_name\x18\x02 \x01(\t\x12\r\n\x05limit\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x05\"Y\n\x17GetUserProjectsResponse\x12>\n\x08projects\x18\x01 \x03(\x0b\x32,.org.apache.airavata.model.workspace.Project\"i\n!GetUserProjectsWithAccessResponse\x12\x44\n\x08projects\x18\x01 \x03(\x0b\x32\x32.org.apache.airavata.api.project.ProjectWithAccess\"\xe3\x01\n\x15SearchProjectsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x11\n\tuser_name\x18\x02 \x01(\t\x12T\n\x07\x66ilters\x18\x03 \x03(\x0b\x32\x43.org.apache.airavata.api.project.SearchProjectsRequest.FiltersEntry\x12\r\n\x05limit\x18\x04 \x01(\x05\x12\x0e\n\x06offset\x18\x05 \x01(\x05\x1a.\n\x0c\x46iltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"X\n\x16SearchProjectsResponse\x12>\n\x08projects\x18\x01 \x03(\x0b\x32,.org.apache.airavata.model.workspace.Project2\x99\x0f\n\x0eProjectService\x12\xa1\x01\n\rCreateProject\x12\x35.org.apache.airavata.api.project.CreateProjectRequest\x1a\x36.org.apache.airavata.api.project.CreateProjectResponse\"!\x82\xd3\xe4\x93\x02\x1b\"\x10/api/v1/projects:\x07project\x12\x95\x01\n\nGetProject\x12\x32.org.apache.airavata.api.project.GetProjectRequest\x1a,.org.apache.airavata.model.workspace.Project\"%\x82\xd3\xe4\x93\x02\x1f\x12\x1d/api/v1/projects/{project_id}\x12\x8e\x01\n\rUpdateProject\x12\x35.org.apache.airavata.api.project.UpdateProjectRequest\x1a\x16.google.protobuf.Empty\".\x82\xd3\xe4\x93\x02(\x1a\x1d/api/v1/projects/{project_id}:\x07project\x12\x85\x01\n\rDeleteProject\x12\x35.org.apache.airavata.api.project.DeleteProjectRequest\x1a\x16.google.protobuf.Empty\"%\x82\xd3\xe4\x93\x02\x1f*\x1d/api/v1/projects/{project_id}\x12\xc6\x01\n\x0fGetUserProjects\x12\x37.org.apache.airavata.api.project.GetUserProjectsRequest\x1a\x38.org.apache.airavata.api.project.GetUserProjectsResponse\"@\x82\xd3\xe4\x93\x02:\x12\x38/api/v1/gateways/{gateway_id}/users/{user_name}/projects\x12\x9b\x01\n\x0eSearchProjects\x12\x36.org.apache.airavata.api.project.SearchProjectsRequest\x1a\x37.org.apache.airavata.api.project.SearchProjectsResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/api/v1/projects\x12\xb0\x01\n\x14GetProjectWithAccess\x12\x32.org.apache.airavata.api.project.GetProjectRequest\x1a\x32.org.apache.airavata.api.project.ProjectWithAccess\"0\x82\xd3\xe4\x93\x02*\x12(/api/v1/projects/{project_id}:withAccess\x12\xe5\x01\n\x19GetUserProjectsWithAccess\x12\x37.org.apache.airavata.api.project.GetUserProjectsRequest\x1a\x42.org.apache.airavata.api.project.GetUserProjectsWithAccessResponse\"K\x82\xd3\xe4\x93\x02\x45\x12\x43/api/v1/gateways/{gateway_id}/users/{user_name}/projects:withAccess\x12\xb8\x01\n\x1cGetMostRecentWritableProject\x12\x37.org.apache.airavata.api.project.GetUserProjectsRequest\x1a\x32.org.apache.airavata.api.project.ProjectWithAccess\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/projects:mostRecentWritable\x12\xb2\x01\n\x17\x43reateProjectWithAccess\x12\x35.org.apache.airavata.api.project.CreateProjectRequest\x1a\x32.org.apache.airavata.api.project.ProjectWithAccess\",\x82\xd3\xe4\x93\x02&\"\x1b/api/v1/projects:withAccess:\x07project\x12\xbf\x01\n\x17UpdateProjectWithAccess\x12\x35.org.apache.airavata.api.project.UpdateProjectRequest\x1a\x32.org.apache.airavata.api.project.ProjectWithAccess\"9\x82\xd3\xe4\x93\x02\x33\x1a(/api/v1/projects/{project_id}:withAccess:\x07projectB#\n\x1forg.apache.airavata.api.projectP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.project_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\037org.apache.airavata.api.projectP\001' + _globals['_SEARCHPROJECTSREQUEST_FILTERSENTRY']._loaded_options = None + _globals['_SEARCHPROJECTSREQUEST_FILTERSENTRY']._serialized_options = b'8\001' + _globals['_PROJECTSERVICE'].methods_by_name['CreateProject']._loaded_options = None + _globals['_PROJECTSERVICE'].methods_by_name['CreateProject']._serialized_options = b'\202\323\344\223\002\033\"\020/api/v1/projects:\007project' + _globals['_PROJECTSERVICE'].methods_by_name['GetProject']._loaded_options = None + _globals['_PROJECTSERVICE'].methods_by_name['GetProject']._serialized_options = b'\202\323\344\223\002\037\022\035/api/v1/projects/{project_id}' + _globals['_PROJECTSERVICE'].methods_by_name['UpdateProject']._loaded_options = None + _globals['_PROJECTSERVICE'].methods_by_name['UpdateProject']._serialized_options = b'\202\323\344\223\002(\032\035/api/v1/projects/{project_id}:\007project' + _globals['_PROJECTSERVICE'].methods_by_name['DeleteProject']._loaded_options = None + _globals['_PROJECTSERVICE'].methods_by_name['DeleteProject']._serialized_options = b'\202\323\344\223\002\037*\035/api/v1/projects/{project_id}' + _globals['_PROJECTSERVICE'].methods_by_name['GetUserProjects']._loaded_options = None + _globals['_PROJECTSERVICE'].methods_by_name['GetUserProjects']._serialized_options = b'\202\323\344\223\002:\0228/api/v1/gateways/{gateway_id}/users/{user_name}/projects' + _globals['_PROJECTSERVICE'].methods_by_name['SearchProjects']._loaded_options = None + _globals['_PROJECTSERVICE'].methods_by_name['SearchProjects']._serialized_options = b'\202\323\344\223\002\022\022\020/api/v1/projects' + _globals['_PROJECTSERVICE'].methods_by_name['GetProjectWithAccess']._loaded_options = None + _globals['_PROJECTSERVICE'].methods_by_name['GetProjectWithAccess']._serialized_options = b'\202\323\344\223\002*\022(/api/v1/projects/{project_id}:withAccess' + _globals['_PROJECTSERVICE'].methods_by_name['GetUserProjectsWithAccess']._loaded_options = None + _globals['_PROJECTSERVICE'].methods_by_name['GetUserProjectsWithAccess']._serialized_options = b'\202\323\344\223\002E\022C/api/v1/gateways/{gateway_id}/users/{user_name}/projects:withAccess' + _globals['_PROJECTSERVICE'].methods_by_name['GetMostRecentWritableProject']._loaded_options = None + _globals['_PROJECTSERVICE'].methods_by_name['GetMostRecentWritableProject']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/projects:mostRecentWritable' + _globals['_PROJECTSERVICE'].methods_by_name['CreateProjectWithAccess']._loaded_options = None + _globals['_PROJECTSERVICE'].methods_by_name['CreateProjectWithAccess']._serialized_options = b'\202\323\344\223\002&\"\033/api/v1/projects:withAccess:\007project' + _globals['_PROJECTSERVICE'].methods_by_name['UpdateProjectWithAccess']._loaded_options = None + _globals['_PROJECTSERVICE'].methods_by_name['UpdateProjectWithAccess']._serialized_options = b'\202\323\344\223\0023\032(/api/v1/projects/{project_id}:withAccess:\007project' + _globals['_CREATEPROJECTREQUEST']._serialized_start=228 + _globals['_CREATEPROJECTREQUEST']._serialized_end=333 + _globals['_CREATEPROJECTRESPONSE']._serialized_start=335 + _globals['_CREATEPROJECTRESPONSE']._serialized_end=378 + _globals['_PROJECTWITHACCESS']._serialized_start=381 + _globals['_PROJECTWITHACCESS']._serialized_end=527 + _globals['_GETPROJECTREQUEST']._serialized_start=529 + _globals['_GETPROJECTREQUEST']._serialized_end=568 + _globals['_UPDATEPROJECTREQUEST']._serialized_start=570 + _globals['_UPDATEPROJECTREQUEST']._serialized_end=675 + _globals['_DELETEPROJECTREQUEST']._serialized_start=677 + _globals['_DELETEPROJECTREQUEST']._serialized_end=719 + _globals['_GETUSERPROJECTSREQUEST']._serialized_start=721 + _globals['_GETUSERPROJECTSREQUEST']._serialized_end=815 + _globals['_GETUSERPROJECTSRESPONSE']._serialized_start=817 + _globals['_GETUSERPROJECTSRESPONSE']._serialized_end=906 + _globals['_GETUSERPROJECTSWITHACCESSRESPONSE']._serialized_start=908 + _globals['_GETUSERPROJECTSWITHACCESSRESPONSE']._serialized_end=1013 + _globals['_SEARCHPROJECTSREQUEST']._serialized_start=1016 + _globals['_SEARCHPROJECTSREQUEST']._serialized_end=1243 + _globals['_SEARCHPROJECTSREQUEST_FILTERSENTRY']._serialized_start=1197 + _globals['_SEARCHPROJECTSREQUEST_FILTERSENTRY']._serialized_end=1243 + _globals['_SEARCHPROJECTSRESPONSE']._serialized_start=1245 + _globals['_SEARCHPROJECTSRESPONSE']._serialized_end=1333 + _globals['_PROJECTSERVICE']._serialized_start=1336 + _globals['_PROJECTSERVICE']._serialized_end=3281 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/project_service_pb2.pyi b/airavata-python-sdk/airavata/services/project_service_pb2.pyi similarity index 82% rename from airavata-python-sdk/airavata_sdk/generated/services/project_service_pb2.pyi rename to airavata-python-sdk/airavata/services/project_service_pb2.pyi index da85a165693..44b68b43902 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/project_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/project_service_pb2.pyi @@ -1,6 +1,7 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.workspace import workspace_pb2 as _workspace_pb2 +from airavata.model.workspace import workspace_pb2 as _workspace_pb2 +from airavata.model.commons import commons_pb2 as _commons_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -23,6 +24,14 @@ class CreateProjectResponse(_message.Message): project_id: str def __init__(self, project_id: _Optional[str] = ...) -> None: ... +class ProjectWithAccess(_message.Message): + __slots__ = ("project", "access") + PROJECT_FIELD_NUMBER: _ClassVar[int] + ACCESS_FIELD_NUMBER: _ClassVar[int] + project: _workspace_pb2.Project + access: _commons_pb2.AccessFlags + def __init__(self, project: _Optional[_Union[_workspace_pb2.Project, _Mapping]] = ..., access: _Optional[_Union[_commons_pb2.AccessFlags, _Mapping]] = ...) -> None: ... + class GetProjectRequest(_message.Message): __slots__ = ("project_id",) PROJECT_ID_FIELD_NUMBER: _ClassVar[int] @@ -61,6 +70,12 @@ class GetUserProjectsResponse(_message.Message): projects: _containers.RepeatedCompositeFieldContainer[_workspace_pb2.Project] def __init__(self, projects: _Optional[_Iterable[_Union[_workspace_pb2.Project, _Mapping]]] = ...) -> None: ... +class GetUserProjectsWithAccessResponse(_message.Message): + __slots__ = ("projects",) + PROJECTS_FIELD_NUMBER: _ClassVar[int] + projects: _containers.RepeatedCompositeFieldContainer[ProjectWithAccess] + def __init__(self, projects: _Optional[_Iterable[_Union[ProjectWithAccess, _Mapping]]] = ...) -> None: ... + class SearchProjectsRequest(_message.Message): __slots__ = ("gateway_id", "user_name", "filters", "limit", "offset") class FiltersEntry(_message.Message): diff --git a/airavata-python-sdk/airavata_sdk/generated/services/project_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/project_service_pb2_grpc.py similarity index 55% rename from airavata-python-sdk/airavata_sdk/generated/services/project_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/project_service_pb2_grpc.py index d26d35e2d2c..e6d16e36d70 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/project_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/project_service_pb2_grpc.py @@ -4,8 +4,8 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 -from services import project_service_pb2 as services_dot_project__service__pb2 +from airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 +from airavata.services import project_service_pb2 as services_dot_project__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ @@ -67,6 +67,31 @@ def __init__(self, channel): request_serializer=services_dot_project__service__pb2.SearchProjectsRequest.SerializeToString, response_deserializer=services_dot_project__service__pb2.SearchProjectsResponse.FromString, _registered_method=True) + self.GetProjectWithAccess = channel.unary_unary( + '/org.apache.airavata.api.project.ProjectService/GetProjectWithAccess', + request_serializer=services_dot_project__service__pb2.GetProjectRequest.SerializeToString, + response_deserializer=services_dot_project__service__pb2.ProjectWithAccess.FromString, + _registered_method=True) + self.GetUserProjectsWithAccess = channel.unary_unary( + '/org.apache.airavata.api.project.ProjectService/GetUserProjectsWithAccess', + request_serializer=services_dot_project__service__pb2.GetUserProjectsRequest.SerializeToString, + response_deserializer=services_dot_project__service__pb2.GetUserProjectsWithAccessResponse.FromString, + _registered_method=True) + self.GetMostRecentWritableProject = channel.unary_unary( + '/org.apache.airavata.api.project.ProjectService/GetMostRecentWritableProject', + request_serializer=services_dot_project__service__pb2.GetUserProjectsRequest.SerializeToString, + response_deserializer=services_dot_project__service__pb2.ProjectWithAccess.FromString, + _registered_method=True) + self.CreateProjectWithAccess = channel.unary_unary( + '/org.apache.airavata.api.project.ProjectService/CreateProjectWithAccess', + request_serializer=services_dot_project__service__pb2.CreateProjectRequest.SerializeToString, + response_deserializer=services_dot_project__service__pb2.ProjectWithAccess.FromString, + _registered_method=True) + self.UpdateProjectWithAccess = channel.unary_unary( + '/org.apache.airavata.api.project.ProjectService/UpdateProjectWithAccess', + request_serializer=services_dot_project__service__pb2.UpdateProjectRequest.SerializeToString, + response_deserializer=services_dot_project__service__pb2.ProjectWithAccess.FromString, + _registered_method=True) class ProjectServiceServicer(object): @@ -109,6 +134,47 @@ def SearchProjects(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetProjectWithAccess(self, request, context): + """Additive: GetProject plus the caller's server-computed access flags, so a + client does not recompute access from a separate sharing round-trip. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetUserProjectsWithAccess(self, request, context): + """Additive: GetUserProjects plus each project's caller-scoped access flags, so + a client does not recompute access per project from separate sharing round-trips. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetMostRecentWritableProject(self, request, context): + """Additive: the caller's most-recently-created WRITE-accessible project, returned + as a ProjectWithAccess. Lets a client resolve a sensible default target project + without listing all projects and recomputing access client-side. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateProjectWithAccess(self, request, context): + """Additive: CreateProject that returns the new project's caller-scoped access flags + (a ProjectWithAccess), so a client does not chain create -> get -> sharing. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateProjectWithAccess(self, request, context): + """Additive: UpdateProject that returns the project's caller-scoped access flags + (a ProjectWithAccess), so a client does not chain update -> get -> sharing. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_ProjectServiceServicer_to_server(servicer, server): rpc_method_handlers = { @@ -142,6 +208,31 @@ def add_ProjectServiceServicer_to_server(servicer, server): request_deserializer=services_dot_project__service__pb2.SearchProjectsRequest.FromString, response_serializer=services_dot_project__service__pb2.SearchProjectsResponse.SerializeToString, ), + 'GetProjectWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetProjectWithAccess, + request_deserializer=services_dot_project__service__pb2.GetProjectRequest.FromString, + response_serializer=services_dot_project__service__pb2.ProjectWithAccess.SerializeToString, + ), + 'GetUserProjectsWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.GetUserProjectsWithAccess, + request_deserializer=services_dot_project__service__pb2.GetUserProjectsRequest.FromString, + response_serializer=services_dot_project__service__pb2.GetUserProjectsWithAccessResponse.SerializeToString, + ), + 'GetMostRecentWritableProject': grpc.unary_unary_rpc_method_handler( + servicer.GetMostRecentWritableProject, + request_deserializer=services_dot_project__service__pb2.GetUserProjectsRequest.FromString, + response_serializer=services_dot_project__service__pb2.ProjectWithAccess.SerializeToString, + ), + 'CreateProjectWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.CreateProjectWithAccess, + request_deserializer=services_dot_project__service__pb2.CreateProjectRequest.FromString, + response_serializer=services_dot_project__service__pb2.ProjectWithAccess.SerializeToString, + ), + 'UpdateProjectWithAccess': grpc.unary_unary_rpc_method_handler( + servicer.UpdateProjectWithAccess, + request_deserializer=services_dot_project__service__pb2.UpdateProjectRequest.FromString, + response_serializer=services_dot_project__service__pb2.ProjectWithAccess.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'org.apache.airavata.api.project.ProjectService', rpc_method_handlers) @@ -315,3 +406,138 @@ def SearchProjects(request, timeout, metadata, _registered_method=True) + + @staticmethod + def GetProjectWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.project.ProjectService/GetProjectWithAccess', + services_dot_project__service__pb2.GetProjectRequest.SerializeToString, + services_dot_project__service__pb2.ProjectWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetUserProjectsWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.project.ProjectService/GetUserProjectsWithAccess', + services_dot_project__service__pb2.GetUserProjectsRequest.SerializeToString, + services_dot_project__service__pb2.GetUserProjectsWithAccessResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetMostRecentWritableProject(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.project.ProjectService/GetMostRecentWritableProject', + services_dot_project__service__pb2.GetUserProjectsRequest.SerializeToString, + services_dot_project__service__pb2.ProjectWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CreateProjectWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.project.ProjectService/CreateProjectWithAccess', + services_dot_project__service__pb2.CreateProjectRequest.SerializeToString, + services_dot_project__service__pb2.ProjectWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateProjectWithAccess(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.project.ProjectService/UpdateProjectWithAccess', + services_dot_project__service__pb2.UpdateProjectRequest.SerializeToString, + services_dot_project__service__pb2.ProjectWithAccess.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/research_service_pb2.py b/airavata-python-sdk/airavata/services/research_service_pb2.py similarity index 99% rename from airavata-python-sdk/airavata_sdk/generated/services/research_service_pb2.py rename to airavata-python-sdk/airavata/services/research_service_pb2.py index 7664bce87b8..719ec8b8b90 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/research_service_pb2.py +++ b/airavata-python-sdk/airavata/services/research_service_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE -# source: services/research-service.proto +# source: services/research_service.proto # Protobuf Python Version: 6.31.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor @@ -15,7 +15,7 @@ 31, 1, '', - 'services/research-service.proto' + 'services/research_service.proto' ) # @@protoc_insertion_point(imports) @@ -26,7 +26,7 @@ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fservices/research-service.proto\x12\x1corg.apache.airavata.research\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\"i\n\x11\x43reateUserRequest\x12\x10\n\x08userName\x18\x01 \x01(\t\x12\x11\n\tfirstName\x18\x02 \x01(\t\x12\x10\n\x08lastName\x18\x03 \x01(\t\x12\r\n\x05\x65mail\x18\x04 \x01(\t\x12\x0e\n\x06\x61vatar\x18\x05 \x01(\t\"\x1d\n\x0c\x42oolResponse\x12\r\n\x05value\x18\x01 \x01(\x08\"\x1c\n\x0cJsonResponse\x12\x0c\n\x04json\x18\x01 \x01(\t\"!\n\x10JsonListResponse\x12\r\n\x05items\x18\x01 \x03(\t\"j\n\x1c\x43reateResearchProjectRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08owner_id\x18\x02 \x01(\t\x12\x15\n\rrepository_id\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x61taset_ids\x18\x04 \x03(\t\"-\n\x19GetProjectsByOwnerRequest\x12\x10\n\x08owner_id\x18\x01 \x01(\t\"*\n\x14\x44\x65leteProjectRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\"\x17\n\x15GetAllProjectsRequest\"\x80\x01\n\x15\x43reateResourceRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cheader_image\x18\x03 \x01(\t\x12\x0c\n\x04tags\x18\x04 \x03(\t\x12\x0f\n\x07\x61uthors\x18\x05 \x03(\t\x12\x0f\n\x07privacy\x18\x06 \x01(\t\"\x8c\x01\n\x15ModifyResourceRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x14\n\x0cheader_image\x18\x04 \x01(\t\x12\x0c\n\x04tags\x18\x05 \x03(\t\x12\x0f\n\x07\x61uthors\x18\x06 \x03(\t\x12\x0f\n\x07privacy\x18\x07 \x01(\t\"|\n\x1f\x43reateRepositoryResourceRequest\x12\x45\n\x08resource\x18\x01 \x01(\x0b\x32\x33.org.apache.airavata.research.CreateResourceRequest\x12\x12\n\ngithub_url\x18\x02 \x01(\t\"\x1f\n\x11ResourceIdRequest\x12\n\n\x02id\x18\x01 \x01(\t\"r\n\x16GetAllResourcesRequest\x12\x13\n\x0bpage_number\x18\x01 \x01(\x05\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x13\n\x0bname_search\x18\x03 \x01(\t\x12\r\n\x05types\x18\x04 \x03(\t\x12\x0c\n\x04tags\x18\x05 \x03(\t\"3\n\x15SearchResourceRequest\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"!\n\x13StarResourceRequest\x12\n\n\x02id\x18\x01 \x01(\t\"-\n\x1aGetStarredResourcesRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\")\n\x1bGetResourceStarCountRequest\x12\n\n\x02id\x18\x01 \x01(\t\"\"\n\x11StarCountResponse\x12\r\n\x05\x63ount\x18\x01 \x01(\x03\"$\n\x12GetSessionsRequest\x12\x0e\n\x06status\x18\x01 \x01(\t\"@\n\x1aUpdateSessionStatusRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"*\n\x14\x44\x65leteSessionRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\",\n\x15\x44\x65leteSessionsRequest\x12\x13\n\x0bsession_ids\x18\x01 \x03(\t\"F\n\x1aStartProjectSessionRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x14\n\x0csession_name\x18\x02 \x01(\t\"*\n\x14ResumeSessionRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\"(\n\x10RedirectResponse\x12\x14\n\x0credirect_url\x18\x01 \x01(\t2\x8d\x05\n\x16ResearchProjectService\x12\x93\x01\n\x0eGetAllProjects\x12\x33.org.apache.airavata.research.GetAllProjectsRequest\x1a..org.apache.airavata.research.JsonListResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\x12\x14/api/v1/rf/projects/\x12\xa5\x01\n\x12GetProjectsByOwner\x12\x37.org.apache.airavata.research.GetProjectsByOwnerRequest\x1a..org.apache.airavata.research.JsonListResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/rf/projects/{owner_id}\x12\x98\x01\n\rCreateProject\x12:.org.apache.airavata.research.CreateResearchProjectRequest\x1a*.org.apache.airavata.research.JsonResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x14/api/v1/rf/projects/:\x01*\x12\x99\x01\n\rDeleteProject\x12\x32.org.apache.airavata.research.DeleteProjectRequest\x1a*.org.apache.airavata.research.BoolResponse\"(\x82\xd3\xe4\x93\x02\"* /api/v1/rf/projects/{project_id}2\xb8\x12\n\x17ResearchResourceService\x12}\n\rCreateDataset\x12\x17.google.protobuf.Struct\x1a*.org.apache.airavata.research.JsonResponse\"\'\x82\xd3\xe4\x93\x02!\"\x1c/api/v1/rf/resources/dataset:\x01*\x12\x7f\n\x0e\x43reateNotebook\x12\x17.google.protobuf.Struct\x1a*.org.apache.airavata.research.JsonResponse\"(\x82\xd3\xe4\x93\x02\"\"\x1d/api/v1/rf/resources/notebook:\x01*\x12\xa9\x01\n\x10\x43reateRepository\x12=.org.apache.airavata.research.CreateRepositoryResourceRequest\x1a*.org.apache.airavata.research.JsonResponse\"*\x82\xd3\xe4\x93\x02$\"\x1f/api/v1/rf/resources/repository:\x01*\x12\x9f\x01\n\x10ModifyRepository\x12\x33.org.apache.airavata.research.ModifyResourceRequest\x1a*.org.apache.airavata.research.JsonResponse\"*\x82\xd3\xe4\x93\x02$2\x1f/api/v1/rf/resources/repository:\x01*\x12y\n\x0b\x43reateModel\x12\x17.google.protobuf.Struct\x1a*.org.apache.airavata.research.JsonResponse\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/api/v1/rf/resources/model:\x01*\x12\x9d\x01\n\x07GetTags\x12\x34.org.apache.airavata.research.GetAllResourcesRequest\x1a..org.apache.airavata.research.JsonListResponse\",\x82\xd3\xe4\x93\x02&\x12$/api/v1/rf/resources/public/tags/all\x12\x94\x01\n\x0bGetResource\x12/.org.apache.airavata.research.ResourceIdRequest\x1a*.org.apache.airavata.research.JsonResponse\"(\x82\xd3\xe4\x93\x02\"\x12 /api/v1/rf/resources/public/{id}\x12\x90\x01\n\x0e\x44\x65leteResource\x12/.org.apache.airavata.research.ResourceIdRequest\x1a*.org.apache.airavata.research.BoolResponse\"!\x82\xd3\xe4\x93\x02\x1b*\x19/api/v1/rf/resources/{id}\x12\x98\x01\n\x0fGetAllResources\x12\x34.org.apache.airavata.research.GetAllResourcesRequest\x1a*.org.apache.airavata.research.JsonResponse\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/api/v1/rf/resources/public\x12\x9b\x01\n\x0fSearchResources\x12\x33.org.apache.airavata.research.SearchResourceRequest\x1a..org.apache.airavata.research.JsonListResponse\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/api/v1/rf/resources/search\x12\xac\x01\n\x16GetProjectsForResource\x12/.org.apache.airavata.research.ResourceIdRequest\x1a..org.apache.airavata.research.JsonListResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/rf/resources/public/{id}/projects\x12\x95\x01\n\x0cStarResource\x12\x31.org.apache.airavata.research.StarResourceRequest\x1a*.org.apache.airavata.research.BoolResponse\"&\x82\xd3\xe4\x93\x02 \"\x1e/api/v1/rf/resources/{id}/star\x12\xa1\x01\n\x18\x43heckUserStarredResource\x12\x31.org.apache.airavata.research.StarResourceRequest\x1a*.org.apache.airavata.research.BoolResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/rf/resources/{id}/star\x12\xb5\x01\n\x14GetResourceStarCount\x12\x39.org.apache.airavata.research.GetResourceStarCountRequest\x1a/.org.apache.airavata.research.StarCountResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/rf/resources/resources/{id}/count\x12\xad\x01\n\x13GetStarredResources\x12\x38.org.apache.airavata.research.GetStarredResourcesRequest\x1a..org.apache.airavata.research.JsonListResponse\",\x82\xd3\xe4\x93\x02&\x12$/api/v1/rf/resources/{user_id}/stars2\x92\x05\n\x16ResearchSessionService\x12\x8d\x01\n\x0bGetSessions\x12\x30.org.apache.airavata.research.GetSessionsRequest\x1a..org.apache.airavata.research.JsonListResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\x12\x14/api/v1/rf/sessions/\x12\xa5\x01\n\x13UpdateSessionStatus\x12\x38.org.apache.airavata.research.UpdateSessionStatusRequest\x1a*.org.apache.airavata.research.JsonResponse\"(\x82\xd3\xe4\x93\x02\"2 /api/v1/rf/sessions/{session_id}\x12\xa3\x01\n\x0e\x44\x65leteSessions\x12\x33.org.apache.airavata.research.DeleteSessionsRequest\x1a*.org.apache.airavata.research.BoolResponse\"0\x82\xd3\xe4\x93\x02**(/api/v1/rf/sessions/delete/{session_ids}\x12\x99\x01\n\rDeleteSession\x12\x32.org.apache.airavata.research.DeleteSessionRequest\x1a*.org.apache.airavata.research.BoolResponse\"(\x82\xd3\xe4\x93\x02\"* /api/v1/rf/sessions/{session_id}2\xf3\x02\n\x12ResearchHubService\x12\xb2\x01\n\x13StartProjectSession\x12\x38.org.apache.airavata.research.StartProjectSessionRequest\x1a..org.apache.airavata.research.RedirectResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/rf/hub/start/project/{project_id}\x12\xa7\x01\n\rResumeSession\x12\x32.org.apache.airavata.research.ResumeSessionRequest\x1a..org.apache.airavata.research.RedirectResponse\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/rf/hub/resume/session/{session_id}B6\n\x1corg.apache.airavata.researchB\x14ResearchServiceProtoP\x01\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fservices/research_service.proto\x12\x1corg.apache.airavata.research\x1a\x1cgoogle/api/annotations.proto\x1a\x1cgoogle/protobuf/struct.proto\"i\n\x11\x43reateUserRequest\x12\x10\n\x08userName\x18\x01 \x01(\t\x12\x11\n\tfirstName\x18\x02 \x01(\t\x12\x10\n\x08lastName\x18\x03 \x01(\t\x12\r\n\x05\x65mail\x18\x04 \x01(\t\x12\x0e\n\x06\x61vatar\x18\x05 \x01(\t\"\x1d\n\x0c\x42oolResponse\x12\r\n\x05value\x18\x01 \x01(\x08\"\x1c\n\x0cJsonResponse\x12\x0c\n\x04json\x18\x01 \x01(\t\"!\n\x10JsonListResponse\x12\r\n\x05items\x18\x01 \x03(\t\"j\n\x1c\x43reateResearchProjectRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08owner_id\x18\x02 \x01(\t\x12\x15\n\rrepository_id\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x61taset_ids\x18\x04 \x03(\t\"-\n\x19GetProjectsByOwnerRequest\x12\x10\n\x08owner_id\x18\x01 \x01(\t\"*\n\x14\x44\x65leteProjectRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\"\x17\n\x15GetAllProjectsRequest\"\x80\x01\n\x15\x43reateResourceRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cheader_image\x18\x03 \x01(\t\x12\x0c\n\x04tags\x18\x04 \x03(\t\x12\x0f\n\x07\x61uthors\x18\x05 \x03(\t\x12\x0f\n\x07privacy\x18\x06 \x01(\t\"\x8c\x01\n\x15ModifyResourceRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x14\n\x0cheader_image\x18\x04 \x01(\t\x12\x0c\n\x04tags\x18\x05 \x03(\t\x12\x0f\n\x07\x61uthors\x18\x06 \x03(\t\x12\x0f\n\x07privacy\x18\x07 \x01(\t\"|\n\x1f\x43reateRepositoryResourceRequest\x12\x45\n\x08resource\x18\x01 \x01(\x0b\x32\x33.org.apache.airavata.research.CreateResourceRequest\x12\x12\n\ngithub_url\x18\x02 \x01(\t\"\x1f\n\x11ResourceIdRequest\x12\n\n\x02id\x18\x01 \x01(\t\"r\n\x16GetAllResourcesRequest\x12\x13\n\x0bpage_number\x18\x01 \x01(\x05\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x13\n\x0bname_search\x18\x03 \x01(\t\x12\r\n\x05types\x18\x04 \x03(\t\x12\x0c\n\x04tags\x18\x05 \x03(\t\"3\n\x15SearchResourceRequest\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"!\n\x13StarResourceRequest\x12\n\n\x02id\x18\x01 \x01(\t\"-\n\x1aGetStarredResourcesRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\")\n\x1bGetResourceStarCountRequest\x12\n\n\x02id\x18\x01 \x01(\t\"\"\n\x11StarCountResponse\x12\r\n\x05\x63ount\x18\x01 \x01(\x03\"$\n\x12GetSessionsRequest\x12\x0e\n\x06status\x18\x01 \x01(\t\"@\n\x1aUpdateSessionStatusRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\"*\n\x14\x44\x65leteSessionRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\",\n\x15\x44\x65leteSessionsRequest\x12\x13\n\x0bsession_ids\x18\x01 \x03(\t\"F\n\x1aStartProjectSessionRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x14\n\x0csession_name\x18\x02 \x01(\t\"*\n\x14ResumeSessionRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\"(\n\x10RedirectResponse\x12\x14\n\x0credirect_url\x18\x01 \x01(\t2\x8d\x05\n\x16ResearchProjectService\x12\x93\x01\n\x0eGetAllProjects\x12\x33.org.apache.airavata.research.GetAllProjectsRequest\x1a..org.apache.airavata.research.JsonListResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\x12\x14/api/v1/rf/projects/\x12\xa5\x01\n\x12GetProjectsByOwner\x12\x37.org.apache.airavata.research.GetProjectsByOwnerRequest\x1a..org.apache.airavata.research.JsonListResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/rf/projects/{owner_id}\x12\x98\x01\n\rCreateProject\x12:.org.apache.airavata.research.CreateResearchProjectRequest\x1a*.org.apache.airavata.research.JsonResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x14/api/v1/rf/projects/:\x01*\x12\x99\x01\n\rDeleteProject\x12\x32.org.apache.airavata.research.DeleteProjectRequest\x1a*.org.apache.airavata.research.BoolResponse\"(\x82\xd3\xe4\x93\x02\"* /api/v1/rf/projects/{project_id}2\xb8\x12\n\x17ResearchResourceService\x12}\n\rCreateDataset\x12\x17.google.protobuf.Struct\x1a*.org.apache.airavata.research.JsonResponse\"\'\x82\xd3\xe4\x93\x02!\"\x1c/api/v1/rf/resources/dataset:\x01*\x12\x7f\n\x0e\x43reateNotebook\x12\x17.google.protobuf.Struct\x1a*.org.apache.airavata.research.JsonResponse\"(\x82\xd3\xe4\x93\x02\"\"\x1d/api/v1/rf/resources/notebook:\x01*\x12\xa9\x01\n\x10\x43reateRepository\x12=.org.apache.airavata.research.CreateRepositoryResourceRequest\x1a*.org.apache.airavata.research.JsonResponse\"*\x82\xd3\xe4\x93\x02$\"\x1f/api/v1/rf/resources/repository:\x01*\x12\x9f\x01\n\x10ModifyRepository\x12\x33.org.apache.airavata.research.ModifyResourceRequest\x1a*.org.apache.airavata.research.JsonResponse\"*\x82\xd3\xe4\x93\x02$2\x1f/api/v1/rf/resources/repository:\x01*\x12y\n\x0b\x43reateModel\x12\x17.google.protobuf.Struct\x1a*.org.apache.airavata.research.JsonResponse\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/api/v1/rf/resources/model:\x01*\x12\x9d\x01\n\x07GetTags\x12\x34.org.apache.airavata.research.GetAllResourcesRequest\x1a..org.apache.airavata.research.JsonListResponse\",\x82\xd3\xe4\x93\x02&\x12$/api/v1/rf/resources/public/tags/all\x12\x94\x01\n\x0bGetResource\x12/.org.apache.airavata.research.ResourceIdRequest\x1a*.org.apache.airavata.research.JsonResponse\"(\x82\xd3\xe4\x93\x02\"\x12 /api/v1/rf/resources/public/{id}\x12\x90\x01\n\x0e\x44\x65leteResource\x12/.org.apache.airavata.research.ResourceIdRequest\x1a*.org.apache.airavata.research.BoolResponse\"!\x82\xd3\xe4\x93\x02\x1b*\x19/api/v1/rf/resources/{id}\x12\x98\x01\n\x0fGetAllResources\x12\x34.org.apache.airavata.research.GetAllResourcesRequest\x1a*.org.apache.airavata.research.JsonResponse\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/api/v1/rf/resources/public\x12\x9b\x01\n\x0fSearchResources\x12\x33.org.apache.airavata.research.SearchResourceRequest\x1a..org.apache.airavata.research.JsonListResponse\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/api/v1/rf/resources/search\x12\xac\x01\n\x16GetProjectsForResource\x12/.org.apache.airavata.research.ResourceIdRequest\x1a..org.apache.airavata.research.JsonListResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/rf/resources/public/{id}/projects\x12\x95\x01\n\x0cStarResource\x12\x31.org.apache.airavata.research.StarResourceRequest\x1a*.org.apache.airavata.research.BoolResponse\"&\x82\xd3\xe4\x93\x02 \"\x1e/api/v1/rf/resources/{id}/star\x12\xa1\x01\n\x18\x43heckUserStarredResource\x12\x31.org.apache.airavata.research.StarResourceRequest\x1a*.org.apache.airavata.research.BoolResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/rf/resources/{id}/star\x12\xb5\x01\n\x14GetResourceStarCount\x12\x39.org.apache.airavata.research.GetResourceStarCountRequest\x1a/.org.apache.airavata.research.StarCountResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/rf/resources/resources/{id}/count\x12\xad\x01\n\x13GetStarredResources\x12\x38.org.apache.airavata.research.GetStarredResourcesRequest\x1a..org.apache.airavata.research.JsonListResponse\",\x82\xd3\xe4\x93\x02&\x12$/api/v1/rf/resources/{user_id}/stars2\x92\x05\n\x16ResearchSessionService\x12\x8d\x01\n\x0bGetSessions\x12\x30.org.apache.airavata.research.GetSessionsRequest\x1a..org.apache.airavata.research.JsonListResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\x12\x14/api/v1/rf/sessions/\x12\xa5\x01\n\x13UpdateSessionStatus\x12\x38.org.apache.airavata.research.UpdateSessionStatusRequest\x1a*.org.apache.airavata.research.JsonResponse\"(\x82\xd3\xe4\x93\x02\"2 /api/v1/rf/sessions/{session_id}\x12\xa3\x01\n\x0e\x44\x65leteSessions\x12\x33.org.apache.airavata.research.DeleteSessionsRequest\x1a*.org.apache.airavata.research.BoolResponse\"0\x82\xd3\xe4\x93\x02**(/api/v1/rf/sessions/delete/{session_ids}\x12\x99\x01\n\rDeleteSession\x12\x32.org.apache.airavata.research.DeleteSessionRequest\x1a*.org.apache.airavata.research.BoolResponse\"(\x82\xd3\xe4\x93\x02\"* /api/v1/rf/sessions/{session_id}2\xf3\x02\n\x12ResearchHubService\x12\xb2\x01\n\x13StartProjectSession\x12\x38.org.apache.airavata.research.StartProjectSessionRequest\x1a..org.apache.airavata.research.RedirectResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/rf/hub/start/project/{project_id}\x12\xa7\x01\n\rResumeSession\x12\x32.org.apache.airavata.research.ResumeSessionRequest\x1a..org.apache.airavata.research.RedirectResponse\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/rf/hub/resume/session/{session_id}B6\n\x1corg.apache.airavata.researchB\x14ResearchServiceProtoP\x01\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/research_service_pb2.pyi b/airavata-python-sdk/airavata/services/research_service_pb2.pyi similarity index 100% rename from airavata-python-sdk/airavata_sdk/generated/services/research_service_pb2.pyi rename to airavata-python-sdk/airavata/services/research_service_pb2.pyi diff --git a/airavata-python-sdk/airavata_sdk/generated/services/research_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/research_service_pb2_grpc.py similarity index 99% rename from airavata-python-sdk/airavata_sdk/generated/services/research_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/research_service_pb2_grpc.py index d4a3eddbf8c..3836e3503ac 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/research_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/research_service_pb2_grpc.py @@ -4,7 +4,7 @@ import warnings from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -from services import research_service_pb2 as services_dot_research__service__pb2 +from airavata.services import research_service_pb2 as services_dot_research__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ diff --git a/airavata-python-sdk/airavata/services/resource_service_pb2.py b/airavata-python-sdk/airavata/services/resource_service_pb2.py new file mode 100644 index 00000000000..6a6160ad74b --- /dev/null +++ b/airavata-python-sdk/airavata/services/resource_service_pb2.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/resource_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/resource_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.appcatalog.computeresource import compute_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2 +from airavata.model.appcatalog.storageresource import storage_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_storageresource_dot_storage__resource__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fservices/resource_service.proto\x12 org.apache.airavata.api.resource\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1aKorg/apache/airavata/model/appcatalog/computeresource/compute_resource.proto\x1aKorg/apache/airavata/model/appcatalog/storageresource/storage_resource.proto\"\x8c\x01\n\x1eRegisterComputeResourceRequest\x12j\n\x10\x63ompute_resource\x18\x01 \x01(\x0b\x32P.org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription\">\n\x1fRegisterComputeResourceResponse\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\"8\n\x19GetComputeResourceRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\"\xa7\x01\n\x1cUpdateComputeResourceRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12j\n\x10\x63ompute_resource\x18\x02 \x01(\x0b\x32P.org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription\";\n\x1c\x44\x65leteComputeResourceRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\"#\n!GetAllComputeResourceNamesRequest\"\xe1\x01\n\"GetAllComputeResourceNamesResponse\x12~\n\x16\x63ompute_resource_names\x18\x01 \x03(\x0b\x32^.org.apache.airavata.api.resource.GetAllComputeResourceNamesResponse.ComputeResourceNamesEntry\x1a;\n\x19\x43omputeResourceNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8c\x01\n\x1eRegisterStorageResourceRequest\x12j\n\x10storage_resource\x18\x01 \x01(\x0b\x32P.org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription\">\n\x1fRegisterStorageResourceResponse\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\"8\n\x19GetStorageResourceRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\"\xa7\x01\n\x1cUpdateStorageResourceRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12j\n\x10storage_resource\x18\x02 \x01(\x0b\x32P.org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription\";\n\x1c\x44\x65leteStorageResourceRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\"#\n!GetAllStorageResourceNamesRequest\"\xe1\x01\n\"GetAllStorageResourceNamesResponse\x12~\n\x16storage_resource_names\x18\x01 \x03(\x0b\x32^.org.apache.airavata.api.resource.GetAllStorageResourceNamesResponse.StorageResourceNamesEntry\x1a;\n\x19StorageResourceNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"J\n\x17\x44\x65leteBatchQueueRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x12\n\nqueue_name\x18\x02 \x01(\t2\xac\x11\n\x0fResourceService\x12\xd3\x01\n\x17RegisterComputeResource\x12@.org.apache.airavata.api.resource.RegisterComputeResourceRequest\x1a\x41.org.apache.airavata.api.resource.RegisterComputeResourceResponse\"3\x82\xd3\xe4\x93\x02-\"\x19/api/v1/compute-resources:\x10\x63ompute_resource\x12\xdc\x01\n\x12GetComputeResource\x12;.org.apache.airavata.api.resource.GetComputeResourceRequest\x1aP.org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription\"7\x82\xd3\xe4\x93\x02\x31\x12//api/v1/compute-resources/{compute_resource_id}\x12\xba\x01\n\x15UpdateComputeResource\x12>.org.apache.airavata.api.resource.UpdateComputeResourceRequest\x1a\x16.google.protobuf.Empty\"I\x82\xd3\xe4\x93\x02\x43\x1a//api/v1/compute-resources/{compute_resource_id}:\x10\x63ompute_resource\x12\xa8\x01\n\x15\x44\x65leteComputeResource\x12>.org.apache.airavata.api.resource.DeleteComputeResourceRequest\x1a\x16.google.protobuf.Empty\"7\x82\xd3\xe4\x93\x02\x31*//api/v1/compute-resources/{compute_resource_id}\x12\xd0\x01\n\x1aGetAllComputeResourceNames\x12\x43.org.apache.airavata.api.resource.GetAllComputeResourceNamesRequest\x1a\x44.org.apache.airavata.api.resource.GetAllComputeResourceNamesResponse\"\'\x82\xd3\xe4\x93\x02!\x12\x1f/api/v1/compute-resources:names\x12\xd3\x01\n\x17RegisterStorageResource\x12@.org.apache.airavata.api.resource.RegisterStorageResourceRequest\x1a\x41.org.apache.airavata.api.resource.RegisterStorageResourceResponse\"3\x82\xd3\xe4\x93\x02-\"\x19/api/v1/storage-resources:\x10storage_resource\x12\xdc\x01\n\x12GetStorageResource\x12;.org.apache.airavata.api.resource.GetStorageResourceRequest\x1aP.org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription\"7\x82\xd3\xe4\x93\x02\x31\x12//api/v1/storage-resources/{storage_resource_id}\x12\xba\x01\n\x15UpdateStorageResource\x12>.org.apache.airavata.api.resource.UpdateStorageResourceRequest\x1a\x16.google.protobuf.Empty\"I\x82\xd3\xe4\x93\x02\x43\x1a//api/v1/storage-resources/{storage_resource_id}:\x10storage_resource\x12\xa8\x01\n\x15\x44\x65leteStorageResource\x12>.org.apache.airavata.api.resource.DeleteStorageResourceRequest\x1a\x16.google.protobuf.Empty\"7\x82\xd3\xe4\x93\x02\x31*//api/v1/storage-resources/{storage_resource_id}\x12\xd0\x01\n\x1aGetAllStorageResourceNames\x12\x43.org.apache.airavata.api.resource.GetAllStorageResourceNamesRequest\x1a\x44.org.apache.airavata.api.resource.GetAllStorageResourceNamesResponse\"\'\x82\xd3\xe4\x93\x02!\x12\x1f/api/v1/storage-resources:names\x12\xb8\x01\n\x10\x44\x65leteBatchQueue\x12\x39.org.apache.airavata.api.resource.DeleteBatchQueueRequest\x1a\x16.google.protobuf.Empty\"Q\x82\xd3\xe4\x93\x02K*I/api/v1/compute-resources/{compute_resource_id}/batch-queues/{queue_name}B$\n org.apache.airavata.api.resourceP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.resource_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n org.apache.airavata.api.resourceP\001' + _globals['_GETALLCOMPUTERESOURCENAMESRESPONSE_COMPUTERESOURCENAMESENTRY']._loaded_options = None + _globals['_GETALLCOMPUTERESOURCENAMESRESPONSE_COMPUTERESOURCENAMESENTRY']._serialized_options = b'8\001' + _globals['_GETALLSTORAGERESOURCENAMESRESPONSE_STORAGERESOURCENAMESENTRY']._loaded_options = None + _globals['_GETALLSTORAGERESOURCENAMESRESPONSE_STORAGERESOURCENAMESENTRY']._serialized_options = b'8\001' + _globals['_RESOURCESERVICE'].methods_by_name['RegisterComputeResource']._loaded_options = None + _globals['_RESOURCESERVICE'].methods_by_name['RegisterComputeResource']._serialized_options = b'\202\323\344\223\002-\"\031/api/v1/compute-resources:\020compute_resource' + _globals['_RESOURCESERVICE'].methods_by_name['GetComputeResource']._loaded_options = None + _globals['_RESOURCESERVICE'].methods_by_name['GetComputeResource']._serialized_options = b'\202\323\344\223\0021\022//api/v1/compute-resources/{compute_resource_id}' + _globals['_RESOURCESERVICE'].methods_by_name['UpdateComputeResource']._loaded_options = None + _globals['_RESOURCESERVICE'].methods_by_name['UpdateComputeResource']._serialized_options = b'\202\323\344\223\002C\032//api/v1/compute-resources/{compute_resource_id}:\020compute_resource' + _globals['_RESOURCESERVICE'].methods_by_name['DeleteComputeResource']._loaded_options = None + _globals['_RESOURCESERVICE'].methods_by_name['DeleteComputeResource']._serialized_options = b'\202\323\344\223\0021*//api/v1/compute-resources/{compute_resource_id}' + _globals['_RESOURCESERVICE'].methods_by_name['GetAllComputeResourceNames']._loaded_options = None + _globals['_RESOURCESERVICE'].methods_by_name['GetAllComputeResourceNames']._serialized_options = b'\202\323\344\223\002!\022\037/api/v1/compute-resources:names' + _globals['_RESOURCESERVICE'].methods_by_name['RegisterStorageResource']._loaded_options = None + _globals['_RESOURCESERVICE'].methods_by_name['RegisterStorageResource']._serialized_options = b'\202\323\344\223\002-\"\031/api/v1/storage-resources:\020storage_resource' + _globals['_RESOURCESERVICE'].methods_by_name['GetStorageResource']._loaded_options = None + _globals['_RESOURCESERVICE'].methods_by_name['GetStorageResource']._serialized_options = b'\202\323\344\223\0021\022//api/v1/storage-resources/{storage_resource_id}' + _globals['_RESOURCESERVICE'].methods_by_name['UpdateStorageResource']._loaded_options = None + _globals['_RESOURCESERVICE'].methods_by_name['UpdateStorageResource']._serialized_options = b'\202\323\344\223\002C\032//api/v1/storage-resources/{storage_resource_id}:\020storage_resource' + _globals['_RESOURCESERVICE'].methods_by_name['DeleteStorageResource']._loaded_options = None + _globals['_RESOURCESERVICE'].methods_by_name['DeleteStorageResource']._serialized_options = b'\202\323\344\223\0021*//api/v1/storage-resources/{storage_resource_id}' + _globals['_RESOURCESERVICE'].methods_by_name['GetAllStorageResourceNames']._loaded_options = None + _globals['_RESOURCESERVICE'].methods_by_name['GetAllStorageResourceNames']._serialized_options = b'\202\323\344\223\002!\022\037/api/v1/storage-resources:names' + _globals['_RESOURCESERVICE'].methods_by_name['DeleteBatchQueue']._loaded_options = None + _globals['_RESOURCESERVICE'].methods_by_name['DeleteBatchQueue']._serialized_options = b'\202\323\344\223\002K*I/api/v1/compute-resources/{compute_resource_id}/batch-queues/{queue_name}' + _globals['_REGISTERCOMPUTERESOURCEREQUEST']._serialized_start=283 + _globals['_REGISTERCOMPUTERESOURCEREQUEST']._serialized_end=423 + _globals['_REGISTERCOMPUTERESOURCERESPONSE']._serialized_start=425 + _globals['_REGISTERCOMPUTERESOURCERESPONSE']._serialized_end=487 + _globals['_GETCOMPUTERESOURCEREQUEST']._serialized_start=489 + _globals['_GETCOMPUTERESOURCEREQUEST']._serialized_end=545 + _globals['_UPDATECOMPUTERESOURCEREQUEST']._serialized_start=548 + _globals['_UPDATECOMPUTERESOURCEREQUEST']._serialized_end=715 + _globals['_DELETECOMPUTERESOURCEREQUEST']._serialized_start=717 + _globals['_DELETECOMPUTERESOURCEREQUEST']._serialized_end=776 + _globals['_GETALLCOMPUTERESOURCENAMESREQUEST']._serialized_start=778 + _globals['_GETALLCOMPUTERESOURCENAMESREQUEST']._serialized_end=813 + _globals['_GETALLCOMPUTERESOURCENAMESRESPONSE']._serialized_start=816 + _globals['_GETALLCOMPUTERESOURCENAMESRESPONSE']._serialized_end=1041 + _globals['_GETALLCOMPUTERESOURCENAMESRESPONSE_COMPUTERESOURCENAMESENTRY']._serialized_start=982 + _globals['_GETALLCOMPUTERESOURCENAMESRESPONSE_COMPUTERESOURCENAMESENTRY']._serialized_end=1041 + _globals['_REGISTERSTORAGERESOURCEREQUEST']._serialized_start=1044 + _globals['_REGISTERSTORAGERESOURCEREQUEST']._serialized_end=1184 + _globals['_REGISTERSTORAGERESOURCERESPONSE']._serialized_start=1186 + _globals['_REGISTERSTORAGERESOURCERESPONSE']._serialized_end=1248 + _globals['_GETSTORAGERESOURCEREQUEST']._serialized_start=1250 + _globals['_GETSTORAGERESOURCEREQUEST']._serialized_end=1306 + _globals['_UPDATESTORAGERESOURCEREQUEST']._serialized_start=1309 + _globals['_UPDATESTORAGERESOURCEREQUEST']._serialized_end=1476 + _globals['_DELETESTORAGERESOURCEREQUEST']._serialized_start=1478 + _globals['_DELETESTORAGERESOURCEREQUEST']._serialized_end=1537 + _globals['_GETALLSTORAGERESOURCENAMESREQUEST']._serialized_start=1539 + _globals['_GETALLSTORAGERESOURCENAMESREQUEST']._serialized_end=1574 + _globals['_GETALLSTORAGERESOURCENAMESRESPONSE']._serialized_start=1577 + _globals['_GETALLSTORAGERESOURCENAMESRESPONSE']._serialized_end=1802 + _globals['_GETALLSTORAGERESOURCENAMESRESPONSE_STORAGERESOURCENAMESENTRY']._serialized_start=1743 + _globals['_GETALLSTORAGERESOURCENAMESRESPONSE_STORAGERESOURCENAMESENTRY']._serialized_end=1802 + _globals['_DELETEBATCHQUEUEREQUEST']._serialized_start=1804 + _globals['_DELETEBATCHQUEUEREQUEST']._serialized_end=1878 + _globals['_RESOURCESERVICE']._serialized_start=1881 + _globals['_RESOURCESERVICE']._serialized_end=4101 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata/services/resource_service_pb2.pyi b/airavata-python-sdk/airavata/services/resource_service_pb2.pyi new file mode 100644 index 00000000000..db601f7e04e --- /dev/null +++ b/airavata-python-sdk/airavata/services/resource_service_pb2.pyi @@ -0,0 +1,117 @@ +from google.api import annotations_pb2 as _annotations_pb2 +from google.protobuf import empty_pb2 as _empty_pb2 +from airavata.model.appcatalog.computeresource import compute_resource_pb2 as _compute_resource_pb2 +from airavata.model.appcatalog.storageresource import storage_resource_pb2 as _storage_resource_pb2 +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from collections.abc import Mapping as _Mapping +from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class RegisterComputeResourceRequest(_message.Message): + __slots__ = ("compute_resource",) + COMPUTE_RESOURCE_FIELD_NUMBER: _ClassVar[int] + compute_resource: _compute_resource_pb2.ComputeResourceDescription + def __init__(self, compute_resource: _Optional[_Union[_compute_resource_pb2.ComputeResourceDescription, _Mapping]] = ...) -> None: ... + +class RegisterComputeResourceResponse(_message.Message): + __slots__ = ("compute_resource_id",) + COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + compute_resource_id: str + def __init__(self, compute_resource_id: _Optional[str] = ...) -> None: ... + +class GetComputeResourceRequest(_message.Message): + __slots__ = ("compute_resource_id",) + COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + compute_resource_id: str + def __init__(self, compute_resource_id: _Optional[str] = ...) -> None: ... + +class UpdateComputeResourceRequest(_message.Message): + __slots__ = ("compute_resource_id", "compute_resource") + COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + COMPUTE_RESOURCE_FIELD_NUMBER: _ClassVar[int] + compute_resource_id: str + compute_resource: _compute_resource_pb2.ComputeResourceDescription + def __init__(self, compute_resource_id: _Optional[str] = ..., compute_resource: _Optional[_Union[_compute_resource_pb2.ComputeResourceDescription, _Mapping]] = ...) -> None: ... + +class DeleteComputeResourceRequest(_message.Message): + __slots__ = ("compute_resource_id",) + COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + compute_resource_id: str + def __init__(self, compute_resource_id: _Optional[str] = ...) -> None: ... + +class GetAllComputeResourceNamesRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class GetAllComputeResourceNamesResponse(_message.Message): + __slots__ = ("compute_resource_names",) + class ComputeResourceNamesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: str + def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... + COMPUTE_RESOURCE_NAMES_FIELD_NUMBER: _ClassVar[int] + compute_resource_names: _containers.ScalarMap[str, str] + def __init__(self, compute_resource_names: _Optional[_Mapping[str, str]] = ...) -> None: ... + +class RegisterStorageResourceRequest(_message.Message): + __slots__ = ("storage_resource",) + STORAGE_RESOURCE_FIELD_NUMBER: _ClassVar[int] + storage_resource: _storage_resource_pb2.StorageResourceDescription + def __init__(self, storage_resource: _Optional[_Union[_storage_resource_pb2.StorageResourceDescription, _Mapping]] = ...) -> None: ... + +class RegisterStorageResourceResponse(_message.Message): + __slots__ = ("storage_resource_id",) + STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + storage_resource_id: str + def __init__(self, storage_resource_id: _Optional[str] = ...) -> None: ... + +class GetStorageResourceRequest(_message.Message): + __slots__ = ("storage_resource_id",) + STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + storage_resource_id: str + def __init__(self, storage_resource_id: _Optional[str] = ...) -> None: ... + +class UpdateStorageResourceRequest(_message.Message): + __slots__ = ("storage_resource_id", "storage_resource") + STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + STORAGE_RESOURCE_FIELD_NUMBER: _ClassVar[int] + storage_resource_id: str + storage_resource: _storage_resource_pb2.StorageResourceDescription + def __init__(self, storage_resource_id: _Optional[str] = ..., storage_resource: _Optional[_Union[_storage_resource_pb2.StorageResourceDescription, _Mapping]] = ...) -> None: ... + +class DeleteStorageResourceRequest(_message.Message): + __slots__ = ("storage_resource_id",) + STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + storage_resource_id: str + def __init__(self, storage_resource_id: _Optional[str] = ...) -> None: ... + +class GetAllStorageResourceNamesRequest(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + +class GetAllStorageResourceNamesResponse(_message.Message): + __slots__ = ("storage_resource_names",) + class StorageResourceNamesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: str + def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... + STORAGE_RESOURCE_NAMES_FIELD_NUMBER: _ClassVar[int] + storage_resource_names: _containers.ScalarMap[str, str] + def __init__(self, storage_resource_names: _Optional[_Mapping[str, str]] = ...) -> None: ... + +class DeleteBatchQueueRequest(_message.Message): + __slots__ = ("compute_resource_id", "queue_name") + COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + QUEUE_NAME_FIELD_NUMBER: _ClassVar[int] + compute_resource_id: str + queue_name: str + def __init__(self, compute_resource_id: _Optional[str] = ..., queue_name: _Optional[str] = ...) -> None: ... diff --git a/airavata-python-sdk/airavata/services/resource_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/resource_service_pb2_grpc.py new file mode 100644 index 00000000000..2a924c92f34 --- /dev/null +++ b/airavata-python-sdk/airavata/services/resource_service_pb2_grpc.py @@ -0,0 +1,542 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.appcatalog.computeresource import compute_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2 +from airavata.model.appcatalog.storageresource import storage_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_storageresource_dot_storage__resource__pb2 +from airavata.services import resource_service_pb2 as services_dot_resource__service__pb2 + +GRPC_GENERATED_VERSION = '1.80.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in services/resource_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class ResourceServiceStub(object): + """ResourceService provides RPCs for managing compute resources, storage resources, + and batch queues. Transport is always SSH (compute) / SFTP (storage), read off the resource. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.RegisterComputeResource = channel.unary_unary( + '/org.apache.airavata.api.resource.ResourceService/RegisterComputeResource', + request_serializer=services_dot_resource__service__pb2.RegisterComputeResourceRequest.SerializeToString, + response_deserializer=services_dot_resource__service__pb2.RegisterComputeResourceResponse.FromString, + _registered_method=True) + self.GetComputeResource = channel.unary_unary( + '/org.apache.airavata.api.resource.ResourceService/GetComputeResource', + request_serializer=services_dot_resource__service__pb2.GetComputeResourceRequest.SerializeToString, + response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.ComputeResourceDescription.FromString, + _registered_method=True) + self.UpdateComputeResource = channel.unary_unary( + '/org.apache.airavata.api.resource.ResourceService/UpdateComputeResource', + request_serializer=services_dot_resource__service__pb2.UpdateComputeResourceRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.DeleteComputeResource = channel.unary_unary( + '/org.apache.airavata.api.resource.ResourceService/DeleteComputeResource', + request_serializer=services_dot_resource__service__pb2.DeleteComputeResourceRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.GetAllComputeResourceNames = channel.unary_unary( + '/org.apache.airavata.api.resource.ResourceService/GetAllComputeResourceNames', + request_serializer=services_dot_resource__service__pb2.GetAllComputeResourceNamesRequest.SerializeToString, + response_deserializer=services_dot_resource__service__pb2.GetAllComputeResourceNamesResponse.FromString, + _registered_method=True) + self.RegisterStorageResource = channel.unary_unary( + '/org.apache.airavata.api.resource.ResourceService/RegisterStorageResource', + request_serializer=services_dot_resource__service__pb2.RegisterStorageResourceRequest.SerializeToString, + response_deserializer=services_dot_resource__service__pb2.RegisterStorageResourceResponse.FromString, + _registered_method=True) + self.GetStorageResource = channel.unary_unary( + '/org.apache.airavata.api.resource.ResourceService/GetStorageResource', + request_serializer=services_dot_resource__service__pb2.GetStorageResourceRequest.SerializeToString, + response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_storageresource_dot_storage__resource__pb2.StorageResourceDescription.FromString, + _registered_method=True) + self.UpdateStorageResource = channel.unary_unary( + '/org.apache.airavata.api.resource.ResourceService/UpdateStorageResource', + request_serializer=services_dot_resource__service__pb2.UpdateStorageResourceRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.DeleteStorageResource = channel.unary_unary( + '/org.apache.airavata.api.resource.ResourceService/DeleteStorageResource', + request_serializer=services_dot_resource__service__pb2.DeleteStorageResourceRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.GetAllStorageResourceNames = channel.unary_unary( + '/org.apache.airavata.api.resource.ResourceService/GetAllStorageResourceNames', + request_serializer=services_dot_resource__service__pb2.GetAllStorageResourceNamesRequest.SerializeToString, + response_deserializer=services_dot_resource__service__pb2.GetAllStorageResourceNamesResponse.FromString, + _registered_method=True) + self.DeleteBatchQueue = channel.unary_unary( + '/org.apache.airavata.api.resource.ResourceService/DeleteBatchQueue', + request_serializer=services_dot_resource__service__pb2.DeleteBatchQueueRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + + +class ResourceServiceServicer(object): + """ResourceService provides RPCs for managing compute resources, storage resources, + and batch queues. Transport is always SSH (compute) / SFTP (storage), read off the resource. + """ + + def RegisterComputeResource(self, request, context): + """--- Compute Resources --- + + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetComputeResource(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateComputeResource(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteComputeResource(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetAllComputeResourceNames(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RegisterStorageResource(self, request, context): + """--- Storage Resources --- + + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetStorageResource(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateStorageResource(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteStorageResource(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetAllStorageResourceNames(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteBatchQueue(self, request, context): + """--- Batch Queue --- + + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_ResourceServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'RegisterComputeResource': grpc.unary_unary_rpc_method_handler( + servicer.RegisterComputeResource, + request_deserializer=services_dot_resource__service__pb2.RegisterComputeResourceRequest.FromString, + response_serializer=services_dot_resource__service__pb2.RegisterComputeResourceResponse.SerializeToString, + ), + 'GetComputeResource': grpc.unary_unary_rpc_method_handler( + servicer.GetComputeResource, + request_deserializer=services_dot_resource__service__pb2.GetComputeResourceRequest.FromString, + response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.ComputeResourceDescription.SerializeToString, + ), + 'UpdateComputeResource': grpc.unary_unary_rpc_method_handler( + servicer.UpdateComputeResource, + request_deserializer=services_dot_resource__service__pb2.UpdateComputeResourceRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'DeleteComputeResource': grpc.unary_unary_rpc_method_handler( + servicer.DeleteComputeResource, + request_deserializer=services_dot_resource__service__pb2.DeleteComputeResourceRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'GetAllComputeResourceNames': grpc.unary_unary_rpc_method_handler( + servicer.GetAllComputeResourceNames, + request_deserializer=services_dot_resource__service__pb2.GetAllComputeResourceNamesRequest.FromString, + response_serializer=services_dot_resource__service__pb2.GetAllComputeResourceNamesResponse.SerializeToString, + ), + 'RegisterStorageResource': grpc.unary_unary_rpc_method_handler( + servicer.RegisterStorageResource, + request_deserializer=services_dot_resource__service__pb2.RegisterStorageResourceRequest.FromString, + response_serializer=services_dot_resource__service__pb2.RegisterStorageResourceResponse.SerializeToString, + ), + 'GetStorageResource': grpc.unary_unary_rpc_method_handler( + servicer.GetStorageResource, + request_deserializer=services_dot_resource__service__pb2.GetStorageResourceRequest.FromString, + response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_storageresource_dot_storage__resource__pb2.StorageResourceDescription.SerializeToString, + ), + 'UpdateStorageResource': grpc.unary_unary_rpc_method_handler( + servicer.UpdateStorageResource, + request_deserializer=services_dot_resource__service__pb2.UpdateStorageResourceRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'DeleteStorageResource': grpc.unary_unary_rpc_method_handler( + servicer.DeleteStorageResource, + request_deserializer=services_dot_resource__service__pb2.DeleteStorageResourceRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'GetAllStorageResourceNames': grpc.unary_unary_rpc_method_handler( + servicer.GetAllStorageResourceNames, + request_deserializer=services_dot_resource__service__pb2.GetAllStorageResourceNamesRequest.FromString, + response_serializer=services_dot_resource__service__pb2.GetAllStorageResourceNamesResponse.SerializeToString, + ), + 'DeleteBatchQueue': grpc.unary_unary_rpc_method_handler( + servicer.DeleteBatchQueue, + request_deserializer=services_dot_resource__service__pb2.DeleteBatchQueueRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'org.apache.airavata.api.resource.ResourceService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('org.apache.airavata.api.resource.ResourceService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class ResourceService(object): + """ResourceService provides RPCs for managing compute resources, storage resources, + and batch queues. Transport is always SSH (compute) / SFTP (storage), read off the resource. + """ + + @staticmethod + def RegisterComputeResource(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.resource.ResourceService/RegisterComputeResource', + services_dot_resource__service__pb2.RegisterComputeResourceRequest.SerializeToString, + services_dot_resource__service__pb2.RegisterComputeResourceResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetComputeResource(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.resource.ResourceService/GetComputeResource', + services_dot_resource__service__pb2.GetComputeResourceRequest.SerializeToString, + org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.ComputeResourceDescription.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateComputeResource(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.resource.ResourceService/UpdateComputeResource', + services_dot_resource__service__pb2.UpdateComputeResourceRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteComputeResource(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.resource.ResourceService/DeleteComputeResource', + services_dot_resource__service__pb2.DeleteComputeResourceRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetAllComputeResourceNames(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.resource.ResourceService/GetAllComputeResourceNames', + services_dot_resource__service__pb2.GetAllComputeResourceNamesRequest.SerializeToString, + services_dot_resource__service__pb2.GetAllComputeResourceNamesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def RegisterStorageResource(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.resource.ResourceService/RegisterStorageResource', + services_dot_resource__service__pb2.RegisterStorageResourceRequest.SerializeToString, + services_dot_resource__service__pb2.RegisterStorageResourceResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetStorageResource(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.resource.ResourceService/GetStorageResource', + services_dot_resource__service__pb2.GetStorageResourceRequest.SerializeToString, + org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_storageresource_dot_storage__resource__pb2.StorageResourceDescription.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateStorageResource(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.resource.ResourceService/UpdateStorageResource', + services_dot_resource__service__pb2.UpdateStorageResourceRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteStorageResource(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.resource.ResourceService/DeleteStorageResource', + services_dot_resource__service__pb2.DeleteStorageResourceRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetAllStorageResourceNames(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.resource.ResourceService/GetAllStorageResourceNames', + services_dot_resource__service__pb2.GetAllStorageResourceNamesRequest.SerializeToString, + services_dot_resource__service__pb2.GetAllStorageResourceNamesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteBatchQueue(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.resource.ResourceService/DeleteBatchQueue', + services_dot_resource__service__pb2.DeleteBatchQueueRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/airavata-python-sdk/airavata/services/sharing_service_pb2.py b/airavata-python-sdk/airavata/services/sharing_service_pb2.py new file mode 100644 index 00000000000..273e08e6792 --- /dev/null +++ b/airavata-python-sdk/airavata/services/sharing_service_pb2.py @@ -0,0 +1,406 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/sharing_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/sharing_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.sharing import sharing_pb2 as org_dot_apache_dot_airavata_dot_model_dot_sharing_dot_sharing__pb2 +from airavata.model.user import user_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_user_dot_user__profile__pb2 +from airavata.services import group_manager_service_pb2 as services_dot_group__manager__service__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1eservices/sharing_service.proto\x12#org.apache.airavata.api.iam.sharing\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a/org/apache/airavata/model/sharing/sharing.proto\x1a\x31org/apache/airavata/model/user/user_profile.proto\x1a$services/group_manager_service.proto\"\xdf\x01\n\x1dShareResourceWithUsersRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12q\n\x10user_permissions\x18\x02 \x03(\x0b\x32W.org.apache.airavata.api.iam.sharing.ShareResourceWithUsersRequest.UserPermissionsEntry\x1a\x36\n\x14UserPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe4\x01\n\x1eShareResourceWithGroupsRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12t\n\x11group_permissions\x18\x02 \x03(\x0b\x32Y.org.apache.airavata.api.iam.sharing.ShareResourceWithGroupsRequest.GroupPermissionsEntry\x1a\x37\n\x15GroupPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd1\x01\n\x16RevokeFromUsersRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12j\n\x10user_permissions\x18\x02 \x03(\x0b\x32P.org.apache.airavata.api.iam.sharing.RevokeFromUsersRequest.UserPermissionsEntry\x1a\x36\n\x14UserPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd6\x01\n\x17RevokeFromGroupsRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12m\n\x11group_permissions\x18\x02 \x03(\x0b\x32R.org.apache.airavata.api.iam.sharing.RevokeFromGroupsRequest.GroupPermissionsEntry\x1a\x37\n\x15GroupPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"L\n\x1cGetAllAccessibleUsersRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12\x17\n\x0fpermission_type\x18\x02 \x01(\t\"1\n\x1dGetAllAccessibleUsersResponse\x12\x10\n\x08user_ids\x18\x01 \x03(\t\"T\n$GetAllDirectlyAccessibleUsersRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12\x17\n\x0fpermission_type\x18\x02 \x01(\t\"9\n%GetAllDirectlyAccessibleUsersResponse\x12\x10\n\x08user_ids\x18\x01 \x03(\t\"M\n\x1dGetAllAccessibleGroupsRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12\x17\n\x0fpermission_type\x18\x02 \x01(\t\"3\n\x1eGetAllAccessibleGroupsResponse\x12\x11\n\tgroup_ids\x18\x01 \x03(\t\"U\n%GetAllDirectlyAccessibleGroupsRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12\x17\n\x0fpermission_type\x18\x02 \x01(\t\";\n&GetAllDirectlyAccessibleGroupsResponse\x12\x11\n\tgroup_ids\x18\x01 \x03(\t\"U\n\x14UserHasAccessRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\x12\x17\n\x0fpermission_type\x18\x03 \x01(\t\"+\n\x15UserHasAccessResponse\x12\x12\n\nhas_access\x18\x01 \x01(\x08\"d\n\x0eUserPermission\x12\x39\n\x04user\x18\x01 \x01(\x0b\x32+.org.apache.airavata.model.user.UserProfile\x12\x17\n\x0fpermission_type\x18\x02 \x01(\t\"t\n\x0fGroupPermission\x12H\n\x05group\x18\x01 \x01(\x0b\x32\x39.org.apache.airavata.api.iam.groupmanager.GroupWithAccess\x12\x17\n\x0fpermission_type\x18\x02 \x01(\t\"\xaf\x02\n\x0cSharedEntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12:\n\x05owner\x18\x02 \x01(\x0b\x32+.org.apache.airavata.model.user.UserProfile\x12M\n\x10user_permissions\x18\x03 \x03(\x0b\x32\x33.org.apache.airavata.api.iam.sharing.UserPermission\x12O\n\x11group_permissions\x18\x04 \x03(\x0b\x32\x34.org.apache.airavata.api.iam.sharing.GroupPermission\x12\x10\n\x08is_owner\x18\x05 \x01(\x08\x12\x1e\n\x16has_sharing_permission\x18\x06 \x01(\x08\"+\n\x16GetSharedEntityRequest\x12\x11\n\tentity_id\x18\x01 \x01(\t\"\xfb\x02\n\x17SetEntitySharingRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12k\n\x10user_permissions\x18\x02 \x03(\x0b\x32Q.org.apache.airavata.api.iam.sharing.SetEntitySharingRequest.UserPermissionsEntry\x12m\n\x11group_permissions\x18\x03 \x03(\x0b\x32R.org.apache.airavata.api.iam.sharing.SetEntitySharingRequest.GroupPermissionsEntry\x1a\x36\n\x14UserPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x37\n\x15GroupPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Z\n\x13\x43reateDomainRequest\x12\x43\n\x06\x64omain\x18\x01 \x01(\x0b\x32\x33.org.apache.airavata.sharing.registry.models.Domain\")\n\x14\x43reateDomainResponse\x12\x11\n\tdomain_id\x18\x01 \x01(\t\"Z\n\x13UpdateDomainRequest\x12\x43\n\x06\x64omain\x18\x01 \x01(\x0b\x32\x33.org.apache.airavata.sharing.registry.models.Domain\"*\n\x15IsDomainExistsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\"(\n\x16IsDomainExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"(\n\x13\x44\x65leteDomainRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\"%\n\x10GetDomainRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\"2\n\x11GetDomainsRequest\x12\x0e\n\x06offset\x18\x01 \x01(\x05\x12\r\n\x05limit\x18\x02 \x01(\x05\"Z\n\x12GetDomainsResponse\x12\x44\n\x07\x64omains\x18\x01 \x03(\x0b\x32\x33.org.apache.airavata.sharing.registry.models.Domain\"T\n\x11\x43reateUserRequest\x12?\n\x04user\x18\x01 \x01(\x0b\x32\x31.org.apache.airavata.sharing.registry.models.User\"%\n\x12\x43reateUserResponse\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"T\n\x11UpdateUserRequest\x12?\n\x04user\x18\x01 \x01(\x0b\x32\x31.org.apache.airavata.sharing.registry.models.User\"9\n\x13IsUserExistsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\"&\n\x14IsUserExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"7\n\x11\x44\x65leteUserRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\"4\n\x0eGetUserRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\"C\n\x0fGetUsersRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\r\n\x05limit\x18\x03 \x01(\x05\"T\n\x10GetUsersResponse\x12@\n\x05users\x18\x01 \x03(\x0b\x32\x31.org.apache.airavata.sharing.registry.models.User\"[\n\x12\x43reateGroupRequest\x12\x45\n\x05group\x18\x01 \x01(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\"\'\n\x13\x43reateGroupResponse\x12\x10\n\x08group_id\x18\x01 \x01(\t\"[\n\x12UpdateGroupRequest\x12\x45\n\x05group\x18\x01 \x01(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\";\n\x14IsGroupExistsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\"\'\n\x15IsGroupExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"9\n\x12\x44\x65leteGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\"6\n\x0fGetGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\"D\n\x10GetGroupsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\r\n\x05limit\x18\x03 \x01(\x05\"[\n\x11GetGroupsResponse\x12\x46\n\x06groups\x18\x01 \x03(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\"O\n\x16\x41\x64\x64UsersToGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08user_ids\x18\x02 \x03(\t\x12\x10\n\x08group_id\x18\x03 \x01(\t\"T\n\x1bRemoveUsersFromGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08user_ids\x18\x02 \x03(\t\x12\x10\n\x08group_id\x18\x03 \x01(\t\"Z\n\x1dTransferGroupOwnershipRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x14\n\x0cnew_owner_id\x18\x03 \x01(\t\"O\n\x15\x41\x64\x64GroupAdminsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x11\n\tadmin_ids\x18\x03 \x03(\t\"R\n\x18RemoveGroupAdminsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x11\n\tadmin_ids\x18\x03 \x03(\t\"N\n\x15HasAdminAccessRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x10\n\x08\x61\x64min_id\x18\x03 \x01(\t\",\n\x16HasAdminAccessResponse\x12\x12\n\nhas_access\x18\x01 \x01(\x08\"N\n\x15HasOwnerAccessRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x10\n\x08owner_id\x18\x03 \x01(\t\",\n\x16HasOwnerAccessResponse\x12\x12\n\nhas_access\x18\x01 \x01(\x08\"f\n GetGroupMembersOfTypeUserRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x0e\n\x06offset\x18\x03 \x01(\x05\x12\r\n\x05limit\x18\x04 \x01(\x05\"e\n!GetGroupMembersOfTypeUserResponse\x12@\n\x05users\x18\x01 \x03(\x0b\x32\x31.org.apache.airavata.sharing.registry.models.User\"g\n!GetGroupMembersOfTypeGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x0e\n\x06offset\x18\x03 \x01(\x05\x12\r\n\x05limit\x18\x04 \x01(\x05\"l\n\"GetGroupMembersOfTypeGroupResponse\x12\x46\n\x06groups\x18\x01 \x03(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\"\\\n\"AddChildGroupsToParentGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tchild_ids\x18\x02 \x03(\t\x12\x10\n\x08group_id\x18\x03 \x01(\t\"_\n&RemoveChildGroupFromParentGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08\x63hild_id\x18\x02 \x01(\t\x12\x10\n\x08group_id\x18\x03 \x01(\t\"F\n GetAllMemberGroupsForUserRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\"k\n!GetAllMemberGroupsForUserResponse\x12\x46\n\x06groups\x18\x01 \x03(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\"g\n\x17\x43reateEntityTypeRequest\x12L\n\x0b\x65ntity_type\x18\x01 \x01(\x0b\x32\x37.org.apache.airavata.sharing.registry.models.EntityType\"2\n\x18\x43reateEntityTypeResponse\x12\x16\n\x0e\x65ntity_type_id\x18\x01 \x01(\t\"g\n\x17UpdateEntityTypeRequest\x12L\n\x0b\x65ntity_type\x18\x01 \x01(\x0b\x32\x37.org.apache.airavata.sharing.registry.models.EntityType\"F\n\x19IsEntityTypeExistsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x16\n\x0e\x65ntity_type_id\x18\x02 \x01(\t\",\n\x1aIsEntityTypeExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"D\n\x17\x44\x65leteEntityTypeRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x16\n\x0e\x65ntity_type_id\x18\x02 \x01(\t\"A\n\x14GetEntityTypeRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x16\n\x0e\x65ntity_type_id\x18\x02 \x01(\t\"I\n\x15GetEntityTypesRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\r\n\x05limit\x18\x03 \x01(\x05\"g\n\x16GetEntityTypesResponse\x12M\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32\x37.org.apache.airavata.sharing.registry.models.EntityType\"Z\n\x13\x43reateEntityRequest\x12\x43\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x33.org.apache.airavata.sharing.registry.models.Entity\")\n\x14\x43reateEntityResponse\x12\x11\n\tentity_id\x18\x01 \x01(\t\"Z\n\x13UpdateEntityRequest\x12\x43\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x33.org.apache.airavata.sharing.registry.models.Entity\"=\n\x15IsEntityExistsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\"(\n\x16IsEntityExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\";\n\x13\x44\x65leteEntityRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\"8\n\x10GetEntityRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\"\xa8\x01\n\x15SearchEntitiesRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\x12L\n\x07\x66ilters\x18\x03 \x03(\x0b\x32;.org.apache.airavata.sharing.registry.models.SearchCriteria\x12\x0e\n\x06offset\x18\x04 \x01(\x05\x12\r\n\x05limit\x18\x05 \x01(\x05\"_\n\x16SearchEntitiesResponse\x12\x45\n\x08\x65ntities\x18\x01 \x03(\x0b\x32\x33.org.apache.airavata.sharing.registry.models.Entity\"_\n\x1bGetListOfSharedUsersRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x1a\n\x12permission_type_id\x18\x03 \x01(\t\"`\n\x1cGetListOfSharedUsersResponse\x12@\n\x05users\x18\x01 \x03(\x0b\x32\x31.org.apache.airavata.sharing.registry.models.User\"g\n#GetListOfDirectlySharedUsersRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x1a\n\x12permission_type_id\x18\x03 \x01(\t\"h\n$GetListOfDirectlySharedUsersResponse\x12@\n\x05users\x18\x01 \x03(\x0b\x32\x31.org.apache.airavata.sharing.registry.models.User\"`\n\x1cGetListOfSharedGroupsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x1a\n\x12permission_type_id\x18\x03 \x01(\t\"g\n\x1dGetListOfSharedGroupsResponse\x12\x46\n\x06groups\x18\x01 \x03(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\"h\n$GetListOfDirectlySharedGroupsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x1a\n\x12permission_type_id\x18\x03 \x01(\t\"o\n%GetListOfDirectlySharedGroupsResponse\x12\x46\n\x06groups\x18\x01 \x03(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\"s\n\x1b\x43reatePermissionTypeRequest\x12T\n\x0fpermission_type\x18\x01 \x01(\x0b\x32;.org.apache.airavata.sharing.registry.models.PermissionType\":\n\x1c\x43reatePermissionTypeResponse\x12\x1a\n\x12permission_type_id\x18\x01 \x01(\t\"s\n\x1bUpdatePermissionTypeRequest\x12T\n\x0fpermission_type\x18\x01 \x01(\x0b\x32;.org.apache.airavata.sharing.registry.models.PermissionType\"E\n\x19IsPermissionExistsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x15\n\rpermission_id\x18\x02 \x01(\t\",\n\x1aIsPermissionExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"L\n\x1b\x44\x65letePermissionTypeRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x1a\n\x12permission_type_id\x18\x02 \x01(\t\"I\n\x18GetPermissionTypeRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x1a\n\x12permission_type_id\x18\x02 \x01(\t\"M\n\x19GetPermissionTypesRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\r\n\x05limit\x18\x03 \x01(\x05\"s\n\x1aGetPermissionTypesResponse\x12U\n\x10permission_types\x18\x01 \x03(\x0b\x32;.org.apache.airavata.sharing.registry.models.PermissionType\"\x8e\x01\n\x1bShareEntityWithUsersRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x11\n\tuser_list\x18\x03 \x03(\t\x12\x1a\n\x12permission_type_id\x18\x04 \x01(\t\x12\x1a\n\x12\x63\x61scade_permission\x18\x05 \x01(\x08\"z\n#RevokeEntitySharingFromUsersRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x11\n\tuser_list\x18\x03 \x03(\t\x12\x1a\n\x12permission_type_id\x18\x04 \x01(\t\"\x90\x01\n\x1cShareEntityWithGroupsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x12\n\ngroup_list\x18\x03 \x03(\t\x12\x1a\n\x12permission_type_id\x18\x04 \x01(\t\x12\x1a\n\x12\x63\x61scade_permission\x18\x05 \x01(\x08\"|\n$RevokeEntitySharingFromGroupsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x12\n\ngroup_list\x18\x03 \x03(\t\x12\x1a\n\x12permission_type_id\x18\x04 \x01(\t2\xe6g\n\x0eSharingService\x12\xa4\x01\n\x16ShareResourceWithUsers\x12\x42.org.apache.airavata.api.iam.sharing.ShareResourceWithUsersRequest\x1a\x16.google.protobuf.Empty\".\x82\xd3\xe4\x93\x02(\"#/api/v1/sharing/{resource_id}/users:\x01*\x12\xa7\x01\n\x17ShareResourceWithGroups\x12\x43.org.apache.airavata.api.iam.sharing.ShareResourceWithGroupsRequest\x1a\x16.google.protobuf.Empty\"/\x82\xd3\xe4\x93\x02)\"$/api/v1/sharing/{resource_id}/groups:\x01*\x12\x93\x01\n\x0fRevokeFromUsers\x12;.org.apache.airavata.api.iam.sharing.RevokeFromUsersRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%*#/api/v1/sharing/{resource_id}/users\x12\x96\x01\n\x10RevokeFromGroups\x12<.org.apache.airavata.api.iam.sharing.RevokeFromGroupsRequest\x1a\x16.google.protobuf.Empty\",\x82\xd3\xe4\x93\x02&*$/api/v1/sharing/{resource_id}/groups\x12\xcb\x01\n\x15GetAllAccessibleUsers\x12\x41.org.apache.airavata.api.iam.sharing.GetAllAccessibleUsersRequest\x1a\x42.org.apache.airavata.api.iam.sharing.GetAllAccessibleUsersResponse\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/sharing/{resource_id}/users\x12\xea\x01\n\x1dGetAllDirectlyAccessibleUsers\x12I.org.apache.airavata.api.iam.sharing.GetAllDirectlyAccessibleUsersRequest\x1aJ.org.apache.airavata.api.iam.sharing.GetAllDirectlyAccessibleUsersResponse\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/sharing/{resource_id}/users:direct\x12\xcf\x01\n\x16GetAllAccessibleGroups\x12\x42.org.apache.airavata.api.iam.sharing.GetAllAccessibleGroupsRequest\x1a\x43.org.apache.airavata.api.iam.sharing.GetAllAccessibleGroupsResponse\",\x82\xd3\xe4\x93\x02&\x12$/api/v1/sharing/{resource_id}/groups\x12\xee\x01\n\x1eGetAllDirectlyAccessibleGroups\x12J.org.apache.airavata.api.iam.sharing.GetAllDirectlyAccessibleGroupsRequest\x1aK.org.apache.airavata.api.iam.sharing.GetAllDirectlyAccessibleGroupsResponse\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/sharing/{resource_id}/groups:direct\x12\xc3\x01\n\rUserHasAccess\x12\x39.org.apache.airavata.api.iam.sharing.UserHasAccessRequest\x1a:.org.apache.airavata.api.iam.sharing.UserHasAccessResponse\";\x82\xd3\xe4\x93\x02\x35\x12\x33/api/v1/sharing/{resource_id}/users/{user_id}:check\x12\xb6\x01\n\x0fGetSharedEntity\x12;.org.apache.airavata.api.iam.sharing.GetSharedEntityRequest\x1a\x31.org.apache.airavata.api.iam.sharing.SharedEntity\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/sharing/entities/{entity_id}:shared\x12\xbc\x01\n\x12GetAllSharedEntity\x12;.org.apache.airavata.api.iam.sharing.GetSharedEntityRequest\x1a\x31.org.apache.airavata.api.iam.sharing.SharedEntity\"6\x82\xd3\xe4\x93\x02\x30\x12./api/v1/sharing/entities/{entity_id}:sharedAll\x12\xa7\x01\n\x10SetEntitySharing\x12<.org.apache.airavata.api.iam.sharing.SetEntitySharingRequest\x1a\x16.google.protobuf.Empty\"=\x82\xd3\xe4\x93\x02\x37\"2/api/v1/sharing/entities/{resource_id}/permissions:\x01*\x12\xa7\x01\n\x0c\x43reateDomain\x12\x38.org.apache.airavata.api.iam.sharing.CreateDomainRequest\x1a\x39.org.apache.airavata.api.iam.sharing.CreateDomainResponse\"\"\x82\xd3\xe4\x93\x02\x1c\"\x17/api/v1/sharing/domains:\x01*\x12\x97\x01\n\x0cUpdateDomain\x12\x38.org.apache.airavata.api.iam.sharing.UpdateDomainRequest\x1a\x16.google.protobuf.Empty\"5\x82\xd3\xe4\x93\x02/\x1a*/api/v1/sharing/domains/{domain.domain_id}:\x01*\x12\xbd\x01\n\x0eIsDomainExists\x12:.org.apache.airavata.api.iam.sharing.IsDomainExistsRequest\x1a;.org.apache.airavata.api.iam.sharing.IsDomainExistsResponse\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/sharing/domains/{domain_id}:exists\x12\x8d\x01\n\x0c\x44\x65leteDomain\x12\x38.org.apache.airavata.api.iam.sharing.DeleteDomainRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%*#/api/v1/sharing/domains/{domain_id}\x12\xa4\x01\n\tGetDomain\x12\x35.org.apache.airavata.api.iam.sharing.GetDomainRequest\x1a\x33.org.apache.airavata.sharing.registry.models.Domain\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/sharing/domains/{domain_id}\x12\x9e\x01\n\nGetDomains\x12\x36.org.apache.airavata.api.iam.sharing.GetDomainsRequest\x1a\x37.org.apache.airavata.api.iam.sharing.GetDomainsResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/api/v1/sharing/domains\x12\x9f\x01\n\nCreateUser\x12\x36.org.apache.airavata.api.iam.sharing.CreateUserRequest\x1a\x37.org.apache.airavata.api.iam.sharing.CreateUserResponse\" \x82\xd3\xe4\x93\x02\x1a\"\x15/api/v1/sharing/users:\x01*\x12\x8d\x01\n\nUpdateUser\x12\x36.org.apache.airavata.api.iam.sharing.UpdateUserRequest\x1a\x16.google.protobuf.Empty\"/\x82\xd3\xe4\x93\x02)\x1a$/api/v1/sharing/users/{user.user_id}:\x01*\x12\xc7\x01\n\x0cIsUserExists\x12\x38.org.apache.airavata.api.iam.sharing.IsUserExistsRequest\x1a\x39.org.apache.airavata.api.iam.sharing.IsUserExistsResponse\"B\x82\xd3\xe4\x93\x02<\x12:/api/v1/sharing/domains/{domain_id}/users/{user_id}:exists\x12\x99\x01\n\nDeleteUser\x12\x36.org.apache.airavata.api.iam.sharing.DeleteUserRequest\x1a\x16.google.protobuf.Empty\";\x82\xd3\xe4\x93\x02\x35*3/api/v1/sharing/domains/{domain_id}/users/{user_id}\x12\xae\x01\n\x07GetUser\x12\x33.org.apache.airavata.api.iam.sharing.GetUserRequest\x1a\x31.org.apache.airavata.sharing.registry.models.User\";\x82\xd3\xe4\x93\x02\x35\x12\x33/api/v1/sharing/domains/{domain_id}/users/{user_id}\x12\xaa\x01\n\x08GetUsers\x12\x34.org.apache.airavata.api.iam.sharing.GetUsersRequest\x1a\x35.org.apache.airavata.api.iam.sharing.GetUsersResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/sharing/domains/{domain_id}/users\x12\xa3\x01\n\x0b\x43reateGroup\x12\x37.org.apache.airavata.api.iam.sharing.CreateGroupRequest\x1a\x38.org.apache.airavata.api.iam.sharing.CreateGroupResponse\"!\x82\xd3\xe4\x93\x02\x1b\"\x16/api/v1/sharing/groups:\x01*\x12\x92\x01\n\x0bUpdateGroup\x12\x37.org.apache.airavata.api.iam.sharing.UpdateGroupRequest\x1a\x16.google.protobuf.Empty\"2\x82\xd3\xe4\x93\x02,\x1a\'/api/v1/sharing/groups/{group.group_id}:\x01*\x12\xcc\x01\n\rIsGroupExists\x12\x39.org.apache.airavata.api.iam.sharing.IsGroupExistsRequest\x1a:.org.apache.airavata.api.iam.sharing.IsGroupExistsResponse\"D\x82\xd3\xe4\x93\x02>\x12*/api/v1/sharing/domains/{domain_id}/groups/{group_id}/children:\x01*\x12\xd9\x01\n\x1fRemoveChildGroupFromParentGroup\x12K.org.apache.airavata.api.iam.sharing.RemoveChildGroupFromParentGroupRequest\x1a\x16.google.protobuf.Empty\"Q\x82\xd3\xe4\x93\x02K*I/api/v1/sharing/domains/{domain_id}/groups/{group_id}/children/{child_id}\x12\xee\x01\n\x19GetAllMemberGroupsForUser\x12\x45.org.apache.airavata.api.iam.sharing.GetAllMemberGroupsForUserRequest\x1a\x46.org.apache.airavata.api.iam.sharing.GetAllMemberGroupsForUserResponse\"B\x82\xd3\xe4\x93\x02<\x12:/api/v1/sharing/domains/{domain_id}/users/{user_id}/groups\x12\xb8\x01\n\x10\x43reateEntityType\x12<.org.apache.airavata.api.iam.sharing.CreateEntityTypeRequest\x1a=.org.apache.airavata.api.iam.sharing.CreateEntityTypeResponse\"\'\x82\xd3\xe4\x93\x02!\"\x1c/api/v1/sharing/entity-types:\x01*\x12\xae\x01\n\x10UpdateEntityType\x12<.org.apache.airavata.api.iam.sharing.UpdateEntityTypeRequest\x1a\x16.google.protobuf.Empty\"D\x82\xd3\xe4\x93\x02>\x1a\x39/api/v1/sharing/entity-types/{entity_type.entity_type_id}:\x01*\x12\xe7\x01\n\x12IsEntityTypeExists\x12>.org.apache.airavata.api.iam.sharing.IsEntityTypeExistsRequest\x1a?.org.apache.airavata.api.iam.sharing.IsEntityTypeExistsResponse\"P\x82\xd3\xe4\x93\x02J\x12H/api/v1/sharing/domains/{domain_id}/entity-types/{entity_type_id}:exists\x12\xb3\x01\n\x10\x44\x65leteEntityType\x12<.org.apache.airavata.api.iam.sharing.DeleteEntityTypeRequest\x1a\x16.google.protobuf.Empty\"I\x82\xd3\xe4\x93\x02\x43*A/api/v1/sharing/domains/{domain_id}/entity-types/{entity_type_id}\x12\xce\x01\n\rGetEntityType\x12\x39.org.apache.airavata.api.iam.sharing.GetEntityTypeRequest\x1a\x37.org.apache.airavata.sharing.registry.models.EntityType\"I\x82\xd3\xe4\x93\x02\x43\x12\x41/api/v1/sharing/domains/{domain_id}/entity-types/{entity_type_id}\x12\xc3\x01\n\x0eGetEntityTypes\x12:.org.apache.airavata.api.iam.sharing.GetEntityTypesRequest\x1a;.org.apache.airavata.api.iam.sharing.GetEntityTypesResponse\"8\x82\xd3\xe4\x93\x02\x32\x12\x30/api/v1/sharing/domains/{domain_id}/entity-types\x12\xa8\x01\n\x0c\x43reateEntity\x12\x38.org.apache.airavata.api.iam.sharing.CreateEntityRequest\x1a\x39.org.apache.airavata.api.iam.sharing.CreateEntityResponse\"#\x82\xd3\xe4\x93\x02\x1d\"\x18/api/v1/sharing/entities:\x01*\x12\x98\x01\n\x0cUpdateEntity\x12\x38.org.apache.airavata.api.iam.sharing.UpdateEntityRequest\x1a\x16.google.protobuf.Empty\"6\x82\xd3\xe4\x93\x02\x30\x1a+/api/v1/sharing/entities/{entity.entity_id}:\x01*\x12\xd2\x01\n\x0eIsEntityExists\x12:.org.apache.airavata.api.iam.sharing.IsEntityExistsRequest\x1a;.org.apache.airavata.api.iam.sharing.IsEntityExistsResponse\"G\x82\xd3\xe4\x93\x02\x41\x12?/api/v1/sharing/domains/{domain_id}/entities/{entity_id}:exists\x12\xa2\x01\n\x0c\x44\x65leteEntity\x12\x38.org.apache.airavata.api.iam.sharing.DeleteEntityRequest\x1a\x16.google.protobuf.Empty\"@\x82\xd3\xe4\x93\x02:*8/api/v1/sharing/domains/{domain_id}/entities/{entity_id}\x12\xb9\x01\n\tGetEntity\x12\x35.org.apache.airavata.api.iam.sharing.GetEntityRequest\x1a\x33.org.apache.airavata.sharing.registry.models.Entity\"@\x82\xd3\xe4\x93\x02:\x12\x38/api/v1/sharing/domains/{domain_id}/entities/{entity_id}\x12\xc9\x01\n\x0eSearchEntities\x12:.org.apache.airavata.api.iam.sharing.SearchEntitiesRequest\x1a;.org.apache.airavata.api.iam.sharing.SearchEntitiesResponse\">\x82\xd3\xe4\x93\x02\x38\"3/api/v1/sharing/domains/{domain_id}/entities:search:\x01*\x12\xea\x01\n\x14GetListOfSharedUsers\x12@.org.apache.airavata.api.iam.sharing.GetListOfSharedUsersRequest\x1a\x41.org.apache.airavata.api.iam.sharing.GetListOfSharedUsersResponse\"M\x82\xd3\xe4\x93\x02G\x12\x45/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-users\x12\x89\x02\n\x1cGetListOfDirectlySharedUsers\x12H.org.apache.airavata.api.iam.sharing.GetListOfDirectlySharedUsersRequest\x1aI.org.apache.airavata.api.iam.sharing.GetListOfDirectlySharedUsersResponse\"T\x82\xd3\xe4\x93\x02N\x12L/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-users:direct\x12\xee\x01\n\x15GetListOfSharedGroups\x12\x41.org.apache.airavata.api.iam.sharing.GetListOfSharedGroupsRequest\x1a\x42.org.apache.airavata.api.iam.sharing.GetListOfSharedGroupsResponse\"N\x82\xd3\xe4\x93\x02H\x12\x46/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-groups\x12\x8d\x02\n\x1dGetListOfDirectlySharedGroups\x12I.org.apache.airavata.api.iam.sharing.GetListOfDirectlySharedGroupsRequest\x1aJ.org.apache.airavata.api.iam.sharing.GetListOfDirectlySharedGroupsResponse\"U\x82\xd3\xe4\x93\x02O\x12M/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-groups:direct\x12\xc8\x01\n\x14\x43reatePermissionType\x12@.org.apache.airavata.api.iam.sharing.CreatePermissionTypeRequest\x1a\x41.org.apache.airavata.api.iam.sharing.CreatePermissionTypeResponse\"+\x82\xd3\xe4\x93\x02%\" /api/v1/sharing/permission-types:\x01*\x12\xc2\x01\n\x14UpdatePermissionType\x12@.org.apache.airavata.api.iam.sharing.UpdatePermissionTypeRequest\x1a\x16.google.protobuf.Empty\"P\x82\xd3\xe4\x93\x02J\x1a\x45/api/v1/sharing/permission-types/{permission_type.permission_type_id}:\x01*\x12\xea\x01\n\x12IsPermissionExists\x12>.org.apache.airavata.api.iam.sharing.IsPermissionExistsRequest\x1a?.org.apache.airavata.api.iam.sharing.IsPermissionExistsResponse\"S\x82\xd3\xe4\x93\x02M\x12K/api/v1/sharing/domains/{domain_id}/permission-types/{permission_id}:exists\x12\xc3\x01\n\x14\x44\x65letePermissionType\x12@.org.apache.airavata.api.iam.sharing.DeletePermissionTypeRequest\x1a\x16.google.protobuf.Empty\"Q\x82\xd3\xe4\x93\x02K*I/api/v1/sharing/domains/{domain_id}/permission-types/{permission_type_id}\x12\xe2\x01\n\x11GetPermissionType\x12=.org.apache.airavata.api.iam.sharing.GetPermissionTypeRequest\x1a;.org.apache.airavata.sharing.registry.models.PermissionType\"Q\x82\xd3\xe4\x93\x02K\x12I/api/v1/sharing/domains/{domain_id}/permission-types/{permission_type_id}\x12\xd3\x01\n\x12GetPermissionTypes\x12>.org.apache.airavata.api.iam.sharing.GetPermissionTypesRequest\x1a?.org.apache.airavata.api.iam.sharing.GetPermissionTypesResponse\"<\x82\xd3\xe4\x93\x02\x36\x12\x34/api/v1/sharing/domains/{domain_id}/permission-types\x12\xc1\x01\n\x14ShareEntityWithUsers\x12@.org.apache.airavata.api.iam.sharing.ShareEntityWithUsersRequest\x1a\x16.google.protobuf.Empty\"O\x82\xd3\xe4\x93\x02I\"D/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/users:share:\x01*\x12\xd2\x01\n\x1cRevokeEntitySharingFromUsers\x12H.org.apache.airavata.api.iam.sharing.RevokeEntitySharingFromUsersRequest\x1a\x16.google.protobuf.Empty\"P\x82\xd3\xe4\x93\x02J\"E/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/users:revoke:\x01*\x12\xc4\x01\n\x15ShareEntityWithGroups\x12\x41.org.apache.airavata.api.iam.sharing.ShareEntityWithGroupsRequest\x1a\x16.google.protobuf.Empty\"P\x82\xd3\xe4\x93\x02J\"E/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/groups:share:\x01*\x12\xd5\x01\n\x1dRevokeEntitySharingFromGroups\x12I.org.apache.airavata.api.iam.sharing.RevokeEntitySharingFromGroupsRequest\x1a\x16.google.protobuf.Empty\"Q\x82\xd3\xe4\x93\x02K\"F/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/groups:revoke:\x01*B\'\n#org.apache.airavata.api.iam.sharingP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.sharing_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n#org.apache.airavata.api.iam.sharingP\001' + _globals['_SHARERESOURCEWITHUSERSREQUEST_USERPERMISSIONSENTRY']._loaded_options = None + _globals['_SHARERESOURCEWITHUSERSREQUEST_USERPERMISSIONSENTRY']._serialized_options = b'8\001' + _globals['_SHARERESOURCEWITHGROUPSREQUEST_GROUPPERMISSIONSENTRY']._loaded_options = None + _globals['_SHARERESOURCEWITHGROUPSREQUEST_GROUPPERMISSIONSENTRY']._serialized_options = b'8\001' + _globals['_REVOKEFROMUSERSREQUEST_USERPERMISSIONSENTRY']._loaded_options = None + _globals['_REVOKEFROMUSERSREQUEST_USERPERMISSIONSENTRY']._serialized_options = b'8\001' + _globals['_REVOKEFROMGROUPSREQUEST_GROUPPERMISSIONSENTRY']._loaded_options = None + _globals['_REVOKEFROMGROUPSREQUEST_GROUPPERMISSIONSENTRY']._serialized_options = b'8\001' + _globals['_SETENTITYSHARINGREQUEST_USERPERMISSIONSENTRY']._loaded_options = None + _globals['_SETENTITYSHARINGREQUEST_USERPERMISSIONSENTRY']._serialized_options = b'8\001' + _globals['_SETENTITYSHARINGREQUEST_GROUPPERMISSIONSENTRY']._loaded_options = None + _globals['_SETENTITYSHARINGREQUEST_GROUPPERMISSIONSENTRY']._serialized_options = b'8\001' + _globals['_SHARINGSERVICE'].methods_by_name['ShareResourceWithUsers']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['ShareResourceWithUsers']._serialized_options = b'\202\323\344\223\002(\"#/api/v1/sharing/{resource_id}/users:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['ShareResourceWithGroups']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['ShareResourceWithGroups']._serialized_options = b'\202\323\344\223\002)\"$/api/v1/sharing/{resource_id}/groups:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['RevokeFromUsers']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['RevokeFromUsers']._serialized_options = b'\202\323\344\223\002%*#/api/v1/sharing/{resource_id}/users' + _globals['_SHARINGSERVICE'].methods_by_name['RevokeFromGroups']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['RevokeFromGroups']._serialized_options = b'\202\323\344\223\002&*$/api/v1/sharing/{resource_id}/groups' + _globals['_SHARINGSERVICE'].methods_by_name['GetAllAccessibleUsers']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetAllAccessibleUsers']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/sharing/{resource_id}/users' + _globals['_SHARINGSERVICE'].methods_by_name['GetAllDirectlyAccessibleUsers']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetAllDirectlyAccessibleUsers']._serialized_options = b'\202\323\344\223\002,\022*/api/v1/sharing/{resource_id}/users:direct' + _globals['_SHARINGSERVICE'].methods_by_name['GetAllAccessibleGroups']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetAllAccessibleGroups']._serialized_options = b'\202\323\344\223\002&\022$/api/v1/sharing/{resource_id}/groups' + _globals['_SHARINGSERVICE'].methods_by_name['GetAllDirectlyAccessibleGroups']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetAllDirectlyAccessibleGroups']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/sharing/{resource_id}/groups:direct' + _globals['_SHARINGSERVICE'].methods_by_name['UserHasAccess']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['UserHasAccess']._serialized_options = b'\202\323\344\223\0025\0223/api/v1/sharing/{resource_id}/users/{user_id}:check' + _globals['_SHARINGSERVICE'].methods_by_name['GetSharedEntity']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetSharedEntity']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/sharing/entities/{entity_id}:shared' + _globals['_SHARINGSERVICE'].methods_by_name['GetAllSharedEntity']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetAllSharedEntity']._serialized_options = b'\202\323\344\223\0020\022./api/v1/sharing/entities/{entity_id}:sharedAll' + _globals['_SHARINGSERVICE'].methods_by_name['SetEntitySharing']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['SetEntitySharing']._serialized_options = b'\202\323\344\223\0027\"2/api/v1/sharing/entities/{resource_id}/permissions:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['CreateDomain']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['CreateDomain']._serialized_options = b'\202\323\344\223\002\034\"\027/api/v1/sharing/domains:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['UpdateDomain']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['UpdateDomain']._serialized_options = b'\202\323\344\223\002/\032*/api/v1/sharing/domains/{domain.domain_id}:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['IsDomainExists']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['IsDomainExists']._serialized_options = b'\202\323\344\223\002,\022*/api/v1/sharing/domains/{domain_id}:exists' + _globals['_SHARINGSERVICE'].methods_by_name['DeleteDomain']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['DeleteDomain']._serialized_options = b'\202\323\344\223\002%*#/api/v1/sharing/domains/{domain_id}' + _globals['_SHARINGSERVICE'].methods_by_name['GetDomain']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetDomain']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/sharing/domains/{domain_id}' + _globals['_SHARINGSERVICE'].methods_by_name['GetDomains']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetDomains']._serialized_options = b'\202\323\344\223\002\031\022\027/api/v1/sharing/domains' + _globals['_SHARINGSERVICE'].methods_by_name['CreateUser']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['CreateUser']._serialized_options = b'\202\323\344\223\002\032\"\025/api/v1/sharing/users:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['UpdateUser']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['UpdateUser']._serialized_options = b'\202\323\344\223\002)\032$/api/v1/sharing/users/{user.user_id}:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['IsUserExists']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['IsUserExists']._serialized_options = b'\202\323\344\223\002<\022:/api/v1/sharing/domains/{domain_id}/users/{user_id}:exists' + _globals['_SHARINGSERVICE'].methods_by_name['DeleteUser']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['DeleteUser']._serialized_options = b'\202\323\344\223\0025*3/api/v1/sharing/domains/{domain_id}/users/{user_id}' + _globals['_SHARINGSERVICE'].methods_by_name['GetUser']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetUser']._serialized_options = b'\202\323\344\223\0025\0223/api/v1/sharing/domains/{domain_id}/users/{user_id}' + _globals['_SHARINGSERVICE'].methods_by_name['GetUsers']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetUsers']._serialized_options = b'\202\323\344\223\002+\022)/api/v1/sharing/domains/{domain_id}/users' + _globals['_SHARINGSERVICE'].methods_by_name['CreateGroup']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['CreateGroup']._serialized_options = b'\202\323\344\223\002\033\"\026/api/v1/sharing/groups:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['UpdateGroup']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['UpdateGroup']._serialized_options = b'\202\323\344\223\002,\032\'/api/v1/sharing/groups/{group.group_id}:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['IsGroupExists']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['IsGroupExists']._serialized_options = b'\202\323\344\223\002>\022*/api/v1/sharing/domains/{domain_id}/groups/{group_id}/children:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['RemoveChildGroupFromParentGroup']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['RemoveChildGroupFromParentGroup']._serialized_options = b'\202\323\344\223\002K*I/api/v1/sharing/domains/{domain_id}/groups/{group_id}/children/{child_id}' + _globals['_SHARINGSERVICE'].methods_by_name['GetAllMemberGroupsForUser']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetAllMemberGroupsForUser']._serialized_options = b'\202\323\344\223\002<\022:/api/v1/sharing/domains/{domain_id}/users/{user_id}/groups' + _globals['_SHARINGSERVICE'].methods_by_name['CreateEntityType']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['CreateEntityType']._serialized_options = b'\202\323\344\223\002!\"\034/api/v1/sharing/entity-types:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['UpdateEntityType']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['UpdateEntityType']._serialized_options = b'\202\323\344\223\002>\0329/api/v1/sharing/entity-types/{entity_type.entity_type_id}:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['IsEntityTypeExists']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['IsEntityTypeExists']._serialized_options = b'\202\323\344\223\002J\022H/api/v1/sharing/domains/{domain_id}/entity-types/{entity_type_id}:exists' + _globals['_SHARINGSERVICE'].methods_by_name['DeleteEntityType']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['DeleteEntityType']._serialized_options = b'\202\323\344\223\002C*A/api/v1/sharing/domains/{domain_id}/entity-types/{entity_type_id}' + _globals['_SHARINGSERVICE'].methods_by_name['GetEntityType']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetEntityType']._serialized_options = b'\202\323\344\223\002C\022A/api/v1/sharing/domains/{domain_id}/entity-types/{entity_type_id}' + _globals['_SHARINGSERVICE'].methods_by_name['GetEntityTypes']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetEntityTypes']._serialized_options = b'\202\323\344\223\0022\0220/api/v1/sharing/domains/{domain_id}/entity-types' + _globals['_SHARINGSERVICE'].methods_by_name['CreateEntity']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['CreateEntity']._serialized_options = b'\202\323\344\223\002\035\"\030/api/v1/sharing/entities:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['UpdateEntity']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['UpdateEntity']._serialized_options = b'\202\323\344\223\0020\032+/api/v1/sharing/entities/{entity.entity_id}:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['IsEntityExists']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['IsEntityExists']._serialized_options = b'\202\323\344\223\002A\022?/api/v1/sharing/domains/{domain_id}/entities/{entity_id}:exists' + _globals['_SHARINGSERVICE'].methods_by_name['DeleteEntity']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['DeleteEntity']._serialized_options = b'\202\323\344\223\002:*8/api/v1/sharing/domains/{domain_id}/entities/{entity_id}' + _globals['_SHARINGSERVICE'].methods_by_name['GetEntity']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetEntity']._serialized_options = b'\202\323\344\223\002:\0228/api/v1/sharing/domains/{domain_id}/entities/{entity_id}' + _globals['_SHARINGSERVICE'].methods_by_name['SearchEntities']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['SearchEntities']._serialized_options = b'\202\323\344\223\0028\"3/api/v1/sharing/domains/{domain_id}/entities:search:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['GetListOfSharedUsers']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetListOfSharedUsers']._serialized_options = b'\202\323\344\223\002G\022E/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-users' + _globals['_SHARINGSERVICE'].methods_by_name['GetListOfDirectlySharedUsers']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetListOfDirectlySharedUsers']._serialized_options = b'\202\323\344\223\002N\022L/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-users:direct' + _globals['_SHARINGSERVICE'].methods_by_name['GetListOfSharedGroups']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetListOfSharedGroups']._serialized_options = b'\202\323\344\223\002H\022F/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-groups' + _globals['_SHARINGSERVICE'].methods_by_name['GetListOfDirectlySharedGroups']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetListOfDirectlySharedGroups']._serialized_options = b'\202\323\344\223\002O\022M/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-groups:direct' + _globals['_SHARINGSERVICE'].methods_by_name['CreatePermissionType']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['CreatePermissionType']._serialized_options = b'\202\323\344\223\002%\" /api/v1/sharing/permission-types:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['UpdatePermissionType']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['UpdatePermissionType']._serialized_options = b'\202\323\344\223\002J\032E/api/v1/sharing/permission-types/{permission_type.permission_type_id}:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['IsPermissionExists']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['IsPermissionExists']._serialized_options = b'\202\323\344\223\002M\022K/api/v1/sharing/domains/{domain_id}/permission-types/{permission_id}:exists' + _globals['_SHARINGSERVICE'].methods_by_name['DeletePermissionType']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['DeletePermissionType']._serialized_options = b'\202\323\344\223\002K*I/api/v1/sharing/domains/{domain_id}/permission-types/{permission_type_id}' + _globals['_SHARINGSERVICE'].methods_by_name['GetPermissionType']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetPermissionType']._serialized_options = b'\202\323\344\223\002K\022I/api/v1/sharing/domains/{domain_id}/permission-types/{permission_type_id}' + _globals['_SHARINGSERVICE'].methods_by_name['GetPermissionTypes']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['GetPermissionTypes']._serialized_options = b'\202\323\344\223\0026\0224/api/v1/sharing/domains/{domain_id}/permission-types' + _globals['_SHARINGSERVICE'].methods_by_name['ShareEntityWithUsers']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['ShareEntityWithUsers']._serialized_options = b'\202\323\344\223\002I\"D/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/users:share:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['RevokeEntitySharingFromUsers']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['RevokeEntitySharingFromUsers']._serialized_options = b'\202\323\344\223\002J\"E/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/users:revoke:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['ShareEntityWithGroups']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['ShareEntityWithGroups']._serialized_options = b'\202\323\344\223\002J\"E/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/groups:share:\001*' + _globals['_SHARINGSERVICE'].methods_by_name['RevokeEntitySharingFromGroups']._loaded_options = None + _globals['_SHARINGSERVICE'].methods_by_name['RevokeEntitySharingFromGroups']._serialized_options = b'\202\323\344\223\002K\"F/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/groups:revoke:\001*' + _globals['_SHARERESOURCEWITHUSERSREQUEST']._serialized_start=269 + _globals['_SHARERESOURCEWITHUSERSREQUEST']._serialized_end=492 + _globals['_SHARERESOURCEWITHUSERSREQUEST_USERPERMISSIONSENTRY']._serialized_start=438 + _globals['_SHARERESOURCEWITHUSERSREQUEST_USERPERMISSIONSENTRY']._serialized_end=492 + _globals['_SHARERESOURCEWITHGROUPSREQUEST']._serialized_start=495 + _globals['_SHARERESOURCEWITHGROUPSREQUEST']._serialized_end=723 + _globals['_SHARERESOURCEWITHGROUPSREQUEST_GROUPPERMISSIONSENTRY']._serialized_start=668 + _globals['_SHARERESOURCEWITHGROUPSREQUEST_GROUPPERMISSIONSENTRY']._serialized_end=723 + _globals['_REVOKEFROMUSERSREQUEST']._serialized_start=726 + _globals['_REVOKEFROMUSERSREQUEST']._serialized_end=935 + _globals['_REVOKEFROMUSERSREQUEST_USERPERMISSIONSENTRY']._serialized_start=438 + _globals['_REVOKEFROMUSERSREQUEST_USERPERMISSIONSENTRY']._serialized_end=492 + _globals['_REVOKEFROMGROUPSREQUEST']._serialized_start=938 + _globals['_REVOKEFROMGROUPSREQUEST']._serialized_end=1152 + _globals['_REVOKEFROMGROUPSREQUEST_GROUPPERMISSIONSENTRY']._serialized_start=668 + _globals['_REVOKEFROMGROUPSREQUEST_GROUPPERMISSIONSENTRY']._serialized_end=723 + _globals['_GETALLACCESSIBLEUSERSREQUEST']._serialized_start=1154 + _globals['_GETALLACCESSIBLEUSERSREQUEST']._serialized_end=1230 + _globals['_GETALLACCESSIBLEUSERSRESPONSE']._serialized_start=1232 + _globals['_GETALLACCESSIBLEUSERSRESPONSE']._serialized_end=1281 + _globals['_GETALLDIRECTLYACCESSIBLEUSERSREQUEST']._serialized_start=1283 + _globals['_GETALLDIRECTLYACCESSIBLEUSERSREQUEST']._serialized_end=1367 + _globals['_GETALLDIRECTLYACCESSIBLEUSERSRESPONSE']._serialized_start=1369 + _globals['_GETALLDIRECTLYACCESSIBLEUSERSRESPONSE']._serialized_end=1426 + _globals['_GETALLACCESSIBLEGROUPSREQUEST']._serialized_start=1428 + _globals['_GETALLACCESSIBLEGROUPSREQUEST']._serialized_end=1505 + _globals['_GETALLACCESSIBLEGROUPSRESPONSE']._serialized_start=1507 + _globals['_GETALLACCESSIBLEGROUPSRESPONSE']._serialized_end=1558 + _globals['_GETALLDIRECTLYACCESSIBLEGROUPSREQUEST']._serialized_start=1560 + _globals['_GETALLDIRECTLYACCESSIBLEGROUPSREQUEST']._serialized_end=1645 + _globals['_GETALLDIRECTLYACCESSIBLEGROUPSRESPONSE']._serialized_start=1647 + _globals['_GETALLDIRECTLYACCESSIBLEGROUPSRESPONSE']._serialized_end=1706 + _globals['_USERHASACCESSREQUEST']._serialized_start=1708 + _globals['_USERHASACCESSREQUEST']._serialized_end=1793 + _globals['_USERHASACCESSRESPONSE']._serialized_start=1795 + _globals['_USERHASACCESSRESPONSE']._serialized_end=1838 + _globals['_USERPERMISSION']._serialized_start=1840 + _globals['_USERPERMISSION']._serialized_end=1940 + _globals['_GROUPPERMISSION']._serialized_start=1942 + _globals['_GROUPPERMISSION']._serialized_end=2058 + _globals['_SHAREDENTITY']._serialized_start=2061 + _globals['_SHAREDENTITY']._serialized_end=2364 + _globals['_GETSHAREDENTITYREQUEST']._serialized_start=2366 + _globals['_GETSHAREDENTITYREQUEST']._serialized_end=2409 + _globals['_SETENTITYSHARINGREQUEST']._serialized_start=2412 + _globals['_SETENTITYSHARINGREQUEST']._serialized_end=2791 + _globals['_SETENTITYSHARINGREQUEST_USERPERMISSIONSENTRY']._serialized_start=438 + _globals['_SETENTITYSHARINGREQUEST_USERPERMISSIONSENTRY']._serialized_end=492 + _globals['_SETENTITYSHARINGREQUEST_GROUPPERMISSIONSENTRY']._serialized_start=668 + _globals['_SETENTITYSHARINGREQUEST_GROUPPERMISSIONSENTRY']._serialized_end=723 + _globals['_CREATEDOMAINREQUEST']._serialized_start=2793 + _globals['_CREATEDOMAINREQUEST']._serialized_end=2883 + _globals['_CREATEDOMAINRESPONSE']._serialized_start=2885 + _globals['_CREATEDOMAINRESPONSE']._serialized_end=2926 + _globals['_UPDATEDOMAINREQUEST']._serialized_start=2928 + _globals['_UPDATEDOMAINREQUEST']._serialized_end=3018 + _globals['_ISDOMAINEXISTSREQUEST']._serialized_start=3020 + _globals['_ISDOMAINEXISTSREQUEST']._serialized_end=3062 + _globals['_ISDOMAINEXISTSRESPONSE']._serialized_start=3064 + _globals['_ISDOMAINEXISTSRESPONSE']._serialized_end=3104 + _globals['_DELETEDOMAINREQUEST']._serialized_start=3106 + _globals['_DELETEDOMAINREQUEST']._serialized_end=3146 + _globals['_GETDOMAINREQUEST']._serialized_start=3148 + _globals['_GETDOMAINREQUEST']._serialized_end=3185 + _globals['_GETDOMAINSREQUEST']._serialized_start=3187 + _globals['_GETDOMAINSREQUEST']._serialized_end=3237 + _globals['_GETDOMAINSRESPONSE']._serialized_start=3239 + _globals['_GETDOMAINSRESPONSE']._serialized_end=3329 + _globals['_CREATEUSERREQUEST']._serialized_start=3331 + _globals['_CREATEUSERREQUEST']._serialized_end=3415 + _globals['_CREATEUSERRESPONSE']._serialized_start=3417 + _globals['_CREATEUSERRESPONSE']._serialized_end=3454 + _globals['_UPDATEUSERREQUEST']._serialized_start=3456 + _globals['_UPDATEUSERREQUEST']._serialized_end=3540 + _globals['_ISUSEREXISTSREQUEST']._serialized_start=3542 + _globals['_ISUSEREXISTSREQUEST']._serialized_end=3599 + _globals['_ISUSEREXISTSRESPONSE']._serialized_start=3601 + _globals['_ISUSEREXISTSRESPONSE']._serialized_end=3639 + _globals['_DELETEUSERREQUEST']._serialized_start=3641 + _globals['_DELETEUSERREQUEST']._serialized_end=3696 + _globals['_GETUSERREQUEST']._serialized_start=3698 + _globals['_GETUSERREQUEST']._serialized_end=3750 + _globals['_GETUSERSREQUEST']._serialized_start=3752 + _globals['_GETUSERSREQUEST']._serialized_end=3819 + _globals['_GETUSERSRESPONSE']._serialized_start=3821 + _globals['_GETUSERSRESPONSE']._serialized_end=3905 + _globals['_CREATEGROUPREQUEST']._serialized_start=3907 + _globals['_CREATEGROUPREQUEST']._serialized_end=3998 + _globals['_CREATEGROUPRESPONSE']._serialized_start=4000 + _globals['_CREATEGROUPRESPONSE']._serialized_end=4039 + _globals['_UPDATEGROUPREQUEST']._serialized_start=4041 + _globals['_UPDATEGROUPREQUEST']._serialized_end=4132 + _globals['_ISGROUPEXISTSREQUEST']._serialized_start=4134 + _globals['_ISGROUPEXISTSREQUEST']._serialized_end=4193 + _globals['_ISGROUPEXISTSRESPONSE']._serialized_start=4195 + _globals['_ISGROUPEXISTSRESPONSE']._serialized_end=4234 + _globals['_DELETEGROUPREQUEST']._serialized_start=4236 + _globals['_DELETEGROUPREQUEST']._serialized_end=4293 + _globals['_GETGROUPREQUEST']._serialized_start=4295 + _globals['_GETGROUPREQUEST']._serialized_end=4349 + _globals['_GETGROUPSREQUEST']._serialized_start=4351 + _globals['_GETGROUPSREQUEST']._serialized_end=4419 + _globals['_GETGROUPSRESPONSE']._serialized_start=4421 + _globals['_GETGROUPSRESPONSE']._serialized_end=4512 + _globals['_ADDUSERSTOGROUPREQUEST']._serialized_start=4514 + _globals['_ADDUSERSTOGROUPREQUEST']._serialized_end=4593 + _globals['_REMOVEUSERSFROMGROUPREQUEST']._serialized_start=4595 + _globals['_REMOVEUSERSFROMGROUPREQUEST']._serialized_end=4679 + _globals['_TRANSFERGROUPOWNERSHIPREQUEST']._serialized_start=4681 + _globals['_TRANSFERGROUPOWNERSHIPREQUEST']._serialized_end=4771 + _globals['_ADDGROUPADMINSREQUEST']._serialized_start=4773 + _globals['_ADDGROUPADMINSREQUEST']._serialized_end=4852 + _globals['_REMOVEGROUPADMINSREQUEST']._serialized_start=4854 + _globals['_REMOVEGROUPADMINSREQUEST']._serialized_end=4936 + _globals['_HASADMINACCESSREQUEST']._serialized_start=4938 + _globals['_HASADMINACCESSREQUEST']._serialized_end=5016 + _globals['_HASADMINACCESSRESPONSE']._serialized_start=5018 + _globals['_HASADMINACCESSRESPONSE']._serialized_end=5062 + _globals['_HASOWNERACCESSREQUEST']._serialized_start=5064 + _globals['_HASOWNERACCESSREQUEST']._serialized_end=5142 + _globals['_HASOWNERACCESSRESPONSE']._serialized_start=5144 + _globals['_HASOWNERACCESSRESPONSE']._serialized_end=5188 + _globals['_GETGROUPMEMBERSOFTYPEUSERREQUEST']._serialized_start=5190 + _globals['_GETGROUPMEMBERSOFTYPEUSERREQUEST']._serialized_end=5292 + _globals['_GETGROUPMEMBERSOFTYPEUSERRESPONSE']._serialized_start=5294 + _globals['_GETGROUPMEMBERSOFTYPEUSERRESPONSE']._serialized_end=5395 + _globals['_GETGROUPMEMBERSOFTYPEGROUPREQUEST']._serialized_start=5397 + _globals['_GETGROUPMEMBERSOFTYPEGROUPREQUEST']._serialized_end=5500 + _globals['_GETGROUPMEMBERSOFTYPEGROUPRESPONSE']._serialized_start=5502 + _globals['_GETGROUPMEMBERSOFTYPEGROUPRESPONSE']._serialized_end=5610 + _globals['_ADDCHILDGROUPSTOPARENTGROUPREQUEST']._serialized_start=5612 + _globals['_ADDCHILDGROUPSTOPARENTGROUPREQUEST']._serialized_end=5704 + _globals['_REMOVECHILDGROUPFROMPARENTGROUPREQUEST']._serialized_start=5706 + _globals['_REMOVECHILDGROUPFROMPARENTGROUPREQUEST']._serialized_end=5801 + _globals['_GETALLMEMBERGROUPSFORUSERREQUEST']._serialized_start=5803 + _globals['_GETALLMEMBERGROUPSFORUSERREQUEST']._serialized_end=5873 + _globals['_GETALLMEMBERGROUPSFORUSERRESPONSE']._serialized_start=5875 + _globals['_GETALLMEMBERGROUPSFORUSERRESPONSE']._serialized_end=5982 + _globals['_CREATEENTITYTYPEREQUEST']._serialized_start=5984 + _globals['_CREATEENTITYTYPEREQUEST']._serialized_end=6087 + _globals['_CREATEENTITYTYPERESPONSE']._serialized_start=6089 + _globals['_CREATEENTITYTYPERESPONSE']._serialized_end=6139 + _globals['_UPDATEENTITYTYPEREQUEST']._serialized_start=6141 + _globals['_UPDATEENTITYTYPEREQUEST']._serialized_end=6244 + _globals['_ISENTITYTYPEEXISTSREQUEST']._serialized_start=6246 + _globals['_ISENTITYTYPEEXISTSREQUEST']._serialized_end=6316 + _globals['_ISENTITYTYPEEXISTSRESPONSE']._serialized_start=6318 + _globals['_ISENTITYTYPEEXISTSRESPONSE']._serialized_end=6362 + _globals['_DELETEENTITYTYPEREQUEST']._serialized_start=6364 + _globals['_DELETEENTITYTYPEREQUEST']._serialized_end=6432 + _globals['_GETENTITYTYPEREQUEST']._serialized_start=6434 + _globals['_GETENTITYTYPEREQUEST']._serialized_end=6499 + _globals['_GETENTITYTYPESREQUEST']._serialized_start=6501 + _globals['_GETENTITYTYPESREQUEST']._serialized_end=6574 + _globals['_GETENTITYTYPESRESPONSE']._serialized_start=6576 + _globals['_GETENTITYTYPESRESPONSE']._serialized_end=6679 + _globals['_CREATEENTITYREQUEST']._serialized_start=6681 + _globals['_CREATEENTITYREQUEST']._serialized_end=6771 + _globals['_CREATEENTITYRESPONSE']._serialized_start=6773 + _globals['_CREATEENTITYRESPONSE']._serialized_end=6814 + _globals['_UPDATEENTITYREQUEST']._serialized_start=6816 + _globals['_UPDATEENTITYREQUEST']._serialized_end=6906 + _globals['_ISENTITYEXISTSREQUEST']._serialized_start=6908 + _globals['_ISENTITYEXISTSREQUEST']._serialized_end=6969 + _globals['_ISENTITYEXISTSRESPONSE']._serialized_start=6971 + _globals['_ISENTITYEXISTSRESPONSE']._serialized_end=7011 + _globals['_DELETEENTITYREQUEST']._serialized_start=7013 + _globals['_DELETEENTITYREQUEST']._serialized_end=7072 + _globals['_GETENTITYREQUEST']._serialized_start=7074 + _globals['_GETENTITYREQUEST']._serialized_end=7130 + _globals['_SEARCHENTITIESREQUEST']._serialized_start=7133 + _globals['_SEARCHENTITIESREQUEST']._serialized_end=7301 + _globals['_SEARCHENTITIESRESPONSE']._serialized_start=7303 + _globals['_SEARCHENTITIESRESPONSE']._serialized_end=7398 + _globals['_GETLISTOFSHAREDUSERSREQUEST']._serialized_start=7400 + _globals['_GETLISTOFSHAREDUSERSREQUEST']._serialized_end=7495 + _globals['_GETLISTOFSHAREDUSERSRESPONSE']._serialized_start=7497 + _globals['_GETLISTOFSHAREDUSERSRESPONSE']._serialized_end=7593 + _globals['_GETLISTOFDIRECTLYSHAREDUSERSREQUEST']._serialized_start=7595 + _globals['_GETLISTOFDIRECTLYSHAREDUSERSREQUEST']._serialized_end=7698 + _globals['_GETLISTOFDIRECTLYSHAREDUSERSRESPONSE']._serialized_start=7700 + _globals['_GETLISTOFDIRECTLYSHAREDUSERSRESPONSE']._serialized_end=7804 + _globals['_GETLISTOFSHAREDGROUPSREQUEST']._serialized_start=7806 + _globals['_GETLISTOFSHAREDGROUPSREQUEST']._serialized_end=7902 + _globals['_GETLISTOFSHAREDGROUPSRESPONSE']._serialized_start=7904 + _globals['_GETLISTOFSHAREDGROUPSRESPONSE']._serialized_end=8007 + _globals['_GETLISTOFDIRECTLYSHAREDGROUPSREQUEST']._serialized_start=8009 + _globals['_GETLISTOFDIRECTLYSHAREDGROUPSREQUEST']._serialized_end=8113 + _globals['_GETLISTOFDIRECTLYSHAREDGROUPSRESPONSE']._serialized_start=8115 + _globals['_GETLISTOFDIRECTLYSHAREDGROUPSRESPONSE']._serialized_end=8226 + _globals['_CREATEPERMISSIONTYPEREQUEST']._serialized_start=8228 + _globals['_CREATEPERMISSIONTYPEREQUEST']._serialized_end=8343 + _globals['_CREATEPERMISSIONTYPERESPONSE']._serialized_start=8345 + _globals['_CREATEPERMISSIONTYPERESPONSE']._serialized_end=8403 + _globals['_UPDATEPERMISSIONTYPEREQUEST']._serialized_start=8405 + _globals['_UPDATEPERMISSIONTYPEREQUEST']._serialized_end=8520 + _globals['_ISPERMISSIONEXISTSREQUEST']._serialized_start=8522 + _globals['_ISPERMISSIONEXISTSREQUEST']._serialized_end=8591 + _globals['_ISPERMISSIONEXISTSRESPONSE']._serialized_start=8593 + _globals['_ISPERMISSIONEXISTSRESPONSE']._serialized_end=8637 + _globals['_DELETEPERMISSIONTYPEREQUEST']._serialized_start=8639 + _globals['_DELETEPERMISSIONTYPEREQUEST']._serialized_end=8715 + _globals['_GETPERMISSIONTYPEREQUEST']._serialized_start=8717 + _globals['_GETPERMISSIONTYPEREQUEST']._serialized_end=8790 + _globals['_GETPERMISSIONTYPESREQUEST']._serialized_start=8792 + _globals['_GETPERMISSIONTYPESREQUEST']._serialized_end=8869 + _globals['_GETPERMISSIONTYPESRESPONSE']._serialized_start=8871 + _globals['_GETPERMISSIONTYPESRESPONSE']._serialized_end=8986 + _globals['_SHAREENTITYWITHUSERSREQUEST']._serialized_start=8989 + _globals['_SHAREENTITYWITHUSERSREQUEST']._serialized_end=9131 + _globals['_REVOKEENTITYSHARINGFROMUSERSREQUEST']._serialized_start=9133 + _globals['_REVOKEENTITYSHARINGFROMUSERSREQUEST']._serialized_end=9255 + _globals['_SHAREENTITYWITHGROUPSREQUEST']._serialized_start=9258 + _globals['_SHAREENTITYWITHGROUPSREQUEST']._serialized_end=9402 + _globals['_REVOKEENTITYSHARINGFROMGROUPSREQUEST']._serialized_start=9404 + _globals['_REVOKEENTITYSHARINGFROMGROUPSREQUEST']._serialized_end=9528 + _globals['_SHARINGSERVICE']._serialized_start=9531 + _globals['_SHARINGSERVICE']._serialized_end=22817 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/sharing_service_pb2.pyi b/airavata-python-sdk/airavata/services/sharing_service_pb2.pyi similarity index 90% rename from airavata-python-sdk/airavata_sdk/generated/services/sharing_service_pb2.pyi rename to airavata-python-sdk/airavata/services/sharing_service_pb2.pyi index b5b300a855a..2528fd52ae3 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/sharing_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/sharing_service_pb2.pyi @@ -1,6 +1,8 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.sharing import sharing_pb2 as _sharing_pb2 +from airavata.model.sharing import sharing_pb2 as _sharing_pb2 +from airavata.model.user import user_profile_pb2 as _user_profile_pb2 +from airavata.services import group_manager_service_pb2 as _group_manager_service_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -141,6 +143,68 @@ class UserHasAccessResponse(_message.Message): has_access: bool def __init__(self, has_access: bool = ...) -> None: ... +class UserPermission(_message.Message): + __slots__ = ("user", "permission_type") + USER_FIELD_NUMBER: _ClassVar[int] + PERMISSION_TYPE_FIELD_NUMBER: _ClassVar[int] + user: _user_profile_pb2.UserProfile + permission_type: str + def __init__(self, user: _Optional[_Union[_user_profile_pb2.UserProfile, _Mapping]] = ..., permission_type: _Optional[str] = ...) -> None: ... + +class GroupPermission(_message.Message): + __slots__ = ("group", "permission_type") + GROUP_FIELD_NUMBER: _ClassVar[int] + PERMISSION_TYPE_FIELD_NUMBER: _ClassVar[int] + group: _group_manager_service_pb2.GroupWithAccess + permission_type: str + def __init__(self, group: _Optional[_Union[_group_manager_service_pb2.GroupWithAccess, _Mapping]] = ..., permission_type: _Optional[str] = ...) -> None: ... + +class SharedEntity(_message.Message): + __slots__ = ("entity_id", "owner", "user_permissions", "group_permissions", "is_owner", "has_sharing_permission") + ENTITY_ID_FIELD_NUMBER: _ClassVar[int] + OWNER_FIELD_NUMBER: _ClassVar[int] + USER_PERMISSIONS_FIELD_NUMBER: _ClassVar[int] + GROUP_PERMISSIONS_FIELD_NUMBER: _ClassVar[int] + IS_OWNER_FIELD_NUMBER: _ClassVar[int] + HAS_SHARING_PERMISSION_FIELD_NUMBER: _ClassVar[int] + entity_id: str + owner: _user_profile_pb2.UserProfile + user_permissions: _containers.RepeatedCompositeFieldContainer[UserPermission] + group_permissions: _containers.RepeatedCompositeFieldContainer[GroupPermission] + is_owner: bool + has_sharing_permission: bool + def __init__(self, entity_id: _Optional[str] = ..., owner: _Optional[_Union[_user_profile_pb2.UserProfile, _Mapping]] = ..., user_permissions: _Optional[_Iterable[_Union[UserPermission, _Mapping]]] = ..., group_permissions: _Optional[_Iterable[_Union[GroupPermission, _Mapping]]] = ..., is_owner: bool = ..., has_sharing_permission: bool = ...) -> None: ... + +class GetSharedEntityRequest(_message.Message): + __slots__ = ("entity_id",) + ENTITY_ID_FIELD_NUMBER: _ClassVar[int] + entity_id: str + def __init__(self, entity_id: _Optional[str] = ...) -> None: ... + +class SetEntitySharingRequest(_message.Message): + __slots__ = ("resource_id", "user_permissions", "group_permissions") + class UserPermissionsEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: str + def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... + class GroupPermissionsEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: str + def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... + RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + USER_PERMISSIONS_FIELD_NUMBER: _ClassVar[int] + GROUP_PERMISSIONS_FIELD_NUMBER: _ClassVar[int] + resource_id: str + user_permissions: _containers.ScalarMap[str, str] + group_permissions: _containers.ScalarMap[str, str] + def __init__(self, resource_id: _Optional[str] = ..., user_permissions: _Optional[_Mapping[str, str]] = ..., group_permissions: _Optional[_Mapping[str, str]] = ...) -> None: ... + class CreateDomainRequest(_message.Message): __slots__ = ("domain",) DOMAIN_FIELD_NUMBER: _ClassVar[int] diff --git a/airavata-python-sdk/airavata_sdk/generated/services/sharing_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/sharing_service_pb2_grpc.py similarity index 94% rename from airavata-python-sdk/airavata_sdk/generated/services/sharing_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/sharing_service_pb2_grpc.py index 3043f9190da..464d5ed3990 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/sharing_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/sharing_service_pb2_grpc.py @@ -4,8 +4,8 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.sharing import sharing_pb2 as org_dot_apache_dot_airavata_dot_model_dot_sharing_dot_sharing__pb2 -from services import sharing_service_pb2 as services_dot_sharing__service__pb2 +from airavata.model.sharing import sharing_pb2 as org_dot_apache_dot_airavata_dot_model_dot_sharing_dot_sharing__pb2 +from airavata.services import sharing_service_pb2 as services_dot_sharing__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ @@ -83,6 +83,21 @@ def __init__(self, channel): request_serializer=services_dot_sharing__service__pb2.UserHasAccessRequest.SerializeToString, response_deserializer=services_dot_sharing__service__pb2.UserHasAccessResponse.FromString, _registered_method=True) + self.GetSharedEntity = channel.unary_unary( + '/org.apache.airavata.api.iam.sharing.SharingService/GetSharedEntity', + request_serializer=services_dot_sharing__service__pb2.GetSharedEntityRequest.SerializeToString, + response_deserializer=services_dot_sharing__service__pb2.SharedEntity.FromString, + _registered_method=True) + self.GetAllSharedEntity = channel.unary_unary( + '/org.apache.airavata.api.iam.sharing.SharingService/GetAllSharedEntity', + request_serializer=services_dot_sharing__service__pb2.GetSharedEntityRequest.SerializeToString, + response_deserializer=services_dot_sharing__service__pb2.SharedEntity.FromString, + _registered_method=True) + self.SetEntitySharing = channel.unary_unary( + '/org.apache.airavata.api.iam.sharing.SharingService/SetEntitySharing', + request_serializer=services_dot_sharing__service__pb2.SetEntitySharingRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) self.CreateDomain = channel.unary_unary( '/org.apache.airavata.api.iam.sharing.SharingService/CreateDomain', request_serializer=services_dot_sharing__service__pb2.CreateDomainRequest.SerializeToString, @@ -426,6 +441,36 @@ def UserHasAccess(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetSharedEntity(self, request, context): + """Additive: the composed sharing view of an entity (owner + per-user UserProfile and per-group + GroupWithAccess permissions, with is_owner / has_sharing_permission), assembled server-side so + a client does not fan out per-permission accessor RPCs + profile/group lookups. DIRECT-only: + only directly granted permissions (the ones the portal UI can edit). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetAllSharedEntity(self, request, context): + """Additive: the accessible-including-inherited analogue of GetSharedEntity (direct + inherited + sharing settings). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetEntitySharing(self, request, context): + """Additive: declaratively set an entity's direct sharing. The client sends the DESIRED end-state + (which users/groups should hold which permission); the server reads the current DIRECT grants, + computes the grant/revoke diff (READ implies READ; WRITE implies READ+WRITE; MANAGE_SHARING + implies READ+WRITE+MANAGE_SHARING), and applies it. Replaces the Python SDK's client-side diff + (sharing_resources.apply_sharing_update). Map values are permission member NAME strings + (READ / WRITE / MANAGE_SHARING); OWNER is not settable here. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def CreateDomain(self, request, context): """--- Domain CRUD --- @@ -826,6 +871,21 @@ def add_SharingServiceServicer_to_server(servicer, server): request_deserializer=services_dot_sharing__service__pb2.UserHasAccessRequest.FromString, response_serializer=services_dot_sharing__service__pb2.UserHasAccessResponse.SerializeToString, ), + 'GetSharedEntity': grpc.unary_unary_rpc_method_handler( + servicer.GetSharedEntity, + request_deserializer=services_dot_sharing__service__pb2.GetSharedEntityRequest.FromString, + response_serializer=services_dot_sharing__service__pb2.SharedEntity.SerializeToString, + ), + 'GetAllSharedEntity': grpc.unary_unary_rpc_method_handler( + servicer.GetAllSharedEntity, + request_deserializer=services_dot_sharing__service__pb2.GetSharedEntityRequest.FromString, + response_serializer=services_dot_sharing__service__pb2.SharedEntity.SerializeToString, + ), + 'SetEntitySharing': grpc.unary_unary_rpc_method_handler( + servicer.SetEntitySharing, + request_deserializer=services_dot_sharing__service__pb2.SetEntitySharingRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), 'CreateDomain': grpc.unary_unary_rpc_method_handler( servicer.CreateDomain, request_deserializer=services_dot_sharing__service__pb2.CreateDomainRequest.FromString, @@ -1362,6 +1422,87 @@ def UserHasAccess(request, metadata, _registered_method=True) + @staticmethod + def GetSharedEntity(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.iam.sharing.SharingService/GetSharedEntity', + services_dot_sharing__service__pb2.GetSharedEntityRequest.SerializeToString, + services_dot_sharing__service__pb2.SharedEntity.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetAllSharedEntity(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.iam.sharing.SharingService/GetAllSharedEntity', + services_dot_sharing__service__pb2.GetSharedEntityRequest.SerializeToString, + services_dot_sharing__service__pb2.SharedEntity.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SetEntitySharing(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.iam.sharing.SharingService/SetEntitySharing', + services_dot_sharing__service__pb2.SetEntitySharingRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def CreateDomain(request, target, diff --git a/airavata-python-sdk/airavata/services/user_profile_service_pb2.py b/airavata-python-sdk/airavata/services/user_profile_service_pb2.py new file mode 100644 index 00000000000..539920d523c --- /dev/null +++ b/airavata-python-sdk/airavata/services/user_profile_service_pb2.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: services/user_profile_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'services/user_profile_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from airavata.model.user import user_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_user_dot_user__profile__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#services/user_profile_service.proto\x12\'org.apache.airavata.api.iam.userprofile\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x31org/apache/airavata/model/user/user_profile.proto\"\xb9\x02\n\x0fUserPreferences\x12\x1e\n\x16most_recent_project_id\x18\x01 \x01(\t\x12-\n%most_recent_group_resource_profile_id\x18\x02 \x01(\t\x12\'\n\x1fmost_recent_compute_resource_id\x18\x03 \x01(\t\x12q\n\x15\x61pplication_favorites\x18\x04 \x03(\x0b\x32R.org.apache.airavata.api.iam.userprofile.UserPreferences.ApplicationFavoritesEntry\x1a;\n\x19\x41pplicationFavoritesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x08:\x02\x38\x01\"Z\n\x15\x41\x64\x64UserProfileRequest\x12\x41\n\x0cuser_profile\x18\x01 \x01(\x0b\x32+.org.apache.airavata.model.user.UserProfile\")\n\x16\x41\x64\x64UserProfileResponse\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"]\n\x18UpdateUserProfileRequest\x12\x41\n\x0cuser_profile\x18\x01 \x01(\x0b\x32+.org.apache.airavata.model.user.UserProfile\"@\n\x19GetUserProfileByIdRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"D\n\x1bGetUserProfileByNameRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"+\n\x18\x44\x65leteUserProfileRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"W\n\"GetAllUserProfilesInGatewayRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\r\n\x05limit\x18\x03 \x01(\x05\"i\n#GetAllUserProfilesInGatewayResponse\x12\x42\n\ruser_profiles\x18\x01 \x03(\x0b\x32+.org.apache.airavata.model.user.UserProfile\"=\n\x14\x44oesUserExistRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"\'\n\x15\x44oesUserExistResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\x32\xa4\r\n\x12UserProfileService\x12\xbe\x01\n\x0e\x41\x64\x64UserProfile\x12>.org.apache.airavata.api.iam.userprofile.AddUserProfileRequest\x1a?.org.apache.airavata.api.iam.userprofile.AddUserProfileResponse\"+\x82\xd3\xe4\x93\x02%\"\x15/api/v1/user-profiles:\x0cuser_profile\x12\xb2\x01\n\x11UpdateUserProfile\x12\x41.org.apache.airavata.api.iam.userprofile.UpdateUserProfileRequest\x1a\x16.google.protobuf.Empty\"B\x82\xd3\xe4\x93\x02<\x1a,/api/v1/user-profiles/{user_profile.user_id}:\x0cuser_profile\x12\xae\x01\n\x12GetUserProfileById\x12\x42.org.apache.airavata.api.iam.userprofile.GetUserProfileByIdRequest\x1a+.org.apache.airavata.model.user.UserProfile\"\'\x82\xd3\xe4\x93\x02!\x12\x1f/api/v1/user-profiles/{user_id}\x12\xc5\x01\n\x14GetUserProfileByName\x12\x44.org.apache.airavata.api.iam.userprofile.GetUserProfileByNameRequest\x1a+.org.apache.airavata.model.user.UserProfile\":\x82\xd3\xe4\x93\x02\x34\x12\x32/api/v1/gateways/{gateway_id}/user-profiles:byName\x12\x97\x01\n\x11\x44\x65leteUserProfile\x12\x41.org.apache.airavata.api.iam.userprofile.DeleteUserProfileRequest\x1a\x16.google.protobuf.Empty\"\'\x82\xd3\xe4\x93\x02!*\x1f/api/v1/user-profiles/{user_id}\x12\xed\x01\n\x1bGetAllUserProfilesInGateway\x12K.org.apache.airavata.api.iam.userprofile.GetAllUserProfilesInGatewayRequest\x1aL.org.apache.airavata.api.iam.userprofile.GetAllUserProfilesInGatewayResponse\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/gateways/{gateway_id}/user-profiles\x12\xd6\x01\n\rDoesUserExist\x12=.org.apache.airavata.api.iam.userprofile.DoesUserExistRequest\x1a>.org.apache.airavata.api.iam.userprofile.DoesUserExistResponse\"F\x82\xd3\xe4\x93\x02@\x12>/api/v1/gateways/{gateway_id}/user-profiles/{user_name}:exists\x12\x88\x01\n\x12GetUserPreferences\x12\x16.google.protobuf.Empty\x1a\x38.org.apache.airavata.api.iam.userprofile.UserPreferences\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/api/v1/user/preferences\x12\xb0\x01\n\x15UpdateUserPreferences\x12\x38.org.apache.airavata.api.iam.userprofile.UserPreferences\x1a\x38.org.apache.airavata.api.iam.userprofile.UserPreferences\"#\x82\xd3\xe4\x93\x02\x1d\x1a\x18/api/v1/user/preferences:\x01*B+\n\'org.apache.airavata.api.iam.userprofileP\x01\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.user_profile_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\'org.apache.airavata.api.iam.userprofileP\001' + _globals['_USERPREFERENCES_APPLICATIONFAVORITESENTRY']._loaded_options = None + _globals['_USERPREFERENCES_APPLICATIONFAVORITESENTRY']._serialized_options = b'8\001' + _globals['_USERPROFILESERVICE'].methods_by_name['AddUserProfile']._loaded_options = None + _globals['_USERPROFILESERVICE'].methods_by_name['AddUserProfile']._serialized_options = b'\202\323\344\223\002%\"\025/api/v1/user-profiles:\014user_profile' + _globals['_USERPROFILESERVICE'].methods_by_name['UpdateUserProfile']._loaded_options = None + _globals['_USERPROFILESERVICE'].methods_by_name['UpdateUserProfile']._serialized_options = b'\202\323\344\223\002<\032,/api/v1/user-profiles/{user_profile.user_id}:\014user_profile' + _globals['_USERPROFILESERVICE'].methods_by_name['GetUserProfileById']._loaded_options = None + _globals['_USERPROFILESERVICE'].methods_by_name['GetUserProfileById']._serialized_options = b'\202\323\344\223\002!\022\037/api/v1/user-profiles/{user_id}' + _globals['_USERPROFILESERVICE'].methods_by_name['GetUserProfileByName']._loaded_options = None + _globals['_USERPROFILESERVICE'].methods_by_name['GetUserProfileByName']._serialized_options = b'\202\323\344\223\0024\0222/api/v1/gateways/{gateway_id}/user-profiles:byName' + _globals['_USERPROFILESERVICE'].methods_by_name['DeleteUserProfile']._loaded_options = None + _globals['_USERPROFILESERVICE'].methods_by_name['DeleteUserProfile']._serialized_options = b'\202\323\344\223\002!*\037/api/v1/user-profiles/{user_id}' + _globals['_USERPROFILESERVICE'].methods_by_name['GetAllUserProfilesInGateway']._loaded_options = None + _globals['_USERPROFILESERVICE'].methods_by_name['GetAllUserProfilesInGateway']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/gateways/{gateway_id}/user-profiles' + _globals['_USERPROFILESERVICE'].methods_by_name['DoesUserExist']._loaded_options = None + _globals['_USERPROFILESERVICE'].methods_by_name['DoesUserExist']._serialized_options = b'\202\323\344\223\002@\022>/api/v1/gateways/{gateway_id}/user-profiles/{user_name}:exists' + _globals['_USERPROFILESERVICE'].methods_by_name['GetUserPreferences']._loaded_options = None + _globals['_USERPROFILESERVICE'].methods_by_name['GetUserPreferences']._serialized_options = b'\202\323\344\223\002\032\022\030/api/v1/user/preferences' + _globals['_USERPROFILESERVICE'].methods_by_name['UpdateUserPreferences']._loaded_options = None + _globals['_USERPROFILESERVICE'].methods_by_name['UpdateUserPreferences']._serialized_options = b'\202\323\344\223\002\035\032\030/api/v1/user/preferences:\001*' + _globals['_USERPREFERENCES']._serialized_start=191 + _globals['_USERPREFERENCES']._serialized_end=504 + _globals['_USERPREFERENCES_APPLICATIONFAVORITESENTRY']._serialized_start=445 + _globals['_USERPREFERENCES_APPLICATIONFAVORITESENTRY']._serialized_end=504 + _globals['_ADDUSERPROFILEREQUEST']._serialized_start=506 + _globals['_ADDUSERPROFILEREQUEST']._serialized_end=596 + _globals['_ADDUSERPROFILERESPONSE']._serialized_start=598 + _globals['_ADDUSERPROFILERESPONSE']._serialized_end=639 + _globals['_UPDATEUSERPROFILEREQUEST']._serialized_start=641 + _globals['_UPDATEUSERPROFILEREQUEST']._serialized_end=734 + _globals['_GETUSERPROFILEBYIDREQUEST']._serialized_start=736 + _globals['_GETUSERPROFILEBYIDREQUEST']._serialized_end=800 + _globals['_GETUSERPROFILEBYNAMEREQUEST']._serialized_start=802 + _globals['_GETUSERPROFILEBYNAMEREQUEST']._serialized_end=870 + _globals['_DELETEUSERPROFILEREQUEST']._serialized_start=872 + _globals['_DELETEUSERPROFILEREQUEST']._serialized_end=915 + _globals['_GETALLUSERPROFILESINGATEWAYREQUEST']._serialized_start=917 + _globals['_GETALLUSERPROFILESINGATEWAYREQUEST']._serialized_end=1004 + _globals['_GETALLUSERPROFILESINGATEWAYRESPONSE']._serialized_start=1006 + _globals['_GETALLUSERPROFILESINGATEWAYRESPONSE']._serialized_end=1111 + _globals['_DOESUSEREXISTREQUEST']._serialized_start=1113 + _globals['_DOESUSEREXISTREQUEST']._serialized_end=1174 + _globals['_DOESUSEREXISTRESPONSE']._serialized_start=1176 + _globals['_DOESUSEREXISTRESPONSE']._serialized_end=1215 + _globals['_USERPROFILESERVICE']._serialized_start=1218 + _globals['_USERPROFILESERVICE']._serialized_end=2918 +# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/user_profile_service_pb2.pyi b/airavata-python-sdk/airavata/services/user_profile_service_pb2.pyi similarity index 73% rename from airavata-python-sdk/airavata_sdk/generated/services/user_profile_service_pb2.pyi rename to airavata-python-sdk/airavata/services/user_profile_service_pb2.pyi index 1cfebe3d393..b3eb2a5f63e 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/user_profile_service_pb2.pyi +++ b/airavata-python-sdk/airavata/services/user_profile_service_pb2.pyi @@ -1,6 +1,6 @@ from google.api import annotations_pb2 as _annotations_pb2 from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.user import user_profile_pb2 as _user_profile_pb2 +from airavata.model.user import user_profile_pb2 as _user_profile_pb2 from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -9,6 +9,25 @@ from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor +class UserPreferences(_message.Message): + __slots__ = ("most_recent_project_id", "most_recent_group_resource_profile_id", "most_recent_compute_resource_id", "application_favorites") + class ApplicationFavoritesEntry(_message.Message): + __slots__ = ("key", "value") + KEY_FIELD_NUMBER: _ClassVar[int] + VALUE_FIELD_NUMBER: _ClassVar[int] + key: str + value: bool + def __init__(self, key: _Optional[str] = ..., value: bool = ...) -> None: ... + MOST_RECENT_PROJECT_ID_FIELD_NUMBER: _ClassVar[int] + MOST_RECENT_GROUP_RESOURCE_PROFILE_ID_FIELD_NUMBER: _ClassVar[int] + MOST_RECENT_COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] + APPLICATION_FAVORITES_FIELD_NUMBER: _ClassVar[int] + most_recent_project_id: str + most_recent_group_resource_profile_id: str + most_recent_compute_resource_id: str + application_favorites: _containers.ScalarMap[str, bool] + def __init__(self, most_recent_project_id: _Optional[str] = ..., most_recent_group_resource_profile_id: _Optional[str] = ..., most_recent_compute_resource_id: _Optional[str] = ..., application_favorites: _Optional[_Mapping[str, bool]] = ...) -> None: ... + class AddUserProfileRequest(_message.Message): __slots__ = ("user_profile",) USER_PROFILE_FIELD_NUMBER: _ClassVar[int] diff --git a/airavata-python-sdk/airavata_sdk/generated/services/user_profile_service_pb2_grpc.py b/airavata-python-sdk/airavata/services/user_profile_service_pb2_grpc.py similarity index 79% rename from airavata-python-sdk/airavata_sdk/generated/services/user_profile_service_pb2_grpc.py rename to airavata-python-sdk/airavata/services/user_profile_service_pb2_grpc.py index a924b7f74c8..ff53ca6d324 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/user_profile_service_pb2_grpc.py +++ b/airavata-python-sdk/airavata/services/user_profile_service_pb2_grpc.py @@ -4,8 +4,8 @@ import warnings from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.user import user_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_user_dot_user__profile__pb2 -from services import user_profile_service_pb2 as services_dot_user__profile__service__pb2 +from airavata.model.user import user_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_user_dot_user__profile__pb2 +from airavata.services import user_profile_service_pb2 as services_dot_user__profile__service__pb2 GRPC_GENERATED_VERSION = '1.80.0' GRPC_VERSION = grpc.__version__ @@ -72,6 +72,16 @@ def __init__(self, channel): request_serializer=services_dot_user__profile__service__pb2.DoesUserExistRequest.SerializeToString, response_deserializer=services_dot_user__profile__service__pb2.DoesUserExistResponse.FromString, _registered_method=True) + self.GetUserPreferences = channel.unary_unary( + '/org.apache.airavata.api.iam.userprofile.UserProfileService/GetUserPreferences', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=services_dot_user__profile__service__pb2.UserPreferences.FromString, + _registered_method=True) + self.UpdateUserPreferences = channel.unary_unary( + '/org.apache.airavata.api.iam.userprofile.UserProfileService/UpdateUserPreferences', + request_serializer=services_dot_user__profile__service__pb2.UserPreferences.SerializeToString, + response_deserializer=services_dot_user__profile__service__pb2.UserPreferences.FromString, + _registered_method=True) class UserProfileServiceServicer(object): @@ -120,6 +130,20 @@ def DoesUserExist(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def GetUserPreferences(self, request, context): + """Per-user workspace preferences, scoped to the authenticated caller + (gateway + user from the request context, not the request body). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateUserPreferences(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_UserProfileServiceServicer_to_server(servicer, server): rpc_method_handlers = { @@ -158,6 +182,16 @@ def add_UserProfileServiceServicer_to_server(servicer, server): request_deserializer=services_dot_user__profile__service__pb2.DoesUserExistRequest.FromString, response_serializer=services_dot_user__profile__service__pb2.DoesUserExistResponse.SerializeToString, ), + 'GetUserPreferences': grpc.unary_unary_rpc_method_handler( + servicer.GetUserPreferences, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=services_dot_user__profile__service__pb2.UserPreferences.SerializeToString, + ), + 'UpdateUserPreferences': grpc.unary_unary_rpc_method_handler( + servicer.UpdateUserPreferences, + request_deserializer=services_dot_user__profile__service__pb2.UserPreferences.FromString, + response_serializer=services_dot_user__profile__service__pb2.UserPreferences.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'org.apache.airavata.api.iam.userprofile.UserProfileService', rpc_method_handlers) @@ -358,3 +392,57 @@ def DoesUserExist(request, timeout, metadata, _registered_method=True) + + @staticmethod + def GetUserPreferences(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.iam.userprofile.UserProfileService/GetUserPreferences', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + services_dot_user__profile__service__pb2.UserPreferences.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateUserPreferences(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/org.apache.airavata.api.iam.userprofile.UserProfileService/UpdateUserPreferences', + services_dot_user__profile__service__pb2.UserPreferences.SerializeToString, + services_dot_user__profile__service__pb2.UserPreferences.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/user_resource_profile_service_pb2.py b/airavata-python-sdk/airavata/services/user_resource_profile_service_pb2.py similarity index 98% rename from airavata-python-sdk/airavata_sdk/generated/services/user_resource_profile_service_pb2.py rename to airavata-python-sdk/airavata/services/user_resource_profile_service_pb2.py index 81b10970cc4..ab25f20f28e 100644 --- a/airavata-python-sdk/airavata_sdk/generated/services/user_resource_profile_service_pb2.py +++ b/airavata-python-sdk/airavata/services/user_resource_profile_service_pb2.py @@ -24,8 +24,8 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.appcatalog.userresourceprofile import user_resource_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_userresourceprofile_dot_user__resource__profile__pb2 -from org.apache.airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 +from airavata.model.appcatalog.userresourceprofile import user_resource_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_userresourceprofile_dot_user__resource__profile__pb2 +from airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,services/user_resource_profile_service.proto\x12#org.apache.airavata.api.userprofile\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1aTorg/apache/airavata/model/appcatalog/userresourceprofile/user_resource_profile.proto\x1a-org/apache/airavata/model/status/status.proto\"\x92\x01\n\"RegisterUserResourceProfileRequest\x12l\n\x15user_resource_profile\x18\x01 \x01(\x0b\x32M.org.apache.airavata.model.appcatalog.userresourceprofile.UserResourceProfile\"6\n#RegisterUserResourceProfileResponse\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"I\n\"IsUserResourceProfileExistsRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"5\n#IsUserResourceProfileExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"D\n\x1dGetUserResourceProfileRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"\xb5\x01\n UpdateUserResourceProfileRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12l\n\x15user_resource_profile\x18\x03 \x01(\x0b\x32M.org.apache.airavata.model.appcatalog.userresourceprofile.UserResourceProfile\"G\n DeleteUserResourceProfileRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"#\n!GetAllUserResourceProfilesRequest\"\x93\x01\n\"GetAllUserResourceProfilesResponse\x12m\n\x16user_resource_profiles\x18\x01 \x03(\x0b\x32M.org.apache.airavata.model.appcatalog.userresourceprofile.UserResourceProfile\"\xe7\x01\n\x1f\x41\x64\x64UserComputePreferenceRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x03 \x01(\t\x12\x81\x01\n user_compute_resource_preference\x18\x04 \x01(\x0b\x32W.org.apache.airavata.model.appcatalog.userresourceprofile.UserComputeResourcePreference\"c\n\x1fGetUserComputePreferenceRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x03 \x01(\t\"\xea\x01\n\"UpdateUserComputePreferenceRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x03 \x01(\t\x12\x81\x01\n user_compute_resource_preference\x18\x04 \x01(\x0b\x32W.org.apache.airavata.model.appcatalog.userresourceprofile.UserComputeResourcePreference\"f\n\"DeleteUserComputePreferenceRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x03 \x01(\t\"J\n#GetAllUserComputePreferencesRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"\xab\x01\n$GetAllUserComputePreferencesResponse\x12\x82\x01\n!user_compute_resource_preferences\x18\x01 \x03(\x0b\x32W.org.apache.airavata.model.appcatalog.userresourceprofile.UserComputeResourcePreference\"\xd5\x01\n\x1f\x41\x64\x64UserStoragePreferenceRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x1b\n\x13storage_resource_id\x18\x03 \x01(\t\x12p\n\x17user_storage_preference\x18\x04 \x01(\x0b\x32O.org.apache.airavata.model.appcatalog.userresourceprofile.UserStoragePreference\"c\n\x1fGetUserStoragePreferenceRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x1b\n\x13storage_resource_id\x18\x03 \x01(\t\"\xd8\x01\n\"UpdateUserStoragePreferenceRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x1b\n\x13storage_resource_id\x18\x03 \x01(\t\x12p\n\x17user_storage_preference\x18\x04 \x01(\x0b\x32O.org.apache.airavata.model.appcatalog.userresourceprofile.UserStoragePreference\"f\n\"DeleteUserStoragePreferenceRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x1b\n\x13storage_resource_id\x18\x03 \x01(\t\"J\n#GetAllUserStoragePreferencesRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"\x99\x01\n$GetAllUserStoragePreferencesResponse\x12q\n\x18user_storage_preferences\x18\x01 \x03(\x0b\x32O.org.apache.airavata.model.appcatalog.userresourceprofile.UserStoragePreference\"\x1f\n\x1dGetLatestQueueStatusesRequest\"l\n\x1eGetLatestQueueStatusesResponse\x12J\n\x0equeue_statuses\x18\x01 \x03(\x0b\x32\x32.org.apache.airavata.model.status.QueueStatusModel2\xf7\x1e\n\x1aUserResourceProfileService\x12\xef\x01\n\x1bRegisterUserResourceProfile\x12G.org.apache.airavata.api.userprofile.RegisterUserResourceProfileRequest\x1aH.org.apache.airavata.api.userprofile.RegisterUserResourceProfileResponse\"=\x82\xd3\xe4\x93\x02\x37\"\x1e/api/v1/user-resource-profiles:\x15user_resource_profile\x12\xe9\x01\n\x1bIsUserResourceProfileExists\x12G.org.apache.airavata.api.userprofile.IsUserResourceProfileExistsRequest\x1aH.org.apache.airavata.api.userprofile.IsUserResourceProfileExistsResponse\"7\x82\xd3\xe4\x93\x02\x31\x12//api/v1/user-resource-profiles/{user_id}:exists\x12\xdd\x01\n\x16GetUserResourceProfile\x12\x42.org.apache.airavata.api.userprofile.GetUserResourceProfileRequest\x1aM.org.apache.airavata.model.appcatalog.userresourceprofile.UserResourceProfile\"0\x82\xd3\xe4\x93\x02*\x12(/api/v1/user-resource-profiles/{user_id}\x12\xc3\x01\n\x19UpdateUserResourceProfile\x12\x45.org.apache.airavata.api.userprofile.UpdateUserResourceProfileRequest\x1a\x16.google.protobuf.Empty\"G\x82\xd3\xe4\x93\x02\x41\x1a(/api/v1/user-resource-profiles/{user_id}:\x15user_resource_profile\x12\xac\x01\n\x19\x44\x65leteUserResourceProfile\x12\x45.org.apache.airavata.api.userprofile.DeleteUserResourceProfileRequest\x1a\x16.google.protobuf.Empty\"0\x82\xd3\xe4\x93\x02**(/api/v1/user-resource-profiles/{user_id}\x12\xd5\x01\n\x1aGetAllUserResourceProfiles\x12\x46.org.apache.airavata.api.userprofile.GetAllUserResourceProfilesRequest\x1aG.org.apache.airavata.api.userprofile.GetAllUserResourceProfilesResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/user-resource-profiles\x12\xe0\x01\n\x18\x41\x64\x64UserComputePreference\x12\x44.org.apache.airavata.api.userprofile.AddUserComputePreferenceRequest\x1a\x16.google.protobuf.Empty\"f\x82\xd3\xe4\x93\x02`\"\x12\x12 AuthzToken: - client_id = self.CLIENT_ID - client_secret = self.CLIENT_SECRET - token_url = self.TOKEN_URL - verify_ssl = self.settings.VERIFY_SSL - oauth2_session = OAuth2Session( - client=LegacyApplicationClient(client_id=client_id)) - token = oauth2_session.fetch_token( - token_url=token_url, - username=username, - password=password, - client_id=client_id, - client_secret=client_secret, - verify=verify_ssl, - ) - claims_map = { - "userName": username, - "gatewayID": gateway_id - } - return AuthzToken(access_token=token['access_token'], claims_map=claims_map) - - def get_airavata_authz_token(self, username: str, token: str, gateway_id: str) -> AuthzToken: - claims_map = { - "userName": username, - "gatewayID": gateway_id - } - return AuthzToken(access_token=token, claims_map=claims_map) - - def get_authorize_url(self, username: str, password: str, gateway_id: str) -> AuthzToken: - client_id = self.CLIENT_ID - client_secret = self.CLIENT_SECRET - token_url = self.TOKEN_URL - verify_ssl = self.settings.VERIFY_SSL - oauth2_session = OAuth2Session( - client=LegacyApplicationClient(client_id=client_id)) - token = oauth2_session.fetch_token( - token_url=token_url, - username=username, - password=password, - client_id=client_id, - client_secret=client_secret, - verify=verify_ssl, - ) - claims_map = { - "userName": username, - "gatewayID": gateway_id - } - return AuthzToken(access_token=token['access_token'], claims_map=claims_map) - - def authenticate_with_auth_code(self): - print("Click on Login URI ", self.LOGIN_DESKTOP_URI) - return self.LOGIN_DESKTOP_URI diff --git a/airavata-python-sdk/airavata_sdk/clients/plan_client.py b/airavata-python-sdk/airavata_sdk/clients/plan_client.py deleted file mode 100644 index c1f9c629587..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/plan_client.py +++ /dev/null @@ -1,88 +0,0 @@ -# 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. -# - -import json -import logging -from typing import Optional - -import grpc -from google.protobuf.struct_pb2 import Struct - -from airavata_sdk import Settings -from airavata_sdk.transport.utils import create_plan_service_stub - -logger = logging.getLogger(__name__) -logger.setLevel(logging.DEBUG) - - -class PlanClient: - """Client for the Plan Service (gRPC). - - Provides methods for saving, retrieving, and updating plans. - """ - - def __init__(self, access_token: Optional[str] = None, claims: Optional[dict] = None): - self.settings = Settings() - host = self.settings.API_SERVER_HOSTNAME - port = self.settings.API_SERVER_PORT - secure = self.settings.API_SERVER_SECURE - - target = f"{host}:{port}" - if secure: - self.channel = grpc.secure_channel(target, grpc.ssl_channel_credentials()) - else: - self.channel = grpc.insecure_channel(target) - - self._metadata: list[tuple[str, str]] = [] - if access_token: - self._metadata.append(("authorization", f"Bearer {access_token}")) - - self._stub = create_plan_service_stub(self.channel) - - def close(self): - self.channel.close() - - def save_plan(self, id: str, data: dict): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - struct = Struct() - struct.update(data) - return self._stub.SavePlan( - pb2.SavePlanRequest(id=id, data=struct), - metadata=self._metadata, - ) - - def get_plan(self, plan_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._stub.GetPlan( - pb2.GetPlanRequest(plan_id=plan_id), - metadata=self._metadata, - ) - - def get_plans_by_user(self): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._stub.GetPlansByUser( - pb2.GetPlansByUserRequest(), - metadata=self._metadata, - ) - - def update_plan(self, plan_id: str, data: dict): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - struct = Struct() - struct.update(data) - return self._stub.UpdatePlan( - pb2.UpdatePlanRequest(plan_id=plan_id, data=struct), - metadata=self._metadata, - ) diff --git a/airavata-python-sdk/airavata_sdk/clients/research_hub_client.py b/airavata-python-sdk/airavata_sdk/clients/research_hub_client.py deleted file mode 100644 index 173adeffeb4..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/research_hub_client.py +++ /dev/null @@ -1,69 +0,0 @@ -# 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. -# - -import json -import logging -from typing import Optional - -import grpc - -from airavata_sdk import Settings -from airavata_sdk.transport.utils import create_research_hub_service_stub - -logger = logging.getLogger(__name__) -logger.setLevel(logging.DEBUG) - - -class ResearchHubClient: - """Client for the Research Hub Service (gRPC). - - Provides methods for starting and resuming project sessions. - """ - - def __init__(self, access_token: Optional[str] = None, claims: Optional[dict] = None): - self.settings = Settings() - host = self.settings.API_SERVER_HOSTNAME - port = self.settings.API_SERVER_PORT - secure = self.settings.API_SERVER_SECURE - - target = f"{host}:{port}" - if secure: - self.channel = grpc.secure_channel(target, grpc.ssl_channel_credentials()) - else: - self.channel = grpc.insecure_channel(target) - - self._metadata: list[tuple[str, str]] = [] - if access_token: - self._metadata.append(("authorization", f"Bearer {access_token}")) - - self._stub = create_research_hub_service_stub(self.channel) - - def close(self): - self.channel.close() - - def start_project_session(self, project_id: str, session_name: str = ""): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.StartProjectSession( - pb2.StartProjectSessionRequest(project_id=project_id, session_name=session_name), - metadata=self._metadata, - ) - - def resume_session(self, session_id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.ResumeSession( - pb2.ResumeSessionRequest(session_id=session_id), - metadata=self._metadata, - ) diff --git a/airavata-python-sdk/airavata_sdk/clients/research_project_client.py b/airavata-python-sdk/airavata_sdk/clients/research_project_client.py deleted file mode 100644 index 3492a3b3726..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/research_project_client.py +++ /dev/null @@ -1,86 +0,0 @@ -# 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. -# - -import json -import logging -from typing import Optional - -import grpc - -from airavata_sdk import Settings -from airavata_sdk.transport.utils import create_research_project_service_stub - -logger = logging.getLogger(__name__) -logger.setLevel(logging.DEBUG) - - -class ResearchProjectClient: - """Client for the Research Project Service (gRPC). - - Provides methods for creating, listing, and deleting research projects. - """ - - def __init__(self, access_token: Optional[str] = None, claims: Optional[dict] = None): - self.settings = Settings() - host = self.settings.API_SERVER_HOSTNAME - port = self.settings.API_SERVER_PORT - secure = self.settings.API_SERVER_SECURE - - target = f"{host}:{port}" - if secure: - self.channel = grpc.secure_channel(target, grpc.ssl_channel_credentials()) - else: - self.channel = grpc.insecure_channel(target) - - self._metadata: list[tuple[str, str]] = [] - if access_token: - self._metadata.append(("authorization", f"Bearer {access_token}")) - - self._stub = create_research_project_service_stub(self.channel) - - def close(self): - self.channel.close() - - def get_all_projects(self): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.GetAllProjects( - pb2.GetAllProjectsRequest(), - metadata=self._metadata, - ) - - def get_projects_by_owner(self, owner_id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.GetProjectsByOwner( - pb2.GetProjectsByOwnerRequest(owner_id=owner_id), - metadata=self._metadata, - ) - - def create_project(self, name: str, owner_id: str, repository_id: str = "", dataset_ids: list[str] = None): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.CreateProject( - pb2.CreateResearchProjectRequest( - name=name, owner_id=owner_id, - repository_id=repository_id, dataset_ids=dataset_ids or [], - ), - metadata=self._metadata, - ) - - def delete_project(self, project_id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.DeleteProject( - pb2.DeleteProjectRequest(project_id=project_id), - metadata=self._metadata, - ) diff --git a/airavata-python-sdk/airavata_sdk/clients/research_resource_client.py b/airavata-python-sdk/airavata_sdk/clients/research_resource_client.py deleted file mode 100644 index 4328e41e6d4..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/research_resource_client.py +++ /dev/null @@ -1,191 +0,0 @@ -# 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. -# - -import json -import logging -from typing import Optional - -import grpc -from google.protobuf.struct_pb2 import Struct - -from airavata_sdk import Settings -from airavata_sdk.transport.utils import create_research_resource_service_stub - -logger = logging.getLogger(__name__) -logger.setLevel(logging.DEBUG) - - -class ResearchResourceClient: - """Client for the Research Resource Service (gRPC). - - Provides methods for creating, searching, starring, and managing - datasets, notebooks, repositories, and models. - """ - - def __init__(self, access_token: Optional[str] = None, claims: Optional[dict] = None): - self.settings = Settings() - host = self.settings.API_SERVER_HOSTNAME - port = self.settings.API_SERVER_PORT - secure = self.settings.API_SERVER_SECURE - - target = f"{host}:{port}" - if secure: - self.channel = grpc.secure_channel(target, grpc.ssl_channel_credentials()) - else: - self.channel = grpc.insecure_channel(target) - - self._metadata: list[tuple[str, str]] = [] - if access_token: - self._metadata.append(("authorization", f"Bearer {access_token}")) - - self._stub = create_research_resource_service_stub(self.channel) - - def close(self): - self.channel.close() - - # --- Resource creation --- - - def create_dataset(self, data: dict): - struct = Struct() - struct.update(data) - return self._stub.CreateDataset( - struct, - metadata=self._metadata, - ) - - def create_notebook(self, data: dict): - struct = Struct() - struct.update(data) - return self._stub.CreateNotebook( - struct, - metadata=self._metadata, - ) - - def create_repository(self, name: str, description: str = "", header_image: str = "", - tags: list[str] = None, authors: list[str] = None, - privacy: str = "PUBLIC", github_url: str = ""): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - resource = pb2.CreateResourceRequest( - name=name, description=description, header_image=header_image, - tags=tags or [], authors=authors or [], privacy=privacy, - ) - return self._stub.CreateRepository( - pb2.CreateRepositoryResourceRequest(resource=resource, github_url=github_url), - metadata=self._metadata, - ) - - def modify_repository(self, id: str, name: str = "", description: str = "", - header_image: str = "", tags: list[str] = None, - authors: list[str] = None, privacy: str = ""): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.ModifyRepository( - pb2.ModifyResourceRequest( - id=id, name=name, description=description, - header_image=header_image, tags=tags or [], - authors=authors or [], privacy=privacy, - ), - metadata=self._metadata, - ) - - def create_model(self, data: dict): - struct = Struct() - struct.update(data) - return self._stub.CreateModel( - struct, - metadata=self._metadata, - ) - - # --- Resource queries --- - - def get_tags(self, page_number: int = 0, page_size: int = 0, name_search: str = "", - types: list[str] = None, tags: list[str] = None): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.GetTags( - pb2.GetAllResourcesRequest( - page_number=page_number, page_size=page_size, - name_search=name_search, types=types or [], tags=tags or [], - ), - metadata=self._metadata, - ) - - def get_resource(self, id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.GetResource( - pb2.ResourceIdRequest(id=id), - metadata=self._metadata, - ) - - def delete_resource(self, id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.DeleteResource( - pb2.ResourceIdRequest(id=id), - metadata=self._metadata, - ) - - def get_all_resources(self, page_number: int = 0, page_size: int = 0, name_search: str = "", - types: list[str] = None, tags: list[str] = None): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.GetAllResources( - pb2.GetAllResourcesRequest( - page_number=page_number, page_size=page_size, - name_search=name_search, types=types or [], tags=tags or [], - ), - metadata=self._metadata, - ) - - def search_resources(self, type: str, name: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.SearchResources( - pb2.SearchResourceRequest(type=type, name=name), - metadata=self._metadata, - ) - - def get_projects_for_resource(self, id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.GetProjectsForResource( - pb2.ResourceIdRequest(id=id), - metadata=self._metadata, - ) - - # --- Starring --- - - def star_resource(self, id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.StarResource( - pb2.StarResourceRequest(id=id), - metadata=self._metadata, - ) - - def check_user_starred_resource(self, id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.CheckUserStarredResource( - pb2.StarResourceRequest(id=id), - metadata=self._metadata, - ) - - def get_resource_star_count(self, id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.GetResourceStarCount( - pb2.GetResourceStarCountRequest(id=id), - metadata=self._metadata, - ) - - def get_starred_resources(self, user_id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.GetStarredResources( - pb2.GetStarredResourcesRequest(user_id=user_id), - metadata=self._metadata, - ) diff --git a/airavata-python-sdk/airavata_sdk/clients/research_session_client.py b/airavata-python-sdk/airavata_sdk/clients/research_session_client.py deleted file mode 100644 index a9d9d5d93d6..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/research_session_client.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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. -# - -import json -import logging -from typing import Optional - -import grpc - -from airavata_sdk import Settings -from airavata_sdk.transport.utils import create_research_session_service_stub - -logger = logging.getLogger(__name__) -logger.setLevel(logging.DEBUG) - - -class ResearchSessionClient: - """Client for the Research Session Service (gRPC). - - Provides methods for listing, updating, and deleting sessions. - """ - - def __init__(self, access_token: Optional[str] = None, claims: Optional[dict] = None): - self.settings = Settings() - host = self.settings.API_SERVER_HOSTNAME - port = self.settings.API_SERVER_PORT - secure = self.settings.API_SERVER_SECURE - - target = f"{host}:{port}" - if secure: - self.channel = grpc.secure_channel(target, grpc.ssl_channel_credentials()) - else: - self.channel = grpc.insecure_channel(target) - - self._metadata: list[tuple[str, str]] = [] - if access_token: - self._metadata.append(("authorization", f"Bearer {access_token}")) - - self._stub = create_research_session_service_stub(self.channel) - - def close(self): - self.channel.close() - - def get_sessions(self, status: str = ""): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.GetSessions( - pb2.GetSessionsRequest(status=status), - metadata=self._metadata, - ) - - def update_session_status(self, session_id: str, status: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.UpdateSessionStatus( - pb2.UpdateSessionStatusRequest(session_id=session_id, status=status), - metadata=self._metadata, - ) - - def delete_session(self, session_id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.DeleteSession( - pb2.DeleteSessionRequest(session_id=session_id), - metadata=self._metadata, - ) - - def delete_sessions(self, session_ids: list[str]): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._stub.DeleteSessions( - pb2.DeleteSessionsRequest(session_ids=session_ids), - metadata=self._metadata, - ) diff --git a/airavata-python-sdk/airavata_sdk/clients/sftp_file_handling_client.py b/airavata-python-sdk/airavata_sdk/clients/sftp_file_handling_client.py deleted file mode 100644 index dac23117d55..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/sftp_file_handling_client.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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. -# - -import logging -import os -from datetime import datetime - -import paramiko -from paramiko import SFTPClient, Transport -from scp import SCPClient - -logger = logging.getLogger(__name__) -logger.setLevel(logging.INFO) -logging.getLogger("paramiko").setLevel(logging.WARNING) - - -class SFTPConnector(object): - - def __init__(self, host, port, username, password): - self.host = host - self.port = port - self.username = username - self.password = password - - ssh = paramiko.SSHClient() - self.ssh = ssh - # self.sftp = paramiko.SFTPClient() - # Trust all key policy on remote host - - ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - - - def upload_files(self, local_path: str, project_name: str, exprement_id: str): - project_name = project_name.replace(" ", "_") - time = datetime.now().strftime('%Y-%m-%d %H:%M:%S').replace(" ", "_") - time = time.replace(":", "_") - time = time.replace("-", "_") - exprement_id = exprement_id+"_"+time - remote_path = "/" + project_name + "/" + exprement_id + "/" - pathsuffix = self.username + remote_path - files = os.listdir(local_path) - for file in files: - try: - transport = Transport(sock=(self.host, int(self.port))) - transport.connect(username=self.username, password=self.password) - connection = SFTPClient.from_transport(transport) - assert connection is not None - try: - base_path = "/" + project_name - connection.chdir(base_path) # Test if remote_path exists - except IOError: - connection.mkdir(base_path) - try: - connection.chdir(remote_path) # Test if remote_path exists - except IOError: - connection.mkdir(remote_path) - connection.put(os.path.join(local_path, file), remote_path + "/" + file) - finally: - transport.close() - return pathsuffix - - def download_files(self, local_path: str, remote_path: str): - self.ssh.connect(self.host, self.port, self.username, password = self.password) - transport = self.ssh.get_transport() - assert transport is not None - with SCPClient(transport) as conn: - conn.get(remote_path=remote_path, local_path= local_path, recursive= True) - self.ssh.close() - - @staticmethod - def uploading_info(uploaded_file_size: str, total_file_size: str): - logging.info('uploaded_file_size : {} total_file_size : {}'.format(uploaded_file_size, total_file_size)) \ No newline at end of file diff --git a/airavata-python-sdk/airavata_sdk/clients/sharing_registry_client.py b/airavata-python-sdk/airavata_sdk/clients/sharing_registry_client.py deleted file mode 100644 index adc7f014daf..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/sharing_registry_client.py +++ /dev/null @@ -1,767 +0,0 @@ -# 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. -# - -import json -import logging -from typing import Optional - -import grpc - -from airavata_sdk import Settings -from airavata_sdk.transport.utils import create_sharing_service_stub - -logger = logging.getLogger(__name__) -logger.setLevel(logging.DEBUG) - - -class SharingRegistryClient: - """Client for the Airavata Sharing Service (gRPC). - - Replaces the old Thrift SharingRegistryService client with full - domain, user, group, entity type, permission type, and entity CRUD - plus resource-level sharing RPCs. - """ - - def __init__(self, access_token: Optional[str] = None, claims: Optional[dict] = None): - self.settings = Settings() - host = self.settings.API_SERVER_HOSTNAME - port = self.settings.API_SERVER_PORT - secure = self.settings.API_SERVER_SECURE - - target = f"{host}:{port}" - if secure: - self.channel = grpc.secure_channel(target, grpc.ssl_channel_credentials()) - else: - self.channel = grpc.insecure_channel(target) - - self._metadata: list[tuple[str, str]] = [] - if access_token: - self._metadata.append(("authorization", f"Bearer {access_token}")) - - self._stub = create_sharing_service_stub(self.channel) - - def close(self): - self.channel.close() - - def _pb2(self): - from airavata_sdk.generated.services import sharing_service_pb2 - return sharing_service_pb2 - - def _sharing_pb2(self): - from airavata_sdk.generated.org.apache.airavata.model.sharing import sharing_pb2 - return sharing_pb2 - - # ======================================================================== - # Resource sharing RPCs - # ======================================================================== - - def share_resource_with_users(self, resource_id, user_permissions): - pb2 = self._pb2() - return self._stub.ShareResourceWithUsers( - pb2.ShareResourceWithUsersRequest(resource_id=resource_id, user_permissions=user_permissions), - metadata=self._metadata, - ) - - def share_resource_with_groups(self, resource_id, group_permissions): - pb2 = self._pb2() - return self._stub.ShareResourceWithGroups( - pb2.ShareResourceWithGroupsRequest(resource_id=resource_id, group_permissions=group_permissions), - metadata=self._metadata, - ) - - def revoke_sharing_of_resource_from_users(self, resource_id, user_permissions): - pb2 = self._pb2() - return self._stub.RevokeFromUsers( - pb2.RevokeFromUsersRequest(resource_id=resource_id, user_permissions=user_permissions), - metadata=self._metadata, - ) - - def revoke_sharing_of_resource_from_groups(self, resource_id, group_permissions): - pb2 = self._pb2() - return self._stub.RevokeFromGroups( - pb2.RevokeFromGroupsRequest(resource_id=resource_id, group_permissions=group_permissions), - metadata=self._metadata, - ) - - def get_all_accessible_users(self, resource_id, permission_type): - pb2 = self._pb2() - return self._stub.GetAllAccessibleUsers( - pb2.GetAllAccessibleUsersRequest(resource_id=resource_id, permission_type=permission_type), - metadata=self._metadata, - ) - - def get_all_directly_accessible_users(self, resource_id, permission_type): - pb2 = self._pb2() - return self._stub.GetAllDirectlyAccessibleUsers( - pb2.GetAllDirectlyAccessibleUsersRequest(resource_id=resource_id, permission_type=permission_type), - metadata=self._metadata, - ) - - def get_all_accessible_groups(self, resource_id, permission_type): - pb2 = self._pb2() - return self._stub.GetAllAccessibleGroups( - pb2.GetAllAccessibleGroupsRequest(resource_id=resource_id, permission_type=permission_type), - metadata=self._metadata, - ) - - def get_all_directly_accessible_groups(self, resource_id, permission_type): - pb2 = self._pb2() - return self._stub.GetAllDirectlyAccessibleGroups( - pb2.GetAllDirectlyAccessibleGroupsRequest(resource_id=resource_id, permission_type=permission_type), - metadata=self._metadata, - ) - - def user_has_access(self, resource_id, user_id, permission_type): - pb2 = self._pb2() - return self._stub.UserHasAccess( - pb2.UserHasAccessRequest(resource_id=resource_id, user_id=user_id, permission_type=permission_type), - metadata=self._metadata, - ) - - def revoke_from_users(self, resource_id, user_permissions): - pb2 = self._pb2() - return self._stub.RevokeFromUsers( - pb2.RevokeFromUsersRequest(resource_id=resource_id, user_permissions=user_permissions), - metadata=self._metadata, - ) - - def revoke_from_groups(self, resource_id, group_permissions): - pb2 = self._pb2() - return self._stub.RevokeFromGroups( - pb2.RevokeFromGroupsRequest(resource_id=resource_id, group_permissions=group_permissions), - metadata=self._metadata, - ) - - # ======================================================================== - # Domain CRUD - # ======================================================================== - - def create_domain(self, domain): - pb2 = self._pb2() - proto_domain = self._to_proto_domain(domain) - resp = self._stub.CreateDomain( - pb2.CreateDomainRequest(domain=proto_domain), - metadata=self._metadata, - ) - return resp.domain_id - - def update_domain(self, domain): - pb2 = self._pb2() - proto_domain = self._to_proto_domain(domain) - self._stub.UpdateDomain( - pb2.UpdateDomainRequest(domain=proto_domain), - metadata=self._metadata, - ) - return True - - def is_domain_exists(self, domain_id): - pb2 = self._pb2() - resp = self._stub.IsDomainExists( - pb2.IsDomainExistsRequest(domain_id=domain_id), - metadata=self._metadata, - ) - return resp.exists - - def delete_domain(self, domain_id): - pb2 = self._pb2() - self._stub.DeleteDomain( - pb2.DeleteDomainRequest(domain_id=domain_id), - metadata=self._metadata, - ) - return True - - def get_domain(self, domain_id): - pb2 = self._pb2() - return self._stub.GetDomain( - pb2.GetDomainRequest(domain_id=domain_id), - metadata=self._metadata, - ) - - def get_domains(self, offset, limit): - pb2 = self._pb2() - resp = self._stub.GetDomains( - pb2.GetDomainsRequest(offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.domains) - - # ======================================================================== - # User CRUD - # ======================================================================== - - def create_user(self, user): - pb2 = self._pb2() - proto_user = self._to_proto_user(user) - resp = self._stub.CreateUser( - pb2.CreateUserRequest(user=proto_user), - metadata=self._metadata, - ) - return resp.user_id - - def updated_user(self, user): - pb2 = self._pb2() - proto_user = self._to_proto_user(user) - self._stub.UpdateUser( - pb2.UpdateUserRequest(user=proto_user), - metadata=self._metadata, - ) - return True - - def update_user(self, user): - """Correctly-named alias for updated_user.""" - return self.updated_user(user) - - def is_user_exists(self, domain_id, user_id): - pb2 = self._pb2() - resp = self._stub.IsUserExists( - pb2.IsUserExistsRequest(domain_id=domain_id, user_id=user_id), - metadata=self._metadata, - ) - return resp.exists - - def delete_user(self, domain_id, user_id): - pb2 = self._pb2() - self._stub.DeleteUser( - pb2.DeleteUserRequest(domain_id=domain_id, user_id=user_id), - metadata=self._metadata, - ) - return True - - def get_user(self, domain_id, user_id): - pb2 = self._pb2() - return self._stub.GetUser( - pb2.GetUserRequest(domain_id=domain_id, user_id=user_id), - metadata=self._metadata, - ) - - def get_users(self, domain_id, offset, limit): - pb2 = self._pb2() - resp = self._stub.GetUsers( - pb2.GetUsersRequest(domain_id=domain_id, offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.users) - - # ======================================================================== - # Group CRUD - # ======================================================================== - - def create_group(self, group): - pb2 = self._pb2() - proto_group = self._to_proto_user_group(group) - resp = self._stub.CreateGroup( - pb2.CreateGroupRequest(group=proto_group), - metadata=self._metadata, - ) - return resp.group_id - - def update_group(self, group): - pb2 = self._pb2() - proto_group = self._to_proto_user_group(group) - self._stub.UpdateGroup( - pb2.UpdateGroupRequest(group=proto_group), - metadata=self._metadata, - ) - return True - - def is_group_exists(self, domain_id, group_id): - pb2 = self._pb2() - resp = self._stub.IsGroupExists( - pb2.IsGroupExistsRequest(domain_id=domain_id, group_id=group_id), - metadata=self._metadata, - ) - return resp.exists - - def delete_group(self, domain_id, group_id): - pb2 = self._pb2() - self._stub.DeleteGroup( - pb2.DeleteGroupRequest(domain_id=domain_id, group_id=group_id), - metadata=self._metadata, - ) - return True - - def get_group(self, domain_id, group_id): - pb2 = self._pb2() - return self._stub.GetGroup( - pb2.GetGroupRequest(domain_id=domain_id, group_id=group_id), - metadata=self._metadata, - ) - - def get_groups(self, domain_id, offset, limit): - pb2 = self._pb2() - resp = self._stub.GetGroups( - pb2.GetGroupsRequest(domain_id=domain_id, offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.groups) - - # ======================================================================== - # Group membership - # ======================================================================== - - def add_users_to_group(self, domain_id, user_ids, group_id): - pb2 = self._pb2() - self._stub.AddUsersToGroup( - pb2.AddUsersToGroupRequest(domain_id=domain_id, user_ids=user_ids, group_id=group_id), - metadata=self._metadata, - ) - return True - - def remove_users_from_group(self, domain_id, user_ids, group_id): - pb2 = self._pb2() - self._stub.RemoveUsersFromGroup( - pb2.RemoveUsersFromGroupRequest(domain_id=domain_id, user_ids=user_ids, group_id=group_id), - metadata=self._metadata, - ) - return True - - def transfer_group_ownership(self, domain_id, group_id, new_owner_id): - pb2 = self._pb2() - self._stub.TransferGroupOwnership( - pb2.TransferGroupOwnershipRequest(domain_id=domain_id, group_id=group_id, new_owner_id=new_owner_id), - metadata=self._metadata, - ) - return True - - def add_group_admins(self, domain_id, group_id, admin_ids): - pb2 = self._pb2() - self._stub.AddGroupAdmins( - pb2.AddGroupAdminsRequest(domain_id=domain_id, group_id=group_id, admin_ids=admin_ids), - metadata=self._metadata, - ) - return True - - def remove_group_admins(self, domain_id, group_id, admin_ids): - pb2 = self._pb2() - self._stub.RemoveGroupAdmins( - pb2.RemoveGroupAdminsRequest(domain_id=domain_id, group_id=group_id, admin_ids=admin_ids), - metadata=self._metadata, - ) - return True - - def has_admin_access(self, domain_id, group_id, admin_id): - pb2 = self._pb2() - resp = self._stub.HasAdminAccess( - pb2.HasAdminAccessRequest(domain_id=domain_id, group_id=group_id, admin_id=admin_id), - metadata=self._metadata, - ) - return resp.has_access - - def has_owner_access(self, domain_id, group_id, owner_id): - pb2 = self._pb2() - resp = self._stub.HasOwnerAccess( - pb2.HasOwnerAccessRequest(domain_id=domain_id, group_id=group_id, owner_id=owner_id), - metadata=self._metadata, - ) - return resp.has_access - - def get_group_members_of_type_user(self, domain_id, group_id, offset, limit): - pb2 = self._pb2() - resp = self._stub.GetGroupMembersOfTypeUser( - pb2.GetGroupMembersOfTypeUserRequest(domain_id=domain_id, group_id=group_id, offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.users) - - def get_group_members_of_type_group(self, domain_id, group_id, offset, limit): - pb2 = self._pb2() - resp = self._stub.GetGroupMembersOfTypeGroup( - pb2.GetGroupMembersOfTypeGroupRequest(domain_id=domain_id, group_id=group_id, offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.groups) - - def add_child_groups_to_parent_group(self, domain_id, child_ids, group_id): - pb2 = self._pb2() - self._stub.AddChildGroupsToParentGroup( - pb2.AddChildGroupsToParentGroupRequest(domain_id=domain_id, child_ids=child_ids, group_id=group_id), - metadata=self._metadata, - ) - return True - - def remove_child_group_from_parent_group(self, domain_id, child_id, group_id): - pb2 = self._pb2() - self._stub.RemoveChildGroupFromParentGroup( - pb2.RemoveChildGroupFromParentGroupRequest(domain_id=domain_id, child_id=child_id, group_id=group_id), - metadata=self._metadata, - ) - return True - - def get_all_member_groups_for_user(self, domain_id, user_id): - pb2 = self._pb2() - resp = self._stub.GetAllMemberGroupsForUser( - pb2.GetAllMemberGroupsForUserRequest(domain_id=domain_id, user_id=user_id), - metadata=self._metadata, - ) - return list(resp.groups) - - # ======================================================================== - # Entity type CRUD - # ======================================================================== - - def create_entity_type(self, entity_type): - pb2 = self._pb2() - proto_et = self._to_proto_entity_type(entity_type) - resp = self._stub.CreateEntityType( - pb2.CreateEntityTypeRequest(entity_type=proto_et), - metadata=self._metadata, - ) - return resp.entity_type_id - - def update_entity_type(self, entity_type): - pb2 = self._pb2() - proto_et = self._to_proto_entity_type(entity_type) - self._stub.UpdateEntityType( - pb2.UpdateEntityTypeRequest(entity_type=proto_et), - metadata=self._metadata, - ) - return True - - def is_entity_type_exists(self, domain_id, entity_type_id): - pb2 = self._pb2() - resp = self._stub.IsEntityTypeExists( - pb2.IsEntityTypeExistsRequest(domain_id=domain_id, entity_type_id=entity_type_id), - metadata=self._metadata, - ) - return resp.exists - - def delete_entity_type(self, domain_id, entity_type_id): - pb2 = self._pb2() - self._stub.DeleteEntityType( - pb2.DeleteEntityTypeRequest(domain_id=domain_id, entity_type_id=entity_type_id), - metadata=self._metadata, - ) - return True - - def get_entity_type(self, domain_id, entity_type_id): - pb2 = self._pb2() - return self._stub.GetEntityType( - pb2.GetEntityTypeRequest(domain_id=domain_id, entity_type_id=entity_type_id), - metadata=self._metadata, - ) - - def get_entity_types(self, domain_id, offset, limit): - pb2 = self._pb2() - resp = self._stub.GetEntityTypes( - pb2.GetEntityTypesRequest(domain_id=domain_id, offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.entity_types) - - # ======================================================================== - # Entity CRUD - # ======================================================================== - - def create_entity(self, entity): - pb2 = self._pb2() - proto_entity = self._to_proto_entity(entity) - resp = self._stub.CreateEntity( - pb2.CreateEntityRequest(entity=proto_entity), - metadata=self._metadata, - ) - return resp.entity_id - - def update_entity(self, entity): - pb2 = self._pb2() - proto_entity = self._to_proto_entity(entity) - self._stub.UpdateEntity( - pb2.UpdateEntityRequest(entity=proto_entity), - metadata=self._metadata, - ) - return True - - def is_entity_exists(self, domain_id, entity_id): - pb2 = self._pb2() - resp = self._stub.IsEntityExists( - pb2.IsEntityExistsRequest(domain_id=domain_id, entity_id=entity_id), - metadata=self._metadata, - ) - return resp.exists - - def delete_entity(self, domain_id, entity_id): - pb2 = self._pb2() - self._stub.DeleteEntity( - pb2.DeleteEntityRequest(domain_id=domain_id, entity_id=entity_id), - metadata=self._metadata, - ) - return True - - def get_entity(self, domain_id, entity_id): - pb2 = self._pb2() - return self._stub.GetEntity( - pb2.GetEntityRequest(domain_id=domain_id, entity_id=entity_id), - metadata=self._metadata, - ) - - def search_entities(self, domain_id, user_id, filters, offset, limit): - pb2 = self._pb2() - proto_filters = [self._to_proto_search_criteria(f) for f in filters] - resp = self._stub.SearchEntities( - pb2.SearchEntitiesRequest( - domain_id=domain_id, user_id=user_id, - filters=proto_filters, offset=offset, limit=limit, - ), - metadata=self._metadata, - ) - return list(resp.entities) - - def get_list_of_shared_users(self, domain_id, entity_id, permission_type_id): - pb2 = self._pb2() - resp = self._stub.GetListOfSharedUsers( - pb2.GetListOfSharedUsersRequest( - domain_id=domain_id, entity_id=entity_id, permission_type_id=permission_type_id, - ), - metadata=self._metadata, - ) - return list(resp.users) - - def get_list_of_directly_shared_users(self, domain_id, entity_id, permission_type_id): - pb2 = self._pb2() - resp = self._stub.GetListOfDirectlySharedUsers( - pb2.GetListOfDirectlySharedUsersRequest( - domain_id=domain_id, entity_id=entity_id, permission_type_id=permission_type_id, - ), - metadata=self._metadata, - ) - return list(resp.users) - - def get_list_of_shared_groups(self, domain_id, entity_id, permission_type_id): - pb2 = self._pb2() - resp = self._stub.GetListOfSharedGroups( - pb2.GetListOfSharedGroupsRequest( - domain_id=domain_id, entity_id=entity_id, permission_type_id=permission_type_id, - ), - metadata=self._metadata, - ) - return list(resp.groups) - - def get_list_of_directly_shared_groups(self, domain_id, entity_id, permission_type_id): - pb2 = self._pb2() - resp = self._stub.GetListOfDirectlySharedGroups( - pb2.GetListOfDirectlySharedGroupsRequest( - domain_id=domain_id, entity_id=entity_id, permission_type_id=permission_type_id, - ), - metadata=self._metadata, - ) - return list(resp.groups) - - # ======================================================================== - # Permission type CRUD - # ======================================================================== - - def create_permission_type(self, permission_type): - pb2 = self._pb2() - proto_pt = self._to_proto_permission_type(permission_type) - resp = self._stub.CreatePermissionType( - pb2.CreatePermissionTypeRequest(permission_type=proto_pt), - metadata=self._metadata, - ) - return resp.permission_type_id - - def update_permission_type(self, permission_type): - pb2 = self._pb2() - proto_pt = self._to_proto_permission_type(permission_type) - self._stub.UpdatePermissionType( - pb2.UpdatePermissionTypeRequest(permission_type=proto_pt), - metadata=self._metadata, - ) - return True - - def is_permission_exists(self, domain_id, permission_id): - pb2 = self._pb2() - resp = self._stub.IsPermissionExists( - pb2.IsPermissionExistsRequest(domain_id=domain_id, permission_id=permission_id), - metadata=self._metadata, - ) - return resp.exists - - def delete_permission_type(self, domain_id, permission_type_id): - pb2 = self._pb2() - self._stub.DeletePermissionType( - pb2.DeletePermissionTypeRequest(domain_id=domain_id, permission_type_id=permission_type_id), - metadata=self._metadata, - ) - return True - - def get_permission_type(self, domain_id, permission_type_id): - pb2 = self._pb2() - return self._stub.GetPermissionType( - pb2.GetPermissionTypeRequest(domain_id=domain_id, permission_type_id=permission_type_id), - metadata=self._metadata, - ) - - def get_permission_types(self, domain_id, offset, limit): - pb2 = self._pb2() - resp = self._stub.GetPermissionTypes( - pb2.GetPermissionTypesRequest(domain_id=domain_id, offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.permission_types) - - # ======================================================================== - # Entity sharing (Thrift-compatible) - # ======================================================================== - - def share_entity_with_users(self, domain_id, entity_id, user_list, permission_type_id, cascade_permission=True): - pb2 = self._pb2() - self._stub.ShareEntityWithUsers( - pb2.ShareEntityWithUsersRequest( - domain_id=domain_id, entity_id=entity_id, - user_list=user_list, permission_type_id=permission_type_id, - cascade_permission=cascade_permission, - ), - metadata=self._metadata, - ) - return True - - def revoke_entity_sharing_from_users(self, domain_id, entity_id, user_list, permission_type_id): - pb2 = self._pb2() - self._stub.RevokeEntitySharingFromUsers( - pb2.RevokeEntitySharingFromUsersRequest( - domain_id=domain_id, entity_id=entity_id, - user_list=user_list, permission_type_id=permission_type_id, - ), - metadata=self._metadata, - ) - return True - - def share_entity_with_groups(self, domain_id, entity_id, group_list, permission_type_id, cascade_permission=True): - pb2 = self._pb2() - self._stub.ShareEntityWithGroups( - pb2.ShareEntityWithGroupsRequest( - domain_id=domain_id, entity_id=entity_id, - group_list=group_list, permission_type_id=permission_type_id, - cascade_permission=cascade_permission, - ), - metadata=self._metadata, - ) - return True - - def revoke_entity_sharing_from_groups(self, domain_id, entity_id, group_list, permission_type_id): - pb2 = self._pb2() - self._stub.RevokeEntitySharingFromGroups( - pb2.RevokeEntitySharingFromGroupsRequest( - domain_id=domain_id, entity_id=entity_id, - group_list=group_list, permission_type_id=permission_type_id, - ), - metadata=self._metadata, - ) - return True - - # ======================================================================== - # Proto model builders (for callers passing dicts or Thrift-like objects) - # ======================================================================== - - def _to_proto_domain(self, domain): - """Convert a domain dict or object to a proto Domain message.""" - spb = self._sharing_pb2() - if isinstance(domain, spb.Domain): - return domain - kwargs = self._extract_fields(domain, [ - 'domain_id', 'name', 'description', 'created_time', - 'updated_time', 'initial_user_group_id', - ]) - return spb.Domain(**kwargs) - - def _to_proto_user(self, user): - spb = self._sharing_pb2() - if isinstance(user, spb.User): - return user - kwargs = self._extract_fields(user, [ - 'user_id', 'domain_id', 'user_name', 'first_name', - 'last_name', 'email', 'icon', 'created_time', 'updated_time', - ]) - return spb.User(**kwargs) - - def _to_proto_user_group(self, group): - spb = self._sharing_pb2() - if isinstance(group, spb.UserGroup): - return group - kwargs = self._extract_fields(group, [ - 'group_id', 'domain_id', 'name', 'description', 'owner_id', - 'group_type', 'group_cardinality', 'created_time', 'updated_time', - ]) - return spb.UserGroup(**kwargs) - - def _to_proto_entity_type(self, entity_type): - spb = self._sharing_pb2() - if isinstance(entity_type, spb.EntityType): - return entity_type - kwargs = self._extract_fields(entity_type, [ - 'entity_type_id', 'domain_id', 'name', 'description', - 'created_time', 'updated_time', - ]) - return spb.EntityType(**kwargs) - - def _to_proto_entity(self, entity): - spb = self._sharing_pb2() - if isinstance(entity, spb.Entity): - return entity - kwargs = self._extract_fields(entity, [ - 'entity_id', 'domain_id', 'entity_type_id', 'owner_id', - 'parent_entity_id', 'name', 'description', 'binary_data', - 'full_text', 'shared_count', 'original_entity_creation_time', - 'created_time', 'updated_time', - ]) - return spb.Entity(**kwargs) - - def _to_proto_permission_type(self, permission_type): - spb = self._sharing_pb2() - if isinstance(permission_type, spb.PermissionType): - return permission_type - kwargs = self._extract_fields(permission_type, [ - 'permission_type_id', 'domain_id', 'name', 'description', - 'created_time', 'updated_time', - ]) - return spb.PermissionType(**kwargs) - - def _to_proto_search_criteria(self, criteria): - spb = self._sharing_pb2() - if isinstance(criteria, spb.SearchCriteria): - return criteria - kwargs = self._extract_fields(criteria, [ - 'search_field', 'value', 'search_condition', - ]) - return spb.SearchCriteria(**kwargs) - - @staticmethod - def _extract_fields(obj, field_names): - """Extract fields from a dict or Thrift-like object.""" - kwargs = {} - for name in field_names: - # Try snake_case first, then camelCase - val = None - if isinstance(obj, dict): - val = obj.get(name) - if val is None: - # Try camelCase key - camel = _snake_to_camel(name) - val = obj.get(camel) - else: - # Try snake_case attribute - val = getattr(obj, name, None) - if val is None: - camel = _snake_to_camel(name) - val = getattr(obj, camel, None) - if val is not None: - kwargs[name] = val - return kwargs - - -def _snake_to_camel(name): - """Convert snake_case to camelCase.""" - parts = name.split('_') - return parts[0] + ''.join(p.capitalize() for p in parts[1:]) diff --git a/airavata-python-sdk/airavata_sdk/clients/tenant_profile_client.py b/airavata-python-sdk/airavata_sdk/clients/tenant_profile_client.py deleted file mode 100644 index 6639de91a19..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/tenant_profile_client.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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. -# - -import json -import logging -from typing import Optional - -import grpc - -from airavata_sdk import Settings -from airavata_sdk.transport.utils import create_gateway_service_stub - -logger = logging.getLogger(__name__) -logger.setLevel(logging.DEBUG) - - -class TenantProfileClient: - """Client for tenant/gateway profile operations (gRPC). - - Replaces the old Thrift TenantProfileService client. - Delegates to the GatewayService gRPC stub, which now covers - gateway CRUD that was previously in TenantProfileService. - """ - - def __init__(self, access_token: Optional[str] = None, claims: Optional[dict] = None): - self.settings = Settings() - host = self.settings.API_SERVER_HOSTNAME - port = self.settings.API_SERVER_PORT - secure = self.settings.API_SERVER_SECURE - - target = f"{host}:{port}" - if secure: - self.channel = grpc.secure_channel(target, grpc.ssl_channel_credentials()) - else: - self.channel = grpc.insecure_channel(target) - - self._metadata: list[tuple[str, str]] = [] - if access_token: - self._metadata.append(("authorization", f"Bearer {access_token}")) - - self._stub = create_gateway_service_stub(self.channel) - - def close(self): - self.channel.close() - - def add_gateway(self, gateway): - from airavata_sdk.generated.services import gateway_service_pb2 as pb2 - return self._stub.AddGateway( - pb2.AddGatewayRequest(gateway=gateway), - metadata=self._metadata, - ) - - def update_gateway(self, gateway_id, gateway): - from airavata_sdk.generated.services import gateway_service_pb2 as pb2 - return self._stub.UpdateGateway( - pb2.UpdateGatewayRequest(gateway_id=gateway_id, gateway=gateway), - metadata=self._metadata, - ) - - def get_gateway(self, gateway_id): - from airavata_sdk.generated.services import gateway_service_pb2 as pb2 - return self._stub.GetGateway( - pb2.GetGatewayRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - - def delete_gateway(self, gateway_id): - from airavata_sdk.generated.services import gateway_service_pb2 as pb2 - return self._stub.DeleteGateway( - pb2.DeleteGatewayRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - - def get_all_gateways(self): - from airavata_sdk.generated.services import gateway_service_pb2 as pb2 - return self._stub.GetAllGateways( - pb2.GetAllGatewaysRequest(), - metadata=self._metadata, - ) - - def is_gateway_exist(self, gateway_id): - from airavata_sdk.generated.services import gateway_service_pb2 as pb2 - return self._stub.IsGatewayExist( - pb2.IsGatewayExistRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - - def get_all_gateways_for_user(self, *args, **kwargs): - """Not available in gRPC GatewayService.""" - raise NotImplementedError("getAllGatewaysForUser not available in gRPC GatewayService") diff --git a/airavata-python-sdk/airavata_sdk/clients/user_profile_client.py b/airavata-python-sdk/airavata_sdk/clients/user_profile_client.py deleted file mode 100644 index 0164eb5fbd9..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/user_profile_client.py +++ /dev/null @@ -1,106 +0,0 @@ -# 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. -# - -import json -import logging -from typing import Optional - -import grpc - -from airavata_sdk import Settings -from airavata_sdk.transport.utils import create_user_profile_service_stub - -logger = logging.getLogger(__name__) -logger.setLevel(logging.DEBUG) - - -class UserProfileClient: - """Client for the Airavata UserProfileService (gRPC).""" - - def __init__(self, access_token: Optional[str] = None, claims: Optional[dict] = None): - self.settings = Settings() - host = self.settings.API_SERVER_HOSTNAME - port = self.settings.API_SERVER_PORT - secure = self.settings.API_SERVER_SECURE - - target = f"{host}:{port}" - if secure: - self.channel = grpc.secure_channel(target, grpc.ssl_channel_credentials()) - else: - self.channel = grpc.insecure_channel(target) - - self._metadata: list[tuple[str, str]] = [] - if access_token: - self._metadata.append(("authorization", f"Bearer {access_token}")) - - self._stub = create_user_profile_service_stub(self.channel) - - def close(self): - self.channel.close() - - def add_user_profile(self, user_profile): - from airavata_sdk.generated.services import user_profile_service_pb2 as pb2 - resp = self._stub.AddUserProfile( - pb2.AddUserProfileRequest(user_profile=user_profile), - metadata=self._metadata, - ) - return resp.user_id - - def update_user_profile(self, user_profile): - from airavata_sdk.generated.services import user_profile_service_pb2 as pb2 - self._stub.UpdateUserProfile( - pb2.UpdateUserProfileRequest(user_profile=user_profile), - metadata=self._metadata, - ) - - def get_user_profile_by_id(self, user_id, gateway_id): - from airavata_sdk.generated.services import user_profile_service_pb2 as pb2 - return self._stub.GetUserProfileById( - pb2.GetUserProfileByIdRequest(user_id=user_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def get_user_profile_by_name(self, user_name, gateway_id): - from airavata_sdk.generated.services import user_profile_service_pb2 as pb2 - return self._stub.GetUserProfileByName( - pb2.GetUserProfileByNameRequest(user_name=user_name, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def delete_user_profile(self, user_id): - from airavata_sdk.generated.services import user_profile_service_pb2 as pb2 - self._stub.DeleteUserProfile( - pb2.DeleteUserProfileRequest(user_id=user_id), - metadata=self._metadata, - ) - - def get_all_user_profiles_in_gateway(self, gateway_id, offset=0, limit=20): - from airavata_sdk.generated.services import user_profile_service_pb2 as pb2 - resp = self._stub.GetAllUserProfilesInGateway( - pb2.GetAllUserProfilesInGatewayRequest( - gateway_id=gateway_id, offset=offset, limit=limit, - ), - metadata=self._metadata, - ) - return list(resp.user_profiles) - - def does_user_exist(self, user_name, gateway_id): - from airavata_sdk.generated.services import user_profile_service_pb2 as pb2 - resp = self._stub.DoesUserExist( - pb2.DoesUserExistRequest(user_name=user_name, gateway_id=gateway_id), - metadata=self._metadata, - ) - return resp.exists diff --git a/airavata-python-sdk/airavata_sdk/clients/utils/__init__.py b/airavata-python-sdk/airavata_sdk/clients/utils/__init__.py deleted file mode 100644 index 92883a4eeb9..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/utils/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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. -# - diff --git a/airavata-python-sdk/airavata_sdk/clients/utils/api_server_client_util.py b/airavata-python-sdk/airavata_sdk/clients/utils/api_server_client_util.py deleted file mode 100644 index 09cb9e94058..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/utils/api_server_client_util.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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. -# - -import logging -from typing import Optional - -from airavata_sdk.clients.api_server_client import APIServerClient -from airavata_sdk.clients.keycloak_token_fetcher import Authenticator - -logger = logging.getLogger(__name__) -logger.setLevel(logging.INFO) - - -class APIServerClientUtil(object): - - def __init__(self, gateway_id: str, username: str, password: Optional[str], access_token: Optional[str] = None): - self.authenticator = Authenticator() - if access_token: - self.token = self.authenticator.get_airavata_authz_token( - gateway_id=gateway_id, - username=username, - token=access_token, - ) - else: - assert password is not None - self.token = self.authenticator.get_token_and_user_info_password_flow( - gateway_id=gateway_id, - username=username, - password=password, - ) - self.gateway_id = gateway_id - self.username = username - # Auth is now passed via constructor metadata, not per-call - self.api_server_client = APIServerClient( - access_token=self.token.access_token, - claims=self.token.claims_map, - ) - - def get_project_id(self, project_name: str) -> Optional[str]: - response = self.api_server_client.get_user_projects(self.gateway_id, self.username, 10, 0) - for project in response.projects: - if project.name == project_name and project.owner == self.username: - return project.project_id - return None - - def get_execution_id(self, application_name: str): - response = self.api_server_client.get_all_application_interfaces(self.gateway_id) - for app in response.application_interfaces: - if app.application_name == application_name: - return app.application_interface_id - return None - - def get_resource_host_id(self, resource_name: str): - response = self.api_server_client.get_all_compute_resource_names() - for k, v in response.compute_resource_names.items(): - if v == resource_name: - return k - return None - - def get_group_resource_profile_id(self, group_resource_profile_name: str): - response = self.api_server_client.get_group_resource_list() - for x in response.group_resource_profiles: - if x.group_resource_profile_name == group_resource_profile_name: - return x.group_resource_profile_id - return None - - def get_storage_resource_id(self, storage_name: str): - response = self.api_server_client.get_all_storage_resource_names() - for k, v in response.storage_resource_names.items(): - if v == storage_name: - return k - return None - - def get_queue_names(self, resource_host_id: str): - resource = self.api_server_client.get_compute_resource(resource_host_id) - batch_queues = resource.batch_queues - allowed_queue_names = [] - for queue in batch_queues: - allowed_queue_names.append(queue.queue_name) - return allowed_queue_names diff --git a/airavata-python-sdk/airavata_sdk/clients/utils/data_model_creation_util.py b/airavata-python-sdk/airavata_sdk/clients/utils/data_model_creation_util.py deleted file mode 100644 index b44b5da94b0..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/utils/data_model_creation_util.py +++ /dev/null @@ -1,181 +0,0 @@ -# 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. -# - -import logging -from typing import Optional - -from airavata_sdk.generated.org.apache.airavata.model.application.io import application_io_pb2 -from airavata_sdk.generated.org.apache.airavata.model.data.replica import replica_catalog_pb2 -from airavata_sdk.generated.org.apache.airavata.model.experiment import experiment_pb2 -from airavata_sdk.generated.org.apache.airavata.model.scheduling import scheduling_pb2 -from airavata_sdk.clients.api_server_client import APIServerClient -from airavata_sdk.clients.keycloak_token_fetcher import Authenticator -from airavata_sdk.clients.utils.api_server_client_util import APIServerClientUtil - -logger = logging.getLogger(__name__) -logger.setLevel(logging.DEBUG) - - -class DataModelCreationUtil(object): - - def __init__(self, gateway_id: str, username: str, password: Optional[str], access_token: Optional[str] = None): - self.authenticator = Authenticator() - if access_token: - self.token = self.authenticator.get_airavata_authz_token( - gateway_id=gateway_id, - username=username, - token=access_token, - ) - else: - assert password is not None - self.token = self.authenticator.get_token_and_user_info_password_flow( - gateway_id=gateway_id, - username=username, - password=password, - ) - self.gateway_id = gateway_id - self.username = username - self.password = password - self.api_server_client = APIServerClient( - access_token=self.token.access_token, - claims=self.token.claims_map, - ) - self.airavata_util = APIServerClientUtil( - self.gateway_id, - self.username, - self.password, - access_token, - ) - - def get_experiment_data_model_for_single_application(self, project_name: str, application_name: str, experiment_name: str, description: str): - execution_id = self.airavata_util.get_execution_id(application_name) - project_id = self.airavata_util.get_project_id(project_name) - assert project_id is not None - experiment = experiment_pb2.ExperimentModel( - experiment_name=experiment_name, - gateway_id=self.gateway_id, - user_name=self.username, - description=description, - project_id=project_id, - experiment_type=experiment_pb2.SINGLE_APPLICATION, - execution_id=execution_id, - ) - return experiment - - def configure_computation_resource_scheduling( - self, - experiment_model, - computation_resource_name: str, - group_resource_profile_name: str, - inputStorageId: str, - outputStorageId: str, - node_count: int, - total_cpu_count: int, - queue_name: str, - wall_time_limit: int, - experiment_dir_path: str, - auto_schedule: bool = False, - ): - resource_host_id = self.airavata_util.get_resource_host_id(computation_resource_name) - group_resource_profile_id = self.airavata_util.get_group_resource_profile_id(group_resource_profile_name) - computRes = scheduling_pb2.ComputationalResourceSchedulingModel( - resource_host_id=resource_host_id, - node_count=node_count, - total_cpu_count=total_cpu_count, - queue_name=queue_name, - wall_time_limit=wall_time_limit, - ) - - userConfigData = experiment_pb2.UserConfigurationDataModel( - computational_resource_scheduling=computRes, - group_resource_profile_id=group_resource_profile_id, - input_storage_resource_id=inputStorageId, - output_storage_resource_id=outputStorageId, - experiment_data_dir=experiment_dir_path, - airavata_auto_schedule=auto_schedule, - ) - experiment_model.user_configuration_data.CopyFrom(userConfigData) - return experiment_model - - def register_input_file( - self, - file_identifier: str, - storage_name: str, - storageId: str, - input_file_name: str, - uploaded_storage_path: str, - ): - replicaLocation = replica_catalog_pb2.DataReplicaLocationModel( - storage_resource_id=storageId, - replica_name="{} gateway data store copy".format(input_file_name), - replica_location_category=replica_catalog_pb2.GATEWAY_DATA_STORE, - file_path="file://{}:{}".format(storage_name, uploaded_storage_path + input_file_name), - ) - dataProductModel = replica_catalog_pb2.DataProductModel( - gateway_id=self.gateway_id, - owner_name=self.username, - product_name=file_identifier, - data_product_type=replica_catalog_pb2.FILE, - replica_locations=[replicaLocation], - ) - return self.api_server_client.register_data_product(dataProductModel) - - def configure_input_and_outputs( - self, - experiment_model, - input_files: list[str], - application_name: str, - file_mapping: dict[str, str]={}, - ): - execution_id = self.airavata_util.get_execution_id(application_name) - assert execution_id is not None - inputs_response = self.api_server_client.get_application_inputs(execution_id) - - # inputs_response is a GetApplicationInputsResponse with a repeated application_inputs field - inputs = list(inputs_response.application_inputs) - - configured_inputs = [] - if len(file_mapping.keys()) == 0: - count = 0 - for obj in inputs: - if count < len(input_files): - obj.value = input_files[count] - count += 1 - configured_inputs = inputs - else: - for key in file_mapping.keys(): - for inp in inputs: - if key == inp.name: - # Compare against the proto DataType members (inp.type stays the - # proto enum). URI -> single path; URI_COLLECTION -> comma-joined. - if inp.type == application_io_pb2.URI: - inp.value = file_mapping[key] - configured_inputs.append(inp) - elif inp.type == application_io_pb2.URI_COLLECTION: - val = ','.join(file_mapping[key]) - inp.value = val - configured_inputs.append(inp) - - del experiment_model.experiment_inputs[:] - experiment_model.experiment_inputs.extend(configured_inputs) - - outputs_response = self.api_server_client.get_application_outputs(execution_id) - outputs = list(outputs_response.application_outputs) - - del experiment_model.experiment_outputs[:] - experiment_model.experiment_outputs.extend(outputs) - - return experiment_model diff --git a/airavata-python-sdk/airavata_sdk/clients/utils/experiment_handler_util.py b/airavata-python-sdk/airavata_sdk/clients/utils/experiment_handler_util.py deleted file mode 100644 index 473238d1f26..00000000000 --- a/airavata-python-sdk/airavata_sdk/clients/utils/experiment_handler_util.py +++ /dev/null @@ -1,235 +0,0 @@ -# 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. -# -import getpass -import logging -import os -import time -from typing import Optional - -import jwt - -from airavata_sdk.generated.org.apache.airavata.model.status import status_pb2 -from airavata_sdk.clients.api_server_client import APIServerClient -from airavata_sdk.clients.keycloak_token_fetcher import Authenticator -from airavata_sdk.clients.sftp_file_handling_client import SFTPConnector -from airavata_sdk.clients.utils.api_server_client_util import APIServerClientUtil -from airavata_sdk.clients.utils.data_model_creation_util import DataModelCreationUtil -from airavata_sdk import Settings - -logger = logging.getLogger('airavata_sdk.clients') -logger.setLevel(logging.INFO) - - -class ExperimentHandlerUtil(object): - def __init__(self, access_token: Optional[str] = None): - self.settings = Settings() - self.authenticator = Authenticator() - if access_token is None: - self.authenticator.authenticate_with_auth_code() - access_token = getpass.getpass('Copy paste the access token') - self.access_token = access_token - decode = jwt.decode(access_token, options={"verify_signature": False}) - self.user_id = decode['preferred_username'] - self.airavata_token = self.authenticator.get_airavata_authz_token( - gateway_id=self.settings.GATEWAY_ID, - username=self.user_id, - token=access_token, - ) - self.airavata_util = APIServerClientUtil( - gateway_id=self.settings.GATEWAY_ID, - username=self.user_id, - password=None, - access_token=access_token, - ) - - self.data_model_client = DataModelCreationUtil( - username=self.user_id, - password=None, - gateway_id=self.settings.GATEWAY_ID, - access_token=access_token) - - self.api_server_client = APIServerClient() - - def queue_names(self, computation_resource_name: str): - resource_id = self.airavata_util.get_resource_host_id(computation_resource_name) - assert resource_id is not None - return self.airavata_util.get_queue_names(resource_id) - - def launch_experiment( - self, - experiment_name: str = "default_exp", - description: str = "this is default exp", - local_input_path: str = "/tmp", - input_file_mapping: dict[str, str] = {}, - computation_resource_name: Optional[str] = None, - queue_name: Optional[str] = None, - node_count: int = 1, - cpu_count: int = 1, - walltime: int = 30, - auto_schedule: bool = False, - output_path: str = '.', - group_name: str = "Default", - application_name: str = "Default Application", - project_name: str = "Default Project", - output_storage_host: str | None = None, - ): - execution_id = self.airavata_util.get_execution_id(application_name) - assert execution_id is not None - project_id = self.airavata_util.get_project_id(project_name) - assert computation_resource_name is not None - resource_host_id = self.airavata_util.get_resource_host_id(computation_resource_name) - group_resource_profile_id = self.airavata_util.get_group_resource_profile_id(group_name) - - input_storage_host = self.settings.STORAGE_RESOURCE_HOST - assert input_storage_host is not None - - sftp_port = self.settings.SFTP_PORT - assert sftp_port is not None - - input_storage_id = self.airavata_util.get_storage_resource_id(input_storage_host) - assert input_storage_id is not None - - if output_storage_host is not None: - output_storage_id = self.airavata_util.get_storage_resource_id(output_storage_host) - else: - output_storage_id = input_storage_id - assert output_storage_id is not None - - assert project_name is not None - assert application_name is not None - assert experiment_name is not None - assert description is not None - logger.info("creating experiment %s", experiment_name) - experiment = self.data_model_client.get_experiment_data_model_for_single_application( - project_name=project_name, - application_name=application_name, - experiment_name=experiment_name, - description=description, - ) - - logger.info("connnecting to file upload endpoint %s : %s", input_storage_host, sftp_port) - sftp_connector = SFTPConnector(host=input_storage_host, - port=sftp_port, - username=self.user_id, - password=self.access_token) - - assert local_input_path is not None - path_suffix = sftp_connector.upload_files(local_input_path, - project_name, - experiment_name) - - logger.info("Input files uploaded to %s", path_suffix) - - path = self.settings.GATEWAY_DATA_STORE_DIR + path_suffix - - assert queue_name is not None - assert node_count is not None - assert cpu_count is not None - assert walltime is not None - - logger.info("configuring inputs ......") - experiment = self.data_model_client.configure_computation_resource_scheduling(experiment_model=experiment, - computation_resource_name=computation_resource_name, - group_resource_profile_name=group_name, - inputStorageId=input_storage_id, - outputStorageId=output_storage_id, - node_count=int(node_count), - total_cpu_count=int(cpu_count), - wall_time_limit=int(walltime), - queue_name=queue_name, - experiment_dir_path=path, - auto_schedule=auto_schedule) - input_files = [] - if (len(input_file_mapping.keys()) > 0): - new_file_mapping = {} - for key in input_file_mapping.keys(): - if type(input_file_mapping[key]) == list: - data_uris = [] - for x in input_file_mapping[key]: - data_uri = self.data_model_client.register_input_file(file_identifier=x, - storage_name=input_storage_host, - storageId=input_storage_id, - input_file_name=x, - uploaded_storage_path=path) - data_uris.append(data_uri) - new_file_mapping[key] = data_uris - else: - x = input_file_mapping[key] - data_uri = self.data_model_client.register_input_file(file_identifier=x, - storage_name=input_storage_host, - storageId=input_storage_id, - input_file_name=x, - uploaded_storage_path=path) - new_file_mapping[key] = data_uri - experiment = self.data_model_client.configure_input_and_outputs(experiment, input_files=[], - application_name=application_name, - file_mapping=new_file_mapping) - else: - for x in os.listdir(local_input_path): - if os.path.isfile(local_input_path + '/' + x): - input_files.append(x) - - if len(input_files) > 0: - data_uris = [] - for x in input_files: - data_uri = self.data_model_client.register_input_file(file_identifier=x, - storage_name=input_storage_host, - storageId=input_storage_id, - input_file_name=x, - uploaded_storage_path=path) - data_uris.append(data_uri) - experiment = self.data_model_client.configure_input_and_outputs(experiment, input_files=data_uris, - application_name=application_name) - else: - inputs = self.api_server_client.get_application_inputs(self.airavata_token, execution_id) - experiment.experimentInputs = inputs - - outputs = self.api_server_client.get_application_outputs(self.airavata_token, execution_id) - - experiment.experimentOutputs = outputs - - # create experiment - ex_id = self.api_server_client.create_experiment(self.airavata_token, self.settings.GATEWAY_ID, experiment) - - # launch experiment - self.api_server_client.launch_experiment(self.airavata_token, ex_id, self.settings.GATEWAY_ID) - - logger.info("experiment launched id: %s", ex_id) - - experiment_url = f"{self.settings.GATEWAY_URL}/workspace/experiments/{ex_id}" - logger.info("For more information visit %s", experiment_url) - - if self.settings.MONITOR_STATUS: - # status.state stays the proto ExperimentState enum; render its NAME via the - # enum's own Name() (no hardcoded {int:name} table) and gate the poll loop on - # named terminal members rather than a magic-int threshold. - ES = status_pb2.ExperimentState - terminal = { - ES.EXPERIMENT_STATE_COMPLETED, - ES.EXPERIMENT_STATE_CANCELED, - ES.EXPERIMENT_STATE_FAILED, - } - status = self.api_server_client.get_experiment_status(ex_id) - if status is not None: - logger.info("Initial state %s", ES.Name(status.state)) - while status.state not in terminal: - time.sleep(30) - status = self.api_server_client.get_experiment_status(ex_id) - logger.info("State %s", ES.Name(status.state)) - - logger.info("Completed") - remote_path = path_suffix.split(self.user_id)[1] - sftp_connector.download_files(output_path, remote_path) diff --git a/airavata-python-sdk/airavata_sdk/facade/__init__.py b/airavata-python-sdk/airavata_sdk/facade/__init__.py deleted file mode 100644 index add6475280e..00000000000 --- a/airavata-python-sdk/airavata_sdk/facade/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -from airavata_sdk.facade.agent import AgentClient -from airavata_sdk.facade.compute import ComputeClient -from airavata_sdk.facade.credential import CredentialClient -from airavata_sdk.facade.iam import IamClient -from airavata_sdk.facade.research import ResearchClient -from airavata_sdk.facade.sharing import SharingClient -from airavata_sdk.facade.storage import StorageClient - -__all__ = [ - "AgentClient", - "ComputeClient", - "CredentialClient", - "IamClient", - "ResearchClient", - "SharingClient", - "StorageClient", -] diff --git a/airavata-python-sdk/airavata_sdk/facade/agent.py b/airavata-python-sdk/airavata_sdk/facade/agent.py deleted file mode 100644 index cc30a696829..00000000000 --- a/airavata-python-sdk/airavata_sdk/facade/agent.py +++ /dev/null @@ -1,229 +0,0 @@ -import importlib - -from google.protobuf.struct_pb2 import Struct - -from airavata_sdk.transport.utils import ( - create_agent_interaction_service_stub, - create_plan_service_stub, -) - - -class AgentClient: - """Agent interaction (tunnels, env setup, command/Jupyter/Python execution) - and plan management.""" - - def __init__(self, channel, metadata, gateway_id): - self._metadata = metadata - self._gateway_id = gateway_id - self._agent = create_agent_interaction_service_stub(channel) - self._plan = create_plan_service_stub(channel) - - @staticmethod - def _svc(name): - return importlib.import_module(f"airavata_sdk.generated.services.{name}") - - # ================================================================ - # Agent Interaction Service - # ================================================================ - - def get_agent_info(self, agent_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.GetAgentInfo( - pb2.GetAgentInfoRequest(agent_id=agent_id), - metadata=self._metadata, - ) - - # --- Tunnel --- - - def setup_tunnel(self, agent_id: str, local_port: int, local_bind_host: str = ""): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.SetupTunnel( - pb2.AgentTunnelCreateRequest(agent_id=agent_id, local_port=local_port, local_bind_host=local_bind_host), - metadata=self._metadata, - ) - - def get_tunnel_response(self, execution_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.GetTunnelResponse( - pb2.GetExecutionResponseRequest(execution_id=execution_id), - metadata=self._metadata, - ) - - def terminate_tunnel(self, agent_id: str, tunnel_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.TerminateTunnel( - pb2.AgentTunnelTerminateRequest(agent_id=agent_id, tunnel_id=tunnel_id), - metadata=self._metadata, - ) - - # --- Environment setup --- - - def setup_env(self, agent_id: str, env_name: str, libraries: list[str] = None, pip: list[str] = None): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.SetupEnv( - pb2.AgentEnvSetupRequest( - agent_id=agent_id, env_name=env_name, - libraries=libraries or [], pip=pip or [], - ), - metadata=self._metadata, - ) - - def get_env_setup_response(self, execution_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.GetEnvSetupResponse( - pb2.GetExecutionResponseRequest(execution_id=execution_id), - metadata=self._metadata, - ) - - # --- Kernel restart --- - - def restart_kernel(self, agent_id: str, env_name: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.RestartKernel( - pb2.AgentKernelRestartRequest(agent_id=agent_id, env_name=env_name), - metadata=self._metadata, - ) - - def get_kernel_restart_response(self, execution_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.GetKernelRestartResponse( - pb2.GetExecutionResponseRequest(execution_id=execution_id), - metadata=self._metadata, - ) - - # --- Shell command execution --- - - def execute_command(self, agent_id: str, env_name: str, working_dir: str, arguments: list[str] = None): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.ExecuteCommand( - pb2.AgentCommandExecutionRequest( - agent_id=agent_id, env_name=env_name, - working_dir=working_dir, arguments=arguments or [], - ), - metadata=self._metadata, - ) - - def get_command_response(self, execution_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.GetCommandResponse( - pb2.GetExecutionResponseRequest(execution_id=execution_id), - metadata=self._metadata, - ) - - # --- Async shell command execution --- - - def execute_async_command(self, agent_id: str, env_name: str, working_dir: str, arguments: list[str] = None): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.ExecuteAsyncCommand( - pb2.AgentAsyncCommandExecutionRequest( - agent_id=agent_id, env_name=env_name, - working_dir=working_dir, arguments=arguments or [], - ), - metadata=self._metadata, - ) - - def get_async_command_response(self, execution_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.GetAsyncCommandResponse( - pb2.GetExecutionResponseRequest(execution_id=execution_id), - metadata=self._metadata, - ) - - def list_async_commands(self, agent_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.ListAsyncCommands( - pb2.AgentAsyncCommandListRequest(agent_id=agent_id), - metadata=self._metadata, - ) - - def get_async_command_list_response(self, execution_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.GetAsyncCommandListResponse( - pb2.GetExecutionResponseRequest(execution_id=execution_id), - metadata=self._metadata, - ) - - def terminate_async_command(self, agent_id: str, process_id: int): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.TerminateAsyncCommand( - pb2.AgentAsyncCommandTerminateRequest(agent_id=agent_id, process_id=process_id), - metadata=self._metadata, - ) - - def get_async_command_terminate_response(self, execution_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.GetAsyncCommandTerminateResponse( - pb2.GetExecutionResponseRequest(execution_id=execution_id), - metadata=self._metadata, - ) - - # --- Jupyter execution --- - - def execute_jupyter(self, agent_id: str, env_name: str, code: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.ExecuteJupyter( - pb2.AgentJupyterExecutionRequest(agent_id=agent_id, env_name=env_name, code=code), - metadata=self._metadata, - ) - - def get_jupyter_response(self, execution_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.GetJupyterResponse( - pb2.GetExecutionResponseRequest(execution_id=execution_id), - metadata=self._metadata, - ) - - # --- Python execution --- - - def execute_python(self, agent_id: str, env_name: str, working_dir: str, code: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.ExecutePython( - pb2.AgentPythonExecutionRequest( - agent_id=agent_id, env_name=env_name, - working_dir=working_dir, code=code, - ), - metadata=self._metadata, - ) - - def get_python_response(self, execution_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._agent.GetPythonResponse( - pb2.GetExecutionResponseRequest(execution_id=execution_id), - metadata=self._metadata, - ) - - # ================================================================ - # Plan Service - # ================================================================ - - def save_plan(self, id: str, data: dict): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - struct = Struct() - struct.update(data) - return self._plan.SavePlan( - pb2.SavePlanRequest(id=id, data=struct), - metadata=self._metadata, - ) - - def get_plan(self, plan_id: str): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._plan.GetPlan( - pb2.GetPlanRequest(plan_id=plan_id), - metadata=self._metadata, - ) - - def get_plans_by_user(self): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - return self._plan.GetPlansByUser( - pb2.GetPlansByUserRequest(), - metadata=self._metadata, - ) - - def update_plan(self, plan_id: str, data: dict): - from airavata_sdk.generated.services import agent_service_pb2 as pb2 - struct = Struct() - struct.update(data) - return self._plan.UpdatePlan( - pb2.UpdatePlanRequest(plan_id=plan_id, data=struct), - metadata=self._metadata, - ) diff --git a/airavata-python-sdk/airavata_sdk/facade/compute.py b/airavata-python-sdk/airavata_sdk/facade/compute.py deleted file mode 100644 index a4c7a93aa78..00000000000 --- a/airavata-python-sdk/airavata_sdk/facade/compute.py +++ /dev/null @@ -1,540 +0,0 @@ -import importlib - -from airavata_sdk.transport.utils import ( - create_resource_service_stub, - create_gateway_resource_profile_service_stub, - create_group_resource_profile_service_stub, - create_user_resource_profile_service_stub, -) - - -class ComputeClient: - """Compute resource catalog, job submissions, gateway/group/user resource profiles.""" - - def __init__(self, channel, metadata, gateway_id): - self._metadata = metadata - self._gateway_id = gateway_id - self._resource = create_resource_service_stub(channel) - self._gw_profile = create_gateway_resource_profile_service_stub(channel) - self._grp_profile = create_group_resource_profile_service_stub(channel) - self._user_profile = create_user_resource_profile_service_stub(channel) - - @staticmethod - def _svc(name): - return importlib.import_module(f"airavata_sdk.generated.services.{name}") - - # ================================================================ - # Resource Service -- compute resources - # ================================================================ - - def register_compute_resource(self, compute_resource): - pb2 = self._svc("resource_service_pb2") - response = self._resource.RegisterComputeResource( - pb2.RegisterComputeResourceRequest(compute_resource=compute_resource), - metadata=self._metadata, - ) - return response.compute_resource_id - - def get_compute_resource(self, compute_resource_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.GetComputeResource( - pb2.GetComputeResourceRequest(compute_resource_id=compute_resource_id), - metadata=self._metadata, - ) - - def get_all_compute_resource_names(self): - pb2 = self._svc("resource_service_pb2") - response = self._resource.GetAllComputeResourceNames( - pb2.GetAllComputeResourceNamesRequest(), - metadata=self._metadata, - ) - return dict(response.compute_resource_names) - - def update_compute_resource(self, compute_resource_id, compute_resource): - pb2 = self._svc("resource_service_pb2") - return self._resource.UpdateComputeResource( - pb2.UpdateComputeResourceRequest(compute_resource_id=compute_resource_id, compute_resource=compute_resource), - metadata=self._metadata, - ) - - def delete_compute_resource(self, compute_resource_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.DeleteComputeResource( - pb2.DeleteComputeResourceRequest(compute_resource_id=compute_resource_id), - metadata=self._metadata, - ) - - # --- Job Submission --- - - def add_local_submission_details(self, compute_resource_id, priority, local_submission): - pb2 = self._svc("resource_service_pb2") - response = self._resource.AddLocalSubmission( - pb2.AddLocalSubmissionRequest(compute_resource_id=compute_resource_id, priority=priority, local_submission=local_submission), - metadata=self._metadata, - ) - return response.submission_id - - def update_local_submission_details(self, submission_id, local_submission): - pb2 = self._svc("resource_service_pb2") - return self._resource.UpdateLocalSubmission( - pb2.UpdateLocalSubmissionRequest(submission_id=submission_id, local_submission=local_submission), - metadata=self._metadata, - ) - - def get_local_job_submission(self, submission_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.GetLocalJobSubmission( - pb2.GetLocalJobSubmissionRequest(submission_id=submission_id), - metadata=self._metadata, - ) - - def add_ssh_job_submission_details(self, compute_resource_id, priority, ssh_job_submission): - pb2 = self._svc("resource_service_pb2") - response = self._resource.AddSSHJobSubmission( - pb2.AddSSHJobSubmissionRequest(compute_resource_id=compute_resource_id, priority=priority, ssh_job_submission=ssh_job_submission), - metadata=self._metadata, - ) - return response.submission_id - - def add_ssh_fork_job_submission_details(self, compute_resource_id, priority, ssh_job_submission): - pb2 = self._svc("resource_service_pb2") - response = self._resource.AddSSHForkJobSubmission( - pb2.AddSSHForkJobSubmissionRequest(compute_resource_id=compute_resource_id, priority=priority, ssh_job_submission=ssh_job_submission), - metadata=self._metadata, - ) - return response.submission_id - - def get_ssh_job_submission(self, submission_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.GetSSHJobSubmission( - pb2.GetSSHJobSubmissionRequest(submission_id=submission_id), - metadata=self._metadata, - ) - - def add_unicore_job_submission_details(self, compute_resource_id, priority, unicore_job_submission): - pb2 = self._svc("resource_service_pb2") - response = self._resource.AddUnicoreJobSubmission( - pb2.AddUnicoreJobSubmissionRequest(compute_resource_id=compute_resource_id, priority=priority, unicore_job_submission=unicore_job_submission), - metadata=self._metadata, - ) - return response.submission_id - - def get_unicore_job_submission(self, submission_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.GetUnicoreJobSubmission( - pb2.GetUnicoreJobSubmissionRequest(submission_id=submission_id), - metadata=self._metadata, - ) - - def add_cloud_job_submission_details(self, compute_resource_id, priority, cloud_job_submission): - pb2 = self._svc("resource_service_pb2") - response = self._resource.AddCloudJobSubmission( - pb2.AddCloudJobSubmissionRequest(compute_resource_id=compute_resource_id, priority=priority, cloud_job_submission=cloud_job_submission), - metadata=self._metadata, - ) - return response.submission_id - - def get_cloud_job_submission(self, submission_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.GetCloudJobSubmission( - pb2.GetCloudJobSubmissionRequest(submission_id=submission_id), - metadata=self._metadata, - ) - - def update_ssh_job_submission_details(self, submission_id, ssh_job_submission): - pb2 = self._svc("resource_service_pb2") - return self._resource.UpdateSSHJobSubmission( - pb2.UpdateSSHJobSubmissionRequest(submission_id=submission_id, ssh_job_submission=ssh_job_submission), - metadata=self._metadata, - ) - - def update_cloud_job_submission_details(self, submission_id, cloud_job_submission): - pb2 = self._svc("resource_service_pb2") - return self._resource.UpdateCloudJobSubmission( - pb2.UpdateCloudJobSubmissionRequest(submission_id=submission_id, cloud_job_submission=cloud_job_submission), - metadata=self._metadata, - ) - - def update_unicore_job_submission_details(self, submission_id, unicore_job_submission): - pb2 = self._svc("resource_service_pb2") - return self._resource.UpdateUnicoreJobSubmission( - pb2.UpdateUnicoreJobSubmissionRequest(submission_id=submission_id, unicore_job_submission=unicore_job_submission), - metadata=self._metadata, - ) - - def delete_job_submission_interface(self, compute_resource_id, submission_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.DeleteJobSubmissionInterface( - pb2.DeleteJobSubmissionInterfaceRequest(compute_resource_id=compute_resource_id, submission_id=submission_id), - metadata=self._metadata, - ) - - def delete_batch_queue(self, compute_resource_id, queue_name): - pb2 = self._svc("resource_service_pb2") - return self._resource.DeleteBatchQueue( - pb2.DeleteBatchQueueRequest(compute_resource_id=compute_resource_id, queue_name=queue_name), - metadata=self._metadata, - ) - - # ================================================================ - # Gateway Resource Profile Service - # ================================================================ - - def register_gateway_resource_profile(self, gateway_resource_profile): - pb2 = self._svc("gateway_resource_profile_service_pb2") - response = self._gw_profile.RegisterGatewayResourceProfile( - pb2.RegisterGatewayResourceProfileRequest(gateway_resource_profile=gateway_resource_profile), - metadata=self._metadata, - ) - return response.gateway_id - - def get_gateway_resource_profile(self, gateway_id): - pb2 = self._svc("gateway_resource_profile_service_pb2") - return self._gw_profile.GetGatewayResourceProfile( - pb2.GetGatewayResourceProfileRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - - def update_gateway_resource_profile(self, gateway_id, gateway_resource_profile): - pb2 = self._svc("gateway_resource_profile_service_pb2") - return self._gw_profile.UpdateGatewayResourceProfile( - pb2.UpdateGatewayResourceProfileRequest(gateway_id=gateway_id, gateway_resource_profile=gateway_resource_profile), - metadata=self._metadata, - ) - - def delete_gateway_resource_profile(self, gateway_id): - pb2 = self._svc("gateway_resource_profile_service_pb2") - return self._gw_profile.DeleteGatewayResourceProfile( - pb2.DeleteGatewayResourceProfileRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - - def add_gateway_compute_resource_preference(self, gateway_id, compute_resource_id, compute_resource_preference): - pb2 = self._svc("gateway_resource_profile_service_pb2") - return self._gw_profile.AddComputePreference( - pb2.AddComputePreferenceRequest(gateway_id=gateway_id, compute_resource_id=compute_resource_id, compute_resource_preference=compute_resource_preference), - metadata=self._metadata, - ) - - def add_gateway_storage_preference(self, gateway_id, storage_resource_id, storage_preference): - pb2 = self._svc("gateway_resource_profile_service_pb2") - return self._gw_profile.AddStoragePreference( - pb2.AddStoragePreferenceRequest(gateway_id=gateway_id, storage_resource_id=storage_resource_id, storage_preference=storage_preference), - metadata=self._metadata, - ) - - def get_gateway_compute_resource_preference(self, gateway_id, compute_resource_id): - pb2 = self._svc("gateway_resource_profile_service_pb2") - return self._gw_profile.GetComputePreference( - pb2.GetComputePreferenceRequest(gateway_id=gateway_id, compute_resource_id=compute_resource_id), - metadata=self._metadata, - ) - - def get_gateway_storage_preference(self, gateway_id, storage_resource_id): - pb2 = self._svc("gateway_resource_profile_service_pb2") - return self._gw_profile.GetStoragePreference( - pb2.GetStoragePreferenceRequest(gateway_id=gateway_id, storage_resource_id=storage_resource_id), - metadata=self._metadata, - ) - - def get_all_gateway_compute_resource_preferences(self, gateway_id): - pb2 = self._svc("gateway_resource_profile_service_pb2") - response = self._gw_profile.GetAllComputePreferences( - pb2.GetAllComputePreferencesRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.compute_resource_preferences) - - def get_all_gateway_storage_preferences(self, gateway_id): - pb2 = self._svc("gateway_resource_profile_service_pb2") - response = self._gw_profile.GetAllStoragePreferences( - pb2.GetAllStoragePreferencesRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.storage_preferences) - - def get_all_gateway_resource_profiles(self): - pb2 = self._svc("gateway_resource_profile_service_pb2") - response = self._gw_profile.GetAllGatewayResourceProfiles( - pb2.GetAllGatewayResourceProfilesRequest(), - metadata=self._metadata, - ) - return list(response.gateway_resource_profiles) - - def update_gateway_compute_resource_preference(self, gateway_id, compute_resource_id, compute_resource_preference): - pb2 = self._svc("gateway_resource_profile_service_pb2") - return self._gw_profile.UpdateComputePreference( - pb2.UpdateComputePreferenceRequest(gateway_id=gateway_id, compute_resource_id=compute_resource_id, compute_resource_preference=compute_resource_preference), - metadata=self._metadata, - ) - - def update_gateway_storage_preference(self, gateway_id, storage_resource_id, storage_preference): - pb2 = self._svc("gateway_resource_profile_service_pb2") - return self._gw_profile.UpdateStoragePreference( - pb2.UpdateStoragePreferenceRequest(gateway_id=gateway_id, storage_resource_id=storage_resource_id, storage_preference=storage_preference), - metadata=self._metadata, - ) - - def delete_gateway_compute_resource_preference(self, gateway_id, compute_resource_id): - pb2 = self._svc("gateway_resource_profile_service_pb2") - return self._gw_profile.DeleteComputePreference( - pb2.DeleteComputePreferenceRequest(gateway_id=gateway_id, compute_resource_id=compute_resource_id), - metadata=self._metadata, - ) - - def delete_gateway_storage_preference(self, gateway_id, storage_resource_id): - pb2 = self._svc("gateway_resource_profile_service_pb2") - return self._gw_profile.DeleteStoragePreference( - pb2.DeleteStoragePreferenceRequest(gateway_id=gateway_id, storage_resource_id=storage_resource_id), - metadata=self._metadata, - ) - - def get_ssh_account_provisioners(self): - pb2 = self._svc("gateway_resource_profile_service_pb2") - response = self._gw_profile.GetSSHAccountProvisioners( - pb2.GetSSHAccountProvisionersRequest(), - metadata=self._metadata, - ) - return list(response.ssh_account_provisioners) - - # ================================================================ - # Group Resource Profile Service - # ================================================================ - - def create_group_resource_profile(self, group_resource_profile): - pb2 = self._svc("group_resource_profile_service_pb2") - return self._grp_profile.CreateGroupResourceProfile( - pb2.CreateGroupResourceProfileRequest(group_resource_profile=group_resource_profile), - metadata=self._metadata, - ) - - def update_group_resource_profile(self, group_resource_profile_id, group_resource_profile): - pb2 = self._svc("group_resource_profile_service_pb2") - return self._grp_profile.UpdateGroupResourceProfile( - pb2.UpdateGroupResourceProfileRequest(group_resource_profile_id=group_resource_profile_id, group_resource_profile=group_resource_profile), - metadata=self._metadata, - ) - - def get_group_resource_profile(self, group_resource_profile_id): - pb2 = self._svc("group_resource_profile_service_pb2") - return self._grp_profile.GetGroupResourceProfile( - pb2.GetGroupResourceProfileRequest(group_resource_profile_id=group_resource_profile_id), - metadata=self._metadata, - ) - - def remove_group_resource_profile(self, group_resource_profile_id): - pb2 = self._svc("group_resource_profile_service_pb2") - return self._grp_profile.RemoveGroupResourceProfile( - pb2.RemoveGroupResourceProfileRequest(group_resource_profile_id=group_resource_profile_id), - metadata=self._metadata, - ) - - def get_group_resource_list(self): - pb2 = self._svc("group_resource_profile_service_pb2") - response = self._grp_profile.GetGroupResourceList( - pb2.GetGroupResourceListRequest(), - metadata=self._metadata, - ) - return list(response.group_resource_profiles) - - def remove_group_compute_prefs(self, group_resource_profile_id, compute_resource_id): - pb2 = self._svc("group_resource_profile_service_pb2") - return self._grp_profile.RemoveGroupComputePrefs( - pb2.RemoveGroupComputePrefsRequest(group_resource_profile_id=group_resource_profile_id, compute_resource_id=compute_resource_id), - metadata=self._metadata, - ) - - def remove_group_compute_resource_policy(self, resource_policy_id): - pb2 = self._svc("group_resource_profile_service_pb2") - return self._grp_profile.RemoveGroupComputeResourcePolicy( - pb2.RemoveGroupComputeResourcePolicyRequest(resource_policy_id=resource_policy_id), - metadata=self._metadata, - ) - - def remove_group_batch_queue_resource_policy(self, resource_policy_id): - pb2 = self._svc("group_resource_profile_service_pb2") - return self._grp_profile.RemoveGroupBatchQueueResourcePolicy( - pb2.RemoveGroupBatchQueueResourcePolicyRequest(resource_policy_id=resource_policy_id), - metadata=self._metadata, - ) - - def get_group_compute_resource_preference(self, group_resource_profile_id, compute_resource_id): - pb2 = self._svc("group_resource_profile_service_pb2") - return self._grp_profile.GetGroupComputePreference( - pb2.GetGroupComputePreferenceRequest(group_resource_profile_id=group_resource_profile_id, compute_resource_id=compute_resource_id), - metadata=self._metadata, - ) - - def get_group_compute_resource_policy(self, resource_policy_id): - pb2 = self._svc("group_resource_profile_service_pb2") - return self._grp_profile.GetGroupComputeResourcePolicy( - pb2.GetGroupComputeResourcePolicyRequest(resource_policy_id=resource_policy_id), - metadata=self._metadata, - ) - - def get_batch_queue_resource_policy(self, resource_policy_id): - pb2 = self._svc("group_resource_profile_service_pb2") - return self._grp_profile.GetBatchQueueResourcePolicy( - pb2.GetBatchQueueResourcePolicyRequest(resource_policy_id=resource_policy_id), - metadata=self._metadata, - ) - - def get_group_compute_resource_pref_list(self, group_resource_profile_id): - pb2 = self._svc("group_resource_profile_service_pb2") - response = self._grp_profile.GetGroupComputePrefList( - pb2.GetGroupComputePrefListRequest(group_resource_profile_id=group_resource_profile_id), - metadata=self._metadata, - ) - return list(response.group_compute_resource_preferences) - - def get_group_batch_queue_resource_policy_list(self, group_resource_profile_id): - pb2 = self._svc("group_resource_profile_service_pb2") - response = self._grp_profile.GetGroupBatchQueuePolicyList( - pb2.GetGroupBatchQueuePolicyListRequest(group_resource_profile_id=group_resource_profile_id), - metadata=self._metadata, - ) - return list(response.batch_queue_resource_policies) - - def get_group_compute_resource_policy_list(self, group_resource_profile_id): - pb2 = self._svc("group_resource_profile_service_pb2") - response = self._grp_profile.GetGroupComputeResourcePolicyList( - pb2.GetGroupComputeResourcePolicyListRequest(group_resource_profile_id=group_resource_profile_id), - metadata=self._metadata, - ) - return list(response.compute_resource_policies) - - def get_gateway_groups(self): - pb2 = self._svc("group_resource_profile_service_pb2") - return self._grp_profile.GetGatewayGroups( - pb2.GetGatewayGroupsRequest(), - metadata=self._metadata, - ) - - # ================================================================ - # User Resource Profile Service - # ================================================================ - - def register_user_resource_profile(self, user_resource_profile): - pb2 = self._svc("user_resource_profile_service_pb2") - response = self._user_profile.RegisterUserResourceProfile( - pb2.RegisterUserResourceProfileRequest(user_resource_profile=user_resource_profile), - metadata=self._metadata, - ) - return response.user_id - - def is_user_resource_profile_exists(self, user_id, gateway_id): - pb2 = self._svc("user_resource_profile_service_pb2") - response = self._user_profile.IsUserResourceProfileExists( - pb2.IsUserResourceProfileExistsRequest(user_id=user_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - return response.exists - - def get_user_resource_profile(self, user_id, gateway_id): - pb2 = self._svc("user_resource_profile_service_pb2") - return self._user_profile.GetUserResourceProfile( - pb2.GetUserResourceProfileRequest(user_id=user_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def update_user_resource_profile(self, user_id, gateway_id, user_resource_profile): - pb2 = self._svc("user_resource_profile_service_pb2") - return self._user_profile.UpdateUserResourceProfile( - pb2.UpdateUserResourceProfileRequest(user_id=user_id, gateway_id=gateway_id, user_resource_profile=user_resource_profile), - metadata=self._metadata, - ) - - def delete_user_resource_profile(self, user_id, gateway_id): - pb2 = self._svc("user_resource_profile_service_pb2") - return self._user_profile.DeleteUserResourceProfile( - pb2.DeleteUserResourceProfileRequest(user_id=user_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def add_user_compute_resource_preference(self, user_id, gateway_id, compute_resource_id, user_compute_resource_preference): - pb2 = self._svc("user_resource_profile_service_pb2") - return self._user_profile.AddUserComputePreference( - pb2.AddUserComputePreferenceRequest(user_id=user_id, gateway_id=gateway_id, compute_resource_id=compute_resource_id, user_compute_resource_preference=user_compute_resource_preference), - metadata=self._metadata, - ) - - def add_user_storage_preference(self, user_id, gateway_id, storage_resource_id, user_storage_preference): - pb2 = self._svc("user_resource_profile_service_pb2") - return self._user_profile.AddUserStoragePreference( - pb2.AddUserStoragePreferenceRequest(user_id=user_id, gateway_id=gateway_id, storage_resource_id=storage_resource_id, user_storage_preference=user_storage_preference), - metadata=self._metadata, - ) - - def get_user_compute_resource_preference(self, user_id, gateway_id, compute_resource_id): - pb2 = self._svc("user_resource_profile_service_pb2") - return self._user_profile.GetUserComputePreference( - pb2.GetUserComputePreferenceRequest(user_id=user_id, gateway_id=gateway_id, compute_resource_id=compute_resource_id), - metadata=self._metadata, - ) - - def get_user_storage_preference(self, user_id, gateway_id, storage_resource_id): - pb2 = self._svc("user_resource_profile_service_pb2") - return self._user_profile.GetUserStoragePreference( - pb2.GetUserStoragePreferenceRequest(user_id=user_id, gateway_id=gateway_id, storage_resource_id=storage_resource_id), - metadata=self._metadata, - ) - - def get_all_user_compute_resource_preferences(self, user_id, gateway_id): - pb2 = self._svc("user_resource_profile_service_pb2") - response = self._user_profile.GetAllUserComputePreferences( - pb2.GetAllUserComputePreferencesRequest(user_id=user_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.user_compute_resource_preferences) - - def get_all_user_storage_preferences(self, user_id, gateway_id): - pb2 = self._svc("user_resource_profile_service_pb2") - response = self._user_profile.GetAllUserStoragePreferences( - pb2.GetAllUserStoragePreferencesRequest(user_id=user_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.user_storage_preferences) - - def get_all_user_resource_profiles(self): - pb2 = self._svc("user_resource_profile_service_pb2") - response = self._user_profile.GetAllUserResourceProfiles( - pb2.GetAllUserResourceProfilesRequest(), - metadata=self._metadata, - ) - return list(response.user_resource_profiles) - - def update_user_compute_resource_preference(self, user_id, gateway_id, compute_resource_id, user_compute_resource_preference): - pb2 = self._svc("user_resource_profile_service_pb2") - return self._user_profile.UpdateUserComputePreference( - pb2.UpdateUserComputePreferenceRequest(user_id=user_id, gateway_id=gateway_id, compute_resource_id=compute_resource_id, user_compute_resource_preference=user_compute_resource_preference), - metadata=self._metadata, - ) - - def update_user_storage_preference(self, user_id, gateway_id, storage_resource_id, user_storage_preference): - pb2 = self._svc("user_resource_profile_service_pb2") - return self._user_profile.UpdateUserStoragePreference( - pb2.UpdateUserStoragePreferenceRequest(user_id=user_id, gateway_id=gateway_id, storage_resource_id=storage_resource_id, user_storage_preference=user_storage_preference), - metadata=self._metadata, - ) - - def delete_user_compute_resource_preference(self, user_id, gateway_id, compute_resource_id): - pb2 = self._svc("user_resource_profile_service_pb2") - return self._user_profile.DeleteUserComputePreference( - pb2.DeleteUserComputePreferenceRequest(user_id=user_id, gateway_id=gateway_id, compute_resource_id=compute_resource_id), - metadata=self._metadata, - ) - - def delete_user_storage_preference(self, user_id, gateway_id, storage_resource_id): - pb2 = self._svc("user_resource_profile_service_pb2") - return self._user_profile.DeleteUserStoragePreference( - pb2.DeleteUserStoragePreferenceRequest(user_id=user_id, gateway_id=gateway_id, storage_resource_id=storage_resource_id), - metadata=self._metadata, - ) - - def get_latest_queue_statuses(self): - pb2 = self._svc("user_resource_profile_service_pb2") - response = self._user_profile.GetLatestQueueStatuses( - pb2.GetLatestQueueStatusesRequest(), - metadata=self._metadata, - ) - return list(response.queue_statuses) diff --git a/airavata-python-sdk/airavata_sdk/facade/credential.py b/airavata-python-sdk/airavata_sdk/facade/credential.py deleted file mode 100644 index bdaf7a4f191..00000000000 --- a/airavata-python-sdk/airavata_sdk/facade/credential.py +++ /dev/null @@ -1,92 +0,0 @@ -import importlib - -from airavata_sdk.transport.utils import create_credential_service_stub - - -class CredentialClient: - """Credential store: SSH keys, passwords, and SSH account setup.""" - - def __init__(self, channel, metadata, gateway_id): - self._metadata = metadata - self._gateway_id = gateway_id - self._stub = create_credential_service_stub(channel) - - @staticmethod - def _svc(name): - return importlib.import_module(f"airavata_sdk.generated.services.{name}") - - def get_SSH_credential(self, token_id, gateway_id): - pb2 = self._svc("credential_service_pb2") - return self._stub.GetCredentialSummary( - pb2.GetCredentialSummaryRequest(token_id=token_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def generate_and_register_ssh_keys(self, gateway_id, username, description=""): - pb2 = self._svc("credential_service_pb2") - response = self._stub.GenerateAndRegisterSSHKeys( - pb2.GenerateAndRegisterSSHKeysRequest(gateway_id=gateway_id, username=username, description=description), - metadata=self._metadata, - ) - return response.token - - def register_pwd_credential(self, gateway_id, password_credential): - pb2 = self._svc("credential_service_pb2") - response = self._stub.RegisterPwdCredential( - pb2.RegisterPwdCredentialRequest(gateway_id=gateway_id, password_credential=password_credential), - metadata=self._metadata, - ) - return response.token - - def get_credential_summary(self, token_id, gateway_id): - pb2 = self._svc("credential_service_pb2") - return self._stub.GetCredentialSummary( - pb2.GetCredentialSummaryRequest(token_id=token_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def get_all_credential_summaries(self, gateway_id, type): - pb2 = self._svc("credential_service_pb2") - response = self._stub.GetAllCredentialSummaries( - pb2.GetAllCredentialSummariesRequest(gateway_id=gateway_id, type=type), - metadata=self._metadata, - ) - return list(response.credential_summaries) - - def delete_ssh_pub_key(self, token_id, gateway_id): - pb2 = self._svc("credential_service_pb2") - return self._stub.DeleteSSHPubKey( - pb2.DeleteSSHPubKeyRequest(token_id=token_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def delete_pwd_credential(self, token_id, gateway_id): - pb2 = self._svc("credential_service_pb2") - return self._stub.DeletePWDCredential( - pb2.DeletePWDCredentialRequest(token_id=token_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def is_ssh_setup_complete(self, compute_resource_id, gateway_id, username): - pb2 = self._svc("credential_service_pb2") - response = self._stub.IsSSHSetupComplete( - pb2.IsSSHSetupCompleteRequest(compute_resource_id=compute_resource_id, gateway_id=gateway_id, username=username), - metadata=self._metadata, - ) - return response.is_complete - - def setup_ssh_account(self, compute_resource_id, gateway_id, username): - pb2 = self._svc("credential_service_pb2") - response = self._stub.SetupSSHAccount( - pb2.SetupSSHAccountRequest(compute_resource_id=compute_resource_id, gateway_id=gateway_id, username=username), - metadata=self._metadata, - ) - return response.success - - def does_user_have_ssh_account(self, compute_resource_id, gateway_id, username): - pb2 = self._svc("credential_service_pb2") - response = self._stub.DoesUserHaveSSHAccount( - pb2.DoesUserHaveSSHAccountRequest(compute_resource_id=compute_resource_id, gateway_id=gateway_id, username=username), - metadata=self._metadata, - ) - return response.has_account diff --git a/airavata-python-sdk/airavata_sdk/facade/iam.py b/airavata-python-sdk/airavata_sdk/facade/iam.py deleted file mode 100644 index 71d2341986a..00000000000 --- a/airavata-python-sdk/airavata_sdk/facade/iam.py +++ /dev/null @@ -1,266 +0,0 @@ -import importlib - -from airavata_sdk.transport.utils import ( - create_gateway_service_stub, - create_iam_admin_service_stub, - create_user_profile_service_stub, -) - - -class IamClient: - """Gateway management, IAM admin (Keycloak users/roles), and user profiles.""" - - def __init__(self, channel, metadata, gateway_id): - self._metadata = metadata - self._gateway_id = gateway_id - self._gateway = create_gateway_service_stub(channel) - self._iam = create_iam_admin_service_stub(channel) - self._user_profile = create_user_profile_service_stub(channel) - - @staticmethod - def _svc(name): - return importlib.import_module(f"airavata_sdk.generated.services.{name}") - - # ================================================================ - # Gateway Service - # ================================================================ - - def is_user_exists(self, gateway_id, user_name): - pb2 = self._svc("gateway_service_pb2") - response = self._gateway.IsUserExists( - pb2.IsUserExistsRequest(gateway_id=gateway_id, user_name=user_name), - metadata=self._metadata, - ) - return response.exists - - def add_gateway(self, gateway): - pb2 = self._svc("gateway_service_pb2") - response = self._gateway.AddGateway( - pb2.AddGatewayRequest(gateway=gateway), - metadata=self._metadata, - ) - return response.gateway_id - - def get_all_users_in_gateway(self, gateway_id): - pb2 = self._svc("gateway_service_pb2") - response = self._gateway.GetAllUsersInGateway( - pb2.GetAllUsersInGatewayRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.user_names) - - def update_gateway(self, gateway_id, gateway): - pb2 = self._svc("gateway_service_pb2") - return self._gateway.UpdateGateway( - pb2.UpdateGatewayRequest(gateway_id=gateway_id, gateway=gateway), - metadata=self._metadata, - ) - - def get_gateway(self, gateway_id): - pb2 = self._svc("gateway_service_pb2") - return self._gateway.GetGateway( - pb2.GetGatewayRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - - def delete_gateway(self, gateway_id): - pb2 = self._svc("gateway_service_pb2") - return self._gateway.DeleteGateway( - pb2.DeleteGatewayRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - - def get_all_gateways(self): - pb2 = self._svc("gateway_service_pb2") - response = self._gateway.GetAllGateways( - pb2.GetAllGatewaysRequest(), - metadata=self._metadata, - ) - return list(response.gateways) - - def is_gateway_exist(self, gateway_id): - pb2 = self._svc("gateway_service_pb2") - response = self._gateway.IsGatewayExist( - pb2.IsGatewayExistRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return response.exists - - # ================================================================ - # IAM Admin Service - # ================================================================ - - def set_up_gateway(self, gateway): - pb2 = self._svc("iam_admin_service_pb2") - return self._iam.SetUpGateway( - pb2.SetUpGatewayRequest(gateway=gateway), - metadata=self._metadata, - ) - - def is_username_available(self, username): - pb2 = self._svc("iam_admin_service_pb2") - resp = self._iam.IsUsernameAvailable( - pb2.IsUsernameAvailableRequest(username=username), - metadata=self._metadata, - ) - return resp.available - - def register_user(self, username, email_address, first_name, last_name, new_password): - pb2 = self._svc("iam_admin_service_pb2") - self._iam.RegisterUser( - pb2.RegisterUserRequest( - username=username, - email_address=email_address, - first_name=first_name, - last_name=last_name, - new_password=new_password, - ), - metadata=self._metadata, - ) - - def enable_user(self, username): - pb2 = self._svc("iam_admin_service_pb2") - self._iam.EnableUser( - pb2.EnableUserRequest(username=username), - metadata=self._metadata, - ) - - def is_user_enabled(self, username): - pb2 = self._svc("iam_admin_service_pb2") - resp = self._iam.IsUserEnabled( - pb2.IsUserEnabledRequest(username=username), - metadata=self._metadata, - ) - return resp.enabled - - def is_user_exist(self, username): - pb2 = self._svc("iam_admin_service_pb2") - resp = self._iam.IsUserExist( - pb2.IsUserExistRequest(username=username), - metadata=self._metadata, - ) - return resp.exists - - def get_iam_user(self, username): - pb2 = self._svc("iam_admin_service_pb2") - return self._iam.GetUser( - pb2.GetIamUserRequest(username=username), - metadata=self._metadata, - ) - - def get_iam_users(self, offset=0, limit=20, search=""): - pb2 = self._svc("iam_admin_service_pb2") - resp = self._iam.GetUsers( - pb2.GetIamUsersRequest(offset=offset, limit=limit, search=search), - metadata=self._metadata, - ) - return list(resp.users) - - def reset_user_password(self, username, new_password): - pb2 = self._svc("iam_admin_service_pb2") - self._iam.ResetUserPassword( - pb2.ResetUserPasswordRequest(username=username, new_password=new_password), - metadata=self._metadata, - ) - - def find_users(self, email, user_id=""): - pb2 = self._svc("iam_admin_service_pb2") - resp = self._iam.FindUsers( - pb2.FindUsersRequest(email=email, user_id=user_id), - metadata=self._metadata, - ) - return list(resp.users) - - def update_iam_user_profile(self, user_details): - pb2 = self._svc("iam_admin_service_pb2") - self._iam.UpdateUserProfile( - pb2.UpdateIamUserProfileRequest(user_details=user_details), - metadata=self._metadata, - ) - - def delete_iam_user(self, username): - pb2 = self._svc("iam_admin_service_pb2") - self._iam.DeleteUser( - pb2.DeleteUserRequest(username=username), - metadata=self._metadata, - ) - - def add_role_to_user(self, username, role_name): - pb2 = self._svc("iam_admin_service_pb2") - self._iam.AddRoleToUser( - pb2.AddRoleToUserRequest(username=username, role_name=role_name), - metadata=self._metadata, - ) - - def remove_role_from_user(self, username, role_name): - pb2 = self._svc("iam_admin_service_pb2") - self._iam.RemoveRoleFromUser( - pb2.RemoveRoleFromUserRequest(username=username, role_name=role_name), - metadata=self._metadata, - ) - - def get_users_with_role(self, role_name): - pb2 = self._svc("iam_admin_service_pb2") - resp = self._iam.GetUsersWithRole( - pb2.GetUsersWithRoleRequest(role_name=role_name), - metadata=self._metadata, - ) - return list(resp.users) - - # ================================================================ - # User Profile Service - # ================================================================ - - def add_user_profile(self, user_profile): - pb2 = self._svc("user_profile_service_pb2") - resp = self._user_profile.AddUserProfile( - pb2.AddUserProfileRequest(user_profile=user_profile), - metadata=self._metadata, - ) - return resp.user_id - - def update_user_profile(self, user_profile): - pb2 = self._svc("user_profile_service_pb2") - self._user_profile.UpdateUserProfile( - pb2.UpdateUserProfileRequest(user_profile=user_profile), - metadata=self._metadata, - ) - - def get_user_profile_by_id(self, user_id, gateway_id): - pb2 = self._svc("user_profile_service_pb2") - return self._user_profile.GetUserProfileById( - pb2.GetUserProfileByIdRequest(user_id=user_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def get_user_profile_by_name(self, user_name, gateway_id): - pb2 = self._svc("user_profile_service_pb2") - return self._user_profile.GetUserProfileByName( - pb2.GetUserProfileByNameRequest(user_name=user_name, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def delete_user_profile(self, user_id): - pb2 = self._svc("user_profile_service_pb2") - self._user_profile.DeleteUserProfile( - pb2.DeleteUserProfileRequest(user_id=user_id), - metadata=self._metadata, - ) - - def get_all_user_profiles_in_gateway(self, gateway_id, offset=0, limit=20): - pb2 = self._svc("user_profile_service_pb2") - resp = self._user_profile.GetAllUserProfilesInGateway( - pb2.GetAllUserProfilesInGatewayRequest( - gateway_id=gateway_id, offset=offset, limit=limit, - ), - metadata=self._metadata, - ) - return list(resp.user_profiles) - - def does_user_exist(self, user_name, gateway_id): - pb2 = self._svc("user_profile_service_pb2") - resp = self._user_profile.DoesUserExist( - pb2.DoesUserExistRequest(user_name=user_name, gateway_id=gateway_id), - metadata=self._metadata, - ) - return resp.exists diff --git a/airavata-python-sdk/airavata_sdk/facade/research.py b/airavata-python-sdk/airavata_sdk/facade/research.py deleted file mode 100644 index 948d9cd5649..00000000000 --- a/airavata-python-sdk/airavata_sdk/facade/research.py +++ /dev/null @@ -1,925 +0,0 @@ -import importlib - -from google.protobuf.struct_pb2 import Struct - -from airavata_sdk.transport.utils import ( - create_experiment_service_stub, - create_project_service_stub, - create_application_catalog_service_stub, - create_parser_service_stub, - create_data_product_service_stub, - create_notification_service_stub, - create_experiment_management_service_stub, - create_research_hub_service_stub, - create_research_project_service_stub, - create_research_resource_service_stub, - create_research_session_service_stub, -) - - -class ResearchClient: - """Experiments, projects, application catalog, parsers, data products, - notifications, experiment management, research hub/project/resource/session.""" - - def __init__(self, channel, metadata, gateway_id): - self._metadata = metadata - self._gateway_id = gateway_id - self._experiment = create_experiment_service_stub(channel) - self._project = create_project_service_stub(channel) - self._app_catalog = create_application_catalog_service_stub(channel) - self._parser = create_parser_service_stub(channel) - self._data_product = create_data_product_service_stub(channel) - self._notification = create_notification_service_stub(channel) - self._exp_mgmt = create_experiment_management_service_stub(channel) - self._research_hub = create_research_hub_service_stub(channel) - self._research_project = create_research_project_service_stub(channel) - self._research_resource = create_research_resource_service_stub(channel) - self._research_session = create_research_session_service_stub(channel) - - @staticmethod - def _svc(name): - return importlib.import_module(f"airavata_sdk.generated.services.{name}") - - # ================================================================ - # Experiment Service - # ================================================================ - - def search_experiments(self, gateway_id, user_name, filters=None, limit=-1, offset=0): - pb2 = self._svc("experiment_service_pb2") - response = self._experiment.SearchExperiments( - pb2.SearchExperimentsRequest(gateway_id=gateway_id, user_name=user_name, filters=filters or {}, limit=limit, offset=offset), - metadata=self._metadata, - ) - return list(response.experiments) - - def get_experiment_statistics(self, gateway_id, from_time, to_time, user_name="", application_name="", resource_host_name="", limit=0, offset=0): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.GetExperimentStatistics( - pb2.GetExperimentStatisticsRequest( - gateway_id=gateway_id, from_time=from_time, to_time=to_time, - user_name=user_name, application_name=application_name, - resource_host_name=resource_host_name, limit=limit, offset=offset, - ), - metadata=self._metadata, - ) - - def get_experiments_in_project(self, project_id, limit=-1, offset=0): - pb2 = self._svc("experiment_service_pb2") - response = self._experiment.GetExperimentsInProject( - pb2.GetExperimentsInProjectRequest(project_id=project_id, limit=limit, offset=offset), - metadata=self._metadata, - ) - return list(response.experiments) - - def get_user_experiments(self, gateway_id, user_name, limit=-1, offset=0): - pb2 = self._svc("experiment_service_pb2") - response = self._experiment.GetUserExperiments( - pb2.GetUserExperimentsRequest(gateway_id=gateway_id, user_name=user_name, limit=limit, offset=offset), - metadata=self._metadata, - ) - return list(response.experiments) - - def create_experiment(self, gateway_id, experiment): - pb2 = self._svc("experiment_service_pb2") - response = self._experiment.CreateExperiment( - pb2.CreateExperimentRequest(gateway_id=gateway_id, experiment=experiment), - metadata=self._metadata, - ) - return response.experiment_id - - def delete_experiment(self, experiment_id): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.DeleteExperiment( - pb2.DeleteExperimentRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - - def get_experiment(self, experiment_id): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.GetExperiment( - pb2.GetExperimentRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - - def get_experiment_by_admin(self, experiment_id): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.GetExperimentByAdmin( - pb2.GetExperimentByAdminRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - - def get_detailed_experiment_tree(self, experiment_id): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.GetDetailedExperimentTree( - pb2.GetDetailedExperimentTreeRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - - def update_experiment(self, experiment_id, experiment): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.UpdateExperiment( - pb2.UpdateExperimentRequest(experiment_id=experiment_id, experiment=experiment), - metadata=self._metadata, - ) - - def update_experiment_configuration(self, experiment_id, configuration): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.UpdateExperimentConfiguration( - pb2.UpdateExperimentConfigurationRequest(experiment_id=experiment_id, configuration=configuration), - metadata=self._metadata, - ) - - def update_resource_scheduling(self, experiment_id, scheduling): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.UpdateResourceScheduling( - pb2.UpdateResourceSchedulingRequest(experiment_id=experiment_id, scheduling=scheduling), - metadata=self._metadata, - ) - - def validate_experiment(self, experiment_id): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.ValidateExperiment( - pb2.ValidateExperimentRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - - def launch_experiment(self, experiment_id, gateway_id): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.LaunchExperiment( - pb2.LaunchExperimentRequest(experiment_id=experiment_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def get_experiment_status(self, experiment_id): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.GetExperimentStatus( - pb2.GetExperimentStatusRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - - def get_experiment_outputs(self, experiment_id): - pb2 = self._svc("experiment_service_pb2") - response = self._experiment.GetExperimentOutputs( - pb2.GetExperimentOutputsRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - return list(response.outputs) - - def get_intermediate_outputs(self, experiment_id, output_names=None): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.FetchIntermediateOutputs( - pb2.FetchIntermediateOutputsRequest(experiment_id=experiment_id, output_names=output_names or []), - metadata=self._metadata, - ) - - def get_intermediate_output_process_status(self, experiment_id): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.GetIntermediateOutputProcessStatus( - pb2.GetIntermediateOutputProcessStatusRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - - def get_job_statuses(self, experiment_id): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.GetJobStatuses( - pb2.GetJobStatusesRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - - def get_job_details(self, experiment_id): - pb2 = self._svc("experiment_service_pb2") - response = self._experiment.GetJobDetails( - pb2.GetJobDetailsRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - return list(response.jobs) - - def clone_experiment(self, experiment_id, new_experiment_name="", new_experiment_project_id=""): - pb2 = self._svc("experiment_service_pb2") - response = self._experiment.CloneExperiment( - pb2.CloneExperimentRequest( - experiment_id=experiment_id, - new_experiment_name=new_experiment_name, - new_experiment_project_id=new_experiment_project_id, - ), - metadata=self._metadata, - ) - return response.experiment_id - - def clone_experiment_by_admin(self, experiment_id, new_experiment_name="", new_experiment_project_id=""): - pb2 = self._svc("experiment_service_pb2") - response = self._experiment.CloneExperiment( - pb2.CloneExperimentRequest( - experiment_id=experiment_id, - new_experiment_name=new_experiment_name, - new_experiment_project_id=new_experiment_project_id, - ), - metadata=self._metadata, - ) - return response.experiment_id - - def terminate_experiment(self, experiment_id, gateway_id): - pb2 = self._svc("experiment_service_pb2") - return self._experiment.TerminateExperiment( - pb2.TerminateExperimentRequest(experiment_id=experiment_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - # ================================================================ - # Project Service - # ================================================================ - - def create_project(self, gateway_id, project): - pb2 = self._svc("project_service_pb2") - response = self._project.CreateProject( - pb2.CreateProjectRequest(gateway_id=gateway_id, project=project), - metadata=self._metadata, - ) - return response.project_id - - def update_project(self, project_id, project): - pb2 = self._svc("project_service_pb2") - return self._project.UpdateProject( - pb2.UpdateProjectRequest(project_id=project_id, project=project), - metadata=self._metadata, - ) - - def get_project(self, project_id): - pb2 = self._svc("project_service_pb2") - return self._project.GetProject( - pb2.GetProjectRequest(project_id=project_id), - metadata=self._metadata, - ) - - def delete_project(self, project_id): - pb2 = self._svc("project_service_pb2") - return self._project.DeleteProject( - pb2.DeleteProjectRequest(project_id=project_id), - metadata=self._metadata, - ) - - def get_user_projects(self, gateway_id, user_name, limit=-1, offset=0): - pb2 = self._svc("project_service_pb2") - response = self._project.GetUserProjects( - pb2.GetUserProjectsRequest(gateway_id=gateway_id, user_name=user_name, limit=limit, offset=offset), - metadata=self._metadata, - ) - return list(response.projects) - - def search_projects(self, gateway_id, user_name, filters=None, limit=-1, offset=0): - pb2 = self._svc("project_service_pb2") - response = self._project.SearchProjects( - pb2.SearchProjectsRequest(gateway_id=gateway_id, user_name=user_name, filters=filters or {}, limit=limit, offset=offset), - metadata=self._metadata, - ) - return list(response.projects) - - # ================================================================ - # Application Catalog Service - # ================================================================ - - def register_application_module(self, gateway_id, application_module): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.RegisterApplicationModule( - pb2.RegisterApplicationModuleRequest(gateway_id=gateway_id, application_module=application_module), - metadata=self._metadata, - ) - return response.app_module_id - - def get_application_module(self, app_module_id): - pb2 = self._svc("application_catalog_service_pb2") - return self._app_catalog.GetApplicationModule( - pb2.GetApplicationModuleRequest(app_module_id=app_module_id), - metadata=self._metadata, - ) - - def update_application_module(self, app_module_id, application_module): - pb2 = self._svc("application_catalog_service_pb2") - return self._app_catalog.UpdateApplicationModule( - pb2.UpdateApplicationModuleRequest(app_module_id=app_module_id, application_module=application_module), - metadata=self._metadata, - ) - - def get_all_app_modules(self, gateway_id): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.GetAllAppModules( - pb2.GetAllAppModulesRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.application_modules) - - def get_accessible_app_modules(self, gateway_id): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.GetAccessibleAppModules( - pb2.GetAccessibleAppModulesRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.application_modules) - - def delete_application_module(self, app_module_id): - pb2 = self._svc("application_catalog_service_pb2") - return self._app_catalog.DeleteApplicationModule( - pb2.DeleteApplicationModuleRequest(app_module_id=app_module_id), - metadata=self._metadata, - ) - - def register_application_deployment(self, gateway_id, application_deployment): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.RegisterApplicationDeployment( - pb2.RegisterApplicationDeploymentRequest(gateway_id=gateway_id, application_deployment=application_deployment), - metadata=self._metadata, - ) - return response.app_deployment_id - - def get_application_deployment(self, app_deployment_id): - pb2 = self._svc("application_catalog_service_pb2") - return self._app_catalog.GetApplicationDeployment( - pb2.GetApplicationDeploymentRequest(app_deployment_id=app_deployment_id), - metadata=self._metadata, - ) - - def update_application_deployment(self, app_deployment_id, application_deployment): - pb2 = self._svc("application_catalog_service_pb2") - return self._app_catalog.UpdateApplicationDeployment( - pb2.UpdateApplicationDeploymentRequest(app_deployment_id=app_deployment_id, application_deployment=application_deployment), - metadata=self._metadata, - ) - - def delete_application_deployment(self, app_deployment_id): - pb2 = self._svc("application_catalog_service_pb2") - return self._app_catalog.DeleteApplicationDeployment( - pb2.DeleteApplicationDeploymentRequest(app_deployment_id=app_deployment_id), - metadata=self._metadata, - ) - - def get_all_application_deployments(self, gateway_id): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.GetAllApplicationDeployments( - pb2.GetAllApplicationDeploymentsRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.application_deployments) - - def get_accessible_application_deployments(self, gateway_id): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.GetAccessibleApplicationDeployments( - pb2.GetAccessibleApplicationDeploymentsRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.application_deployments) - - def get_app_module_deployed_resources(self, app_module_id): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.GetAppModuleDeployedResources( - pb2.GetAppModuleDeployedResourcesRequest(app_module_id=app_module_id), - metadata=self._metadata, - ) - return list(response.compute_resource_ids) - - def get_application_deployments_for_app_module_and_group_resource_profile(self, app_module_id, group_resource_profile_id): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.GetDeploymentsForModuleAndProfile( - pb2.GetDeploymentsForModuleAndProfileRequest(app_module_id=app_module_id, group_resource_profile_id=group_resource_profile_id), - metadata=self._metadata, - ) - return list(response.application_deployments) - - def register_application_interface(self, gateway_id, application_interface): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.RegisterApplicationInterface( - pb2.RegisterApplicationInterfaceRequest(gateway_id=gateway_id, application_interface=application_interface), - metadata=self._metadata, - ) - return response.app_interface_id - - def clone_application_interface(self, existing_app_interface_id, new_app_module_name, gateway_id): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.CloneApplicationInterface( - pb2.CloneApplicationInterfaceRequest( - existing_app_interface_id=existing_app_interface_id, - new_app_module_name=new_app_module_name, - gateway_id=gateway_id, - ), - metadata=self._metadata, - ) - return response.app_interface_id - - def get_application_interface(self, app_interface_id): - pb2 = self._svc("application_catalog_service_pb2") - return self._app_catalog.GetApplicationInterface( - pb2.GetApplicationInterfaceRequest(app_interface_id=app_interface_id), - metadata=self._metadata, - ) - - def update_application_interface(self, app_interface_id, application_interface): - pb2 = self._svc("application_catalog_service_pb2") - return self._app_catalog.UpdateApplicationInterface( - pb2.UpdateApplicationInterfaceRequest(app_interface_id=app_interface_id, application_interface=application_interface), - metadata=self._metadata, - ) - - def delete_application_interface(self, app_interface_id): - pb2 = self._svc("application_catalog_service_pb2") - return self._app_catalog.DeleteApplicationInterface( - pb2.DeleteApplicationInterfaceRequest(app_interface_id=app_interface_id), - metadata=self._metadata, - ) - - def get_all_application_interface_names(self, gateway_id): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.GetAllApplicationInterfaceNames( - pb2.GetAllApplicationInterfaceNamesRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return dict(response.application_interface_names) - - def get_all_application_interfaces(self, gateway_id): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.GetAllApplicationInterfaces( - pb2.GetAllApplicationInterfacesRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.application_interfaces) - - def get_application_inputs(self, app_interface_id): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.GetApplicationInputs( - pb2.GetApplicationInputsRequest(app_interface_id=app_interface_id), - metadata=self._metadata, - ) - return list(response.application_inputs) - - def get_application_outputs(self, app_interface_id): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.GetApplicationOutputs( - pb2.GetApplicationOutputsRequest(app_interface_id=app_interface_id), - metadata=self._metadata, - ) - return list(response.application_outputs) - - def get_available_app_interface_compute_resources(self, app_interface_id): - pb2 = self._svc("application_catalog_service_pb2") - response = self._app_catalog.GetAvailableComputeResources( - pb2.GetAvailableComputeResourcesRequest(app_interface_id=app_interface_id), - metadata=self._metadata, - ) - return dict(response.compute_resource_names) - - # ================================================================ - # Parser Service - # ================================================================ - - def get_parser(self, parser_id, gateway_id): - pb2 = self._svc("parser_service_pb2") - return self._parser.GetParser( - pb2.GetParserRequest(parser_id=parser_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def save_parser(self, parser): - pb2 = self._svc("parser_service_pb2") - response = self._parser.SaveParser( - pb2.SaveParserRequest(parser=parser), - metadata=self._metadata, - ) - return response.parser_id - - def list_all_parsers(self, gateway_id): - pb2 = self._svc("parser_service_pb2") - response = self._parser.ListAllParsers( - pb2.ListAllParsersRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.parsers) - - def remove_parser(self, parser_id, gateway_id): - pb2 = self._svc("parser_service_pb2") - return self._parser.RemoveParser( - pb2.RemoveParserRequest(parser_id=parser_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def get_parsing_template(self, template_id, gateway_id): - pb2 = self._svc("parser_service_pb2") - return self._parser.GetParsingTemplate( - pb2.GetParsingTemplateRequest(template_id=template_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def get_parsing_templates_for_experiment(self, experiment_id, gateway_id): - pb2 = self._svc("parser_service_pb2") - response = self._parser.GetParsingTemplatesForExperiment( - pb2.GetParsingTemplatesForExperimentRequest(experiment_id=experiment_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.parsing_templates) - - def save_parsing_template(self, parsing_template): - pb2 = self._svc("parser_service_pb2") - response = self._parser.SaveParsingTemplate( - pb2.SaveParsingTemplateRequest(parsing_template=parsing_template), - metadata=self._metadata, - ) - return response.template_id - - def remove_parsing_template(self, template_id, gateway_id): - pb2 = self._svc("parser_service_pb2") - return self._parser.RemoveParsingTemplate( - pb2.RemoveParsingTemplateRequest(template_id=template_id, gateway_id=gateway_id), - metadata=self._metadata, - ) - - def list_all_parsing_templates(self, gateway_id): - pb2 = self._svc("parser_service_pb2") - response = self._parser.ListAllParsingTemplates( - pb2.ListAllParsingTemplatesRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.parsing_templates) - - # ================================================================ - # Data Product Service - # ================================================================ - - def register_data_product(self, data_product): - pb2 = self._svc("data_product_service_pb2") - response = self._data_product.RegisterDataProduct( - pb2.RegisterDataProductRequest(data_product=data_product), - metadata=self._metadata, - ) - return response.product_uri - - def get_data_product(self, data_product_uri): - pb2 = self._svc("data_product_service_pb2") - return self._data_product.GetDataProduct( - pb2.GetDataProductRequest(product_uri=data_product_uri), - metadata=self._metadata, - ) - - def register_replica_location(self, replica_location): - pb2 = self._svc("data_product_service_pb2") - response = self._data_product.RegisterReplicaLocation( - pb2.RegisterReplicaLocationRequest(replica_location=replica_location), - metadata=self._metadata, - ) - return response.replica_id - - def get_parent_data_product(self, data_product_uri): - pb2 = self._svc("data_product_service_pb2") - return self._data_product.GetParentDataProduct( - pb2.GetParentDataProductRequest(product_uri=data_product_uri), - metadata=self._metadata, - ) - - def get_child_data_products(self, data_product_uri): - pb2 = self._svc("data_product_service_pb2") - response = self._data_product.GetChildDataProducts( - pb2.GetChildDataProductsRequest(product_uri=data_product_uri), - metadata=self._metadata, - ) - return list(response.data_products) - - def update_data_product(self, product_uri, data_product): - pb2 = self._svc("data_product_service_pb2") - return self._data_product.UpdateDataProduct( - pb2.UpdateDataProductRequest(product_uri=product_uri, data_product=data_product), - metadata=self._metadata, - ) - - def delete_data_product(self, product_uri): - pb2 = self._svc("data_product_service_pb2") - return self._data_product.DeleteDataProduct( - pb2.DeleteDataProductRequest(product_uri=product_uri), - metadata=self._metadata, - ) - - def get_replica_location(self, replica_id): - pb2 = self._svc("data_product_service_pb2") - return self._data_product.GetReplicaLocation( - pb2.GetReplicaLocationRequest(replica_id=replica_id), - metadata=self._metadata, - ) - - def update_replica_location(self, replica_id, replica_location): - pb2 = self._svc("data_product_service_pb2") - return self._data_product.UpdateReplicaLocation( - pb2.UpdateReplicaLocationRequest(replica_id=replica_id, replica_location=replica_location), - metadata=self._metadata, - ) - - def delete_replica_location(self, replica_id): - pb2 = self._svc("data_product_service_pb2") - return self._data_product.DeleteReplicaLocation( - pb2.DeleteReplicaLocationRequest(replica_id=replica_id), - metadata=self._metadata, - ) - - # ================================================================ - # Notification Service - # ================================================================ - - def create_notification(self, notification): - pb2 = self._svc("notification_service_pb2") - response = self._notification.CreateNotification( - pb2.CreateNotificationRequest(notification=notification), - metadata=self._metadata, - ) - return response.notification_id - - def update_notification(self, notification): - pb2 = self._svc("notification_service_pb2") - return self._notification.UpdateNotification( - pb2.UpdateNotificationRequest(notification=notification), - metadata=self._metadata, - ) - - def delete_notification(self, gateway_id, notification_id): - pb2 = self._svc("notification_service_pb2") - return self._notification.DeleteNotification( - pb2.DeleteNotificationRequest(gateway_id=gateway_id, notification_id=notification_id), - metadata=self._metadata, - ) - - def get_notification(self, gateway_id, notification_id): - pb2 = self._svc("notification_service_pb2") - return self._notification.GetNotification( - pb2.GetNotificationRequest(gateway_id=gateway_id, notification_id=notification_id), - metadata=self._metadata, - ) - - def get_all_notifications(self, gateway_id): - pb2 = self._svc("notification_service_pb2") - response = self._notification.GetAllNotifications( - pb2.GetAllNotificationsRequest(gateway_id=gateway_id), - metadata=self._metadata, - ) - return list(response.notifications) - - # ================================================================ - # Experiment Management Service - # ================================================================ - - def get_agent_experiment(self, experiment_id: str): - from airavata_sdk.generated.services import experiment_management_service_pb2 as pb2 - return self._exp_mgmt.GetExperiment( - pb2.GetAgentExperimentRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - - def launch_agent_experiment( - self, experiment_name: str, project_name: str, remote_cluster: str, - group: str = "", libraries: list[str] = None, pip: list[str] = None, - mounts: list[str] = None, queue: str = "", wall_time: int = 0, - cpu_count: int = 0, node_count: int = 0, memory: int = 0, - input_storage_id: str = "", output_storage_id: str = "", - ): - from airavata_sdk.generated.services import experiment_management_service_pb2 as pb2 - return self._exp_mgmt.LaunchExperiment( - pb2.AgentLaunchRequest( - experiment_name=experiment_name, project_name=project_name, - remote_cluster=remote_cluster, group=group, - libraries=libraries or [], pip=pip or [], - mounts=mounts or [], queue=queue, wall_time=wall_time, - cpu_count=cpu_count, node_count=node_count, memory=memory, - input_storage_id=input_storage_id, output_storage_id=output_storage_id, - ), - metadata=self._metadata, - ) - - def launch_optimized_experiment(self, requests: list): - from airavata_sdk.generated.services import experiment_management_service_pb2 as pb2 - return self._exp_mgmt.LaunchOptimizedExperiment( - pb2.LaunchOptimizedExperimentRequest(requests=requests), - metadata=self._metadata, - ) - - def terminate_agent_experiment(self, experiment_id: str): - from airavata_sdk.generated.services import experiment_management_service_pb2 as pb2 - return self._exp_mgmt.TerminateExperiment( - pb2.TerminateAgentExperimentRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - - def get_process_model(self, experiment_id: str): - from airavata_sdk.generated.services import experiment_management_service_pb2 as pb2 - return self._exp_mgmt.GetProcessModel( - pb2.GetProcessModelRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - - # ================================================================ - # Research Hub Service - # ================================================================ - - def start_project_session(self, project_id: str, session_name: str = ""): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_hub.StartProjectSession( - pb2.StartProjectSessionRequest(project_id=project_id, session_name=session_name), - metadata=self._metadata, - ) - - def resume_session(self, session_id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_hub.ResumeSession( - pb2.ResumeSessionRequest(session_id=session_id), - metadata=self._metadata, - ) - - # ================================================================ - # Research Project Service - # ================================================================ - - def get_all_research_projects(self): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_project.GetAllProjects( - pb2.GetAllProjectsRequest(), - metadata=self._metadata, - ) - - def get_research_projects_by_owner(self, owner_id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_project.GetProjectsByOwner( - pb2.GetProjectsByOwnerRequest(owner_id=owner_id), - metadata=self._metadata, - ) - - def create_research_project(self, name: str, owner_id: str, repository_id: str = "", dataset_ids: list[str] = None): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_project.CreateProject( - pb2.CreateResearchProjectRequest( - name=name, owner_id=owner_id, - repository_id=repository_id, dataset_ids=dataset_ids or [], - ), - metadata=self._metadata, - ) - - def delete_research_project(self, project_id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_project.DeleteProject( - pb2.DeleteProjectRequest(project_id=project_id), - metadata=self._metadata, - ) - - # ================================================================ - # Research Resource Service - # ================================================================ - - def create_dataset(self, data: dict): - struct = Struct() - struct.update(data) - return self._research_resource.CreateDataset( - struct, - metadata=self._metadata, - ) - - def create_notebook(self, data: dict): - struct = Struct() - struct.update(data) - return self._research_resource.CreateNotebook( - struct, - metadata=self._metadata, - ) - - def create_repository(self, name: str, description: str = "", header_image: str = "", - tags: list[str] = None, authors: list[str] = None, - privacy: str = "PUBLIC", github_url: str = ""): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - resource = pb2.CreateResourceRequest( - name=name, description=description, header_image=header_image, - tags=tags or [], authors=authors or [], privacy=privacy, - ) - return self._research_resource.CreateRepository( - pb2.CreateRepositoryResourceRequest(resource=resource, github_url=github_url), - metadata=self._metadata, - ) - - def modify_repository(self, id: str, name: str = "", description: str = "", - header_image: str = "", tags: list[str] = None, - authors: list[str] = None, privacy: str = ""): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_resource.ModifyRepository( - pb2.ModifyResourceRequest( - id=id, name=name, description=description, - header_image=header_image, tags=tags or [], - authors=authors or [], privacy=privacy, - ), - metadata=self._metadata, - ) - - def create_model(self, data: dict): - struct = Struct() - struct.update(data) - return self._research_resource.CreateModel( - struct, - metadata=self._metadata, - ) - - def get_tags(self, page_number: int = 0, page_size: int = 0, name_search: str = "", - types: list[str] = None, tags: list[str] = None): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_resource.GetTags( - pb2.GetAllResourcesRequest( - page_number=page_number, page_size=page_size, - name_search=name_search, types=types or [], tags=tags or [], - ), - metadata=self._metadata, - ) - - def get_resource(self, id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_resource.GetResource( - pb2.ResourceIdRequest(id=id), - metadata=self._metadata, - ) - - def delete_resource(self, id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_resource.DeleteResource( - pb2.ResourceIdRequest(id=id), - metadata=self._metadata, - ) - - def get_all_resources(self, page_number: int = 0, page_size: int = 0, name_search: str = "", - types: list[str] = None, tags: list[str] = None): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_resource.GetAllResources( - pb2.GetAllResourcesRequest( - page_number=page_number, page_size=page_size, - name_search=name_search, types=types or [], tags=tags or [], - ), - metadata=self._metadata, - ) - - def search_resources(self, type: str, name: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_resource.SearchResources( - pb2.SearchResourceRequest(type=type, name=name), - metadata=self._metadata, - ) - - def get_projects_for_resource(self, id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_resource.GetProjectsForResource( - pb2.ResourceIdRequest(id=id), - metadata=self._metadata, - ) - - def star_resource(self, id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_resource.StarResource( - pb2.StarResourceRequest(id=id), - metadata=self._metadata, - ) - - def check_user_starred_resource(self, id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_resource.CheckUserStarredResource( - pb2.StarResourceRequest(id=id), - metadata=self._metadata, - ) - - def get_resource_star_count(self, id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_resource.GetResourceStarCount( - pb2.GetResourceStarCountRequest(id=id), - metadata=self._metadata, - ) - - def get_starred_resources(self, user_id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_resource.GetStarredResources( - pb2.GetStarredResourcesRequest(user_id=user_id), - metadata=self._metadata, - ) - - # ================================================================ - # Research Session Service - # ================================================================ - - def get_sessions(self, status: str = ""): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_session.GetSessions( - pb2.GetSessionsRequest(status=status), - metadata=self._metadata, - ) - - def update_session_status(self, session_id: str, status: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_session.UpdateSessionStatus( - pb2.UpdateSessionStatusRequest(session_id=session_id, status=status), - metadata=self._metadata, - ) - - def delete_session(self, session_id: str): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_session.DeleteSession( - pb2.DeleteSessionRequest(session_id=session_id), - metadata=self._metadata, - ) - - def delete_sessions(self, session_ids: list[str]): - from airavata_sdk.generated.services import research_service_pb2 as pb2 - return self._research_session.DeleteSessions( - pb2.DeleteSessionsRequest(session_ids=session_ids), - metadata=self._metadata, - ) diff --git a/airavata-python-sdk/airavata_sdk/facade/sharing.py b/airavata-python-sdk/airavata_sdk/facade/sharing.py deleted file mode 100644 index ea5bb31a56c..00000000000 --- a/airavata-python-sdk/airavata_sdk/facade/sharing.py +++ /dev/null @@ -1,832 +0,0 @@ -import importlib - -from airavata_sdk.transport.utils import ( - create_sharing_service_stub, - create_group_manager_service_stub, -) - - -def _snake_to_camel(name): - """Convert snake_case to camelCase.""" - parts = name.split('_') - return parts[0] + ''.join(p.capitalize() for p in parts[1:]) - - -class SharingClient: - """Sharing registry (domains, users, groups, entities, permissions, resource sharing) - and group manager operations.""" - - def __init__(self, channel, metadata, gateway_id): - self._metadata = metadata - self._gateway_id = gateway_id - self._sharing = create_sharing_service_stub(channel) - self._group_mgr = create_group_manager_service_stub(channel) - - @staticmethod - def _svc(name): - return importlib.import_module(f"airavata_sdk.generated.services.{name}") - - def _pb2(self): - from airavata_sdk.generated.services import sharing_service_pb2 - return sharing_service_pb2 - - def _sharing_pb2(self): - from airavata_sdk.generated.org.apache.airavata.model.sharing import sharing_pb2 - return sharing_pb2 - - # ================================================================ - # Resource sharing RPCs - # ================================================================ - - def share_resource_with_users(self, resource_id, user_permissions): - pb2 = self._pb2() - return self._sharing.ShareResourceWithUsers( - pb2.ShareResourceWithUsersRequest(resource_id=resource_id, user_permissions=user_permissions), - metadata=self._metadata, - ) - - def share_resource_with_groups(self, resource_id, group_permissions): - pb2 = self._pb2() - return self._sharing.ShareResourceWithGroups( - pb2.ShareResourceWithGroupsRequest(resource_id=resource_id, group_permissions=group_permissions), - metadata=self._metadata, - ) - - def revoke_sharing_of_resource_from_users(self, resource_id, user_permissions): - pb2 = self._pb2() - return self._sharing.RevokeFromUsers( - pb2.RevokeFromUsersRequest(resource_id=resource_id, user_permissions=user_permissions), - metadata=self._metadata, - ) - - def revoke_sharing_of_resource_from_groups(self, resource_id, group_permissions): - pb2 = self._pb2() - return self._sharing.RevokeFromGroups( - pb2.RevokeFromGroupsRequest(resource_id=resource_id, group_permissions=group_permissions), - metadata=self._metadata, - ) - - def get_all_accessible_users(self, resource_id, permission_type): - pb2 = self._pb2() - response = self._sharing.GetAllAccessibleUsers( - pb2.GetAllAccessibleUsersRequest(resource_id=resource_id, permission_type=permission_type), - metadata=self._metadata, - ) - return list(response.user_ids) - - def get_all_directly_accessible_users(self, resource_id, permission_type): - pb2 = self._pb2() - response = self._sharing.GetAllDirectlyAccessibleUsers( - pb2.GetAllDirectlyAccessibleUsersRequest(resource_id=resource_id, permission_type=permission_type), - metadata=self._metadata, - ) - return list(response.user_ids) - - def get_all_accessible_groups(self, resource_id, permission_type): - pb2 = self._pb2() - response = self._sharing.GetAllAccessibleGroups( - pb2.GetAllAccessibleGroupsRequest(resource_id=resource_id, permission_type=permission_type), - metadata=self._metadata, - ) - return list(response.group_ids) - - def get_all_directly_accessible_groups(self, resource_id, permission_type): - pb2 = self._pb2() - response = self._sharing.GetAllDirectlyAccessibleGroups( - pb2.GetAllDirectlyAccessibleGroupsRequest(resource_id=resource_id, permission_type=permission_type), - metadata=self._metadata, - ) - return list(response.group_ids) - - def user_has_access(self, resource_id, user_id, permission_type): - pb2 = self._pb2() - response = self._sharing.UserHasAccess( - pb2.UserHasAccessRequest(resource_id=resource_id, user_id=user_id, permission_type=permission_type), - metadata=self._metadata, - ) - return response.has_access - - def revoke_from_users(self, resource_id, user_permissions): - pb2 = self._pb2() - return self._sharing.RevokeFromUsers( - pb2.RevokeFromUsersRequest(resource_id=resource_id, user_permissions=user_permissions), - metadata=self._metadata, - ) - - def revoke_from_groups(self, resource_id, group_permissions): - pb2 = self._pb2() - return self._sharing.RevokeFromGroups( - pb2.RevokeFromGroupsRequest(resource_id=resource_id, group_permissions=group_permissions), - metadata=self._metadata, - ) - - # ================================================================ - # Domain CRUD - # ================================================================ - - def create_domain(self, domain): - pb2 = self._pb2() - proto_domain = self._to_proto_domain(domain) - resp = self._sharing.CreateDomain( - pb2.CreateDomainRequest(domain=proto_domain), - metadata=self._metadata, - ) - return resp.domain_id - - def update_domain(self, domain): - pb2 = self._pb2() - proto_domain = self._to_proto_domain(domain) - self._sharing.UpdateDomain( - pb2.UpdateDomainRequest(domain=proto_domain), - metadata=self._metadata, - ) - return True - - def is_domain_exists(self, domain_id): - pb2 = self._pb2() - resp = self._sharing.IsDomainExists( - pb2.IsDomainExistsRequest(domain_id=domain_id), - metadata=self._metadata, - ) - return resp.exists - - def delete_domain(self, domain_id): - pb2 = self._pb2() - self._sharing.DeleteDomain( - pb2.DeleteDomainRequest(domain_id=domain_id), - metadata=self._metadata, - ) - return True - - def get_domain(self, domain_id): - pb2 = self._pb2() - return self._sharing.GetDomain( - pb2.GetDomainRequest(domain_id=domain_id), - metadata=self._metadata, - ) - - def get_domains(self, offset, limit): - pb2 = self._pb2() - resp = self._sharing.GetDomains( - pb2.GetDomainsRequest(offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.domains) - - # ================================================================ - # User CRUD - # ================================================================ - - def create_user(self, user): - pb2 = self._pb2() - proto_user = self._to_proto_user(user) - resp = self._sharing.CreateUser( - pb2.CreateUserRequest(user=proto_user), - metadata=self._metadata, - ) - return resp.user_id - - def updated_user(self, user): - pb2 = self._pb2() - proto_user = self._to_proto_user(user) - self._sharing.UpdateUser( - pb2.UpdateUserRequest(user=proto_user), - metadata=self._metadata, - ) - return True - - def update_user(self, user): - """Correctly-named alias for updated_user.""" - return self.updated_user(user) - - def is_user_exists(self, domain_id, user_id): - pb2 = self._pb2() - resp = self._sharing.IsUserExists( - pb2.IsUserExistsRequest(domain_id=domain_id, user_id=user_id), - metadata=self._metadata, - ) - return resp.exists - - def delete_user(self, domain_id, user_id): - pb2 = self._pb2() - self._sharing.DeleteUser( - pb2.DeleteUserRequest(domain_id=domain_id, user_id=user_id), - metadata=self._metadata, - ) - return True - - def get_user(self, domain_id, user_id): - pb2 = self._pb2() - return self._sharing.GetUser( - pb2.GetUserRequest(domain_id=domain_id, user_id=user_id), - metadata=self._metadata, - ) - - def get_users(self, domain_id, offset, limit): - pb2 = self._pb2() - resp = self._sharing.GetUsers( - pb2.GetUsersRequest(domain_id=domain_id, offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.users) - - # ================================================================ - # Group CRUD (sharing registry) - # ================================================================ - - def create_group(self, group): - pb2 = self._pb2() - proto_group = self._to_proto_user_group(group) - resp = self._sharing.CreateGroup( - pb2.CreateGroupRequest(group=proto_group), - metadata=self._metadata, - ) - return resp.group_id - - def update_group(self, group): - pb2 = self._pb2() - proto_group = self._to_proto_user_group(group) - self._sharing.UpdateGroup( - pb2.UpdateGroupRequest(group=proto_group), - metadata=self._metadata, - ) - return True - - def is_group_exists(self, domain_id, group_id): - pb2 = self._pb2() - resp = self._sharing.IsGroupExists( - pb2.IsGroupExistsRequest(domain_id=domain_id, group_id=group_id), - metadata=self._metadata, - ) - return resp.exists - - def delete_group(self, domain_id, group_id): - pb2 = self._pb2() - self._sharing.DeleteGroup( - pb2.DeleteGroupRequest(domain_id=domain_id, group_id=group_id), - metadata=self._metadata, - ) - return True - - def get_group(self, domain_id, group_id): - pb2 = self._pb2() - return self._sharing.GetGroup( - pb2.GetGroupRequest(domain_id=domain_id, group_id=group_id), - metadata=self._metadata, - ) - - def get_groups(self, domain_id, offset, limit): - pb2 = self._pb2() - resp = self._sharing.GetGroups( - pb2.GetGroupsRequest(domain_id=domain_id, offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.groups) - - # ================================================================ - # Group membership (sharing registry) - # ================================================================ - - def add_users_to_group(self, domain_id, user_ids, group_id): - pb2 = self._pb2() - self._sharing.AddUsersToGroup( - pb2.AddUsersToGroupRequest(domain_id=domain_id, user_ids=user_ids, group_id=group_id), - metadata=self._metadata, - ) - return True - - def remove_users_from_group(self, domain_id, user_ids, group_id): - pb2 = self._pb2() - self._sharing.RemoveUsersFromGroup( - pb2.RemoveUsersFromGroupRequest(domain_id=domain_id, user_ids=user_ids, group_id=group_id), - metadata=self._metadata, - ) - return True - - def transfer_group_ownership(self, domain_id, group_id, new_owner_id): - pb2 = self._pb2() - self._sharing.TransferGroupOwnership( - pb2.TransferGroupOwnershipRequest(domain_id=domain_id, group_id=group_id, new_owner_id=new_owner_id), - metadata=self._metadata, - ) - return True - - def add_group_admins(self, domain_id, group_id, admin_ids): - pb2 = self._pb2() - self._sharing.AddGroupAdmins( - pb2.AddGroupAdminsRequest(domain_id=domain_id, group_id=group_id, admin_ids=admin_ids), - metadata=self._metadata, - ) - return True - - def remove_group_admins(self, domain_id, group_id, admin_ids): - pb2 = self._pb2() - self._sharing.RemoveGroupAdmins( - pb2.RemoveGroupAdminsRequest(domain_id=domain_id, group_id=group_id, admin_ids=admin_ids), - metadata=self._metadata, - ) - return True - - def has_admin_access(self, domain_id, group_id, admin_id): - pb2 = self._pb2() - resp = self._sharing.HasAdminAccess( - pb2.HasAdminAccessRequest(domain_id=domain_id, group_id=group_id, admin_id=admin_id), - metadata=self._metadata, - ) - return resp.has_access - - def has_owner_access(self, domain_id, group_id, owner_id): - pb2 = self._pb2() - resp = self._sharing.HasOwnerAccess( - pb2.HasOwnerAccessRequest(domain_id=domain_id, group_id=group_id, owner_id=owner_id), - metadata=self._metadata, - ) - return resp.has_access - - def get_group_members_of_type_user(self, domain_id, group_id, offset, limit): - pb2 = self._pb2() - resp = self._sharing.GetGroupMembersOfTypeUser( - pb2.GetGroupMembersOfTypeUserRequest(domain_id=domain_id, group_id=group_id, offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.users) - - def get_group_members_of_type_group(self, domain_id, group_id, offset, limit): - pb2 = self._pb2() - resp = self._sharing.GetGroupMembersOfTypeGroup( - pb2.GetGroupMembersOfTypeGroupRequest(domain_id=domain_id, group_id=group_id, offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.groups) - - def add_child_groups_to_parent_group(self, domain_id, child_ids, group_id): - pb2 = self._pb2() - self._sharing.AddChildGroupsToParentGroup( - pb2.AddChildGroupsToParentGroupRequest(domain_id=domain_id, child_ids=child_ids, group_id=group_id), - metadata=self._metadata, - ) - return True - - def remove_child_group_from_parent_group(self, domain_id, child_id, group_id): - pb2 = self._pb2() - self._sharing.RemoveChildGroupFromParentGroup( - pb2.RemoveChildGroupFromParentGroupRequest(domain_id=domain_id, child_id=child_id, group_id=group_id), - metadata=self._metadata, - ) - return True - - def get_all_member_groups_for_user(self, domain_id, user_id): - pb2 = self._pb2() - resp = self._sharing.GetAllMemberGroupsForUser( - pb2.GetAllMemberGroupsForUserRequest(domain_id=domain_id, user_id=user_id), - metadata=self._metadata, - ) - return list(resp.groups) - - # ================================================================ - # Entity type CRUD - # ================================================================ - - def create_entity_type(self, entity_type): - pb2 = self._pb2() - proto_et = self._to_proto_entity_type(entity_type) - resp = self._sharing.CreateEntityType( - pb2.CreateEntityTypeRequest(entity_type=proto_et), - metadata=self._metadata, - ) - return resp.entity_type_id - - def update_entity_type(self, entity_type): - pb2 = self._pb2() - proto_et = self._to_proto_entity_type(entity_type) - self._sharing.UpdateEntityType( - pb2.UpdateEntityTypeRequest(entity_type=proto_et), - metadata=self._metadata, - ) - return True - - def is_entity_type_exists(self, domain_id, entity_type_id): - pb2 = self._pb2() - resp = self._sharing.IsEntityTypeExists( - pb2.IsEntityTypeExistsRequest(domain_id=domain_id, entity_type_id=entity_type_id), - metadata=self._metadata, - ) - return resp.exists - - def delete_entity_type(self, domain_id, entity_type_id): - pb2 = self._pb2() - self._sharing.DeleteEntityType( - pb2.DeleteEntityTypeRequest(domain_id=domain_id, entity_type_id=entity_type_id), - metadata=self._metadata, - ) - return True - - def get_entity_type(self, domain_id, entity_type_id): - pb2 = self._pb2() - return self._sharing.GetEntityType( - pb2.GetEntityTypeRequest(domain_id=domain_id, entity_type_id=entity_type_id), - metadata=self._metadata, - ) - - def get_entity_types(self, domain_id, offset, limit): - pb2 = self._pb2() - resp = self._sharing.GetEntityTypes( - pb2.GetEntityTypesRequest(domain_id=domain_id, offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.entity_types) - - # ================================================================ - # Entity CRUD - # ================================================================ - - def create_entity(self, entity): - pb2 = self._pb2() - proto_entity = self._to_proto_entity(entity) - resp = self._sharing.CreateEntity( - pb2.CreateEntityRequest(entity=proto_entity), - metadata=self._metadata, - ) - return resp.entity_id - - def update_entity(self, entity): - pb2 = self._pb2() - proto_entity = self._to_proto_entity(entity) - self._sharing.UpdateEntity( - pb2.UpdateEntityRequest(entity=proto_entity), - metadata=self._metadata, - ) - return True - - def is_entity_exists(self, domain_id, entity_id): - pb2 = self._pb2() - resp = self._sharing.IsEntityExists( - pb2.IsEntityExistsRequest(domain_id=domain_id, entity_id=entity_id), - metadata=self._metadata, - ) - return resp.exists - - def delete_entity(self, domain_id, entity_id): - pb2 = self._pb2() - self._sharing.DeleteEntity( - pb2.DeleteEntityRequest(domain_id=domain_id, entity_id=entity_id), - metadata=self._metadata, - ) - return True - - def get_entity(self, domain_id, entity_id): - pb2 = self._pb2() - return self._sharing.GetEntity( - pb2.GetEntityRequest(domain_id=domain_id, entity_id=entity_id), - metadata=self._metadata, - ) - - def search_entities(self, domain_id, user_id, filters, offset, limit): - pb2 = self._pb2() - proto_filters = [self._to_proto_search_criteria(f) for f in filters] - resp = self._sharing.SearchEntities( - pb2.SearchEntitiesRequest( - domain_id=domain_id, user_id=user_id, - filters=proto_filters, offset=offset, limit=limit, - ), - metadata=self._metadata, - ) - return list(resp.entities) - - def get_list_of_shared_users(self, domain_id, entity_id, permission_type_id): - pb2 = self._pb2() - resp = self._sharing.GetListOfSharedUsers( - pb2.GetListOfSharedUsersRequest( - domain_id=domain_id, entity_id=entity_id, permission_type_id=permission_type_id, - ), - metadata=self._metadata, - ) - return list(resp.users) - - def get_list_of_directly_shared_users(self, domain_id, entity_id, permission_type_id): - pb2 = self._pb2() - resp = self._sharing.GetListOfDirectlySharedUsers( - pb2.GetListOfDirectlySharedUsersRequest( - domain_id=domain_id, entity_id=entity_id, permission_type_id=permission_type_id, - ), - metadata=self._metadata, - ) - return list(resp.users) - - def get_list_of_shared_groups(self, domain_id, entity_id, permission_type_id): - pb2 = self._pb2() - resp = self._sharing.GetListOfSharedGroups( - pb2.GetListOfSharedGroupsRequest( - domain_id=domain_id, entity_id=entity_id, permission_type_id=permission_type_id, - ), - metadata=self._metadata, - ) - return list(resp.groups) - - def get_list_of_directly_shared_groups(self, domain_id, entity_id, permission_type_id): - pb2 = self._pb2() - resp = self._sharing.GetListOfDirectlySharedGroups( - pb2.GetListOfDirectlySharedGroupsRequest( - domain_id=domain_id, entity_id=entity_id, permission_type_id=permission_type_id, - ), - metadata=self._metadata, - ) - return list(resp.groups) - - # ================================================================ - # Permission type CRUD - # ================================================================ - - def create_permission_type(self, permission_type): - pb2 = self._pb2() - proto_pt = self._to_proto_permission_type(permission_type) - resp = self._sharing.CreatePermissionType( - pb2.CreatePermissionTypeRequest(permission_type=proto_pt), - metadata=self._metadata, - ) - return resp.permission_type_id - - def update_permission_type(self, permission_type): - pb2 = self._pb2() - proto_pt = self._to_proto_permission_type(permission_type) - self._sharing.UpdatePermissionType( - pb2.UpdatePermissionTypeRequest(permission_type=proto_pt), - metadata=self._metadata, - ) - return True - - def is_permission_exists(self, domain_id, permission_id): - pb2 = self._pb2() - resp = self._sharing.IsPermissionExists( - pb2.IsPermissionExistsRequest(domain_id=domain_id, permission_id=permission_id), - metadata=self._metadata, - ) - return resp.exists - - def delete_permission_type(self, domain_id, permission_type_id): - pb2 = self._pb2() - self._sharing.DeletePermissionType( - pb2.DeletePermissionTypeRequest(domain_id=domain_id, permission_type_id=permission_type_id), - metadata=self._metadata, - ) - return True - - def get_permission_type(self, domain_id, permission_type_id): - pb2 = self._pb2() - return self._sharing.GetPermissionType( - pb2.GetPermissionTypeRequest(domain_id=domain_id, permission_type_id=permission_type_id), - metadata=self._metadata, - ) - - def get_permission_types(self, domain_id, offset, limit): - pb2 = self._pb2() - resp = self._sharing.GetPermissionTypes( - pb2.GetPermissionTypesRequest(domain_id=domain_id, offset=offset, limit=limit), - metadata=self._metadata, - ) - return list(resp.permission_types) - - # ================================================================ - # Entity sharing (Thrift-compatible) - # ================================================================ - - def share_entity_with_users(self, domain_id, entity_id, user_list, permission_type_id, cascade_permission=True): - pb2 = self._pb2() - self._sharing.ShareEntityWithUsers( - pb2.ShareEntityWithUsersRequest( - domain_id=domain_id, entity_id=entity_id, - user_list=user_list, permission_type_id=permission_type_id, - cascade_permission=cascade_permission, - ), - metadata=self._metadata, - ) - return True - - def revoke_entity_sharing_from_users(self, domain_id, entity_id, user_list, permission_type_id): - pb2 = self._pb2() - self._sharing.RevokeEntitySharingFromUsers( - pb2.RevokeEntitySharingFromUsersRequest( - domain_id=domain_id, entity_id=entity_id, - user_list=user_list, permission_type_id=permission_type_id, - ), - metadata=self._metadata, - ) - return True - - def share_entity_with_groups(self, domain_id, entity_id, group_list, permission_type_id, cascade_permission=True): - pb2 = self._pb2() - self._sharing.ShareEntityWithGroups( - pb2.ShareEntityWithGroupsRequest( - domain_id=domain_id, entity_id=entity_id, - group_list=group_list, permission_type_id=permission_type_id, - cascade_permission=cascade_permission, - ), - metadata=self._metadata, - ) - return True - - def revoke_entity_sharing_from_groups(self, domain_id, entity_id, group_list, permission_type_id): - pb2 = self._pb2() - self._sharing.RevokeEntitySharingFromGroups( - pb2.RevokeEntitySharingFromGroupsRequest( - domain_id=domain_id, entity_id=entity_id, - group_list=group_list, permission_type_id=permission_type_id, - ), - metadata=self._metadata, - ) - return True - - # ================================================================ - # Group Manager Service (prefixed with gm_ where names collide) - # ================================================================ - - def gm_create_group(self, group): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - resp = self._group_mgr.CreateGroup( - pb2.CreateGroupRequest(group=group), - metadata=self._metadata, - ) - return resp.group_id - - def gm_update_group(self, group): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - self._group_mgr.UpdateGroup( - pb2.UpdateGroupRequest(group=group), - metadata=self._metadata, - ) - - def gm_delete_group(self, group_id, owner_id): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - self._group_mgr.DeleteGroup( - pb2.DeleteGroupRequest(group_id=group_id, owner_id=owner_id), - metadata=self._metadata, - ) - - def gm_get_group(self, group_id): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - return self._group_mgr.GetGroup( - pb2.GetGroupRequest(group_id=group_id), - metadata=self._metadata, - ) - - def gm_get_groups(self): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - resp = self._group_mgr.GetGroups( - pb2.GetGroupsRequest(), - metadata=self._metadata, - ) - return list(resp.groups) - - def gm_get_all_groups_user_belongs(self, user_name): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - resp = self._group_mgr.GetAllGroupsUserBelongs( - pb2.GetAllGroupsUserBelongsRequest(user_name=user_name), - metadata=self._metadata, - ) - return list(resp.groups) - - def gm_add_users_to_group(self, user_ids, group_id): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - self._group_mgr.AddUsersToGroup( - pb2.AddUsersToGroupRequest(group_id=group_id, user_ids=user_ids), - metadata=self._metadata, - ) - - def gm_remove_users_from_group(self, user_ids, group_id): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - self._group_mgr.RemoveUsersFromGroup( - pb2.RemoveUsersFromGroupRequest(group_id=group_id, user_ids=user_ids), - metadata=self._metadata, - ) - - def gm_transfer_group_ownership(self, group_id, new_owner_id): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - self._group_mgr.TransferGroupOwnership( - pb2.TransferGroupOwnershipRequest(group_id=group_id, new_owner_id=new_owner_id), - metadata=self._metadata, - ) - - def gm_add_group_admins(self, group_id, admin_ids): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - self._group_mgr.AddGroupAdmins( - pb2.AddGroupAdminsRequest(group_id=group_id, admin_ids=admin_ids), - metadata=self._metadata, - ) - - def gm_remove_group_admins(self, group_id, admin_ids): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - self._group_mgr.RemoveGroupAdmins( - pb2.RemoveGroupAdminsRequest(group_id=group_id, admin_ids=admin_ids), - metadata=self._metadata, - ) - - def gm_has_admin_access(self, group_id, admin_id): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - resp = self._group_mgr.HasAdminAccess( - pb2.HasAdminAccessRequest(group_id=group_id, admin_id=admin_id), - metadata=self._metadata, - ) - return resp.has_access - - def gm_has_owner_access(self, group_id, owner_id): - from airavata_sdk.generated.services import group_manager_service_pb2 as pb2 - resp = self._group_mgr.HasOwnerAccess( - pb2.HasOwnerAccessRequest(group_id=group_id, owner_id=owner_id), - metadata=self._metadata, - ) - return resp.has_access - - # ================================================================ - # Proto model builders - # ================================================================ - - def _to_proto_domain(self, domain): - spb = self._sharing_pb2() - if isinstance(domain, spb.Domain): - return domain - kwargs = self._extract_fields(domain, [ - 'domain_id', 'name', 'description', 'created_time', - 'updated_time', 'initial_user_group_id', - ]) - return spb.Domain(**kwargs) - - def _to_proto_user(self, user): - spb = self._sharing_pb2() - if isinstance(user, spb.User): - return user - kwargs = self._extract_fields(user, [ - 'user_id', 'domain_id', 'user_name', 'first_name', - 'last_name', 'email', 'icon', 'created_time', 'updated_time', - ]) - return spb.User(**kwargs) - - def _to_proto_user_group(self, group): - spb = self._sharing_pb2() - if isinstance(group, spb.UserGroup): - return group - kwargs = self._extract_fields(group, [ - 'group_id', 'domain_id', 'name', 'description', 'owner_id', - 'group_type', 'group_cardinality', 'created_time', 'updated_time', - ]) - return spb.UserGroup(**kwargs) - - def _to_proto_entity_type(self, entity_type): - spb = self._sharing_pb2() - if isinstance(entity_type, spb.EntityType): - return entity_type - kwargs = self._extract_fields(entity_type, [ - 'entity_type_id', 'domain_id', 'name', 'description', - 'created_time', 'updated_time', - ]) - return spb.EntityType(**kwargs) - - def _to_proto_entity(self, entity): - spb = self._sharing_pb2() - if isinstance(entity, spb.Entity): - return entity - kwargs = self._extract_fields(entity, [ - 'entity_id', 'domain_id', 'entity_type_id', 'owner_id', - 'parent_entity_id', 'name', 'description', 'binary_data', - 'full_text', 'shared_count', 'original_entity_creation_time', - 'created_time', 'updated_time', - ]) - return spb.Entity(**kwargs) - - def _to_proto_permission_type(self, permission_type): - spb = self._sharing_pb2() - if isinstance(permission_type, spb.PermissionType): - return permission_type - kwargs = self._extract_fields(permission_type, [ - 'permission_type_id', 'domain_id', 'name', 'description', - 'created_time', 'updated_time', - ]) - return spb.PermissionType(**kwargs) - - def _to_proto_search_criteria(self, criteria): - spb = self._sharing_pb2() - if isinstance(criteria, spb.SearchCriteria): - return criteria - kwargs = self._extract_fields(criteria, [ - 'search_field', 'value', 'search_condition', - ]) - return spb.SearchCriteria(**kwargs) - - @staticmethod - def _extract_fields(obj, field_names): - """Extract fields from a dict or Thrift-like object.""" - kwargs = {} - for name in field_names: - val = None - if isinstance(obj, dict): - val = obj.get(name) - if val is None: - camel = _snake_to_camel(name) - val = obj.get(camel) - else: - val = getattr(obj, name, None) - if val is None: - camel = _snake_to_camel(name) - val = getattr(obj, camel, None) - if val is not None: - kwargs[name] = val - return kwargs diff --git a/airavata-python-sdk/airavata_sdk/facade/storage.py b/airavata-python-sdk/airavata_sdk/facade/storage.py deleted file mode 100644 index b6a1ca80e74..00000000000 --- a/airavata-python-sdk/airavata_sdk/facade/storage.py +++ /dev/null @@ -1,247 +0,0 @@ -import importlib - -from airavata_sdk.transport.utils import create_resource_service_stub, create_user_storage_service_stub - - -class StorageClient: - """Storage resource CRUD and data movement operations.""" - - def __init__(self, channel, metadata, gateway_id): - self._metadata = metadata - self._gateway_id = gateway_id - self._resource = create_resource_service_stub(channel) - self._user_storage = create_user_storage_service_stub(channel) - - @staticmethod - def _svc(name): - return importlib.import_module(f"airavata_sdk.generated.services.{name}") - - # ================================================================ - # Storage Resource CRUD - # ================================================================ - - def register_storage_resource(self, storage_resource): - pb2 = self._svc("resource_service_pb2") - response = self._resource.RegisterStorageResource( - pb2.RegisterStorageResourceRequest(storage_resource=storage_resource), - metadata=self._metadata, - ) - return response.storage_resource_id - - def get_storage_resource(self, storage_resource_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.GetStorageResource( - pb2.GetStorageResourceRequest(storage_resource_id=storage_resource_id), - metadata=self._metadata, - ) - - def update_storage_resource(self, storage_resource_id, storage_resource): - pb2 = self._svc("resource_service_pb2") - return self._resource.UpdateStorageResource( - pb2.UpdateStorageResourceRequest(storage_resource_id=storage_resource_id, storage_resource=storage_resource), - metadata=self._metadata, - ) - - def delete_storage_resource(self, storage_resource_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.DeleteStorageResource( - pb2.DeleteStorageResourceRequest(storage_resource_id=storage_resource_id), - metadata=self._metadata, - ) - - def get_all_storage_resource_names(self): - pb2 = self._svc("resource_service_pb2") - response = self._resource.GetAllStorageResourceNames( - pb2.GetAllStorageResourceNamesRequest(), - metadata=self._metadata, - ) - return dict(response.storage_resource_names) - - # ================================================================ - # Data Movement - # ================================================================ - - def add_local_data_movement(self, compute_resource_id, priority, dm_type, local_data_movement): - pb2 = self._svc("resource_service_pb2") - response = self._resource.AddLocalDataMovement( - pb2.AddLocalDataMovementRequest(compute_resource_id=compute_resource_id, priority=priority, dm_type=dm_type, local_data_movement=local_data_movement), - metadata=self._metadata, - ) - return response.data_movement_id - - def update_local_data_movement(self, data_movement_id, local_data_movement): - pb2 = self._svc("resource_service_pb2") - return self._resource.UpdateLocalDataMovement( - pb2.UpdateLocalDataMovementRequest(data_movement_id=data_movement_id, local_data_movement=local_data_movement), - metadata=self._metadata, - ) - - def get_local_data_movement(self, data_movement_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.GetLocalDataMovement( - pb2.GetLocalDataMovementRequest(data_movement_id=data_movement_id), - metadata=self._metadata, - ) - - def add_scp_data_movement(self, compute_resource_id, priority, dm_type, scp_data_movement): - pb2 = self._svc("resource_service_pb2") - response = self._resource.AddSCPDataMovement( - pb2.AddSCPDataMovementRequest(compute_resource_id=compute_resource_id, priority=priority, dm_type=dm_type, scp_data_movement=scp_data_movement), - metadata=self._metadata, - ) - return response.data_movement_id - - def update_scp_data_movement(self, data_movement_id, scp_data_movement): - pb2 = self._svc("resource_service_pb2") - return self._resource.UpdateSCPDataMovement( - pb2.UpdateSCPDataMovementRequest(data_movement_id=data_movement_id, scp_data_movement=scp_data_movement), - metadata=self._metadata, - ) - - def get_scp_data_movement(self, data_movement_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.GetSCPDataMovement( - pb2.GetSCPDataMovementRequest(data_movement_id=data_movement_id), - metadata=self._metadata, - ) - - def add_grid_ftp_data_movement(self, compute_resource_id, priority, dm_type, gridftp_data_movement): - pb2 = self._svc("resource_service_pb2") - response = self._resource.AddGridFTPDataMovement( - pb2.AddGridFTPDataMovementRequest(compute_resource_id=compute_resource_id, priority=priority, dm_type=dm_type, gridftp_data_movement=gridftp_data_movement), - metadata=self._metadata, - ) - return response.data_movement_id - - def update_grid_ftp_data_movement(self, data_movement_id, gridftp_data_movement): - pb2 = self._svc("resource_service_pb2") - return self._resource.UpdateGridFTPDataMovement( - pb2.UpdateGridFTPDataMovementRequest(data_movement_id=data_movement_id, gridftp_data_movement=gridftp_data_movement), - metadata=self._metadata, - ) - - def get_grid_ftp_data_movement(self, data_movement_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.GetGridFTPDataMovement( - pb2.GetGridFTPDataMovementRequest(data_movement_id=data_movement_id), - metadata=self._metadata, - ) - - def delete_data_movement_interface(self, compute_resource_id, data_movement_id): - pb2 = self._svc("resource_service_pb2") - return self._resource.DeleteDataMovementInterface( - pb2.DeleteDataMovementInterfaceRequest(compute_resource_id=compute_resource_id, data_movement_id=data_movement_id), - metadata=self._metadata, - ) - - # ================================================================ - # User Storage - # ================================================================ - - def upload_file(self, path, content, name, storage_resource_id=None, content_type=""): - pb2 = self._svc("file_service_pb2") - return self._user_storage.UploadFile( - pb2.UploadFileRequest( - storage_resource_id=storage_resource_id or "", - path=path, - name=name, - content_type=content_type, - content=content, - ), - metadata=self._metadata, - ) - - def download_file(self, path, storage_resource_id=None): - pb2 = self._svc("file_service_pb2") - return self._user_storage.DownloadFile( - pb2.DownloadFileRequest(storage_resource_id=storage_resource_id or "", path=path), - metadata=self._metadata, - ) - - def file_exists(self, path, storage_resource_id=None): - pb2 = self._svc("file_service_pb2") - resp = self._user_storage.FileExists( - pb2.FileExistsRequest(storage_resource_id=storage_resource_id or "", path=path), - metadata=self._metadata, - ) - return resp.exists - - def dir_exists(self, path, storage_resource_id=None): - pb2 = self._svc("file_service_pb2") - resp = self._user_storage.DirExists( - pb2.DirExistsRequest(storage_resource_id=storage_resource_id or "", path=path), - metadata=self._metadata, - ) - return resp.exists - - def list_dir(self, path, storage_resource_id=None): - pb2 = self._svc("file_service_pb2") - return self._user_storage.ListDir( - pb2.ListDirRequest(storage_resource_id=storage_resource_id or "", path=path), - metadata=self._metadata, - ) - - def delete_file(self, path, storage_resource_id=None): - pb2 = self._svc("file_service_pb2") - return self._user_storage.DeleteFile( - pb2.DeleteFileRequest(storage_resource_id=storage_resource_id or "", path=path), - metadata=self._metadata, - ) - - def delete_dir(self, path, storage_resource_id=None): - pb2 = self._svc("file_service_pb2") - return self._user_storage.DeleteDir( - pb2.DeleteDirRequest(storage_resource_id=storage_resource_id or "", path=path), - metadata=self._metadata, - ) - - def move_file(self, source_path, dest_path, storage_resource_id=None): - pb2 = self._svc("file_service_pb2") - return self._user_storage.MoveFile( - pb2.MoveFileRequest( - storage_resource_id=storage_resource_id or "", - source_path=source_path, - destination_path=dest_path, - ), - metadata=self._metadata, - ) - - def create_dir(self, path, storage_resource_id=None): - pb2 = self._svc("file_service_pb2") - return self._user_storage.CreateDir( - pb2.CreateDirRequest(storage_resource_id=storage_resource_id or "", path=path), - metadata=self._metadata, - ) - - def create_symlink(self, source_path, dest_path, storage_resource_id=None): - pb2 = self._svc("file_service_pb2") - return self._user_storage.CreateSymlink( - pb2.CreateSymlinkRequest( - storage_resource_id=storage_resource_id or "", - source_path=source_path, - target_path=dest_path, - ), - metadata=self._metadata, - ) - - def get_file_metadata(self, path, storage_resource_id=None): - pb2 = self._svc("file_service_pb2") - return self._user_storage.GetFileMetadata( - pb2.GetFileMetadataRequest(storage_resource_id=storage_resource_id or "", path=path), - metadata=self._metadata, - ) - - def list_experiment_dir(self, experiment_id, path=""): - pb2 = self._svc("file_service_pb2") - return self._user_storage.ListExperimentDir( - pb2.ListExperimentDirRequest(experiment_id=experiment_id), - metadata=self._metadata, - ) - - def get_default_storage_resource_id(self): - pb2 = self._svc("file_service_pb2") - resp = self._user_storage.GetDefaultStorageResourceId( - pb2.GetDefaultStorageResourceIdRequest(), - metadata=self._metadata, - ) - return resp.storage_resource_id diff --git a/airavata-python-sdk/airavata_sdk/generated/__init__.py b/airavata-python-sdk/airavata_sdk/generated/__init__.py deleted file mode 100644 index c30b1661d98..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Generated protobuf and gRPC stubs. - -Adds this directory to sys.path so that absolute imports generated by protoc -(e.g., ``from org.apache.airavata.model.experiment import experiment_pb2``) -resolve correctly. -""" - -import os as _os -import sys as _sys - -_generated_dir = _os.path.dirname(_os.path.abspath(__file__)) -if _generated_dir not in _sys.path: - _sys.path.insert(0, _generated_dir) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/computeresource/compute_resource_pb2.py b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/computeresource/compute_resource_pb2.py deleted file mode 100644 index 61aeacba36b..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/computeresource/compute_resource_pb2.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: org/apache/airavata/model/appcatalog/computeresource/compute_resource.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'org/apache/airavata/model/appcatalog/computeresource/compute_resource.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from org.apache.airavata.model.parallelism import parallelism_pb2 as org_dot_apache_dot_airavata_dot_model_dot_parallelism_dot_parallelism__pb2 -from org.apache.airavata.model.data.movement import data_movement_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nKorg/apache/airavata/model/appcatalog/computeresource/compute_resource.proto\x12\x34org.apache.airavata.model.appcatalog.computeresource\x1a\x37org/apache/airavata/model/parallelism/parallelism.proto\x1a;org/apache/airavata/model/data/movement/data_movement.proto\"\xd8\x04\n\x12ResourceJobManager\x12\x1f\n\x17resource_job_manager_id\x18\x01 \x01(\t\x12o\n\x19resource_job_manager_type\x18\x02 \x01(\x0e\x32L.org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType\x12 \n\x18push_monitoring_endpoint\x18\x03 \x01(\t\x12\x1c\n\x14job_manager_bin_path\x18\x04 \x01(\t\x12~\n\x14job_manager_commands\x18\x05 \x03(\x0b\x32`.org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager.JobManagerCommandsEntry\x12{\n\x12parallelism_prefix\x18\x06 \x03(\x0b\x32_.org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager.ParallelismPrefixEntry\x1a\x39\n\x17JobManagerCommandsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x38\n\x16ParallelismPrefixEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcb\x02\n\nBatchQueue\x12\x12\n\nqueue_name\x18\x01 \x01(\t\x12\x19\n\x11queue_description\x18\x02 \x01(\t\x12\x14\n\x0cmax_run_time\x18\x03 \x01(\x05\x12\x11\n\tmax_nodes\x18\x04 \x01(\x05\x12\x16\n\x0emax_processors\x18\x05 \x01(\x05\x12\x19\n\x11max_jobs_in_queue\x18\x06 \x01(\x05\x12\x12\n\nmax_memory\x18\x07 \x01(\x05\x12\x14\n\x0c\x63pu_per_node\x18\x08 \x01(\x05\x12\x1a\n\x12\x64\x65\x66\x61ult_node_count\x18\t \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_cpu_count\x18\n \x01(\x05\x12\x18\n\x10\x64\x65\x66\x61ult_walltime\x18\x0b \x01(\x05\x12\x1d\n\x15queue_specific_macros\x18\x0c \x01(\t\x12\x18\n\x10is_default_queue\x18\r \x01(\x08\"\xf4\x01\n\x0fLOCALSubmission\x12#\n\x1bjob_submission_interface_id\x18\x01 \x01(\t\x12\x66\n\x14resource_job_manager\x18\x02 \x01(\x0b\x32H.org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager\x12T\n\x11security_protocol\x18\x03 \x01(\x0e\x32\x39.org.apache.airavata.model.data.movement.SecurityProtocol\"\xa6\x03\n\x10SSHJobSubmission\x12#\n\x1bjob_submission_interface_id\x18\x01 \x01(\t\x12T\n\x11security_protocol\x18\x02 \x01(\x0e\x32\x39.org.apache.airavata.model.data.movement.SecurityProtocol\x12\x66\n\x14resource_job_manager\x18\x03 \x01(\x0b\x32H.org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager\x12!\n\x19\x61lternative_ssh_host_name\x18\x04 \x01(\t\x12\x10\n\x08ssh_port\x18\x05 \x01(\x05\x12W\n\x0cmonitor_mode\x18\x06 \x01(\x0e\x32\x41.org.apache.airavata.model.appcatalog.computeresource.MonitorMode\x12!\n\x19\x62\x61tch_queue_email_senders\x18\x07 \x03(\t\"\xb6\x01\n\x13GlobusJobSubmission\x12#\n\x1bjob_submission_interface_id\x18\x01 \x01(\t\x12T\n\x11security_protocol\x18\x02 \x01(\x0e\x32\x39.org.apache.airavata.model.data.movement.SecurityProtocol\x12$\n\x1cglobus_gate_keeper_end_point\x18\x03 \x03(\t\"\xb0\x01\n\x14UnicoreJobSubmission\x12#\n\x1bjob_submission_interface_id\x18\x01 \x01(\t\x12T\n\x11security_protocol\x18\x02 \x01(\x0e\x32\x39.org.apache.airavata.model.data.movement.SecurityProtocol\x12\x1d\n\x15unicore_end_point_url\x18\x03 \x01(\t\"\xaf\x02\n\x12\x43loudJobSubmission\x12#\n\x1bjob_submission_interface_id\x18\x01 \x01(\t\x12T\n\x11security_protocol\x18\x02 \x01(\x0e\x32\x39.org.apache.airavata.model.data.movement.SecurityProtocol\x12\x0f\n\x07node_id\x18\x03 \x01(\t\x12\x17\n\x0f\x65xecutable_type\x18\x04 \x01(\t\x12Y\n\rprovider_name\x18\x05 \x01(\x0e\x32\x42.org.apache.airavata.model.appcatalog.computeresource.ProviderName\x12\x19\n\x11user_account_name\x18\x06 \x01(\t\"\xc3\x01\n\x16JobSubmissionInterface\x12#\n\x1bjob_submission_interface_id\x18\x01 \x01(\t\x12l\n\x17job_submission_protocol\x18\x02 \x01(\x0e\x32K.org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol\x12\x16\n\x0epriority_order\x18\x03 \x01(\x05\"\xf2\x06\n\x1a\x43omputeResourceDescription\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x11\n\thost_name\x18\x02 \x01(\t\x12\x14\n\x0chost_aliases\x18\x03 \x03(\t\x12\x14\n\x0cip_addresses\x18\x04 \x03(\t\x12\x1c\n\x14resource_description\x18\x05 \x01(\t\x12\x0f\n\x07\x65nabled\x18\x06 \x01(\x08\x12V\n\x0c\x62\x61tch_queues\x18\x07 \x03(\x0b\x32@.org.apache.airavata.model.appcatalog.computeresource.BatchQueue\x12w\n\x0c\x66ile_systems\x18\x08 \x03(\x0b\x32\x61.org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription.FileSystemsEntry\x12o\n\x19job_submission_interfaces\x18\t \x03(\x0b\x32L.org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterface\x12`\n\x18\x64\x61ta_movement_interfaces\x18\n \x03(\x0b\x32>.org.apache.airavata.model.data.movement.DataMovementInterface\x12\x1b\n\x13max_memory_per_node\x18\x0b \x01(\x05\x12\x1f\n\x17gateway_usage_reporting\x18\x0c \x01(\x08\x12)\n!gateway_usage_module_load_command\x18\r \x01(\t\x12 \n\x18gateway_usage_executable\x18\x0e \x01(\t\x12\x15\n\rcpus_per_node\x18\x0f \x01(\x05\x12\x1a\n\x12\x64\x65\x66\x61ult_node_count\x18\x10 \x01(\x05\x12\x19\n\x11\x64\x65\x66\x61ult_cpu_count\x18\x11 \x01(\x05\x12\x18\n\x10\x64\x65\x66\x61ult_walltime\x18\x12 \x01(\x05\x1a\x32\n\x10\x46ileSystemsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01*\x9d\x01\n\x16ResourceJobManagerType\x12%\n!RESOURCE_JOB_MANAGER_TYPE_UNKNOWN\x10\x00\x12\x08\n\x04\x46ORK\x10\x01\x12\x07\n\x03PBS\x10\x02\x12\t\n\x05SLURM\x10\x03\x12\x07\n\x03LSF\x10\x04\x12\x07\n\x03UGE\x10\x05\x12\t\n\x05\x43LOUD\x10\x06\x12\x13\n\x0f\x41IRAVATA_CUSTOM\x10\x07\x12\x0c\n\x08HTCONDOR\x10\x08*\xfc\x01\n\x11JobManagerCommand\x12\x1f\n\x1bJOB_MANAGER_COMMAND_UNKNOWN\x10\x00\x12\x0e\n\nSUBMISSION\x10\x01\x12\x12\n\x0eJOB_MONITORING\x10\x02\x12\x0c\n\x08\x44\x45LETION\x10\x03\x12\r\n\tCHECK_JOB\x10\x04\x12\x0e\n\nSHOW_QUEUE\x10\x05\x12\x14\n\x10SHOW_RESERVATION\x10\x06\x12\x0e\n\nSHOW_START\x10\x07\x12\x15\n\x11SHOW_CLUSTER_INFO\x10\x08\x12\x1b\n\x17SHOW_NO_OF_RUNNING_JOBS\x10\t\x12\x1b\n\x17SHOW_NO_OF_PENDING_JOBS\x10\n*c\n\x0b\x46ileSystems\x12\x18\n\x14\x46ILE_SYSTEMS_UNKNOWN\x10\x00\x12\x08\n\x04HOME\x10\x01\x12\x08\n\x04WORK\x10\x02\x12\x0c\n\x08LOCALTMP\x10\x03\x12\x0b\n\x07SCRATCH\x10\x04\x12\x0b\n\x07\x41RCHIVE\x10\x05*\x96\x01\n\x15JobSubmissionProtocol\x12#\n\x1fJOB_SUBMISSION_PROTOCOL_UNKNOWN\x10\x00\x12\t\n\x05LOCAL\x10\x01\x12\x07\n\x03SSH\x10\x02\x12\n\n\x06GLOBUS\x10\x03\x12\x0b\n\x07UNICORE\x10\x04\x12\r\n\tJSP_CLOUD\x10\x05\x12\x0c\n\x08SSH_FORK\x10\x06\x12\x0e\n\nLOCAL_FORK\x10\x07*\xb7\x01\n\x0bMonitorMode\x12\x18\n\x14MONITOR_MODE_UNKNOWN\x10\x00\x12\x14\n\x10POLL_JOB_MANAGER\x10\x01\x12\x15\n\x11\x43LOUD_JOB_MONITOR\x10\x02\x12\"\n\x1eJOB_EMAIL_NOTIFICATION_MONITOR\x10\x03\x12\x18\n\x14XSEDE_AMQP_SUBSCRIBE\x10\x04\x12\x10\n\x0cMONITOR_FORK\x10\x05\x12\x11\n\rMONITOR_LOCAL\x10\x06*I\n\x06\x44MType\x12\x13\n\x0f\x44M_TYPE_UNKNOWN\x10\x00\x12\x14\n\x10\x43OMPUTE_RESOURCE\x10\x01\x12\x14\n\x10STORAGE_RESOURCE\x10\x02*M\n\x0cProviderName\x12\x19\n\x15PROVIDER_NAME_UNKNOWN\x10\x00\x12\x07\n\x03\x45\x43\x32\x10\x01\x12\n\n\x06\x41WSEC2\x10\x02\x12\r\n\tRACKSPACE\x10\x03\x42>\n:org.apache.airavata.model.appcatalog.computeresource.protoP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.appcatalog.computeresource.compute_resource_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n:org.apache.airavata.model.appcatalog.computeresource.protoP\001' - _globals['_RESOURCEJOBMANAGER_JOBMANAGERCOMMANDSENTRY']._loaded_options = None - _globals['_RESOURCEJOBMANAGER_JOBMANAGERCOMMANDSENTRY']._serialized_options = b'8\001' - _globals['_RESOURCEJOBMANAGER_PARALLELISMPREFIXENTRY']._loaded_options = None - _globals['_RESOURCEJOBMANAGER_PARALLELISMPREFIXENTRY']._serialized_options = b'8\001' - _globals['_COMPUTERESOURCEDESCRIPTION_FILESYSTEMSENTRY']._loaded_options = None - _globals['_COMPUTERESOURCEDESCRIPTION_FILESYSTEMSENTRY']._serialized_options = b'8\001' - _globals['_RESOURCEJOBMANAGERTYPE']._serialized_start=3614 - _globals['_RESOURCEJOBMANAGERTYPE']._serialized_end=3771 - _globals['_JOBMANAGERCOMMAND']._serialized_start=3774 - _globals['_JOBMANAGERCOMMAND']._serialized_end=4026 - _globals['_FILESYSTEMS']._serialized_start=4028 - _globals['_FILESYSTEMS']._serialized_end=4127 - _globals['_JOBSUBMISSIONPROTOCOL']._serialized_start=4130 - _globals['_JOBSUBMISSIONPROTOCOL']._serialized_end=4280 - _globals['_MONITORMODE']._serialized_start=4283 - _globals['_MONITORMODE']._serialized_end=4466 - _globals['_DMTYPE']._serialized_start=4468 - _globals['_DMTYPE']._serialized_end=4541 - _globals['_PROVIDERNAME']._serialized_start=4543 - _globals['_PROVIDERNAME']._serialized_end=4620 - _globals['_RESOURCEJOBMANAGER']._serialized_start=252 - _globals['_RESOURCEJOBMANAGER']._serialized_end=852 - _globals['_RESOURCEJOBMANAGER_JOBMANAGERCOMMANDSENTRY']._serialized_start=737 - _globals['_RESOURCEJOBMANAGER_JOBMANAGERCOMMANDSENTRY']._serialized_end=794 - _globals['_RESOURCEJOBMANAGER_PARALLELISMPREFIXENTRY']._serialized_start=796 - _globals['_RESOURCEJOBMANAGER_PARALLELISMPREFIXENTRY']._serialized_end=852 - _globals['_BATCHQUEUE']._serialized_start=855 - _globals['_BATCHQUEUE']._serialized_end=1186 - _globals['_LOCALSUBMISSION']._serialized_start=1189 - _globals['_LOCALSUBMISSION']._serialized_end=1433 - _globals['_SSHJOBSUBMISSION']._serialized_start=1436 - _globals['_SSHJOBSUBMISSION']._serialized_end=1858 - _globals['_GLOBUSJOBSUBMISSION']._serialized_start=1861 - _globals['_GLOBUSJOBSUBMISSION']._serialized_end=2043 - _globals['_UNICOREJOBSUBMISSION']._serialized_start=2046 - _globals['_UNICOREJOBSUBMISSION']._serialized_end=2222 - _globals['_CLOUDJOBSUBMISSION']._serialized_start=2225 - _globals['_CLOUDJOBSUBMISSION']._serialized_end=2528 - _globals['_JOBSUBMISSIONINTERFACE']._serialized_start=2531 - _globals['_JOBSUBMISSIONINTERFACE']._serialized_end=2726 - _globals['_COMPUTERESOURCEDESCRIPTION']._serialized_start=2729 - _globals['_COMPUTERESOURCEDESCRIPTION']._serialized_end=3611 - _globals['_COMPUTERESOURCEDESCRIPTION_FILESYSTEMSENTRY']._serialized_start=3561 - _globals['_COMPUTERESOURCEDESCRIPTION_FILESYSTEMSENTRY']._serialized_end=3611 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2.py b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2.py deleted file mode 100644 index b40dc728583..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile_pb2.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'org/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from org.apache.airavata.model.appcatalog.computeresource import compute_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2 -from org.apache.airavata.model.data.movement import data_movement_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nIorg/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile.proto\x12\x33org.apache.airavata.model.appcatalog.gatewayprofile\x1aKorg/apache/airavata/model/appcatalog/computeresource/compute_resource.proto\x1a;org/apache/airavata/model/data/movement/data_movement.proto\"\xa1\x07\n\x19\x43omputeResourcePreference\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x1c\n\x14override_by_airavata\x18\x02 \x01(\x08\x12\x17\n\x0flogin_user_name\x18\x03 \x01(\t\x12v\n!preferred_job_submission_protocol\x18\x04 \x01(\x0e\x32K.org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol\x12g\n preferred_data_movement_protocol\x18\x05 \x01(\x0e\x32=.org.apache.airavata.model.data.movement.DataMovementProtocol\x12\x1d\n\x15preferred_batch_queue\x18\x06 \x01(\t\x12\x18\n\x10scratch_location\x18\x07 \x01(\t\x12!\n\x19\x61llocation_project_number\x18\x08 \x01(\t\x12\x30\n(resource_specific_credential_store_token\x18\t \x01(\t\x12\"\n\x1ausage_reporting_gateway_id\x18\n \x01(\t\x12\x1a\n\x12quality_of_service\x18\x0b \x01(\t\x12\x13\n\x0breservation\x18\x0c \x01(\t\x12\x1e\n\x16reservation_start_time\x18\r \x01(\x03\x12\x1c\n\x14reservation_end_time\x18\x0e \x01(\x03\x12\x1f\n\x17ssh_account_provisioner\x18\x0f \x01(\t\x12\x97\x01\n\x1essh_account_provisioner_config\x18\x10 \x03(\x0b\x32o.org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference.SshAccountProvisionerConfigEntry\x12/\n\'ssh_account_provisioner_additional_info\x18\x11 \x01(\t\x1a\x42\n SshAccountProvisionerConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9e\x01\n\x11StoragePreference\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x17\n\x0flogin_user_name\x18\x02 \x01(\t\x12!\n\x19\x66ile_system_root_location\x18\x03 \x01(\t\x12\x30\n(resource_specific_credential_store_token\x18\x04 \x01(\t\"\xef\x02\n\x16GatewayResourceProfile\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1e\n\x16\x63redential_store_token\x18\x02 \x01(\t\x12t\n\x1c\x63ompute_resource_preferences\x18\x03 \x03(\x0b\x32N.org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference\x12\x63\n\x13storage_preferences\x18\x04 \x03(\x0b\x32\x46.org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference\x12\x1e\n\x16identity_server_tenant\x18\x05 \x01(\t\x12&\n\x1eidentity_server_pwd_cred_token\x18\x06 \x01(\tB=\n9org.apache.airavata.model.appcatalog.gatewayprofile.protoP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.appcatalog.gatewayprofile.gateway_profile_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n9org.apache.airavata.model.appcatalog.gatewayprofile.protoP\001' - _globals['_COMPUTERESOURCEPREFERENCE_SSHACCOUNTPROVISIONERCONFIGENTRY']._loaded_options = None - _globals['_COMPUTERESOURCEPREFERENCE_SSHACCOUNTPROVISIONERCONFIGENTRY']._serialized_options = b'8\001' - _globals['_COMPUTERESOURCEPREFERENCE']._serialized_start=269 - _globals['_COMPUTERESOURCEPREFERENCE']._serialized_end=1198 - _globals['_COMPUTERESOURCEPREFERENCE_SSHACCOUNTPROVISIONERCONFIGENTRY']._serialized_start=1132 - _globals['_COMPUTERESOURCEPREFERENCE_SSHACCOUNTPROVISIONERCONFIGENTRY']._serialized_end=1198 - _globals['_STORAGEPREFERENCE']._serialized_start=1201 - _globals['_STORAGEPREFERENCE']._serialized_end=1359 - _globals['_GATEWAYRESOURCEPROFILE']._serialized_start=1362 - _globals['_GATEWAYRESOURCEPROFILE']._serialized_end=1729 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2.py b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2.py deleted file mode 100644 index 4e23195117c..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile_pb2.py +++ /dev/null @@ -1,57 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'org/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from org.apache.airavata.model.appcatalog.computeresource import compute_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2 -from org.apache.airavata.model.data.movement import data_movement_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nVorg/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile.proto\x12\x39org.apache.airavata.model.appcatalog.groupresourceprofile\x1aKorg/apache/airavata/model/appcatalog/computeresource/compute_resource.proto\x1a;org/apache/airavata/model/data/movement/data_movement.proto\"\x85\x01\n GroupAccountSSHProvisionerConfig\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x02 \x01(\t\x12\x13\n\x0b\x63onfig_name\x18\x03 \x01(\t\x12\x14\n\x0c\x63onfig_value\x18\x04 \x01(\t\"\x89\x01\n\x1a\x43omputeResourceReservation\x12\x16\n\x0ereservation_id\x18\x01 \x01(\t\x12\x18\n\x10reservation_name\x18\x02 \x01(\t\x12\x13\n\x0bqueue_names\x18\x03 \x03(\t\x12\x12\n\nstart_time\x18\x04 \x01(\x03\x12\x10\n\x08\x65nd_time\x18\x05 \x01(\x03\"\xee\x03\n\x1eSlurmComputeResourcePreference\x12!\n\x19\x61llocation_project_number\x18\x01 \x01(\t\x12\x1d\n\x15preferred_batch_queue\x18\x02 \x01(\t\x12\x1a\n\x12quality_of_service\x18\x03 \x01(\t\x12\"\n\x1ausage_reporting_gateway_id\x18\x04 \x01(\t\x12\x1f\n\x17ssh_account_provisioner\x18\x05 \x01(\t\x12\x8a\x01\n%group_ssh_account_provisioner_configs\x18\x06 \x03(\x0b\x32[.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupAccountSSHProvisionerConfig\x12/\n\'ssh_account_provisioner_additional_info\x18\x07 \x01(\t\x12k\n\x0creservations\x18\x08 \x03(\x0b\x32U.org.apache.airavata.model.appcatalog.groupresourceprofile.ComputeResourceReservation\"i\n\x1c\x41wsComputeResourcePreference\x12\x0e\n\x06region\x18\x01 \x01(\t\x12\x18\n\x10preferred_ami_id\x18\x02 \x01(\t\x12\x1f\n\x17preferred_instance_type\x18\x03 \x01(\t\"\x83\x02\n\x1e\x45nvironmentSpecificPreferences\x12j\n\x05slurm\x18\x01 \x01(\x0b\x32Y.org.apache.airavata.model.appcatalog.groupresourceprofile.SlurmComputeResourcePreferenceH\x00\x12\x66\n\x03\x61ws\x18\x02 \x01(\x0b\x32W.org.apache.airavata.model.appcatalog.groupresourceprofile.AwsComputeResourcePreferenceH\x00\x42\r\n\x0bpreferences\"\x9d\x05\n\x1eGroupComputeResourcePreference\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x02 \x01(\t\x12\x1c\n\x14override_by_airavata\x18\x03 \x01(\x08\x12\x17\n\x0flogin_user_name\x18\x04 \x01(\t\x12\x18\n\x10scratch_location\x18\x05 \x01(\t\x12v\n!preferred_job_submission_protocol\x18\x06 \x01(\x0e\x32K.org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol\x12g\n preferred_data_movement_protocol\x18\x07 \x01(\x0e\x32=.org.apache.airavata.model.data.movement.DataMovementProtocol\x12\x30\n(resource_specific_credential_store_token\x18\x08 \x01(\t\x12^\n\rresource_type\x18\t \x01(\x0e\x32G.org.apache.airavata.model.appcatalog.groupresourceprofile.ResourceType\x12w\n\x14specific_preferences\x18\n \x01(\x0b\x32Y.org.apache.airavata.model.appcatalog.groupresourceprofile.EnvironmentSpecificPreferences\"\x91\x01\n\x15\x43omputeResourcePolicy\x12\x1a\n\x12resource_policy_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x03 \x01(\t\x12\x1c\n\x14\x61llowed_batch_queues\x18\x04 \x03(\t\"\xdd\x01\n\x18\x42\x61tchQueueResourcePolicy\x12\x1a\n\x12resource_policy_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x03 \x01(\t\x12\x11\n\tqueuename\x18\x04 \x01(\t\x12\x19\n\x11max_allowed_nodes\x18\x05 \x01(\x05\x12\x19\n\x11max_allowed_cores\x18\x06 \x01(\x05\x12\x1c\n\x14max_allowed_walltime\x18\x07 \x01(\x05\"\xb0\x04\n\x14GroupResourceProfile\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x02 \x01(\t\x12#\n\x1bgroup_resource_profile_name\x18\x03 \x01(\t\x12v\n\x13\x63ompute_preferences\x18\x04 \x03(\x0b\x32Y.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupComputeResourcePreference\x12s\n\x19\x63ompute_resource_policies\x18\x05 \x03(\x0b\x32P.org.apache.airavata.model.appcatalog.groupresourceprofile.ComputeResourcePolicy\x12z\n\x1d\x62\x61tch_queue_resource_policies\x18\x06 \x03(\x0b\x32S.org.apache.airavata.model.appcatalog.groupresourceprofile.BatchQueueResourcePolicy\x12\x15\n\rcreation_time\x18\x07 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x08 \x01(\x03\x12&\n\x1e\x64\x65\x66\x61ult_credential_store_token\x18\t \x01(\t*=\n\x0cResourceType\x12\x19\n\x15RESOURCE_TYPE_UNKNOWN\x10\x00\x12\t\n\x05SLURM\x10\x01\x12\x07\n\x03\x41WS\x10\x02\x42\x43\n?org.apache.airavata.model.appcatalog.groupresourceprofile.protoP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.appcatalog.groupresourceprofile.group_resource_profile_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n?org.apache.airavata.model.appcatalog.groupresourceprofile.protoP\001' - _globals['_RESOURCETYPE']._serialized_start=3036 - _globals['_RESOURCETYPE']._serialized_end=3097 - _globals['_GROUPACCOUNTSSHPROVISIONERCONFIG']._serialized_start=288 - _globals['_GROUPACCOUNTSSHPROVISIONERCONFIG']._serialized_end=421 - _globals['_COMPUTERESOURCERESERVATION']._serialized_start=424 - _globals['_COMPUTERESOURCERESERVATION']._serialized_end=561 - _globals['_SLURMCOMPUTERESOURCEPREFERENCE']._serialized_start=564 - _globals['_SLURMCOMPUTERESOURCEPREFERENCE']._serialized_end=1058 - _globals['_AWSCOMPUTERESOURCEPREFERENCE']._serialized_start=1060 - _globals['_AWSCOMPUTERESOURCEPREFERENCE']._serialized_end=1165 - _globals['_ENVIRONMENTSPECIFICPREFERENCES']._serialized_start=1168 - _globals['_ENVIRONMENTSPECIFICPREFERENCES']._serialized_end=1427 - _globals['_GROUPCOMPUTERESOURCEPREFERENCE']._serialized_start=1430 - _globals['_GROUPCOMPUTERESOURCEPREFERENCE']._serialized_end=2099 - _globals['_COMPUTERESOURCEPOLICY']._serialized_start=2102 - _globals['_COMPUTERESOURCEPOLICY']._serialized_end=2247 - _globals['_BATCHQUEUERESOURCEPOLICY']._serialized_start=2250 - _globals['_BATCHQUEUERESOURCEPOLICY']._serialized_end=2471 - _globals['_GROUPRESOURCEPROFILE']._serialized_start=2474 - _globals['_GROUPRESOURCEPROFILE']._serialized_end=3034 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/storageresource/storage_resource_pb2.py b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/storageresource/storage_resource_pb2.py deleted file mode 100644 index 313330b3fe1..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/appcatalog/storageresource/storage_resource_pb2.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: org/apache/airavata/model/appcatalog/storageresource/storage_resource.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'org/apache/airavata/model/appcatalog/storageresource/storage_resource.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from org.apache.airavata.model.data.movement import data_movement_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nKorg/apache/airavata/model/appcatalog/storageresource/storage_resource.proto\x12\x34org.apache.airavata.model.appcatalog.storageresource\x1a;org/apache/airavata/model/data/movement/data_movement.proto\"\x91\x02\n\x1aStorageResourceDescription\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x11\n\thost_name\x18\x02 \x01(\t\x12$\n\x1cstorage_resource_description\x18\x03 \x01(\t\x12\x0f\n\x07\x65nabled\x18\x04 \x01(\x08\x12`\n\x18\x64\x61ta_movement_interfaces\x18\x05 \x03(\x0b\x32>.org.apache.airavata.model.data.movement.DataMovementInterface\x12\x15\n\rcreation_time\x18\x06 \x01(\x03\x12\x13\n\x0bupdate_time\x18\x07 \x01(\x03\"\xf9\x01\n\x11StorageVolumeInfo\x12\x12\n\ntotal_size\x18\x01 \x01(\t\x12\x11\n\tused_size\x18\x02 \x01(\t\x12\x16\n\x0e\x61vailable_size\x18\x03 \x01(\t\x12\x1d\n\x15total_size_byte_count\x18\x04 \x01(\x03\x12\x1c\n\x14used_size_byte_count\x18\x05 \x01(\x03\x12!\n\x19\x61vailable_size_byte_count\x18\x06 \x01(\x03\x12\x17\n\x0fpercentage_used\x18\x07 \x01(\x01\x12\x13\n\x0bmount_point\x18\x08 \x01(\t\x12\x17\n\x0f\x66ilesystem_type\x18\t \x01(\t\"I\n\x14StorageDirectoryInfo\x12\x12\n\ntotal_size\x18\x01 \x01(\t\x12\x1d\n\x15total_size_byte_count\x18\x02 \x01(\x03\x42>\n:org.apache.airavata.model.appcatalog.storageresource.protoP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.appcatalog.storageresource.storage_resource_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n:org.apache.airavata.model.appcatalog.storageresource.protoP\001' - _globals['_STORAGERESOURCEDESCRIPTION']._serialized_start=195 - _globals['_STORAGERESOURCEDESCRIPTION']._serialized_end=468 - _globals['_STORAGEVOLUMEINFO']._serialized_start=471 - _globals['_STORAGEVOLUMEINFO']._serialized_end=720 - _globals['_STORAGEDIRECTORYINFO']._serialized_start=722 - _globals['_STORAGEDIRECTORYINFO']._serialized_end=795 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/movement/data_movement_pb2.py b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/movement/data_movement_pb2.py deleted file mode 100644 index 927d4d50ded..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/movement/data_movement_pb2.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: org/apache/airavata/model/data/movement/data_movement.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'org/apache/airavata/model/data/movement/data_movement.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n;org/apache/airavata/model/data/movement/data_movement.proto\x12\'org.apache.airavata.model.data.movement\"\xc0\x01\n\x0fSCPDataMovement\x12\"\n\x1a\x64\x61ta_movement_interface_id\x18\x01 \x01(\t\x12T\n\x11security_protocol\x18\x02 \x01(\x0e\x32\x39.org.apache.airavata.model.data.movement.SecurityProtocol\x12!\n\x19\x61lternative_scp_host_name\x18\x03 \x01(\t\x12\x10\n\x08ssh_port\x18\x04 \x01(\x05\"\xac\x01\n\x13GridFTPDataMovement\x12\"\n\x1a\x64\x61ta_movement_interface_id\x18\x01 \x01(\t\x12T\n\x11security_protocol\x18\x02 \x01(\x0e\x32\x39.org.apache.airavata.model.data.movement.SecurityProtocol\x12\x1b\n\x13grid_ftp_end_points\x18\x03 \x03(\t\"\xae\x01\n\x13UnicoreDataMovement\x12\"\n\x1a\x64\x61ta_movement_interface_id\x18\x01 \x01(\t\x12T\n\x11security_protocol\x18\x02 \x01(\x0e\x32\x39.org.apache.airavata.model.data.movement.SecurityProtocol\x12\x1d\n\x15unicore_end_point_url\x18\x03 \x01(\t\"7\n\x11LOCALDataMovement\x12\"\n\x1a\x64\x61ta_movement_interface_id\x18\x01 \x01(\t\"\xfb\x01\n\x15\x44\x61taMovementInterface\x12\"\n\x1a\x64\x61ta_movement_interface_id\x18\x01 \x01(\t\x12]\n\x16\x64\x61ta_movement_protocol\x18\x02 \x01(\x0e\x32=.org.apache.airavata.model.data.movement.DataMovementProtocol\x12\x16\n\x0epriority_order\x18\x03 \x01(\x05\x12\x15\n\rcreation_time\x18\x04 \x01(\x03\x12\x13\n\x0bupdate_time\x18\x05 \x01(\x03\x12\x1b\n\x13storage_resource_id\x18\x06 \x01(\t*I\n\x06\x44MType\x12\x13\n\x0f\x44M_TYPE_UNKNOWN\x10\x00\x12\x14\n\x10\x43OMPUTE_RESOURCE\x10\x01\x12\x14\n\x10STORAGE_RESOURCE\x10\x02*\x83\x01\n\x10SecurityProtocol\x12\x1d\n\x19SECURITY_PROTOCOL_UNKNOWN\x10\x00\x12\x15\n\x11USERNAME_PASSWORD\x10\x01\x12\x0c\n\x08SSH_KEYS\x10\x02\x12\x07\n\x03GSI\x10\x03\x12\x0c\n\x08KERBEROS\x10\x04\x12\t\n\x05OAUTH\x10\x05\x12\t\n\x05LOCAL\x10\x06*\x9a\x01\n\x14\x44\x61taMovementProtocol\x12\"\n\x1e\x44\x41TA_MOVEMENT_PROTOCOL_UNKNOWN\x10\x00\x12 \n\x1c\x44\x41TA_MOVEMENT_PROTOCOL_LOCAL\x10\x01\x12\x07\n\x03SCP\x10\x02\x12\x08\n\x04SFTP\x10\x03\x12\x0c\n\x08GRID_FTP\x10\x04\x12\x1b\n\x17UNICORE_STORAGE_SERVICE\x10\x05\x42\x31\n-org.apache.airavata.model.data.movement.protoP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.data.movement.data_movement_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n-org.apache.airavata.model.data.movement.protoP\001' - _globals['_DMTYPE']._serialized_start=962 - _globals['_DMTYPE']._serialized_end=1035 - _globals['_SECURITYPROTOCOL']._serialized_start=1038 - _globals['_SECURITYPROTOCOL']._serialized_end=1169 - _globals['_DATAMOVEMENTPROTOCOL']._serialized_start=1172 - _globals['_DATAMOVEMENTPROTOCOL']._serialized_end=1326 - _globals['_SCPDATAMOVEMENT']._serialized_start=105 - _globals['_SCPDATAMOVEMENT']._serialized_end=297 - _globals['_GRIDFTPDATAMOVEMENT']._serialized_start=300 - _globals['_GRIDFTPDATAMOVEMENT']._serialized_end=472 - _globals['_UNICOREDATAMOVEMENT']._serialized_start=475 - _globals['_UNICOREDATAMOVEMENT']._serialized_end=649 - _globals['_LOCALDATAMOVEMENT']._serialized_start=651 - _globals['_LOCALDATAMOVEMENT']._serialized_end=706 - _globals['_DATAMOVEMENTINTERFACE']._serialized_start=709 - _globals['_DATAMOVEMENTINTERFACE']._serialized_end=960 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/movement/data_movement_pb2.pyi b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/movement/data_movement_pb2.pyi deleted file mode 100644 index 4f3f2c6ef9e..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/data/movement/data_movement_pb2.pyi +++ /dev/null @@ -1,103 +0,0 @@ -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class DMType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - DM_TYPE_UNKNOWN: _ClassVar[DMType] - COMPUTE_RESOURCE: _ClassVar[DMType] - STORAGE_RESOURCE: _ClassVar[DMType] - -class SecurityProtocol(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - SECURITY_PROTOCOL_UNKNOWN: _ClassVar[SecurityProtocol] - USERNAME_PASSWORD: _ClassVar[SecurityProtocol] - SSH_KEYS: _ClassVar[SecurityProtocol] - GSI: _ClassVar[SecurityProtocol] - KERBEROS: _ClassVar[SecurityProtocol] - OAUTH: _ClassVar[SecurityProtocol] - LOCAL: _ClassVar[SecurityProtocol] - -class DataMovementProtocol(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - DATA_MOVEMENT_PROTOCOL_UNKNOWN: _ClassVar[DataMovementProtocol] - DATA_MOVEMENT_PROTOCOL_LOCAL: _ClassVar[DataMovementProtocol] - SCP: _ClassVar[DataMovementProtocol] - SFTP: _ClassVar[DataMovementProtocol] - GRID_FTP: _ClassVar[DataMovementProtocol] - UNICORE_STORAGE_SERVICE: _ClassVar[DataMovementProtocol] -DM_TYPE_UNKNOWN: DMType -COMPUTE_RESOURCE: DMType -STORAGE_RESOURCE: DMType -SECURITY_PROTOCOL_UNKNOWN: SecurityProtocol -USERNAME_PASSWORD: SecurityProtocol -SSH_KEYS: SecurityProtocol -GSI: SecurityProtocol -KERBEROS: SecurityProtocol -OAUTH: SecurityProtocol -LOCAL: SecurityProtocol -DATA_MOVEMENT_PROTOCOL_UNKNOWN: DataMovementProtocol -DATA_MOVEMENT_PROTOCOL_LOCAL: DataMovementProtocol -SCP: DataMovementProtocol -SFTP: DataMovementProtocol -GRID_FTP: DataMovementProtocol -UNICORE_STORAGE_SERVICE: DataMovementProtocol - -class SCPDataMovement(_message.Message): - __slots__ = ("data_movement_interface_id", "security_protocol", "alternative_scp_host_name", "ssh_port") - DATA_MOVEMENT_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] - SECURITY_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - ALTERNATIVE_SCP_HOST_NAME_FIELD_NUMBER: _ClassVar[int] - SSH_PORT_FIELD_NUMBER: _ClassVar[int] - data_movement_interface_id: str - security_protocol: SecurityProtocol - alternative_scp_host_name: str - ssh_port: int - def __init__(self, data_movement_interface_id: _Optional[str] = ..., security_protocol: _Optional[_Union[SecurityProtocol, str]] = ..., alternative_scp_host_name: _Optional[str] = ..., ssh_port: _Optional[int] = ...) -> None: ... - -class GridFTPDataMovement(_message.Message): - __slots__ = ("data_movement_interface_id", "security_protocol", "grid_ftp_end_points") - DATA_MOVEMENT_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] - SECURITY_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - GRID_FTP_END_POINTS_FIELD_NUMBER: _ClassVar[int] - data_movement_interface_id: str - security_protocol: SecurityProtocol - grid_ftp_end_points: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, data_movement_interface_id: _Optional[str] = ..., security_protocol: _Optional[_Union[SecurityProtocol, str]] = ..., grid_ftp_end_points: _Optional[_Iterable[str]] = ...) -> None: ... - -class UnicoreDataMovement(_message.Message): - __slots__ = ("data_movement_interface_id", "security_protocol", "unicore_end_point_url") - DATA_MOVEMENT_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] - SECURITY_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - UNICORE_END_POINT_URL_FIELD_NUMBER: _ClassVar[int] - data_movement_interface_id: str - security_protocol: SecurityProtocol - unicore_end_point_url: str - def __init__(self, data_movement_interface_id: _Optional[str] = ..., security_protocol: _Optional[_Union[SecurityProtocol, str]] = ..., unicore_end_point_url: _Optional[str] = ...) -> None: ... - -class LOCALDataMovement(_message.Message): - __slots__ = ("data_movement_interface_id",) - DATA_MOVEMENT_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] - data_movement_interface_id: str - def __init__(self, data_movement_interface_id: _Optional[str] = ...) -> None: ... - -class DataMovementInterface(_message.Message): - __slots__ = ("data_movement_interface_id", "data_movement_protocol", "priority_order", "creation_time", "update_time", "storage_resource_id") - DATA_MOVEMENT_INTERFACE_ID_FIELD_NUMBER: _ClassVar[int] - DATA_MOVEMENT_PROTOCOL_FIELD_NUMBER: _ClassVar[int] - PRIORITY_ORDER_FIELD_NUMBER: _ClassVar[int] - CREATION_TIME_FIELD_NUMBER: _ClassVar[int] - UPDATE_TIME_FIELD_NUMBER: _ClassVar[int] - STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - data_movement_interface_id: str - data_movement_protocol: DataMovementProtocol - priority_order: int - creation_time: int - update_time: int - storage_resource_id: str - def __init__(self, data_movement_interface_id: _Optional[str] = ..., data_movement_protocol: _Optional[_Union[DataMovementProtocol, str]] = ..., priority_order: _Optional[int] = ..., creation_time: _Optional[int] = ..., update_time: _Optional[int] = ..., storage_resource_id: _Optional[str] = ...) -> None: ... diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/sharing/sharing_pb2.py b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/sharing/sharing_pb2.py deleted file mode 100644 index fc5aa6ae1f1..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/sharing/sharing_pb2.py +++ /dev/null @@ -1,67 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: org/apache/airavata/model/sharing/sharing.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'org/apache/airavata/model/sharing/sharing.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/org/apache/airavata/model/sharing/sharing.proto\x12+org.apache.airavata.sharing.registry.models\"\x89\x01\n\x06\x44omain\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x14\n\x0c\x63reated_time\x18\x04 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x05 \x01(\x03\x12\x1d\n\x15initial_user_group_id\x18\x06 \x01(\t\"\xad\x01\n\x04User\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x11\n\tuser_name\x18\x03 \x01(\t\x12\x12\n\nfirst_name\x18\x04 \x01(\t\x12\x11\n\tlast_name\x18\x05 \x01(\t\x12\r\n\x05\x65mail\x18\x06 \x01(\t\x12\x0c\n\x04icon\x18\x07 \x01(\x0c\x12\x14\n\x0c\x63reated_time\x18\x08 \x01(\x03\x12\x14\n\x0cupdated_time\x18\t \x01(\x03\"C\n\nGroupAdmin\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x10\n\x08\x61\x64min_id\x18\x03 \x01(\t\"\x86\x03\n\tUserGroup\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x10\n\x08owner_id\x18\x05 \x01(\t\x12J\n\ngroup_type\x18\x06 \x01(\x0e\x32\x36.org.apache.airavata.sharing.registry.models.GroupType\x12X\n\x11group_cardinality\x18\x07 \x01(\x0e\x32=.org.apache.airavata.sharing.registry.models.GroupCardinality\x12\x14\n\x0c\x63reated_time\x18\x08 \x01(\x03\x12\x14\n\x0cupdated_time\x18\t \x01(\x03\x12M\n\x0cgroup_admins\x18\n \x03(\x0b\x32\x37.org.apache.airavata.sharing.registry.models.GroupAdmin\"\xc6\x01\n\x0fGroupMembership\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x10\n\x08\x63hild_id\x18\x02 \x01(\t\x12\x11\n\tdomain_id\x18\x03 \x01(\t\x12O\n\nchild_type\x18\x04 \x01(\x0e\x32;.org.apache.airavata.sharing.registry.models.GroupChildType\x12\x14\n\x0c\x63reated_time\x18\x05 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x06 \x01(\x03\"\x86\x01\n\nEntityType\x12\x16\n\x0e\x65ntity_type_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x14\n\x0c\x63reated_time\x18\x05 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x06 \x01(\x03\"\xcd\x01\n\x0eSearchCriteria\x12T\n\x0csearch_field\x18\x01 \x01(\x0e\x32>.org.apache.airavata.sharing.registry.models.EntitySearchField\x12\r\n\x05value\x18\x02 \x01(\t\x12V\n\x10search_condition\x18\x03 \x01(\x0e\x32<.org.apache.airavata.sharing.registry.models.SearchCondition\"\xa6\x02\n\x06\x45ntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x16\n\x0e\x65ntity_type_id\x18\x03 \x01(\t\x12\x10\n\x08owner_id\x18\x04 \x01(\t\x12\x18\n\x10parent_entity_id\x18\x05 \x01(\t\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x13\n\x0b\x62inary_data\x18\x08 \x01(\x0c\x12\x11\n\tfull_text\x18\t \x01(\t\x12\x14\n\x0cshared_count\x18\n \x01(\x03\x12%\n\x1doriginal_entity_creation_time\x18\x0b \x01(\x03\x12\x14\n\x0c\x63reated_time\x18\x0c \x01(\x03\x12\x14\n\x0cupdated_time\x18\r \x01(\x03\"\x8e\x01\n\x0ePermissionType\x12\x1a\n\x12permission_type_id\x18\x01 \x01(\t\x12\x11\n\tdomain_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x14\n\x0c\x63reated_time\x18\x05 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x06 \x01(\x03\"\xf6\x01\n\x07Sharing\x12\x1a\n\x12permission_type_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x10\n\x08group_id\x18\x03 \x01(\t\x12N\n\x0csharing_type\x18\x04 \x01(\x0e\x32\x38.org.apache.airavata.sharing.registry.models.SharingType\x12\x11\n\tdomain_id\x18\x05 \x01(\t\x12\x1b\n\x13inherited_parent_id\x18\x06 \x01(\t\x12\x14\n\x0c\x63reated_time\x18\x07 \x01(\x03\x12\x14\n\x0cupdated_time\x18\x08 \x01(\x03*R\n\x10GroupCardinality\x12\x1d\n\x19GROUP_CARDINALITY_UNKNOWN\x10\x00\x12\x0f\n\x0bSINGLE_USER\x10\x01\x12\x0e\n\nMULTI_USER\x10\x02*Q\n\tGroupType\x12\x16\n\x12GROUP_TYPE_UNKNOWN\x10\x00\x12\x16\n\x12\x44OMAIN_LEVEL_GROUP\x10\x01\x12\x14\n\x10USER_LEVEL_GROUP\x10\x02*C\n\x0eGroupChildType\x12\x1c\n\x18GROUP_CHILD_TYPE_UNKNOWN\x10\x00\x12\x08\n\x04USER\x10\x01\x12\t\n\x05GROUP\x10\x02*\xe5\x01\n\x11\x45ntitySearchField\x12\x1f\n\x1b\x45NTITY_SEARCH_FIELD_UNKNOWN\x10\x00\x12\x08\n\x04NAME\x10\x01\x12\x0f\n\x0b\x44\x45SCRIPTION\x10\x02\x12\r\n\tFULL_TEXT\x10\x03\x12\x15\n\x11PARRENT_ENTITY_ID\x10\x04\x12\x0c\n\x08OWNER_ID\x10\x05\x12\x16\n\x12PERMISSION_TYPE_ID\x10\x06\x12\x10\n\x0c\x43REATED_TIME\x10\x07\x12\x10\n\x0cUPDATED_TIME\x10\x08\x12\x12\n\x0e\x45NTITY_TYPE_ID\x10\t\x12\x10\n\x0cSHARED_COUNT\x10\n*u\n\x0fSearchCondition\x12\x1c\n\x18SEARCH_CONDITION_UNKNOWN\x10\x00\x12\t\n\x05\x45QUAL\x10\x01\x12\x08\n\x04LIKE\x10\x02\x12\x14\n\x10\x46ULL_TEXT_SEARCH\x10\x03\x12\x07\n\x03GTE\x10\x04\x12\x07\n\x03LTE\x10\x05\x12\x07\n\x03NOT\x10\x06*o\n\x0bSharingType\x12\x18\n\x14SHARING_TYPE_UNKNOWN\x10\x00\x12\x18\n\x14\x44IRECT_NON_CASCADING\x10\x01\x12\x14\n\x10\x44IRECT_CASCADING\x10\x02\x12\x16\n\x12INDIRECT_CASCADING\x10\x03\x42\x35\n1org.apache.airavata.sharing.registry.models.protoP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.sharing.sharing_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n1org.apache.airavata.sharing.registry.models.protoP\001' - _globals['_GROUPCARDINALITY']._serialized_start=2111 - _globals['_GROUPCARDINALITY']._serialized_end=2193 - _globals['_GROUPTYPE']._serialized_start=2195 - _globals['_GROUPTYPE']._serialized_end=2276 - _globals['_GROUPCHILDTYPE']._serialized_start=2278 - _globals['_GROUPCHILDTYPE']._serialized_end=2345 - _globals['_ENTITYSEARCHFIELD']._serialized_start=2348 - _globals['_ENTITYSEARCHFIELD']._serialized_end=2577 - _globals['_SEARCHCONDITION']._serialized_start=2579 - _globals['_SEARCHCONDITION']._serialized_end=2696 - _globals['_SHARINGTYPE']._serialized_start=2698 - _globals['_SHARINGTYPE']._serialized_end=2809 - _globals['_DOMAIN']._serialized_start=97 - _globals['_DOMAIN']._serialized_end=234 - _globals['_USER']._serialized_start=237 - _globals['_USER']._serialized_end=410 - _globals['_GROUPADMIN']._serialized_start=412 - _globals['_GROUPADMIN']._serialized_end=479 - _globals['_USERGROUP']._serialized_start=482 - _globals['_USERGROUP']._serialized_end=872 - _globals['_GROUPMEMBERSHIP']._serialized_start=875 - _globals['_GROUPMEMBERSHIP']._serialized_end=1073 - _globals['_ENTITYTYPE']._serialized_start=1076 - _globals['_ENTITYTYPE']._serialized_end=1210 - _globals['_SEARCHCRITERIA']._serialized_start=1213 - _globals['_SEARCHCRITERIA']._serialized_end=1418 - _globals['_ENTITY']._serialized_start=1421 - _globals['_ENTITY']._serialized_end=1715 - _globals['_PERMISSIONTYPE']._serialized_start=1718 - _globals['_PERMISSIONTYPE']._serialized_end=1860 - _globals['_SHARING']._serialized_start=1863 - _globals['_SHARING']._serialized_end=2109 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/task/task_pb2.py b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/task/task_pb2.py deleted file mode 100644 index 5f822b43a19..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/task/task_pb2.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: org/apache/airavata/model/task/task.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'org/apache/airavata/model/task/task.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from org.apache.airavata.model.commons import commons_pb2 as org_dot_apache_dot_airavata_dot_model_dot_commons_dot_commons__pb2 -from org.apache.airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 -from org.apache.airavata.model.appcatalog.computeresource import compute_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2 -from org.apache.airavata.model.data.movement import data_movement_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2 -from org.apache.airavata.model.job import job_pb2 as org_dot_apache_dot_airavata_dot_model_dot_job_dot_job__pb2 -from org.apache.airavata.model.status import status_pb2 as org_dot_apache_dot_airavata_dot_model_dot_status_dot_status__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)org/apache/airavata/model/task/task.proto\x12\x1eorg.apache.airavata.model.task\x1a/org/apache/airavata/model/commons/commons.proto\x1a=org/apache/airavata/model/application/io/application_io.proto\x1aKorg/apache/airavata/model/appcatalog/computeresource/compute_resource.proto\x1a;org/apache/airavata/model/data/movement/data_movement.proto\x1a\'org/apache/airavata/model/job/job.proto\x1a-org/apache/airavata/model/status/status.proto\"\xbd\x03\n\tTaskModel\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12<\n\ttask_type\x18\x02 \x01(\x0e\x32).org.apache.airavata.model.task.TaskTypes\x12\x19\n\x11parent_process_id\x18\x03 \x01(\t\x12\x15\n\rcreation_time\x18\x04 \x01(\x03\x12\x18\n\x10last_update_time\x18\x05 \x01(\x03\x12\x43\n\rtask_statuses\x18\x06 \x03(\x0b\x32,.org.apache.airavata.model.status.TaskStatus\x12\x13\n\x0btask_detail\x18\x07 \x01(\t\x12\x16\n\x0esub_task_model\x18\x08 \x01(\x0c\x12\x42\n\x0btask_errors\x18\t \x03(\x0b\x32-.org.apache.airavata.model.commons.ErrorModel\x12\x35\n\x04jobs\x18\n \x03(\x0b\x32\'.org.apache.airavata.model.job.JobModel\x12\x11\n\tmax_retry\x18\x0b \x01(\x05\x12\x15\n\rcurrent_retry\x18\x0c \x01(\x05\"\xf5\x02\n\x14\x44\x61taStagingTaskModel\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\t\x12;\n\x04type\x18\x03 \x01(\x0e\x32-.org.apache.airavata.model.task.DataStageType\x12\x1b\n\x13transfer_start_time\x18\x04 \x01(\x03\x12\x19\n\x11transfer_end_time\x18\x05 \x01(\x03\x12\x15\n\rtransfer_rate\x18\x06 \x01(\t\x12T\n\rprocess_input\x18\x07 \x01(\x0b\x32=.org.apache.airavata.model.application.io.InputDataObjectType\x12V\n\x0eprocess_output\x18\x08 \x01(\x0b\x32>.org.apache.airavata.model.application.io.OutputDataObjectType\"z\n\x19\x45nvironmentSetupTaskModel\x12\x10\n\x08location\x18\x01 \x01(\t\x12K\n\x08protocol\x18\x02 \x01(\x0e\x32\x39.org.apache.airavata.model.data.movement.SecurityProtocol\"\xf2\x01\n\x16JobSubmissionTaskModel\x12l\n\x17job_submission_protocol\x18\x01 \x01(\x0e\x32K.org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol\x12W\n\x0cmonitor_mode\x18\x02 \x01(\x0e\x32\x41.org.apache.airavata.model.appcatalog.computeresource.MonitorMode\x12\x11\n\twall_time\x18\x03 \x01(\x05\"k\n\x10MonitorTaskModel\x12W\n\x0cmonitor_mode\x18\x01 \x01(\x0e\x32\x41.org.apache.airavata.model.appcatalog.computeresource.MonitorMode*\x8e\x01\n\tTaskTypes\x12\x16\n\x12TASK_TYPES_UNKNOWN\x10\x00\x12\r\n\tENV_SETUP\x10\x01\x12\x10\n\x0c\x44\x41TA_STAGING\x10\x02\x12\x12\n\x0eJOB_SUBMISSION\x10\x03\x12\x0f\n\x0b\x45NV_CLEANUP\x10\x04\x12\x0e\n\nMONITORING\x10\x05\x12\x13\n\x0fOUTPUT_FETCHING\x10\x06*V\n\rDataStageType\x12\x1b\n\x17\x44\x41TA_STAGE_TYPE_UNKNOWN\x10\x00\x12\t\n\x05INPUT\x10\x01\x12\t\n\x05OUPUT\x10\x02\x12\x12\n\x0e\x41RCHIVE_OUTPUT\x10\x03\x42(\n$org.apache.airavata.model.task.protoP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.model.task.task_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n$org.apache.airavata.model.task.protoP\001' - _globals['_TASKTYPES']._serialized_start=1718 - _globals['_TASKTYPES']._serialized_end=1860 - _globals['_DATASTAGETYPE']._serialized_start=1862 - _globals['_DATASTAGETYPE']._serialized_end=1948 - _globals['_TASKMODEL']._serialized_start=416 - _globals['_TASKMODEL']._serialized_end=861 - _globals['_DATASTAGINGTASKMODEL']._serialized_start=864 - _globals['_DATASTAGINGTASKMODEL']._serialized_end=1237 - _globals['_ENVIRONMENTSETUPTASKMODEL']._serialized_start=1239 - _globals['_ENVIRONMENTSETUPTASKMODEL']._serialized_end=1361 - _globals['_JOBSUBMISSIONTASKMODEL']._serialized_start=1364 - _globals['_JOBSUBMISSIONTASKMODEL']._serialized_end=1606 - _globals['_MONITORTASKMODEL']._serialized_start=1608 - _globals['_MONITORTASKMODEL']._serialized_end=1715 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/tenant/__init__.py b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/tenant/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/user/__init__.py b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/user/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workflow/__init__.py b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workflow/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workflow/data/__init__.py b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workflow/data/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workspace/__init__.py b/airavata-python-sdk/airavata_sdk/generated/org/apache/airavata/model/workspace/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/airavata-python-sdk/airavata_sdk/generated/services/__init__.py b/airavata-python-sdk/airavata_sdk/generated/services/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/airavata-python-sdk/airavata_sdk/generated/services/application_catalog_service_pb2.py b/airavata-python-sdk/airavata_sdk/generated/services/application_catalog_service_pb2.py deleted file mode 100644 index 14694a7c9c2..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/application_catalog_service_pb2.py +++ /dev/null @@ -1,177 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: services/application_catalog_service.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'services/application_catalog_service.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.appcatalog.appdeployment import app_deployment_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appdeployment_dot_app__deployment__pb2 -from org.apache.airavata.model.appcatalog.appinterface import app_interface_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_appinterface_dot_app__interface__pb2 -from org.apache.airavata.model.appcatalog.computeresource import compute_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2 -from org.apache.airavata.model.application.io import application_io_pb2 as org_dot_apache_dot_airavata_dot_model_dot_application_dot_io_dot_application__io__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*services/application_catalog_service.proto\x12\"org.apache.airavata.api.appcatalog\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1aGorg/apache/airavata/model/appcatalog/appdeployment/app_deployment.proto\x1a\x45org/apache/airavata/model/appcatalog/appinterface/app_interface.proto\x1aKorg/apache/airavata/model/appcatalog/computeresource/compute_resource.proto\x1a=org/apache/airavata/model/application/io/application_io.proto\"\x99\x01\n RegisterApplicationModuleRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x61\n\x12\x61pplication_module\x18\x02 \x01(\x0b\x32\x45.org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule\":\n!RegisterApplicationModuleResponse\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\"4\n\x1bGetApplicationModuleRequest\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\"\x9a\x01\n\x1eUpdateApplicationModuleRequest\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\x12\x61\n\x12\x61pplication_module\x18\x02 \x01(\x0b\x32\x45.org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule\"7\n\x1e\x44\x65leteApplicationModuleRequest\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\"-\n\x17GetAllAppModulesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"~\n\x18GetAllAppModulesResponse\x12\x62\n\x13\x61pplication_modules\x18\x01 \x03(\x0b\x32\x45.org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule\"4\n\x1eGetAccessibleAppModulesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\x85\x01\n\x1fGetAccessibleAppModulesResponse\x12\x62\n\x13\x61pplication_modules\x18\x01 \x03(\x0b\x32\x45.org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule\"\xb0\x01\n$RegisterApplicationDeploymentRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12t\n\x16\x61pplication_deployment\x18\x02 \x01(\x0b\x32T.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\"B\n%RegisterApplicationDeploymentResponse\x12\x19\n\x11\x61pp_deployment_id\x18\x01 \x01(\t\"<\n\x1fGetApplicationDeploymentRequest\x12\x19\n\x11\x61pp_deployment_id\x18\x01 \x01(\t\"\xb5\x01\n\"UpdateApplicationDeploymentRequest\x12\x19\n\x11\x61pp_deployment_id\x18\x01 \x01(\t\x12t\n\x16\x61pplication_deployment\x18\x02 \x01(\x0b\x32T.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\"?\n\"DeleteApplicationDeploymentRequest\x12\x19\n\x11\x61pp_deployment_id\x18\x01 \x01(\t\"9\n#GetAllApplicationDeploymentsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\x9d\x01\n$GetAllApplicationDeploymentsResponse\x12u\n\x17\x61pplication_deployments\x18\x01 \x03(\x0b\x32T.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\"@\n*GetAccessibleApplicationDeploymentsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\xa4\x01\n+GetAccessibleApplicationDeploymentsResponse\x12u\n\x17\x61pplication_deployments\x18\x01 \x03(\x0b\x32T.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\"=\n$GetAppModuleDeployedResourcesRequest\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\"E\n%GetAppModuleDeployedResourcesResponse\x12\x1c\n\x14\x63ompute_resource_ids\x18\x01 \x03(\t\"d\n(GetDeploymentsForModuleAndProfileRequest\x12\x15\n\rapp_module_id\x18\x01 \x01(\t\x12!\n\x19group_resource_profile_id\x18\x02 \x01(\t\"\xa2\x01\n)GetDeploymentsForModuleAndProfileResponse\x12u\n\x17\x61pplication_deployments\x18\x01 \x03(\x0b\x32T.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\"\xac\x01\n#RegisterApplicationInterfaceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12q\n\x15\x61pplication_interface\x18\x02 \x01(\x0b\x32R.org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription\"@\n$RegisterApplicationInterfaceResponse\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\"n\n CloneApplicationInterfaceRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\x12\x1c\n\x14new_application_name\x18\x02 \x01(\t\x12\x12\n\ngateway_id\x18\x03 \x01(\t\"=\n!CloneApplicationInterfaceResponse\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\":\n\x1eGetApplicationInterfaceRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\"\xb0\x01\n!UpdateApplicationInterfaceRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\x12q\n\x15\x61pplication_interface\x18\x02 \x01(\x0b\x32R.org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription\"=\n!DeleteApplicationInterfaceRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\"<\n&GetAllApplicationInterfaceNamesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\xfd\x01\n\'GetAllApplicationInterfaceNamesResponse\x12\x8f\x01\n\x1b\x61pplication_interface_names\x18\x01 \x03(\x0b\x32j.org.apache.airavata.api.appcatalog.GetAllApplicationInterfaceNamesResponse.ApplicationInterfaceNamesEntry\x1a@\n\x1e\x41pplicationInterfaceNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"8\n\"GetAllApplicationInterfacesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\x99\x01\n#GetAllApplicationInterfacesResponse\x12r\n\x16\x61pplication_interfaces\x18\x01 \x03(\x0b\x32R.org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription\"7\n\x1bGetApplicationInputsRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\"y\n\x1cGetApplicationInputsResponse\x12Y\n\x12\x61pplication_inputs\x18\x01 \x03(\x0b\x32=.org.apache.airavata.model.application.io.InputDataObjectType\"8\n\x1cGetApplicationOutputsRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\"|\n\x1dGetApplicationOutputsResponse\x12[\n\x13\x61pplication_outputs\x18\x01 \x03(\x0b\x32>.org.apache.airavata.model.application.io.OutputDataObjectType\"?\n#GetAvailableComputeResourcesRequest\x12\x18\n\x10\x61pp_interface_id\x18\x01 \x01(\t\"\xe8\x01\n$GetAvailableComputeResourcesResponse\x12\x82\x01\n\x16\x63ompute_resource_names\x18\x01 \x03(\x0b\x32\x62.org.apache.airavata.api.appcatalog.GetAvailableComputeResourcesResponse.ComputeResourceNamesEntry\x1a;\n\x19\x43omputeResourceNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x32\xea(\n\x19\x41pplicationCatalogService\x12\xd9\x01\n\x19RegisterApplicationModule\x12\x44.org.apache.airavata.api.appcatalog.RegisterApplicationModuleRequest\x1a\x45.org.apache.airavata.api.appcatalog.RegisterApplicationModuleResponse\"/\x82\xd3\xe4\x93\x02)\"\x13/api/v1/app-modules:\x12\x61pplication_module\x12\xcb\x01\n\x14GetApplicationModule\x12?.org.apache.airavata.api.appcatalog.GetApplicationModuleRequest\x1a\x45.org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/app-modules/{app_module_id}\x12\xb6\x01\n\x17UpdateApplicationModule\x12\x42.org.apache.airavata.api.appcatalog.UpdateApplicationModuleRequest\x1a\x16.google.protobuf.Empty\"?\x82\xd3\xe4\x93\x02\x39\x1a#/api/v1/app-modules/{app_module_id}:\x12\x61pplication_module\x12\xa2\x01\n\x17\x44\x65leteApplicationModule\x12\x42.org.apache.airavata.api.appcatalog.DeleteApplicationModuleRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%*#/api/v1/app-modules/{app_module_id}\x12\xaa\x01\n\x10GetAllAppModules\x12;.org.apache.airavata.api.appcatalog.GetAllAppModulesRequest\x1a<.org.apache.airavata.api.appcatalog.GetAllAppModulesResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/api/v1/app-modules\x12\xca\x01\n\x17GetAccessibleAppModules\x12\x42.org.apache.airavata.api.appcatalog.GetAccessibleAppModulesRequest\x1a\x43.org.apache.airavata.api.appcatalog.GetAccessibleAppModulesResponse\"&\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/app-modules:accessible\x12\xed\x01\n\x1dRegisterApplicationDeployment\x12H.org.apache.airavata.api.appcatalog.RegisterApplicationDeploymentRequest\x1aI.org.apache.airavata.api.appcatalog.RegisterApplicationDeploymentResponse\"7\x82\xd3\xe4\x93\x02\x31\"\x17/api/v1/app-deployments:\x16\x61pplication_deployment\x12\xea\x01\n\x18GetApplicationDeployment\x12\x43.org.apache.airavata.api.appcatalog.GetApplicationDeploymentRequest\x1aT.org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/app-deployments/{app_deployment_id}\x12\xca\x01\n\x1bUpdateApplicationDeployment\x12\x46.org.apache.airavata.api.appcatalog.UpdateApplicationDeploymentRequest\x1a\x16.google.protobuf.Empty\"K\x82\xd3\xe4\x93\x02\x45\x1a+/api/v1/app-deployments/{app_deployment_id}:\x16\x61pplication_deployment\x12\xb2\x01\n\x1b\x44\x65leteApplicationDeployment\x12\x46.org.apache.airavata.api.appcatalog.DeleteApplicationDeploymentRequest\x1a\x16.google.protobuf.Empty\"3\x82\xd3\xe4\x93\x02-*+/api/v1/app-deployments/{app_deployment_id}\x12\xd2\x01\n\x1cGetAllApplicationDeployments\x12G.org.apache.airavata.api.appcatalog.GetAllApplicationDeploymentsRequest\x1aH.org.apache.airavata.api.appcatalog.GetAllApplicationDeploymentsResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/api/v1/app-deployments\x12\xf2\x01\n#GetAccessibleApplicationDeployments\x12N.org.apache.airavata.api.appcatalog.GetAccessibleApplicationDeploymentsRequest\x1aO.org.apache.airavata.api.appcatalog.GetAccessibleApplicationDeploymentsResponse\"*\x82\xd3\xe4\x93\x02$\x12\"/api/v1/app-deployments:accessible\x12\xf4\x01\n\x1dGetAppModuleDeployedResources\x12H.org.apache.airavata.api.appcatalog.GetAppModuleDeployedResourcesRequest\x1aI.org.apache.airavata.api.appcatalog.GetAppModuleDeployedResourcesResponse\">\x82\xd3\xe4\x93\x02\x38\x12\x36/api/v1/app-modules/{app_module_id}/deployed-resources\x12\x9e\x02\n!GetDeploymentsForModuleAndProfile\x12L.org.apache.airavata.api.appcatalog.GetDeploymentsForModuleAndProfileRequest\x1aM.org.apache.airavata.api.appcatalog.GetDeploymentsForModuleAndProfileResponse\"\\\x82\xd3\xe4\x93\x02V\x12T/api/v1/app-modules/{app_module_id}/profiles/{group_resource_profile_id}/deployments\x12\xe8\x01\n\x1cRegisterApplicationInterface\x12G.org.apache.airavata.api.appcatalog.RegisterApplicationInterfaceRequest\x1aH.org.apache.airavata.api.appcatalog.RegisterApplicationInterfaceResponse\"5\x82\xd3\xe4\x93\x02/\"\x16/api/v1/app-interfaces:\x15\x61pplication_interface\x12\xe1\x01\n\x19\x43loneApplicationInterface\x12\x44.org.apache.airavata.api.appcatalog.CloneApplicationInterfaceRequest\x1a\x45.org.apache.airavata.api.appcatalog.CloneApplicationInterfaceResponse\"7\x82\xd3\xe4\x93\x02\x31\"//api/v1/app-interfaces/{app_interface_id}:clone\x12\xe4\x01\n\x17GetApplicationInterface\x12\x42.org.apache.airavata.api.appcatalog.GetApplicationInterfaceRequest\x1aR.org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/app-interfaces/{app_interface_id}\x12\xc5\x01\n\x1aUpdateApplicationInterface\x12\x45.org.apache.airavata.api.appcatalog.UpdateApplicationInterfaceRequest\x1a\x16.google.protobuf.Empty\"H\x82\xd3\xe4\x93\x02\x42\x1a)/api/v1/app-interfaces/{app_interface_id}:\x15\x61pplication_interface\x12\xae\x01\n\x1a\x44\x65leteApplicationInterface\x12\x45.org.apache.airavata.api.appcatalog.DeleteApplicationInterfaceRequest\x1a\x16.google.protobuf.Empty\"1\x82\xd3\xe4\x93\x02+*)/api/v1/app-interfaces/{app_interface_id}\x12\xe0\x01\n\x1fGetAllApplicationInterfaceNames\x12J.org.apache.airavata.api.appcatalog.GetAllApplicationInterfaceNamesRequest\x1aK.org.apache.airavata.api.appcatalog.GetAllApplicationInterfaceNamesResponse\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/api/v1/app-interfaces:names\x12\xce\x01\n\x1bGetAllApplicationInterfaces\x12\x46.org.apache.airavata.api.appcatalog.GetAllApplicationInterfacesRequest\x1aG.org.apache.airavata.api.appcatalog.GetAllApplicationInterfacesResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/api/v1/app-interfaces\x12\xd3\x01\n\x14GetApplicationInputs\x12?.org.apache.airavata.api.appcatalog.GetApplicationInputsRequest\x1a@.org.apache.airavata.api.appcatalog.GetApplicationInputsResponse\"8\x82\xd3\xe4\x93\x02\x32\x12\x30/api/v1/app-interfaces/{app_interface_id}/inputs\x12\xd7\x01\n\x15GetApplicationOutputs\x12@.org.apache.airavata.api.appcatalog.GetApplicationOutputsRequest\x1a\x41.org.apache.airavata.api.appcatalog.GetApplicationOutputsResponse\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/api/v1/app-interfaces/{app_interface_id}/outputs\x12\xf6\x01\n\x1cGetAvailableComputeResources\x12G.org.apache.airavata.api.appcatalog.GetAvailableComputeResourcesRequest\x1aH.org.apache.airavata.api.appcatalog.GetAvailableComputeResourcesResponse\"C\x82\xd3\xe4\x93\x02=\x12;/api/v1/app-interfaces/{app_interface_id}/compute-resourcesB&\n\"org.apache.airavata.api.appcatalogP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.application_catalog_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\"org.apache.airavata.api.appcatalogP\001' - _globals['_GETALLAPPLICATIONINTERFACENAMESRESPONSE_APPLICATIONINTERFACENAMESENTRY']._loaded_options = None - _globals['_GETALLAPPLICATIONINTERFACENAMESRESPONSE_APPLICATIONINTERFACENAMESENTRY']._serialized_options = b'8\001' - _globals['_GETAVAILABLECOMPUTERESOURCESRESPONSE_COMPUTERESOURCENAMESENTRY']._loaded_options = None - _globals['_GETAVAILABLECOMPUTERESOURCESRESPONSE_COMPUTERESOURCENAMESENTRY']._serialized_options = b'8\001' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['RegisterApplicationModule']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['RegisterApplicationModule']._serialized_options = b'\202\323\344\223\002)\"\023/api/v1/app-modules:\022application_module' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationModule']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationModule']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/app-modules/{app_module_id}' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['UpdateApplicationModule']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['UpdateApplicationModule']._serialized_options = b'\202\323\344\223\0029\032#/api/v1/app-modules/{app_module_id}:\022application_module' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['DeleteApplicationModule']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['DeleteApplicationModule']._serialized_options = b'\202\323\344\223\002%*#/api/v1/app-modules/{app_module_id}' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllAppModules']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllAppModules']._serialized_options = b'\202\323\344\223\002\025\022\023/api/v1/app-modules' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAccessibleAppModules']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAccessibleAppModules']._serialized_options = b'\202\323\344\223\002 \022\036/api/v1/app-modules:accessible' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['RegisterApplicationDeployment']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['RegisterApplicationDeployment']._serialized_options = b'\202\323\344\223\0021\"\027/api/v1/app-deployments:\026application_deployment' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationDeployment']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationDeployment']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/app-deployments/{app_deployment_id}' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['UpdateApplicationDeployment']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['UpdateApplicationDeployment']._serialized_options = b'\202\323\344\223\002E\032+/api/v1/app-deployments/{app_deployment_id}:\026application_deployment' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['DeleteApplicationDeployment']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['DeleteApplicationDeployment']._serialized_options = b'\202\323\344\223\002-*+/api/v1/app-deployments/{app_deployment_id}' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationDeployments']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationDeployments']._serialized_options = b'\202\323\344\223\002\031\022\027/api/v1/app-deployments' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAccessibleApplicationDeployments']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAccessibleApplicationDeployments']._serialized_options = b'\202\323\344\223\002$\022\"/api/v1/app-deployments:accessible' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAppModuleDeployedResources']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAppModuleDeployedResources']._serialized_options = b'\202\323\344\223\0028\0226/api/v1/app-modules/{app_module_id}/deployed-resources' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetDeploymentsForModuleAndProfile']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetDeploymentsForModuleAndProfile']._serialized_options = b'\202\323\344\223\002V\022T/api/v1/app-modules/{app_module_id}/profiles/{group_resource_profile_id}/deployments' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['RegisterApplicationInterface']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['RegisterApplicationInterface']._serialized_options = b'\202\323\344\223\002/\"\026/api/v1/app-interfaces:\025application_interface' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['CloneApplicationInterface']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['CloneApplicationInterface']._serialized_options = b'\202\323\344\223\0021\"//api/v1/app-interfaces/{app_interface_id}:clone' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationInterface']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationInterface']._serialized_options = b'\202\323\344\223\002+\022)/api/v1/app-interfaces/{app_interface_id}' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['UpdateApplicationInterface']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['UpdateApplicationInterface']._serialized_options = b'\202\323\344\223\002B\032)/api/v1/app-interfaces/{app_interface_id}:\025application_interface' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['DeleteApplicationInterface']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['DeleteApplicationInterface']._serialized_options = b'\202\323\344\223\002+*)/api/v1/app-interfaces/{app_interface_id}' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationInterfaceNames']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationInterfaceNames']._serialized_options = b'\202\323\344\223\002\036\022\034/api/v1/app-interfaces:names' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationInterfaces']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAllApplicationInterfaces']._serialized_options = b'\202\323\344\223\002\030\022\026/api/v1/app-interfaces' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationInputs']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationInputs']._serialized_options = b'\202\323\344\223\0022\0220/api/v1/app-interfaces/{app_interface_id}/inputs' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationOutputs']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetApplicationOutputs']._serialized_options = b'\202\323\344\223\0023\0221/api/v1/app-interfaces/{app_interface_id}/outputs' - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAvailableComputeResources']._loaded_options = None - _globals['_APPLICATIONCATALOGSERVICE'].methods_by_name['GetAvailableComputeResources']._serialized_options = b'\202\323\344\223\002=\022;/api/v1/app-interfaces/{app_interface_id}/compute-resources' - _globals['_REGISTERAPPLICATIONMODULEREQUEST']._serialized_start=426 - _globals['_REGISTERAPPLICATIONMODULEREQUEST']._serialized_end=579 - _globals['_REGISTERAPPLICATIONMODULERESPONSE']._serialized_start=581 - _globals['_REGISTERAPPLICATIONMODULERESPONSE']._serialized_end=639 - _globals['_GETAPPLICATIONMODULEREQUEST']._serialized_start=641 - _globals['_GETAPPLICATIONMODULEREQUEST']._serialized_end=693 - _globals['_UPDATEAPPLICATIONMODULEREQUEST']._serialized_start=696 - _globals['_UPDATEAPPLICATIONMODULEREQUEST']._serialized_end=850 - _globals['_DELETEAPPLICATIONMODULEREQUEST']._serialized_start=852 - _globals['_DELETEAPPLICATIONMODULEREQUEST']._serialized_end=907 - _globals['_GETALLAPPMODULESREQUEST']._serialized_start=909 - _globals['_GETALLAPPMODULESREQUEST']._serialized_end=954 - _globals['_GETALLAPPMODULESRESPONSE']._serialized_start=956 - _globals['_GETALLAPPMODULESRESPONSE']._serialized_end=1082 - _globals['_GETACCESSIBLEAPPMODULESREQUEST']._serialized_start=1084 - _globals['_GETACCESSIBLEAPPMODULESREQUEST']._serialized_end=1136 - _globals['_GETACCESSIBLEAPPMODULESRESPONSE']._serialized_start=1139 - _globals['_GETACCESSIBLEAPPMODULESRESPONSE']._serialized_end=1272 - _globals['_REGISTERAPPLICATIONDEPLOYMENTREQUEST']._serialized_start=1275 - _globals['_REGISTERAPPLICATIONDEPLOYMENTREQUEST']._serialized_end=1451 - _globals['_REGISTERAPPLICATIONDEPLOYMENTRESPONSE']._serialized_start=1453 - _globals['_REGISTERAPPLICATIONDEPLOYMENTRESPONSE']._serialized_end=1519 - _globals['_GETAPPLICATIONDEPLOYMENTREQUEST']._serialized_start=1521 - _globals['_GETAPPLICATIONDEPLOYMENTREQUEST']._serialized_end=1581 - _globals['_UPDATEAPPLICATIONDEPLOYMENTREQUEST']._serialized_start=1584 - _globals['_UPDATEAPPLICATIONDEPLOYMENTREQUEST']._serialized_end=1765 - _globals['_DELETEAPPLICATIONDEPLOYMENTREQUEST']._serialized_start=1767 - _globals['_DELETEAPPLICATIONDEPLOYMENTREQUEST']._serialized_end=1830 - _globals['_GETALLAPPLICATIONDEPLOYMENTSREQUEST']._serialized_start=1832 - _globals['_GETALLAPPLICATIONDEPLOYMENTSREQUEST']._serialized_end=1889 - _globals['_GETALLAPPLICATIONDEPLOYMENTSRESPONSE']._serialized_start=1892 - _globals['_GETALLAPPLICATIONDEPLOYMENTSRESPONSE']._serialized_end=2049 - _globals['_GETACCESSIBLEAPPLICATIONDEPLOYMENTSREQUEST']._serialized_start=2051 - _globals['_GETACCESSIBLEAPPLICATIONDEPLOYMENTSREQUEST']._serialized_end=2115 - _globals['_GETACCESSIBLEAPPLICATIONDEPLOYMENTSRESPONSE']._serialized_start=2118 - _globals['_GETACCESSIBLEAPPLICATIONDEPLOYMENTSRESPONSE']._serialized_end=2282 - _globals['_GETAPPMODULEDEPLOYEDRESOURCESREQUEST']._serialized_start=2284 - _globals['_GETAPPMODULEDEPLOYEDRESOURCESREQUEST']._serialized_end=2345 - _globals['_GETAPPMODULEDEPLOYEDRESOURCESRESPONSE']._serialized_start=2347 - _globals['_GETAPPMODULEDEPLOYEDRESOURCESRESPONSE']._serialized_end=2416 - _globals['_GETDEPLOYMENTSFORMODULEANDPROFILEREQUEST']._serialized_start=2418 - _globals['_GETDEPLOYMENTSFORMODULEANDPROFILEREQUEST']._serialized_end=2518 - _globals['_GETDEPLOYMENTSFORMODULEANDPROFILERESPONSE']._serialized_start=2521 - _globals['_GETDEPLOYMENTSFORMODULEANDPROFILERESPONSE']._serialized_end=2683 - _globals['_REGISTERAPPLICATIONINTERFACEREQUEST']._serialized_start=2686 - _globals['_REGISTERAPPLICATIONINTERFACEREQUEST']._serialized_end=2858 - _globals['_REGISTERAPPLICATIONINTERFACERESPONSE']._serialized_start=2860 - _globals['_REGISTERAPPLICATIONINTERFACERESPONSE']._serialized_end=2924 - _globals['_CLONEAPPLICATIONINTERFACEREQUEST']._serialized_start=2926 - _globals['_CLONEAPPLICATIONINTERFACEREQUEST']._serialized_end=3036 - _globals['_CLONEAPPLICATIONINTERFACERESPONSE']._serialized_start=3038 - _globals['_CLONEAPPLICATIONINTERFACERESPONSE']._serialized_end=3099 - _globals['_GETAPPLICATIONINTERFACEREQUEST']._serialized_start=3101 - _globals['_GETAPPLICATIONINTERFACEREQUEST']._serialized_end=3159 - _globals['_UPDATEAPPLICATIONINTERFACEREQUEST']._serialized_start=3162 - _globals['_UPDATEAPPLICATIONINTERFACEREQUEST']._serialized_end=3338 - _globals['_DELETEAPPLICATIONINTERFACEREQUEST']._serialized_start=3340 - _globals['_DELETEAPPLICATIONINTERFACEREQUEST']._serialized_end=3401 - _globals['_GETALLAPPLICATIONINTERFACENAMESREQUEST']._serialized_start=3403 - _globals['_GETALLAPPLICATIONINTERFACENAMESREQUEST']._serialized_end=3463 - _globals['_GETALLAPPLICATIONINTERFACENAMESRESPONSE']._serialized_start=3466 - _globals['_GETALLAPPLICATIONINTERFACENAMESRESPONSE']._serialized_end=3719 - _globals['_GETALLAPPLICATIONINTERFACENAMESRESPONSE_APPLICATIONINTERFACENAMESENTRY']._serialized_start=3655 - _globals['_GETALLAPPLICATIONINTERFACENAMESRESPONSE_APPLICATIONINTERFACENAMESENTRY']._serialized_end=3719 - _globals['_GETALLAPPLICATIONINTERFACESREQUEST']._serialized_start=3721 - _globals['_GETALLAPPLICATIONINTERFACESREQUEST']._serialized_end=3777 - _globals['_GETALLAPPLICATIONINTERFACESRESPONSE']._serialized_start=3780 - _globals['_GETALLAPPLICATIONINTERFACESRESPONSE']._serialized_end=3933 - _globals['_GETAPPLICATIONINPUTSREQUEST']._serialized_start=3935 - _globals['_GETAPPLICATIONINPUTSREQUEST']._serialized_end=3990 - _globals['_GETAPPLICATIONINPUTSRESPONSE']._serialized_start=3992 - _globals['_GETAPPLICATIONINPUTSRESPONSE']._serialized_end=4113 - _globals['_GETAPPLICATIONOUTPUTSREQUEST']._serialized_start=4115 - _globals['_GETAPPLICATIONOUTPUTSREQUEST']._serialized_end=4171 - _globals['_GETAPPLICATIONOUTPUTSRESPONSE']._serialized_start=4173 - _globals['_GETAPPLICATIONOUTPUTSRESPONSE']._serialized_end=4297 - _globals['_GETAVAILABLECOMPUTERESOURCESREQUEST']._serialized_start=4299 - _globals['_GETAVAILABLECOMPUTERESOURCESREQUEST']._serialized_end=4362 - _globals['_GETAVAILABLECOMPUTERESOURCESRESPONSE']._serialized_start=4365 - _globals['_GETAVAILABLECOMPUTERESOURCESRESPONSE']._serialized_end=4597 - _globals['_GETAVAILABLECOMPUTERESOURCESRESPONSE_COMPUTERESOURCENAMESENTRY']._serialized_start=4538 - _globals['_GETAVAILABLECOMPUTERESOURCESRESPONSE_COMPUTERESOURCENAMESENTRY']._serialized_end=4597 - _globals['_APPLICATIONCATALOGSERVICE']._serialized_start=4600 - _globals['_APPLICATIONCATALOGSERVICE']._serialized_end=9826 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/credential_service_pb2.py b/airavata-python-sdk/airavata_sdk/generated/services/credential_service_pb2.py deleted file mode 100644 index 54b0bb02280..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/credential_service_pb2.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: services/credential_service.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'services/credential_service.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.credential.store import credential_store_pb2 as org_dot_apache_dot_airavata_dot_model_dot_credential_dot_store_dot_credential__store__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!services/credential_service.proto\x12\"org.apache.airavata.api.credential\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x41org/apache/airavata/model/credential/store/credential_store.proto\"^\n!GenerateAndRegisterSSHKeysRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"3\n\"GenerateAndRegisterSSHKeysResponse\x12\r\n\x05token\x18\x01 \x01(\t\"\x8f\x01\n\x1cRegisterPwdCredentialRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12[\n\x13password_credential\x18\x02 \x01(\x0b\x32>.org.apache.airavata.model.credential.store.PasswordCredential\".\n\x1dRegisterPwdCredentialResponse\x12\r\n\x05token\x18\x01 \x01(\t\"C\n\x1bGetCredentialSummaryRequest\x12\x10\n\x08token_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"}\n GetAllCredentialSummariesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x45\n\x04type\x18\x02 \x01(\x0e\x32\x37.org.apache.airavata.model.credential.store.SummaryType\"\x80\x01\n!GetAllCredentialSummariesResponse\x12[\n\x14\x63redential_summaries\x18\x01 \x03(\x0b\x32=.org.apache.airavata.model.credential.store.CredentialSummary\">\n\x16\x44\x65leteSSHPubKeyRequest\x12\x10\n\x08token_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"B\n\x1a\x44\x65letePWDCredentialRequest\x12\x10\n\x08token_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"b\n\x1d\x44oesUserHaveSSHAccountRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x10\n\x08username\x18\x03 \x01(\t\"5\n\x1e\x44oesUserHaveSSHAccountResponse\x12\x13\n\x0bhas_account\x18\x01 \x01(\x08\"^\n\x19IsSSHSetupCompleteRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x10\n\x08username\x18\x03 \x01(\t\"1\n\x1aIsSSHSetupCompleteResponse\x12\x13\n\x0bis_complete\x18\x01 \x01(\x08\"[\n\x16SetupSSHAccountRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\x12\x10\n\x08username\x18\x03 \x01(\t\"*\n\x17SetupSSHAccountResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x32\x98\x0e\n\x11\x43redentialService\x12\xd4\x01\n\x1aGenerateAndRegisterSSHKeys\x12\x45.org.apache.airavata.api.credential.GenerateAndRegisterSSHKeysRequest\x1a\x46.org.apache.airavata.api.credential.GenerateAndRegisterSSHKeysResponse\"\'\x82\xd3\xe4\x93\x02!\"\x1c/api/v1/credentials/ssh-keys:\x01*\x12\xc6\x01\n\x15RegisterPwdCredential\x12@.org.apache.airavata.api.credential.RegisterPwdCredentialRequest\x1a\x41.org.apache.airavata.api.credential.RegisterPwdCredentialResponse\"(\x82\xd3\xe4\x93\x02\"\"\x1d/api/v1/credentials/passwords:\x01*\x12\xbe\x01\n\x14GetCredentialSummary\x12?.org.apache.airavata.api.credential.GetCredentialSummaryRequest\x1a=.org.apache.airavata.model.credential.store.CredentialSummary\"&\x82\xd3\xe4\x93\x02 \x12\x1e/api/v1/credentials/{token_id}\x12\xc5\x01\n\x19GetAllCredentialSummaries\x12\x44.org.apache.airavata.api.credential.GetAllCredentialSummariesRequest\x1a\x45.org.apache.airavata.api.credential.GetAllCredentialSummariesResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/api/v1/credentials\x12\x96\x01\n\x0f\x44\x65leteSSHPubKey\x12:.org.apache.airavata.api.credential.DeleteSSHPubKeyRequest\x1a\x16.google.protobuf.Empty\"/\x82\xd3\xe4\x93\x02)*\'/api/v1/credentials/ssh-keys/{token_id}\x12\x9f\x01\n\x13\x44\x65letePWDCredential\x12>.org.apache.airavata.api.credential.DeletePWDCredentialRequest\x1a\x16.google.protobuf.Empty\"0\x82\xd3\xe4\x93\x02**(/api/v1/credentials/passwords/{token_id}\x12\xe5\x01\n\x16\x44oesUserHaveSSHAccount\x12\x41.org.apache.airavata.api.credential.DoesUserHaveSSHAccountRequest\x1a\x42.org.apache.airavata.api.credential.DoesUserHaveSSHAccountResponse\"D\x82\xd3\xe4\x93\x02>\x12.org.apache.airavata.api.credential.IsSSHSetupCompleteResponse\"K\x82\xd3\xe4\x93\x02\x45\x12\x43/api/v1/credentials/ssh-accounts/{compute_resource_id}:setup-status\x12\xd3\x01\n\x0fSetupSSHAccount\x12:.org.apache.airavata.api.credential.SetupSSHAccountRequest\x1a;.org.apache.airavata.api.credential.SetupSSHAccountResponse\"G\x82\xd3\xe4\x93\x02\x41\"\022.org.apache.airavata.model.application.io.OutputDataObjectType\"S\n\x1eGetExperimentsInProjectRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x05\x12\x0e\n\x06offset\x18\x03 \x01(\x05\"m\n\x1fGetExperimentsInProjectResponse\x12J\n\x0b\x65xperiments\x18\x01 \x03(\x0b\x32\x35.org.apache.airavata.model.experiment.ExperimentModel\"a\n\x19GetUserExperimentsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x11\n\tuser_name\x18\x02 \x01(\t\x12\r\n\x05limit\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x05\"h\n\x1aGetUserExperimentsResponse\x12J\n\x0b\x65xperiments\x18\x01 \x03(\x0b\x32\x35.org.apache.airavata.model.experiment.ExperimentModel\"9\n GetDetailedExperimentTreeRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"\x96\x01\n$UpdateExperimentConfigurationRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12W\n\rconfiguration\x18\x02 \x01(\x0b\x32@.org.apache.airavata.model.experiment.UserConfigurationDataModel\"\x98\x01\n\x1fUpdateResourceSchedulingRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12^\n\nscheduling\x18\x02 \x01(\x0b\x32J.org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel\"2\n\x19ValidateExperimentRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"I\n\x1aValidateExperimentResponse\x12\x10\n\x08is_valid\x18\x01 \x01(\x08\x12\x19\n\x11validation_errors\x18\x02 \x03(\t\"D\n\x17LaunchExperimentRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"G\n\x1aTerminateExperimentRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"o\n\x16\x43loneExperimentRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\x1b\n\x13new_experiment_name\x18\x02 \x01(\t\x12!\n\x19new_experiment_project_id\x18\x03 \x01(\t\"0\n\x17\x43loneExperimentResponse\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\".\n\x15GetJobStatusesRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"\xdc\x01\n\x16GetJobStatusesResponse\x12\x61\n\x0cjob_statuses\x18\x01 \x03(\x0b\x32K.org.apache.airavata.api.experiment.GetJobStatusesResponse.JobStatusesEntry\x1a_\n\x10JobStatusesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.apache.airavata.model.status.JobStatus:\x02\x38\x01\"-\n\x14GetJobDetailsRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"N\n\x15GetJobDetailsResponse\x12\x35\n\x04jobs\x18\x01 \x03(\x0b\x32\'.org.apache.airavata.model.job.JobModel\"N\n\x1f\x46\x65tchIntermediateOutputsRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\x12\x14\n\x0coutput_names\x18\x02 \x03(\t\"B\n)GetIntermediateOutputProcessStatusRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"\xc0\x01\n\x1eGetExperimentStatisticsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x11\n\tfrom_time\x18\x02 \x01(\x03\x12\x0f\n\x07to_time\x18\x03 \x01(\x03\x12\x11\n\tuser_name\x18\x04 \x01(\t\x12\x18\n\x10\x61pplication_name\x18\x05 \x01(\t\x12\x1a\n\x12resource_host_name\x18\x06 \x01(\t\x12\r\n\x05limit\x18\x07 \x01(\x05\x12\x0e\n\x06offset\x18\x08 \x01(\x05\x32\xf9 \n\x11\x45xperimentService\x12\xb6\x01\n\x10\x43reateExperiment\x12;.org.apache.airavata.api.experiment.CreateExperimentRequest\x1a<.org.apache.airavata.api.experiment.CreateExperimentResponse\"\'\x82\xd3\xe4\x93\x02!\"\x13/api/v1/experiments:\nexperiment\x12\xad\x01\n\rGetExperiment\x12\x38.org.apache.airavata.api.experiment.GetExperimentRequest\x1a\x35.org.apache.airavata.model.experiment.ExperimentModel\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/experiments/{experiment_id}\x12\xc1\x01\n\x14GetExperimentByAdmin\x12?.org.apache.airavata.api.experiment.GetExperimentByAdminRequest\x1a\x35.org.apache.airavata.model.experiment.ExperimentModel\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/experiments/{experiment_id}:admin\x12\xa0\x01\n\x10UpdateExperiment\x12;.org.apache.airavata.api.experiment.UpdateExperimentRequest\x1a\x16.google.protobuf.Empty\"7\x82\xd3\xe4\x93\x02\x31\x1a#/api/v1/experiments/{experiment_id}:\nexperiment\x12\x94\x01\n\x10\x44\x65leteExperiment\x12;.org.apache.airavata.api.experiment.DeleteExperimentRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%*#/api/v1/experiments/{experiment_id}\x12\xad\x01\n\x11SearchExperiments\x12<.org.apache.airavata.api.experiment.SearchExperimentsRequest\x1a=.org.apache.airavata.api.experiment.SearchExperimentsResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\x12\x13/api/v1/experiments\x12\xbd\x01\n\x13GetExperimentStatus\x12>.org.apache.airavata.api.experiment.GetExperimentStatusRequest\x1a\x32.org.apache.airavata.model.status.ExperimentStatus\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/experiments/{experiment_id}/status\x12\xce\x01\n\x14GetExperimentOutputs\x12?.org.apache.airavata.api.experiment.GetExperimentOutputsRequest\x1a@.org.apache.airavata.api.experiment.GetExperimentOutputsResponse\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/experiments/{experiment_id}/outputs\x12\xd5\x01\n\x17GetExperimentsInProject\x12\x42.org.apache.airavata.api.experiment.GetExperimentsInProjectRequest\x1a\x43.org.apache.airavata.api.experiment.GetExperimentsInProjectResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/projects/{project_id}/experiments\x12\xd8\x01\n\x12GetUserExperiments\x12=.org.apache.airavata.api.experiment.GetUserExperimentsRequest\x1a>.org.apache.airavata.api.experiment.GetUserExperimentsResponse\"C\x82\xd3\xe4\x93\x02=\x12;/api/v1/gateways/{gateway_id}/users/{user_name}/experiments\x12\xce\x01\n\x19GetDetailedExperimentTree\x12\x44.org.apache.airavata.api.experiment.GetDetailedExperimentTreeRequest\x1a\x35.org.apache.airavata.model.experiment.ExperimentModel\"4\x82\xd3\xe4\x93\x02.\x12,/api/v1/experiments/{experiment_id}:detailed\x12\xcb\x01\n\x1dUpdateExperimentConfiguration\x12H.org.apache.airavata.api.experiment.UpdateExperimentConfigurationRequest\x1a\x16.google.protobuf.Empty\"H\x82\xd3\xe4\x93\x02\x42\x1a\x31/api/v1/experiments/{experiment_id}/configuration:\rconfiguration\x12\xbb\x01\n\x18UpdateResourceScheduling\x12\x43.org.apache.airavata.api.experiment.UpdateResourceSchedulingRequest\x1a\x16.google.protobuf.Empty\"B\x82\xd3\xe4\x93\x02<\x1a./api/v1/experiments/{experiment_id}/scheduling:\nscheduling\x12\xc9\x01\n\x12ValidateExperiment\x12=.org.apache.airavata.api.experiment.ValidateExperimentRequest\x1a>.org.apache.airavata.api.experiment.ValidateExperimentResponse\"4\x82\xd3\xe4\x93\x02.\",/api/v1/experiments/{experiment_id}:validate\x12\x9b\x01\n\x10LaunchExperiment\x12;.org.apache.airavata.api.experiment.LaunchExperimentRequest\x1a\x16.google.protobuf.Empty\"2\x82\xd3\xe4\x93\x02,\"*/api/v1/experiments/{experiment_id}:launch\x12\xa4\x01\n\x13TerminateExperiment\x12>.org.apache.airavata.api.experiment.TerminateExperimentRequest\x1a\x16.google.protobuf.Empty\"5\x82\xd3\xe4\x93\x02/\"-/api/v1/experiments/{experiment_id}:terminate\x12\xbd\x01\n\x0f\x43loneExperiment\x12:.org.apache.airavata.api.experiment.CloneExperimentRequest\x1a;.org.apache.airavata.api.experiment.CloneExperimentResponse\"1\x82\xd3\xe4\x93\x02+\")/api/v1/experiments/{experiment_id}:clone\x12\xc1\x01\n\x0eGetJobStatuses\x12\x39.org.apache.airavata.api.experiment.GetJobStatusesRequest\x1a:.org.apache.airavata.api.experiment.GetJobStatusesResponse\"8\x82\xd3\xe4\x93\x02\x32\x12\x30/api/v1/experiments/{experiment_id}/job-statuses\x12\xb6\x01\n\rGetJobDetails\x12\x38.org.apache.airavata.api.experiment.GetJobDetailsRequest\x1a\x39.org.apache.airavata.api.experiment.GetJobDetailsResponse\"0\x82\xd3\xe4\x93\x02*\x12(/api/v1/experiments/{experiment_id}/jobs\x12\xb2\x01\n\x18\x46\x65tchIntermediateOutputs\x12\x43.org.apache.airavata.api.experiment.FetchIntermediateOutputsRequest\x1a\x16.google.protobuf.Empty\"9\x82\xd3\xe4\x93\x02\x33\"1/api/v1/experiments/{experiment_id}:fetch-outputs\x12\xe5\x01\n\"GetIntermediateOutputProcessStatus\x12M.org.apache.airavata.api.experiment.GetIntermediateOutputProcessStatusRequest\x1a/.org.apache.airavata.model.status.ProcessStatus\"?\x82\xd3\xe4\x93\x02\x39\x12\x37/api/v1/experiments/{experiment_id}/intermediate-status\x12\xc0\x01\n\x17GetExperimentStatistics\x12\x42.org.apache.airavata.api.experiment.GetExperimentStatisticsRequest\x1a:.org.apache.airavata.model.experiment.ExperimentStatistics\"%\x82\xd3\xe4\x93\x02\x1f\x12\x1d/api/v1/experiment-statisticsB&\n\"org.apache.airavata.api.experimentP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.experiment_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\"org.apache.airavata.api.experimentP\001' - _globals['_SEARCHEXPERIMENTSREQUEST_FILTERSENTRY']._loaded_options = None - _globals['_SEARCHEXPERIMENTSREQUEST_FILTERSENTRY']._serialized_options = b'8\001' - _globals['_GETJOBSTATUSESRESPONSE_JOBSTATUSESENTRY']._loaded_options = None - _globals['_GETJOBSTATUSESRESPONSE_JOBSTATUSESENTRY']._serialized_options = b'8\001' - _globals['_EXPERIMENTSERVICE'].methods_by_name['CreateExperiment']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['CreateExperiment']._serialized_options = b'\202\323\344\223\002!\"\023/api/v1/experiments:\nexperiment' - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperiment']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperiment']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/experiments/{experiment_id}' - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentByAdmin']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentByAdmin']._serialized_options = b'\202\323\344\223\002+\022)/api/v1/experiments/{experiment_id}:admin' - _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateExperiment']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateExperiment']._serialized_options = b'\202\323\344\223\0021\032#/api/v1/experiments/{experiment_id}:\nexperiment' - _globals['_EXPERIMENTSERVICE'].methods_by_name['DeleteExperiment']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['DeleteExperiment']._serialized_options = b'\202\323\344\223\002%*#/api/v1/experiments/{experiment_id}' - _globals['_EXPERIMENTSERVICE'].methods_by_name['SearchExperiments']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['SearchExperiments']._serialized_options = b'\202\323\344\223\002\025\022\023/api/v1/experiments' - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentStatus']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentStatus']._serialized_options = b'\202\323\344\223\002,\022*/api/v1/experiments/{experiment_id}/status' - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentOutputs']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentOutputs']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/experiments/{experiment_id}/outputs' - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentsInProject']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentsInProject']._serialized_options = b'\202\323\344\223\002+\022)/api/v1/projects/{project_id}/experiments' - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetUserExperiments']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetUserExperiments']._serialized_options = b'\202\323\344\223\002=\022;/api/v1/gateways/{gateway_id}/users/{user_name}/experiments' - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetDetailedExperimentTree']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetDetailedExperimentTree']._serialized_options = b'\202\323\344\223\002.\022,/api/v1/experiments/{experiment_id}:detailed' - _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateExperimentConfiguration']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateExperimentConfiguration']._serialized_options = b'\202\323\344\223\002B\0321/api/v1/experiments/{experiment_id}/configuration:\rconfiguration' - _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateResourceScheduling']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['UpdateResourceScheduling']._serialized_options = b'\202\323\344\223\002<\032./api/v1/experiments/{experiment_id}/scheduling:\nscheduling' - _globals['_EXPERIMENTSERVICE'].methods_by_name['ValidateExperiment']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['ValidateExperiment']._serialized_options = b'\202\323\344\223\002.\",/api/v1/experiments/{experiment_id}:validate' - _globals['_EXPERIMENTSERVICE'].methods_by_name['LaunchExperiment']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['LaunchExperiment']._serialized_options = b'\202\323\344\223\002,\"*/api/v1/experiments/{experiment_id}:launch' - _globals['_EXPERIMENTSERVICE'].methods_by_name['TerminateExperiment']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['TerminateExperiment']._serialized_options = b'\202\323\344\223\002/\"-/api/v1/experiments/{experiment_id}:terminate' - _globals['_EXPERIMENTSERVICE'].methods_by_name['CloneExperiment']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['CloneExperiment']._serialized_options = b'\202\323\344\223\002+\")/api/v1/experiments/{experiment_id}:clone' - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetJobStatuses']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetJobStatuses']._serialized_options = b'\202\323\344\223\0022\0220/api/v1/experiments/{experiment_id}/job-statuses' - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetJobDetails']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetJobDetails']._serialized_options = b'\202\323\344\223\002*\022(/api/v1/experiments/{experiment_id}/jobs' - _globals['_EXPERIMENTSERVICE'].methods_by_name['FetchIntermediateOutputs']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['FetchIntermediateOutputs']._serialized_options = b'\202\323\344\223\0023\"1/api/v1/experiments/{experiment_id}:fetch-outputs' - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetIntermediateOutputProcessStatus']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetIntermediateOutputProcessStatus']._serialized_options = b'\202\323\344\223\0029\0227/api/v1/experiments/{experiment_id}/intermediate-status' - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentStatistics']._loaded_options = None - _globals['_EXPERIMENTSERVICE'].methods_by_name['GetExperimentStatistics']._serialized_options = b'\202\323\344\223\002\037\022\035/api/v1/experiment-statistics' - _globals['_CREATEEXPERIMENTREQUEST']._serialized_start=393 - _globals['_CREATEEXPERIMENTREQUEST']._serialized_end=513 - _globals['_CREATEEXPERIMENTRESPONSE']._serialized_start=515 - _globals['_CREATEEXPERIMENTRESPONSE']._serialized_end=564 - _globals['_GETEXPERIMENTREQUEST']._serialized_start=566 - _globals['_GETEXPERIMENTREQUEST']._serialized_end=611 - _globals['_GETEXPERIMENTBYADMINREQUEST']._serialized_start=613 - _globals['_GETEXPERIMENTBYADMINREQUEST']._serialized_end=665 - _globals['_UPDATEEXPERIMENTREQUEST']._serialized_start=667 - _globals['_UPDATEEXPERIMENTREQUEST']._serialized_end=790 - _globals['_DELETEEXPERIMENTREQUEST']._serialized_start=792 - _globals['_DELETEEXPERIMENTREQUEST']._serialized_end=840 - _globals['_SEARCHEXPERIMENTSREQUEST']._serialized_start=843 - _globals['_SEARCHEXPERIMENTSREQUEST']._serialized_end=1079 - _globals['_SEARCHEXPERIMENTSREQUEST_FILTERSENTRY']._serialized_start=1033 - _globals['_SEARCHEXPERIMENTSREQUEST_FILTERSENTRY']._serialized_end=1079 - _globals['_SEARCHEXPERIMENTSRESPONSE']._serialized_start=1081 - _globals['_SEARCHEXPERIMENTSRESPONSE']._serialized_end=1191 - _globals['_GETEXPERIMENTSTATUSREQUEST']._serialized_start=1193 - _globals['_GETEXPERIMENTSTATUSREQUEST']._serialized_end=1244 - _globals['_GETEXPERIMENTOUTPUTSREQUEST']._serialized_start=1246 - _globals['_GETEXPERIMENTOUTPUTSREQUEST']._serialized_end=1298 - _globals['_GETEXPERIMENTOUTPUTSRESPONSE']._serialized_start=1300 - _globals['_GETEXPERIMENTOUTPUTSRESPONSE']._serialized_end=1411 - _globals['_GETEXPERIMENTSINPROJECTREQUEST']._serialized_start=1413 - _globals['_GETEXPERIMENTSINPROJECTREQUEST']._serialized_end=1496 - _globals['_GETEXPERIMENTSINPROJECTRESPONSE']._serialized_start=1498 - _globals['_GETEXPERIMENTSINPROJECTRESPONSE']._serialized_end=1607 - _globals['_GETUSEREXPERIMENTSREQUEST']._serialized_start=1609 - _globals['_GETUSEREXPERIMENTSREQUEST']._serialized_end=1706 - _globals['_GETUSEREXPERIMENTSRESPONSE']._serialized_start=1708 - _globals['_GETUSEREXPERIMENTSRESPONSE']._serialized_end=1812 - _globals['_GETDETAILEDEXPERIMENTTREEREQUEST']._serialized_start=1814 - _globals['_GETDETAILEDEXPERIMENTTREEREQUEST']._serialized_end=1871 - _globals['_UPDATEEXPERIMENTCONFIGURATIONREQUEST']._serialized_start=1874 - _globals['_UPDATEEXPERIMENTCONFIGURATIONREQUEST']._serialized_end=2024 - _globals['_UPDATERESOURCESCHEDULINGREQUEST']._serialized_start=2027 - _globals['_UPDATERESOURCESCHEDULINGREQUEST']._serialized_end=2179 - _globals['_VALIDATEEXPERIMENTREQUEST']._serialized_start=2181 - _globals['_VALIDATEEXPERIMENTREQUEST']._serialized_end=2231 - _globals['_VALIDATEEXPERIMENTRESPONSE']._serialized_start=2233 - _globals['_VALIDATEEXPERIMENTRESPONSE']._serialized_end=2306 - _globals['_LAUNCHEXPERIMENTREQUEST']._serialized_start=2308 - _globals['_LAUNCHEXPERIMENTREQUEST']._serialized_end=2376 - _globals['_TERMINATEEXPERIMENTREQUEST']._serialized_start=2378 - _globals['_TERMINATEEXPERIMENTREQUEST']._serialized_end=2449 - _globals['_CLONEEXPERIMENTREQUEST']._serialized_start=2451 - _globals['_CLONEEXPERIMENTREQUEST']._serialized_end=2562 - _globals['_CLONEEXPERIMENTRESPONSE']._serialized_start=2564 - _globals['_CLONEEXPERIMENTRESPONSE']._serialized_end=2612 - _globals['_GETJOBSTATUSESREQUEST']._serialized_start=2614 - _globals['_GETJOBSTATUSESREQUEST']._serialized_end=2660 - _globals['_GETJOBSTATUSESRESPONSE']._serialized_start=2663 - _globals['_GETJOBSTATUSESRESPONSE']._serialized_end=2883 - _globals['_GETJOBSTATUSESRESPONSE_JOBSTATUSESENTRY']._serialized_start=2788 - _globals['_GETJOBSTATUSESRESPONSE_JOBSTATUSESENTRY']._serialized_end=2883 - _globals['_GETJOBDETAILSREQUEST']._serialized_start=2885 - _globals['_GETJOBDETAILSREQUEST']._serialized_end=2930 - _globals['_GETJOBDETAILSRESPONSE']._serialized_start=2932 - _globals['_GETJOBDETAILSRESPONSE']._serialized_end=3010 - _globals['_FETCHINTERMEDIATEOUTPUTSREQUEST']._serialized_start=3012 - _globals['_FETCHINTERMEDIATEOUTPUTSREQUEST']._serialized_end=3090 - _globals['_GETINTERMEDIATEOUTPUTPROCESSSTATUSREQUEST']._serialized_start=3092 - _globals['_GETINTERMEDIATEOUTPUTPROCESSSTATUSREQUEST']._serialized_end=3158 - _globals['_GETEXPERIMENTSTATISTICSREQUEST']._serialized_start=3161 - _globals['_GETEXPERIMENTSTATISTICSREQUEST']._serialized_end=3353 - _globals['_EXPERIMENTSERVICE']._serialized_start=3356 - _globals['_EXPERIMENTSERVICE']._serialized_end=7573 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/file_service_pb2.py b/airavata-python-sdk/airavata_sdk/generated/services/file_service_pb2.py deleted file mode 100644 index c7ad127984a..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/file_service_pb2.py +++ /dev/null @@ -1,108 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: services/file_service.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'services/file_service.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.data.replica import replica_catalog_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_replica_dot_replica__catalog__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bservices/file_service.proto\x12\x1corg.apache.airavata.api.file\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\n\x11\x46ileExistsRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\"$\n\x12\x46ileExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"=\n\x10\x44irExistsRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\"#\n\x11\x44irExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\";\n\x0eListDirRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\"\x9d\x01\n\x0fListDirResponse\x12G\n\x0b\x64irectories\x18\x01 \x03(\x0b\x32\x32.org.apache.airavata.api.file.FileMetadataResponse\x12\x41\n\x05\x66iles\x18\x02 \x03(\x0b\x32\x32.org.apache.airavata.api.file.FileMetadataResponse\">\n\x11\x44\x65leteFileRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\"=\n\x10\x44\x65leteDirRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\"]\n\x0fMoveFileRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x13\n\x0bsource_path\x18\x02 \x01(\t\x12\x18\n\x10\x64\x65stination_path\x18\x03 \x01(\t\"=\n\x10\x43reateDirRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\")\n\x11\x43reateDirResponse\x12\x14\n\x0c\x63reated_path\x18\x01 \x01(\t\"]\n\x14\x43reateSymlinkRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x13\n\x0bsource_path\x18\x02 \x01(\t\x12\x13\n\x0btarget_path\x18\x03 \x01(\t\"C\n\x16GetFileMetadataRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\"1\n\x18ListExperimentDirRequest\x12\x15\n\rexperiment_id\x18\x01 \x01(\t\"$\n\"GetDefaultStorageResourceIdRequest\"B\n#GetDefaultStorageResourceIdResponse\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t2\xbe\x10\n\x12UserStorageService\x12\x9e\x01\n\nUploadFile\x12/.org.apache.airavata.api.file.UploadFileRequest\x1a\x38.org.apache.airavata.model.data.replica.DataProductModel\"%\x82\xd3\xe4\x93\x02\x1f\"\x1a/api/v1/user-storage/files:\x01*\x12\xa2\x01\n\x0c\x44ownloadFile\x12\x31.org.apache.airavata.api.file.DownloadFileRequest\x1a\x32.org.apache.airavata.api.file.DownloadFileResponse\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/user-storage/files:download\x12\x9a\x01\n\nFileExists\x12/.org.apache.airavata.api.file.FileExistsRequest\x1a\x30.org.apache.airavata.api.file.FileExistsResponse\")\x82\xd3\xe4\x93\x02#\x12!/api/v1/user-storage/files:exists\x12\x9d\x01\n\tDirExists\x12..org.apache.airavata.api.file.DirExistsRequest\x1a/.org.apache.airavata.api.file.DirExistsResponse\"/\x82\xd3\xe4\x93\x02)\x12\'/api/v1/user-storage/directories:exists\x12\x95\x01\n\x07ListDir\x12,.org.apache.airavata.api.file.ListDirRequest\x1a-.org.apache.airavata.api.file.ListDirResponse\"-\x82\xd3\xe4\x93\x02\'\x12%/api/v1/user-storage/directories:list\x12y\n\nDeleteFile\x12/.org.apache.airavata.api.file.DeleteFileRequest\x1a\x16.google.protobuf.Empty\"\"\x82\xd3\xe4\x93\x02\x1c*\x1a/api/v1/user-storage/files\x12}\n\tDeleteDir\x12..org.apache.airavata.api.file.DeleteDirRequest\x1a\x16.google.protobuf.Empty\"(\x82\xd3\xe4\x93\x02\"* /api/v1/user-storage/directories\x12\x9f\x01\n\x08MoveFile\x12-.org.apache.airavata.api.file.MoveFileRequest\x1a\x38.org.apache.airavata.model.data.replica.DataProductModel\"*\x82\xd3\xe4\x93\x02$\"\x1f/api/v1/user-storage/files:move:\x01*\x12\x99\x01\n\tCreateDir\x12..org.apache.airavata.api.file.CreateDirRequest\x1a/.org.apache.airavata.api.file.CreateDirResponse\"+\x82\xd3\xe4\x93\x02%\" /api/v1/user-storage/directories:\x01*\x12\x85\x01\n\rCreateSymlink\x12\x32.org.apache.airavata.api.file.CreateSymlinkRequest\x1a\x16.google.protobuf.Empty\"(\x82\xd3\xe4\x93\x02\"\"\x1d/api/v1/user-storage/symlinks:\x01*\x12\xa8\x01\n\x0fGetFileMetadata\x12\x34.org.apache.airavata.api.file.GetFileMetadataRequest\x1a\x32.org.apache.airavata.api.file.FileMetadataResponse\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/user-storage/files:metadata\x12\xc5\x01\n\x11ListExperimentDir\x12\x36.org.apache.airavata.api.file.ListExperimentDirRequest\x1a-.org.apache.airavata.api.file.ListDirResponse\"I\x82\xd3\xe4\x93\x02\x43\x12\x41/api/v1/user-storage/experiments/{experiment_id}/directories:list\x12\xd9\x01\n\x1bGetDefaultStorageResourceId\x12@.org.apache.airavata.api.file.GetDefaultStorageResourceIdRequest\x1a\x41.org.apache.airavata.api.file.GetDefaultStorageResourceIdResponse\"5\x82\xd3\xe4\x93\x02/\x12-/api/v1/user-storage/default-storage-resourceB \n\x1corg.apache.airavata.api.fileP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.file_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\034org.apache.airavata.api.fileP\001' - _globals['_USERSTORAGESERVICE'].methods_by_name['UploadFile']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['UploadFile']._serialized_options = b'\202\323\344\223\002\037\"\032/api/v1/user-storage/files:\001*' - _globals['_USERSTORAGESERVICE'].methods_by_name['DownloadFile']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['DownloadFile']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/user-storage/files:download' - _globals['_USERSTORAGESERVICE'].methods_by_name['FileExists']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['FileExists']._serialized_options = b'\202\323\344\223\002#\022!/api/v1/user-storage/files:exists' - _globals['_USERSTORAGESERVICE'].methods_by_name['DirExists']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['DirExists']._serialized_options = b'\202\323\344\223\002)\022\'/api/v1/user-storage/directories:exists' - _globals['_USERSTORAGESERVICE'].methods_by_name['ListDir']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['ListDir']._serialized_options = b'\202\323\344\223\002\'\022%/api/v1/user-storage/directories:list' - _globals['_USERSTORAGESERVICE'].methods_by_name['DeleteFile']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['DeleteFile']._serialized_options = b'\202\323\344\223\002\034*\032/api/v1/user-storage/files' - _globals['_USERSTORAGESERVICE'].methods_by_name['DeleteDir']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['DeleteDir']._serialized_options = b'\202\323\344\223\002\"* /api/v1/user-storage/directories' - _globals['_USERSTORAGESERVICE'].methods_by_name['MoveFile']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['MoveFile']._serialized_options = b'\202\323\344\223\002$\"\037/api/v1/user-storage/files:move:\001*' - _globals['_USERSTORAGESERVICE'].methods_by_name['CreateDir']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['CreateDir']._serialized_options = b'\202\323\344\223\002%\" /api/v1/user-storage/directories:\001*' - _globals['_USERSTORAGESERVICE'].methods_by_name['CreateSymlink']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['CreateSymlink']._serialized_options = b'\202\323\344\223\002\"\"\035/api/v1/user-storage/symlinks:\001*' - _globals['_USERSTORAGESERVICE'].methods_by_name['GetFileMetadata']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['GetFileMetadata']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/user-storage/files:metadata' - _globals['_USERSTORAGESERVICE'].methods_by_name['ListExperimentDir']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['ListExperimentDir']._serialized_options = b'\202\323\344\223\002C\022A/api/v1/user-storage/experiments/{experiment_id}/directories:list' - _globals['_USERSTORAGESERVICE'].methods_by_name['GetDefaultStorageResourceId']._loaded_options = None - _globals['_USERSTORAGESERVICE'].methods_by_name['GetDefaultStorageResourceId']._serialized_options = b'\202\323\344\223\002/\022-/api/v1/user-storage/default-storage-resource' - _globals['_FILEUPLOADRESPONSE']._serialized_start=182 - _globals['_FILEUPLOADRESPONSE']._serialized_end=257 - _globals['_FILEMETADATARESPONSE']._serialized_start=260 - _globals['_FILEMETADATARESPONSE']._serialized_end=439 - _globals['_UPLOADFILEREQUEST']._serialized_start=441 - _globals['_UPLOADFILEREQUEST']._serialized_end=556 - _globals['_DOWNLOADFILEREQUEST']._serialized_start=558 - _globals['_DOWNLOADFILEREQUEST']._serialized_end=622 - _globals['_DOWNLOADFILERESPONSE']._serialized_start=624 - _globals['_DOWNLOADFILERESPONSE']._serialized_end=699 - _globals['_FILEEXISTSREQUEST']._serialized_start=701 - _globals['_FILEEXISTSREQUEST']._serialized_end=763 - _globals['_FILEEXISTSRESPONSE']._serialized_start=765 - _globals['_FILEEXISTSRESPONSE']._serialized_end=801 - _globals['_DIREXISTSREQUEST']._serialized_start=803 - _globals['_DIREXISTSREQUEST']._serialized_end=864 - _globals['_DIREXISTSRESPONSE']._serialized_start=866 - _globals['_DIREXISTSRESPONSE']._serialized_end=901 - _globals['_LISTDIRREQUEST']._serialized_start=903 - _globals['_LISTDIRREQUEST']._serialized_end=962 - _globals['_LISTDIRRESPONSE']._serialized_start=965 - _globals['_LISTDIRRESPONSE']._serialized_end=1122 - _globals['_DELETEFILEREQUEST']._serialized_start=1124 - _globals['_DELETEFILEREQUEST']._serialized_end=1186 - _globals['_DELETEDIRREQUEST']._serialized_start=1188 - _globals['_DELETEDIRREQUEST']._serialized_end=1249 - _globals['_MOVEFILEREQUEST']._serialized_start=1251 - _globals['_MOVEFILEREQUEST']._serialized_end=1344 - _globals['_CREATEDIRREQUEST']._serialized_start=1346 - _globals['_CREATEDIRREQUEST']._serialized_end=1407 - _globals['_CREATEDIRRESPONSE']._serialized_start=1409 - _globals['_CREATEDIRRESPONSE']._serialized_end=1450 - _globals['_CREATESYMLINKREQUEST']._serialized_start=1452 - _globals['_CREATESYMLINKREQUEST']._serialized_end=1545 - _globals['_GETFILEMETADATAREQUEST']._serialized_start=1547 - _globals['_GETFILEMETADATAREQUEST']._serialized_end=1614 - _globals['_LISTEXPERIMENTDIRREQUEST']._serialized_start=1616 - _globals['_LISTEXPERIMENTDIRREQUEST']._serialized_end=1665 - _globals['_GETDEFAULTSTORAGERESOURCEIDREQUEST']._serialized_start=1667 - _globals['_GETDEFAULTSTORAGERESOURCEIDREQUEST']._serialized_end=1703 - _globals['_GETDEFAULTSTORAGERESOURCEIDRESPONSE']._serialized_start=1705 - _globals['_GETDEFAULTSTORAGERESOURCEIDRESPONSE']._serialized_end=1771 - _globals['_USERSTORAGESERVICE']._serialized_start=1774 - _globals['_USERSTORAGESERVICE']._serialized_end=3884 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/gateway_resource_profile_service_pb2.py b/airavata-python-sdk/airavata_sdk/generated/services/gateway_resource_profile_service_pb2.py deleted file mode 100644 index b45223d19c0..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/gateway_resource_profile_service_pb2.py +++ /dev/null @@ -1,115 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: services/gateway_resource_profile_service.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'services/gateway_resource_profile_service.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.appcatalog.gatewayprofile import gateway_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_gatewayprofile_dot_gateway__profile__pb2 -from org.apache.airavata.model.appcatalog.accountprovisioning import account_provisioning_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_accountprovisioning_dot_account__provisioning__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n/services/gateway_resource_profile_service.proto\x12&org.apache.airavata.api.gatewayprofile\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1aIorg/apache/airavata/model/appcatalog/gatewayprofile/gateway_profile.proto\x1aSorg/apache/airavata/model/appcatalog/accountprovisioning/account_provisioning.proto\"\x96\x01\n%RegisterGatewayResourceProfileRequest\x12m\n\x18gateway_resource_profile\x18\x01 \x01(\x0b\x32K.org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile\"<\n&RegisterGatewayResourceProfileResponse\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"6\n GetGatewayResourceProfileRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\xa8\x01\n#UpdateGatewayResourceProfileRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12m\n\x18gateway_resource_profile\x18\x02 \x01(\x0b\x32K.org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile\"9\n#DeleteGatewayResourceProfileRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"&\n$GetAllGatewayResourceProfilesRequest\"\x97\x01\n%GetAllGatewayResourceProfilesResponse\x12n\n\x19gateway_resource_profiles\x18\x01 \x03(\x0b\x32K.org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile\"\xc3\x01\n\x1b\x41\x64\x64\x43omputePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\x12s\n\x1b\x63ompute_resource_preference\x18\x03 \x01(\x0b\x32N.org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference\"N\n\x1bGetComputePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\"\xc6\x01\n\x1eUpdateComputePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\x12s\n\x1b\x63ompute_resource_preference\x18\x03 \x01(\x0b\x32N.org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference\"Q\n\x1e\x44\x65leteComputePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\"5\n\x1fGetAllComputePreferencesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\x98\x01\n GetAllComputePreferencesResponse\x12t\n\x1c\x63ompute_resource_preferences\x18\x01 \x03(\x0b\x32N.org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference\"\xb2\x01\n\x1b\x41\x64\x64StoragePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13storage_resource_id\x18\x02 \x01(\t\x12\x62\n\x12storage_preference\x18\x03 \x01(\x0b\x32\x46.org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference\"N\n\x1bGetStoragePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13storage_resource_id\x18\x02 \x01(\t\"\xb5\x01\n\x1eUpdateStoragePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13storage_resource_id\x18\x02 \x01(\t\x12\x62\n\x12storage_preference\x18\x03 \x01(\x0b\x32\x46.org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference\"Q\n\x1e\x44\x65leteStoragePreferenceRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x1b\n\x13storage_resource_id\x18\x02 \x01(\t\"5\n\x1fGetAllStoragePreferencesRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"\x87\x01\n GetAllStoragePreferencesResponse\x12\x63\n\x13storage_preferences\x18\x01 \x03(\x0b\x32\x46.org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference\"\"\n GetSSHAccountProvisionersRequest\"\x96\x01\n!GetSSHAccountProvisionersResponse\x12q\n\x18ssh_account_provisioners\x18\x01 \x03(\x0b\x32O.org.apache.airavata.model.appcatalog.accountprovisioning.SSHAccountProvisioner2\xd7\x1c\n\x1dGatewayResourceProfileService\x12\xfb\x01\n\x1eRegisterGatewayResourceProfile\x12M.org.apache.airavata.api.gatewayprofile.RegisterGatewayResourceProfileRequest\x1aN.org.apache.airavata.api.gatewayprofile.RegisterGatewayResourceProfileResponse\":\x82\xd3\xe4\x93\x02\x34\"\x18/api/v1/gateway-profiles:\x18gateway_resource_profile\x12\xe1\x01\n\x19GetGatewayResourceProfile\x12H.org.apache.airavata.api.gatewayprofile.GetGatewayResourceProfileRequest\x1aK.org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile\"-\x82\xd3\xe4\x93\x02\'\x12%/api/v1/gateway-profiles/{gateway_id}\x12\xcc\x01\n\x1cUpdateGatewayResourceProfile\x12K.org.apache.airavata.api.gatewayprofile.UpdateGatewayResourceProfileRequest\x1a\x16.google.protobuf.Empty\"G\x82\xd3\xe4\x93\x02\x41\x1a%/api/v1/gateway-profiles/{gateway_id}:\x18gateway_resource_profile\x12\xb2\x01\n\x1c\x44\x65leteGatewayResourceProfile\x12K.org.apache.airavata.api.gatewayprofile.DeleteGatewayResourceProfileRequest\x1a\x16.google.protobuf.Empty\"-\x82\xd3\xe4\x93\x02\'*%/api/v1/gateway-profiles/{gateway_id}\x12\xde\x01\n\x1dGetAllGatewayResourceProfiles\x12L.org.apache.airavata.api.gatewayprofile.GetAllGatewayResourceProfilesRequest\x1aM.org.apache.airavata.api.gatewayprofile.GetAllGatewayResourceProfilesResponse\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/api/v1/gateway-profiles\x12\xd3\x01\n\x14\x41\x64\x64\x43omputePreference\x12\x43.org.apache.airavata.api.gatewayprofile.AddComputePreferenceRequest\x1a\x16.google.protobuf.Empty\"^\x82\xd3\xe4\x93\x02X\"9/api/v1/gateway-profiles/{gateway_id}/compute-preferences:\x1b\x63ompute_resource_preference\x12\x84\x02\n\x14GetComputePreference\x12\x43.org.apache.airavata.api.gatewayprofile.GetComputePreferenceRequest\x1aN.org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference\"W\x82\xd3\xe4\x93\x02Q\x12O/api/v1/gateway-profiles/{gateway_id}/compute-preferences/{compute_resource_id}\x12\xef\x01\n\x17UpdateComputePreference\x12\x46.org.apache.airavata.api.gatewayprofile.UpdateComputePreferenceRequest\x1a\x16.google.protobuf.Empty\"t\x82\xd3\xe4\x93\x02n\x1aO/api/v1/gateway-profiles/{gateway_id}/compute-preferences/{compute_resource_id}:\x1b\x63ompute_resource_preference\x12\xd2\x01\n\x17\x44\x65leteComputePreference\x12\x46.org.apache.airavata.api.gatewayprofile.DeleteComputePreferenceRequest\x1a\x16.google.protobuf.Empty\"W\x82\xd3\xe4\x93\x02Q*O/api/v1/gateway-profiles/{gateway_id}/compute-preferences/{compute_resource_id}\x12\xf0\x01\n\x18GetAllComputePreferences\x12G.org.apache.airavata.api.gatewayprofile.GetAllComputePreferencesRequest\x1aH.org.apache.airavata.api.gatewayprofile.GetAllComputePreferencesResponse\"A\x82\xd3\xe4\x93\x02;\x12\x39/api/v1/gateway-profiles/{gateway_id}/compute-preferences\x12\xca\x01\n\x14\x41\x64\x64StoragePreference\x12\x43.org.apache.airavata.api.gatewayprofile.AddStoragePreferenceRequest\x1a\x16.google.protobuf.Empty\"U\x82\xd3\xe4\x93\x02O\"9/api/v1/gateway-profiles/{gateway_id}/storage-preferences:\x12storage_preference\x12\xfc\x01\n\x14GetStoragePreference\x12\x43.org.apache.airavata.api.gatewayprofile.GetStoragePreferenceRequest\x1a\x46.org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference\"W\x82\xd3\xe4\x93\x02Q\x12O/api/v1/gateway-profiles/{gateway_id}/storage-preferences/{storage_resource_id}\x12\xe6\x01\n\x17UpdateStoragePreference\x12\x46.org.apache.airavata.api.gatewayprofile.UpdateStoragePreferenceRequest\x1a\x16.google.protobuf.Empty\"k\x82\xd3\xe4\x93\x02\x65\x1aO/api/v1/gateway-profiles/{gateway_id}/storage-preferences/{storage_resource_id}:\x12storage_preference\x12\xd2\x01\n\x17\x44\x65leteStoragePreference\x12\x46.org.apache.airavata.api.gatewayprofile.DeleteStoragePreferenceRequest\x1a\x16.google.protobuf.Empty\"W\x82\xd3\xe4\x93\x02Q*O/api/v1/gateway-profiles/{gateway_id}/storage-preferences/{storage_resource_id}\x12\xf0\x01\n\x18GetAllStoragePreferences\x12G.org.apache.airavata.api.gatewayprofile.GetAllStoragePreferencesRequest\x1aH.org.apache.airavata.api.gatewayprofile.GetAllStoragePreferencesResponse\"A\x82\xd3\xe4\x93\x02;\x12\x39/api/v1/gateway-profiles/{gateway_id}/storage-preferences\x12\xda\x01\n\x19GetSSHAccountProvisioners\x12H.org.apache.airavata.api.gatewayprofile.GetSSHAccountProvisionersRequest\x1aI.org.apache.airavata.api.gatewayprofile.GetSSHAccountProvisionersResponse\"(\x82\xd3\xe4\x93\x02\"\x12 /api/v1/ssh-account-provisionersB*\n&org.apache.airavata.api.gatewayprofileP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.gateway_resource_profile_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n&org.apache.airavata.api.gatewayprofileP\001' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['RegisterGatewayResourceProfile']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['RegisterGatewayResourceProfile']._serialized_options = b'\202\323\344\223\0024\"\030/api/v1/gateway-profiles:\030gateway_resource_profile' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetGatewayResourceProfile']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetGatewayResourceProfile']._serialized_options = b'\202\323\344\223\002\'\022%/api/v1/gateway-profiles/{gateway_id}' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['UpdateGatewayResourceProfile']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['UpdateGatewayResourceProfile']._serialized_options = b'\202\323\344\223\002A\032%/api/v1/gateway-profiles/{gateway_id}:\030gateway_resource_profile' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['DeleteGatewayResourceProfile']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['DeleteGatewayResourceProfile']._serialized_options = b'\202\323\344\223\002\'*%/api/v1/gateway-profiles/{gateway_id}' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetAllGatewayResourceProfiles']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetAllGatewayResourceProfiles']._serialized_options = b'\202\323\344\223\002\032\022\030/api/v1/gateway-profiles' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['AddComputePreference']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['AddComputePreference']._serialized_options = b'\202\323\344\223\002X\"9/api/v1/gateway-profiles/{gateway_id}/compute-preferences:\033compute_resource_preference' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetComputePreference']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetComputePreference']._serialized_options = b'\202\323\344\223\002Q\022O/api/v1/gateway-profiles/{gateway_id}/compute-preferences/{compute_resource_id}' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['UpdateComputePreference']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['UpdateComputePreference']._serialized_options = b'\202\323\344\223\002n\032O/api/v1/gateway-profiles/{gateway_id}/compute-preferences/{compute_resource_id}:\033compute_resource_preference' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['DeleteComputePreference']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['DeleteComputePreference']._serialized_options = b'\202\323\344\223\002Q*O/api/v1/gateway-profiles/{gateway_id}/compute-preferences/{compute_resource_id}' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetAllComputePreferences']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetAllComputePreferences']._serialized_options = b'\202\323\344\223\002;\0229/api/v1/gateway-profiles/{gateway_id}/compute-preferences' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['AddStoragePreference']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['AddStoragePreference']._serialized_options = b'\202\323\344\223\002O\"9/api/v1/gateway-profiles/{gateway_id}/storage-preferences:\022storage_preference' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetStoragePreference']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetStoragePreference']._serialized_options = b'\202\323\344\223\002Q\022O/api/v1/gateway-profiles/{gateway_id}/storage-preferences/{storage_resource_id}' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['UpdateStoragePreference']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['UpdateStoragePreference']._serialized_options = b'\202\323\344\223\002e\032O/api/v1/gateway-profiles/{gateway_id}/storage-preferences/{storage_resource_id}:\022storage_preference' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['DeleteStoragePreference']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['DeleteStoragePreference']._serialized_options = b'\202\323\344\223\002Q*O/api/v1/gateway-profiles/{gateway_id}/storage-preferences/{storage_resource_id}' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetAllStoragePreferences']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetAllStoragePreferences']._serialized_options = b'\202\323\344\223\002;\0229/api/v1/gateway-profiles/{gateway_id}/storage-preferences' - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetSSHAccountProvisioners']._loaded_options = None - _globals['_GATEWAYRESOURCEPROFILESERVICE'].methods_by_name['GetSSHAccountProvisioners']._serialized_options = b'\202\323\344\223\002\"\022 /api/v1/ssh-account-provisioners' - _globals['_REGISTERGATEWAYRESOURCEPROFILEREQUEST']._serialized_start=311 - _globals['_REGISTERGATEWAYRESOURCEPROFILEREQUEST']._serialized_end=461 - _globals['_REGISTERGATEWAYRESOURCEPROFILERESPONSE']._serialized_start=463 - _globals['_REGISTERGATEWAYRESOURCEPROFILERESPONSE']._serialized_end=523 - _globals['_GETGATEWAYRESOURCEPROFILEREQUEST']._serialized_start=525 - _globals['_GETGATEWAYRESOURCEPROFILEREQUEST']._serialized_end=579 - _globals['_UPDATEGATEWAYRESOURCEPROFILEREQUEST']._serialized_start=582 - _globals['_UPDATEGATEWAYRESOURCEPROFILEREQUEST']._serialized_end=750 - _globals['_DELETEGATEWAYRESOURCEPROFILEREQUEST']._serialized_start=752 - _globals['_DELETEGATEWAYRESOURCEPROFILEREQUEST']._serialized_end=809 - _globals['_GETALLGATEWAYRESOURCEPROFILESREQUEST']._serialized_start=811 - _globals['_GETALLGATEWAYRESOURCEPROFILESREQUEST']._serialized_end=849 - _globals['_GETALLGATEWAYRESOURCEPROFILESRESPONSE']._serialized_start=852 - _globals['_GETALLGATEWAYRESOURCEPROFILESRESPONSE']._serialized_end=1003 - _globals['_ADDCOMPUTEPREFERENCEREQUEST']._serialized_start=1006 - _globals['_ADDCOMPUTEPREFERENCEREQUEST']._serialized_end=1201 - _globals['_GETCOMPUTEPREFERENCEREQUEST']._serialized_start=1203 - _globals['_GETCOMPUTEPREFERENCEREQUEST']._serialized_end=1281 - _globals['_UPDATECOMPUTEPREFERENCEREQUEST']._serialized_start=1284 - _globals['_UPDATECOMPUTEPREFERENCEREQUEST']._serialized_end=1482 - _globals['_DELETECOMPUTEPREFERENCEREQUEST']._serialized_start=1484 - _globals['_DELETECOMPUTEPREFERENCEREQUEST']._serialized_end=1565 - _globals['_GETALLCOMPUTEPREFERENCESREQUEST']._serialized_start=1567 - _globals['_GETALLCOMPUTEPREFERENCESREQUEST']._serialized_end=1620 - _globals['_GETALLCOMPUTEPREFERENCESRESPONSE']._serialized_start=1623 - _globals['_GETALLCOMPUTEPREFERENCESRESPONSE']._serialized_end=1775 - _globals['_ADDSTORAGEPREFERENCEREQUEST']._serialized_start=1778 - _globals['_ADDSTORAGEPREFERENCEREQUEST']._serialized_end=1956 - _globals['_GETSTORAGEPREFERENCEREQUEST']._serialized_start=1958 - _globals['_GETSTORAGEPREFERENCEREQUEST']._serialized_end=2036 - _globals['_UPDATESTORAGEPREFERENCEREQUEST']._serialized_start=2039 - _globals['_UPDATESTORAGEPREFERENCEREQUEST']._serialized_end=2220 - _globals['_DELETESTORAGEPREFERENCEREQUEST']._serialized_start=2222 - _globals['_DELETESTORAGEPREFERENCEREQUEST']._serialized_end=2303 - _globals['_GETALLSTORAGEPREFERENCESREQUEST']._serialized_start=2305 - _globals['_GETALLSTORAGEPREFERENCESREQUEST']._serialized_end=2358 - _globals['_GETALLSTORAGEPREFERENCESRESPONSE']._serialized_start=2361 - _globals['_GETALLSTORAGEPREFERENCESRESPONSE']._serialized_end=2496 - _globals['_GETSSHACCOUNTPROVISIONERSREQUEST']._serialized_start=2498 - _globals['_GETSSHACCOUNTPROVISIONERSREQUEST']._serialized_end=2532 - _globals['_GETSSHACCOUNTPROVISIONERSRESPONSE']._serialized_start=2535 - _globals['_GETSSHACCOUNTPROVISIONERSRESPONSE']._serialized_end=2685 - _globals['_GATEWAYRESOURCEPROFILESERVICE']._serialized_start=2688 - _globals['_GATEWAYRESOURCEPROFILESERVICE']._serialized_end=6359 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/group_manager_service_pb2.py b/airavata-python-sdk/airavata_sdk/generated/services/group_manager_service_pb2.py deleted file mode 100644 index 98befb10741..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/group_manager_service_pb2.py +++ /dev/null @@ -1,102 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: services/group_manager_service.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'services/group_manager_service.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.group import group_manager_pb2 as org_dot_apache_dot_airavata_dot_model_dot_group_dot_group__manager__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$services/group_manager_service.proto\x12(org.apache.airavata.api.iam.groupmanager\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x33org/apache/airavata/model/group/group_manager.proto\"P\n\x12\x43reateGroupRequest\x12:\n\x05group\x18\x01 \x01(\x0b\x32+.org.apache.airavata.model.group.GroupModel\"\'\n\x13\x43reateGroupResponse\x12\x10\n\x08group_id\x18\x01 \x01(\t\"P\n\x12UpdateGroupRequest\x12:\n\x05group\x18\x01 \x01(\x0b\x32+.org.apache.airavata.model.group.GroupModel\"8\n\x12\x44\x65leteGroupRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x10\n\x08owner_id\x18\x02 \x01(\t\"#\n\x0fGetGroupRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\"\x12\n\x10GetGroupsRequest\"P\n\x11GetGroupsResponse\x12;\n\x06groups\x18\x01 \x03(\x0b\x32+.org.apache.airavata.model.group.GroupModel\"3\n\x1eGetAllGroupsUserBelongsRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\"^\n\x1fGetAllGroupsUserBelongsResponse\x12;\n\x06groups\x18\x01 \x03(\x0b\x32+.org.apache.airavata.model.group.GroupModel\"<\n\x16\x41\x64\x64UsersToGroupRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x10\n\x08user_ids\x18\x02 \x03(\t\"A\n\x1bRemoveUsersFromGroupRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x10\n\x08user_ids\x18\x02 \x03(\t\"G\n\x1dTransferGroupOwnershipRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x14\n\x0cnew_owner_id\x18\x02 \x01(\t\"<\n\x15\x41\x64\x64GroupAdminsRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x11\n\tadmin_ids\x18\x02 \x03(\t\"?\n\x18RemoveGroupAdminsRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x11\n\tadmin_ids\x18\x02 \x03(\t\";\n\x15HasAdminAccessRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x10\n\x08\x61\x64min_id\x18\x02 \x01(\t\",\n\x16HasAdminAccessResponse\x12\x12\n\nhas_access\x18\x01 \x01(\x08\";\n\x15HasOwnerAccessRequest\x12\x10\n\x08group_id\x18\x01 \x01(\t\x12\x10\n\x08owner_id\x18\x02 \x01(\t\",\n\x16HasOwnerAccessResponse\x12\x12\n\nhas_access\x18\x01 \x01(\x08\x32\xad\x11\n\x13GroupManagerService\x12\xa9\x01\n\x0b\x43reateGroup\x12<.org.apache.airavata.api.iam.groupmanager.CreateGroupRequest\x1a=.org.apache.airavata.api.iam.groupmanager.CreateGroupResponse\"\x1d\x82\xd3\xe4\x93\x02\x17\"\x0e/api/v1/groups:\x05group\x12\x8d\x01\n\x0bUpdateGroup\x12<.org.apache.airavata.api.iam.groupmanager.UpdateGroupRequest\x1a\x16.google.protobuf.Empty\"(\x82\xd3\xe4\x93\x02\"\x1a\x19/api/v1/groups/{group.id}:\x05group\x12\x86\x01\n\x0b\x44\x65leteGroup\x12<.org.apache.airavata.api.iam.groupmanager.DeleteGroupRequest\x1a\x16.google.protobuf.Empty\"!\x82\xd3\xe4\x93\x02\x1b*\x19/api/v1/groups/{group_id}\x12\x95\x01\n\x08GetGroup\x12\x39.org.apache.airavata.api.iam.groupmanager.GetGroupRequest\x1a+.org.apache.airavata.model.group.GroupModel\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/api/v1/groups/{group_id}\x12\x9c\x01\n\tGetGroups\x12:.org.apache.airavata.api.iam.groupmanager.GetGroupsRequest\x1a;.org.apache.airavata.api.iam.groupmanager.GetGroupsResponse\"\x16\x82\xd3\xe4\x93\x02\x10\x12\x0e/api/v1/groups\x12\xd7\x01\n\x17GetAllGroupsUserBelongs\x12H.org.apache.airavata.api.iam.groupmanager.GetAllGroupsUserBelongsRequest\x1aI.org.apache.airavata.api.iam.groupmanager.GetAllGroupsUserBelongsResponse\"\'\x82\xd3\xe4\x93\x02!\x12\x1f/api/v1/groups/user/{user_name}\x12\x99\x01\n\x0f\x41\x64\x64UsersToGroup\x12@.org.apache.airavata.api.iam.groupmanager.AddUsersToGroupRequest\x1a\x16.google.protobuf.Empty\",\x82\xd3\xe4\x93\x02&\"!/api/v1/groups/{group_id}/members:\x01*\x12\xa0\x01\n\x14RemoveUsersFromGroup\x12\x45.org.apache.airavata.api.iam.groupmanager.RemoveUsersFromGroupRequest\x1a\x16.google.protobuf.Empty\")\x82\xd3\xe4\x93\x02#*!/api/v1/groups/{group_id}/members\x12\xa9\x01\n\x16TransferGroupOwnership\x12G.org.apache.airavata.api.iam.groupmanager.TransferGroupOwnershipRequest\x1a\x16.google.protobuf.Empty\".\x82\xd3\xe4\x93\x02(\"#/api/v1/groups/{group_id}/ownership:\x01*\x12\x96\x01\n\x0e\x41\x64\x64GroupAdmins\x12?.org.apache.airavata.api.iam.groupmanager.AddGroupAdminsRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%\" /api/v1/groups/{group_id}/admins:\x01*\x12\x99\x01\n\x11RemoveGroupAdmins\x12\x42.org.apache.airavata.api.iam.groupmanager.RemoveGroupAdminsRequest\x1a\x16.google.protobuf.Empty\"(\x82\xd3\xe4\x93\x02\"* /api/v1/groups/{group_id}/admins\x12\xce\x01\n\x0eHasAdminAccess\x12?.org.apache.airavata.api.iam.groupmanager.HasAdminAccessRequest\x1a@.org.apache.airavata.api.iam.groupmanager.HasAdminAccessResponse\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/api/v1/groups/{group_id}/admins/{admin_id}:check\x12\xce\x01\n\x0eHasOwnerAccess\x12?.org.apache.airavata.api.iam.groupmanager.HasOwnerAccessRequest\x1a@.org.apache.airavata.api.iam.groupmanager.HasOwnerAccessResponse\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/api/v1/groups/{group_id}/owners/{owner_id}:checkB,\n(org.apache.airavata.api.iam.groupmanagerP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.group_manager_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n(org.apache.airavata.api.iam.groupmanagerP\001' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['CreateGroup']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['CreateGroup']._serialized_options = b'\202\323\344\223\002\027\"\016/api/v1/groups:\005group' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['UpdateGroup']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['UpdateGroup']._serialized_options = b'\202\323\344\223\002\"\032\031/api/v1/groups/{group.id}:\005group' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['DeleteGroup']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['DeleteGroup']._serialized_options = b'\202\323\344\223\002\033*\031/api/v1/groups/{group_id}' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetGroup']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetGroup']._serialized_options = b'\202\323\344\223\002\033\022\031/api/v1/groups/{group_id}' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetGroups']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetGroups']._serialized_options = b'\202\323\344\223\002\020\022\016/api/v1/groups' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetAllGroupsUserBelongs']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['GetAllGroupsUserBelongs']._serialized_options = b'\202\323\344\223\002!\022\037/api/v1/groups/user/{user_name}' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['AddUsersToGroup']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['AddUsersToGroup']._serialized_options = b'\202\323\344\223\002&\"!/api/v1/groups/{group_id}/members:\001*' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['RemoveUsersFromGroup']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['RemoveUsersFromGroup']._serialized_options = b'\202\323\344\223\002#*!/api/v1/groups/{group_id}/members' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['TransferGroupOwnership']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['TransferGroupOwnership']._serialized_options = b'\202\323\344\223\002(\"#/api/v1/groups/{group_id}/ownership:\001*' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['AddGroupAdmins']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['AddGroupAdmins']._serialized_options = b'\202\323\344\223\002%\" /api/v1/groups/{group_id}/admins:\001*' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['RemoveGroupAdmins']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['RemoveGroupAdmins']._serialized_options = b'\202\323\344\223\002\"* /api/v1/groups/{group_id}/admins' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['HasAdminAccess']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['HasAdminAccess']._serialized_options = b'\202\323\344\223\0023\0221/api/v1/groups/{group_id}/admins/{admin_id}:check' - _globals['_GROUPMANAGERSERVICE'].methods_by_name['HasOwnerAccess']._loaded_options = None - _globals['_GROUPMANAGERSERVICE'].methods_by_name['HasOwnerAccess']._serialized_options = b'\202\323\344\223\0023\0221/api/v1/groups/{group_id}/owners/{owner_id}:check' - _globals['_CREATEGROUPREQUEST']._serialized_start=194 - _globals['_CREATEGROUPREQUEST']._serialized_end=274 - _globals['_CREATEGROUPRESPONSE']._serialized_start=276 - _globals['_CREATEGROUPRESPONSE']._serialized_end=315 - _globals['_UPDATEGROUPREQUEST']._serialized_start=317 - _globals['_UPDATEGROUPREQUEST']._serialized_end=397 - _globals['_DELETEGROUPREQUEST']._serialized_start=399 - _globals['_DELETEGROUPREQUEST']._serialized_end=455 - _globals['_GETGROUPREQUEST']._serialized_start=457 - _globals['_GETGROUPREQUEST']._serialized_end=492 - _globals['_GETGROUPSREQUEST']._serialized_start=494 - _globals['_GETGROUPSREQUEST']._serialized_end=512 - _globals['_GETGROUPSRESPONSE']._serialized_start=514 - _globals['_GETGROUPSRESPONSE']._serialized_end=594 - _globals['_GETALLGROUPSUSERBELONGSREQUEST']._serialized_start=596 - _globals['_GETALLGROUPSUSERBELONGSREQUEST']._serialized_end=647 - _globals['_GETALLGROUPSUSERBELONGSRESPONSE']._serialized_start=649 - _globals['_GETALLGROUPSUSERBELONGSRESPONSE']._serialized_end=743 - _globals['_ADDUSERSTOGROUPREQUEST']._serialized_start=745 - _globals['_ADDUSERSTOGROUPREQUEST']._serialized_end=805 - _globals['_REMOVEUSERSFROMGROUPREQUEST']._serialized_start=807 - _globals['_REMOVEUSERSFROMGROUPREQUEST']._serialized_end=872 - _globals['_TRANSFERGROUPOWNERSHIPREQUEST']._serialized_start=874 - _globals['_TRANSFERGROUPOWNERSHIPREQUEST']._serialized_end=945 - _globals['_ADDGROUPADMINSREQUEST']._serialized_start=947 - _globals['_ADDGROUPADMINSREQUEST']._serialized_end=1007 - _globals['_REMOVEGROUPADMINSREQUEST']._serialized_start=1009 - _globals['_REMOVEGROUPADMINSREQUEST']._serialized_end=1072 - _globals['_HASADMINACCESSREQUEST']._serialized_start=1074 - _globals['_HASADMINACCESSREQUEST']._serialized_end=1133 - _globals['_HASADMINACCESSRESPONSE']._serialized_start=1135 - _globals['_HASADMINACCESSRESPONSE']._serialized_end=1179 - _globals['_HASOWNERACCESSREQUEST']._serialized_start=1181 - _globals['_HASOWNERACCESSREQUEST']._serialized_end=1240 - _globals['_HASOWNERACCESSRESPONSE']._serialized_start=1242 - _globals['_HASOWNERACCESSRESPONSE']._serialized_end=1286 - _globals['_GROUPMANAGERSERVICE']._serialized_start=1289 - _globals['_GROUPMANAGERSERVICE']._serialized_end=3510 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/group_resource_profile_service_pb2.py b/airavata-python-sdk/airavata_sdk/generated/services/group_resource_profile_service_pb2.py deleted file mode 100644 index 01a3c758833..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/group_resource_profile_service_pb2.py +++ /dev/null @@ -1,109 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: services/group_resource_profile_service.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'services/group_resource_profile_service.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.appcatalog.groupresourceprofile import group_resource_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_groupresourceprofile_dot_group__resource__profile__pb2 -from org.apache.airavata.model.appcatalog.gatewaygroups import gateway_groups_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_gatewaygroups_dot_gateway__groups__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-services/group_resource_profile_service.proto\x12$org.apache.airavata.api.groupprofile\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1aVorg/apache/airavata/model/appcatalog/groupresourceprofile/group_resource_profile.proto\x1aGorg/apache/airavata/model/appcatalog/gatewaygroups/gateway_groups.proto\"\x94\x01\n!CreateGroupResourceProfileRequest\x12o\n\x16group_resource_profile\x18\x01 \x01(\x0b\x32O.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile\"C\n\x1eGetGroupResourceProfileRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\"\xb7\x01\n!UpdateGroupResourceProfileRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\x12o\n\x16group_resource_profile\x18\x02 \x01(\x0b\x32O.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile\"F\n!RemoveGroupResourceProfileRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\"\x1d\n\x1bGetGroupResourceListRequest\"\x90\x01\n\x1cGetGroupResourceListResponse\x12p\n\x17group_resource_profiles\x18\x01 \x03(\x0b\x32O.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile\"b\n GetGroupComputePreferenceRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\"`\n\x1eRemoveGroupComputePrefsRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\x12\x1b\n\x13\x63ompute_resource_id\x18\x02 \x01(\t\"C\n\x1eGetGroupComputePrefListRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\"\xa9\x01\n\x1fGetGroupComputePrefListResponse\x12\x85\x01\n\"group_compute_resource_preferences\x18\x01 \x03(\x0b\x32Y.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupComputeResourcePreference\"B\n$GetGroupComputeResourcePolicyRequest\x12\x1a\n\x12resource_policy_id\x18\x01 \x01(\t\"E\n\'RemoveGroupComputeResourcePolicyRequest\x12\x1a\n\x12resource_policy_id\x18\x01 \x01(\t\"M\n(GetGroupComputeResourcePolicyListRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\"\xa0\x01\n)GetGroupComputeResourcePolicyListResponse\x12s\n\x19\x63ompute_resource_policies\x18\x01 \x03(\x0b\x32P.org.apache.airavata.model.appcatalog.groupresourceprofile.ComputeResourcePolicy\"@\n\"GetBatchQueueResourcePolicyRequest\x12\x1a\n\x12resource_policy_id\x18\x01 \x01(\t\"H\n*RemoveGroupBatchQueueResourcePolicyRequest\x12\x1a\n\x12resource_policy_id\x18\x01 \x01(\t\"H\n#GetGroupBatchQueuePolicyListRequest\x12!\n\x19group_resource_profile_id\x18\x01 \x01(\t\"\xa2\x01\n$GetGroupBatchQueuePolicyListResponse\x12z\n\x1d\x62\x61tch_queue_resource_policies\x18\x01 \x03(\x0b\x32S.org.apache.airavata.model.appcatalog.groupresourceprofile.BatchQueueResourcePolicy\"\x19\n\x17GetGatewayGroupsRequest2\xae\x1b\n\x1bGroupResourceProfileService\x12\xee\x01\n\x1a\x43reateGroupResourceProfile\x12G.org.apache.airavata.api.groupprofile.CreateGroupResourceProfileRequest\x1aO.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile\"6\x82\xd3\xe4\x93\x02\x30\"\x16/api/v1/group-profiles:\x16group_resource_profile\x12\xec\x01\n\x17GetGroupResourceProfile\x12\x44.org.apache.airavata.api.groupprofile.GetGroupResourceProfileRequest\x1aO.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile\":\x82\xd3\xe4\x93\x02\x34\x12\x32/api/v1/group-profiles/{group_resource_profile_id}\x12\xd1\x01\n\x1aUpdateGroupResourceProfile\x12G.org.apache.airavata.api.groupprofile.UpdateGroupResourceProfileRequest\x1a\x16.google.protobuf.Empty\"R\x82\xd3\xe4\x93\x02L\x1a\x32/api/v1/group-profiles/{group_resource_profile_id}:\x16group_resource_profile\x12\xb9\x01\n\x1aRemoveGroupResourceProfile\x12G.org.apache.airavata.api.groupprofile.RemoveGroupResourceProfileRequest\x1a\x16.google.protobuf.Empty\":\x82\xd3\xe4\x93\x02\x34*2/api/v1/group-profiles/{group_resource_profile_id}\x12\xbd\x01\n\x14GetGroupResourceList\x12\x41.org.apache.airavata.api.groupprofile.GetGroupResourceListRequest\x1a\x42.org.apache.airavata.api.groupprofile.GetGroupResourceListResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/api/v1/group-profiles\x12\xa4\x02\n\x19GetGroupComputePreference\x12\x46.org.apache.airavata.api.groupprofile.GetGroupComputePreferenceRequest\x1aY.org.apache.airavata.model.appcatalog.groupresourceprofile.GroupComputeResourcePreference\"d\x82\xd3\xe4\x93\x02^\x12\\/api/v1/group-profiles/{group_resource_profile_id}/compute-preferences/{compute_resource_id}\x12\xdd\x01\n\x17RemoveGroupComputePrefs\x12\x44.org.apache.airavata.api.groupprofile.RemoveGroupComputePrefsRequest\x1a\x16.google.protobuf.Empty\"d\x82\xd3\xe4\x93\x02^*\\/api/v1/group-profiles/{group_resource_profile_id}/compute-preferences/{compute_resource_id}\x12\xf6\x01\n\x17GetGroupComputePrefList\x12\x44.org.apache.airavata.api.groupprofile.GetGroupComputePrefListRequest\x1a\x45.org.apache.airavata.api.groupprofile.GetGroupComputePrefListResponse\"N\x82\xd3\xe4\x93\x02H\x12\x46/api/v1/group-profiles/{group_resource_profile_id}/compute-preferences\x12\xfa\x01\n\x1dGetGroupComputeResourcePolicy\x12J.org.apache.airavata.api.groupprofile.GetGroupComputeResourcePolicyRequest\x1aP.org.apache.airavata.model.appcatalog.groupresourceprofile.ComputeResourcePolicy\";\x82\xd3\xe4\x93\x02\x35\x12\x33/api/v1/group-compute-policies/{resource_policy_id}\x12\xc6\x01\n RemoveGroupComputeResourcePolicy\x12M.org.apache.airavata.api.groupprofile.RemoveGroupComputeResourcePolicyRequest\x1a\x16.google.protobuf.Empty\";\x82\xd3\xe4\x93\x02\x35*3/api/v1/group-compute-policies/{resource_policy_id}\x12\x91\x02\n!GetGroupComputeResourcePolicyList\x12N.org.apache.airavata.api.groupprofile.GetGroupComputeResourcePolicyListRequest\x1aO.org.apache.airavata.api.groupprofile.GetGroupComputeResourcePolicyListResponse\"K\x82\xd3\xe4\x93\x02\x45\x12\x43/api/v1/group-profiles/{group_resource_profile_id}/compute-policies\x12\xf7\x01\n\x1bGetBatchQueueResourcePolicy\x12H.org.apache.airavata.api.groupprofile.GetBatchQueueResourcePolicyRequest\x1aS.org.apache.airavata.model.appcatalog.groupresourceprofile.BatchQueueResourcePolicy\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/api/v1/batch-queue-policies/{resource_policy_id}\x12\xca\x01\n#RemoveGroupBatchQueueResourcePolicy\x12P.org.apache.airavata.api.groupprofile.RemoveGroupBatchQueueResourcePolicyRequest\x1a\x16.google.protobuf.Empty\"9\x82\xd3\xe4\x93\x02\x33*1/api/v1/batch-queue-policies/{resource_policy_id}\x12\x86\x02\n\x1cGetGroupBatchQueuePolicyList\x12I.org.apache.airavata.api.groupprofile.GetGroupBatchQueuePolicyListRequest\x1aJ.org.apache.airavata.api.groupprofile.GetGroupBatchQueuePolicyListResponse\"O\x82\xd3\xe4\x93\x02I\x12G/api/v1/group-profiles/{group_resource_profile_id}/batch-queue-policies\x12\xb4\x01\n\x10GetGatewayGroups\x12=.org.apache.airavata.api.groupprofile.GetGatewayGroupsRequest\x1a\x41.org.apache.airavata.model.appcatalog.gatewaygroups.GatewayGroups\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/api/v1/gateway-groupsB(\n$org.apache.airavata.api.groupprofileP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.group_resource_profile_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n$org.apache.airavata.api.groupprofileP\001' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['CreateGroupResourceProfile']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['CreateGroupResourceProfile']._serialized_options = b'\202\323\344\223\0020\"\026/api/v1/group-profiles:\026group_resource_profile' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupResourceProfile']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupResourceProfile']._serialized_options = b'\202\323\344\223\0024\0222/api/v1/group-profiles/{group_resource_profile_id}' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['UpdateGroupResourceProfile']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['UpdateGroupResourceProfile']._serialized_options = b'\202\323\344\223\002L\0322/api/v1/group-profiles/{group_resource_profile_id}:\026group_resource_profile' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupResourceProfile']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupResourceProfile']._serialized_options = b'\202\323\344\223\0024*2/api/v1/group-profiles/{group_resource_profile_id}' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupResourceList']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupResourceList']._serialized_options = b'\202\323\344\223\002\030\022\026/api/v1/group-profiles' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputePreference']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputePreference']._serialized_options = b'\202\323\344\223\002^\022\\/api/v1/group-profiles/{group_resource_profile_id}/compute-preferences/{compute_resource_id}' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupComputePrefs']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupComputePrefs']._serialized_options = b'\202\323\344\223\002^*\\/api/v1/group-profiles/{group_resource_profile_id}/compute-preferences/{compute_resource_id}' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputePrefList']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputePrefList']._serialized_options = b'\202\323\344\223\002H\022F/api/v1/group-profiles/{group_resource_profile_id}/compute-preferences' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputeResourcePolicy']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputeResourcePolicy']._serialized_options = b'\202\323\344\223\0025\0223/api/v1/group-compute-policies/{resource_policy_id}' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupComputeResourcePolicy']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupComputeResourcePolicy']._serialized_options = b'\202\323\344\223\0025*3/api/v1/group-compute-policies/{resource_policy_id}' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputeResourcePolicyList']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupComputeResourcePolicyList']._serialized_options = b'\202\323\344\223\002E\022C/api/v1/group-profiles/{group_resource_profile_id}/compute-policies' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetBatchQueueResourcePolicy']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetBatchQueueResourcePolicy']._serialized_options = b'\202\323\344\223\0023\0221/api/v1/batch-queue-policies/{resource_policy_id}' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupBatchQueueResourcePolicy']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['RemoveGroupBatchQueueResourcePolicy']._serialized_options = b'\202\323\344\223\0023*1/api/v1/batch-queue-policies/{resource_policy_id}' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupBatchQueuePolicyList']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGroupBatchQueuePolicyList']._serialized_options = b'\202\323\344\223\002I\022G/api/v1/group-profiles/{group_resource_profile_id}/batch-queue-policies' - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGatewayGroups']._loaded_options = None - _globals['_GROUPRESOURCEPROFILESERVICE'].methods_by_name['GetGatewayGroups']._serialized_options = b'\202\323\344\223\002\030\022\026/api/v1/gateway-groups' - _globals['_CREATEGROUPRESOURCEPROFILEREQUEST']._serialized_start=308 - _globals['_CREATEGROUPRESOURCEPROFILEREQUEST']._serialized_end=456 - _globals['_GETGROUPRESOURCEPROFILEREQUEST']._serialized_start=458 - _globals['_GETGROUPRESOURCEPROFILEREQUEST']._serialized_end=525 - _globals['_UPDATEGROUPRESOURCEPROFILEREQUEST']._serialized_start=528 - _globals['_UPDATEGROUPRESOURCEPROFILEREQUEST']._serialized_end=711 - _globals['_REMOVEGROUPRESOURCEPROFILEREQUEST']._serialized_start=713 - _globals['_REMOVEGROUPRESOURCEPROFILEREQUEST']._serialized_end=783 - _globals['_GETGROUPRESOURCELISTREQUEST']._serialized_start=785 - _globals['_GETGROUPRESOURCELISTREQUEST']._serialized_end=814 - _globals['_GETGROUPRESOURCELISTRESPONSE']._serialized_start=817 - _globals['_GETGROUPRESOURCELISTRESPONSE']._serialized_end=961 - _globals['_GETGROUPCOMPUTEPREFERENCEREQUEST']._serialized_start=963 - _globals['_GETGROUPCOMPUTEPREFERENCEREQUEST']._serialized_end=1061 - _globals['_REMOVEGROUPCOMPUTEPREFSREQUEST']._serialized_start=1063 - _globals['_REMOVEGROUPCOMPUTEPREFSREQUEST']._serialized_end=1159 - _globals['_GETGROUPCOMPUTEPREFLISTREQUEST']._serialized_start=1161 - _globals['_GETGROUPCOMPUTEPREFLISTREQUEST']._serialized_end=1228 - _globals['_GETGROUPCOMPUTEPREFLISTRESPONSE']._serialized_start=1231 - _globals['_GETGROUPCOMPUTEPREFLISTRESPONSE']._serialized_end=1400 - _globals['_GETGROUPCOMPUTERESOURCEPOLICYREQUEST']._serialized_start=1402 - _globals['_GETGROUPCOMPUTERESOURCEPOLICYREQUEST']._serialized_end=1468 - _globals['_REMOVEGROUPCOMPUTERESOURCEPOLICYREQUEST']._serialized_start=1470 - _globals['_REMOVEGROUPCOMPUTERESOURCEPOLICYREQUEST']._serialized_end=1539 - _globals['_GETGROUPCOMPUTERESOURCEPOLICYLISTREQUEST']._serialized_start=1541 - _globals['_GETGROUPCOMPUTERESOURCEPOLICYLISTREQUEST']._serialized_end=1618 - _globals['_GETGROUPCOMPUTERESOURCEPOLICYLISTRESPONSE']._serialized_start=1621 - _globals['_GETGROUPCOMPUTERESOURCEPOLICYLISTRESPONSE']._serialized_end=1781 - _globals['_GETBATCHQUEUERESOURCEPOLICYREQUEST']._serialized_start=1783 - _globals['_GETBATCHQUEUERESOURCEPOLICYREQUEST']._serialized_end=1847 - _globals['_REMOVEGROUPBATCHQUEUERESOURCEPOLICYREQUEST']._serialized_start=1849 - _globals['_REMOVEGROUPBATCHQUEUERESOURCEPOLICYREQUEST']._serialized_end=1921 - _globals['_GETGROUPBATCHQUEUEPOLICYLISTREQUEST']._serialized_start=1923 - _globals['_GETGROUPBATCHQUEUEPOLICYLISTREQUEST']._serialized_end=1995 - _globals['_GETGROUPBATCHQUEUEPOLICYLISTRESPONSE']._serialized_start=1998 - _globals['_GETGROUPBATCHQUEUEPOLICYLISTRESPONSE']._serialized_end=2160 - _globals['_GETGATEWAYGROUPSREQUEST']._serialized_start=2162 - _globals['_GETGATEWAYGROUPSREQUEST']._serialized_end=2187 - _globals['_GROUPRESOURCEPROFILESERVICE']._serialized_start=2190 - _globals['_GROUPRESOURCEPROFILESERVICE']._serialized_end=5692 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/notification_service_pb2.py b/airavata-python-sdk/airavata_sdk/generated/services/notification_service_pb2.py deleted file mode 100644 index 2821cbb9d00..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/notification_service_pb2.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: services/notification_service.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'services/notification_service.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#services/notification_service.proto\x12$org.apache.airavata.api.notification\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x33org/apache/airavata/model/workspace/workspace.proto\"x\n\x19\x43reateNotificationRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12G\n\x0cnotification\x18\x02 \x01(\x0b\x32\x31.org.apache.airavata.model.workspace.Notification\"5\n\x1a\x43reateNotificationResponse\x12\x17\n\x0fnotification_id\x18\x01 \x01(\t\"}\n\x19UpdateNotificationRequest\x12\x17\n\x0fnotification_id\x18\x01 \x01(\t\x12G\n\x0cnotification\x18\x02 \x01(\x0b\x32\x31.org.apache.airavata.model.workspace.Notification\"H\n\x19\x44\x65leteNotificationRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x17\n\x0fnotification_id\x18\x02 \x01(\t\"E\n\x16GetNotificationRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x17\n\x0fnotification_id\x18\x02 \x01(\t\"0\n\x1aGetAllNotificationsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\"g\n\x1bGetAllNotificationsResponse\x12H\n\rnotifications\x18\x01 \x03(\x0b\x32\x31.org.apache.airavata.model.workspace.Notification2\xe0\x07\n\x13NotificationService\x12\xc4\x01\n\x12\x43reateNotification\x12?.org.apache.airavata.api.notification.CreateNotificationRequest\x1a@.org.apache.airavata.api.notification.CreateNotificationResponse\"+\x82\xd3\xe4\x93\x02%\"\x15/api/v1/notifications:\x0cnotification\x12\xac\x01\n\x12UpdateNotification\x12?.org.apache.airavata.api.notification.UpdateNotificationRequest\x1a\x16.google.protobuf.Empty\"=\x82\xd3\xe4\x93\x02\x37\x1a\'/api/v1/notifications/{notification_id}:\x0cnotification\x12\xb4\x01\n\x12\x44\x65leteNotification\x12?.org.apache.airavata.api.notification.DeleteNotificationRequest\x1a\x16.google.protobuf.Empty\"E\x82\xd3\xe4\x93\x02?*=/api/v1/gateways/{gateway_id}/notifications/{notification_id}\x12\xc9\x01\n\x0fGetNotification\x12<.org.apache.airavata.api.notification.GetNotificationRequest\x1a\x31.org.apache.airavata.model.workspace.Notification\"E\x82\xd3\xe4\x93\x02?\x12=/api/v1/gateways/{gateway_id}/notifications/{notification_id}\x12\xcf\x01\n\x13GetAllNotifications\x12@.org.apache.airavata.api.notification.GetAllNotificationsRequest\x1a\x41.org.apache.airavata.api.notification.GetAllNotificationsResponse\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/gateways/{gateway_id}/notificationsB(\n$org.apache.airavata.api.notificationP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.notification_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n$org.apache.airavata.api.notificationP\001' - _globals['_NOTIFICATIONSERVICE'].methods_by_name['CreateNotification']._loaded_options = None - _globals['_NOTIFICATIONSERVICE'].methods_by_name['CreateNotification']._serialized_options = b'\202\323\344\223\002%\"\025/api/v1/notifications:\014notification' - _globals['_NOTIFICATIONSERVICE'].methods_by_name['UpdateNotification']._loaded_options = None - _globals['_NOTIFICATIONSERVICE'].methods_by_name['UpdateNotification']._serialized_options = b'\202\323\344\223\0027\032\'/api/v1/notifications/{notification_id}:\014notification' - _globals['_NOTIFICATIONSERVICE'].methods_by_name['DeleteNotification']._loaded_options = None - _globals['_NOTIFICATIONSERVICE'].methods_by_name['DeleteNotification']._serialized_options = b'\202\323\344\223\002?*=/api/v1/gateways/{gateway_id}/notifications/{notification_id}' - _globals['_NOTIFICATIONSERVICE'].methods_by_name['GetNotification']._loaded_options = None - _globals['_NOTIFICATIONSERVICE'].methods_by_name['GetNotification']._serialized_options = b'\202\323\344\223\002?\022=/api/v1/gateways/{gateway_id}/notifications/{notification_id}' - _globals['_NOTIFICATIONSERVICE'].methods_by_name['GetAllNotifications']._loaded_options = None - _globals['_NOTIFICATIONSERVICE'].methods_by_name['GetAllNotifications']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/gateways/{gateway_id}/notifications' - _globals['_CREATENOTIFICATIONREQUEST']._serialized_start=189 - _globals['_CREATENOTIFICATIONREQUEST']._serialized_end=309 - _globals['_CREATENOTIFICATIONRESPONSE']._serialized_start=311 - _globals['_CREATENOTIFICATIONRESPONSE']._serialized_end=364 - _globals['_UPDATENOTIFICATIONREQUEST']._serialized_start=366 - _globals['_UPDATENOTIFICATIONREQUEST']._serialized_end=491 - _globals['_DELETENOTIFICATIONREQUEST']._serialized_start=493 - _globals['_DELETENOTIFICATIONREQUEST']._serialized_end=565 - _globals['_GETNOTIFICATIONREQUEST']._serialized_start=567 - _globals['_GETNOTIFICATIONREQUEST']._serialized_end=636 - _globals['_GETALLNOTIFICATIONSREQUEST']._serialized_start=638 - _globals['_GETALLNOTIFICATIONSREQUEST']._serialized_end=686 - _globals['_GETALLNOTIFICATIONSRESPONSE']._serialized_start=688 - _globals['_GETALLNOTIFICATIONSRESPONSE']._serialized_end=791 - _globals['_NOTIFICATIONSERVICE']._serialized_start=794 - _globals['_NOTIFICATIONSERVICE']._serialized_end=1786 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/project_service_pb2.py b/airavata-python-sdk/airavata_sdk/generated/services/project_service_pb2.py deleted file mode 100644 index 6f4ac327d14..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/project_service_pb2.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: services/project_service.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'services/project_service.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.workspace import workspace_pb2 as org_dot_apache_dot_airavata_dot_model_dot_workspace_dot_workspace__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1eservices/project_service.proto\x12\x1forg.apache.airavata.api.project\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x33org/apache/airavata/model/workspace/workspace.proto\"i\n\x14\x43reateProjectRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12=\n\x07project\x18\x02 \x01(\x0b\x32,.org.apache.airavata.model.workspace.Project\"+\n\x15\x43reateProjectResponse\x12\x12\n\nproject_id\x18\x01 \x01(\t\"\'\n\x11GetProjectRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\"i\n\x14UpdateProjectRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12=\n\x07project\x18\x02 \x01(\x0b\x32,.org.apache.airavata.model.workspace.Project\"*\n\x14\x44\x65leteProjectRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\"^\n\x16GetUserProjectsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x11\n\tuser_name\x18\x02 \x01(\t\x12\r\n\x05limit\x18\x03 \x01(\x05\x12\x0e\n\x06offset\x18\x04 \x01(\x05\"Y\n\x17GetUserProjectsResponse\x12>\n\x08projects\x18\x01 \x03(\x0b\x32,.org.apache.airavata.model.workspace.Project\"\xe3\x01\n\x15SearchProjectsRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x11\n\tuser_name\x18\x02 \x01(\t\x12T\n\x07\x66ilters\x18\x03 \x03(\x0b\x32\x43.org.apache.airavata.api.project.SearchProjectsRequest.FiltersEntry\x12\r\n\x05limit\x18\x04 \x01(\x05\x12\x0e\n\x06offset\x18\x05 \x01(\x05\x1a.\n\x0c\x46iltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"X\n\x16SearchProjectsResponse\x12>\n\x08projects\x18\x01 \x03(\x0b\x32,.org.apache.airavata.model.workspace.Project2\xcc\x07\n\x0eProjectService\x12\xa1\x01\n\rCreateProject\x12\x35.org.apache.airavata.api.project.CreateProjectRequest\x1a\x36.org.apache.airavata.api.project.CreateProjectResponse\"!\x82\xd3\xe4\x93\x02\x1b\"\x10/api/v1/projects:\x07project\x12\x95\x01\n\nGetProject\x12\x32.org.apache.airavata.api.project.GetProjectRequest\x1a,.org.apache.airavata.model.workspace.Project\"%\x82\xd3\xe4\x93\x02\x1f\x12\x1d/api/v1/projects/{project_id}\x12\x8e\x01\n\rUpdateProject\x12\x35.org.apache.airavata.api.project.UpdateProjectRequest\x1a\x16.google.protobuf.Empty\".\x82\xd3\xe4\x93\x02(\x1a\x1d/api/v1/projects/{project_id}:\x07project\x12\x85\x01\n\rDeleteProject\x12\x35.org.apache.airavata.api.project.DeleteProjectRequest\x1a\x16.google.protobuf.Empty\"%\x82\xd3\xe4\x93\x02\x1f*\x1d/api/v1/projects/{project_id}\x12\xc6\x01\n\x0fGetUserProjects\x12\x37.org.apache.airavata.api.project.GetUserProjectsRequest\x1a\x38.org.apache.airavata.api.project.GetUserProjectsResponse\"@\x82\xd3\xe4\x93\x02:\x12\x38/api/v1/gateways/{gateway_id}/users/{user_name}/projects\x12\x9b\x01\n\x0eSearchProjects\x12\x36.org.apache.airavata.api.project.SearchProjectsRequest\x1a\x37.org.apache.airavata.api.project.SearchProjectsResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/api/v1/projectsB#\n\x1forg.apache.airavata.api.projectP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.project_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\037org.apache.airavata.api.projectP\001' - _globals['_SEARCHPROJECTSREQUEST_FILTERSENTRY']._loaded_options = None - _globals['_SEARCHPROJECTSREQUEST_FILTERSENTRY']._serialized_options = b'8\001' - _globals['_PROJECTSERVICE'].methods_by_name['CreateProject']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['CreateProject']._serialized_options = b'\202\323\344\223\002\033\"\020/api/v1/projects:\007project' - _globals['_PROJECTSERVICE'].methods_by_name['GetProject']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['GetProject']._serialized_options = b'\202\323\344\223\002\037\022\035/api/v1/projects/{project_id}' - _globals['_PROJECTSERVICE'].methods_by_name['UpdateProject']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['UpdateProject']._serialized_options = b'\202\323\344\223\002(\032\035/api/v1/projects/{project_id}:\007project' - _globals['_PROJECTSERVICE'].methods_by_name['DeleteProject']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['DeleteProject']._serialized_options = b'\202\323\344\223\002\037*\035/api/v1/projects/{project_id}' - _globals['_PROJECTSERVICE'].methods_by_name['GetUserProjects']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['GetUserProjects']._serialized_options = b'\202\323\344\223\002:\0228/api/v1/gateways/{gateway_id}/users/{user_name}/projects' - _globals['_PROJECTSERVICE'].methods_by_name['SearchProjects']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['SearchProjects']._serialized_options = b'\202\323\344\223\002\022\022\020/api/v1/projects' - _globals['_CREATEPROJECTREQUEST']._serialized_start=179 - _globals['_CREATEPROJECTREQUEST']._serialized_end=284 - _globals['_CREATEPROJECTRESPONSE']._serialized_start=286 - _globals['_CREATEPROJECTRESPONSE']._serialized_end=329 - _globals['_GETPROJECTREQUEST']._serialized_start=331 - _globals['_GETPROJECTREQUEST']._serialized_end=370 - _globals['_UPDATEPROJECTREQUEST']._serialized_start=372 - _globals['_UPDATEPROJECTREQUEST']._serialized_end=477 - _globals['_DELETEPROJECTREQUEST']._serialized_start=479 - _globals['_DELETEPROJECTREQUEST']._serialized_end=521 - _globals['_GETUSERPROJECTSREQUEST']._serialized_start=523 - _globals['_GETUSERPROJECTSREQUEST']._serialized_end=617 - _globals['_GETUSERPROJECTSRESPONSE']._serialized_start=619 - _globals['_GETUSERPROJECTSRESPONSE']._serialized_end=708 - _globals['_SEARCHPROJECTSREQUEST']._serialized_start=711 - _globals['_SEARCHPROJECTSREQUEST']._serialized_end=938 - _globals['_SEARCHPROJECTSREQUEST_FILTERSENTRY']._serialized_start=892 - _globals['_SEARCHPROJECTSREQUEST_FILTERSENTRY']._serialized_end=938 - _globals['_SEARCHPROJECTSRESPONSE']._serialized_start=940 - _globals['_SEARCHPROJECTSRESPONSE']._serialized_end=1028 - _globals['_PROJECTSERVICE']._serialized_start=1031 - _globals['_PROJECTSERVICE']._serialized_end=2003 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/resource_service_pb2.py b/airavata-python-sdk/airavata_sdk/generated/services/resource_service_pb2.py deleted file mode 100644 index 2e91f6a3d06..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/resource_service_pb2.py +++ /dev/null @@ -1,214 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: services/resource_service.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'services/resource_service.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.appcatalog.computeresource import compute_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2 -from org.apache.airavata.model.appcatalog.storageresource import storage_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_storageresource_dot_storage__resource__pb2 -from org.apache.airavata.model.data.movement import data_movement_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fservices/resource_service.proto\x12 org.apache.airavata.api.resource\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1aKorg/apache/airavata/model/appcatalog/computeresource/compute_resource.proto\x1aKorg/apache/airavata/model/appcatalog/storageresource/storage_resource.proto\x1a;org/apache/airavata/model/data/movement/data_movement.proto\"\x8c\x01\n\x1eRegisterComputeResourceRequest\x12j\n\x10\x63ompute_resource\x18\x01 \x01(\x0b\x32P.org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription\">\n\x1fRegisterComputeResourceResponse\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\"8\n\x19GetComputeResourceRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\"\xa7\x01\n\x1cUpdateComputeResourceRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12j\n\x10\x63ompute_resource\x18\x02 \x01(\x0b\x32P.org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription\";\n\x1c\x44\x65leteComputeResourceRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\"#\n!GetAllComputeResourceNamesRequest\"\xe1\x01\n\"GetAllComputeResourceNamesResponse\x12~\n\x16\x63ompute_resource_names\x18\x01 \x03(\x0b\x32^.org.apache.airavata.api.resource.GetAllComputeResourceNamesResponse.ComputeResourceNamesEntry\x1a;\n\x19\x43omputeResourceNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8c\x01\n\x1eRegisterStorageResourceRequest\x12j\n\x10storage_resource\x18\x01 \x01(\x0b\x32P.org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription\">\n\x1fRegisterStorageResourceResponse\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\"8\n\x19GetStorageResourceRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\"\xa7\x01\n\x1cUpdateStorageResourceRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\x12j\n\x10storage_resource\x18\x02 \x01(\x0b\x32P.org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription\";\n\x1c\x44\x65leteStorageResourceRequest\x12\x1b\n\x13storage_resource_id\x18\x01 \x01(\t\"#\n!GetAllStorageResourceNamesRequest\"\xe1\x01\n\"GetAllStorageResourceNamesResponse\x12~\n\x16storage_resource_names\x18\x01 \x03(\x0b\x32^.org.apache.airavata.api.resource.GetAllStorageResourceNamesResponse.StorageResourceNamesEntry\x1a;\n\x19StorageResourceNamesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xab\x01\n\x19\x41\x64\x64LocalSubmissionRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x10\n\x08priority\x18\x02 \x01(\x05\x12_\n\x10local_submission\x18\x03 \x01(\x0b\x32\x45.org.apache.airavata.model.appcatalog.computeresource.LOCALSubmission\"3\n\x1a\x41\x64\x64LocalSubmissionResponse\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\"\x96\x01\n\x1cUpdateLocalSubmissionRequest\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\x12_\n\x10local_submission\x18\x02 \x01(\x0b\x32\x45.org.apache.airavata.model.appcatalog.computeresource.LOCALSubmission\"5\n\x1cGetLocalJobSubmissionRequest\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\"\xaf\x01\n\x1a\x41\x64\x64SSHJobSubmissionRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x10\n\x08priority\x18\x02 \x01(\x05\x12\x62\n\x12ssh_job_submission\x18\x03 \x01(\x0b\x32\x46.org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission\"4\n\x1b\x41\x64\x64SSHJobSubmissionResponse\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\"\xb3\x01\n\x1e\x41\x64\x64SSHForkJobSubmissionRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x10\n\x08priority\x18\x02 \x01(\x05\x12\x62\n\x12ssh_job_submission\x18\x03 \x01(\x0b\x32\x46.org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission\"8\n\x1f\x41\x64\x64SSHForkJobSubmissionResponse\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\"3\n\x1aGetSSHJobSubmissionRequest\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\"\x9a\x01\n\x1dUpdateSSHJobSubmissionRequest\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\x12\x62\n\x12ssh_job_submission\x18\x02 \x01(\x0b\x32\x46.org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission\"\xb5\x01\n\x1c\x41\x64\x64\x43loudJobSubmissionRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x10\n\x08priority\x18\x02 \x01(\x05\x12\x66\n\x14\x63loud_job_submission\x18\x03 \x01(\x0b\x32H.org.apache.airavata.model.appcatalog.computeresource.CloudJobSubmission\"6\n\x1d\x41\x64\x64\x43loudJobSubmissionResponse\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\"5\n\x1cGetCloudJobSubmissionRequest\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\"\xa0\x01\n\x1fUpdateCloudJobSubmissionRequest\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\x12\x66\n\x14\x63loud_job_submission\x18\x02 \x01(\x0b\x32H.org.apache.airavata.model.appcatalog.computeresource.CloudJobSubmission\"\xbb\x01\n\x1e\x41\x64\x64UnicoreJobSubmissionRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x10\n\x08priority\x18\x02 \x01(\x05\x12j\n\x16unicore_job_submission\x18\x03 \x01(\x0b\x32J.org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission\"8\n\x1f\x41\x64\x64UnicoreJobSubmissionResponse\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\"7\n\x1eGetUnicoreJobSubmissionRequest\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\"\xa6\x01\n!UpdateUnicoreJobSubmissionRequest\x12\x15\n\rsubmission_id\x18\x01 \x01(\t\x12j\n\x16unicore_job_submission\x18\x02 \x01(\x0b\x32J.org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission\"Y\n#DeleteJobSubmissionInterfaceRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x15\n\rsubmission_id\x18\x02 \x01(\t\"\xb6\x01\n\x1b\x41\x64\x64LocalDataMovementRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x10\n\x08priority\x18\x02 \x01(\x05\x12\x0f\n\x07\x64m_type\x18\x03 \x01(\t\x12W\n\x13local_data_movement\x18\x04 \x01(\x0b\x32:.org.apache.airavata.model.data.movement.LOCALDataMovement\"8\n\x1c\x41\x64\x64LocalDataMovementResponse\x12\x18\n\x10\x64\x61ta_movement_id\x18\x01 \x01(\t\"\x93\x01\n\x1eUpdateLocalDataMovementRequest\x12\x18\n\x10\x64\x61ta_movement_id\x18\x01 \x01(\t\x12W\n\x13local_data_movement\x18\x02 \x01(\x0b\x32:.org.apache.airavata.model.data.movement.LOCALDataMovement\"7\n\x1bGetLocalDataMovementRequest\x12\x18\n\x10\x64\x61ta_movement_id\x18\x01 \x01(\t\"\xb0\x01\n\x19\x41\x64\x64SCPDataMovementRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x10\n\x08priority\x18\x02 \x01(\x05\x12\x0f\n\x07\x64m_type\x18\x03 \x01(\t\x12S\n\x11scp_data_movement\x18\x04 \x01(\x0b\x32\x38.org.apache.airavata.model.data.movement.SCPDataMovement\"6\n\x1a\x41\x64\x64SCPDataMovementResponse\x12\x18\n\x10\x64\x61ta_movement_id\x18\x01 \x01(\t\"\x8d\x01\n\x1cUpdateSCPDataMovementRequest\x12\x18\n\x10\x64\x61ta_movement_id\x18\x01 \x01(\t\x12S\n\x11scp_data_movement\x18\x02 \x01(\x0b\x32\x38.org.apache.airavata.model.data.movement.SCPDataMovement\"5\n\x19GetSCPDataMovementRequest\x12\x18\n\x10\x64\x61ta_movement_id\x18\x01 \x01(\t\"\xbc\x01\n\x1d\x41\x64\x64GridFTPDataMovementRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x10\n\x08priority\x18\x02 \x01(\x05\x12\x0f\n\x07\x64m_type\x18\x03 \x01(\t\x12[\n\x15gridftp_data_movement\x18\x04 \x01(\x0b\x32<.org.apache.airavata.model.data.movement.GridFTPDataMovement\":\n\x1e\x41\x64\x64GridFTPDataMovementResponse\x12\x18\n\x10\x64\x61ta_movement_id\x18\x01 \x01(\t\"\x99\x01\n UpdateGridFTPDataMovementRequest\x12\x18\n\x10\x64\x61ta_movement_id\x18\x01 \x01(\t\x12[\n\x15gridftp_data_movement\x18\x02 \x01(\x0b\x32<.org.apache.airavata.model.data.movement.GridFTPDataMovement\"9\n\x1dGetGridFTPDataMovementRequest\x12\x18\n\x10\x64\x61ta_movement_id\x18\x01 \x01(\t\"[\n\"DeleteDataMovementInterfaceRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x18\n\x10\x64\x61ta_movement_id\x18\x02 \x01(\t\"J\n\x17\x44\x65leteBatchQueueRequest\x12\x1b\n\x13\x63ompute_resource_id\x18\x01 \x01(\t\x12\x12\n\nqueue_name\x18\x02 \x01(\t2\xbb:\n\x0fResourceService\x12\xd3\x01\n\x17RegisterComputeResource\x12@.org.apache.airavata.api.resource.RegisterComputeResourceRequest\x1a\x41.org.apache.airavata.api.resource.RegisterComputeResourceResponse\"3\x82\xd3\xe4\x93\x02-\"\x19/api/v1/compute-resources:\x10\x63ompute_resource\x12\xdc\x01\n\x12GetComputeResource\x12;.org.apache.airavata.api.resource.GetComputeResourceRequest\x1aP.org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription\"7\x82\xd3\xe4\x93\x02\x31\x12//api/v1/compute-resources/{compute_resource_id}\x12\xba\x01\n\x15UpdateComputeResource\x12>.org.apache.airavata.api.resource.UpdateComputeResourceRequest\x1a\x16.google.protobuf.Empty\"I\x82\xd3\xe4\x93\x02\x43\x1a//api/v1/compute-resources/{compute_resource_id}:\x10\x63ompute_resource\x12\xa8\x01\n\x15\x44\x65leteComputeResource\x12>.org.apache.airavata.api.resource.DeleteComputeResourceRequest\x1a\x16.google.protobuf.Empty\"7\x82\xd3\xe4\x93\x02\x31*//api/v1/compute-resources/{compute_resource_id}\x12\xd0\x01\n\x1aGetAllComputeResourceNames\x12\x43.org.apache.airavata.api.resource.GetAllComputeResourceNamesRequest\x1a\x44.org.apache.airavata.api.resource.GetAllComputeResourceNamesResponse\"\'\x82\xd3\xe4\x93\x02!\x12\x1f/api/v1/compute-resources:names\x12\xd3\x01\n\x17RegisterStorageResource\x12@.org.apache.airavata.api.resource.RegisterStorageResourceRequest\x1a\x41.org.apache.airavata.api.resource.RegisterStorageResourceResponse\"3\x82\xd3\xe4\x93\x02-\"\x19/api/v1/storage-resources:\x10storage_resource\x12\xdc\x01\n\x12GetStorageResource\x12;.org.apache.airavata.api.resource.GetStorageResourceRequest\x1aP.org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription\"7\x82\xd3\xe4\x93\x02\x31\x12//api/v1/storage-resources/{storage_resource_id}\x12\xba\x01\n\x15UpdateStorageResource\x12>.org.apache.airavata.api.resource.UpdateStorageResourceRequest\x1a\x16.google.protobuf.Empty\"I\x82\xd3\xe4\x93\x02\x43\x1a//api/v1/storage-resources/{storage_resource_id}:\x10storage_resource\x12\xa8\x01\n\x15\x44\x65leteStorageResource\x12>.org.apache.airavata.api.resource.DeleteStorageResourceRequest\x1a\x16.google.protobuf.Empty\"7\x82\xd3\xe4\x93\x02\x31*//api/v1/storage-resources/{storage_resource_id}\x12\xd0\x01\n\x1aGetAllStorageResourceNames\x12\x43.org.apache.airavata.api.resource.GetAllStorageResourceNamesRequest\x1a\x44.org.apache.airavata.api.resource.GetAllStorageResourceNamesResponse\"\'\x82\xd3\xe4\x93\x02!\x12\x1f/api/v1/storage-resources:names\x12\xec\x01\n\x12\x41\x64\x64LocalSubmission\x12;.org.apache.airavata.api.resource.AddLocalSubmissionRequest\x1a<.org.apache.airavata.api.resource.AddLocalSubmissionResponse\"[\x82\xd3\xe4\x93\x02U\"A/api/v1/compute-resources/{compute_resource_id}/local-submissions:\x10local_submission\x12\xb4\x01\n\x15UpdateLocalSubmission\x12>.org.apache.airavata.api.resource.UpdateLocalSubmissionRequest\x1a\x16.google.protobuf.Empty\"C\x82\xd3\xe4\x93\x02=\x1a)/api/v1/local-submissions/{submission_id}:\x10local_submission\x12\xd1\x01\n\x15GetLocalJobSubmission\x12>.org.apache.airavata.api.resource.GetLocalJobSubmissionRequest\x1a\x45.org.apache.airavata.model.appcatalog.computeresource.LOCALSubmission\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/local-submissions/{submission_id}\x12\xef\x01\n\x13\x41\x64\x64SSHJobSubmission\x12<.org.apache.airavata.api.resource.AddSSHJobSubmissionRequest\x1a=.org.apache.airavata.api.resource.AddSSHJobSubmissionResponse\"[\x82\xd3\xe4\x93\x02U\"?/api/v1/compute-resources/{compute_resource_id}/ssh-submissions:\x12ssh_job_submission\x12\x80\x02\n\x17\x41\x64\x64SSHForkJobSubmission\x12@.org.apache.airavata.api.resource.AddSSHForkJobSubmissionRequest\x1a\x41.org.apache.airavata.api.resource.AddSSHForkJobSubmissionResponse\"`\x82\xd3\xe4\x93\x02Z\"D/api/v1/compute-resources/{compute_resource_id}/ssh-fork-submissions:\x12ssh_job_submission\x12\xcc\x01\n\x13GetSSHJobSubmission\x12<.org.apache.airavata.api.resource.GetSSHJobSubmissionRequest\x1a\x46.org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission\"/\x82\xd3\xe4\x93\x02)\x12\'/api/v1/ssh-submissions/{submission_id}\x12\xb6\x01\n\x16UpdateSSHJobSubmission\x12?.org.apache.airavata.api.resource.UpdateSSHJobSubmissionRequest\x1a\x16.google.protobuf.Empty\"C\x82\xd3\xe4\x93\x02=\x1a\'/api/v1/ssh-submissions/{submission_id}:\x12ssh_job_submission\x12\xf9\x01\n\x15\x41\x64\x64\x43loudJobSubmission\x12>.org.apache.airavata.api.resource.AddCloudJobSubmissionRequest\x1a?.org.apache.airavata.api.resource.AddCloudJobSubmissionResponse\"_\x82\xd3\xe4\x93\x02Y\"A/api/v1/compute-resources/{compute_resource_id}/cloud-submissions:\x14\x63loud_job_submission\x12\xd4\x01\n\x15GetCloudJobSubmission\x12>.org.apache.airavata.api.resource.GetCloudJobSubmissionRequest\x1aH.org.apache.airavata.model.appcatalog.computeresource.CloudJobSubmission\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/cloud-submissions/{submission_id}\x12\xbe\x01\n\x18UpdateCloudJobSubmission\x12\x41.org.apache.airavata.api.resource.UpdateCloudJobSubmissionRequest\x1a\x16.google.protobuf.Empty\"G\x82\xd3\xe4\x93\x02\x41\x1a)/api/v1/cloud-submissions/{submission_id}:\x14\x63loud_job_submission\x12\x83\x02\n\x17\x41\x64\x64UnicoreJobSubmission\x12@.org.apache.airavata.api.resource.AddUnicoreJobSubmissionRequest\x1a\x41.org.apache.airavata.api.resource.AddUnicoreJobSubmissionResponse\"c\x82\xd3\xe4\x93\x02]\"C/api/v1/compute-resources/{compute_resource_id}/unicore-submissions:\x16unicore_job_submission\x12\xdc\x01\n\x17GetUnicoreJobSubmission\x12@.org.apache.airavata.api.resource.GetUnicoreJobSubmissionRequest\x1aJ.org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/unicore-submissions/{submission_id}\x12\xc6\x01\n\x1aUpdateUnicoreJobSubmission\x12\x43.org.apache.airavata.api.resource.UpdateUnicoreJobSubmissionRequest\x1a\x16.google.protobuf.Empty\"K\x82\xd3\xe4\x93\x02\x45\x1a+/api/v1/unicore-submissions/{submission_id}:\x16unicore_job_submission\x12\xd6\x01\n\x1c\x44\x65leteJobSubmissionInterface\x12\x45.org.apache.airavata.api.resource.DeleteJobSubmissionInterfaceRequest\x1a\x16.google.protobuf.Empty\"W\x82\xd3\xe4\x93\x02Q*O/api/v1/compute-resources/{compute_resource_id}/job-submissions/{submission_id}\x12\xf8\x01\n\x14\x41\x64\x64LocalDataMovement\x12=.org.apache.airavata.api.resource.AddLocalDataMovementRequest\x1a>.org.apache.airavata.api.resource.AddLocalDataMovementResponse\"a\x82\xd3\xe4\x93\x02[\"D/api/v1/compute-resources/{compute_resource_id}/local-data-movements:\x13local_data_movement\x12\xc1\x01\n\x17UpdateLocalDataMovement\x12@.org.apache.airavata.api.resource.UpdateLocalDataMovementRequest\x1a\x16.google.protobuf.Empty\"L\x82\xd3\xe4\x93\x02\x46\x1a//api/v1/local-data-movements/{data_movement_id}:\x13local_data_movement\x12\xca\x01\n\x14GetLocalDataMovement\x12=.org.apache.airavata.api.resource.GetLocalDataMovementRequest\x1a:.org.apache.airavata.model.data.movement.LOCALDataMovement\"7\x82\xd3\xe4\x93\x02\x31\x12//api/v1/local-data-movements/{data_movement_id}\x12\xee\x01\n\x12\x41\x64\x64SCPDataMovement\x12;.org.apache.airavata.api.resource.AddSCPDataMovementRequest\x1a<.org.apache.airavata.api.resource.AddSCPDataMovementResponse\"]\x82\xd3\xe4\x93\x02W\"B/api/v1/compute-resources/{compute_resource_id}/scp-data-movements:\x11scp_data_movement\x12\xb9\x01\n\x15UpdateSCPDataMovement\x12>.org.apache.airavata.api.resource.UpdateSCPDataMovementRequest\x1a\x16.google.protobuf.Empty\"H\x82\xd3\xe4\x93\x02\x42\x1a-/api/v1/scp-data-movements/{data_movement_id}:\x11scp_data_movement\x12\xc2\x01\n\x12GetSCPDataMovement\x12;.org.apache.airavata.api.resource.GetSCPDataMovementRequest\x1a\x38.org.apache.airavata.model.data.movement.SCPDataMovement\"5\x82\xd3\xe4\x93\x02/\x12-/api/v1/scp-data-movements/{data_movement_id}\x12\x82\x02\n\x16\x41\x64\x64GridFTPDataMovement\x12?.org.apache.airavata.api.resource.AddGridFTPDataMovementRequest\x1a@.org.apache.airavata.api.resource.AddGridFTPDataMovementResponse\"e\x82\xd3\xe4\x93\x02_\"F/api/v1/compute-resources/{compute_resource_id}/gridftp-data-movements:\x15gridftp_data_movement\x12\xc9\x01\n\x19UpdateGridFTPDataMovement\x12\x42.org.apache.airavata.api.resource.UpdateGridFTPDataMovementRequest\x1a\x16.google.protobuf.Empty\"P\x82\xd3\xe4\x93\x02J\x1a\x31/api/v1/gridftp-data-movements/{data_movement_id}:\x15gridftp_data_movement\x12\xd2\x01\n\x16GetGridFTPDataMovement\x12?.org.apache.airavata.api.resource.GetGridFTPDataMovementRequest\x1a<.org.apache.airavata.model.data.movement.GridFTPDataMovement\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/api/v1/gridftp-data-movements/{data_movement_id}\x12\xd6\x01\n\x1b\x44\x65leteDataMovementInterface\x12\x44.org.apache.airavata.api.resource.DeleteDataMovementInterfaceRequest\x1a\x16.google.protobuf.Empty\"Y\x82\xd3\xe4\x93\x02S*Q/api/v1/compute-resources/{compute_resource_id}/data-movements/{data_movement_id}\x12\xb8\x01\n\x10\x44\x65leteBatchQueue\x12\x39.org.apache.airavata.api.resource.DeleteBatchQueueRequest\x1a\x16.google.protobuf.Empty\"Q\x82\xd3\xe4\x93\x02K*I/api/v1/compute-resources/{compute_resource_id}/batch-queues/{queue_name}B$\n org.apache.airavata.api.resourceP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.resource_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n org.apache.airavata.api.resourceP\001' - _globals['_GETALLCOMPUTERESOURCENAMESRESPONSE_COMPUTERESOURCENAMESENTRY']._loaded_options = None - _globals['_GETALLCOMPUTERESOURCENAMESRESPONSE_COMPUTERESOURCENAMESENTRY']._serialized_options = b'8\001' - _globals['_GETALLSTORAGERESOURCENAMESRESPONSE_STORAGERESOURCENAMESENTRY']._loaded_options = None - _globals['_GETALLSTORAGERESOURCENAMESRESPONSE_STORAGERESOURCENAMESENTRY']._serialized_options = b'8\001' - _globals['_RESOURCESERVICE'].methods_by_name['RegisterComputeResource']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['RegisterComputeResource']._serialized_options = b'\202\323\344\223\002-\"\031/api/v1/compute-resources:\020compute_resource' - _globals['_RESOURCESERVICE'].methods_by_name['GetComputeResource']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['GetComputeResource']._serialized_options = b'\202\323\344\223\0021\022//api/v1/compute-resources/{compute_resource_id}' - _globals['_RESOURCESERVICE'].methods_by_name['UpdateComputeResource']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['UpdateComputeResource']._serialized_options = b'\202\323\344\223\002C\032//api/v1/compute-resources/{compute_resource_id}:\020compute_resource' - _globals['_RESOURCESERVICE'].methods_by_name['DeleteComputeResource']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['DeleteComputeResource']._serialized_options = b'\202\323\344\223\0021*//api/v1/compute-resources/{compute_resource_id}' - _globals['_RESOURCESERVICE'].methods_by_name['GetAllComputeResourceNames']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['GetAllComputeResourceNames']._serialized_options = b'\202\323\344\223\002!\022\037/api/v1/compute-resources:names' - _globals['_RESOURCESERVICE'].methods_by_name['RegisterStorageResource']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['RegisterStorageResource']._serialized_options = b'\202\323\344\223\002-\"\031/api/v1/storage-resources:\020storage_resource' - _globals['_RESOURCESERVICE'].methods_by_name['GetStorageResource']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['GetStorageResource']._serialized_options = b'\202\323\344\223\0021\022//api/v1/storage-resources/{storage_resource_id}' - _globals['_RESOURCESERVICE'].methods_by_name['UpdateStorageResource']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['UpdateStorageResource']._serialized_options = b'\202\323\344\223\002C\032//api/v1/storage-resources/{storage_resource_id}:\020storage_resource' - _globals['_RESOURCESERVICE'].methods_by_name['DeleteStorageResource']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['DeleteStorageResource']._serialized_options = b'\202\323\344\223\0021*//api/v1/storage-resources/{storage_resource_id}' - _globals['_RESOURCESERVICE'].methods_by_name['GetAllStorageResourceNames']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['GetAllStorageResourceNames']._serialized_options = b'\202\323\344\223\002!\022\037/api/v1/storage-resources:names' - _globals['_RESOURCESERVICE'].methods_by_name['AddLocalSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['AddLocalSubmission']._serialized_options = b'\202\323\344\223\002U\"A/api/v1/compute-resources/{compute_resource_id}/local-submissions:\020local_submission' - _globals['_RESOURCESERVICE'].methods_by_name['UpdateLocalSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['UpdateLocalSubmission']._serialized_options = b'\202\323\344\223\002=\032)/api/v1/local-submissions/{submission_id}:\020local_submission' - _globals['_RESOURCESERVICE'].methods_by_name['GetLocalJobSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['GetLocalJobSubmission']._serialized_options = b'\202\323\344\223\002+\022)/api/v1/local-submissions/{submission_id}' - _globals['_RESOURCESERVICE'].methods_by_name['AddSSHJobSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['AddSSHJobSubmission']._serialized_options = b'\202\323\344\223\002U\"?/api/v1/compute-resources/{compute_resource_id}/ssh-submissions:\022ssh_job_submission' - _globals['_RESOURCESERVICE'].methods_by_name['AddSSHForkJobSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['AddSSHForkJobSubmission']._serialized_options = b'\202\323\344\223\002Z\"D/api/v1/compute-resources/{compute_resource_id}/ssh-fork-submissions:\022ssh_job_submission' - _globals['_RESOURCESERVICE'].methods_by_name['GetSSHJobSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['GetSSHJobSubmission']._serialized_options = b'\202\323\344\223\002)\022\'/api/v1/ssh-submissions/{submission_id}' - _globals['_RESOURCESERVICE'].methods_by_name['UpdateSSHJobSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['UpdateSSHJobSubmission']._serialized_options = b'\202\323\344\223\002=\032\'/api/v1/ssh-submissions/{submission_id}:\022ssh_job_submission' - _globals['_RESOURCESERVICE'].methods_by_name['AddCloudJobSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['AddCloudJobSubmission']._serialized_options = b'\202\323\344\223\002Y\"A/api/v1/compute-resources/{compute_resource_id}/cloud-submissions:\024cloud_job_submission' - _globals['_RESOURCESERVICE'].methods_by_name['GetCloudJobSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['GetCloudJobSubmission']._serialized_options = b'\202\323\344\223\002+\022)/api/v1/cloud-submissions/{submission_id}' - _globals['_RESOURCESERVICE'].methods_by_name['UpdateCloudJobSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['UpdateCloudJobSubmission']._serialized_options = b'\202\323\344\223\002A\032)/api/v1/cloud-submissions/{submission_id}:\024cloud_job_submission' - _globals['_RESOURCESERVICE'].methods_by_name['AddUnicoreJobSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['AddUnicoreJobSubmission']._serialized_options = b'\202\323\344\223\002]\"C/api/v1/compute-resources/{compute_resource_id}/unicore-submissions:\026unicore_job_submission' - _globals['_RESOURCESERVICE'].methods_by_name['GetUnicoreJobSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['GetUnicoreJobSubmission']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/unicore-submissions/{submission_id}' - _globals['_RESOURCESERVICE'].methods_by_name['UpdateUnicoreJobSubmission']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['UpdateUnicoreJobSubmission']._serialized_options = b'\202\323\344\223\002E\032+/api/v1/unicore-submissions/{submission_id}:\026unicore_job_submission' - _globals['_RESOURCESERVICE'].methods_by_name['DeleteJobSubmissionInterface']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['DeleteJobSubmissionInterface']._serialized_options = b'\202\323\344\223\002Q*O/api/v1/compute-resources/{compute_resource_id}/job-submissions/{submission_id}' - _globals['_RESOURCESERVICE'].methods_by_name['AddLocalDataMovement']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['AddLocalDataMovement']._serialized_options = b'\202\323\344\223\002[\"D/api/v1/compute-resources/{compute_resource_id}/local-data-movements:\023local_data_movement' - _globals['_RESOURCESERVICE'].methods_by_name['UpdateLocalDataMovement']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['UpdateLocalDataMovement']._serialized_options = b'\202\323\344\223\002F\032//api/v1/local-data-movements/{data_movement_id}:\023local_data_movement' - _globals['_RESOURCESERVICE'].methods_by_name['GetLocalDataMovement']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['GetLocalDataMovement']._serialized_options = b'\202\323\344\223\0021\022//api/v1/local-data-movements/{data_movement_id}' - _globals['_RESOURCESERVICE'].methods_by_name['AddSCPDataMovement']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['AddSCPDataMovement']._serialized_options = b'\202\323\344\223\002W\"B/api/v1/compute-resources/{compute_resource_id}/scp-data-movements:\021scp_data_movement' - _globals['_RESOURCESERVICE'].methods_by_name['UpdateSCPDataMovement']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['UpdateSCPDataMovement']._serialized_options = b'\202\323\344\223\002B\032-/api/v1/scp-data-movements/{data_movement_id}:\021scp_data_movement' - _globals['_RESOURCESERVICE'].methods_by_name['GetSCPDataMovement']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['GetSCPDataMovement']._serialized_options = b'\202\323\344\223\002/\022-/api/v1/scp-data-movements/{data_movement_id}' - _globals['_RESOURCESERVICE'].methods_by_name['AddGridFTPDataMovement']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['AddGridFTPDataMovement']._serialized_options = b'\202\323\344\223\002_\"F/api/v1/compute-resources/{compute_resource_id}/gridftp-data-movements:\025gridftp_data_movement' - _globals['_RESOURCESERVICE'].methods_by_name['UpdateGridFTPDataMovement']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['UpdateGridFTPDataMovement']._serialized_options = b'\202\323\344\223\002J\0321/api/v1/gridftp-data-movements/{data_movement_id}:\025gridftp_data_movement' - _globals['_RESOURCESERVICE'].methods_by_name['GetGridFTPDataMovement']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['GetGridFTPDataMovement']._serialized_options = b'\202\323\344\223\0023\0221/api/v1/gridftp-data-movements/{data_movement_id}' - _globals['_RESOURCESERVICE'].methods_by_name['DeleteDataMovementInterface']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['DeleteDataMovementInterface']._serialized_options = b'\202\323\344\223\002S*Q/api/v1/compute-resources/{compute_resource_id}/data-movements/{data_movement_id}' - _globals['_RESOURCESERVICE'].methods_by_name['DeleteBatchQueue']._loaded_options = None - _globals['_RESOURCESERVICE'].methods_by_name['DeleteBatchQueue']._serialized_options = b'\202\323\344\223\002K*I/api/v1/compute-resources/{compute_resource_id}/batch-queues/{queue_name}' - _globals['_REGISTERCOMPUTERESOURCEREQUEST']._serialized_start=344 - _globals['_REGISTERCOMPUTERESOURCEREQUEST']._serialized_end=484 - _globals['_REGISTERCOMPUTERESOURCERESPONSE']._serialized_start=486 - _globals['_REGISTERCOMPUTERESOURCERESPONSE']._serialized_end=548 - _globals['_GETCOMPUTERESOURCEREQUEST']._serialized_start=550 - _globals['_GETCOMPUTERESOURCEREQUEST']._serialized_end=606 - _globals['_UPDATECOMPUTERESOURCEREQUEST']._serialized_start=609 - _globals['_UPDATECOMPUTERESOURCEREQUEST']._serialized_end=776 - _globals['_DELETECOMPUTERESOURCEREQUEST']._serialized_start=778 - _globals['_DELETECOMPUTERESOURCEREQUEST']._serialized_end=837 - _globals['_GETALLCOMPUTERESOURCENAMESREQUEST']._serialized_start=839 - _globals['_GETALLCOMPUTERESOURCENAMESREQUEST']._serialized_end=874 - _globals['_GETALLCOMPUTERESOURCENAMESRESPONSE']._serialized_start=877 - _globals['_GETALLCOMPUTERESOURCENAMESRESPONSE']._serialized_end=1102 - _globals['_GETALLCOMPUTERESOURCENAMESRESPONSE_COMPUTERESOURCENAMESENTRY']._serialized_start=1043 - _globals['_GETALLCOMPUTERESOURCENAMESRESPONSE_COMPUTERESOURCENAMESENTRY']._serialized_end=1102 - _globals['_REGISTERSTORAGERESOURCEREQUEST']._serialized_start=1105 - _globals['_REGISTERSTORAGERESOURCEREQUEST']._serialized_end=1245 - _globals['_REGISTERSTORAGERESOURCERESPONSE']._serialized_start=1247 - _globals['_REGISTERSTORAGERESOURCERESPONSE']._serialized_end=1309 - _globals['_GETSTORAGERESOURCEREQUEST']._serialized_start=1311 - _globals['_GETSTORAGERESOURCEREQUEST']._serialized_end=1367 - _globals['_UPDATESTORAGERESOURCEREQUEST']._serialized_start=1370 - _globals['_UPDATESTORAGERESOURCEREQUEST']._serialized_end=1537 - _globals['_DELETESTORAGERESOURCEREQUEST']._serialized_start=1539 - _globals['_DELETESTORAGERESOURCEREQUEST']._serialized_end=1598 - _globals['_GETALLSTORAGERESOURCENAMESREQUEST']._serialized_start=1600 - _globals['_GETALLSTORAGERESOURCENAMESREQUEST']._serialized_end=1635 - _globals['_GETALLSTORAGERESOURCENAMESRESPONSE']._serialized_start=1638 - _globals['_GETALLSTORAGERESOURCENAMESRESPONSE']._serialized_end=1863 - _globals['_GETALLSTORAGERESOURCENAMESRESPONSE_STORAGERESOURCENAMESENTRY']._serialized_start=1804 - _globals['_GETALLSTORAGERESOURCENAMESRESPONSE_STORAGERESOURCENAMESENTRY']._serialized_end=1863 - _globals['_ADDLOCALSUBMISSIONREQUEST']._serialized_start=1866 - _globals['_ADDLOCALSUBMISSIONREQUEST']._serialized_end=2037 - _globals['_ADDLOCALSUBMISSIONRESPONSE']._serialized_start=2039 - _globals['_ADDLOCALSUBMISSIONRESPONSE']._serialized_end=2090 - _globals['_UPDATELOCALSUBMISSIONREQUEST']._serialized_start=2093 - _globals['_UPDATELOCALSUBMISSIONREQUEST']._serialized_end=2243 - _globals['_GETLOCALJOBSUBMISSIONREQUEST']._serialized_start=2245 - _globals['_GETLOCALJOBSUBMISSIONREQUEST']._serialized_end=2298 - _globals['_ADDSSHJOBSUBMISSIONREQUEST']._serialized_start=2301 - _globals['_ADDSSHJOBSUBMISSIONREQUEST']._serialized_end=2476 - _globals['_ADDSSHJOBSUBMISSIONRESPONSE']._serialized_start=2478 - _globals['_ADDSSHJOBSUBMISSIONRESPONSE']._serialized_end=2530 - _globals['_ADDSSHFORKJOBSUBMISSIONREQUEST']._serialized_start=2533 - _globals['_ADDSSHFORKJOBSUBMISSIONREQUEST']._serialized_end=2712 - _globals['_ADDSSHFORKJOBSUBMISSIONRESPONSE']._serialized_start=2714 - _globals['_ADDSSHFORKJOBSUBMISSIONRESPONSE']._serialized_end=2770 - _globals['_GETSSHJOBSUBMISSIONREQUEST']._serialized_start=2772 - _globals['_GETSSHJOBSUBMISSIONREQUEST']._serialized_end=2823 - _globals['_UPDATESSHJOBSUBMISSIONREQUEST']._serialized_start=2826 - _globals['_UPDATESSHJOBSUBMISSIONREQUEST']._serialized_end=2980 - _globals['_ADDCLOUDJOBSUBMISSIONREQUEST']._serialized_start=2983 - _globals['_ADDCLOUDJOBSUBMISSIONREQUEST']._serialized_end=3164 - _globals['_ADDCLOUDJOBSUBMISSIONRESPONSE']._serialized_start=3166 - _globals['_ADDCLOUDJOBSUBMISSIONRESPONSE']._serialized_end=3220 - _globals['_GETCLOUDJOBSUBMISSIONREQUEST']._serialized_start=3222 - _globals['_GETCLOUDJOBSUBMISSIONREQUEST']._serialized_end=3275 - _globals['_UPDATECLOUDJOBSUBMISSIONREQUEST']._serialized_start=3278 - _globals['_UPDATECLOUDJOBSUBMISSIONREQUEST']._serialized_end=3438 - _globals['_ADDUNICOREJOBSUBMISSIONREQUEST']._serialized_start=3441 - _globals['_ADDUNICOREJOBSUBMISSIONREQUEST']._serialized_end=3628 - _globals['_ADDUNICOREJOBSUBMISSIONRESPONSE']._serialized_start=3630 - _globals['_ADDUNICOREJOBSUBMISSIONRESPONSE']._serialized_end=3686 - _globals['_GETUNICOREJOBSUBMISSIONREQUEST']._serialized_start=3688 - _globals['_GETUNICOREJOBSUBMISSIONREQUEST']._serialized_end=3743 - _globals['_UPDATEUNICOREJOBSUBMISSIONREQUEST']._serialized_start=3746 - _globals['_UPDATEUNICOREJOBSUBMISSIONREQUEST']._serialized_end=3912 - _globals['_DELETEJOBSUBMISSIONINTERFACEREQUEST']._serialized_start=3914 - _globals['_DELETEJOBSUBMISSIONINTERFACEREQUEST']._serialized_end=4003 - _globals['_ADDLOCALDATAMOVEMENTREQUEST']._serialized_start=4006 - _globals['_ADDLOCALDATAMOVEMENTREQUEST']._serialized_end=4188 - _globals['_ADDLOCALDATAMOVEMENTRESPONSE']._serialized_start=4190 - _globals['_ADDLOCALDATAMOVEMENTRESPONSE']._serialized_end=4246 - _globals['_UPDATELOCALDATAMOVEMENTREQUEST']._serialized_start=4249 - _globals['_UPDATELOCALDATAMOVEMENTREQUEST']._serialized_end=4396 - _globals['_GETLOCALDATAMOVEMENTREQUEST']._serialized_start=4398 - _globals['_GETLOCALDATAMOVEMENTREQUEST']._serialized_end=4453 - _globals['_ADDSCPDATAMOVEMENTREQUEST']._serialized_start=4456 - _globals['_ADDSCPDATAMOVEMENTREQUEST']._serialized_end=4632 - _globals['_ADDSCPDATAMOVEMENTRESPONSE']._serialized_start=4634 - _globals['_ADDSCPDATAMOVEMENTRESPONSE']._serialized_end=4688 - _globals['_UPDATESCPDATAMOVEMENTREQUEST']._serialized_start=4691 - _globals['_UPDATESCPDATAMOVEMENTREQUEST']._serialized_end=4832 - _globals['_GETSCPDATAMOVEMENTREQUEST']._serialized_start=4834 - _globals['_GETSCPDATAMOVEMENTREQUEST']._serialized_end=4887 - _globals['_ADDGRIDFTPDATAMOVEMENTREQUEST']._serialized_start=4890 - _globals['_ADDGRIDFTPDATAMOVEMENTREQUEST']._serialized_end=5078 - _globals['_ADDGRIDFTPDATAMOVEMENTRESPONSE']._serialized_start=5080 - _globals['_ADDGRIDFTPDATAMOVEMENTRESPONSE']._serialized_end=5138 - _globals['_UPDATEGRIDFTPDATAMOVEMENTREQUEST']._serialized_start=5141 - _globals['_UPDATEGRIDFTPDATAMOVEMENTREQUEST']._serialized_end=5294 - _globals['_GETGRIDFTPDATAMOVEMENTREQUEST']._serialized_start=5296 - _globals['_GETGRIDFTPDATAMOVEMENTREQUEST']._serialized_end=5353 - _globals['_DELETEDATAMOVEMENTINTERFACEREQUEST']._serialized_start=5355 - _globals['_DELETEDATAMOVEMENTINTERFACEREQUEST']._serialized_end=5446 - _globals['_DELETEBATCHQUEUEREQUEST']._serialized_start=5448 - _globals['_DELETEBATCHQUEUEREQUEST']._serialized_end=5522 - _globals['_RESOURCESERVICE']._serialized_start=5525 - _globals['_RESOURCESERVICE']._serialized_end=13008 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/resource_service_pb2.pyi b/airavata-python-sdk/airavata_sdk/generated/services/resource_service_pb2.pyi deleted file mode 100644 index 30d219b7dde..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/resource_service_pb2.pyi +++ /dev/null @@ -1,366 +0,0 @@ -from google.api import annotations_pb2 as _annotations_pb2 -from google.protobuf import empty_pb2 as _empty_pb2 -from org.apache.airavata.model.appcatalog.computeresource import compute_resource_pb2 as _compute_resource_pb2 -from org.apache.airavata.model.appcatalog.storageresource import storage_resource_pb2 as _storage_resource_pb2 -from org.apache.airavata.model.data.movement import data_movement_pb2 as _data_movement_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class RegisterComputeResourceRequest(_message.Message): - __slots__ = ("compute_resource",) - COMPUTE_RESOURCE_FIELD_NUMBER: _ClassVar[int] - compute_resource: _compute_resource_pb2.ComputeResourceDescription - def __init__(self, compute_resource: _Optional[_Union[_compute_resource_pb2.ComputeResourceDescription, _Mapping]] = ...) -> None: ... - -class RegisterComputeResourceResponse(_message.Message): - __slots__ = ("compute_resource_id",) - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - def __init__(self, compute_resource_id: _Optional[str] = ...) -> None: ... - -class GetComputeResourceRequest(_message.Message): - __slots__ = ("compute_resource_id",) - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - def __init__(self, compute_resource_id: _Optional[str] = ...) -> None: ... - -class UpdateComputeResourceRequest(_message.Message): - __slots__ = ("compute_resource_id", "compute_resource") - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - COMPUTE_RESOURCE_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - compute_resource: _compute_resource_pb2.ComputeResourceDescription - def __init__(self, compute_resource_id: _Optional[str] = ..., compute_resource: _Optional[_Union[_compute_resource_pb2.ComputeResourceDescription, _Mapping]] = ...) -> None: ... - -class DeleteComputeResourceRequest(_message.Message): - __slots__ = ("compute_resource_id",) - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - def __init__(self, compute_resource_id: _Optional[str] = ...) -> None: ... - -class GetAllComputeResourceNamesRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class GetAllComputeResourceNamesResponse(_message.Message): - __slots__ = ("compute_resource_names",) - class ComputeResourceNamesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - COMPUTE_RESOURCE_NAMES_FIELD_NUMBER: _ClassVar[int] - compute_resource_names: _containers.ScalarMap[str, str] - def __init__(self, compute_resource_names: _Optional[_Mapping[str, str]] = ...) -> None: ... - -class RegisterStorageResourceRequest(_message.Message): - __slots__ = ("storage_resource",) - STORAGE_RESOURCE_FIELD_NUMBER: _ClassVar[int] - storage_resource: _storage_resource_pb2.StorageResourceDescription - def __init__(self, storage_resource: _Optional[_Union[_storage_resource_pb2.StorageResourceDescription, _Mapping]] = ...) -> None: ... - -class RegisterStorageResourceResponse(_message.Message): - __slots__ = ("storage_resource_id",) - STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - storage_resource_id: str - def __init__(self, storage_resource_id: _Optional[str] = ...) -> None: ... - -class GetStorageResourceRequest(_message.Message): - __slots__ = ("storage_resource_id",) - STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - storage_resource_id: str - def __init__(self, storage_resource_id: _Optional[str] = ...) -> None: ... - -class UpdateStorageResourceRequest(_message.Message): - __slots__ = ("storage_resource_id", "storage_resource") - STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - STORAGE_RESOURCE_FIELD_NUMBER: _ClassVar[int] - storage_resource_id: str - storage_resource: _storage_resource_pb2.StorageResourceDescription - def __init__(self, storage_resource_id: _Optional[str] = ..., storage_resource: _Optional[_Union[_storage_resource_pb2.StorageResourceDescription, _Mapping]] = ...) -> None: ... - -class DeleteStorageResourceRequest(_message.Message): - __slots__ = ("storage_resource_id",) - STORAGE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - storage_resource_id: str - def __init__(self, storage_resource_id: _Optional[str] = ...) -> None: ... - -class GetAllStorageResourceNamesRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class GetAllStorageResourceNamesResponse(_message.Message): - __slots__ = ("storage_resource_names",) - class StorageResourceNamesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - STORAGE_RESOURCE_NAMES_FIELD_NUMBER: _ClassVar[int] - storage_resource_names: _containers.ScalarMap[str, str] - def __init__(self, storage_resource_names: _Optional[_Mapping[str, str]] = ...) -> None: ... - -class AddLocalSubmissionRequest(_message.Message): - __slots__ = ("compute_resource_id", "priority", "local_submission") - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - PRIORITY_FIELD_NUMBER: _ClassVar[int] - LOCAL_SUBMISSION_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - priority: int - local_submission: _compute_resource_pb2.LOCALSubmission - def __init__(self, compute_resource_id: _Optional[str] = ..., priority: _Optional[int] = ..., local_submission: _Optional[_Union[_compute_resource_pb2.LOCALSubmission, _Mapping]] = ...) -> None: ... - -class AddLocalSubmissionResponse(_message.Message): - __slots__ = ("submission_id",) - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - submission_id: str - def __init__(self, submission_id: _Optional[str] = ...) -> None: ... - -class UpdateLocalSubmissionRequest(_message.Message): - __slots__ = ("submission_id", "local_submission") - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - LOCAL_SUBMISSION_FIELD_NUMBER: _ClassVar[int] - submission_id: str - local_submission: _compute_resource_pb2.LOCALSubmission - def __init__(self, submission_id: _Optional[str] = ..., local_submission: _Optional[_Union[_compute_resource_pb2.LOCALSubmission, _Mapping]] = ...) -> None: ... - -class GetLocalJobSubmissionRequest(_message.Message): - __slots__ = ("submission_id",) - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - submission_id: str - def __init__(self, submission_id: _Optional[str] = ...) -> None: ... - -class AddSSHJobSubmissionRequest(_message.Message): - __slots__ = ("compute_resource_id", "priority", "ssh_job_submission") - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - PRIORITY_FIELD_NUMBER: _ClassVar[int] - SSH_JOB_SUBMISSION_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - priority: int - ssh_job_submission: _compute_resource_pb2.SSHJobSubmission - def __init__(self, compute_resource_id: _Optional[str] = ..., priority: _Optional[int] = ..., ssh_job_submission: _Optional[_Union[_compute_resource_pb2.SSHJobSubmission, _Mapping]] = ...) -> None: ... - -class AddSSHJobSubmissionResponse(_message.Message): - __slots__ = ("submission_id",) - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - submission_id: str - def __init__(self, submission_id: _Optional[str] = ...) -> None: ... - -class AddSSHForkJobSubmissionRequest(_message.Message): - __slots__ = ("compute_resource_id", "priority", "ssh_job_submission") - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - PRIORITY_FIELD_NUMBER: _ClassVar[int] - SSH_JOB_SUBMISSION_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - priority: int - ssh_job_submission: _compute_resource_pb2.SSHJobSubmission - def __init__(self, compute_resource_id: _Optional[str] = ..., priority: _Optional[int] = ..., ssh_job_submission: _Optional[_Union[_compute_resource_pb2.SSHJobSubmission, _Mapping]] = ...) -> None: ... - -class AddSSHForkJobSubmissionResponse(_message.Message): - __slots__ = ("submission_id",) - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - submission_id: str - def __init__(self, submission_id: _Optional[str] = ...) -> None: ... - -class GetSSHJobSubmissionRequest(_message.Message): - __slots__ = ("submission_id",) - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - submission_id: str - def __init__(self, submission_id: _Optional[str] = ...) -> None: ... - -class UpdateSSHJobSubmissionRequest(_message.Message): - __slots__ = ("submission_id", "ssh_job_submission") - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - SSH_JOB_SUBMISSION_FIELD_NUMBER: _ClassVar[int] - submission_id: str - ssh_job_submission: _compute_resource_pb2.SSHJobSubmission - def __init__(self, submission_id: _Optional[str] = ..., ssh_job_submission: _Optional[_Union[_compute_resource_pb2.SSHJobSubmission, _Mapping]] = ...) -> None: ... - -class AddCloudJobSubmissionRequest(_message.Message): - __slots__ = ("compute_resource_id", "priority", "cloud_job_submission") - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - PRIORITY_FIELD_NUMBER: _ClassVar[int] - CLOUD_JOB_SUBMISSION_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - priority: int - cloud_job_submission: _compute_resource_pb2.CloudJobSubmission - def __init__(self, compute_resource_id: _Optional[str] = ..., priority: _Optional[int] = ..., cloud_job_submission: _Optional[_Union[_compute_resource_pb2.CloudJobSubmission, _Mapping]] = ...) -> None: ... - -class AddCloudJobSubmissionResponse(_message.Message): - __slots__ = ("submission_id",) - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - submission_id: str - def __init__(self, submission_id: _Optional[str] = ...) -> None: ... - -class GetCloudJobSubmissionRequest(_message.Message): - __slots__ = ("submission_id",) - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - submission_id: str - def __init__(self, submission_id: _Optional[str] = ...) -> None: ... - -class UpdateCloudJobSubmissionRequest(_message.Message): - __slots__ = ("submission_id", "cloud_job_submission") - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - CLOUD_JOB_SUBMISSION_FIELD_NUMBER: _ClassVar[int] - submission_id: str - cloud_job_submission: _compute_resource_pb2.CloudJobSubmission - def __init__(self, submission_id: _Optional[str] = ..., cloud_job_submission: _Optional[_Union[_compute_resource_pb2.CloudJobSubmission, _Mapping]] = ...) -> None: ... - -class AddUnicoreJobSubmissionRequest(_message.Message): - __slots__ = ("compute_resource_id", "priority", "unicore_job_submission") - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - PRIORITY_FIELD_NUMBER: _ClassVar[int] - UNICORE_JOB_SUBMISSION_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - priority: int - unicore_job_submission: _compute_resource_pb2.UnicoreJobSubmission - def __init__(self, compute_resource_id: _Optional[str] = ..., priority: _Optional[int] = ..., unicore_job_submission: _Optional[_Union[_compute_resource_pb2.UnicoreJobSubmission, _Mapping]] = ...) -> None: ... - -class AddUnicoreJobSubmissionResponse(_message.Message): - __slots__ = ("submission_id",) - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - submission_id: str - def __init__(self, submission_id: _Optional[str] = ...) -> None: ... - -class GetUnicoreJobSubmissionRequest(_message.Message): - __slots__ = ("submission_id",) - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - submission_id: str - def __init__(self, submission_id: _Optional[str] = ...) -> None: ... - -class UpdateUnicoreJobSubmissionRequest(_message.Message): - __slots__ = ("submission_id", "unicore_job_submission") - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - UNICORE_JOB_SUBMISSION_FIELD_NUMBER: _ClassVar[int] - submission_id: str - unicore_job_submission: _compute_resource_pb2.UnicoreJobSubmission - def __init__(self, submission_id: _Optional[str] = ..., unicore_job_submission: _Optional[_Union[_compute_resource_pb2.UnicoreJobSubmission, _Mapping]] = ...) -> None: ... - -class DeleteJobSubmissionInterfaceRequest(_message.Message): - __slots__ = ("compute_resource_id", "submission_id") - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - SUBMISSION_ID_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - submission_id: str - def __init__(self, compute_resource_id: _Optional[str] = ..., submission_id: _Optional[str] = ...) -> None: ... - -class AddLocalDataMovementRequest(_message.Message): - __slots__ = ("compute_resource_id", "priority", "dm_type", "local_data_movement") - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - PRIORITY_FIELD_NUMBER: _ClassVar[int] - DM_TYPE_FIELD_NUMBER: _ClassVar[int] - LOCAL_DATA_MOVEMENT_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - priority: int - dm_type: str - local_data_movement: _data_movement_pb2.LOCALDataMovement - def __init__(self, compute_resource_id: _Optional[str] = ..., priority: _Optional[int] = ..., dm_type: _Optional[str] = ..., local_data_movement: _Optional[_Union[_data_movement_pb2.LOCALDataMovement, _Mapping]] = ...) -> None: ... - -class AddLocalDataMovementResponse(_message.Message): - __slots__ = ("data_movement_id",) - DATA_MOVEMENT_ID_FIELD_NUMBER: _ClassVar[int] - data_movement_id: str - def __init__(self, data_movement_id: _Optional[str] = ...) -> None: ... - -class UpdateLocalDataMovementRequest(_message.Message): - __slots__ = ("data_movement_id", "local_data_movement") - DATA_MOVEMENT_ID_FIELD_NUMBER: _ClassVar[int] - LOCAL_DATA_MOVEMENT_FIELD_NUMBER: _ClassVar[int] - data_movement_id: str - local_data_movement: _data_movement_pb2.LOCALDataMovement - def __init__(self, data_movement_id: _Optional[str] = ..., local_data_movement: _Optional[_Union[_data_movement_pb2.LOCALDataMovement, _Mapping]] = ...) -> None: ... - -class GetLocalDataMovementRequest(_message.Message): - __slots__ = ("data_movement_id",) - DATA_MOVEMENT_ID_FIELD_NUMBER: _ClassVar[int] - data_movement_id: str - def __init__(self, data_movement_id: _Optional[str] = ...) -> None: ... - -class AddSCPDataMovementRequest(_message.Message): - __slots__ = ("compute_resource_id", "priority", "dm_type", "scp_data_movement") - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - PRIORITY_FIELD_NUMBER: _ClassVar[int] - DM_TYPE_FIELD_NUMBER: _ClassVar[int] - SCP_DATA_MOVEMENT_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - priority: int - dm_type: str - scp_data_movement: _data_movement_pb2.SCPDataMovement - def __init__(self, compute_resource_id: _Optional[str] = ..., priority: _Optional[int] = ..., dm_type: _Optional[str] = ..., scp_data_movement: _Optional[_Union[_data_movement_pb2.SCPDataMovement, _Mapping]] = ...) -> None: ... - -class AddSCPDataMovementResponse(_message.Message): - __slots__ = ("data_movement_id",) - DATA_MOVEMENT_ID_FIELD_NUMBER: _ClassVar[int] - data_movement_id: str - def __init__(self, data_movement_id: _Optional[str] = ...) -> None: ... - -class UpdateSCPDataMovementRequest(_message.Message): - __slots__ = ("data_movement_id", "scp_data_movement") - DATA_MOVEMENT_ID_FIELD_NUMBER: _ClassVar[int] - SCP_DATA_MOVEMENT_FIELD_NUMBER: _ClassVar[int] - data_movement_id: str - scp_data_movement: _data_movement_pb2.SCPDataMovement - def __init__(self, data_movement_id: _Optional[str] = ..., scp_data_movement: _Optional[_Union[_data_movement_pb2.SCPDataMovement, _Mapping]] = ...) -> None: ... - -class GetSCPDataMovementRequest(_message.Message): - __slots__ = ("data_movement_id",) - DATA_MOVEMENT_ID_FIELD_NUMBER: _ClassVar[int] - data_movement_id: str - def __init__(self, data_movement_id: _Optional[str] = ...) -> None: ... - -class AddGridFTPDataMovementRequest(_message.Message): - __slots__ = ("compute_resource_id", "priority", "dm_type", "gridftp_data_movement") - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - PRIORITY_FIELD_NUMBER: _ClassVar[int] - DM_TYPE_FIELD_NUMBER: _ClassVar[int] - GRIDFTP_DATA_MOVEMENT_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - priority: int - dm_type: str - gridftp_data_movement: _data_movement_pb2.GridFTPDataMovement - def __init__(self, compute_resource_id: _Optional[str] = ..., priority: _Optional[int] = ..., dm_type: _Optional[str] = ..., gridftp_data_movement: _Optional[_Union[_data_movement_pb2.GridFTPDataMovement, _Mapping]] = ...) -> None: ... - -class AddGridFTPDataMovementResponse(_message.Message): - __slots__ = ("data_movement_id",) - DATA_MOVEMENT_ID_FIELD_NUMBER: _ClassVar[int] - data_movement_id: str - def __init__(self, data_movement_id: _Optional[str] = ...) -> None: ... - -class UpdateGridFTPDataMovementRequest(_message.Message): - __slots__ = ("data_movement_id", "gridftp_data_movement") - DATA_MOVEMENT_ID_FIELD_NUMBER: _ClassVar[int] - GRIDFTP_DATA_MOVEMENT_FIELD_NUMBER: _ClassVar[int] - data_movement_id: str - gridftp_data_movement: _data_movement_pb2.GridFTPDataMovement - def __init__(self, data_movement_id: _Optional[str] = ..., gridftp_data_movement: _Optional[_Union[_data_movement_pb2.GridFTPDataMovement, _Mapping]] = ...) -> None: ... - -class GetGridFTPDataMovementRequest(_message.Message): - __slots__ = ("data_movement_id",) - DATA_MOVEMENT_ID_FIELD_NUMBER: _ClassVar[int] - data_movement_id: str - def __init__(self, data_movement_id: _Optional[str] = ...) -> None: ... - -class DeleteDataMovementInterfaceRequest(_message.Message): - __slots__ = ("compute_resource_id", "data_movement_id") - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - DATA_MOVEMENT_ID_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - data_movement_id: str - def __init__(self, compute_resource_id: _Optional[str] = ..., data_movement_id: _Optional[str] = ...) -> None: ... - -class DeleteBatchQueueRequest(_message.Message): - __slots__ = ("compute_resource_id", "queue_name") - COMPUTE_RESOURCE_ID_FIELD_NUMBER: _ClassVar[int] - QUEUE_NAME_FIELD_NUMBER: _ClassVar[int] - compute_resource_id: str - queue_name: str - def __init__(self, compute_resource_id: _Optional[str] = ..., queue_name: _Optional[str] = ...) -> None: ... diff --git a/airavata-python-sdk/airavata_sdk/generated/services/resource_service_pb2_grpc.py b/airavata-python-sdk/airavata_sdk/generated/services/resource_service_pb2_grpc.py deleted file mode 100644 index 68ff764264d..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/resource_service_pb2_grpc.py +++ /dev/null @@ -1,1579 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings - -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.appcatalog.computeresource import compute_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2 -from org.apache.airavata.model.appcatalog.storageresource import storage_resource_pb2 as org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_storageresource_dot_storage__resource__pb2 -from org.apache.airavata.model.data.movement import data_movement_pb2 as org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2 -from services import resource_service_pb2 as services_dot_resource__service__pb2 - -GRPC_GENERATED_VERSION = '1.80.0' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False - -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True - -if _version_not_supported: - raise RuntimeError( - f'The grpc package installed is at version {GRPC_VERSION},' - + ' but the generated code in services/resource_service_pb2_grpc.py depends on' - + f' grpcio>={GRPC_GENERATED_VERSION}.' - + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' - + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' - ) - - -class ResourceServiceStub(object): - """ResourceService provides RPCs for managing compute resources, storage resources, - job submissions, and data movements. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.RegisterComputeResource = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/RegisterComputeResource', - request_serializer=services_dot_resource__service__pb2.RegisterComputeResourceRequest.SerializeToString, - response_deserializer=services_dot_resource__service__pb2.RegisterComputeResourceResponse.FromString, - _registered_method=True) - self.GetComputeResource = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/GetComputeResource', - request_serializer=services_dot_resource__service__pb2.GetComputeResourceRequest.SerializeToString, - response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.ComputeResourceDescription.FromString, - _registered_method=True) - self.UpdateComputeResource = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/UpdateComputeResource', - request_serializer=services_dot_resource__service__pb2.UpdateComputeResourceRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.DeleteComputeResource = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/DeleteComputeResource', - request_serializer=services_dot_resource__service__pb2.DeleteComputeResourceRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.GetAllComputeResourceNames = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/GetAllComputeResourceNames', - request_serializer=services_dot_resource__service__pb2.GetAllComputeResourceNamesRequest.SerializeToString, - response_deserializer=services_dot_resource__service__pb2.GetAllComputeResourceNamesResponse.FromString, - _registered_method=True) - self.RegisterStorageResource = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/RegisterStorageResource', - request_serializer=services_dot_resource__service__pb2.RegisterStorageResourceRequest.SerializeToString, - response_deserializer=services_dot_resource__service__pb2.RegisterStorageResourceResponse.FromString, - _registered_method=True) - self.GetStorageResource = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/GetStorageResource', - request_serializer=services_dot_resource__service__pb2.GetStorageResourceRequest.SerializeToString, - response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_storageresource_dot_storage__resource__pb2.StorageResourceDescription.FromString, - _registered_method=True) - self.UpdateStorageResource = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/UpdateStorageResource', - request_serializer=services_dot_resource__service__pb2.UpdateStorageResourceRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.DeleteStorageResource = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/DeleteStorageResource', - request_serializer=services_dot_resource__service__pb2.DeleteStorageResourceRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.GetAllStorageResourceNames = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/GetAllStorageResourceNames', - request_serializer=services_dot_resource__service__pb2.GetAllStorageResourceNamesRequest.SerializeToString, - response_deserializer=services_dot_resource__service__pb2.GetAllStorageResourceNamesResponse.FromString, - _registered_method=True) - self.AddLocalSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/AddLocalSubmission', - request_serializer=services_dot_resource__service__pb2.AddLocalSubmissionRequest.SerializeToString, - response_deserializer=services_dot_resource__service__pb2.AddLocalSubmissionResponse.FromString, - _registered_method=True) - self.UpdateLocalSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/UpdateLocalSubmission', - request_serializer=services_dot_resource__service__pb2.UpdateLocalSubmissionRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.GetLocalJobSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/GetLocalJobSubmission', - request_serializer=services_dot_resource__service__pb2.GetLocalJobSubmissionRequest.SerializeToString, - response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.LOCALSubmission.FromString, - _registered_method=True) - self.AddSSHJobSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/AddSSHJobSubmission', - request_serializer=services_dot_resource__service__pb2.AddSSHJobSubmissionRequest.SerializeToString, - response_deserializer=services_dot_resource__service__pb2.AddSSHJobSubmissionResponse.FromString, - _registered_method=True) - self.AddSSHForkJobSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/AddSSHForkJobSubmission', - request_serializer=services_dot_resource__service__pb2.AddSSHForkJobSubmissionRequest.SerializeToString, - response_deserializer=services_dot_resource__service__pb2.AddSSHForkJobSubmissionResponse.FromString, - _registered_method=True) - self.GetSSHJobSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/GetSSHJobSubmission', - request_serializer=services_dot_resource__service__pb2.GetSSHJobSubmissionRequest.SerializeToString, - response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.SSHJobSubmission.FromString, - _registered_method=True) - self.UpdateSSHJobSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/UpdateSSHJobSubmission', - request_serializer=services_dot_resource__service__pb2.UpdateSSHJobSubmissionRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.AddCloudJobSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/AddCloudJobSubmission', - request_serializer=services_dot_resource__service__pb2.AddCloudJobSubmissionRequest.SerializeToString, - response_deserializer=services_dot_resource__service__pb2.AddCloudJobSubmissionResponse.FromString, - _registered_method=True) - self.GetCloudJobSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/GetCloudJobSubmission', - request_serializer=services_dot_resource__service__pb2.GetCloudJobSubmissionRequest.SerializeToString, - response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.CloudJobSubmission.FromString, - _registered_method=True) - self.UpdateCloudJobSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/UpdateCloudJobSubmission', - request_serializer=services_dot_resource__service__pb2.UpdateCloudJobSubmissionRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.AddUnicoreJobSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/AddUnicoreJobSubmission', - request_serializer=services_dot_resource__service__pb2.AddUnicoreJobSubmissionRequest.SerializeToString, - response_deserializer=services_dot_resource__service__pb2.AddUnicoreJobSubmissionResponse.FromString, - _registered_method=True) - self.GetUnicoreJobSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/GetUnicoreJobSubmission', - request_serializer=services_dot_resource__service__pb2.GetUnicoreJobSubmissionRequest.SerializeToString, - response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.UnicoreJobSubmission.FromString, - _registered_method=True) - self.UpdateUnicoreJobSubmission = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/UpdateUnicoreJobSubmission', - request_serializer=services_dot_resource__service__pb2.UpdateUnicoreJobSubmissionRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.DeleteJobSubmissionInterface = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/DeleteJobSubmissionInterface', - request_serializer=services_dot_resource__service__pb2.DeleteJobSubmissionInterfaceRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.AddLocalDataMovement = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/AddLocalDataMovement', - request_serializer=services_dot_resource__service__pb2.AddLocalDataMovementRequest.SerializeToString, - response_deserializer=services_dot_resource__service__pb2.AddLocalDataMovementResponse.FromString, - _registered_method=True) - self.UpdateLocalDataMovement = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/UpdateLocalDataMovement', - request_serializer=services_dot_resource__service__pb2.UpdateLocalDataMovementRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.GetLocalDataMovement = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/GetLocalDataMovement', - request_serializer=services_dot_resource__service__pb2.GetLocalDataMovementRequest.SerializeToString, - response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2.LOCALDataMovement.FromString, - _registered_method=True) - self.AddSCPDataMovement = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/AddSCPDataMovement', - request_serializer=services_dot_resource__service__pb2.AddSCPDataMovementRequest.SerializeToString, - response_deserializer=services_dot_resource__service__pb2.AddSCPDataMovementResponse.FromString, - _registered_method=True) - self.UpdateSCPDataMovement = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/UpdateSCPDataMovement', - request_serializer=services_dot_resource__service__pb2.UpdateSCPDataMovementRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.GetSCPDataMovement = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/GetSCPDataMovement', - request_serializer=services_dot_resource__service__pb2.GetSCPDataMovementRequest.SerializeToString, - response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2.SCPDataMovement.FromString, - _registered_method=True) - self.AddGridFTPDataMovement = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/AddGridFTPDataMovement', - request_serializer=services_dot_resource__service__pb2.AddGridFTPDataMovementRequest.SerializeToString, - response_deserializer=services_dot_resource__service__pb2.AddGridFTPDataMovementResponse.FromString, - _registered_method=True) - self.UpdateGridFTPDataMovement = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/UpdateGridFTPDataMovement', - request_serializer=services_dot_resource__service__pb2.UpdateGridFTPDataMovementRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.GetGridFTPDataMovement = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/GetGridFTPDataMovement', - request_serializer=services_dot_resource__service__pb2.GetGridFTPDataMovementRequest.SerializeToString, - response_deserializer=org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2.GridFTPDataMovement.FromString, - _registered_method=True) - self.DeleteDataMovementInterface = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/DeleteDataMovementInterface', - request_serializer=services_dot_resource__service__pb2.DeleteDataMovementInterfaceRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - self.DeleteBatchQueue = channel.unary_unary( - '/org.apache.airavata.api.resource.ResourceService/DeleteBatchQueue', - request_serializer=services_dot_resource__service__pb2.DeleteBatchQueueRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - _registered_method=True) - - -class ResourceServiceServicer(object): - """ResourceService provides RPCs for managing compute resources, storage resources, - job submissions, and data movements. - """ - - def RegisterComputeResource(self, request, context): - """--- Compute Resources --- - - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetComputeResource(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateComputeResource(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteComputeResource(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetAllComputeResourceNames(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def RegisterStorageResource(self, request, context): - """--- Storage Resources --- - - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetStorageResource(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateStorageResource(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteStorageResource(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetAllStorageResourceNames(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def AddLocalSubmission(self, request, context): - """--- Job Submissions --- - - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateLocalSubmission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetLocalJobSubmission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def AddSSHJobSubmission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def AddSSHForkJobSubmission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetSSHJobSubmission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateSSHJobSubmission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def AddCloudJobSubmission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetCloudJobSubmission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateCloudJobSubmission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def AddUnicoreJobSubmission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetUnicoreJobSubmission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateUnicoreJobSubmission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteJobSubmissionInterface(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def AddLocalDataMovement(self, request, context): - """--- Data Movements --- - - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateLocalDataMovement(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetLocalDataMovement(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def AddSCPDataMovement(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateSCPDataMovement(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetSCPDataMovement(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def AddGridFTPDataMovement(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateGridFTPDataMovement(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetGridFTPDataMovement(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteDataMovementInterface(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteBatchQueue(self, request, context): - """--- Batch Queue --- - - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ResourceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'RegisterComputeResource': grpc.unary_unary_rpc_method_handler( - servicer.RegisterComputeResource, - request_deserializer=services_dot_resource__service__pb2.RegisterComputeResourceRequest.FromString, - response_serializer=services_dot_resource__service__pb2.RegisterComputeResourceResponse.SerializeToString, - ), - 'GetComputeResource': grpc.unary_unary_rpc_method_handler( - servicer.GetComputeResource, - request_deserializer=services_dot_resource__service__pb2.GetComputeResourceRequest.FromString, - response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.ComputeResourceDescription.SerializeToString, - ), - 'UpdateComputeResource': grpc.unary_unary_rpc_method_handler( - servicer.UpdateComputeResource, - request_deserializer=services_dot_resource__service__pb2.UpdateComputeResourceRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'DeleteComputeResource': grpc.unary_unary_rpc_method_handler( - servicer.DeleteComputeResource, - request_deserializer=services_dot_resource__service__pb2.DeleteComputeResourceRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'GetAllComputeResourceNames': grpc.unary_unary_rpc_method_handler( - servicer.GetAllComputeResourceNames, - request_deserializer=services_dot_resource__service__pb2.GetAllComputeResourceNamesRequest.FromString, - response_serializer=services_dot_resource__service__pb2.GetAllComputeResourceNamesResponse.SerializeToString, - ), - 'RegisterStorageResource': grpc.unary_unary_rpc_method_handler( - servicer.RegisterStorageResource, - request_deserializer=services_dot_resource__service__pb2.RegisterStorageResourceRequest.FromString, - response_serializer=services_dot_resource__service__pb2.RegisterStorageResourceResponse.SerializeToString, - ), - 'GetStorageResource': grpc.unary_unary_rpc_method_handler( - servicer.GetStorageResource, - request_deserializer=services_dot_resource__service__pb2.GetStorageResourceRequest.FromString, - response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_storageresource_dot_storage__resource__pb2.StorageResourceDescription.SerializeToString, - ), - 'UpdateStorageResource': grpc.unary_unary_rpc_method_handler( - servicer.UpdateStorageResource, - request_deserializer=services_dot_resource__service__pb2.UpdateStorageResourceRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'DeleteStorageResource': grpc.unary_unary_rpc_method_handler( - servicer.DeleteStorageResource, - request_deserializer=services_dot_resource__service__pb2.DeleteStorageResourceRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'GetAllStorageResourceNames': grpc.unary_unary_rpc_method_handler( - servicer.GetAllStorageResourceNames, - request_deserializer=services_dot_resource__service__pb2.GetAllStorageResourceNamesRequest.FromString, - response_serializer=services_dot_resource__service__pb2.GetAllStorageResourceNamesResponse.SerializeToString, - ), - 'AddLocalSubmission': grpc.unary_unary_rpc_method_handler( - servicer.AddLocalSubmission, - request_deserializer=services_dot_resource__service__pb2.AddLocalSubmissionRequest.FromString, - response_serializer=services_dot_resource__service__pb2.AddLocalSubmissionResponse.SerializeToString, - ), - 'UpdateLocalSubmission': grpc.unary_unary_rpc_method_handler( - servicer.UpdateLocalSubmission, - request_deserializer=services_dot_resource__service__pb2.UpdateLocalSubmissionRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'GetLocalJobSubmission': grpc.unary_unary_rpc_method_handler( - servicer.GetLocalJobSubmission, - request_deserializer=services_dot_resource__service__pb2.GetLocalJobSubmissionRequest.FromString, - response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.LOCALSubmission.SerializeToString, - ), - 'AddSSHJobSubmission': grpc.unary_unary_rpc_method_handler( - servicer.AddSSHJobSubmission, - request_deserializer=services_dot_resource__service__pb2.AddSSHJobSubmissionRequest.FromString, - response_serializer=services_dot_resource__service__pb2.AddSSHJobSubmissionResponse.SerializeToString, - ), - 'AddSSHForkJobSubmission': grpc.unary_unary_rpc_method_handler( - servicer.AddSSHForkJobSubmission, - request_deserializer=services_dot_resource__service__pb2.AddSSHForkJobSubmissionRequest.FromString, - response_serializer=services_dot_resource__service__pb2.AddSSHForkJobSubmissionResponse.SerializeToString, - ), - 'GetSSHJobSubmission': grpc.unary_unary_rpc_method_handler( - servicer.GetSSHJobSubmission, - request_deserializer=services_dot_resource__service__pb2.GetSSHJobSubmissionRequest.FromString, - response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.SSHJobSubmission.SerializeToString, - ), - 'UpdateSSHJobSubmission': grpc.unary_unary_rpc_method_handler( - servicer.UpdateSSHJobSubmission, - request_deserializer=services_dot_resource__service__pb2.UpdateSSHJobSubmissionRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'AddCloudJobSubmission': grpc.unary_unary_rpc_method_handler( - servicer.AddCloudJobSubmission, - request_deserializer=services_dot_resource__service__pb2.AddCloudJobSubmissionRequest.FromString, - response_serializer=services_dot_resource__service__pb2.AddCloudJobSubmissionResponse.SerializeToString, - ), - 'GetCloudJobSubmission': grpc.unary_unary_rpc_method_handler( - servicer.GetCloudJobSubmission, - request_deserializer=services_dot_resource__service__pb2.GetCloudJobSubmissionRequest.FromString, - response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.CloudJobSubmission.SerializeToString, - ), - 'UpdateCloudJobSubmission': grpc.unary_unary_rpc_method_handler( - servicer.UpdateCloudJobSubmission, - request_deserializer=services_dot_resource__service__pb2.UpdateCloudJobSubmissionRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'AddUnicoreJobSubmission': grpc.unary_unary_rpc_method_handler( - servicer.AddUnicoreJobSubmission, - request_deserializer=services_dot_resource__service__pb2.AddUnicoreJobSubmissionRequest.FromString, - response_serializer=services_dot_resource__service__pb2.AddUnicoreJobSubmissionResponse.SerializeToString, - ), - 'GetUnicoreJobSubmission': grpc.unary_unary_rpc_method_handler( - servicer.GetUnicoreJobSubmission, - request_deserializer=services_dot_resource__service__pb2.GetUnicoreJobSubmissionRequest.FromString, - response_serializer=org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.UnicoreJobSubmission.SerializeToString, - ), - 'UpdateUnicoreJobSubmission': grpc.unary_unary_rpc_method_handler( - servicer.UpdateUnicoreJobSubmission, - request_deserializer=services_dot_resource__service__pb2.UpdateUnicoreJobSubmissionRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'DeleteJobSubmissionInterface': grpc.unary_unary_rpc_method_handler( - servicer.DeleteJobSubmissionInterface, - request_deserializer=services_dot_resource__service__pb2.DeleteJobSubmissionInterfaceRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'AddLocalDataMovement': grpc.unary_unary_rpc_method_handler( - servicer.AddLocalDataMovement, - request_deserializer=services_dot_resource__service__pb2.AddLocalDataMovementRequest.FromString, - response_serializer=services_dot_resource__service__pb2.AddLocalDataMovementResponse.SerializeToString, - ), - 'UpdateLocalDataMovement': grpc.unary_unary_rpc_method_handler( - servicer.UpdateLocalDataMovement, - request_deserializer=services_dot_resource__service__pb2.UpdateLocalDataMovementRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'GetLocalDataMovement': grpc.unary_unary_rpc_method_handler( - servicer.GetLocalDataMovement, - request_deserializer=services_dot_resource__service__pb2.GetLocalDataMovementRequest.FromString, - response_serializer=org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2.LOCALDataMovement.SerializeToString, - ), - 'AddSCPDataMovement': grpc.unary_unary_rpc_method_handler( - servicer.AddSCPDataMovement, - request_deserializer=services_dot_resource__service__pb2.AddSCPDataMovementRequest.FromString, - response_serializer=services_dot_resource__service__pb2.AddSCPDataMovementResponse.SerializeToString, - ), - 'UpdateSCPDataMovement': grpc.unary_unary_rpc_method_handler( - servicer.UpdateSCPDataMovement, - request_deserializer=services_dot_resource__service__pb2.UpdateSCPDataMovementRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'GetSCPDataMovement': grpc.unary_unary_rpc_method_handler( - servicer.GetSCPDataMovement, - request_deserializer=services_dot_resource__service__pb2.GetSCPDataMovementRequest.FromString, - response_serializer=org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2.SCPDataMovement.SerializeToString, - ), - 'AddGridFTPDataMovement': grpc.unary_unary_rpc_method_handler( - servicer.AddGridFTPDataMovement, - request_deserializer=services_dot_resource__service__pb2.AddGridFTPDataMovementRequest.FromString, - response_serializer=services_dot_resource__service__pb2.AddGridFTPDataMovementResponse.SerializeToString, - ), - 'UpdateGridFTPDataMovement': grpc.unary_unary_rpc_method_handler( - servicer.UpdateGridFTPDataMovement, - request_deserializer=services_dot_resource__service__pb2.UpdateGridFTPDataMovementRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'GetGridFTPDataMovement': grpc.unary_unary_rpc_method_handler( - servicer.GetGridFTPDataMovement, - request_deserializer=services_dot_resource__service__pb2.GetGridFTPDataMovementRequest.FromString, - response_serializer=org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2.GridFTPDataMovement.SerializeToString, - ), - 'DeleteDataMovementInterface': grpc.unary_unary_rpc_method_handler( - servicer.DeleteDataMovementInterface, - request_deserializer=services_dot_resource__service__pb2.DeleteDataMovementInterfaceRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'DeleteBatchQueue': grpc.unary_unary_rpc_method_handler( - servicer.DeleteBatchQueue, - request_deserializer=services_dot_resource__service__pb2.DeleteBatchQueueRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'org.apache.airavata.api.resource.ResourceService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('org.apache.airavata.api.resource.ResourceService', rpc_method_handlers) - - - # This class is part of an EXPERIMENTAL API. -class ResourceService(object): - """ResourceService provides RPCs for managing compute resources, storage resources, - job submissions, and data movements. - """ - - @staticmethod - def RegisterComputeResource(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/RegisterComputeResource', - services_dot_resource__service__pb2.RegisterComputeResourceRequest.SerializeToString, - services_dot_resource__service__pb2.RegisterComputeResourceResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetComputeResource(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/GetComputeResource', - services_dot_resource__service__pb2.GetComputeResourceRequest.SerializeToString, - org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.ComputeResourceDescription.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def UpdateComputeResource(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/UpdateComputeResource', - services_dot_resource__service__pb2.UpdateComputeResourceRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def DeleteComputeResource(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/DeleteComputeResource', - services_dot_resource__service__pb2.DeleteComputeResourceRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetAllComputeResourceNames(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/GetAllComputeResourceNames', - services_dot_resource__service__pb2.GetAllComputeResourceNamesRequest.SerializeToString, - services_dot_resource__service__pb2.GetAllComputeResourceNamesResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def RegisterStorageResource(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/RegisterStorageResource', - services_dot_resource__service__pb2.RegisterStorageResourceRequest.SerializeToString, - services_dot_resource__service__pb2.RegisterStorageResourceResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetStorageResource(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/GetStorageResource', - services_dot_resource__service__pb2.GetStorageResourceRequest.SerializeToString, - org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_storageresource_dot_storage__resource__pb2.StorageResourceDescription.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def UpdateStorageResource(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/UpdateStorageResource', - services_dot_resource__service__pb2.UpdateStorageResourceRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def DeleteStorageResource(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/DeleteStorageResource', - services_dot_resource__service__pb2.DeleteStorageResourceRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetAllStorageResourceNames(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/GetAllStorageResourceNames', - services_dot_resource__service__pb2.GetAllStorageResourceNamesRequest.SerializeToString, - services_dot_resource__service__pb2.GetAllStorageResourceNamesResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def AddLocalSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/AddLocalSubmission', - services_dot_resource__service__pb2.AddLocalSubmissionRequest.SerializeToString, - services_dot_resource__service__pb2.AddLocalSubmissionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def UpdateLocalSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/UpdateLocalSubmission', - services_dot_resource__service__pb2.UpdateLocalSubmissionRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetLocalJobSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/GetLocalJobSubmission', - services_dot_resource__service__pb2.GetLocalJobSubmissionRequest.SerializeToString, - org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.LOCALSubmission.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def AddSSHJobSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/AddSSHJobSubmission', - services_dot_resource__service__pb2.AddSSHJobSubmissionRequest.SerializeToString, - services_dot_resource__service__pb2.AddSSHJobSubmissionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def AddSSHForkJobSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/AddSSHForkJobSubmission', - services_dot_resource__service__pb2.AddSSHForkJobSubmissionRequest.SerializeToString, - services_dot_resource__service__pb2.AddSSHForkJobSubmissionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetSSHJobSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/GetSSHJobSubmission', - services_dot_resource__service__pb2.GetSSHJobSubmissionRequest.SerializeToString, - org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.SSHJobSubmission.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def UpdateSSHJobSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/UpdateSSHJobSubmission', - services_dot_resource__service__pb2.UpdateSSHJobSubmissionRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def AddCloudJobSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/AddCloudJobSubmission', - services_dot_resource__service__pb2.AddCloudJobSubmissionRequest.SerializeToString, - services_dot_resource__service__pb2.AddCloudJobSubmissionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetCloudJobSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/GetCloudJobSubmission', - services_dot_resource__service__pb2.GetCloudJobSubmissionRequest.SerializeToString, - org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.CloudJobSubmission.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def UpdateCloudJobSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/UpdateCloudJobSubmission', - services_dot_resource__service__pb2.UpdateCloudJobSubmissionRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def AddUnicoreJobSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/AddUnicoreJobSubmission', - services_dot_resource__service__pb2.AddUnicoreJobSubmissionRequest.SerializeToString, - services_dot_resource__service__pb2.AddUnicoreJobSubmissionResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetUnicoreJobSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/GetUnicoreJobSubmission', - services_dot_resource__service__pb2.GetUnicoreJobSubmissionRequest.SerializeToString, - org_dot_apache_dot_airavata_dot_model_dot_appcatalog_dot_computeresource_dot_compute__resource__pb2.UnicoreJobSubmission.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def UpdateUnicoreJobSubmission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/UpdateUnicoreJobSubmission', - services_dot_resource__service__pb2.UpdateUnicoreJobSubmissionRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def DeleteJobSubmissionInterface(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/DeleteJobSubmissionInterface', - services_dot_resource__service__pb2.DeleteJobSubmissionInterfaceRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def AddLocalDataMovement(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/AddLocalDataMovement', - services_dot_resource__service__pb2.AddLocalDataMovementRequest.SerializeToString, - services_dot_resource__service__pb2.AddLocalDataMovementResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def UpdateLocalDataMovement(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/UpdateLocalDataMovement', - services_dot_resource__service__pb2.UpdateLocalDataMovementRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetLocalDataMovement(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/GetLocalDataMovement', - services_dot_resource__service__pb2.GetLocalDataMovementRequest.SerializeToString, - org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2.LOCALDataMovement.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def AddSCPDataMovement(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/AddSCPDataMovement', - services_dot_resource__service__pb2.AddSCPDataMovementRequest.SerializeToString, - services_dot_resource__service__pb2.AddSCPDataMovementResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def UpdateSCPDataMovement(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/UpdateSCPDataMovement', - services_dot_resource__service__pb2.UpdateSCPDataMovementRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetSCPDataMovement(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/GetSCPDataMovement', - services_dot_resource__service__pb2.GetSCPDataMovementRequest.SerializeToString, - org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2.SCPDataMovement.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def AddGridFTPDataMovement(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/AddGridFTPDataMovement', - services_dot_resource__service__pb2.AddGridFTPDataMovementRequest.SerializeToString, - services_dot_resource__service__pb2.AddGridFTPDataMovementResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def UpdateGridFTPDataMovement(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/UpdateGridFTPDataMovement', - services_dot_resource__service__pb2.UpdateGridFTPDataMovementRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetGridFTPDataMovement(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/GetGridFTPDataMovement', - services_dot_resource__service__pb2.GetGridFTPDataMovementRequest.SerializeToString, - org_dot_apache_dot_airavata_dot_model_dot_data_dot_movement_dot_data__movement__pb2.GridFTPDataMovement.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def DeleteDataMovementInterface(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/DeleteDataMovementInterface', - services_dot_resource__service__pb2.DeleteDataMovementInterfaceRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def DeleteBatchQueue(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/org.apache.airavata.api.resource.ResourceService/DeleteBatchQueue', - services_dot_resource__service__pb2.DeleteBatchQueueRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/sharing_service_pb2.py b/airavata-python-sdk/airavata_sdk/generated/services/sharing_service_pb2.py deleted file mode 100644 index 43ad54f4f4e..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/sharing_service_pb2.py +++ /dev/null @@ -1,380 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: services/sharing_service.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'services/sharing_service.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.sharing import sharing_pb2 as org_dot_apache_dot_airavata_dot_model_dot_sharing_dot_sharing__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1eservices/sharing_service.proto\x12#org.apache.airavata.api.iam.sharing\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a/org/apache/airavata/model/sharing/sharing.proto\"\xdf\x01\n\x1dShareResourceWithUsersRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12q\n\x10user_permissions\x18\x02 \x03(\x0b\x32W.org.apache.airavata.api.iam.sharing.ShareResourceWithUsersRequest.UserPermissionsEntry\x1a\x36\n\x14UserPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe4\x01\n\x1eShareResourceWithGroupsRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12t\n\x11group_permissions\x18\x02 \x03(\x0b\x32Y.org.apache.airavata.api.iam.sharing.ShareResourceWithGroupsRequest.GroupPermissionsEntry\x1a\x37\n\x15GroupPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd1\x01\n\x16RevokeFromUsersRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12j\n\x10user_permissions\x18\x02 \x03(\x0b\x32P.org.apache.airavata.api.iam.sharing.RevokeFromUsersRequest.UserPermissionsEntry\x1a\x36\n\x14UserPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd6\x01\n\x17RevokeFromGroupsRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12m\n\x11group_permissions\x18\x02 \x03(\x0b\x32R.org.apache.airavata.api.iam.sharing.RevokeFromGroupsRequest.GroupPermissionsEntry\x1a\x37\n\x15GroupPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"L\n\x1cGetAllAccessibleUsersRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12\x17\n\x0fpermission_type\x18\x02 \x01(\t\"1\n\x1dGetAllAccessibleUsersResponse\x12\x10\n\x08user_ids\x18\x01 \x03(\t\"T\n$GetAllDirectlyAccessibleUsersRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12\x17\n\x0fpermission_type\x18\x02 \x01(\t\"9\n%GetAllDirectlyAccessibleUsersResponse\x12\x10\n\x08user_ids\x18\x01 \x03(\t\"M\n\x1dGetAllAccessibleGroupsRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12\x17\n\x0fpermission_type\x18\x02 \x01(\t\"3\n\x1eGetAllAccessibleGroupsResponse\x12\x11\n\tgroup_ids\x18\x01 \x03(\t\"U\n%GetAllDirectlyAccessibleGroupsRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12\x17\n\x0fpermission_type\x18\x02 \x01(\t\";\n&GetAllDirectlyAccessibleGroupsResponse\x12\x11\n\tgroup_ids\x18\x01 \x03(\t\"U\n\x14UserHasAccessRequest\x12\x13\n\x0bresource_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\x12\x17\n\x0fpermission_type\x18\x03 \x01(\t\"+\n\x15UserHasAccessResponse\x12\x12\n\nhas_access\x18\x01 \x01(\x08\"Z\n\x13\x43reateDomainRequest\x12\x43\n\x06\x64omain\x18\x01 \x01(\x0b\x32\x33.org.apache.airavata.sharing.registry.models.Domain\")\n\x14\x43reateDomainResponse\x12\x11\n\tdomain_id\x18\x01 \x01(\t\"Z\n\x13UpdateDomainRequest\x12\x43\n\x06\x64omain\x18\x01 \x01(\x0b\x32\x33.org.apache.airavata.sharing.registry.models.Domain\"*\n\x15IsDomainExistsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\"(\n\x16IsDomainExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"(\n\x13\x44\x65leteDomainRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\"%\n\x10GetDomainRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\"2\n\x11GetDomainsRequest\x12\x0e\n\x06offset\x18\x01 \x01(\x05\x12\r\n\x05limit\x18\x02 \x01(\x05\"Z\n\x12GetDomainsResponse\x12\x44\n\x07\x64omains\x18\x01 \x03(\x0b\x32\x33.org.apache.airavata.sharing.registry.models.Domain\"T\n\x11\x43reateUserRequest\x12?\n\x04user\x18\x01 \x01(\x0b\x32\x31.org.apache.airavata.sharing.registry.models.User\"%\n\x12\x43reateUserResponse\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"T\n\x11UpdateUserRequest\x12?\n\x04user\x18\x01 \x01(\x0b\x32\x31.org.apache.airavata.sharing.registry.models.User\"9\n\x13IsUserExistsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\"&\n\x14IsUserExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"7\n\x11\x44\x65leteUserRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\"4\n\x0eGetUserRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\"C\n\x0fGetUsersRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\r\n\x05limit\x18\x03 \x01(\x05\"T\n\x10GetUsersResponse\x12@\n\x05users\x18\x01 \x03(\x0b\x32\x31.org.apache.airavata.sharing.registry.models.User\"[\n\x12\x43reateGroupRequest\x12\x45\n\x05group\x18\x01 \x01(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\"\'\n\x13\x43reateGroupResponse\x12\x10\n\x08group_id\x18\x01 \x01(\t\"[\n\x12UpdateGroupRequest\x12\x45\n\x05group\x18\x01 \x01(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\";\n\x14IsGroupExistsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\"\'\n\x15IsGroupExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"9\n\x12\x44\x65leteGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\"6\n\x0fGetGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\"D\n\x10GetGroupsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\r\n\x05limit\x18\x03 \x01(\x05\"[\n\x11GetGroupsResponse\x12\x46\n\x06groups\x18\x01 \x03(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\"O\n\x16\x41\x64\x64UsersToGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08user_ids\x18\x02 \x03(\t\x12\x10\n\x08group_id\x18\x03 \x01(\t\"T\n\x1bRemoveUsersFromGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08user_ids\x18\x02 \x03(\t\x12\x10\n\x08group_id\x18\x03 \x01(\t\"Z\n\x1dTransferGroupOwnershipRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x14\n\x0cnew_owner_id\x18\x03 \x01(\t\"O\n\x15\x41\x64\x64GroupAdminsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x11\n\tadmin_ids\x18\x03 \x03(\t\"R\n\x18RemoveGroupAdminsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x11\n\tadmin_ids\x18\x03 \x03(\t\"N\n\x15HasAdminAccessRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x10\n\x08\x61\x64min_id\x18\x03 \x01(\t\",\n\x16HasAdminAccessResponse\x12\x12\n\nhas_access\x18\x01 \x01(\x08\"N\n\x15HasOwnerAccessRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x10\n\x08owner_id\x18\x03 \x01(\t\",\n\x16HasOwnerAccessResponse\x12\x12\n\nhas_access\x18\x01 \x01(\x08\"f\n GetGroupMembersOfTypeUserRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x0e\n\x06offset\x18\x03 \x01(\x05\x12\r\n\x05limit\x18\x04 \x01(\x05\"e\n!GetGroupMembersOfTypeUserResponse\x12@\n\x05users\x18\x01 \x03(\x0b\x32\x31.org.apache.airavata.sharing.registry.models.User\"g\n!GetGroupMembersOfTypeGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08group_id\x18\x02 \x01(\t\x12\x0e\n\x06offset\x18\x03 \x01(\x05\x12\r\n\x05limit\x18\x04 \x01(\x05\"l\n\"GetGroupMembersOfTypeGroupResponse\x12\x46\n\x06groups\x18\x01 \x03(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\"\\\n\"AddChildGroupsToParentGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tchild_ids\x18\x02 \x03(\t\x12\x10\n\x08group_id\x18\x03 \x01(\t\"_\n&RemoveChildGroupFromParentGroupRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x10\n\x08\x63hild_id\x18\x02 \x01(\t\x12\x10\n\x08group_id\x18\x03 \x01(\t\"F\n GetAllMemberGroupsForUserRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\"k\n!GetAllMemberGroupsForUserResponse\x12\x46\n\x06groups\x18\x01 \x03(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\"g\n\x17\x43reateEntityTypeRequest\x12L\n\x0b\x65ntity_type\x18\x01 \x01(\x0b\x32\x37.org.apache.airavata.sharing.registry.models.EntityType\"2\n\x18\x43reateEntityTypeResponse\x12\x16\n\x0e\x65ntity_type_id\x18\x01 \x01(\t\"g\n\x17UpdateEntityTypeRequest\x12L\n\x0b\x65ntity_type\x18\x01 \x01(\x0b\x32\x37.org.apache.airavata.sharing.registry.models.EntityType\"F\n\x19IsEntityTypeExistsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x16\n\x0e\x65ntity_type_id\x18\x02 \x01(\t\",\n\x1aIsEntityTypeExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"D\n\x17\x44\x65leteEntityTypeRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x16\n\x0e\x65ntity_type_id\x18\x02 \x01(\t\"A\n\x14GetEntityTypeRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x16\n\x0e\x65ntity_type_id\x18\x02 \x01(\t\"I\n\x15GetEntityTypesRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\r\n\x05limit\x18\x03 \x01(\x05\"g\n\x16GetEntityTypesResponse\x12M\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32\x37.org.apache.airavata.sharing.registry.models.EntityType\"Z\n\x13\x43reateEntityRequest\x12\x43\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x33.org.apache.airavata.sharing.registry.models.Entity\")\n\x14\x43reateEntityResponse\x12\x11\n\tentity_id\x18\x01 \x01(\t\"Z\n\x13UpdateEntityRequest\x12\x43\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x33.org.apache.airavata.sharing.registry.models.Entity\"=\n\x15IsEntityExistsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\"(\n\x16IsEntityExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\";\n\x13\x44\x65leteEntityRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\"8\n\x10GetEntityRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\"\xa8\x01\n\x15SearchEntitiesRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\x12L\n\x07\x66ilters\x18\x03 \x03(\x0b\x32;.org.apache.airavata.sharing.registry.models.SearchCriteria\x12\x0e\n\x06offset\x18\x04 \x01(\x05\x12\r\n\x05limit\x18\x05 \x01(\x05\"_\n\x16SearchEntitiesResponse\x12\x45\n\x08\x65ntities\x18\x01 \x03(\x0b\x32\x33.org.apache.airavata.sharing.registry.models.Entity\"_\n\x1bGetListOfSharedUsersRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x1a\n\x12permission_type_id\x18\x03 \x01(\t\"`\n\x1cGetListOfSharedUsersResponse\x12@\n\x05users\x18\x01 \x03(\x0b\x32\x31.org.apache.airavata.sharing.registry.models.User\"g\n#GetListOfDirectlySharedUsersRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x1a\n\x12permission_type_id\x18\x03 \x01(\t\"h\n$GetListOfDirectlySharedUsersResponse\x12@\n\x05users\x18\x01 \x03(\x0b\x32\x31.org.apache.airavata.sharing.registry.models.User\"`\n\x1cGetListOfSharedGroupsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x1a\n\x12permission_type_id\x18\x03 \x01(\t\"g\n\x1dGetListOfSharedGroupsResponse\x12\x46\n\x06groups\x18\x01 \x03(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\"h\n$GetListOfDirectlySharedGroupsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x1a\n\x12permission_type_id\x18\x03 \x01(\t\"o\n%GetListOfDirectlySharedGroupsResponse\x12\x46\n\x06groups\x18\x01 \x03(\x0b\x32\x36.org.apache.airavata.sharing.registry.models.UserGroup\"s\n\x1b\x43reatePermissionTypeRequest\x12T\n\x0fpermission_type\x18\x01 \x01(\x0b\x32;.org.apache.airavata.sharing.registry.models.PermissionType\":\n\x1c\x43reatePermissionTypeResponse\x12\x1a\n\x12permission_type_id\x18\x01 \x01(\t\"s\n\x1bUpdatePermissionTypeRequest\x12T\n\x0fpermission_type\x18\x01 \x01(\x0b\x32;.org.apache.airavata.sharing.registry.models.PermissionType\"E\n\x19IsPermissionExistsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x15\n\rpermission_id\x18\x02 \x01(\t\",\n\x1aIsPermissionExistsResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"L\n\x1b\x44\x65letePermissionTypeRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x1a\n\x12permission_type_id\x18\x02 \x01(\t\"I\n\x18GetPermissionTypeRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x1a\n\x12permission_type_id\x18\x02 \x01(\t\"M\n\x19GetPermissionTypesRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\r\n\x05limit\x18\x03 \x01(\x05\"s\n\x1aGetPermissionTypesResponse\x12U\n\x10permission_types\x18\x01 \x03(\x0b\x32;.org.apache.airavata.sharing.registry.models.PermissionType\"\x8e\x01\n\x1bShareEntityWithUsersRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x11\n\tuser_list\x18\x03 \x03(\t\x12\x1a\n\x12permission_type_id\x18\x04 \x01(\t\x12\x1a\n\x12\x63\x61scade_permission\x18\x05 \x01(\x08\"z\n#RevokeEntitySharingFromUsersRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x11\n\tuser_list\x18\x03 \x03(\t\x12\x1a\n\x12permission_type_id\x18\x04 \x01(\t\"\x90\x01\n\x1cShareEntityWithGroupsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x12\n\ngroup_list\x18\x03 \x03(\t\x12\x1a\n\x12permission_type_id\x18\x04 \x01(\t\x12\x1a\n\x12\x63\x61scade_permission\x18\x05 \x01(\x08\"|\n$RevokeEntitySharingFromGroupsRequest\x12\x11\n\tdomain_id\x18\x01 \x01(\t\x12\x11\n\tentity_id\x18\x02 \x01(\t\x12\x12\n\ngroup_list\x18\x03 \x03(\t\x12\x1a\n\x12permission_type_id\x18\x04 \x01(\t2\xc4\x63\n\x0eSharingService\x12\xa4\x01\n\x16ShareResourceWithUsers\x12\x42.org.apache.airavata.api.iam.sharing.ShareResourceWithUsersRequest\x1a\x16.google.protobuf.Empty\".\x82\xd3\xe4\x93\x02(\"#/api/v1/sharing/{resource_id}/users:\x01*\x12\xa7\x01\n\x17ShareResourceWithGroups\x12\x43.org.apache.airavata.api.iam.sharing.ShareResourceWithGroupsRequest\x1a\x16.google.protobuf.Empty\"/\x82\xd3\xe4\x93\x02)\"$/api/v1/sharing/{resource_id}/groups:\x01*\x12\x93\x01\n\x0fRevokeFromUsers\x12;.org.apache.airavata.api.iam.sharing.RevokeFromUsersRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%*#/api/v1/sharing/{resource_id}/users\x12\x96\x01\n\x10RevokeFromGroups\x12<.org.apache.airavata.api.iam.sharing.RevokeFromGroupsRequest\x1a\x16.google.protobuf.Empty\",\x82\xd3\xe4\x93\x02&*$/api/v1/sharing/{resource_id}/groups\x12\xcb\x01\n\x15GetAllAccessibleUsers\x12\x41.org.apache.airavata.api.iam.sharing.GetAllAccessibleUsersRequest\x1a\x42.org.apache.airavata.api.iam.sharing.GetAllAccessibleUsersResponse\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/sharing/{resource_id}/users\x12\xea\x01\n\x1dGetAllDirectlyAccessibleUsers\x12I.org.apache.airavata.api.iam.sharing.GetAllDirectlyAccessibleUsersRequest\x1aJ.org.apache.airavata.api.iam.sharing.GetAllDirectlyAccessibleUsersResponse\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/sharing/{resource_id}/users:direct\x12\xcf\x01\n\x16GetAllAccessibleGroups\x12\x42.org.apache.airavata.api.iam.sharing.GetAllAccessibleGroupsRequest\x1a\x43.org.apache.airavata.api.iam.sharing.GetAllAccessibleGroupsResponse\",\x82\xd3\xe4\x93\x02&\x12$/api/v1/sharing/{resource_id}/groups\x12\xee\x01\n\x1eGetAllDirectlyAccessibleGroups\x12J.org.apache.airavata.api.iam.sharing.GetAllDirectlyAccessibleGroupsRequest\x1aK.org.apache.airavata.api.iam.sharing.GetAllDirectlyAccessibleGroupsResponse\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/sharing/{resource_id}/groups:direct\x12\xc3\x01\n\rUserHasAccess\x12\x39.org.apache.airavata.api.iam.sharing.UserHasAccessRequest\x1a:.org.apache.airavata.api.iam.sharing.UserHasAccessResponse\";\x82\xd3\xe4\x93\x02\x35\x12\x33/api/v1/sharing/{resource_id}/users/{user_id}:check\x12\xa7\x01\n\x0c\x43reateDomain\x12\x38.org.apache.airavata.api.iam.sharing.CreateDomainRequest\x1a\x39.org.apache.airavata.api.iam.sharing.CreateDomainResponse\"\"\x82\xd3\xe4\x93\x02\x1c\"\x17/api/v1/sharing/domains:\x01*\x12\x97\x01\n\x0cUpdateDomain\x12\x38.org.apache.airavata.api.iam.sharing.UpdateDomainRequest\x1a\x16.google.protobuf.Empty\"5\x82\xd3\xe4\x93\x02/\x1a*/api/v1/sharing/domains/{domain.domain_id}:\x01*\x12\xbd\x01\n\x0eIsDomainExists\x12:.org.apache.airavata.api.iam.sharing.IsDomainExistsRequest\x1a;.org.apache.airavata.api.iam.sharing.IsDomainExistsResponse\"2\x82\xd3\xe4\x93\x02,\x12*/api/v1/sharing/domains/{domain_id}:exists\x12\x8d\x01\n\x0c\x44\x65leteDomain\x12\x38.org.apache.airavata.api.iam.sharing.DeleteDomainRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%*#/api/v1/sharing/domains/{domain_id}\x12\xa4\x01\n\tGetDomain\x12\x35.org.apache.airavata.api.iam.sharing.GetDomainRequest\x1a\x33.org.apache.airavata.sharing.registry.models.Domain\"+\x82\xd3\xe4\x93\x02%\x12#/api/v1/sharing/domains/{domain_id}\x12\x9e\x01\n\nGetDomains\x12\x36.org.apache.airavata.api.iam.sharing.GetDomainsRequest\x1a\x37.org.apache.airavata.api.iam.sharing.GetDomainsResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/api/v1/sharing/domains\x12\x9f\x01\n\nCreateUser\x12\x36.org.apache.airavata.api.iam.sharing.CreateUserRequest\x1a\x37.org.apache.airavata.api.iam.sharing.CreateUserResponse\" \x82\xd3\xe4\x93\x02\x1a\"\x15/api/v1/sharing/users:\x01*\x12\x8d\x01\n\nUpdateUser\x12\x36.org.apache.airavata.api.iam.sharing.UpdateUserRequest\x1a\x16.google.protobuf.Empty\"/\x82\xd3\xe4\x93\x02)\x1a$/api/v1/sharing/users/{user.user_id}:\x01*\x12\xc7\x01\n\x0cIsUserExists\x12\x38.org.apache.airavata.api.iam.sharing.IsUserExistsRequest\x1a\x39.org.apache.airavata.api.iam.sharing.IsUserExistsResponse\"B\x82\xd3\xe4\x93\x02<\x12:/api/v1/sharing/domains/{domain_id}/users/{user_id}:exists\x12\x99\x01\n\nDeleteUser\x12\x36.org.apache.airavata.api.iam.sharing.DeleteUserRequest\x1a\x16.google.protobuf.Empty\";\x82\xd3\xe4\x93\x02\x35*3/api/v1/sharing/domains/{domain_id}/users/{user_id}\x12\xae\x01\n\x07GetUser\x12\x33.org.apache.airavata.api.iam.sharing.GetUserRequest\x1a\x31.org.apache.airavata.sharing.registry.models.User\";\x82\xd3\xe4\x93\x02\x35\x12\x33/api/v1/sharing/domains/{domain_id}/users/{user_id}\x12\xaa\x01\n\x08GetUsers\x12\x34.org.apache.airavata.api.iam.sharing.GetUsersRequest\x1a\x35.org.apache.airavata.api.iam.sharing.GetUsersResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/sharing/domains/{domain_id}/users\x12\xa3\x01\n\x0b\x43reateGroup\x12\x37.org.apache.airavata.api.iam.sharing.CreateGroupRequest\x1a\x38.org.apache.airavata.api.iam.sharing.CreateGroupResponse\"!\x82\xd3\xe4\x93\x02\x1b\"\x16/api/v1/sharing/groups:\x01*\x12\x92\x01\n\x0bUpdateGroup\x12\x37.org.apache.airavata.api.iam.sharing.UpdateGroupRequest\x1a\x16.google.protobuf.Empty\"2\x82\xd3\xe4\x93\x02,\x1a\'/api/v1/sharing/groups/{group.group_id}:\x01*\x12\xcc\x01\n\rIsGroupExists\x12\x39.org.apache.airavata.api.iam.sharing.IsGroupExistsRequest\x1a:.org.apache.airavata.api.iam.sharing.IsGroupExistsResponse\"D\x82\xd3\xe4\x93\x02>\x12*/api/v1/sharing/domains/{domain_id}/groups/{group_id}/children:\x01*\x12\xd9\x01\n\x1fRemoveChildGroupFromParentGroup\x12K.org.apache.airavata.api.iam.sharing.RemoveChildGroupFromParentGroupRequest\x1a\x16.google.protobuf.Empty\"Q\x82\xd3\xe4\x93\x02K*I/api/v1/sharing/domains/{domain_id}/groups/{group_id}/children/{child_id}\x12\xee\x01\n\x19GetAllMemberGroupsForUser\x12\x45.org.apache.airavata.api.iam.sharing.GetAllMemberGroupsForUserRequest\x1a\x46.org.apache.airavata.api.iam.sharing.GetAllMemberGroupsForUserResponse\"B\x82\xd3\xe4\x93\x02<\x12:/api/v1/sharing/domains/{domain_id}/users/{user_id}/groups\x12\xb8\x01\n\x10\x43reateEntityType\x12<.org.apache.airavata.api.iam.sharing.CreateEntityTypeRequest\x1a=.org.apache.airavata.api.iam.sharing.CreateEntityTypeResponse\"\'\x82\xd3\xe4\x93\x02!\"\x1c/api/v1/sharing/entity-types:\x01*\x12\xae\x01\n\x10UpdateEntityType\x12<.org.apache.airavata.api.iam.sharing.UpdateEntityTypeRequest\x1a\x16.google.protobuf.Empty\"D\x82\xd3\xe4\x93\x02>\x1a\x39/api/v1/sharing/entity-types/{entity_type.entity_type_id}:\x01*\x12\xe7\x01\n\x12IsEntityTypeExists\x12>.org.apache.airavata.api.iam.sharing.IsEntityTypeExistsRequest\x1a?.org.apache.airavata.api.iam.sharing.IsEntityTypeExistsResponse\"P\x82\xd3\xe4\x93\x02J\x12H/api/v1/sharing/domains/{domain_id}/entity-types/{entity_type_id}:exists\x12\xb3\x01\n\x10\x44\x65leteEntityType\x12<.org.apache.airavata.api.iam.sharing.DeleteEntityTypeRequest\x1a\x16.google.protobuf.Empty\"I\x82\xd3\xe4\x93\x02\x43*A/api/v1/sharing/domains/{domain_id}/entity-types/{entity_type_id}\x12\xce\x01\n\rGetEntityType\x12\x39.org.apache.airavata.api.iam.sharing.GetEntityTypeRequest\x1a\x37.org.apache.airavata.sharing.registry.models.EntityType\"I\x82\xd3\xe4\x93\x02\x43\x12\x41/api/v1/sharing/domains/{domain_id}/entity-types/{entity_type_id}\x12\xc3\x01\n\x0eGetEntityTypes\x12:.org.apache.airavata.api.iam.sharing.GetEntityTypesRequest\x1a;.org.apache.airavata.api.iam.sharing.GetEntityTypesResponse\"8\x82\xd3\xe4\x93\x02\x32\x12\x30/api/v1/sharing/domains/{domain_id}/entity-types\x12\xa8\x01\n\x0c\x43reateEntity\x12\x38.org.apache.airavata.api.iam.sharing.CreateEntityRequest\x1a\x39.org.apache.airavata.api.iam.sharing.CreateEntityResponse\"#\x82\xd3\xe4\x93\x02\x1d\"\x18/api/v1/sharing/entities:\x01*\x12\x98\x01\n\x0cUpdateEntity\x12\x38.org.apache.airavata.api.iam.sharing.UpdateEntityRequest\x1a\x16.google.protobuf.Empty\"6\x82\xd3\xe4\x93\x02\x30\x1a+/api/v1/sharing/entities/{entity.entity_id}:\x01*\x12\xd2\x01\n\x0eIsEntityExists\x12:.org.apache.airavata.api.iam.sharing.IsEntityExistsRequest\x1a;.org.apache.airavata.api.iam.sharing.IsEntityExistsResponse\"G\x82\xd3\xe4\x93\x02\x41\x12?/api/v1/sharing/domains/{domain_id}/entities/{entity_id}:exists\x12\xa2\x01\n\x0c\x44\x65leteEntity\x12\x38.org.apache.airavata.api.iam.sharing.DeleteEntityRequest\x1a\x16.google.protobuf.Empty\"@\x82\xd3\xe4\x93\x02:*8/api/v1/sharing/domains/{domain_id}/entities/{entity_id}\x12\xb9\x01\n\tGetEntity\x12\x35.org.apache.airavata.api.iam.sharing.GetEntityRequest\x1a\x33.org.apache.airavata.sharing.registry.models.Entity\"@\x82\xd3\xe4\x93\x02:\x12\x38/api/v1/sharing/domains/{domain_id}/entities/{entity_id}\x12\xc9\x01\n\x0eSearchEntities\x12:.org.apache.airavata.api.iam.sharing.SearchEntitiesRequest\x1a;.org.apache.airavata.api.iam.sharing.SearchEntitiesResponse\">\x82\xd3\xe4\x93\x02\x38\"3/api/v1/sharing/domains/{domain_id}/entities:search:\x01*\x12\xea\x01\n\x14GetListOfSharedUsers\x12@.org.apache.airavata.api.iam.sharing.GetListOfSharedUsersRequest\x1a\x41.org.apache.airavata.api.iam.sharing.GetListOfSharedUsersResponse\"M\x82\xd3\xe4\x93\x02G\x12\x45/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-users\x12\x89\x02\n\x1cGetListOfDirectlySharedUsers\x12H.org.apache.airavata.api.iam.sharing.GetListOfDirectlySharedUsersRequest\x1aI.org.apache.airavata.api.iam.sharing.GetListOfDirectlySharedUsersResponse\"T\x82\xd3\xe4\x93\x02N\x12L/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-users:direct\x12\xee\x01\n\x15GetListOfSharedGroups\x12\x41.org.apache.airavata.api.iam.sharing.GetListOfSharedGroupsRequest\x1a\x42.org.apache.airavata.api.iam.sharing.GetListOfSharedGroupsResponse\"N\x82\xd3\xe4\x93\x02H\x12\x46/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-groups\x12\x8d\x02\n\x1dGetListOfDirectlySharedGroups\x12I.org.apache.airavata.api.iam.sharing.GetListOfDirectlySharedGroupsRequest\x1aJ.org.apache.airavata.api.iam.sharing.GetListOfDirectlySharedGroupsResponse\"U\x82\xd3\xe4\x93\x02O\x12M/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-groups:direct\x12\xc8\x01\n\x14\x43reatePermissionType\x12@.org.apache.airavata.api.iam.sharing.CreatePermissionTypeRequest\x1a\x41.org.apache.airavata.api.iam.sharing.CreatePermissionTypeResponse\"+\x82\xd3\xe4\x93\x02%\" /api/v1/sharing/permission-types:\x01*\x12\xc2\x01\n\x14UpdatePermissionType\x12@.org.apache.airavata.api.iam.sharing.UpdatePermissionTypeRequest\x1a\x16.google.protobuf.Empty\"P\x82\xd3\xe4\x93\x02J\x1a\x45/api/v1/sharing/permission-types/{permission_type.permission_type_id}:\x01*\x12\xea\x01\n\x12IsPermissionExists\x12>.org.apache.airavata.api.iam.sharing.IsPermissionExistsRequest\x1a?.org.apache.airavata.api.iam.sharing.IsPermissionExistsResponse\"S\x82\xd3\xe4\x93\x02M\x12K/api/v1/sharing/domains/{domain_id}/permission-types/{permission_id}:exists\x12\xc3\x01\n\x14\x44\x65letePermissionType\x12@.org.apache.airavata.api.iam.sharing.DeletePermissionTypeRequest\x1a\x16.google.protobuf.Empty\"Q\x82\xd3\xe4\x93\x02K*I/api/v1/sharing/domains/{domain_id}/permission-types/{permission_type_id}\x12\xe2\x01\n\x11GetPermissionType\x12=.org.apache.airavata.api.iam.sharing.GetPermissionTypeRequest\x1a;.org.apache.airavata.sharing.registry.models.PermissionType\"Q\x82\xd3\xe4\x93\x02K\x12I/api/v1/sharing/domains/{domain_id}/permission-types/{permission_type_id}\x12\xd3\x01\n\x12GetPermissionTypes\x12>.org.apache.airavata.api.iam.sharing.GetPermissionTypesRequest\x1a?.org.apache.airavata.api.iam.sharing.GetPermissionTypesResponse\"<\x82\xd3\xe4\x93\x02\x36\x12\x34/api/v1/sharing/domains/{domain_id}/permission-types\x12\xc1\x01\n\x14ShareEntityWithUsers\x12@.org.apache.airavata.api.iam.sharing.ShareEntityWithUsersRequest\x1a\x16.google.protobuf.Empty\"O\x82\xd3\xe4\x93\x02I\"D/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/users:share:\x01*\x12\xd2\x01\n\x1cRevokeEntitySharingFromUsers\x12H.org.apache.airavata.api.iam.sharing.RevokeEntitySharingFromUsersRequest\x1a\x16.google.protobuf.Empty\"P\x82\xd3\xe4\x93\x02J\"E/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/users:revoke:\x01*\x12\xc4\x01\n\x15ShareEntityWithGroups\x12\x41.org.apache.airavata.api.iam.sharing.ShareEntityWithGroupsRequest\x1a\x16.google.protobuf.Empty\"P\x82\xd3\xe4\x93\x02J\"E/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/groups:share:\x01*\x12\xd5\x01\n\x1dRevokeEntitySharingFromGroups\x12I.org.apache.airavata.api.iam.sharing.RevokeEntitySharingFromGroupsRequest\x1a\x16.google.protobuf.Empty\"Q\x82\xd3\xe4\x93\x02K\"F/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/groups:revoke:\x01*B\'\n#org.apache.airavata.api.iam.sharingP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.sharing_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n#org.apache.airavata.api.iam.sharingP\001' - _globals['_SHARERESOURCEWITHUSERSREQUEST_USERPERMISSIONSENTRY']._loaded_options = None - _globals['_SHARERESOURCEWITHUSERSREQUEST_USERPERMISSIONSENTRY']._serialized_options = b'8\001' - _globals['_SHARERESOURCEWITHGROUPSREQUEST_GROUPPERMISSIONSENTRY']._loaded_options = None - _globals['_SHARERESOURCEWITHGROUPSREQUEST_GROUPPERMISSIONSENTRY']._serialized_options = b'8\001' - _globals['_REVOKEFROMUSERSREQUEST_USERPERMISSIONSENTRY']._loaded_options = None - _globals['_REVOKEFROMUSERSREQUEST_USERPERMISSIONSENTRY']._serialized_options = b'8\001' - _globals['_REVOKEFROMGROUPSREQUEST_GROUPPERMISSIONSENTRY']._loaded_options = None - _globals['_REVOKEFROMGROUPSREQUEST_GROUPPERMISSIONSENTRY']._serialized_options = b'8\001' - _globals['_SHARINGSERVICE'].methods_by_name['ShareResourceWithUsers']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['ShareResourceWithUsers']._serialized_options = b'\202\323\344\223\002(\"#/api/v1/sharing/{resource_id}/users:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['ShareResourceWithGroups']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['ShareResourceWithGroups']._serialized_options = b'\202\323\344\223\002)\"$/api/v1/sharing/{resource_id}/groups:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['RevokeFromUsers']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['RevokeFromUsers']._serialized_options = b'\202\323\344\223\002%*#/api/v1/sharing/{resource_id}/users' - _globals['_SHARINGSERVICE'].methods_by_name['RevokeFromGroups']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['RevokeFromGroups']._serialized_options = b'\202\323\344\223\002&*$/api/v1/sharing/{resource_id}/groups' - _globals['_SHARINGSERVICE'].methods_by_name['GetAllAccessibleUsers']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetAllAccessibleUsers']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/sharing/{resource_id}/users' - _globals['_SHARINGSERVICE'].methods_by_name['GetAllDirectlyAccessibleUsers']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetAllDirectlyAccessibleUsers']._serialized_options = b'\202\323\344\223\002,\022*/api/v1/sharing/{resource_id}/users:direct' - _globals['_SHARINGSERVICE'].methods_by_name['GetAllAccessibleGroups']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetAllAccessibleGroups']._serialized_options = b'\202\323\344\223\002&\022$/api/v1/sharing/{resource_id}/groups' - _globals['_SHARINGSERVICE'].methods_by_name['GetAllDirectlyAccessibleGroups']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetAllDirectlyAccessibleGroups']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/sharing/{resource_id}/groups:direct' - _globals['_SHARINGSERVICE'].methods_by_name['UserHasAccess']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['UserHasAccess']._serialized_options = b'\202\323\344\223\0025\0223/api/v1/sharing/{resource_id}/users/{user_id}:check' - _globals['_SHARINGSERVICE'].methods_by_name['CreateDomain']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['CreateDomain']._serialized_options = b'\202\323\344\223\002\034\"\027/api/v1/sharing/domains:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['UpdateDomain']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['UpdateDomain']._serialized_options = b'\202\323\344\223\002/\032*/api/v1/sharing/domains/{domain.domain_id}:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['IsDomainExists']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['IsDomainExists']._serialized_options = b'\202\323\344\223\002,\022*/api/v1/sharing/domains/{domain_id}:exists' - _globals['_SHARINGSERVICE'].methods_by_name['DeleteDomain']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['DeleteDomain']._serialized_options = b'\202\323\344\223\002%*#/api/v1/sharing/domains/{domain_id}' - _globals['_SHARINGSERVICE'].methods_by_name['GetDomain']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetDomain']._serialized_options = b'\202\323\344\223\002%\022#/api/v1/sharing/domains/{domain_id}' - _globals['_SHARINGSERVICE'].methods_by_name['GetDomains']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetDomains']._serialized_options = b'\202\323\344\223\002\031\022\027/api/v1/sharing/domains' - _globals['_SHARINGSERVICE'].methods_by_name['CreateUser']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['CreateUser']._serialized_options = b'\202\323\344\223\002\032\"\025/api/v1/sharing/users:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['UpdateUser']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['UpdateUser']._serialized_options = b'\202\323\344\223\002)\032$/api/v1/sharing/users/{user.user_id}:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['IsUserExists']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['IsUserExists']._serialized_options = b'\202\323\344\223\002<\022:/api/v1/sharing/domains/{domain_id}/users/{user_id}:exists' - _globals['_SHARINGSERVICE'].methods_by_name['DeleteUser']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['DeleteUser']._serialized_options = b'\202\323\344\223\0025*3/api/v1/sharing/domains/{domain_id}/users/{user_id}' - _globals['_SHARINGSERVICE'].methods_by_name['GetUser']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetUser']._serialized_options = b'\202\323\344\223\0025\0223/api/v1/sharing/domains/{domain_id}/users/{user_id}' - _globals['_SHARINGSERVICE'].methods_by_name['GetUsers']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetUsers']._serialized_options = b'\202\323\344\223\002+\022)/api/v1/sharing/domains/{domain_id}/users' - _globals['_SHARINGSERVICE'].methods_by_name['CreateGroup']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['CreateGroup']._serialized_options = b'\202\323\344\223\002\033\"\026/api/v1/sharing/groups:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['UpdateGroup']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['UpdateGroup']._serialized_options = b'\202\323\344\223\002,\032\'/api/v1/sharing/groups/{group.group_id}:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['IsGroupExists']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['IsGroupExists']._serialized_options = b'\202\323\344\223\002>\022*/api/v1/sharing/domains/{domain_id}/groups/{group_id}/children:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['RemoveChildGroupFromParentGroup']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['RemoveChildGroupFromParentGroup']._serialized_options = b'\202\323\344\223\002K*I/api/v1/sharing/domains/{domain_id}/groups/{group_id}/children/{child_id}' - _globals['_SHARINGSERVICE'].methods_by_name['GetAllMemberGroupsForUser']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetAllMemberGroupsForUser']._serialized_options = b'\202\323\344\223\002<\022:/api/v1/sharing/domains/{domain_id}/users/{user_id}/groups' - _globals['_SHARINGSERVICE'].methods_by_name['CreateEntityType']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['CreateEntityType']._serialized_options = b'\202\323\344\223\002!\"\034/api/v1/sharing/entity-types:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['UpdateEntityType']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['UpdateEntityType']._serialized_options = b'\202\323\344\223\002>\0329/api/v1/sharing/entity-types/{entity_type.entity_type_id}:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['IsEntityTypeExists']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['IsEntityTypeExists']._serialized_options = b'\202\323\344\223\002J\022H/api/v1/sharing/domains/{domain_id}/entity-types/{entity_type_id}:exists' - _globals['_SHARINGSERVICE'].methods_by_name['DeleteEntityType']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['DeleteEntityType']._serialized_options = b'\202\323\344\223\002C*A/api/v1/sharing/domains/{domain_id}/entity-types/{entity_type_id}' - _globals['_SHARINGSERVICE'].methods_by_name['GetEntityType']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetEntityType']._serialized_options = b'\202\323\344\223\002C\022A/api/v1/sharing/domains/{domain_id}/entity-types/{entity_type_id}' - _globals['_SHARINGSERVICE'].methods_by_name['GetEntityTypes']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetEntityTypes']._serialized_options = b'\202\323\344\223\0022\0220/api/v1/sharing/domains/{domain_id}/entity-types' - _globals['_SHARINGSERVICE'].methods_by_name['CreateEntity']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['CreateEntity']._serialized_options = b'\202\323\344\223\002\035\"\030/api/v1/sharing/entities:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['UpdateEntity']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['UpdateEntity']._serialized_options = b'\202\323\344\223\0020\032+/api/v1/sharing/entities/{entity.entity_id}:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['IsEntityExists']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['IsEntityExists']._serialized_options = b'\202\323\344\223\002A\022?/api/v1/sharing/domains/{domain_id}/entities/{entity_id}:exists' - _globals['_SHARINGSERVICE'].methods_by_name['DeleteEntity']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['DeleteEntity']._serialized_options = b'\202\323\344\223\002:*8/api/v1/sharing/domains/{domain_id}/entities/{entity_id}' - _globals['_SHARINGSERVICE'].methods_by_name['GetEntity']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetEntity']._serialized_options = b'\202\323\344\223\002:\0228/api/v1/sharing/domains/{domain_id}/entities/{entity_id}' - _globals['_SHARINGSERVICE'].methods_by_name['SearchEntities']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['SearchEntities']._serialized_options = b'\202\323\344\223\0028\"3/api/v1/sharing/domains/{domain_id}/entities:search:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['GetListOfSharedUsers']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetListOfSharedUsers']._serialized_options = b'\202\323\344\223\002G\022E/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-users' - _globals['_SHARINGSERVICE'].methods_by_name['GetListOfDirectlySharedUsers']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetListOfDirectlySharedUsers']._serialized_options = b'\202\323\344\223\002N\022L/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-users:direct' - _globals['_SHARINGSERVICE'].methods_by_name['GetListOfSharedGroups']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetListOfSharedGroups']._serialized_options = b'\202\323\344\223\002H\022F/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-groups' - _globals['_SHARINGSERVICE'].methods_by_name['GetListOfDirectlySharedGroups']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetListOfDirectlySharedGroups']._serialized_options = b'\202\323\344\223\002O\022M/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/shared-groups:direct' - _globals['_SHARINGSERVICE'].methods_by_name['CreatePermissionType']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['CreatePermissionType']._serialized_options = b'\202\323\344\223\002%\" /api/v1/sharing/permission-types:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['UpdatePermissionType']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['UpdatePermissionType']._serialized_options = b'\202\323\344\223\002J\032E/api/v1/sharing/permission-types/{permission_type.permission_type_id}:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['IsPermissionExists']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['IsPermissionExists']._serialized_options = b'\202\323\344\223\002M\022K/api/v1/sharing/domains/{domain_id}/permission-types/{permission_id}:exists' - _globals['_SHARINGSERVICE'].methods_by_name['DeletePermissionType']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['DeletePermissionType']._serialized_options = b'\202\323\344\223\002K*I/api/v1/sharing/domains/{domain_id}/permission-types/{permission_type_id}' - _globals['_SHARINGSERVICE'].methods_by_name['GetPermissionType']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetPermissionType']._serialized_options = b'\202\323\344\223\002K\022I/api/v1/sharing/domains/{domain_id}/permission-types/{permission_type_id}' - _globals['_SHARINGSERVICE'].methods_by_name['GetPermissionTypes']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['GetPermissionTypes']._serialized_options = b'\202\323\344\223\0026\0224/api/v1/sharing/domains/{domain_id}/permission-types' - _globals['_SHARINGSERVICE'].methods_by_name['ShareEntityWithUsers']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['ShareEntityWithUsers']._serialized_options = b'\202\323\344\223\002I\"D/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/users:share:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['RevokeEntitySharingFromUsers']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['RevokeEntitySharingFromUsers']._serialized_options = b'\202\323\344\223\002J\"E/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/users:revoke:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['ShareEntityWithGroups']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['ShareEntityWithGroups']._serialized_options = b'\202\323\344\223\002J\"E/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/groups:share:\001*' - _globals['_SHARINGSERVICE'].methods_by_name['RevokeEntitySharingFromGroups']._loaded_options = None - _globals['_SHARINGSERVICE'].methods_by_name['RevokeEntitySharingFromGroups']._serialized_options = b'\202\323\344\223\002K\"F/api/v1/sharing/domains/{domain_id}/entities/{entity_id}/groups:revoke:\001*' - _globals['_SHARERESOURCEWITHUSERSREQUEST']._serialized_start=180 - _globals['_SHARERESOURCEWITHUSERSREQUEST']._serialized_end=403 - _globals['_SHARERESOURCEWITHUSERSREQUEST_USERPERMISSIONSENTRY']._serialized_start=349 - _globals['_SHARERESOURCEWITHUSERSREQUEST_USERPERMISSIONSENTRY']._serialized_end=403 - _globals['_SHARERESOURCEWITHGROUPSREQUEST']._serialized_start=406 - _globals['_SHARERESOURCEWITHGROUPSREQUEST']._serialized_end=634 - _globals['_SHARERESOURCEWITHGROUPSREQUEST_GROUPPERMISSIONSENTRY']._serialized_start=579 - _globals['_SHARERESOURCEWITHGROUPSREQUEST_GROUPPERMISSIONSENTRY']._serialized_end=634 - _globals['_REVOKEFROMUSERSREQUEST']._serialized_start=637 - _globals['_REVOKEFROMUSERSREQUEST']._serialized_end=846 - _globals['_REVOKEFROMUSERSREQUEST_USERPERMISSIONSENTRY']._serialized_start=349 - _globals['_REVOKEFROMUSERSREQUEST_USERPERMISSIONSENTRY']._serialized_end=403 - _globals['_REVOKEFROMGROUPSREQUEST']._serialized_start=849 - _globals['_REVOKEFROMGROUPSREQUEST']._serialized_end=1063 - _globals['_REVOKEFROMGROUPSREQUEST_GROUPPERMISSIONSENTRY']._serialized_start=579 - _globals['_REVOKEFROMGROUPSREQUEST_GROUPPERMISSIONSENTRY']._serialized_end=634 - _globals['_GETALLACCESSIBLEUSERSREQUEST']._serialized_start=1065 - _globals['_GETALLACCESSIBLEUSERSREQUEST']._serialized_end=1141 - _globals['_GETALLACCESSIBLEUSERSRESPONSE']._serialized_start=1143 - _globals['_GETALLACCESSIBLEUSERSRESPONSE']._serialized_end=1192 - _globals['_GETALLDIRECTLYACCESSIBLEUSERSREQUEST']._serialized_start=1194 - _globals['_GETALLDIRECTLYACCESSIBLEUSERSREQUEST']._serialized_end=1278 - _globals['_GETALLDIRECTLYACCESSIBLEUSERSRESPONSE']._serialized_start=1280 - _globals['_GETALLDIRECTLYACCESSIBLEUSERSRESPONSE']._serialized_end=1337 - _globals['_GETALLACCESSIBLEGROUPSREQUEST']._serialized_start=1339 - _globals['_GETALLACCESSIBLEGROUPSREQUEST']._serialized_end=1416 - _globals['_GETALLACCESSIBLEGROUPSRESPONSE']._serialized_start=1418 - _globals['_GETALLACCESSIBLEGROUPSRESPONSE']._serialized_end=1469 - _globals['_GETALLDIRECTLYACCESSIBLEGROUPSREQUEST']._serialized_start=1471 - _globals['_GETALLDIRECTLYACCESSIBLEGROUPSREQUEST']._serialized_end=1556 - _globals['_GETALLDIRECTLYACCESSIBLEGROUPSRESPONSE']._serialized_start=1558 - _globals['_GETALLDIRECTLYACCESSIBLEGROUPSRESPONSE']._serialized_end=1617 - _globals['_USERHASACCESSREQUEST']._serialized_start=1619 - _globals['_USERHASACCESSREQUEST']._serialized_end=1704 - _globals['_USERHASACCESSRESPONSE']._serialized_start=1706 - _globals['_USERHASACCESSRESPONSE']._serialized_end=1749 - _globals['_CREATEDOMAINREQUEST']._serialized_start=1751 - _globals['_CREATEDOMAINREQUEST']._serialized_end=1841 - _globals['_CREATEDOMAINRESPONSE']._serialized_start=1843 - _globals['_CREATEDOMAINRESPONSE']._serialized_end=1884 - _globals['_UPDATEDOMAINREQUEST']._serialized_start=1886 - _globals['_UPDATEDOMAINREQUEST']._serialized_end=1976 - _globals['_ISDOMAINEXISTSREQUEST']._serialized_start=1978 - _globals['_ISDOMAINEXISTSREQUEST']._serialized_end=2020 - _globals['_ISDOMAINEXISTSRESPONSE']._serialized_start=2022 - _globals['_ISDOMAINEXISTSRESPONSE']._serialized_end=2062 - _globals['_DELETEDOMAINREQUEST']._serialized_start=2064 - _globals['_DELETEDOMAINREQUEST']._serialized_end=2104 - _globals['_GETDOMAINREQUEST']._serialized_start=2106 - _globals['_GETDOMAINREQUEST']._serialized_end=2143 - _globals['_GETDOMAINSREQUEST']._serialized_start=2145 - _globals['_GETDOMAINSREQUEST']._serialized_end=2195 - _globals['_GETDOMAINSRESPONSE']._serialized_start=2197 - _globals['_GETDOMAINSRESPONSE']._serialized_end=2287 - _globals['_CREATEUSERREQUEST']._serialized_start=2289 - _globals['_CREATEUSERREQUEST']._serialized_end=2373 - _globals['_CREATEUSERRESPONSE']._serialized_start=2375 - _globals['_CREATEUSERRESPONSE']._serialized_end=2412 - _globals['_UPDATEUSERREQUEST']._serialized_start=2414 - _globals['_UPDATEUSERREQUEST']._serialized_end=2498 - _globals['_ISUSEREXISTSREQUEST']._serialized_start=2500 - _globals['_ISUSEREXISTSREQUEST']._serialized_end=2557 - _globals['_ISUSEREXISTSRESPONSE']._serialized_start=2559 - _globals['_ISUSEREXISTSRESPONSE']._serialized_end=2597 - _globals['_DELETEUSERREQUEST']._serialized_start=2599 - _globals['_DELETEUSERREQUEST']._serialized_end=2654 - _globals['_GETUSERREQUEST']._serialized_start=2656 - _globals['_GETUSERREQUEST']._serialized_end=2708 - _globals['_GETUSERSREQUEST']._serialized_start=2710 - _globals['_GETUSERSREQUEST']._serialized_end=2777 - _globals['_GETUSERSRESPONSE']._serialized_start=2779 - _globals['_GETUSERSRESPONSE']._serialized_end=2863 - _globals['_CREATEGROUPREQUEST']._serialized_start=2865 - _globals['_CREATEGROUPREQUEST']._serialized_end=2956 - _globals['_CREATEGROUPRESPONSE']._serialized_start=2958 - _globals['_CREATEGROUPRESPONSE']._serialized_end=2997 - _globals['_UPDATEGROUPREQUEST']._serialized_start=2999 - _globals['_UPDATEGROUPREQUEST']._serialized_end=3090 - _globals['_ISGROUPEXISTSREQUEST']._serialized_start=3092 - _globals['_ISGROUPEXISTSREQUEST']._serialized_end=3151 - _globals['_ISGROUPEXISTSRESPONSE']._serialized_start=3153 - _globals['_ISGROUPEXISTSRESPONSE']._serialized_end=3192 - _globals['_DELETEGROUPREQUEST']._serialized_start=3194 - _globals['_DELETEGROUPREQUEST']._serialized_end=3251 - _globals['_GETGROUPREQUEST']._serialized_start=3253 - _globals['_GETGROUPREQUEST']._serialized_end=3307 - _globals['_GETGROUPSREQUEST']._serialized_start=3309 - _globals['_GETGROUPSREQUEST']._serialized_end=3377 - _globals['_GETGROUPSRESPONSE']._serialized_start=3379 - _globals['_GETGROUPSRESPONSE']._serialized_end=3470 - _globals['_ADDUSERSTOGROUPREQUEST']._serialized_start=3472 - _globals['_ADDUSERSTOGROUPREQUEST']._serialized_end=3551 - _globals['_REMOVEUSERSFROMGROUPREQUEST']._serialized_start=3553 - _globals['_REMOVEUSERSFROMGROUPREQUEST']._serialized_end=3637 - _globals['_TRANSFERGROUPOWNERSHIPREQUEST']._serialized_start=3639 - _globals['_TRANSFERGROUPOWNERSHIPREQUEST']._serialized_end=3729 - _globals['_ADDGROUPADMINSREQUEST']._serialized_start=3731 - _globals['_ADDGROUPADMINSREQUEST']._serialized_end=3810 - _globals['_REMOVEGROUPADMINSREQUEST']._serialized_start=3812 - _globals['_REMOVEGROUPADMINSREQUEST']._serialized_end=3894 - _globals['_HASADMINACCESSREQUEST']._serialized_start=3896 - _globals['_HASADMINACCESSREQUEST']._serialized_end=3974 - _globals['_HASADMINACCESSRESPONSE']._serialized_start=3976 - _globals['_HASADMINACCESSRESPONSE']._serialized_end=4020 - _globals['_HASOWNERACCESSREQUEST']._serialized_start=4022 - _globals['_HASOWNERACCESSREQUEST']._serialized_end=4100 - _globals['_HASOWNERACCESSRESPONSE']._serialized_start=4102 - _globals['_HASOWNERACCESSRESPONSE']._serialized_end=4146 - _globals['_GETGROUPMEMBERSOFTYPEUSERREQUEST']._serialized_start=4148 - _globals['_GETGROUPMEMBERSOFTYPEUSERREQUEST']._serialized_end=4250 - _globals['_GETGROUPMEMBERSOFTYPEUSERRESPONSE']._serialized_start=4252 - _globals['_GETGROUPMEMBERSOFTYPEUSERRESPONSE']._serialized_end=4353 - _globals['_GETGROUPMEMBERSOFTYPEGROUPREQUEST']._serialized_start=4355 - _globals['_GETGROUPMEMBERSOFTYPEGROUPREQUEST']._serialized_end=4458 - _globals['_GETGROUPMEMBERSOFTYPEGROUPRESPONSE']._serialized_start=4460 - _globals['_GETGROUPMEMBERSOFTYPEGROUPRESPONSE']._serialized_end=4568 - _globals['_ADDCHILDGROUPSTOPARENTGROUPREQUEST']._serialized_start=4570 - _globals['_ADDCHILDGROUPSTOPARENTGROUPREQUEST']._serialized_end=4662 - _globals['_REMOVECHILDGROUPFROMPARENTGROUPREQUEST']._serialized_start=4664 - _globals['_REMOVECHILDGROUPFROMPARENTGROUPREQUEST']._serialized_end=4759 - _globals['_GETALLMEMBERGROUPSFORUSERREQUEST']._serialized_start=4761 - _globals['_GETALLMEMBERGROUPSFORUSERREQUEST']._serialized_end=4831 - _globals['_GETALLMEMBERGROUPSFORUSERRESPONSE']._serialized_start=4833 - _globals['_GETALLMEMBERGROUPSFORUSERRESPONSE']._serialized_end=4940 - _globals['_CREATEENTITYTYPEREQUEST']._serialized_start=4942 - _globals['_CREATEENTITYTYPEREQUEST']._serialized_end=5045 - _globals['_CREATEENTITYTYPERESPONSE']._serialized_start=5047 - _globals['_CREATEENTITYTYPERESPONSE']._serialized_end=5097 - _globals['_UPDATEENTITYTYPEREQUEST']._serialized_start=5099 - _globals['_UPDATEENTITYTYPEREQUEST']._serialized_end=5202 - _globals['_ISENTITYTYPEEXISTSREQUEST']._serialized_start=5204 - _globals['_ISENTITYTYPEEXISTSREQUEST']._serialized_end=5274 - _globals['_ISENTITYTYPEEXISTSRESPONSE']._serialized_start=5276 - _globals['_ISENTITYTYPEEXISTSRESPONSE']._serialized_end=5320 - _globals['_DELETEENTITYTYPEREQUEST']._serialized_start=5322 - _globals['_DELETEENTITYTYPEREQUEST']._serialized_end=5390 - _globals['_GETENTITYTYPEREQUEST']._serialized_start=5392 - _globals['_GETENTITYTYPEREQUEST']._serialized_end=5457 - _globals['_GETENTITYTYPESREQUEST']._serialized_start=5459 - _globals['_GETENTITYTYPESREQUEST']._serialized_end=5532 - _globals['_GETENTITYTYPESRESPONSE']._serialized_start=5534 - _globals['_GETENTITYTYPESRESPONSE']._serialized_end=5637 - _globals['_CREATEENTITYREQUEST']._serialized_start=5639 - _globals['_CREATEENTITYREQUEST']._serialized_end=5729 - _globals['_CREATEENTITYRESPONSE']._serialized_start=5731 - _globals['_CREATEENTITYRESPONSE']._serialized_end=5772 - _globals['_UPDATEENTITYREQUEST']._serialized_start=5774 - _globals['_UPDATEENTITYREQUEST']._serialized_end=5864 - _globals['_ISENTITYEXISTSREQUEST']._serialized_start=5866 - _globals['_ISENTITYEXISTSREQUEST']._serialized_end=5927 - _globals['_ISENTITYEXISTSRESPONSE']._serialized_start=5929 - _globals['_ISENTITYEXISTSRESPONSE']._serialized_end=5969 - _globals['_DELETEENTITYREQUEST']._serialized_start=5971 - _globals['_DELETEENTITYREQUEST']._serialized_end=6030 - _globals['_GETENTITYREQUEST']._serialized_start=6032 - _globals['_GETENTITYREQUEST']._serialized_end=6088 - _globals['_SEARCHENTITIESREQUEST']._serialized_start=6091 - _globals['_SEARCHENTITIESREQUEST']._serialized_end=6259 - _globals['_SEARCHENTITIESRESPONSE']._serialized_start=6261 - _globals['_SEARCHENTITIESRESPONSE']._serialized_end=6356 - _globals['_GETLISTOFSHAREDUSERSREQUEST']._serialized_start=6358 - _globals['_GETLISTOFSHAREDUSERSREQUEST']._serialized_end=6453 - _globals['_GETLISTOFSHAREDUSERSRESPONSE']._serialized_start=6455 - _globals['_GETLISTOFSHAREDUSERSRESPONSE']._serialized_end=6551 - _globals['_GETLISTOFDIRECTLYSHAREDUSERSREQUEST']._serialized_start=6553 - _globals['_GETLISTOFDIRECTLYSHAREDUSERSREQUEST']._serialized_end=6656 - _globals['_GETLISTOFDIRECTLYSHAREDUSERSRESPONSE']._serialized_start=6658 - _globals['_GETLISTOFDIRECTLYSHAREDUSERSRESPONSE']._serialized_end=6762 - _globals['_GETLISTOFSHAREDGROUPSREQUEST']._serialized_start=6764 - _globals['_GETLISTOFSHAREDGROUPSREQUEST']._serialized_end=6860 - _globals['_GETLISTOFSHAREDGROUPSRESPONSE']._serialized_start=6862 - _globals['_GETLISTOFSHAREDGROUPSRESPONSE']._serialized_end=6965 - _globals['_GETLISTOFDIRECTLYSHAREDGROUPSREQUEST']._serialized_start=6967 - _globals['_GETLISTOFDIRECTLYSHAREDGROUPSREQUEST']._serialized_end=7071 - _globals['_GETLISTOFDIRECTLYSHAREDGROUPSRESPONSE']._serialized_start=7073 - _globals['_GETLISTOFDIRECTLYSHAREDGROUPSRESPONSE']._serialized_end=7184 - _globals['_CREATEPERMISSIONTYPEREQUEST']._serialized_start=7186 - _globals['_CREATEPERMISSIONTYPEREQUEST']._serialized_end=7301 - _globals['_CREATEPERMISSIONTYPERESPONSE']._serialized_start=7303 - _globals['_CREATEPERMISSIONTYPERESPONSE']._serialized_end=7361 - _globals['_UPDATEPERMISSIONTYPEREQUEST']._serialized_start=7363 - _globals['_UPDATEPERMISSIONTYPEREQUEST']._serialized_end=7478 - _globals['_ISPERMISSIONEXISTSREQUEST']._serialized_start=7480 - _globals['_ISPERMISSIONEXISTSREQUEST']._serialized_end=7549 - _globals['_ISPERMISSIONEXISTSRESPONSE']._serialized_start=7551 - _globals['_ISPERMISSIONEXISTSRESPONSE']._serialized_end=7595 - _globals['_DELETEPERMISSIONTYPEREQUEST']._serialized_start=7597 - _globals['_DELETEPERMISSIONTYPEREQUEST']._serialized_end=7673 - _globals['_GETPERMISSIONTYPEREQUEST']._serialized_start=7675 - _globals['_GETPERMISSIONTYPEREQUEST']._serialized_end=7748 - _globals['_GETPERMISSIONTYPESREQUEST']._serialized_start=7750 - _globals['_GETPERMISSIONTYPESREQUEST']._serialized_end=7827 - _globals['_GETPERMISSIONTYPESRESPONSE']._serialized_start=7829 - _globals['_GETPERMISSIONTYPESRESPONSE']._serialized_end=7944 - _globals['_SHAREENTITYWITHUSERSREQUEST']._serialized_start=7947 - _globals['_SHAREENTITYWITHUSERSREQUEST']._serialized_end=8089 - _globals['_REVOKEENTITYSHARINGFROMUSERSREQUEST']._serialized_start=8091 - _globals['_REVOKEENTITYSHARINGFROMUSERSREQUEST']._serialized_end=8213 - _globals['_SHAREENTITYWITHGROUPSREQUEST']._serialized_start=8216 - _globals['_SHAREENTITYWITHGROUPSREQUEST']._serialized_end=8360 - _globals['_REVOKEENTITYSHARINGFROMGROUPSREQUEST']._serialized_start=8362 - _globals['_REVOKEENTITYSHARINGFROMGROUPSREQUEST']._serialized_end=8486 - _globals['_SHARINGSERVICE']._serialized_start=8489 - _globals['_SHARINGSERVICE']._serialized_end=21229 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/generated/services/user_profile_service_pb2.py b/airavata-python-sdk/airavata_sdk/generated/services/user_profile_service_pb2.py deleted file mode 100644 index 24d76eec7ec..00000000000 --- a/airavata-python-sdk/airavata_sdk/generated/services/user_profile_service_pb2.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: services/user_profile_service.proto -# Protobuf Python Version: 6.31.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 6, - 31, - 1, - '', - 'services/user_profile_service.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from org.apache.airavata.model.user import user_profile_pb2 as org_dot_apache_dot_airavata_dot_model_dot_user_dot_user__profile__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#services/user_profile_service.proto\x12\'org.apache.airavata.api.iam.userprofile\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x31org/apache/airavata/model/user/user_profile.proto\"Z\n\x15\x41\x64\x64UserProfileRequest\x12\x41\n\x0cuser_profile\x18\x01 \x01(\x0b\x32+.org.apache.airavata.model.user.UserProfile\")\n\x16\x41\x64\x64UserProfileResponse\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"]\n\x18UpdateUserProfileRequest\x12\x41\n\x0cuser_profile\x18\x01 \x01(\x0b\x32+.org.apache.airavata.model.user.UserProfile\"@\n\x19GetUserProfileByIdRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"D\n\x1bGetUserProfileByNameRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"+\n\x18\x44\x65leteUserProfileRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"W\n\"GetAllUserProfilesInGatewayRequest\x12\x12\n\ngateway_id\x18\x01 \x01(\t\x12\x0e\n\x06offset\x18\x02 \x01(\x05\x12\r\n\x05limit\x18\x03 \x01(\x05\"i\n#GetAllUserProfilesInGatewayResponse\x12\x42\n\ruser_profiles\x18\x01 \x03(\x0b\x32+.org.apache.airavata.model.user.UserProfile\"=\n\x14\x44oesUserExistRequest\x12\x11\n\tuser_name\x18\x01 \x01(\t\x12\x12\n\ngateway_id\x18\x02 \x01(\t\"\'\n\x15\x44oesUserExistResponse\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\x32\xe6\n\n\x12UserProfileService\x12\xbe\x01\n\x0e\x41\x64\x64UserProfile\x12>.org.apache.airavata.api.iam.userprofile.AddUserProfileRequest\x1a?.org.apache.airavata.api.iam.userprofile.AddUserProfileResponse\"+\x82\xd3\xe4\x93\x02%\"\x15/api/v1/user-profiles:\x0cuser_profile\x12\xb2\x01\n\x11UpdateUserProfile\x12\x41.org.apache.airavata.api.iam.userprofile.UpdateUserProfileRequest\x1a\x16.google.protobuf.Empty\"B\x82\xd3\xe4\x93\x02<\x1a,/api/v1/user-profiles/{user_profile.user_id}:\x0cuser_profile\x12\xae\x01\n\x12GetUserProfileById\x12\x42.org.apache.airavata.api.iam.userprofile.GetUserProfileByIdRequest\x1a+.org.apache.airavata.model.user.UserProfile\"\'\x82\xd3\xe4\x93\x02!\x12\x1f/api/v1/user-profiles/{user_id}\x12\xc5\x01\n\x14GetUserProfileByName\x12\x44.org.apache.airavata.api.iam.userprofile.GetUserProfileByNameRequest\x1a+.org.apache.airavata.model.user.UserProfile\":\x82\xd3\xe4\x93\x02\x34\x12\x32/api/v1/gateways/{gateway_id}/user-profiles:byName\x12\x97\x01\n\x11\x44\x65leteUserProfile\x12\x41.org.apache.airavata.api.iam.userprofile.DeleteUserProfileRequest\x1a\x16.google.protobuf.Empty\"\'\x82\xd3\xe4\x93\x02!*\x1f/api/v1/user-profiles/{user_id}\x12\xed\x01\n\x1bGetAllUserProfilesInGateway\x12K.org.apache.airavata.api.iam.userprofile.GetAllUserProfilesInGatewayRequest\x1aL.org.apache.airavata.api.iam.userprofile.GetAllUserProfilesInGatewayResponse\"3\x82\xd3\xe4\x93\x02-\x12+/api/v1/gateways/{gateway_id}/user-profiles\x12\xd6\x01\n\rDoesUserExist\x12=.org.apache.airavata.api.iam.userprofile.DoesUserExistRequest\x1a>.org.apache.airavata.api.iam.userprofile.DoesUserExistResponse\"F\x82\xd3\xe4\x93\x02@\x12>/api/v1/gateways/{gateway_id}/user-profiles/{user_name}:existsB+\n\'org.apache.airavata.api.iam.userprofileP\x01\x62\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'services.user_profile_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\'org.apache.airavata.api.iam.userprofileP\001' - _globals['_USERPROFILESERVICE'].methods_by_name['AddUserProfile']._loaded_options = None - _globals['_USERPROFILESERVICE'].methods_by_name['AddUserProfile']._serialized_options = b'\202\323\344\223\002%\"\025/api/v1/user-profiles:\014user_profile' - _globals['_USERPROFILESERVICE'].methods_by_name['UpdateUserProfile']._loaded_options = None - _globals['_USERPROFILESERVICE'].methods_by_name['UpdateUserProfile']._serialized_options = b'\202\323\344\223\002<\032,/api/v1/user-profiles/{user_profile.user_id}:\014user_profile' - _globals['_USERPROFILESERVICE'].methods_by_name['GetUserProfileById']._loaded_options = None - _globals['_USERPROFILESERVICE'].methods_by_name['GetUserProfileById']._serialized_options = b'\202\323\344\223\002!\022\037/api/v1/user-profiles/{user_id}' - _globals['_USERPROFILESERVICE'].methods_by_name['GetUserProfileByName']._loaded_options = None - _globals['_USERPROFILESERVICE'].methods_by_name['GetUserProfileByName']._serialized_options = b'\202\323\344\223\0024\0222/api/v1/gateways/{gateway_id}/user-profiles:byName' - _globals['_USERPROFILESERVICE'].methods_by_name['DeleteUserProfile']._loaded_options = None - _globals['_USERPROFILESERVICE'].methods_by_name['DeleteUserProfile']._serialized_options = b'\202\323\344\223\002!*\037/api/v1/user-profiles/{user_id}' - _globals['_USERPROFILESERVICE'].methods_by_name['GetAllUserProfilesInGateway']._loaded_options = None - _globals['_USERPROFILESERVICE'].methods_by_name['GetAllUserProfilesInGateway']._serialized_options = b'\202\323\344\223\002-\022+/api/v1/gateways/{gateway_id}/user-profiles' - _globals['_USERPROFILESERVICE'].methods_by_name['DoesUserExist']._loaded_options = None - _globals['_USERPROFILESERVICE'].methods_by_name['DoesUserExist']._serialized_options = b'\202\323\344\223\002@\022>/api/v1/gateways/{gateway_id}/user-profiles/{user_name}:exists' - _globals['_ADDUSERPROFILEREQUEST']._serialized_start=190 - _globals['_ADDUSERPROFILEREQUEST']._serialized_end=280 - _globals['_ADDUSERPROFILERESPONSE']._serialized_start=282 - _globals['_ADDUSERPROFILERESPONSE']._serialized_end=323 - _globals['_UPDATEUSERPROFILEREQUEST']._serialized_start=325 - _globals['_UPDATEUSERPROFILEREQUEST']._serialized_end=418 - _globals['_GETUSERPROFILEBYIDREQUEST']._serialized_start=420 - _globals['_GETUSERPROFILEBYIDREQUEST']._serialized_end=484 - _globals['_GETUSERPROFILEBYNAMEREQUEST']._serialized_start=486 - _globals['_GETUSERPROFILEBYNAMEREQUEST']._serialized_end=554 - _globals['_DELETEUSERPROFILEREQUEST']._serialized_start=556 - _globals['_DELETEUSERPROFILEREQUEST']._serialized_end=599 - _globals['_GETALLUSERPROFILESINGATEWAYREQUEST']._serialized_start=601 - _globals['_GETALLUSERPROFILESINGATEWAYREQUEST']._serialized_end=688 - _globals['_GETALLUSERPROFILESINGATEWAYRESPONSE']._serialized_start=690 - _globals['_GETALLUSERPROFILESINGATEWAYRESPONSE']._serialized_end=795 - _globals['_DOESUSEREXISTREQUEST']._serialized_start=797 - _globals['_DOESUSEREXISTREQUEST']._serialized_end=858 - _globals['_DOESUSEREXISTRESPONSE']._serialized_start=860 - _globals['_DOESUSEREXISTRESPONSE']._serialized_end=899 - _globals['_USERPROFILESERVICE']._serialized_start=902 - _globals['_USERPROFILESERVICE']._serialized_end=2284 -# @@protoc_insertion_point(module_scope) diff --git a/airavata-python-sdk/airavata_sdk/helpers/__init__.py b/airavata-python-sdk/airavata_sdk/helpers/__init__.py deleted file mode 100644 index 7f5bcea185a..00000000000 --- a/airavata-python-sdk/airavata_sdk/helpers/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Framework-agnostic resource helpers relocated from the Django portal SDK. - -No Django/DRF/Thrift dependencies — all backend access goes through the gRPC -facades on :class:`airavata_sdk.client.AiravataClient` (``client.research``, -``client.storage``, ``client.sharing``, ...). -""" diff --git a/airavata-python-sdk/airavata_sdk/helpers/_envelope.py b/airavata-python-sdk/airavata_sdk/helpers/_envelope.py deleted file mode 100644 index 6029362c347..00000000000 --- a/airavata-python-sdk/airavata_sdk/helpers/_envelope.py +++ /dev/null @@ -1,52 +0,0 @@ -"""Typed containers that union a proto message with chained-call scalars. - -The proto-direct architecture returns the gRPC message as-is whenever that is -sufficient. Some resources need a few extra fields the owning service cannot -compute without breaking service isolation — most commonly the sharing-access -flags, which live in the SHARING service while the resource is owned elsewhere. -Rather than couple the two services, the SDK makes a chained follow-up call and -carries the result alongside the proto here. The proto is never re-modelled: it -flows through under ``.message``; the portal renderer flattens each container to -``MessageToDict(message)`` merged with the extra scalars. -""" - -from __future__ import annotations - -from dataclasses import dataclass -from typing import Generic, TypeVar - -M = TypeVar("M") -G = TypeVar("G") - - -@dataclass -class WithAccess(Generic[M]): - """A proto message unioned with the caller's sharing-access flags. - - ``is_owner`` is SDK-trivial for protos carrying an ``owner`` field (else - always ``False``). ``user_has_write_access`` is the chained - ``sharing.user_has_access`` lookup the proto is wrapped for. - """ - - message: M - is_owner: bool - user_has_write_access: bool - - -@dataclass -class WithGroupAccess(Generic[G]): - """A ``GroupModel`` proto unioned with the caller's six group-access flags. - - Same pattern as :class:`WithAccess`, but a group needs six cross-context - booleans (a GroupManager admin lookup, the acting user's ``user@gateway`` id, - and the gateway-group identity ids) the ``GroupModel`` proto cannot compute - without coupling GroupManager to the gateway-groups catalog. - """ - - message: G - is_admin: bool - is_owner: bool - is_member: bool - is_gateway_admins_group: bool - is_read_only_gateway_admins_group: bool - is_default_gateway_users_group: bool diff --git a/airavata-python-sdk/airavata_sdk/helpers/compute_resources.py b/airavata-python-sdk/airavata_sdk/helpers/compute_resources.py deleted file mode 100644 index 6f878461cbd..00000000000 --- a/airavata-python-sdk/airavata_sdk/helpers/compute_resources.py +++ /dev/null @@ -1,574 +0,0 @@ -"""Compute-domain helpers. - -Read paths are proto-direct: ``get_gateway_resource_profile`` / -``get_group_resource_profile`` return a ``WithAccess`` (``is_owner`` always -``False``, ``user_has_write_access`` supplied by the ViewSet as *has_write*); -``get_compute_resource`` and the four ``get_*_job_submission`` helpers return the -bare proto. - -The group-resource-profile WRITE builders resolve protocol/resource-type enums -with ``proto_enum_value`` (the proto enum is the source of type-truth — it accepts -the proto member NAME or the proto int the frontend sends, never a Thrift int). -Read paths render enum NAMES via ``MessageToDict``. -""" - -from __future__ import annotations - -from typing import TYPE_CHECKING, Optional - -from airavata_sdk.helpers._envelope import WithAccess -from airavata_sdk.helpers.models import ( - GroupResourceProfileCreate, - WorkspaceDefaultsModel, - proto_enum_value, -) - -if TYPE_CHECKING: - from airavata_sdk.client import AiravataClient - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.computeresource import ( # noqa: E501 - compute_resource_pb2, - ) - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.gatewayprofile import ( # noqa: E501 - gateway_profile_pb2, - ) - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.groupresourceprofile import ( # noqa: E501 - group_resource_profile_pb2, - ) - - -def _jsp_enum(): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.computeresource import ( # noqa: E501 - compute_resource_pb2, - ) - return compute_resource_pb2.JobSubmissionProtocol - - -def _dmp_enum(): - from airavata_sdk.generated.org.apache.airavata.model.data.movement import ( # noqa: E501 - data_movement_pb2, - ) - return data_movement_pb2.DataMovementProtocol - - -# StoragePreference — bare proto, no envelope (a flat message with no ownership -# or sharing fields). Write path builds the proto via _build_storage_preference. - - -def list_gateway_storage_preferences( - client: "AiravataClient", - gateway_id: str, -) -> "list[gateway_profile_pb2.StoragePreference]": - return list(client.compute.get_all_gateway_storage_preferences(gateway_id)) - - -def get_gateway_storage_preference( - client: "AiravataClient", - gateway_id: str, - storage_resource_id: str, -) -> "gateway_profile_pb2.StoragePreference": - return client.compute.get_gateway_storage_preference( - gateway_id, storage_resource_id) - - -def create_gateway_storage_preference( - client: "AiravataClient", - gateway_id: str, - data: dict, -) -> "gateway_profile_pb2.StoragePreference": - pref = _build_storage_preference(data) - client.compute.add_gateway_storage_preference( - gateway_id, pref.storage_resource_id, pref) - return get_gateway_storage_preference( - client, gateway_id, pref.storage_resource_id) - - -def update_gateway_storage_preference( - client: "AiravataClient", - gateway_id: str, - storage_resource_id: str, - data: dict, -) -> "gateway_profile_pb2.StoragePreference": - """The ``storage_resource_id`` path value overrides any value in *data*.""" - merged = dict(data) - merged["storage_resource_id"] = storage_resource_id - pref = _build_storage_preference(merged) - client.compute.update_gateway_storage_preference( - gateway_id, storage_resource_id, pref) - return get_gateway_storage_preference( - client, gateway_id, storage_resource_id) - - -def delete_gateway_storage_preference( - client: "AiravataClient", - gateway_id: str, - storage_resource_id: str, -) -> None: - client.compute.delete_gateway_storage_preference( - gateway_id, storage_resource_id) - - -# GatewayResourceProfile — WithAccess (gateway-catalog: no owner, so is_owner is -# always False; user_has_write_access is the gateway-admin flag the ViewSet -# supplies as has_write, not a sharing lookup). - - -def get_gateway_resource_profile( - client: "AiravataClient", - gateway_id: str, - *, - has_write: bool, -) -> "WithAccess": - p = client.compute.get_gateway_resource_profile(gateway_id) - return WithAccess( - message=p, - is_owner=False, - user_has_write_access=has_write, - ) - - -def _build_storage_preference(data: dict): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.gatewayprofile import ( # noqa: E501 - gateway_profile_pb2, - ) - return gateway_profile_pb2.StoragePreference( - storage_resource_id=data.get("storage_resource_id") or "", - login_user_name=data.get("login_user_name") or "", - file_system_root_location=data.get("file_system_root_location") or "", - resource_specific_credential_store_token=data.get( - "resource_specific_credential_store_token") or "", - ) - - -def _build_compute_resource_preference(data: dict): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.gatewayprofile import ( # noqa: E501 - gateway_profile_pb2, - ) - return gateway_profile_pb2.ComputeResourcePreference( - compute_resource_id=data.get("compute_resource_id") or "", - # decamelized incoming ``overridebyAiravata`` -> ``overrideby_airavata`` - override_by_airavata=bool(data.get("overrideby_airavata", False)), - login_user_name=data.get("login_user_name") or "", - preferred_job_submission_protocol=proto_enum_value( - _jsp_enum(), data.get("preferred_job_submission_protocol")), - preferred_data_movement_protocol=proto_enum_value( - _dmp_enum(), data.get("preferred_data_movement_protocol")), - preferred_batch_queue=data.get("preferred_batch_queue") or "", - scratch_location=data.get("scratch_location") or "", - allocation_project_number=data.get("allocation_project_number") or "", - resource_specific_credential_store_token=data.get( - "resource_specific_credential_store_token") or "", - usage_reporting_gateway_id=data.get("usage_reporting_gateway_id") or "", - quality_of_service=data.get("quality_of_service") or "", - reservation=data.get("reservation") or "", - reservation_start_time=data.get("reservation_start_time") or 0, - reservation_end_time=data.get("reservation_end_time") or 0, - ssh_account_provisioner=data.get("ssh_account_provisioner") or "", - ssh_account_provisioner_config=dict( - data.get("ssh_account_provisioner_config") or {}), - ssh_account_provisioner_additional_info=data.get( - "ssh_account_provisioner_additional_info") or "", - ) - - -def build_gateway_resource_profile( - data: dict, -) -> "gateway_profile_pb2.GatewayResourceProfile": - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.gatewayprofile import ( # noqa: E501 - gateway_profile_pb2, - ) - return gateway_profile_pb2.GatewayResourceProfile( - gateway_id=data.get("gateway_id") or "", - credential_store_token=data.get("credential_store_token") or "", - compute_resource_preferences=[ - _build_compute_resource_preference(c) - for c in (data.get("compute_resource_preferences") or []) - ], - storage_preferences=[ - _build_storage_preference(s) - for s in (data.get("storage_preferences") or []) - ], - identity_server_tenant=data.get("identity_server_tenant") or "", - identity_server_pwd_cred_token=data.get( - "identity_server_pwd_cred_token") or "", - ) - - -def update_gateway_resource_profile( - client: "AiravataClient", - gateway_id: str, - data: dict, - *, - has_write: bool, -) -> "WithAccess": - profile = build_gateway_resource_profile(data) - client.compute.update_gateway_resource_profile(gateway_id, profile) - return get_gateway_resource_profile( - client, gateway_id, has_write=has_write) - - -# ComputeResourceDescription — bare proto, no envelope (no ownership/sharing). - - -def get_compute_resource( - client: "AiravataClient", - compute_resource_id: str, -) -> "compute_resource_pb2.ComputeResourceDescription": - return client.compute.get_compute_resource(compute_resource_id) - - -def list_compute_resource_names(client: "AiravataClient") -> dict[str, str]: - """The ``{compute_resource_id: host_name}`` map, passed straight through.""" - return client.compute.get_all_compute_resource_names() - - -# GroupResourceProfile — WithAccess. The profile has no owner (is_owner always -# False). user_has_write_access is NOT a single chained sharing lookup but a -# COMPOSITE request-bound boolean (WRITE on the profile AND READ on every -# credential token), so the ViewSet computes it and passes it in as has_write. - - -def _grp_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.groupresourceprofile import ( # noqa: E501 - group_resource_profile_pb2, - ) - return group_resource_profile_pb2 - - -# GroupResourceProfile: write builders (snake_case dict -> proto). - - -def _build_ssh_provisioner_config(c: dict): - grp = _grp_pb2() - return grp.GroupAccountSSHProvisionerConfig( - resource_id=c.get("resource_id", "") or "", - group_resource_profile_id=c.get("group_resource_profile_id", "") or "", - config_name=c.get("config_name", "") or "", - config_value=c.get("config_value", "") or "", - ) - - -def _build_reservation(r: dict): - grp = _grp_pb2() - return grp.ComputeResourceReservation( - reservation_id=r.get("reservation_id", "") or "", - reservation_name=r.get("reservation_name", "") or "", - queue_names=list(r.get("queue_names", []) or []), - start_time=r.get("start_time", 0) or 0, - end_time=r.get("end_time", 0) or 0, - ) - - -def _build_slurm_pref(s: dict): - grp = _grp_pb2() - return grp.SlurmComputeResourcePreference( - allocation_project_number=s.get("allocation_project_number", "") or "", - preferred_batch_queue=s.get("preferred_batch_queue", "") or "", - quality_of_service=s.get("quality_of_service", "") or "", - usage_reporting_gateway_id=s.get("usage_reporting_gateway_id", "") or "", - ssh_account_provisioner=s.get("ssh_account_provisioner", "") or "", - group_ssh_account_provisioner_configs=[ - _build_ssh_provisioner_config(c) - for c in (s.get("group_ssh_account_provisioner_configs", []) or [])], - ssh_account_provisioner_additional_info=s.get( - "ssh_account_provisioner_additional_info", "") or "", - reservations=[ - _build_reservation(r) - for r in (s.get("reservations", []) or [])], - ) - - -def _build_aws_pref(a: dict): - grp = _grp_pb2() - return grp.AwsComputeResourcePreference( - region=a.get("region", "") or "", - preferred_ami_id=a.get("preferred_ami_id", "") or "", - preferred_instance_type=a.get("preferred_instance_type", "") or "", - ) - - -def _build_group_compute_resource_preference(d: dict): - """The write payload's ``specific_preferences`` (a ``{'slurm': {...}}`` / AWS - dict) plus a flattened ``allocation_project_number`` / ``resource_type`` are - mapped into the proto oneof. Enums resolve via the proto enum (NAME or proto int). - """ - grp = _grp_pb2() - sp = d.get("specific_preferences") - resource_type = proto_enum_value(grp.ResourceType, d.get("resource_type")) - msg = grp.GroupComputeResourcePreference( - compute_resource_id=d.get("compute_resource_id", "") or "", - group_resource_profile_id=d.get("group_resource_profile_id", "") or "", - override_by_airavata=bool(d.get("overrideby_airavata", False)), - login_user_name=d.get("login_user_name", "") or "", - scratch_location=d.get("scratch_location", "") or "", - preferred_job_submission_protocol=proto_enum_value( - _jsp_enum(), d.get("preferred_job_submission_protocol")), - preferred_data_movement_protocol=proto_enum_value( - _dmp_enum(), d.get("preferred_data_movement_protocol")), - resource_specific_credential_store_token=d.get( - "resource_specific_credential_store_token", "") or "", - resource_type=resource_type, - ) - # Resolve the union: prefer an explicit specific_preferences, else infer - # from the flattened allocation_project_number / resource_type / aws fields. - slurm_data = None - aws_data = None - if isinstance(sp, dict): - if "slurm" in sp and isinstance(sp["slurm"], dict): - slurm_data = dict(sp["slurm"]) - elif "aws" in sp and isinstance(sp["aws"], dict): - aws_data = dict(sp["aws"]) - elif "region" in sp or "preferred_ami_id" in sp: - aws_data = dict(sp) - elif sp: - slurm_data = dict(sp) - if slurm_data is None and aws_data is None: - proto_resource_type = grp.ResourceType - if resource_type == proto_resource_type.AWS or "region" in d: - aws_data = {} - elif ("allocation_project_number" in d - or resource_type == proto_resource_type.SLURM): - slurm_data = {} - if "allocation_project_number" in d and slurm_data is not None: - slurm_data.setdefault( - "allocation_project_number", d["allocation_project_number"]) - if slurm_data is not None: - msg.specific_preferences.CopyFrom(grp.EnvironmentSpecificPreferences( - slurm=_build_slurm_pref(slurm_data))) - elif aws_data is not None: - msg.specific_preferences.CopyFrom(grp.EnvironmentSpecificPreferences( - aws=_build_aws_pref(aws_data))) - return msg - - -def _build_compute_resource_policy(d: dict): - grp = _grp_pb2() - return grp.ComputeResourcePolicy( - resource_policy_id=d.get("resource_policy_id", "") or "", - compute_resource_id=d.get("compute_resource_id", "") or "", - group_resource_profile_id=d.get("group_resource_profile_id", "") or "", - allowed_batch_queues=list(d.get("allowed_batch_queues", []) or []), - ) - - -def _build_batch_queue_resource_policy(d: dict): - grp = _grp_pb2() - return grp.BatchQueueResourcePolicy( - resource_policy_id=d.get("resource_policy_id", "") or "", - compute_resource_id=d.get("compute_resource_id", "") or "", - group_resource_profile_id=d.get("group_resource_profile_id", "") or "", - queuename=d.get("queuename", "") or "", - max_allowed_nodes=d.get("max_allowed_nodes", 0) or 0, - max_allowed_cores=d.get("max_allowed_cores", 0) or 0, - max_allowed_walltime=d.get("max_allowed_walltime", 0) or 0, - ) - - -def build_group_resource_profile( - client: "AiravataClient", - data: dict, -) -> "group_resource_profile_pb2.GroupResourceProfile": - """``gateway_id`` is forced from the client context.""" - grp = _grp_pb2() - return grp.GroupResourceProfile( - gateway_id=client.gateway_id or "", - group_resource_profile_id=data.get( - "group_resource_profile_id", "") or "", - group_resource_profile_name=data.get( - "group_resource_profile_name", "") or "", - compute_preferences=[ - _build_group_compute_resource_preference(p) - for p in (data.get("compute_preferences", []) or [])], - compute_resource_policies=[ - _build_compute_resource_policy(p) - for p in (data.get("compute_resource_policies", []) or [])], - batch_queue_resource_policies=[ - _build_batch_queue_resource_policy(p) - for p in (data.get("batch_queue_resource_policies", []) or [])], - default_credential_store_token=data.get( - "default_credential_store_token", "") or "", - ) - - -def list_group_resource_profiles( - client: "AiravataClient", - *, - has_write_by_id: Optional[dict] = None, -) -> "list[WithAccess]": - """*has_write_by_id* maps ``group_resource_profile_id`` -> the composite - write flag the ViewSet resolved; ids absent from the map default to ``False``. - """ - by_id = has_write_by_id or {} - profiles = client.compute.get_group_resource_list() - return [ - WithAccess( - message=g, - is_owner=False, - user_has_write_access=bool( - by_id.get(g.group_resource_profile_id, False)), - ) - for g in profiles - ] - - -def get_group_resource_profile( - client: "AiravataClient", - group_resource_profile_id: str, - *, - has_write: bool, -) -> "WithAccess": - g = client.compute.get_group_resource_profile(group_resource_profile_id) - return WithAccess( - message=g, - is_owner=False, - user_has_write_access=has_write, - ) - - -def create_group_resource_profile( - client: "AiravataClient", - data: "GroupResourceProfileCreate | dict", - *, - has_write: bool = True, -) -> "WithAccess": - """The server mints the id; the creator can write, so *has_write* defaults - to ``True``. - """ - data = GroupResourceProfileCreate.model_validate(data).model_dump( - exclude_unset=True) - grp = build_group_resource_profile(client, data) - created = client.compute.create_group_resource_profile(grp) - return WithAccess( - message=created, - is_owner=False, - user_has_write_access=has_write, - ) - - -def update_group_resource_profile( - client: "AiravataClient", - group_resource_profile_id: str, - data: "GroupResourceProfileCreate | dict", - *, - has_write: bool = True, -) -> "WithAccess": - """Orphaned compute prefs / policies no longer present are removed - individually before ``UpdateGroupResourceProfile``. The path id is - authoritative; the updated proto is re-fetched (the update RPC returns Empty). - """ - data = GroupResourceProfileCreate.model_validate(data).model_dump( - exclude_unset=True) - grp = build_group_resource_profile(client, data) - grp.group_resource_profile_id = group_resource_profile_id - original = client.compute.get_group_resource_profile( - group_resource_profile_id) - # Remove compute prefs / policies that are no longer present. - new_pref_ids = { - cp.compute_resource_id for cp in grp.compute_preferences} - for cp in original.compute_preferences: - if cp.compute_resource_id not in new_pref_ids: - client.compute.remove_group_compute_prefs( - cp.group_resource_profile_id, cp.compute_resource_id) - new_policy_ids = { - p.resource_policy_id for p in grp.compute_resource_policies} - for p in original.compute_resource_policies: - if p.resource_policy_id and p.resource_policy_id not in new_policy_ids: - client.compute.remove_group_compute_resource_policy( - p.resource_policy_id) - new_bq_ids = { - p.resource_policy_id for p in grp.batch_queue_resource_policies} - for p in original.batch_queue_resource_policies: - if p.resource_policy_id and p.resource_policy_id not in new_bq_ids: - client.compute.remove_group_batch_queue_resource_policy( - p.resource_policy_id) - client.compute.update_group_resource_profile( - group_resource_profile_id, grp) - return get_group_resource_profile( - client, group_resource_profile_id, has_write=has_write) - - -def delete_group_resource_profile( - client: "AiravataClient", - group_resource_profile_id: str, -) -> None: - client.compute.remove_group_resource_profile(group_resource_profile_id) - - -# Per-protocol job submission (Local / SSH / Unicore / Cloud) — bare proto. - - -def get_local_job_submission( - client: "AiravataClient", - submission_id: str, -): - return client.compute.get_local_job_submission(submission_id) - - -def get_ssh_job_submission( - client: "AiravataClient", - submission_id: str, -): - return client.compute.get_ssh_job_submission(submission_id) - - -def get_unicore_job_submission( - client: "AiravataClient", - submission_id: str, -): - return client.compute.get_unicore_job_submission(submission_id) - - -def get_cloud_job_submission( - client: "AiravataClient", - submission_id: str, -): - return client.compute.get_cloud_job_submission(submission_id) - - -# Workspace defaults: the "talk to Airavata" grunt the portal -# WorkspacePreferencesHelper did inline — resolve sensible defaults for a fresh -# record and validate a stored record against the server. Return plain -# scalars/lists (no contract dict); the ORM read/write stays in the portal. - - -def user_can_write(client: "AiravataClient", resource_id: str) -> bool: - return client.sharing.user_has_access( - resource_id=resource_id, - user_id=client.username, - permission_type="WRITE", - ) - - -def most_recent_writeable_project_id( - client: "AiravataClient", -) -> Optional[str]: - """Id of the caller's first WRITE-accessible project (newest first), or None.""" - projects = client.research.get_user_projects( - gateway_id=client.gateway_id, - user_name=client.username, - limit=-1, - offset=0, - ) - for project in projects: - if user_can_write(client, project.project_id): - return project.project_id - return None - - -def accessible_group_resource_profile_ids( - client: "AiravataClient", -) -> list[str]: - profiles = client.compute.get_group_resource_list() - return [g.group_resource_profile_id for g in profiles] - - -def resolve_workspace_defaults(client: "AiravataClient") -> dict: - """Server-derived defaults the portal persists into its own ORM record: - first WRITE-accessible project id, all accessible group-resource-profile ids - (server order), and the first of those. - """ - grp_ids = accessible_group_resource_profile_ids(client) - return WorkspaceDefaultsModel.model_validate({ - "most_recent_project_id": most_recent_writeable_project_id(client), - "group_resource_profile_ids": grp_ids, - "most_recent_group_resource_profile_id": grp_ids[0] if grp_ids else None, - }).model_dump() diff --git a/airavata-python-sdk/airavata_sdk/helpers/credential_resources.py b/airavata-python-sdk/airavata_sdk/helpers/credential_resources.py deleted file mode 100644 index 5057de7e91d..00000000000 --- a/airavata-python-sdk/airavata_sdk/helpers/credential_resources.py +++ /dev/null @@ -1,120 +0,0 @@ -"""Credential-domain helpers. A ``CredentialSummary`` is returned in a -:class:`~airavata_sdk.helpers._envelope.WithAccess`: ``is_owner`` is always -``False`` (a credential has no owner) and ``user_has_write_access`` is a chained -``sharing.user_has_access`` WRITE lookup keyed on the credential ``token``. -""" - -from __future__ import annotations - -from typing import TYPE_CHECKING - -from airavata_sdk.helpers._envelope import WithAccess - -if TYPE_CHECKING: - from airavata_sdk.client import AiravataClient - - -def _has_write(client: "AiravataClient", token: str) -> bool: - return client.sharing.user_has_access( - resource_id=token, - user_id=client.username, - permission_type="WRITE", - ) - - -def get_credential_summary( - client: "AiravataClient", - token_id: str, -) -> "WithAccess": - c = client.credential.get_credential_summary(token_id, client.gateway_id) - return WithAccess( - message=c, - is_owner=False, - user_has_write_access=_has_write(client, c.token), - ) - - -def get_all_credential_summaries( - client: "AiravataClient", - *, - summary_type=None, -) -> "list[WithAccess]": - """When *summary_type* is ``None`` the SSH and PASSWD summaries are - concatenated (the portal list endpoint); otherwise only that type is fetched. - """ - from airavata_sdk.generated.org.apache.airavata.model.credential.store import ( # noqa: E501 - credential_store_pb2, - ) - - if summary_type is None: - summaries = ( - client.credential.get_all_credential_summaries( - client.gateway_id, credential_store_pb2.SummaryType.SSH) - + client.credential.get_all_credential_summaries( - client.gateway_id, credential_store_pb2.SummaryType.PASSWD) - ) - else: - summaries = client.credential.get_all_credential_summaries( - client.gateway_id, summary_type) - return [ - WithAccess( - message=c, - is_owner=False, - user_has_write_access=_has_write(client, c.token), - ) - for c in summaries - ] - - -def create_ssh_credential( - client: "AiravataClient", - data: dict, -) -> "WithAccess": - """``gateway_id`` / ``username`` come from the client context; only - ``description`` is read from *data*. Re-fetched so the shape matches the read - path. - """ - token_id = client.credential.generate_and_register_ssh_keys( - client.gateway_id, - client.username, - data.get("description") or "", - ) - return get_credential_summary(client, token_id) - - -def create_password_credential( - client: "AiravataClient", - data: dict, -) -> "WithAccess": - """``gateway_id`` / ``portal_user_name`` come from the client context; - ``login_user_name`` (wire ``username``) / ``password`` / ``description`` from - *data*. Re-fetched so the shape matches the read path. - """ - from airavata_sdk.generated.org.apache.airavata.model.credential.store import ( # noqa: E501 - credential_store_pb2, - ) - - password_credential = credential_store_pb2.PasswordCredential( - gateway_id=client.gateway_id or "", - portal_user_name=client.username or "", - login_user_name=data.get("username") or "", - password=data.get("password") or "", - description=data.get("description") or "", - ) - token_id = client.credential.register_pwd_credential( - client.gateway_id, password_credential) - return get_credential_summary(client, token_id) - - -def delete_credential_summary(client: "AiravataClient", summary) -> None: - """Dispatch on *summary*'s ``SummaryType``: SSH via ``DeleteSSHPubKey``, - PASSWD via ``DeletePWDCredential``. - """ - from airavata_sdk.generated.org.apache.airavata.model.credential.store import ( # noqa: E501 - credential_store_pb2, - ) - - if summary.type == credential_store_pb2.SummaryType.SSH: - client.credential.delete_ssh_pub_key(summary.token, client.gateway_id) - elif summary.type == credential_store_pb2.SummaryType.PASSWD: - client.credential.delete_pwd_credential(summary.token, client.gateway_id) diff --git a/airavata-python-sdk/airavata_sdk/helpers/experiment_orchestration.py b/airavata-python-sdk/airavata_sdk/helpers/experiment_orchestration.py deleted file mode 100644 index 474992e756a..00000000000 --- a/airavata-python-sdk/airavata_sdk/helpers/experiment_orchestration.py +++ /dev/null @@ -1,452 +0,0 @@ -"""Experiment orchestration helpers over the gRPC facades. Every function takes -an :class:`~airavata_sdk.client.AiravataClient` plus explicit keyword arguments; -``experiment`` arguments are proto ``ExperimentModel`` instances. -""" - -from __future__ import annotations - -import logging -import os -from typing import TYPE_CHECKING, Optional -from urllib.parse import unquote, urlparse - -# Importing ``airavata_sdk.generated`` puts the generated proto root on sys.path -# so the absolute ``from org.apache.airavata...`` imports inside the stubs resolve. -import airavata_sdk.generated # noqa: F401 -from airavata_sdk.generated.org.apache.airavata.model.application.io import ( - application_io_pb2, -) -from airavata_sdk.generated.org.apache.airavata.model.data.replica import ( - replica_catalog_pb2, -) -from airavata_sdk.generated.org.apache.airavata.model.status import status_pb2 -from airavata_sdk.generated.org.apache.airavata.model.task import task_pb2 - -if TYPE_CHECKING: - from airavata_sdk.client import AiravataClient - from airavata_sdk.generated.org.apache.airavata.model.experiment import ( - experiment_pb2, - ) - -logger = logging.getLogger(__name__) - -# Directory (relative to the user's storage root) where freshly uploaded input -# files land before they are moved into a launched experiment's data directory. -TMP_INPUT_FILE_UPLOAD_DIR = "tmp" - -# Permission name understood by the sharing service (it does -# ResourcePermissionType.valueOf(permission_type) server-side). -_WRITE_PERMISSION = "WRITE" - -# Terminal process states for intermediate-output fetching. -_TERMINAL_PROCESS_STATES = ( - status_pb2.PROCESS_STATE_CANCELED, - status_pb2.PROCESS_STATE_COMPLETED, - status_pb2.PROCESS_STATE_FAILED, -) - - -def _gateway_data_store_replica(data_product): - """The GATEWAY_DATA_STORE replica, or the first replica, or None.""" - replicas = [ - rep - for rep in data_product.replica_locations - if rep.replica_location_category == replica_catalog_pb2.GATEWAY_DATA_STORE - ] - if replicas: - return replicas[0] - return data_product.replica_locations[0] if data_product.replica_locations else None - - -def _replica_filesystem_path(replica): - """The plain filesystem path from a replica's file_path (which may be stored - as ``file://:`` or URL-encoded). - """ - if replica is None or not replica.file_path: - return None - return unquote(urlparse(replica.file_path).path) - - -def is_input_file( - data_product: "replica_catalog_pb2.DataProductModel", -) -> bool: - """True iff the gateway-data-store replica's file_path lives directly under - the tmp upload dir. - """ - replica = _gateway_data_store_replica(data_product) - path = _replica_filesystem_path(replica) - if path is None: - return False - return os.path.basename(os.path.dirname(path)) == TMP_INPUT_FILE_UPLOAD_DIR - - -def launch( - client: "AiravataClient", - experiment_id: str, - *, - username: str, -) -> None: - """Set storage ids + data dir, move tmp input uploads into it, persist, launch.""" - experiment = client.research.get_experiment(experiment_id) - _set_storage_id_and_data_dir(client, experiment, username=username) - _move_tmp_input_file_uploads_to_data_dir(client, experiment) - client.research.update_experiment(experiment_id, experiment) - client.research.launch_experiment(experiment_id, gateway_id=client.gateway_id) - - -def _set_storage_id_and_data_dir(client, experiment, *, username): - """Default input/output storage to the gateway default, then ensure - ``experiment_data_dir`` is set, creating the directory on storage if needed. - """ - default_storage_id = client.storage.get_default_storage_resource_id() - - user_config = experiment.user_configuration_data - user_config.input_storage_resource_id = default_storage_id - user_config.output_storage_resource_id = default_storage_id - - if not user_config.experiment_data_dir: - project = client.research.get_project(experiment.project_id) - # "/" under the storage root (spaces -> underscores). - exp_dir = "/".join( - _sanitize_path_component(part) - for part in (project.name, experiment.experiment_name) - ) - # TODO(sdk-consolidation): the storage facade's create_dir has no - # uniqueness guarantee, so two experiments with the same project+name - # share a data dir (the old create_user_dir(create_unique=True) suffixed - # on collision). A create_unique option would restore old behavior. - resp = client.storage.create_dir(exp_dir, storage_resource_id=default_storage_id) - created = getattr(resp, "created_path", "") or exp_dir - user_config.experiment_data_dir = created - else: - client.storage.create_dir( - user_config.experiment_data_dir, storage_resource_id=default_storage_id - ) - - -def _sanitize_path_component(name): - return (name or "").strip().replace(" ", "_") - - -def _move_tmp_input_file_uploads_to_data_dir(client, experiment): - """Relocate any URI / URI_COLLECTION input that is a tmp upload into the - experiment data dir, rewriting the input value to the (same) data-product URI. - """ - exp_data_dir = experiment.user_configuration_data.experiment_data_dir - storage_id = experiment.user_configuration_data.input_storage_resource_id or None - for experiment_input in experiment.experiment_inputs: - if experiment_input.type == application_io_pb2.URI: - if experiment_input.value: - experiment_input.value = _move_if_tmp_input_file_upload( - client, experiment_input.value, exp_data_dir, storage_id - ) - elif experiment_input.type == application_io_pb2.URI_COLLECTION: - data_product_uris = ( - experiment_input.value.split(",") if experiment_input.value else [] - ) - moved_uris = [ - _move_if_tmp_input_file_upload(client, uri, exp_data_dir, storage_id) - for uri in data_product_uris - ] - experiment_input.value = ",".join(moved_uris) - - -def _move_if_tmp_input_file_upload(client, data_product_uri, experiment_data_dir, storage_id): - """If a tmp upload, relocate the bytes and repoint the replica's file_path in - place — preserving the data-product URI. Returns the (same) URI. - """ - data_product = client.research.get_data_product(data_product_uri) - if not is_input_file(data_product): - return data_product_uri - - replica = _gateway_data_store_replica(data_product) - source_path = _replica_filesystem_path(replica) - if source_path is None: - logger.warning("No replica file path for data product %s; skipping move", data_product_uri) - return data_product_uri - - file_name = data_product.product_name or os.path.basename(source_path) - dest_path = _join_storage_path(experiment_data_dir, file_name) - - client.storage.move_file(source_path, dest_path, storage_resource_id=storage_id) - - # Repoint the replica's file_path to the new location and persist it. - if replica.replica_id: - replica.file_path = dest_path - # TODO(sdk-consolidation): update_replica_location persists the new - # file_path against the existing replica_id, preserving the data-product - # URI. Verify round-trip against a live backend during portal - # integration (research-service must honor a bare path as file_path). - client.research.update_replica_location(replica.replica_id, replica) - else: - logger.warning( - "Replica for data product %s has no replica_id; " - "moved bytes but could not repoint replica file_path", - data_product_uri, - ) - return data_product_uri - - -def _join_storage_path(directory, name): - if not directory: - return name - return directory.rstrip("/") + "/" + name - - -def clone( - client: "AiravataClient", - experiment_id: str, - *, - username: str, - project_id: Optional[str] = None, -) -> str: - """Clone into a writeable project (the given *project_id*, else the source's, - else the first writeable), copy input files into fresh tmp uploads, null the - data dir, persist. Returns the cloned id. - """ - experiment = client.research.get_experiment(experiment_id) - target_project_id = project_id or _get_writeable_project(client, experiment, username=username) - - cloned_experiment_id = client.research.clone_experiment( - experiment_id, - new_experiment_name="Clone of {}".format(experiment.experiment_name), - new_experiment_project_id=target_project_id, - ) - cloned_experiment = client.research.get_experiment(cloned_experiment_id) - - _copy_cloned_experiment_input_uris(client, cloned_experiment, username=username) - - # Null experiment_data_dir so a fresh one is created at launch time. - cloned_experiment.user_configuration_data.experiment_data_dir = "" - client.research.update_experiment(cloned_experiment.experiment_id, cloned_experiment) - return cloned_experiment_id - - -def _get_writeable_project(client, experiment, *, username): - """The experiment's own project if writeable, else the first writeable one.""" - project_id = experiment.project_id - if _can_write(client, project_id, username=username): - return project_id - user_projects = client.research.get_user_projects( - client.gateway_id, username, limit=-1, offset=0 - ) - for user_project in user_projects: - if _can_write(client, user_project.project_id, username=username): - return user_project.project_id - raise Exception( - "Could not find writeable project for user {} in gateway {}".format( - username, client.gateway_id - ) - ) - - -def _can_write(client, entity_id, *, username) -> bool: - return client.sharing.user_has_access(entity_id, username, _WRITE_PERMISSION) - - -def _copy_cloned_experiment_input_uris(client, cloned_experiment, *, username): - """Copy each referenced data product into a fresh tmp upload and rewrite the - input value to the new URI. Missing source files are dropped (URI) / omitted - (URI_COLLECTION). - """ - for experiment_input in cloned_experiment.experiment_inputs: - if not experiment_input.value: - continue - if experiment_input.type == application_io_pb2.URI: - cloned_uri = _copy_experiment_input_uri(client, experiment_input.value, username=username) - if cloned_uri is None: - logger.warning("Setting cloned input %s to null", experiment_input.name) - experiment_input.value = "" - else: - experiment_input.value = cloned_uri - elif experiment_input.type == application_io_pb2.URI_COLLECTION: - data_product_uris = experiment_input.value.split(",") if experiment_input.value else [] - cloned_uris = [] - for uri in data_product_uris: - cloned_uri = _copy_experiment_input_uri(client, uri, username=username) - if cloned_uri is None: - logger.warning("Omitting a cloned input value for %s", experiment_input.name) - else: - cloned_uris.append(cloned_uri) - experiment_input.value = ",".join(cloned_uris) - - -def _copy_experiment_input_uri(client, data_product_uri, *, username): - """The storage facade has no copy primitive, so download the source bytes, - re-upload to a fresh tmp path, and register a new data product. Returns the - new URI, or None if the source file does not exist. - """ - source_product = client.research.get_data_product(data_product_uri) - replica = _gateway_data_store_replica(source_product) - source_path = _replica_filesystem_path(replica) - storage_id = replica.storage_resource_id if replica is not None else None - - if source_path is None or not client.storage.file_exists( - source_path, storage_resource_id=storage_id or None - ): - logger.warning("Could not find file for source data product %s", data_product_uri) - return None - - download = client.storage.download_file(source_path, storage_resource_id=storage_id or None) - file_name = source_product.product_name or os.path.basename(source_path) - dest_path = _join_storage_path(TMP_INPUT_FILE_UPLOAD_DIR, file_name) - - content_type = source_product.product_metadata.get("mime-type", "") - client.storage.upload_file( - dest_path, - download.content, - file_name, - storage_resource_id=storage_id or None, - content_type=content_type, - ) - - # The facade's upload returns a DataProductModel without a URI; register it - # explicitly to mint a persistent URI. - new_product = _build_copy_data_product( - client, source_product, dest_path, file_name, storage_id, username - ) - new_uri = client.research.register_data_product(new_product) - return new_uri - - -def _build_copy_data_product(client, source_product, dest_path, file_name, storage_id, username): - """Build an unsaved DataProductModel for a copied input file.""" - replica = replica_catalog_pb2.DataReplicaLocationModel( - storage_resource_id=storage_id or "", - replica_name="{} gateway data store copy".format(file_name), - replica_location_category=replica_catalog_pb2.GATEWAY_DATA_STORE, - replica_persistent_type=replica_catalog_pb2.TRANSIENT, - file_path=dest_path, - ) - metadata = dict(source_product.product_metadata) - return replica_catalog_pb2.DataProductModel( - gateway_id=client.gateway_id, - owner_name=username, - product_name=file_name, - data_product_type=replica_catalog_pb2.FILE, - product_metadata=metadata, - replica_locations=[replica], - ) - - -# --------------------------------------------------------------------------- -# Intermediate output -# --------------------------------------------------------------------------- - -def _get_output_fetching_processes(experiment): - """Most-recent-first list of the experiment's output-fetching processes.""" - processes = ( - sorted(experiment.processes, key=lambda p: p.creation_time, reverse=True) - if experiment.processes - else [] - ) - return [ - process - for process in processes - if any(task.task_type == task_pb2.OUTPUT_FETCHING for task in process.tasks) - ] - - -def get_intermediate_output_process_status( - client: "AiravataClient", - experiment: "experiment_pb2.ExperimentModel", - *output_names: str, -) -> "Optional[status_pb2.ProcessStatus]": - """ProcessStatus of the intermediate-output fetch process, or None (no - output-fetching processes / backend error). ``output_names`` is accepted for - signature compatibility but the facade does not filter by it (see TODO). - """ - output_fetching_processes = _get_output_fetching_processes(experiment) - if not output_fetching_processes: - return None - try: - # TODO(sdk-consolidation): research facade - # get_intermediate_output_process_status(experiment_id) does not accept - # output names; the old Thrift API filtered by output name. If - # per-output status is required, the proto - # GetIntermediateOutputProcessStatusRequest needs an output_names field. - return client.research.get_intermediate_output_process_status(experiment.experiment_id) - except Exception: - logger.debug("Failed to get intermediate output process status", exc_info=True) - return None - - -def can_fetch_intermediate_output( - client: "AiravataClient", - experiment: "experiment_pb2.ExperimentModel", - output_name: str, -) -> bool: - """True only when at least one job is ACTIVE and there is no in-progress - (non-terminal) intermediate-output process. - """ - jobs = [] - for process in experiment.processes: - for task in process.tasks: - for job in task.jobs: - jobs.append(job) - - def latest_status_is_active(job): - if not job.job_statuses: - return False - return job.job_statuses[-1].job_state == status_pb2.ACTIVE - - if not any(latest_status_is_active(job) for job in jobs): - return False - - try: - process_status = get_intermediate_output_process_status(client, experiment, output_name) - # If there's no running process, status is None -> treat as fetchable. - if process_status is None: - return True - return process_status.state in _TERMINAL_PROCESS_STATES - except Exception: - # An error here likely means there is no currently running process. - return True - - -def fetch_intermediate_output( - client: "AiravataClient", - experiment_id: str, - *output_names: str, -): - """Start a fetch of the output file(s) for a currently running experiment.""" - return client.research.get_intermediate_outputs( - experiment_id, output_names=list(output_names) - ) - - -def get_intermediate_output_data_products( - client: "AiravataClient", - experiment: "experiment_pb2.ExperimentModel", - output_name: str, -) -> list: - """DataProduct(s) for the named output: the most-recent completed - output-fetching process's matching output, with its data-product URIs resolved. - """ - output_fetching_processes = _get_output_fetching_processes(experiment) - - data_products = [] - if not output_fetching_processes: - return data_products - - most_recent_completed_output = None - for process in output_fetching_processes: - if ( - not process.process_statuses - or process.process_statuses[-1].state != status_pb2.PROCESS_STATE_COMPLETED - ): - continue - for process_output in process.process_outputs: - if process_output.name == output_name: - most_recent_completed_output = process_output - break - if most_recent_completed_output is not None: - break - - if most_recent_completed_output is not None: - data_product_uris = [] - if most_recent_completed_output.value.startswith("airavata-dp://"): - data_product_uris = most_recent_completed_output.value.split(",") - for uri in data_product_uris: - data_products.append(client.research.get_data_product(uri)) - return data_products diff --git a/airavata-python-sdk/airavata_sdk/helpers/iam_resources.py b/airavata-python-sdk/airavata_sdk/helpers/iam_resources.py deleted file mode 100644 index 4bfef52a551..00000000000 --- a/airavata-python-sdk/airavata_sdk/helpers/iam_resources.py +++ /dev/null @@ -1,169 +0,0 @@ -"""IAM / user-profile helpers. - -Two families: - -* **user-profiles** (``get_user_profile`` / ``get_all_user_profiles_in_gateway``) - — read-only; the ``UserProfile`` proto is returned as-is (nothing - cross-service is computed). -* **IAM users** (:class:`IAMUser` / :class:`UnverifiedEmailUser`) — the - administrator-facing managed-account view backed by the Keycloak IAM-admin - facade (``GetUsers`` / ``GetUser``). A genuinely composed multi-source shape - (proto-derived scalars unioned with a sharing group list, two Django-ORM - lookups, a gateway-admin flag, and a ``DoesUserExist`` result), so it is a - pydantic model carrying plain JSON-able values the ViewSet supplies. -""" - -from __future__ import annotations - -from typing import TYPE_CHECKING, Any, Optional - -from pydantic import BaseModel, ConfigDict - -if TYPE_CHECKING: - from airavata_sdk.client import AiravataClient - from airavata_sdk.generated.org.apache.airavata.model.user import ( - user_profile_pb2, - ) - - -def get_user_profile( - client: "AiravataClient", - user_id: str, -) -> "user_profile_pb2.UserProfile": - return client.iam.get_user_profile_by_id(user_id, client.gateway_id) - - -def get_all_user_profiles_in_gateway( - client: "AiravataClient", - *, - offset: int = 0, - limit: int = -1, -) -> "list[user_profile_pb2.UserProfile]": - return list(client.iam.get_all_user_profiles_in_gateway( - client.gateway_id, offset, limit, - )) - - -# IAM user (managed Keycloak user). enabled/email_verified/email/creation_time -# are derived from the proto; the rest (DoesUserExist result, sharing group -# list, gateway-admin flag, two Django-ORM lookups) the ViewSet passes in. - - -class IAMUser(BaseModel): - model_config = ConfigDict(extra="forbid") - - airavata_internal_user_id: str - user_id: str - gateway_id: str - email: str - first_name: str - last_name: str - enabled: bool - email_verified: bool - creation_time: int - airavata_user_profile_exists: bool - user_has_write_access: bool - groups: list[dict[str, Any]] - external_idp_user_info: dict[str, Any] - user_profile_invalid_fields: list[Any] - - -class UnverifiedEmailUser(BaseModel): - """A strict subset of :class:`IAMUser`: proto-derived scalars plus - ``user_has_write_access``. - """ - - model_config = ConfigDict(extra="forbid") - - user_id: str - gateway_id: str - email: str - first_name: str - last_name: str - enabled: bool - email_verified: bool - creation_time: int - user_has_write_access: bool - - -def _iam_user_state_flags(state) -> tuple[bool, bool]: - """``(enabled, email_verified)``: enabled iff ACTIVE; email_verified iff - CONFIRMED or ACTIVE. - """ - from airavata_sdk.generated.org.apache.airavata.model.user import ( - user_profile_pb2, - ) - - Status = user_profile_pb2.Status - enabled = state == Status.ACTIVE - email_verified = state in (Status.CONFIRMED, Status.ACTIVE) - return enabled, email_verified - - -def get_iam_user( - client: "AiravataClient", - user_profile, - *, - airavata_user_profile_exists: bool, - user_has_write_access: bool, - groups: "Optional[list[dict[str, Any]]]" = None, - external_idp_user_info: "Optional[dict[str, Any]]" = None, - user_profile_invalid_fields: "Optional[list[Any]]" = None, -) -> IAMUser: - """Compose an already-fetched IAM ``UserProfile`` proto into an ``IAMUser``. - - The cross-service / request-scoped / ORM parts are supplied by the caller. - """ - enabled, email_verified = _iam_user_state_flags(user_profile.state) - return IAMUser( - airavata_internal_user_id=user_profile.airavata_internal_user_id, - user_id=user_profile.user_id, - gateway_id=user_profile.gateway_id, - email=user_profile.emails[0] if user_profile.emails else "", - first_name=user_profile.first_name, - last_name=user_profile.last_name, - enabled=enabled, - email_verified=email_verified, - creation_time=user_profile.creation_time, - airavata_user_profile_exists=airavata_user_profile_exists, - user_has_write_access=user_has_write_access, - groups=groups or [], - external_idp_user_info=external_idp_user_info or {}, - user_profile_invalid_fields=( - [] if user_profile_invalid_fields is None - else user_profile_invalid_fields), - ) - - -def get_unverified_email_user( - client: "AiravataClient", - user_profile, - *, - user_has_write_access: bool, -) -> UnverifiedEmailUser: - enabled, email_verified = _iam_user_state_flags(user_profile.state) - return UnverifiedEmailUser( - user_id=user_profile.user_id, - gateway_id=user_profile.gateway_id, - email=user_profile.emails[0] if user_profile.emails else "", - first_name=user_profile.first_name, - last_name=user_profile.last_name, - enabled=enabled, - email_verified=email_verified, - creation_time=user_profile.creation_time, - user_has_write_access=user_has_write_access, - ) - - -def list_iam_users( - client: "AiravataClient", - *, - offset: int = 0, - limit: int = -1, - search: str = "", -) -> list: - """Raw IAM ``UserProfile`` protos (``GetUsers``); the caller composes each - :class:`IAMUser` via :func:`get_iam_user` (per-user enrichment needs - per-user lookups). - """ - return client.iam.get_iam_users(offset=offset, limit=limit, search=search) diff --git a/airavata-python-sdk/airavata_sdk/helpers/models.py b/airavata-python-sdk/airavata_sdk/helpers/models.py deleted file mode 100644 index 9e5844a6672..00000000000 --- a/airavata-python-sdk/airavata_sdk/helpers/models.py +++ /dev/null @@ -1,167 +0,0 @@ -"""Write-path input models: permissive pydantic shapes naming the writable -fields the ``create_*`` / ``update_*`` helpers accept, so a caller can hand in a -plain snake_case dict and have it validated before it is assembled into a proto. - -Enum fields are ``int | str | None`` (member NAME string or historical Thrift -int); timestamp fields are ``int | str | None`` (epoch millis or ISO string). -""" - -from __future__ import annotations - -from typing import Annotated, Optional, Union - -from pydantic import BaseModel, BeforeValidator, ConfigDict - - -def _blank_to_none(value): - """Map an empty-string form value to ``None`` so an ``int`` field doesn't - choke on it (HTML number inputs can submit ``""`` for a cleared field).""" - return None if value == "" else value - - -# An int field that mirrors a proto int32/int64: pydantic coerces a numeric -# string ("1") to int at the typed boundary; "" -> None (left unset -> proto 0). -_OptInt = Annotated[Optional[int], BeforeValidator(_blank_to_none)] - - -def proto_enum_value(enum_cls, value) -> int: - """Resolve a wire value to a proto enum's INT value, with the PROTO enum as - the single source of type-truth — there is NO Thrift remapping. - - Accepts the proto member NAME (full proto name, e.g. ``"EXPERIMENT_STATE_CREATED"``, - or the prefix-stripped short alias, e.g. ``"LOCAL"``) or the proto int as-is; - ``None`` / ``""`` / bool -> 0 (the proto UNKNOWN sentinel). *enum_cls* is a - protobuf ``EnumTypeWrapper`` (e.g. ``compute_resource_pb2.JobSubmissionProtocol``). - """ - if value is None or value == "" or isinstance(value, bool): - return 0 - if isinstance(value, int): - return value # already the proto int — pass through, never remap - name = str(value) - if name in enum_cls.keys(): - return enum_cls.Value(name) - # short alias: re-attach the enum's SCREAMING_SNAKE prefix, derived from the - # 0-sentinel member name (e.g. JOB_SUBMISSION_PROTOCOL_UNKNOWN -> prefix). - zero = enum_cls.DESCRIPTOR.values_by_number.get(0) - if zero is not None and "_" in zero.name: - prefix = zero.name[: zero.name.rfind("_") + 1] - if (prefix + name) in enum_cls.keys(): - return enum_cls.Value(prefix + name) - return 0 - - -class _Base(BaseModel): - # extra='allow' so an unexpected key round-trips untouched. - model_config = ConfigDict(extra="allow", populate_by_name=True) - - -class WorkspaceDefaultsModel(_Base): - most_recent_project_id: Optional[str] = None - group_resource_profile_ids: list[str] = [] - most_recent_group_resource_profile_id: Optional[str] = None - - -class ProjectCreate(_Base): - name: Optional[str] = None - description: Optional[str] = None - - -class ComputationalResourceSchedulingCreate(_Base): - # int fields mirror the proto int32s; the typed boundary coerces "1" -> 1. - resource_host_id: Optional[str] = None - total_cpu_count: _OptInt = None - node_count: _OptInt = None - number_of_threads: _OptInt = None - queue_name: Optional[str] = None - wall_time_limit: _OptInt = None - total_physical_memory: _OptInt = None - chessis_number: Optional[str] = None - static_working_dir: Optional[str] = None - override_login_user_name: Optional[str] = None - override_scratch_location: Optional[str] = None - override_allocation_project_number: Optional[str] = None - m_group_count: _OptInt = None - - -class UserConfigurationDataCreate(_Base): - airavata_auto_schedule: Optional[bool] = None - override_manual_scheduled_params: Optional[bool] = None - share_experiment_publicly: Optional[bool] = None - computational_resource_scheduling: Optional[ - ComputationalResourceSchedulingCreate] = None - throttle_resources: Optional[bool] = None - input_storage_resource_id: Optional[str] = None - output_storage_resource_id: Optional[str] = None - experiment_data_dir: Optional[str] = None - use_user_cr_pref: Optional[bool] = None - group_resource_profile_id: Optional[str] = None - - -class ExperimentCreate(_Base): - experiment_id: Optional[str] = None - project_id: Optional[str] = None - experiment_type: Union[int, str, None] = None - experiment_name: Optional[str] = None - description: Optional[str] = None - execution_id: Optional[str] = None - enable_email_notification: Optional[bool] = None - email_addresses: Optional[list[str]] = None - experiment_inputs: Optional[list[dict]] = None - experiment_outputs: Optional[list[dict]] = None - user_configuration_data: Optional[UserConfigurationDataCreate] = None - - -class NotificationCreate(_Base): - title: Optional[str] = None - notification_message: Optional[str] = None - creation_time: Union[int, str, None] = None - published_time: Union[int, str, None] = None - expiration_time: Union[int, str, None] = None - priority: Union[int, str, None] = None - - -class ParserCreate(_Base): - id: Optional[str] = None - image_name: Optional[str] = None - output_dir_path: Optional[str] = None - input_dir_path: Optional[str] = None - execution_command: Optional[str] = None - input_files: Optional[list[dict]] = None - output_files: Optional[list[dict]] = None - - -class ApplicationInterfaceCreate(_Base): - application_interface_id: Optional[str] = None - application_name: Optional[str] = None - application_description: Optional[str] = None - application_modules: Optional[list[str]] = None - application_inputs: Optional[list[dict]] = None - application_outputs: Optional[list[dict]] = None - archive_working_directory: Optional[bool] = None - - -class ApplicationDeploymentCreate(_Base): - app_module_id: Optional[str] = None - compute_host_id: Optional[str] = None - executable_path: Optional[str] = None - parallelism: Union[int, str, None] = None - app_deployment_description: Optional[str] = None - module_load_cmds: Optional[list[dict]] = None - lib_prepend_paths: Optional[list[dict]] = None - lib_append_paths: Optional[list[dict]] = None - set_environment: Optional[list[dict]] = None - pre_job_commands: Optional[list[dict]] = None - post_job_commands: Optional[list[dict]] = None - default_queue_name: Optional[str] = None - default_node_count: Optional[int] = None - default_cpu_count: Optional[int] = None - default_walltime: Optional[int] = None - editable_by_user: Optional[bool] = None - - -class GroupResourceProfileCreate(_Base): - group_resource_profile_id: Optional[str] = None - group_resource_profile_name: Optional[str] = None - compute_preferences: Optional[list[dict]] = None - compute_resource_policies: Optional[list[dict]] = None - batch_queue_resource_policies: Optional[list[dict]] = None diff --git a/airavata-python-sdk/airavata_sdk/helpers/queue_settings.py b/airavata-python-sdk/airavata_sdk/helpers/queue_settings.py deleted file mode 100644 index 40d90718e97..00000000000 --- a/airavata-python-sdk/airavata_sdk/helpers/queue_settings.py +++ /dev/null @@ -1,59 +0,0 @@ -"""In-process queue-settings calculator registry (no framework deps). - -A gateway registers calculators with :func:`queue_settings_calculator`, then -invokes them by id via :func:`calculate_queue_settings`; positional/keyword args -are forwarded verbatim to the registered callable. -""" - -from typing import Callable, NamedTuple - -QUEUE_SETTINGS_CALCULATORS = [] - - -class QueueSettingsCalculator(NamedTuple): - id: str - name: str - func: Callable - - -def queue_settings_calculator(_func=None, *, id=None, name=None, **kwargs): - def decorator(func): - name_ = name - if name_ is None: - name_ = func.__name__ - id_ = id - if id_ is None: - id_ = func.__module__ + ":" + func.__name__ - if exists(id_): - raise Exception(f"Duplicate queue settings calculator id: {id_}") - QUEUE_SETTINGS_CALCULATORS.append(QueueSettingsCalculator(id_, name_, func)) - return func - if _func is None: - return decorator - else: - return decorator(_func) - - -def calculate_queue_settings(calculator_id, *args, **kwargs): - calcs = [calc for calc in QUEUE_SETTINGS_CALCULATORS if calc.id == calculator_id] - if len(calcs) == 0: - raise LookupError(f"Could not find queue settings calculator for {calculator_id}") - calc = calcs[0] - try: - return calc.func(*args, **kwargs) - except Exception as e: - raise Exception(f"Failed to calculate queue settings for {calculator_id}") from e - - -def get_all(): - return QUEUE_SETTINGS_CALCULATORS.copy() - - -def exists(calculator_id): - calcs = [calc for calc in QUEUE_SETTINGS_CALCULATORS if calc.id == calculator_id] - return len(calcs) == 1 - - -def reset_registry(): - global QUEUE_SETTINGS_CALCULATORS - QUEUE_SETTINGS_CALCULATORS = [] diff --git a/airavata-python-sdk/airavata_sdk/helpers/research_resources.py b/airavata-python-sdk/airavata_sdk/helpers/research_resources.py deleted file mode 100644 index 4d016ebf76b..00000000000 --- a/airavata-python-sdk/airavata_sdk/helpers/research_resources.py +++ /dev/null @@ -1,1366 +0,0 @@ -"""Research-domain helpers (proto-direct). Each family returns objects, not dicts: - -* a plain resource -> its proto, returned wholesale; -* a resource needing cross-service sharing-access flags -> - :class:`~airavata_sdk.helpers._envelope.WithAccess` (proto + chained scalars); -* a composed multi-proto shape (full-experiment) -> a pydantic model carrying - the component protos / envelopes wholesale. -""" - -from __future__ import annotations - -from datetime import datetime, timezone -from typing import TYPE_CHECKING, Any, Optional - -from pydantic import BaseModel, ConfigDict - -from airavata_sdk.helpers._envelope import WithAccess -from airavata_sdk.helpers.models import ( - ApplicationDeploymentCreate, - ApplicationInterfaceCreate, - ExperimentCreate, - NotificationCreate, - ParserCreate, - ProjectCreate, - proto_enum_value, -) - -if TYPE_CHECKING: - from airavata_sdk.client import AiravataClient - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.appdeployment import ( # noqa: E501 - app_deployment_pb2, - ) - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.appinterface import ( # noqa: E501 - app_interface_pb2, - ) - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.parser import ( # noqa: E501 - parser_pb2, - ) - from airavata_sdk.generated.org.apache.airavata.model.data.replica import ( - replica_catalog_pb2, - ) - from airavata_sdk.generated.org.apache.airavata.model.experiment import ( - experiment_pb2, - ) - from airavata_sdk.generated.org.apache.airavata.model.job import ( - job_pb2, - ) - from airavata_sdk.generated.org.apache.airavata.model.workspace import ( - workspace_pb2, - ) - - -# Project (reference family) — WithAccess. is_owner is SDK-trivial -# (proto.owner == client.username); user_has_write_access is a chained -# sharing.user_has_access WRITE lookup. - - -def get_project(client: "AiravataClient", project_id: str) -> "WithAccess": - p = client.research.get_project(project_id) - return WithAccess( - message=p, - is_owner=(p.owner == client.username), - user_has_write_access=client.sharing.user_has_access( - resource_id=project_id, - user_id=client.username, - permission_type="WRITE", - ), - ) - - -def list_projects( - client: "AiravataClient", - *, - limit: int = -1, - offset: int = 0, -) -> "list[WithAccess]": - projects = client.research.get_user_projects( - gateway_id=client.gateway_id, - user_name=client.username, - limit=limit, - offset=offset, - ) - return [ - WithAccess( - message=p, - is_owner=(p.owner == client.username), - user_has_write_access=client.sharing.user_has_access( - resource_id=p.project_id, - user_id=client.username, - permission_type="WRITE", - ), - ) - for p in projects - ] - - -def create_project( - client: "AiravataClient", - data: "ProjectCreate | dict", -) -> "WithAccess": - """``owner`` / ``gateway_id`` are forced from the client context. Re-fetched - so the shape matches the read path. - """ - from airavata_sdk.generated.org.apache.airavata.model.workspace import ( - workspace_pb2, - ) - - data = ProjectCreate.model_validate(data).model_dump(exclude_unset=True) - project = workspace_pb2.Project( - owner=client.username or "", - gateway_id=client.gateway_id or "", - name=data.get("name") or "", - description=data.get("description") or "", - ) - project_id = client.research.create_project(client.gateway_id, project) - return get_project(client, project_id) - - -def update_project( - client: "AiravataClient", - project_id: str, - data: "ProjectCreate | dict", -) -> "WithAccess": - """Only ``name`` / ``description`` are mutable. Re-fetched so the shape - matches the read path. - """ - data = ProjectCreate.model_validate(data).model_dump(exclude_unset=True) - project = client.research.get_project(project_id) - if "name" in data: - project.name = data["name"] or "" - if "description" in data: - project.description = data["description"] or "" - client.research.update_project(project_id, project) - return get_project(client, project_id) - - -# Gateway-catalog families (ApplicationModule, ApplicationInterface, -# Notification, GatewayResourceProfile) — WithAccess with no owner (is_owner -# always False) and user_has_write_access = the gateway-admin flag the ViewSet -# supplies as has_write (not a sharing lookup). - - -def get_application_module( - client: "AiravataClient", - app_module_id: str, - *, - has_write: bool, -) -> "WithAccess": - m = client.research.get_application_module(app_module_id) - return WithAccess( - message=m, - is_owner=False, - user_has_write_access=has_write, - ) - - -def list_application_modules( - client: "AiravataClient", - *, - has_write: bool, - accessible_only: bool = True, -) -> "list[WithAccess]": - """*accessible_only* True (default) -> only modules the caller can access; - False -> every module in the gateway (the ``list_all`` action). - """ - if accessible_only: - modules = client.research.get_accessible_app_modules( - gateway_id=client.gateway_id) - else: - modules = client.research.get_all_app_modules( - gateway_id=client.gateway_id) - return [ - WithAccess(message=m, is_owner=False, user_has_write_access=has_write) - for m in modules - ] - - -def create_application_module( - client: "AiravataClient", - data: dict, - *, - has_write: bool, -) -> "WithAccess": - """Re-fetched so the server-assigned ``app_module_id`` is populated and the - shape matches the read path. - """ - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.appdeployment import ( # noqa: E501 - app_deployment_pb2, - ) - - module = app_deployment_pb2.ApplicationModule( - app_module_name=data.get("app_module_name") or "", - app_module_version=data.get("app_module_version") or "", - app_module_description=data.get("app_module_description") or "", - ) - app_module_id = client.research.register_application_module( - client.gateway_id, module) - return get_application_module(client, app_module_id, has_write=has_write) - - -def update_application_module( - client: "AiravataClient", - app_module_id: str, - data: dict, - *, - has_write: bool, -) -> "WithAccess": - """``app_module_name`` / ``app_module_version`` / ``app_module_description`` - are mutable. Re-fetched so the shape matches the read path. - """ - module = client.research.get_application_module(app_module_id) - if "app_module_name" in data: - module.app_module_name = data["app_module_name"] or "" - if "app_module_version" in data: - module.app_module_version = data["app_module_version"] or "" - if "app_module_description" in data: - module.app_module_description = data["app_module_description"] or "" - client.research.update_application_module(app_module_id, module) - return get_application_module(client, app_module_id, has_write=has_write) - - -# Experiment (experiments-core) — WithAccess. The whole process/task/job tree -# flows through the proto wholesale. is_owner compares the experiment's owner -# (user_name) against the caller; user_has_write_access is ownership OR a chained -# sharing WRITE lookup (owners always retain write/edit/launch rights). - - -def get_experiment( - client: "AiravataClient", - experiment_id: str, -) -> "WithAccess": - e = client.research.get_experiment(experiment_id) - is_owner = e.user_name == client.username - return WithAccess( - message=e, - is_owner=is_owner, - user_has_write_access=is_owner - or client.sharing.user_has_access( - resource_id=experiment_id, - user_id=client.username, - permission_type="WRITE", - ), - ) - - -def get_experiment_proto( - client: "AiravataClient", - experiment_id: str, -) -> "experiment_pb2.ExperimentModel": - """The bare proto (vs. the :func:`get_experiment` envelope), for callers that - work with proto fields directly — notably portal output-view-provider data - generation. - """ - return client.research.get_experiment(experiment_id) - - -def get_experiments_in_project( - client: "AiravataClient", - project_id: str, - *, - limit: int = -1, - offset: int = 0, -) -> "list[WithAccess]": - experiments = client.research.get_experiments_in_project( - project_id, limit, offset) - return [ - _experiment_with_access(client, e) - for e in experiments - ] - - -def _experiment_with_access( - client: "AiravataClient", - e: "experiment_pb2.ExperimentModel", -) -> "WithAccess": - is_owner = e.user_name == client.username - return WithAccess( - message=e, - is_owner=is_owner, - user_has_write_access=is_owner - or client.sharing.user_has_access( - resource_id=e.experiment_id, - user_id=client.username, - permission_type="WRITE", - ), - ) - - -def list_experiment_jobs( - client: "AiravataClient", - experiment_id: str, -) -> "list[job_pb2.JobModel]": - """Bare ``JobModel`` protos (``GetJobDetails``) — a job has no ownership or - sharing concept. - """ - return list(client.research.get_job_details(experiment_id)) - - -# FullExperiment — a composed multi-proto shape: the experiment plus every -# resolved reference (project, app module, compute resource, input/output data -# products, job details) and the portal-computed output_views map. Each -# component is produced by the proto-direct component function above and carried -# wholesale, so the family inherits each family's field handling / access flags. -# Optional references resolve to None on lookup failure / no READ access. - - -class FullExperiment(BaseModel): - model_config = ConfigDict(arbitrary_types_allowed=True) - - experiment_id: str - experiment: Any - project: Optional[Any] - application_module: Optional[Any] - compute_resource: Optional[Any] - input_data_products: list[Any] - output_data_products: list[Any] - job_details: list[Any] - output_views: dict - - -def _data_type_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.application.io import ( - application_io_pb2 as io, - ) - return io.DataType - - -def _collect_data_product_uris(io_objects) -> list[str]: - """``airavata-dp`` URIs referenced by input/output protos: single-URI types - (URI / STDOUT / STDERR) contribute their ``value``, URI_COLLECTION each - comma-separated member. All single URIs first, then collection members. - """ - DT = _data_type_pb2() - single = [ - o.value for o in io_objects - if (o.value and o.value.startswith("airavata-dp") and - o.type in (DT.URI, DT.STDOUT, DT.STDERR)) - ] - collection = [ - dp - for o in io_objects - if o.value and o.type == DT.URI_COLLECTION - for dp in o.value.split(",") - if o.value.startswith("airavata-dp") - ] - return single + collection - - -def get_full_experiment( - client: "AiravataClient", - experiment_id: str, - *, - project_has_read: bool, - module_has_write: bool, - data_product_write_fn, - output_views_fn, -) -> "FullExperiment": - """Compose the full-experiment view. Request-bound inputs the SDK cannot - derive are supplied by the ViewSet: - - * *project_has_read* — when ``False`` the project is omitted. - * *module_has_write* — the gateway-admin write flag for the nested module. - * *data_product_write_fn* — ``(data_product_proto) -> bool``, the per-product - ``user_has_write_access`` flag. - * *output_views_fn* — ``(experiment, app_interface_or_None) -> dict``, the - portal-computed view-provider map. - - Errors resolving an optional reference leave it ``None``. - """ - from airavata_sdk.helpers import compute_resources - - experiment_env = get_experiment(client, experiment_id) - experiment = experiment_env.message - - # Resolve referenced data products for outputs then inputs (order matches - # the old view). - output_uris = _collect_data_product_uris(experiment.experiment_outputs) - input_uris = _collect_data_product_uris(experiment.experiment_inputs) - output_products = [ - client.research.get_data_product(uri) for uri in output_uris] - input_products = [ - client.research.get_data_product(uri) for uri in input_uris] - - # Resolve the application interface (execution_id) → module. - application_interface = None - try: - application_interface = client.research.get_application_interface( - experiment.execution_id) - except Exception: - application_interface = None - - output_views = output_views_fn(experiment, application_interface) - - application_module = None - try: - if (application_interface is not None and - application_interface.application_modules): - application_module = get_application_module( - client, - application_interface.application_modules[0], - has_write=module_has_write, - ) - except Exception: - application_module = None - - # Resolve the compute resource from the scheduling host id, when set. - compute_resource = None - compute_resource_id = None - if experiment.HasField("user_configuration_data"): - ucd = experiment.user_configuration_data - if ucd.HasField("computational_resource_scheduling"): - compute_resource_id = ( - ucd.computational_resource_scheduling.resource_host_id) - if compute_resource_id: - try: - compute_resource = compute_resources.get_compute_resource( - client, compute_resource_id) - except Exception: - compute_resource = None - - # Resolve the project (only when the caller may READ it). - project = None - if project_has_read: - project = get_project(client, experiment.project_id) - - job_details = list_experiment_jobs(client, experiment_id) - - input_data_products = [ - WithAccess( - message=dp, - is_owner=bool(dp.owner_name) and (dp.owner_name == client.username), - user_has_write_access=data_product_write_fn(dp), - ) - for dp in input_products - ] - output_data_products = [ - WithAccess( - message=dp, - is_owner=bool(dp.owner_name) and (dp.owner_name == client.username), - user_has_write_access=data_product_write_fn(dp), - ) - for dp in output_products - ] - - return FullExperiment( - experiment_id=experiment.experiment_id, - experiment=experiment_env, - project=project, - application_module=application_module, - compute_resource=compute_resource, - input_data_products=input_data_products, - output_data_products=output_data_products, - job_details=job_details, - output_views=output_views, - ) - - -def _build_input_data_object(data: dict): - return _proto_input_data_object(data) - - -def _build_output_data_object(data: dict): - return _proto_output_data_object(data) - - -def _build_computational_resource_scheduling(data: dict): - from airavata_sdk.generated.org.apache.airavata.model.scheduling import ( - scheduling_pb2, - ) - - # Scheduling ints are coerced to int at the typed boundary - # (ComputationalResourceSchedulingCreate), so they arrive here already int. - return scheduling_pb2.ComputationalResourceSchedulingModel( - resource_host_id=data.get("resource_host_id") or "", - total_cpu_count=data.get("total_cpu_count") or 0, - node_count=data.get("node_count") or 0, - number_of_threads=data.get("number_of_threads") or 0, - queue_name=data.get("queue_name") or "", - wall_time_limit=data.get("wall_time_limit") or 0, - total_physical_memory=data.get("total_physical_memory") or 0, - chessis_number=data.get("chessis_number") or "", - static_working_dir=data.get("static_working_dir") or "", - override_login_user_name=data.get("override_login_user_name") or "", - override_scratch_location=data.get("override_scratch_location") or "", - override_allocation_project_number=data.get( - "override_allocation_project_number") or "", - m_group_count=data.get("m_group_count") or 0, - ) - - -def _build_user_configuration_data(data: dict): - """Only the user-submittable scalar fields, plus the singular - ``computational_resource_scheduling`` when present. - """ - from airavata_sdk.generated.org.apache.airavata.model.experiment import ( - experiment_pb2, - ) - - crs = data.get("computational_resource_scheduling") - kwargs = dict( - airavata_auto_schedule=bool(data.get("airavata_auto_schedule", False)), - override_manual_scheduled_params=bool( - data.get("override_manual_scheduled_params", False)), - share_experiment_publicly=bool( - data.get("share_experiment_publicly", False)), - throttle_resources=bool(data.get("throttle_resources", False)), - input_storage_resource_id=data.get("input_storage_resource_id") or "", - output_storage_resource_id=data.get("output_storage_resource_id") or "", - experiment_data_dir=data.get("experiment_data_dir") or "", - use_user_cr_pref=bool(data.get("use_user_cr_pref", False)), - group_resource_profile_id=data.get("group_resource_profile_id") or "", - ) - if crs is not None: - kwargs["computational_resource_scheduling"] = ( - _build_computational_resource_scheduling(crs)) - return experiment_pb2.UserConfigurationDataModel(**kwargs) - - -def _build_experiment(client: "AiravataClient", data: dict): - """Only the user-submittable fields (status / errors / processes / workflow - are server-managed). ``gateway_id`` / ``user_name`` are forced from the - client context. - """ - from airavata_sdk.generated.org.apache.airavata.model.experiment import ( - experiment_pb2, - ) - - ucd = data.get("user_configuration_data") - kwargs = dict( - experiment_id=data.get("experiment_id") or "", - project_id=data.get("project_id") or "", - gateway_id=client.gateway_id or "", - experiment_type=_experiment_type_int(data.get("experiment_type")), - user_name=client.username or "", - experiment_name=data.get("experiment_name") or "", - description=data.get("description") or "", - execution_id=data.get("execution_id") or "", - enable_email_notification=bool( - data.get("enable_email_notification", False)), - email_addresses=list(data.get("email_addresses") or []), - experiment_inputs=[ - _build_input_data_object(i) - for i in (data.get("experiment_inputs") or [])], - experiment_outputs=[ - _build_output_data_object(o) - for o in (data.get("experiment_outputs") or [])], - ) - if ucd is not None: - kwargs["user_configuration_data"] = _build_user_configuration_data(ucd) - return experiment_pb2.ExperimentModel(**kwargs) - - -def _experiment_type_int(value) -> int: - """``experiment_type`` -> proto ``ExperimentType`` int via the proto enum - (member NAME or proto int; ``None`` / ``""`` -> 0). The proto enum is the type - truth — no Thrift remapping. - """ - from airavata_sdk.generated.org.apache.airavata.model.experiment import ( - experiment_pb2, - ) - - return proto_enum_value(experiment_pb2.ExperimentType, value) - - -def build_experiment( - client: "AiravataClient", - data: "ExperimentCreate | dict", -): - """Validate *data* and assemble a proto ``ExperimentModel`` (no RPC). - - The public parse entry point for callers that need only the model — e.g. the - queue-settings calculator. ``create_experiment`` / ``update_experiment`` use - the same validate-then-build path before submitting. - """ - data = ExperimentCreate.model_validate(data).model_dump(exclude_unset=True) - return _build_experiment(client, data) - - -def create_experiment( - client: "AiravataClient", - data: "ExperimentCreate | dict", -) -> "WithAccess": - """The server mints the ``experiment_id``; re-fetched so the shape matches - the read path. New id at ``result.message.experiment_id``. - """ - experiment = build_experiment(client, data) - experiment_id = client.research.create_experiment( - client.gateway_id, experiment) - return get_experiment(client, experiment_id) - - -def update_experiment( - client: "AiravataClient", - experiment_id: str, - data: "ExperimentCreate | dict", -) -> "WithAccess": - """The proto is rebuilt wholesale from *data* (``experiment_id`` forced), - pushed, and re-fetched so the shape matches the read path. - """ - experiment = build_experiment(client, data) - experiment.experiment_id = experiment_id - client.research.update_experiment(experiment_id, experiment) - return get_experiment(client, experiment_id) - - -# ExperimentSummary (experiment-search) — WithAccess. is_owner always False (no -# owner field); user_has_write_access is a per-summary chained sharing WRITE -# lookup. - - -def search_experiments( - client: "AiravataClient", - *, - filters: Optional[dict] = None, - limit: int = -1, - offset: int = 0, -) -> "list[WithAccess]": - """*filters* is a ``map`` keyed by ``ExperimentSearchFields`` - member name, passed straight through to ``SearchExperiments``. - """ - summaries = client.research.search_experiments( - gateway_id=client.gateway_id, - user_name=client.username, - filters=filters or {}, - limit=limit, - offset=offset, - ) - return [ - WithAccess( - message=e, - is_owner=False, - user_has_write_access=client.sharing.user_has_access( - resource_id=e.experiment_id, - user_id=client.username, - permission_type="WRITE", - ), - ) - for e in summaries - ] - - -# ExperimentStatistics — bare proto (already carries the full shape: six -# per-state counts plus six per-state summary lists; nothing cross-service). - - -def get_experiment_statistics( - client: "AiravataClient", - *, - from_time: int, - to_time: int, - user_name: Optional[str] = None, - application_name: Optional[str] = None, - resource_host_name: Optional[str] = None, - limit: int = 50, - offset: int = 0, -) -> "experiment_pb2.ExperimentStatistics": - """``from_time`` / ``to_time`` are epoch-millis bounds; the optional filters - map to string fields (``None`` -> ``""``). - """ - return client.research.get_experiment_statistics( - gateway_id=client.gateway_id, - from_time=from_time, - to_time=to_time, - user_name=user_name or "", - application_name=application_name or "", - resource_host_name=resource_host_name or "", - limit=limit, - offset=offset, - ) - - -# Notification — gateway-catalog WithAccess (is_owner always False; -# user_has_write_access = has_write). The portal-only show_in_dashboard flag -# lives in a Django table and is merged by the ViewSet, not here. - - -def _to_epoch_ms(value) -> int: - """Timestamp -> epoch-millis int. ``None`` / ``""`` / ``0`` -> 0; int as-is; - ISO-8601 string -> epoch millis. - """ - if not value: - return 0 - if isinstance(value, bool): - return 0 - if isinstance(value, int): - return value - if isinstance(value, float): - return int(value) - # ISO-8601 string — normalise a trailing ``Z`` to ``+00:00`` for fromisoformat. - s = str(value) - if s.endswith("Z"): - s = s[:-1] + "+00:00" - dt = datetime.fromisoformat(s) - if dt.tzinfo is None: - dt = dt.replace(tzinfo=timezone.utc) - return int(dt.timestamp() * 1000) - - -def _to_priority_int(value) -> int: - """priority -> proto ``NotificationPriority`` int via the proto enum (member - NAME or proto int; ``None`` / ``""`` -> 0). - """ - from airavata_sdk.generated.org.apache.airavata.model.workspace import ( - workspace_pb2, - ) - - return proto_enum_value(workspace_pb2.NotificationPriority, value) - - -def _build_notification( - client: "AiravataClient", - data: dict, - *, - base: "Optional[workspace_pb2.Notification]" = None, -) -> "workspace_pb2.Notification": - """*base* (the update path) seeds the proto; absent keys keep the base value - or the proto default. ``gateway_id`` is forced to the client's gateway. - """ - from airavata_sdk.generated.org.apache.airavata.model.workspace import ( - workspace_pb2, - ) - - n = workspace_pb2.Notification() - if base is not None: - n.CopyFrom(base) - n.gateway_id = client.gateway_id or "" - if "title" in data: - n.title = data["title"] or "" - if "notification_message" in data: - n.notification_message = data["notification_message"] or "" - if "creation_time" in data: - n.creation_time = _to_epoch_ms(data["creation_time"]) - if "published_time" in data: - n.published_time = _to_epoch_ms(data["published_time"]) - if "expiration_time" in data: - n.expiration_time = _to_epoch_ms(data["expiration_time"]) - if "priority" in data: - n.priority = _to_priority_int(data["priority"]) - return n - - -def get_notification( - client: "AiravataClient", - notification_id: str, - *, - has_write: bool, -) -> "WithAccess": - n = client.research.get_notification(client.gateway_id, notification_id) - return WithAccess( - message=n, - is_owner=False, - user_has_write_access=has_write, - ) - - -def list_notifications( - client: "AiravataClient", - *, - has_write: bool, -) -> "list[WithAccess]": - notifications = client.research.get_all_notifications(client.gateway_id) - return [ - WithAccess(message=n, is_owner=False, user_has_write_access=has_write) - for n in notifications - ] - - -def create_notification( - client: "AiravataClient", - data: "NotificationCreate | dict", - *, - has_write: bool, -) -> "WithAccess": - """The created proto is re-built with the server-assigned ``notification_id``.""" - data = NotificationCreate.model_validate(data).model_dump( - exclude_unset=True) - n = _build_notification(client, data) - notification_id = client.research.create_notification(n) - n.notification_id = notification_id - return WithAccess( - message=n, - is_owner=False, - user_has_write_access=has_write, - ) - - -def update_notification( - client: "AiravataClient", - notification_id: str, - data: "NotificationCreate | dict", - *, - has_write: bool, -) -> "WithAccess": - data = NotificationCreate.model_validate(data).model_dump( - exclude_unset=True) - base = client.research.get_notification(client.gateway_id, notification_id) - n = _build_notification(client, data, base=base) - n.notification_id = notification_id - client.research.update_notification(n) - return WithAccess( - message=n, - is_owner=False, - user_has_write_access=has_write, - ) - - -def delete_notification( - client: "AiravataClient", - notification_id: str, -) -> None: - client.research.delete_notification(client.gateway_id, notification_id) - - -# Parser — bare proto, gateway catalog (no ownership/sharing). - - -def _io_type_value(value) -> int: - """parser ``type`` -> proto ``IOType`` int via the proto enum (member NAME or - proto int; ``None`` / ``""`` -> 0). - """ - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.parser import ( # noqa: E501 - parser_pb2, - ) - - return proto_enum_value(parser_pb2.IOType, value) - - -def _build_parser( - client: "AiravataClient", - data: dict, -) -> "parser_pb2.Parser": - """``gateway_id`` is forced to the client's gateway.""" - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.parser import ( # noqa: E501 - parser_pb2, - ) - - return parser_pb2.Parser( - id=data.get("id") or "", - image_name=data.get("image_name") or "", - output_dir_path=data.get("output_dir_path") or "", - input_dir_path=data.get("input_dir_path") or "", - execution_command=data.get("execution_command") or "", - gateway_id=client.gateway_id or "", - input_files=[ - parser_pb2.ParserInput( - id=i.get("id") or "", - name=i.get("name") or "", - required_input=bool(i.get("required_input", False)), - parser_id=i.get("parser_id") or "", - type=_io_type_value(i.get("type")), - ) - for i in (data.get("input_files") or []) - ], - output_files=[ - parser_pb2.ParserOutput( - id=o.get("id") or "", - name=o.get("name") or "", - required_output=bool(o.get("required_output", False)), - parser_id=o.get("parser_id") or "", - type=_io_type_value(o.get("type")), - ) - for o in (data.get("output_files") or []) - ], - ) - - -def get_parser(client: "AiravataClient", parser_id: str) -> "parser_pb2.Parser": - """Fetch a single parser and return the raw ``parser_pb2.Parser`` proto.""" - return client.research.get_parser(parser_id, client.gateway_id) - - -def list_parsers(client: "AiravataClient") -> "list[parser_pb2.Parser]": - """Return the gateway's parsers as a list of ``parser_pb2.Parser`` protos.""" - return list(client.research.list_all_parsers(client.gateway_id)) - - -def create_parser( - client: "AiravataClient", - data: "ParserCreate | dict", -) -> "parser_pb2.Parser": - """Re-fetched so read and write paths emit the same shape.""" - data = ParserCreate.model_validate(data).model_dump(exclude_unset=True) - parser = _build_parser(client, data) - parser_id = client.research.save_parser(parser) - return get_parser(client, parser_id) - - -def update_parser( - client: "AiravataClient", - parser_id: str, - data: "ParserCreate | dict", -) -> "parser_pb2.Parser": - """The proto is re-assembled from *data* (``id`` forced), saved, re-fetched.""" - data = ParserCreate.model_validate(data).model_dump(exclude_unset=True) - merged = dict(data) - merged["id"] = parser_id - parser = _build_parser(client, merged) - client.research.save_parser(parser) - return get_parser(client, parser_id) - - -def delete_parser(client: "AiravataClient", parser_id: str) -> None: - """Delete a parser by id.""" - client.research.remove_parser(parser_id, client.gateway_id) - - -# DataProduct — WithAccess. is_owner is SDK-trivial -# (proto.owner_name == client.username); user_has_write_access is the -# request-bound flag the ViewSet computes (owner / shared-dir gateway-admin / -# otherwise-allowed) and supplies as has_write. - - -def get_data_product( - client: "AiravataClient", - product_uri: str, - *, - has_write: bool, -) -> "WithAccess": - p = client.research.get_data_product(product_uri) - return WithAccess( - message=p, - is_owner=bool(p.owner_name) and (p.owner_name == client.username), - user_has_write_access=has_write, - ) - - -def data_product_for_upload( - *, - gateway_id: str, - owner_name: str, - product_name: str, - file_path: str, - storage_resource_id: str, - content_type: Optional[str] = None, - product_size: int = 0, -) -> "replica_catalog_pb2.DataProductModel": - """``storage.upload_file`` only transfers bytes, so the upload flow registers - the product to mint a canonical URI. A single GATEWAY_DATA_STORE / TRANSIENT - replica points at *file_path*; content type goes under ``mime-type`` metadata. - """ - from airavata_sdk.generated.org.apache.airavata.model.data.replica import ( - replica_catalog_pb2 as rc, - ) - - product_metadata = {"mime-type": content_type} if content_type else {} - return rc.DataProductModel( - gateway_id=gateway_id or "", - owner_name=owner_name or "", - product_name=product_name or "", - data_product_type=rc.DataProductType.FILE, - product_size=product_size or 0, - product_metadata=product_metadata, - replica_locations=[rc.DataReplicaLocationModel( - replica_name="{} gateway data store copy".format(product_name), - replica_location_category=rc.ReplicaLocationCategory.GATEWAY_DATA_STORE, - replica_persistent_type=rc.ReplicaPersistentType.TRANSIENT, - storage_resource_id=storage_resource_id or "", - file_path=file_path, - )], - ) - - -def register_data_product( - client: "AiravataClient", - data_product: "replica_catalog_pb2.DataProductModel", -) -> str: - """Pass-through used by the upload flow after :func:`data_product_for_upload`.""" - return client.research.register_data_product(data_product) - - -# ApplicationInterface — gateway-catalog WithAccess (is_owner always False; -# user_has_write_access = has_write). The portal-only show_queue_settings / -# queue_settings_calculator_id overrides are persisted by the ViewSet, not here. - - -def get_application_interface( - client: "AiravataClient", - app_interface_id: str, - *, - has_write: bool, -) -> "WithAccess": - ai = client.research.get_application_interface(app_interface_id) - return WithAccess( - message=ai, - is_owner=False, - user_has_write_access=has_write, - ) - - -def list_application_interfaces( - client: "AiravataClient", - *, - has_write: bool, -) -> "list[WithAccess]": - interfaces = client.research.get_all_application_interfaces( - client.gateway_id) - return [ - WithAccess(message=ai, is_owner=False, user_has_write_access=has_write) - for ai in interfaces - ] - - -def _proto_input_data_object(data: dict): - from airavata_sdk.generated.org.apache.airavata.model.application.io import ( - application_io_pb2 as io, - ) - - return io.InputDataObjectType( - name=data.get("name") or "", - value=data.get("value") or "", - type=_data_type_int(data.get("type")), - application_argument=data.get("application_argument") or "", - standard_input=bool(data.get("standard_input", False)), - user_friendly_description=data.get("user_friendly_description") or "", - meta_data=_meta_data_str(data.get("meta_data")), - input_order=data.get("input_order") or 0, - is_required=bool(data.get("is_required", False)), - required_to_added_to_command_line=bool( - data.get("required_to_added_to_command_line", False)), - data_staged=bool(data.get("data_staged", False)), - storage_resource_id=data.get("storage_resource_id") or "", - is_read_only=bool(data.get("is_read_only", False)), - override_filename=data.get("override_filename") or "", - ) - - -def _proto_output_data_object(data: dict): - from airavata_sdk.generated.org.apache.airavata.model.application.io import ( - application_io_pb2 as io, - ) - - return io.OutputDataObjectType( - name=data.get("name") or "", - value=data.get("value") or "", - type=_data_type_int(data.get("type")), - application_argument=data.get("application_argument") or "", - is_required=bool(data.get("is_required", False)), - required_to_added_to_command_line=bool( - data.get("required_to_added_to_command_line", False)), - data_movement=bool(data.get("data_movement", False)), - location=data.get("location") or "", - search_query=data.get("search_query") or "", - output_streaming=bool(data.get("output_streaming", False)), - storage_resource_id=data.get("storage_resource_id") or "", - meta_data=_meta_data_str(data.get("meta_data")), - ) - - -def _data_type_int(value) -> int: - """``DataType`` -> proto enum int via the proto enum (member NAME or proto - int; ``None`` / ``""`` -> 0). - """ - from airavata_sdk.generated.org.apache.airavata.model.application.io import ( - application_io_pb2 as io, - ) - - return proto_enum_value(io.DataType, value) - - -def _meta_data_str(value) -> str: - """``meta_data`` -> proto JSON string. A str passes through; other values are - ``json.dumps``ed; ``None`` -> ``""``. - """ - import json - - if value is None: - return "" - if isinstance(value, str): - return value - try: - return json.dumps(value) - except (TypeError, ValueError): - return "" - - -def _build_application_interface( - client: "AiravataClient", - data: dict, - *, - base: "Optional[app_interface_pb2.ApplicationInterfaceDescription]" = None, -) -> "app_interface_pb2.ApplicationInterfaceDescription": - """*base* (the update path) seeds the proto. Nested input/output lists are - replaced wholesale when present in *data*. - """ - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.appinterface import ( # noqa: E501 - app_interface_pb2 as ai_pb2, - ) - - ai = ai_pb2.ApplicationInterfaceDescription() - if base is not None: - ai.CopyFrom(base) - if "application_interface_id" in data: - ai.application_interface_id = data["application_interface_id"] or "" - if "application_name" in data: - ai.application_name = data["application_name"] or "" - if "application_description" in data: - ai.application_description = data["application_description"] or "" - if "application_modules" in data: - ai.application_modules[:] = list(data["application_modules"] or []) - if "archive_working_directory" in data: - ai.archive_working_directory = bool(data["archive_working_directory"]) - if "application_inputs" in data: - del ai.application_inputs[:] - ai.application_inputs.extend( - _proto_input_data_object(i) - for i in (data["application_inputs"] or [])) - if "application_outputs" in data: - del ai.application_outputs[:] - ai.application_outputs.extend( - _proto_output_data_object(o) - for o in (data["application_outputs"] or [])) - return ai - - -def create_application_interface( - client: "AiravataClient", - data: "ApplicationInterfaceCreate | dict", - *, - has_write: bool, -) -> "WithAccess": - """Re-fetched so the server-assigned ``application_interface_id`` is populated.""" - data = ApplicationInterfaceCreate.model_validate(data).model_dump( - exclude_unset=True) - ai = _build_application_interface(client, data) - app_interface_id = client.research.register_application_interface( - client.gateway_id, ai) - return get_application_interface( - client, app_interface_id, has_write=has_write) - - -def update_application_interface( - client: "AiravataClient", - app_interface_id: str, - data: "ApplicationInterfaceCreate | dict", - *, - has_write: bool, -) -> "WithAccess": - data = ApplicationInterfaceCreate.model_validate(data).model_dump( - exclude_unset=True) - base = client.research.get_application_interface(app_interface_id) - ai = _build_application_interface(client, data, base=base) - ai.application_interface_id = app_interface_id - client.research.update_application_interface(app_interface_id, ai) - return get_application_interface( - client, app_interface_id, has_write=has_write) - - -def delete_application_interface( - client: "AiravataClient", - app_interface_id: str, -) -> None: - """Delete an application interface by id.""" - client.research.delete_application_interface(app_interface_id) - - -# ApplicationDeployment — WithAccess. is_owner always False (catalog entry, no -# owner). Unlike the other gateway-catalog families, user_has_write_access is a -# genuine per-resource CHAINED sharing WRITE lookup keyed on app_deployment_id. - - -def get_application_deployment( - client: "AiravataClient", - app_deployment_id: str, -) -> "WithAccess": - d = client.research.get_application_deployment(app_deployment_id) - return WithAccess( - message=d, - is_owner=False, - user_has_write_access=client.sharing.user_has_access( - resource_id=app_deployment_id, - user_id=client.username, - permission_type="WRITE", - ), - ) - - -def list_application_deployments( - client: "AiravataClient", -) -> "list[WithAccess]": - deployments = client.research.get_accessible_application_deployments( - client.gateway_id) - return [ - WithAccess( - message=d, - is_owner=False, - user_has_write_access=client.sharing.user_has_access( - resource_id=d.app_deployment_id, - user_id=client.username, - permission_type="WRITE", - ), - ) - for d in deployments - ] - - -def list_application_deployments_for_module( - client: "AiravataClient", - app_module_id: str, -) -> "list[WithAccess]": - """Accessible deployments for a single app module (the gateway-wide - accessible set filtered by ``app_module_id``).""" - deployments = client.research.get_accessible_application_deployments( - client.gateway_id) - return [ - WithAccess( - message=d, - is_owner=False, - user_has_write_access=client.sharing.user_has_access( - resource_id=d.app_deployment_id, - user_id=client.username, - permission_type="WRITE", - ), - ) - for d in deployments - if d.app_module_id == app_module_id - ] - - -def list_application_deployments_for_module_and_profile( - client: "AiravataClient", - app_module_id: str, - group_resource_profile_id: str, -) -> "list[WithAccess]": - deployments = client.research.\ - get_application_deployments_for_app_module_and_group_resource_profile( - app_module_id, group_resource_profile_id) - return [ - WithAccess( - message=d, - is_owner=False, - user_has_write_access=client.sharing.user_has_access( - resource_id=d.app_deployment_id, - user_id=client.username, - permission_type="WRITE", - ), - ) - for d in deployments - ] - - -def _proto_command_object(data: dict): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.appdeployment import ( # noqa: E501 - app_deployment_pb2, - ) - - return app_deployment_pb2.CommandObject( - command=data.get("command") or "", - command_order=data.get("command_order") or 0, - ) - - -def _proto_set_env_paths(data: dict): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.appdeployment import ( # noqa: E501 - app_deployment_pb2, - ) - - return app_deployment_pb2.SetEnvPaths( - name=data.get("name") or "", - value=data.get("value") or "", - env_path_order=data.get("env_path_order") or 0, - ) - - -def _parallelism_input_to_proto_int(value) -> int: - """``parallelism`` -> proto ``ApplicationParallelismType`` int via the proto - enum (member NAME or proto int; ``None`` / ``""`` -> 0). - """ - from airavata_sdk.generated.org.apache.airavata.model.parallelism import ( - parallelism_pb2, - ) - - return proto_enum_value(parallelism_pb2.ApplicationParallelismType, value) - - -def _build_application_deployment( - client: "AiravataClient", - data: dict, -) -> "app_deployment_pb2.ApplicationDeploymentDescription": - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.appdeployment import ( # noqa: E501 - app_deployment_pb2, - ) - - return app_deployment_pb2.ApplicationDeploymentDescription( - app_module_id=data.get("app_module_id") or "", - compute_host_id=data.get("compute_host_id") or "", - executable_path=data.get("executable_path") or "", - parallelism=_parallelism_input_to_proto_int(data.get("parallelism")), - app_deployment_description=data.get("app_deployment_description") or "", - module_load_cmds=[ - _proto_command_object(c) - for c in (data.get("module_load_cmds") or []) - ], - lib_prepend_paths=[ - _proto_set_env_paths(p) - for p in (data.get("lib_prepend_paths") or []) - ], - lib_append_paths=[ - _proto_set_env_paths(p) - for p in (data.get("lib_append_paths") or []) - ], - set_environment=[ - _proto_set_env_paths(p) - for p in (data.get("set_environment") or []) - ], - pre_job_commands=[ - _proto_command_object(c) - for c in (data.get("pre_job_commands") or []) - ], - post_job_commands=[ - _proto_command_object(c) - for c in (data.get("post_job_commands") or []) - ], - default_queue_name=data.get("default_queue_name") or "", - default_node_count=data.get("default_node_count") or 0, - default_cpu_count=data.get("default_cpu_count") or 0, - default_walltime=data.get("default_walltime") or 0, - editable_by_user=bool(data.get("editable_by_user", False)), - ) - - -def create_application_deployment( - client: "AiravataClient", - data: "ApplicationDeploymentCreate | dict", - *, - has_write: bool, -) -> "WithAccess": - """Re-fetched so the server-assigned ``app_deployment_id`` is populated. - *has_write* is forwarded (the creator has write access) rather than chained. - """ - data = ApplicationDeploymentCreate.model_validate(data).model_dump( - exclude_unset=True) - deployment = _build_application_deployment(client, data) - app_deployment_id = client.research.register_application_deployment( - client.gateway_id, deployment) - created = client.research.get_application_deployment(app_deployment_id) - return WithAccess( - message=created, is_owner=False, user_has_write_access=has_write) - - -def update_application_deployment( - client: "AiravataClient", - app_deployment_id: str, - data: "ApplicationDeploymentCreate | dict", - *, - has_write: bool, -) -> "WithAccess": - """The proto is rebuilt wholesale from *data* (``app_deployment_id`` forced), - pushed, and re-fetched. *has_write* is forwarded (the ViewSet resolves it). - """ - data = ApplicationDeploymentCreate.model_validate(data).model_dump( - exclude_unset=True) - deployment = _build_application_deployment(client, data) - deployment.app_deployment_id = app_deployment_id - client.research.update_application_deployment( - app_deployment_id, deployment) - updated = client.research.get_application_deployment(app_deployment_id) - return WithAccess( - message=updated, is_owner=False, user_has_write_access=has_write) - - -def delete_application_deployment( - client: "AiravataClient", - app_deployment_id: str, -) -> None: - """Delete an application deployment by id.""" - client.research.delete_application_deployment(app_deployment_id) diff --git a/airavata-python-sdk/airavata_sdk/helpers/sharing_resources.py b/airavata-python-sdk/airavata_sdk/helpers/sharing_resources.py deleted file mode 100644 index ada7f5395bd..00000000000 --- a/airavata-python-sdk/airavata_sdk/helpers/sharing_resources.py +++ /dev/null @@ -1,438 +0,0 @@ -"""Sharing-domain helpers, two families: - -* **groups** (``GroupViewSet``) — the ``GroupModel`` proto wrapped in a - :class:`~airavata_sdk.helpers._envelope.WithGroupAccess` carrying the six - cross-context booleans (:func:`_group_flags`) the proto cannot compute on its - own without coupling GroupManager to the gateway-groups catalog. -* **shared-entities** (``SharedEntityViewSet``) — a composed multi-proto shape - (owner / per-user ``UserProfile`` protos + per-group ``WithGroupAccess`` - envelopes), returned as a pydantic :class:`SharedEntity` carrying them - wholesale. ``permission_type`` is the permission member NAME string. -""" - -from __future__ import annotations - -from typing import TYPE_CHECKING, Any, Optional - -from pydantic import BaseModel, ConfigDict - -from airavata_sdk.helpers._envelope import WithGroupAccess - -if TYPE_CHECKING: - from airavata_sdk.client import AiravataClient - - -def _user_at_gateway(client: "AiravataClient") -> str: - return f"{client.username}@{client.gateway_id}" - - -def _gateway_groups(client: "AiravataClient") -> dict: - """The three gateway-group identity ids (``admins_group_id`` / - ``read_only_admins_group_id`` / ``default_gateway_users_group_id``). - """ - gg = client.compute.get_gateway_groups() - return { - "admins_group_id": gg.admins_group_id, - "read_only_admins_group_id": gg.read_only_admins_group_id, - "default_gateway_users_group_id": gg.default_gateway_users_group_id, - } - - -def _group_flags( - client: "AiravataClient", - g, - *, - gateway_groups: Optional[dict] = None, -) -> dict: - """The six per-group access booleans. *gateway_groups* may be supplied by the - caller (a session-cached copy) to avoid a redundant ``GetGatewayGroups`` RPC. - """ - me = _user_at_gateway(client) - gg = gateway_groups if gateway_groups is not None else _gateway_groups(client) - return dict( - is_admin=client.sharing.gm_has_admin_access(g.id, me), - is_owner=(g.owner_id == me), - is_member=bool(g.members) and me in g.members, - is_gateway_admins_group=(g.id == gg["admins_group_id"]), - is_read_only_gateway_admins_group=( - g.id == gg["read_only_admins_group_id"]), - is_default_gateway_users_group=( - g.id == gg["default_gateway_users_group_id"]), - ) - - -def get_group( - client: "AiravataClient", - group_id: str, - *, - gateway_groups: Optional[dict] = None, -) -> "WithGroupAccess": - g = client.sharing.gm_get_group(group_id) - return WithGroupAccess( - message=g, - **_group_flags(client, g, gateway_groups=gateway_groups), - ) - - -def wrap_groups( - client: "AiravataClient", - group_protos, - *, - gateway_groups: Optional[dict] = None, -) -> "list[WithGroupAccess]": - """Wrap already-fetched ``GroupModel`` protos in ``WithGroupAccess`` (e.g. the - groups a user belongs to). *gateway_groups* is resolved once and reused.""" - groups = list(group_protos) - gg = gateway_groups if gateway_groups is not None else _gateway_groups(client) - return [ - WithGroupAccess(message=g, **_group_flags(client, g, gateway_groups=gg)) - for g in groups - ] - - -def list_groups( - client: "AiravataClient", - *, - limit: int = -1, - offset: int = 0, - gateway_groups: Optional[dict] = None, -) -> "list[WithGroupAccess]": - """``GetGroups`` returns the full list; *limit* / *offset* slice it - in-process. *gateway_groups* is resolved once and reused across the page. - """ - groups = list(client.sharing.gm_get_groups()) - end = offset + limit if limit > 0 else len(groups) - page = groups[offset:end] if groups else [] - gg = gateway_groups if gateway_groups is not None else _gateway_groups(client) - return [ - WithGroupAccess(message=g, **_group_flags(client, g, gateway_groups=gg)) - for g in page - ] - - -def _group_manager_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.group import ( - group_manager_pb2, - ) - return group_manager_pb2 - - -def _build_group(client: "AiravataClient", data: dict): - """``owner_id`` is forced from the client context (``user@gateway``).""" - return _group_manager_pb2().GroupModel( - name=data.get("name") or "", - description=data.get("description") or "", - members=list(data.get("members") or []), - admins=list(data.get("admins") or []), - owner_id=_user_at_gateway(client), - ) - - -def _member_admin_diff(existing, data: dict) -> dict: - """Added/removed member & admin id lists. New lists default to the existing - proto values when absent from *data*. Admins not already members are added to - both the member list and ``added_members``. - """ - old_members = set(existing.members) - new_members = set(data["members"]) if "members" in data else set(existing.members) - removed_members = list(old_members - new_members) - added_members = list(new_members - old_members) - - old_admins = set(existing.admins) - new_admins = set(data["admins"]) if "admins" in data else set(existing.admins) - removed_admins = list(old_admins - new_admins) - added_admins = list(new_admins - old_admins) - - final_members = list(new_members) - # Admins not yet members become members too. - extra = list(new_admins - new_members) - added_members = added_members + extra - final_members = final_members + extra - - return dict( - members=final_members, - admins=list(new_admins), - added_members=added_members, - removed_members=removed_members, - added_admins=added_admins, - removed_admins=removed_admins, - ) - - -def create_group( - client: "AiravataClient", - data: dict, - *, - gateway_groups: Optional[dict] = None, -) -> tuple: - """Returns ``(WithGroupAccess, group_proto, added_member_ids)``: the read - shape plus the raw proto + newly added members the ViewSet needs to fan out - ``user_added_to_group`` notifications (which stay in the portal). - """ - group = _build_group(client, data) - group_id = client.sharing.gm_create_group(group) - group.id = group_id - added_members = list(set(group.members) - {group.owner_id}) - result = WithGroupAccess( - message=group, - **_group_flags(client, group, gateway_groups=gateway_groups)) - return result, group, added_members - - -def update_group( - client: "AiravataClient", - group_id: str, - data: dict, - *, - gateway_groups: Optional[dict] = None, -) -> tuple: - """Patch ``name`` / ``description``, fire the membership / admin mutator RPCs - for each non-empty diff, then ``UpdateGroup``. Returns ``(WithGroupAccess, - group_proto, added_member_ids)`` (see :func:`create_group`). - """ - group = client.sharing.gm_get_group(group_id) - if "name" in data: - group.name = data["name"] or "" - if "description" in data: - group.description = data["description"] or "" - - diff = _member_admin_diff(group, data) - - sharing = client.sharing - if diff["added_members"]: - sharing.gm_add_users_to_group(diff["added_members"], group.id) - if diff["removed_members"]: - sharing.gm_remove_users_from_group(diff["removed_members"], group.id) - if diff["added_admins"]: - sharing.gm_add_group_admins(group.id, diff["added_admins"]) - if diff["removed_admins"]: - sharing.gm_remove_group_admins(group.id, diff["removed_admins"]) - - group.members[:] = diff["members"] - group.admins[:] = diff["admins"] - sharing.gm_update_group(group) - - result = WithGroupAccess( - message=group, - **_group_flags(client, group, gateway_groups=gateway_groups)) - return result, group, diff["added_members"] - - -def delete_group(client: "AiravataClient", group_id: str) -> None: - """The proto is fetched to recover the ``owner_id`` the delete RPC requires.""" - group = client.sharing.gm_get_group(group_id) - client.sharing.gm_delete_group(group.id, group.owner_id) - - -# SharedEntity — a composed multi-proto shape (owner / per-user UserProfile -# protos + per-group WithGroupAccess envelopes from two services), returned as a -# pydantic model carrying them wholesale. permission_type is the member NAME -# string. is_owner = owner.user_id == client.username; has_sharing_permission is -# a chained MANAGE_SHARING lookup. - -# Precedence: a later (more privileged) grant overwrites an earlier one, so WRITE -# (which implies READ) wins over a bare READ. -_PERMISSION_PRECEDENCE = ("READ", "WRITE", "MANAGE_SHARING") - - -class UserPermission(BaseModel): - model_config = ConfigDict(arbitrary_types_allowed=True) - - user: Any # raw UserProfile proto - permission_type: str - - -class GroupPermission(BaseModel): - model_config = ConfigDict(arbitrary_types_allowed=True) - - group: Any # WithGroupAccess envelope - permission_type: str - - -class SharedEntity(BaseModel): - model_config = ConfigDict(arbitrary_types_allowed=True) - - entity_id: str - owner: Any - user_permissions: list[UserPermission] - group_permissions: list[GroupPermission] - is_owner: bool - has_sharing_permission: bool - - -def _username_from_internal_id(internal_user_id: str) -> str: - """The accessible-users RPCs return ``user@gateway`` ids but - ``GetUserProfileById`` keys on the bare username. - """ - return internal_user_id[0:internal_user_id.rindex("@")] - - -def _collect_permissions(accessor, entity_id: str) -> dict: - """``{id -> permission_name}`` across the precedence order (most privileged - grant wins). *accessor* is ``(entity_id, permission_name) -> list[id]``. - """ - result: dict = {} - for name in _PERMISSION_PRECEDENCE: - for resource_id in accessor(entity_id, name): - result[resource_id] = name - return result - - -def _load_shared_entity( - client: "AiravataClient", - entity_id: str, - *, - directly: bool, - gateway_groups: Optional[dict] = None, -) -> "SharedEntity": - """*directly* selects the direct-only (True) vs. accessible-including-inherited - (False) accessor pair. Loads the user/group permission maps, drops the owner - from the users list, fetches every profile/group, and composes a - :class:`SharedEntity`. - """ - sharing = client.sharing - if directly: - users_accessor = sharing.get_all_directly_accessible_users - groups_accessor = sharing.get_all_directly_accessible_groups - else: - users_accessor = sharing.get_all_accessible_users - groups_accessor = sharing.get_all_accessible_groups - - users = _collect_permissions(users_accessor, entity_id) - # The owner is the single DIRECT owner (the OWNER grant); there is exactly - # one (indirect cascading owners are not returned by these RPCs). - owner_ids = users_accessor(entity_id, "OWNER") - owner_id = list(owner_ids)[0] - users.pop(owner_id, None) - - groups = _collect_permissions(groups_accessor, entity_id) - - gg = ( - gateway_groups if gateway_groups is not None - else _gateway_groups(client)) - - def _load_profile(user_internal_id): - return client.iam.get_user_profile_by_id( - _username_from_internal_id(user_internal_id), client.gateway_id) - - user_permissions = [ - UserPermission(user=_load_profile(uid), permission_type=users[uid]) - for uid in users - ] - group_permissions = [ - GroupPermission( - group=get_group(client, gid, gateway_groups=gg), - permission_type=groups[gid]) - for gid in groups - ] - owner_profile = _load_profile(owner_id) - - return SharedEntity( - entity_id=entity_id, - owner=owner_profile, - user_permissions=user_permissions, - group_permissions=group_permissions, - is_owner=(owner_profile.user_id == client.username), - has_sharing_permission=client.sharing.user_has_access( - resource_id=entity_id, - user_id=client.username, - permission_type="MANAGE_SHARING", - ), - ) - - -def get_shared_entity( - client: "AiravataClient", - entity_id: str, - *, - gateway_groups: Optional[dict] = None, -) -> "SharedEntity": - """Only directly granted permissions (the only ones the portal UI can edit).""" - return _load_shared_entity( - client, entity_id, directly=True, gateway_groups=gateway_groups) - - -def get_all_shared_entity( - client: "AiravataClient", - entity_id: str, - *, - gateway_groups: Optional[dict] = None, -) -> "SharedEntity": - """All (direct + inherited) sharing settings.""" - return _load_shared_entity( - client, entity_id, directly=False, gateway_groups=gateway_groups) - - -# Implied-permission sets for grant/revoke deltas: WRITE implies READ; -# MANAGE_SHARING implies READ + WRITE. -_IMPLIED_PERMISSIONS = { - "READ": {"READ"}, - "WRITE": {"READ", "WRITE"}, - "MANAGE_SHARING": {"READ", "WRITE", "MANAGE_SHARING"}, -} - - -def _compute_revokes_and_grants(current_name, new_name) -> tuple: - """``(revokes, grants)`` permission-NAME sets for one id: diff the - implied-permission sets of *current_name* / *new_name* (``None`` -> empty). - """ - current = _IMPLIED_PERMISSIONS.get(current_name, set()) \ - if current_name is not None else set() - new = _IMPLIED_PERMISSIONS.get(new_name, set()) \ - if new_name is not None else set() - return (current - new, new - current) - - -def compute_sharing_deltas(existing: dict, new: dict) -> dict: - """*existing* / *new* are ``{id -> permission_name}`` maps. Returns - ``{"grant": {perm_name: [ids]}, "revoke": {...}}``. - """ - grant = {"READ": [], "WRITE": [], "MANAGE_SHARING": []} - revoke = {"READ": [], "WRITE": [], "MANAGE_SHARING": []} - all_ids = set(existing.keys()) | set(new.keys()) - for resource_id in all_ids: - revokes, grants = _compute_revokes_and_grants( - existing.get(resource_id), new.get(resource_id)) - for name in revokes: - revoke[name].append(resource_id) - for name in grants: - grant[name].append(resource_id) - return {"grant": grant, "revoke": revoke} - - -def apply_sharing_update( - client: "AiravataClient", - entity_id: str, - *, - existing_user_permissions: dict, - new_user_permissions: dict, - existing_group_permissions: dict, - new_group_permissions: dict, -) -> None: - """Fire ``share_resource_with_*`` / ``revoke_sharing_of_resource_from_*`` for - each non-empty delta bucket. The ``*_permissions`` args are - ``{id -> permission_name}`` maps the caller assembles. - """ - sharing = client.sharing - - user_deltas = compute_sharing_deltas( - existing_user_permissions, new_user_permissions) - for name, ids in user_deltas["grant"].items(): - if ids: - sharing.share_resource_with_users( - entity_id, {uid: name for uid in ids}) - for name, ids in user_deltas["revoke"].items(): - if ids: - sharing.revoke_sharing_of_resource_from_users( - entity_id, {uid: name for uid in ids}) - - group_deltas = compute_sharing_deltas( - existing_group_permissions, new_group_permissions) - for name, ids in group_deltas["grant"].items(): - if ids: - sharing.share_resource_with_groups( - entity_id, {gid: name for gid in ids}) - for name, ids in group_deltas["revoke"].items(): - if ids: - sharing.revoke_sharing_of_resource_from_groups( - entity_id, {gid: name for gid in ids}) diff --git a/airavata-python-sdk/airavata_sdk/helpers/storage_resources.py b/airavata-python-sdk/airavata_sdk/helpers/storage_resources.py deleted file mode 100644 index 2197559ad1a..00000000000 --- a/airavata-python-sdk/airavata_sdk/helpers/storage_resources.py +++ /dev/null @@ -1,205 +0,0 @@ -"""Storage-domain helpers. - -Storage resources, per-protocol data movement, and user-storage file/directory -listings are proto-direct: each ``get_*`` / ``list_*`` returns its proto (or the -raw ``{storage_resource_id: host_name}`` map) as-is — these are gateway-level -catalog / metadata entries with no ownership or sharing fields. The data-product -download orchestration at the bottom spans the research + storage facades and -returns plain file-like objects (not part of the read contract). -""" - -from __future__ import annotations - -from typing import TYPE_CHECKING, Optional - -if TYPE_CHECKING: - from airavata_sdk.client import AiravataClient - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.storageresource import ( # noqa: E501 - storage_resource_pb2, - ) - from airavata_sdk.generated.org.apache.airavata.model.data.movement import ( # noqa: E501 - data_movement_pb2, - ) - from airavata_sdk.generated.services import file_service_pb2 - - -def get_storage_resource( - client: "AiravataClient", - storage_resource_id: str, -) -> "storage_resource_pb2.StorageResourceDescription": - return client.storage.get_storage_resource(storage_resource_id) - - -def list_storage_resource_names(client: "AiravataClient") -> dict[str, str]: - """The ``{storage_resource_id: host_name}`` map, passed straight through.""" - return client.storage.get_all_storage_resource_names() - - -# Per-protocol data movement (Local / SCP / GridFTP) — bare proto, no envelope. - - -def get_local_data_movement( - client: "AiravataClient", - data_movement_id: str, -) -> "data_movement_pb2.LOCALDataMovement": - return client.storage.get_local_data_movement(data_movement_id) - - -def get_scp_data_movement( - client: "AiravataClient", - data_movement_id: str, -) -> "data_movement_pb2.SCPDataMovement": - return client.storage.get_scp_data_movement(data_movement_id) - - -def get_grid_ftp_data_movement( - client: "AiravataClient", - data_movement_id: str, -) -> "data_movement_pb2.GridFTPDataMovement": - return client.storage.get_grid_ftp_data_movement(data_movement_id) - - -# User-storage paths (file/directory listings) — proto-direct. The per-entry -# write/shared-dir flags, hyperlinks, and the experiment-dir relative-path -# rewrite are portal path-decisions the ViewSet layers on the rendered proto. -# The orchestration helpers resolve the bare portal path to the absolute -# ``~/``-prefixed path the facade expects, then wrap the raw facade. - - -def resolve_user_storage_path( - client: "AiravataClient", - path: str, - experiment_id: Optional[str] = None, -) -> str: - """Resolve a portal user-storage path to the absolute facade path. - - A bare relative path is relative to the user's storage root (``~/``); with - *experiment_id* it is relative to that experiment's data directory. - """ - rel = (path or "").lstrip("/") - if experiment_id: - experiment = client.research.get_experiment(experiment_id) - data_dir = ( - experiment.user_configuration_data.experiment_data_dir - if experiment.HasField("user_configuration_data") - else None - ) or "" - # The experiment data dir is user-storage-relative. The SDK launch persists it with a - # leading '/' that the staging write side (DataStagingTask.buildDestinationFilePath) strips - # and anchors under the storage root; strip it here too and anchor under '~/' — otherwise - # list_dir/dir_exists resolve against the SFTP chroot root (outside it) and show "no files". - base = data_dir.strip("/") - full = base + ("/" + rel if rel else "") - if full.startswith("~/"): - return full - return "~/" + full - if rel.startswith("~"): - return rel - return "~/" + rel - - -def dir_exists( - client: "AiravataClient", - resolved_path: str, -) -> bool: - return client.storage.dir_exists(resolved_path) - - -def create_dir( - client: "AiravataClient", - resolved_path: str, -) -> None: - client.storage.create_dir(resolved_path) - - -def delete_file( - client: "AiravataClient", - resolved_path: str, -) -> None: - client.storage.delete_file(resolved_path) - - -def delete_dir( - client: "AiravataClient", - resolved_path: str, -) -> None: - client.storage.delete_dir(resolved_path) - - -def get_file_metadata( - client: "AiravataClient", - resolved_path: str, -) -> "file_service_pb2.FileMetadataResponse": - return client.storage.get_file_metadata(resolved_path) - - -def list_dir( - client: "AiravataClient", - resolved_path: str, -) -> "file_service_pb2.ListDirResponse": - return client.storage.list_dir(resolved_path) - - -def list_experiment_dir( - client: "AiravataClient", - resolved_path: str, -) -> "file_service_pb2.ListDirResponse": - """Same proto shape as :func:`list_dir`; the ViewSet rewrites each entry's - ``path`` relative to the experiment data dir. - """ - return client.storage.list_dir(resolved_path) - - -# Data-product file download (output-view-provider data generation). Thin -# orchestration over the research (``GetDataProduct``) + storage -# (``FileExists`` / ``DownloadFile``) facades. - - -def data_product_file_path(data_product) -> Optional[str]: - """First replica's ``file_path``, or None. - - The storage facade expects the FULL path, absolute or ``~/``-prefixed (a bare - relative path NPEs server-side); a relative replica path is ``~/``-prefixed. - """ - replicas = data_product.replica_locations - if not replicas: - return None - file_path = replicas[0].file_path - if not file_path: - return None - if not (file_path.startswith("/") or file_path.startswith("~/")): - file_path = "~/" + file_path - return file_path - - -def file_exists( - client: "AiravataClient", - resolved_path: str, -) -> bool: - return client.storage.file_exists(resolved_path) - - -def download_data_product_files( - client: "AiravataClient", - data_product_uris, -) -> list: - """For each ``airavata-dp://`` URI, fetch the product, resolve its first - replica's file path, and download its bytes when the file exists. - - Returns a list of :class:`io.BytesIO` (``.name`` set to the download name or - the path basename), in input-URI order. URIs with no replica / missing file - contribute nothing. - """ - import io - import os - - output_files = [] - for uri in data_product_uris: - data_product = client.research.get_data_product(uri) - path = data_product_file_path(data_product) - if path and client.storage.file_exists(path): - resp = client.storage.download_file(path) - output_file = io.BytesIO(resp.content) - output_file.name = resp.name or os.path.basename(path) - output_files.append(output_file) - return output_files diff --git a/airavata-python-sdk/airavata_sdk/samples/api_server_client_samples.py b/airavata-python-sdk/airavata_sdk/samples/api_server_client_samples.py deleted file mode 100644 index f66b6a113f0..00000000000 --- a/airavata-python-sdk/airavata_sdk/samples/api_server_client_samples.py +++ /dev/null @@ -1,193 +0,0 @@ -# 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. -# -import logging - -from airavata_sdk.generated.org.apache.airavata.model.workspace import workspace_pb2 -from airavata_sdk.generated.org.apache.airavata.model.experiment import experiment_pb2 -from airavata_sdk.generated.org.apache.airavata.model.appcatalog.groupresourceprofile import group_resource_profile_pb2 -from airavata_sdk.clients.api_server_client import APIServerClient -from airavata_sdk.clients.keycloak_token_fetcher import Authenticator - -logger = logging.getLogger(__name__) - -logger.setLevel(logging.DEBUG) -# create console handler with a higher log level -handler = logging.StreamHandler() -handler.setLevel(logging.DEBUG) - -authenticator = Authenticator() -token = authenticator.get_token_and_user_info_password_flow("default-admin", "123456", "default") - -# load APIServerClient with access token -client = APIServerClient(access_token=token) - - -# check for given gateway exists -def is_gateway_exists(): - try: - is_exists = client.is_gateway_exist("default") - print("Gateway exist: " + str(is_exists)) - except Exception: - logger.exception("Error occurred") - - -# check if given user exists in given gateway -def is_user_exists(): - try: - is_exists = client.is_user_exists("default", "default-admin") - print("User exist: " + str(is_exists)) - except Exception: - logger.exception("Error occurred") - - -# adding a new gateway -def add_gateway(): - try: - gateway = workspace_pb2.Gateway( - gateway_id="test-gw", - domain="airavata.org", - gateway_admin_email="gw@gmail.com", - gateway_admin_first_name="isuru", - gateway_admin_last_name="ranawaka", - gateway_name="test-gw", - gateway_approval_status=workspace_pb2.REQUESTED, - ) - gateway_id = client.add_gateway(gateway) - print("Gateway Id :" + str(gateway_id)) - except Exception: - logger.exception("Error occurred") - - -# delete gateway -def delete_gateway(): - try: - gateway = client.delete_gateway("test-gw") - print("Gateway deleted ", gateway) - except Exception: - logger.exception("Error occurred") - - -# get all existing gateways -def get_all_gateways(): - try: - gateway = client.get_all_gateways() - print("Get all gateways :", gateway) - except Exception: - logger.exception("Error occurred") - - -def create_notification(): - try: - notification = workspace_pb2.Notification( - gateway_id="default", - title="default-gateway-notification", - notification_message="Hello gateway", - ) - created_notification = client.create_notification(notification) - print("Notification Created ", created_notification) - except Exception: - logger.exception("Error occurred") - - -def get_all_notifications(): - try: - notifications = client.get_all_notifications("default") - print("Notifications ", notifications) - except Exception: - logger.exception("Error occurred") - - -def create_project(): - try: - project = workspace_pb2.Project( - project_id="def1234", - owner="default-admin", - gateway_id="default", - name="defaultProject", - ) - pro = client.create_project("default", project) - print("Project created ", pro) - except Exception: - logger.exception("Error occurred") - - -def search_projects(): - try: - filters = {experiment_pb2.PROJECT_DESCRIPTION: "defaultProject"} - projects = client.search_projects("default-gateway", "default-admin", filters, limit=10, offset=0) - print(projects) - except Exception: - logger.exception("Error occurred") - - -def create_experiment(): - try: - experiment_model = experiment_pb2.ExperimentModel( - experiment_id="exp123", - project_id="def1234", - gateway_id="default", - experiment_type=experiment_pb2.SINGLE_APPLICATION, - user_name="default-admin", - experiment_name="test_exp", - ) - exp = client.create_experiment("default", experiment_model) - print("Experiment created ", exp) - except Exception: - logger.exception("Error occurred") - - -def get_experiment(): - try: - experiment = client.get_experiment("test_exp_26302f87-c8eb-4d44-8b6b-4a5c7b1ff014") - print("Experiment ", experiment) - except Exception: - logger.exception("Error occurred") - - -def create_group_resource_profile(): - try: - group_resource = group_resource_profile_pb2.GroupResourceProfile( - gateway_id="default", - group_resource_profile_id="default_profile", - group_resource_profile_name="default_profile_1", - ) - resource = client.create_group_resource_profile(group_resource) - print("Group resource created ", resource) - except Exception: - logger.exception("Error occurred") - - -def update_experiment(): - try: - data_model = experiment_pb2.UserConfigurationDataModel( - group_resource_profile_id="default_profile", - airavata_auto_schedule=True, - override_manual_scheduled_params=True, - ) - experiment = client.get_experiment("test_exp_26302f87-c8eb-4d44-8b6b-4a5c7b1ff014") - experiment.user_configuration_data.CopyFrom(data_model) - exp = client.update_experiment("test_exp_26302f87-c8eb-4d44-8b6b-4a5c7b1ff014", experiment) - print("Updated Experiment ", exp) - except Exception: - logger.exception("Error occurred") - - -def launch_experiment(): - try: - status = client.launch_experiment("test_exp_26302f87-c8eb-4d44-8b6b-4a5c7b1ff014", "default") - print("Experiment Status ", status) - except Exception: - logger.exception("Error occurred") diff --git a/airavata-python-sdk/airavata_sdk/samples/create_launch_echo_experiment.py b/airavata-python-sdk/airavata_sdk/samples/create_launch_echo_experiment.py deleted file mode 100644 index a85a1d8c854..00000000000 --- a/airavata-python-sdk/airavata_sdk/samples/create_launch_echo_experiment.py +++ /dev/null @@ -1,109 +0,0 @@ -import logging -import time - -from airavata_sdk.clients.api_server_client import APIServerClient -from airavata_sdk.clients.credential_store_client import CredentialStoreClient -from airavata_sdk.clients.keycloak_token_fetcher import Authenticator -from airavata_sdk.clients.sftp_file_handling_client import SFTPConnector -from airavata_sdk.clients.utils.api_server_client_util import APIServerClientUtil -from airavata_sdk.clients.utils.data_model_creation_util import DataModelCreationUtil -from airavata_sdk import Settings - -logger = logging.getLogger(__name__) - -logger.setLevel(logging.DEBUG) -authenticator = Authenticator() -username: str = "username" -password: str = "password" -gateway_id: str = "cyberwater" -token = authenticator.get_token_and_user_info_password_flow(username=username, password=password, gateway_id=gateway_id) - -api_server_client = APIServerClient() - -data_model_client = DataModelCreationUtil( - gateway_id=gateway_id, - username=username, - password=password, - access_token=token.accessToken, -) - -credential_store_client = CredentialStoreClient() - -airavata_util = APIServerClientUtil( - gateway_id=gateway_id, - username=username, - password=password, -) - -executionId = airavata_util.get_execution_id("Echo") -assert executionId is not None - -projectId = airavata_util.get_project_id("Default Project") - -resourceHostId = airavata_util.get_resource_host_id("karst.uits.iu.edu") - -groupResourceProfileId = airavata_util.get_group_resource_profile_id("Default Gateway Profile") - -storageId = airavata_util.get_storage_resource_id("pgadev.scigap.org") - -# create experiment data model -experiment = data_model_client.get_experiment_data_model_for_single_application( - project_name="Default Project", - application_name="Echo", - experiment_name="Testing_ECHO_SDK 2", - description="Testing") - -sftp_connector = SFTPConnector(host="cyberwater.scigap.org", port=9000, username="isuru_janith", - password=token.accessToken) -path_suffix = sftp_connector.upload_files("/Users/isururanawaka/Documents/Cyberwater/poc2/resources/storage", - "Default_Project", - experiment.experimentName) - -sftp_connector = SFTPConnector(host="cyberwater.scigap.org", port=9000, username="isuru_janith", - password=token.accessToken) -path_suffix = sftp_connector.upload_files("/Users/isururanawaka/Documents/Cyberwater/poc2/resources/storage", - "Default_Project", - experiment.experimentName) - -path = Settings().GATEWAY_DATA_STORE_DIR + path_suffix - -# configure computational resources -experiment = data_model_client.configure_computation_resource_scheduling(experiment_model=experiment, - computation_resource_name="karst.uits.iu.edu", - group_resource_profile_name="Default Gateway Profile", - inputStorageId="pgadev.scigap.org", - outputStorageId="pgadev.scigap.org", - node_count=1, - total_cpu_count=16, - wall_time_limit=15, - queue_name="batch", - experiment_dir_path=path) - -inputs = api_server_client.get_application_inputs(token, executionId) - -experiment.experimentInputs = inputs - -outputs = api_server_client.get_application_outputs(token, executionId) - -experiment.experimentOutputs = outputs - -# create experiment -ex_id = api_server_client.create_experiment(token, gateway_id, experiment) -print(ex_id) -# launch experiment -api_server_client.launch_experiment(token, ex_id, - gateway_id) - -status = api_server_client.get_experiment_status(token, ex_id); - -if status is not None: - print("Initial state " + str(status.state)) -while status.state <= 6: - status = api_server_client.get_experiment_status(token, - ex_id); - time.sleep(30) - print("State " + str(status.state)) - -print("Completed") - -sftp_connector.download_files(".", f"Default_Project/{experiment.experimentName}") diff --git a/airavata-python-sdk/airavata_sdk/samples/create_launch_gaussian_experiment.py b/airavata-python-sdk/airavata_sdk/samples/create_launch_gaussian_experiment.py deleted file mode 100644 index 4640aed6309..00000000000 --- a/airavata-python-sdk/airavata_sdk/samples/create_launch_gaussian_experiment.py +++ /dev/null @@ -1,124 +0,0 @@ -# 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. -# - -import logging -import time - -import airavata_sdk.samples.file_utils as fb -from airavata_sdk.clients.api_server_client import APIServerClient -from airavata_sdk.clients.credential_store_client import CredentialStoreClient -from airavata_sdk.clients.keycloak_token_fetcher import Authenticator -from airavata_sdk.clients.utils.api_server_client_util import APIServerClientUtil -from airavata_sdk.clients.utils.data_model_creation_util import DataModelCreationUtil - -logger = logging.getLogger(__name__) - -logger.setLevel(logging.DEBUG) - -authenticator = Authenticator() - -user_name = "username" -password = "password" -gateway_id = "cyberwater" - -token = authenticator.get_token_and_user_info_password_flow( - username=user_name, - password=password, - gateway_id=gateway_id, -) - -api_server_client = APIServerClient() - -airavata_util = APIServerClientUtil( - gateway_id=gateway_id, - username=user_name, - password=password, -) -data_model_client = DataModelCreationUtil( - gateway_id=gateway_id, - username=user_name, - password=password, -) - -credential_store_client = CredentialStoreClient() - -executionId = airavata_util.get_execution_id("Gaussian") -projectId = airavata_util.get_project_id("Default Project") - -resourceHostId = airavata_util.get_resource_host_id("karst.uits.iu.edu") - -groupResourceProfileId = airavata_util.get_group_resource_profile_id("Default Gateway Profile") - -storageId = airavata_util.get_storage_resource_id("pgadev.scigap.org") - -# create Experiment data Model - -experiment = data_model_client.get_experiment_data_model_for_single_application( - project_name="Default Project", - application_name="Gaussian", - experiment_name="Gaussian_16", - description="Testing") - -folder_name = "storage" - -path = fb.upload_files(api_server_client, credential_store_client, token, gateway_id, - storageId, - "pgadev.scigap.org", user_name, "Default_Project", executionId, - "/Users/isururanawaka/Documents/Cyberwater/poc/resources/storage/") - -experiment = data_model_client.configure_computation_resource_scheduling(experiment_model=experiment, - computation_resource_name="karst.uits.iu.edu", - group_resource_profile_name="Default Gateway Profile", - inputStorageId="pgadev.scigap.org", - outputStorageId="pgadev.scigap.org", - node_count=1, - total_cpu_count=16, - wall_time_limit=15, - queue_name="batch", - experiment_dir_path=path) - -data_uri = data_model_client.register_input_file(file_identifier="npentane12diol.inp", - storage_name='pgadev.scigap.org', - storageId='pgadev.scigap.org_asdasdad', - input_file_name="npentane12diol.inp", - uploaded_storage_path=path) - -input_files = [data_uri] - -experiment = data_model_client.configure_input_and_outputs(experiment, input_files=input_files, - application_name="Gaussian") - -# create experiment -ex_id = api_server_client.create_experiment(token, "cyberwater", experiment) - -# launch experiment -api_server_client.launch_experiment(token, ex_id, "cyberwater") - -status = api_server_client.get_experiment_status(token, ex_id); - -if status is not None: - print("Initial state " + str(status.state)) -while status.state <= 6: - status = api_server_client.get_experiment_status(token, - ex_id); - time.sleep(30) - print("State " + str(status.state)) - -print("Completed") - -fb.download_files(api_server_client, credential_store_client, token, "cyberwater", - storageId, - "pgadev.scigap.org", user_name, "Default_Project", executionId, ".") diff --git a/airavata-python-sdk/airavata_sdk/samples/file_utils.py b/airavata-python-sdk/airavata_sdk/samples/file_utils.py deleted file mode 100644 index fd3fa6a7310..00000000000 --- a/airavata-python-sdk/airavata_sdk/samples/file_utils.py +++ /dev/null @@ -1,47 +0,0 @@ -import io - -import paramiko - -from airavata_sdk.clients.file_handling_client import FileHandler - - -def upload_files(api_server_client, credential_store_client, token, gateway_id, storage_id, storage_host, - username, project_name, experiment_id, local_folder_path, ): - gateway_storage_preferance = api_server_client.get_gateway_storage_preference(token, gateway_id, - storage_id) - - credential = credential_store_client.get_SSH_credential( - gateway_storage_preferance.resourceSpecificCredentialStoreToken, - gateway_id); - private_key_file = io.StringIO() - private_key_file.write(credential.privateKey) - private_key_file.seek(0) - private_key = paramiko.RSAKey.from_private_key(private_key_file, credential.passphrase) - - file_handler = FileHandler(storage_host, 22, gateway_storage_preferance.loginUserName, credential.passphrase, - private_key) - remotePath = gateway_storage_preferance.fileSystemRootLocation + "/" + username + "/" + project_name + "/" + experiment_id + "/" - file_handler.upload_file(local_folder_path, - remotePath, - True, True) - return remotePath - - -def download_files(api_server_client, credential_store_client, token, gateway_id, storage_id, storage_host, - username, project_name, experiment_id, local_folder_path): - gateway_storage_preferance = api_server_client.get_gateway_storage_preference(token, gateway_id, - storage_id) - - credential = credential_store_client.get_SSH_credential( - gateway_storage_preferance.resourceSpecificCredentialStoreToken, - gateway_id); - - private_key_file = io.StringIO() - private_key_file.write(credential.privateKey) - private_key_file.seek(0) - private_key = paramiko.RSAKey.from_private_key(private_key_file, credential.passphrase) - - file_handler = FileHandler(storage_host, 22, gateway_storage_preferance.loginUserName, credential.passphrase, - private_key) - remotePath = gateway_storage_preferance.fileSystemRootLocation + "/" + username + "/" + project_name + "/" + experiment_id + "/" - file_handler.download_file(remotePath, local_folder_path, True, True) diff --git a/airavata-python-sdk/airavata_sdk/samples/group_manager_client_samples.py b/airavata-python-sdk/airavata_sdk/samples/group_manager_client_samples.py deleted file mode 100644 index 742e3d0919d..00000000000 --- a/airavata-python-sdk/airavata_sdk/samples/group_manager_client_samples.py +++ /dev/null @@ -1,75 +0,0 @@ -# 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. -# - -import logging - -from airavata_sdk.generated.org.apache.airavata.model.group import group_manager_pb2 -from airavata_sdk.clients.group_manager_client import GroupManagerClient -from airavata_sdk.clients.keycloak_token_fetcher import Authenticator - -logger = logging.getLogger(__name__) - -logger.setLevel(logging.DEBUG) - -authenticator = Authenticator() -token = authenticator.get_token_and_user_info_password_flow("default-admin", "123456", "default") - -# load GroupManagerClient with access token -client = GroupManagerClient(access_token=token) - - -# create group in airavata -def create_group(): - try: - group_model = group_manager_pb2.GroupModel( - id="testing_group", - name="testing_group_name", - owner_id="default-admin", - description="This group is used for testing users", - members=["default-admin"], - admins=["default-admin"], - ) - created_group = client.create_group(group_model) - print(created_group) - except Exception: - logger.exception("Exception occurred") - - -# get all groups -def get_groups(): - try: - created_group = client.get_groups() - print("Groups :", created_group) - except Exception: - logger.exception("Exception occurred") - - -def add_group_admin(): - try: - created_group = client.add_group_admins("testing_group", ["default-admin"]) - print("Groups :", created_group) - except Exception: - logger.exception("Exception occurred") - - -def has_owner_access(): - try: - has_access = client.has_owner_access("testing_group", "default-admin") - print("Is have accesss ", has_access) - except Exception: - logger.exception("Exception occurred") - -get_groups() diff --git a/airavata-python-sdk/airavata_sdk/samples/iam_admin_client_samples.py b/airavata-python-sdk/airavata_sdk/samples/iam_admin_client_samples.py deleted file mode 100644 index db008339421..00000000000 --- a/airavata-python-sdk/airavata_sdk/samples/iam_admin_client_samples.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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. -# - -import logging - -from airavata_sdk.clients.iam_admin_client import IAMAdminClient -from airavata_sdk.clients.keycloak_token_fetcher import Authenticator - -logger = logging.getLogger(__name__) - -logger.setLevel(logging.DEBUG) - -authenticator = Authenticator() -token = authenticator.get_token_and_user_info_password_flow("default-admin", "123456", "default") - -# load IAMAdminClient with access token -client = IAMAdminClient(access_token=token) - - -def is_user_exisits(): - try: - user = client.is_user_exist("default-admin") - print("Is user exists :", user) - except Exception: - logger.exception("Error occurred") - - -def get_user(): - try: - user = client.get_user("default-admin") - print("User :", user) - except Exception: - logger.exception("Error occurred") - - -def get_users_with_role(): - try: - user = client.get_users_with_role("admin") - print("Users :", user) - except Exception: - logger.exception("Error occurred") diff --git a/airavata-python-sdk/airavata_sdk/samples/metadata_fetcher.py b/airavata-python-sdk/airavata_sdk/samples/metadata_fetcher.py deleted file mode 100644 index 350fe899cb4..00000000000 --- a/airavata-python-sdk/airavata_sdk/samples/metadata_fetcher.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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. -# - -import logging - -from airavata_sdk.clients.api_server_client import APIServerClient -from airavata_sdk.clients.keycloak_token_fetcher import Authenticator - -logger = logging.getLogger(__name__) - -logger.setLevel(logging.DEBUG) - -authenticator = Authenticator() -token = authenticator.get_token_and_user_info_password_flow("username", "password", "cyberwater") - -api_server_client = APIServerClient() - -# fetch all application deployments -deployments = api_server_client.get_all_application_deployments(token, "cyberwater"); -print(deployments); -# appModuleId for execution Id - - -# compute resource names and Ids -compute_resoure_name = api_server_client.get_all_compute_resource_names(token); -print(compute_resoure_name); - -# get resource profiles -resource_profile = api_server_client.get_all_gateway_resource_profiles(token); -print(resource_profile); - -# get resource profiles -group_resource_list = api_server_client.get_group_resource_list(token, "cyberwater"); -print(group_resource_list); - -# provides storage resources -storage_resource = api_server_client.get_all_storage_resource_names(token) -print(storage_resource); diff --git a/airavata-python-sdk/airavata_sdk/samples/sharing_registry_client_samples.py b/airavata-python-sdk/airavata_sdk/samples/sharing_registry_client_samples.py deleted file mode 100644 index be92a8e84f8..00000000000 --- a/airavata-python-sdk/airavata_sdk/samples/sharing_registry_client_samples.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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. -# - - -import logging - -from airavata_sdk.generated.org.apache.airavata.model.sharing import sharing_pb2 -from airavata_sdk.clients.keycloak_token_fetcher import Authenticator -from airavata_sdk.clients.sharing_registry_client import SharingRegistryClient - -logger = logging.getLogger(__name__) - -logger.setLevel(logging.DEBUG) - -authenticator = Authenticator() -token = authenticator.get_token_and_user_info_password_flow("default-admin", "123456", "default") - -# load SharingRegistryClient with access token -client = SharingRegistryClient(access_token=token) - - -# create domain -def create_domain(): - try: - domain = sharing_pb2.Domain( - domain_id="gw@scigap.org", - name="gw", - description="this domain is used by testing server", - ) - domain_id = client.create_domain(domain) - print("Domain created :", domain_id) - except Exception: - logger.exception("Error occurred") - - -# get domain -def get_domain(): - try: - domain = client.get_domain("gw") - print("Domain :", domain) - except Exception: - logger.exception("Error occurred") - - -def create_entity_type(): - try: - entity_type = sharing_pb2.EntityType( - domain_id="gw@scigap.org", - description="project entity type", - name="PROJECT", - entity_type_id="gw@scigap.org:PROJECT", - ) - en_type = client.create_entity_type(entity_type) - print("Entity Type ", en_type) - except Exception: - logger.exception("Error occurred") - - -def create_entity(): - try: - entity = sharing_pb2.Entity( - entity_type_id="gw@scigap.org:PROJECT", - name="PROJECT_ENTITY", - domain_id="gw", - owner_id="default-admin", - ) - en_type = client.create_entity(entity) - print("Entity Type ", en_type) - except Exception: - logger.exception("Error occurred") diff --git a/airavata-python-sdk/airavata_sdk/samples/tenant_profile_client_samples.py b/airavata-python-sdk/airavata_sdk/samples/tenant_profile_client_samples.py deleted file mode 100644 index 7faf9788103..00000000000 --- a/airavata-python-sdk/airavata_sdk/samples/tenant_profile_client_samples.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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. -# - -import logging - -from airavata_sdk.clients.keycloak_token_fetcher import Authenticator -from airavata_sdk.clients.tenant_profile_client import TenantProfileClient - -logger = logging.getLogger(__name__) - -logger.setLevel(logging.DEBUG) - -authenticator = Authenticator() -token = authenticator.get_token_and_user_info_password_flow("default-admin", "123456", "default") - -# load TenantProfileClient with access token -client = TenantProfileClient(access_token=token) - - -def get_all_gateways(): - try: - gws = client.get_all_gateways() - print("Gateways ", gws) - except Exception: - logger.exception("Error occurred") - - -def is_gateway_exsist(): - try: - gw_exisist = client.is_gateway_exist("default") - print("Gateways ", gw_exisist) - except Exception: - logger.exception("Error occurred") diff --git a/airavata-python-sdk/airavata_sdk/samples/user_profile_client_samples.py b/airavata-python-sdk/airavata_sdk/samples/user_profile_client_samples.py deleted file mode 100644 index 4305c2cb8c7..00000000000 --- a/airavata-python-sdk/airavata_sdk/samples/user_profile_client_samples.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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. -# - -import logging - -from airavata_sdk.generated.org.apache.airavata.model.user import user_profile_pb2 -from airavata_sdk.clients.keycloak_token_fetcher import Authenticator -from airavata_sdk.clients.user_profile_client import UserProfileClient - -logger = logging.getLogger(__name__) - -logger.setLevel(logging.DEBUG) - -authenticator = Authenticator() -token = authenticator.get_token_and_user_info_password_flow("default-admin", "123456", "default") - -# load UserProfileClient with access token -client = UserProfileClient(access_token=token) - - -def add_user_profile(): - try: - profile = user_profile_pb2.UserProfile( - gateway_id="default", - user_id="default-admin", - emails=["gw@scigap.org"], - airavata_internal_user_id="default-admin", - user_model_version="1.0.0", - first_name="Isuru", - last_name="Ranawaka", - creation_time=1576103354, - last_access_time=1576103296, - valid_until=1607725696, - state=user_profile_pb2.ACTIVE, - ) - added_profile = client.add_user_profile(profile) - print("Add user profile", added_profile) - except Exception: - logger.exception("Error Occurred") - - -def get_all_user_profiles_in_gateway(): - try: - profiles = client.get_all_user_profiles_in_gateway("default", offset=0, limit=20) - print("User Profiles ", profiles) - except Exception: - logger.exception("Error Occurred") diff --git a/airavata-python-sdk/airavata_sdk/transport/__init__.py b/airavata-python-sdk/airavata_sdk/transport/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/airavata-python-sdk/airavata_sdk/transport/utils.py b/airavata-python-sdk/airavata_sdk/transport/utils.py deleted file mode 100644 index 0b1fa2ab4c7..00000000000 --- a/airavata-python-sdk/airavata_sdk/transport/utils.py +++ /dev/null @@ -1,186 +0,0 @@ -# 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. -# - -import json -import logging -from typing import Optional - -import grpc - -from airavata_sdk import Settings - -log = logging.getLogger(__name__) - -settings = Settings() - - -class GrpcChannel: - """Manages a gRPC channel with optional TLS.""" - - def __init__(self, host: str, port: int, secure: bool = False): - self.target = f"{host}:{port}" - if secure: - self.channel = grpc.secure_channel(self.target, grpc.ssl_channel_credentials()) - else: - self.channel = grpc.insecure_channel(self.target) - log.debug(f"[AV] Created gRPC channel to {self.target} (secure={secure})") - - def close(self): - self.channel.close() - - -class AuthMetadataPlugin(grpc.AuthMetadataPlugin): - """Injects Bearer token into gRPC call metadata.""" - - def __init__(self, access_token: str, claims: Optional[dict] = None): - self.access_token = access_token - self.claims = claims or {} - - def __call__(self, context, callback): - metadata = [("authorization", f"Bearer {self.access_token}")] - callback(metadata, None) - - -def build_metadata(access_token: Optional[str] = None, claims: Optional[dict] = None) -> list[tuple[str, str]]: - """Build gRPC call metadata from token and claims.""" - metadata = [] - if access_token: - metadata.append(("authorization", f"Bearer {access_token}")) - return metadata - - -# --------------------------------------------------------------------------- -# Stub factory helpers -# --------------------------------------------------------------------------- - -def create_experiment_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import experiment_service_pb2_grpc - return experiment_service_pb2_grpc.ExperimentServiceStub(channel) - - -def create_project_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import project_service_pb2_grpc - return project_service_pb2_grpc.ProjectServiceStub(channel) - - -def create_gateway_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import gateway_service_pb2_grpc - return gateway_service_pb2_grpc.GatewayServiceStub(channel) - - -def create_application_catalog_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import application_catalog_service_pb2_grpc - return application_catalog_service_pb2_grpc.ApplicationCatalogServiceStub(channel) - - -def create_resource_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import resource_service_pb2_grpc - return resource_service_pb2_grpc.ResourceServiceStub(channel) - - -def create_credential_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import credential_service_pb2_grpc - return credential_service_pb2_grpc.CredentialServiceStub(channel) - - -def create_sharing_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import sharing_service_pb2_grpc - return sharing_service_pb2_grpc.SharingServiceStub(channel) - - -def create_notification_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import notification_service_pb2_grpc - return notification_service_pb2_grpc.NotificationServiceStub(channel) - - -def create_data_product_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import data_product_service_pb2_grpc - return data_product_service_pb2_grpc.DataProductServiceStub(channel) - - -def create_gateway_resource_profile_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import gateway_resource_profile_service_pb2_grpc - return gateway_resource_profile_service_pb2_grpc.GatewayResourceProfileServiceStub(channel) - - -def create_user_resource_profile_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import user_resource_profile_service_pb2_grpc - return user_resource_profile_service_pb2_grpc.UserResourceProfileServiceStub(channel) - - -def create_group_resource_profile_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import group_resource_profile_service_pb2_grpc - return group_resource_profile_service_pb2_grpc.GroupResourceProfileServiceStub(channel) - - -def create_parser_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import parser_service_pb2_grpc - return parser_service_pb2_grpc.ParserServiceStub(channel) - - -def create_group_manager_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import group_manager_service_pb2_grpc - return group_manager_service_pb2_grpc.GroupManagerServiceStub(channel) - - -def create_iam_admin_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import iam_admin_service_pb2_grpc - return iam_admin_service_pb2_grpc.IamAdminServiceStub(channel) - - -def create_user_profile_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import user_profile_service_pb2_grpc - return user_profile_service_pb2_grpc.UserProfileServiceStub(channel) - - -def create_agent_interaction_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import agent_service_pb2_grpc - return agent_service_pb2_grpc.AgentInteractionServiceStub(channel) - - -def create_plan_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import agent_service_pb2_grpc - return agent_service_pb2_grpc.PlanServiceStub(channel) - - -def create_experiment_management_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import experiment_management_service_pb2_grpc - return experiment_management_service_pb2_grpc.ExperimentManagementServiceStub(channel) - - -def create_research_hub_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import research_service_pb2_grpc - return research_service_pb2_grpc.ResearchHubServiceStub(channel) - - -def create_research_project_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import research_service_pb2_grpc - return research_service_pb2_grpc.ResearchProjectServiceStub(channel) - - -def create_research_resource_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import research_service_pb2_grpc - return research_service_pb2_grpc.ResearchResourceServiceStub(channel) - - -def create_research_session_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import research_service_pb2_grpc - return research_service_pb2_grpc.ResearchSessionServiceStub(channel) - - -def create_user_storage_service_stub(channel: grpc.Channel): - from airavata_sdk.generated.services import file_service_pb2_grpc - return file_service_pb2_grpc.UserStorageServiceStub(channel) diff --git a/airavata-python-sdk/codegen.py b/airavata-python-sdk/codegen.py new file mode 100644 index 00000000000..2c5a6235781 --- /dev/null +++ b/airavata-python-sdk/codegen.py @@ -0,0 +1,210 @@ +#!/usr/bin/env python3 +# /// script +# requires-python = ">=3.10" +# dependencies = [ +# "grpcio-tools==1.80.0", +# "googleapis-common-protos>=1.62.0", +# ] +# /// +"""Regenerate airavata/model + airavata/services from the airavata-api protos. + +Run: `uv run --script codegen.py` (needs an airavata-api sibling checkout). +""" + +from __future__ import annotations + +import os +import shutil +import sys +import tempfile +from pathlib import Path + +SDK_ROOT = Path(__file__).resolve().parent +PROTO_API_ROOT = SDK_ROOT.parent / "airavata-api" +MODEL_PROTO_ROOT = PROTO_API_ROOT / "src" / "main" / "proto" + +AIRAVATA_PKG = SDK_ROOT / "airavata" +MODEL_OUT = AIRAVATA_PKG / "model" +SERVICES_OUT = AIRAVATA_PKG / "services" + +SMOKE_CHECKS = [ + (SERVICES_OUT / "experiment_service_pb2_grpc.py", "GetFullExperiment"), + (SERVICES_OUT / "experiment_set_service_pb2_grpc.py", "ExperimentSetServiceStub"), + (MODEL_OUT / "commons" / "commons_pb2.pyi", "AccessFlags"), +] + + +def _fail(msg: str) -> None: + sys.stderr.write(f"codegen: {msg}\n") + sys.exit(1) + + +def _underscore(name: str) -> str: + return name.replace("-", "_") + + +def _service_protos() -> list[Path]: + protos = [ + p + for p in PROTO_API_ROOT.glob("*/src/main/proto/*.proto") + if "/org/" not in p.as_posix() + ] + if not protos: + _fail(f"no service protos found under {PROTO_API_ROOT}/*/src/main/proto/") + return sorted(protos) + + +def _rewrite_proto_imports(text: str) -> str: + # flat sibling-service import -> services/.proto + out = [] + for line in text.splitlines(keepends=True): + stripped = line.strip() + if stripped.startswith("import \"") and "/" not in stripped[len("import \""):]: + inner = stripped[len("import \"") : stripped.index("\";", len("import \""))] + out.append(f'import "services/{_underscore(inner)}";\n') + else: + out.append(line) + return "".join(out) + + +def _rewrite_py(text: str) -> str: + # rewrite only the import lines + the BuildTop module-name; never the + # serialized descriptors (they carry the org.apache.airavata.* wire identity). + out = [] + for line in text.splitlines(keepends=True): + if line.startswith("from org.apache.airavata."): + line = "from airavata." + line[len("from org.apache.airavata."):] + elif line.startswith("from services import") or line.startswith("from services."): + line = "from airavata." + line[len("from "):] + elif "BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata." in line: + line = line.replace( + "BuildTopDescriptorsAndMessages(DESCRIPTOR, 'org.apache.airavata.", + "BuildTopDescriptorsAndMessages(DESCRIPTOR, 'airavata.", + ) + out.append(line) + return "".join(out) + + +def _relocate_and_rewrite(gen_dir: Path) -> None: + for d in (MODEL_OUT, SERVICES_OUT): + if d.exists(): + shutil.rmtree(d) + + model_src = gen_dir / "org" / "apache" / "airavata" / "model" + if not model_src.is_dir(): + _fail(f"protoc produced no model tree at {model_src}") + services_src = gen_dir / "services" + if not services_src.is_dir(): + _fail(f"protoc produced no services tree at {services_src}") + + def _copy_tree(src: Path, dst: Path) -> None: + for f in sorted(src.rglob("*")): + if f.is_dir(): + continue + dest = dst / f.relative_to(src) + dest.parent.mkdir(parents=True, exist_ok=True) + if f.suffix in (".py", ".pyi"): + dest.write_text(_rewrite_py(f.read_text())) + else: + shutil.copy2(f, dest) + + _copy_tree(model_src, MODEL_OUT) + _copy_tree(services_src, SERVICES_OUT) + + for root in (MODEL_OUT, SERVICES_OUT): + for d in [root, *[p for p in root.rglob("*") if p.is_dir()]]: + init = d / "__init__.py" + if not init.exists(): + init.write_text("") + + +def _proto_includes() -> list[str]: + import grpc_tools + + includes = [] + builtin = Path(grpc_tools.__file__).resolve().parent / "_proto" + if builtin.is_dir(): + includes.append(str(builtin)) + for entry in sys.path: + cand = Path(entry) / "google" / "api" / "annotations.proto" + if cand.is_file(): + includes.append(entry) + break + else: + _fail("google/api/annotations.proto not found; install googleapis-common-protos") + return includes + + +def _stage(stage: Path) -> None: + src_org = MODEL_PROTO_ROOT / "org" + if not src_org.is_dir(): + _fail(f"model proto root not found: {src_org}") + shutil.copytree(src_org, stage / "org") + + services_dir = stage / "services" + services_dir.mkdir(parents=True) + for proto in _service_protos(): + dest = services_dir / _underscore(proto.name) + dest.write_text(_rewrite_proto_imports(proto.read_text())) + + +def _run_protoc(stage: Path, out_dir: Path, rel_protos: list[str], includes: list[str]) -> None: + from grpc_tools import protoc + + args = [ + "grpc_tools.protoc", + f"--proto_path={stage}", + *[f"--proto_path={inc}" for inc in includes], + f"--python_out={out_dir}", + f"--grpc_python_out={out_dir}", + f"--pyi_out={out_dir}", + *rel_protos, + ] + prev = os.getcwd() + os.chdir(stage) + try: + rc = protoc.main(args) + finally: + os.chdir(prev) + if rc != 0: + _fail(f"protoc exited {rc} for: {' '.join(rel_protos[:3])}...") + + +def main() -> None: + if not PROTO_API_ROOT.is_dir(): + _fail(f"airavata-api not found at {PROTO_API_ROOT} (sibling checkout required)") + AIRAVATA_PKG.mkdir(parents=True, exist_ok=True) + + with tempfile.TemporaryDirectory(prefix="airavata-codegen-") as tmp: + stage = Path(tmp) / "stage" + gen = Path(tmp) / "gen" + gen.mkdir(parents=True) + _stage(stage) + includes = _proto_includes() + + org_protos = [ + str(p.relative_to(stage)) for p in sorted((stage / "org").rglob("*.proto")) + ] + svc_protos = [ + str(p.relative_to(stage)) + for p in sorted((stage / "services").glob("*.proto")) + ] + print(f"codegen: {len(org_protos)} model protos, {len(svc_protos)} service protos") + # two passes (models, then services); a combined run fails protoc path relativization + _run_protoc(stage, gen, org_protos, includes) + _run_protoc(stage, gen, svc_protos, includes) + + _relocate_and_rewrite(gen) + + failures = [ + f"{path.relative_to(SDK_ROOT)} missing '{token}'" + for path, token in SMOKE_CHECKS + if not (path.is_file() and token in path.read_text()) + ] + if failures: + _fail("smoke check failed: " + "; ".join(failures)) + print(f"codegen: regenerated {MODEL_OUT.relative_to(SDK_ROOT)} + {SERVICES_OUT.relative_to(SDK_ROOT)}") + + +if __name__ == "__main__": + main() diff --git a/airavata-python-sdk/pyproject.toml b/airavata-python-sdk/pyproject.toml index edcc0ef09b1..4bccd52ded9 100644 --- a/airavata-python-sdk/pyproject.toml +++ b/airavata-python-sdk/pyproject.toml @@ -37,9 +37,8 @@ notebook = [ [tool.setuptools.packages.find] where = ["."] -include = ["airavata_sdk*"] +include = ["airavata*"] exclude = ["*.egg-info"] [tool.setuptools.package-data] -"airavata_sdk.transport" = ["*.ini"] -"airavata_sdk.samples.resources" = ["*.pem"] +"airavata.samples.resources" = ["*.pem"] diff --git a/airavata-python-sdk/tests/helpers/__init__.py b/airavata-python-sdk/tests/helpers/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/airavata-python-sdk/tests/helpers/test_compute_resources.py b/airavata-python-sdk/tests/helpers/test_compute_resources.py deleted file mode 100644 index 1378091ddc5..00000000000 --- a/airavata-python-sdk/tests/helpers/test_compute_resources.py +++ /dev/null @@ -1,882 +0,0 @@ -"""Unit tests for airavata_sdk.helpers.compute_resources. - -The gateway-resource-profile family is proto-direct: ``get_gateway_resource_profile`` -returns a ``WithAccess[GatewayResourceProfile]`` (the raw proto wrapped with the -caller's access flags), so its tests assert the wrapper carries the proto -verbatim plus ``is_owner`` / ``user_has_write_access``. The standalone -gateway-storage-preference family is proto-direct too, but BARE: it has no -ownership / sharing fields, so ``get`` returns one ``StoragePreference`` proto -and ``list`` returns ``list[proto]`` (no envelope). The still-legacy families -(the compute-resource / group-resource-profile / job-submission ``_x_dict`` -transforms) keep their proto → neutral-dict tests. - -Orchestration functions (``get_gateway_resource_profile``, -``update_gateway_resource_profile``) are tested via a lightweight stub client -that records the calls made. -""" - -from airavata_sdk.helpers._envelope import WithAccess -from airavata_sdk.helpers.compute_resources import ( - _data_movement_protocol_int, - _job_submission_protocol_int, - build_gateway_resource_profile, - build_group_resource_profile, - create_gateway_storage_preference, - create_group_resource_profile, - delete_gateway_storage_preference, - delete_group_resource_profile, - get_cloud_job_submission, - get_compute_resource, - get_gateway_resource_profile, - get_gateway_storage_preference, - get_group_resource_profile, - get_local_job_submission, - get_ssh_job_submission, - get_unicore_job_submission, - list_compute_resource_names, - list_gateway_storage_preferences, - list_group_resource_profiles, - update_gateway_resource_profile, - update_gateway_storage_preference, - update_group_resource_profile, -) - - -def _gp_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.gatewayprofile import ( # noqa: E501 - gateway_profile_pb2, - ) - return gateway_profile_pb2 - - -def _make_storage_preference(**kwargs): - return _gp_pb2().StoragePreference(**kwargs) - - -def _make_compute_preference(**kwargs): - return _gp_pb2().ComputeResourcePreference(**kwargs) - - -def _make_profile(**kwargs): - return _gp_pb2().GatewayResourceProfile(**kwargs) - - -# --------------------------------------------------------------------------- -# Protocol enum bridges -# --------------------------------------------------------------------------- - -class TestProtocolEnumBridges: - def test_job_submission_protocol_proto_to_thrift(self): - # proto: 0 UNKNOWN, 1 LOCAL, 2 SSH, 3 GLOBUS, 4 UNICORE, 5 JSP_CLOUD, - # 6 SSH_FORK, 7 LOCAL_FORK - assert _job_submission_protocol_int(0) is None - assert _job_submission_protocol_int(1) == 0 # LOCAL - assert _job_submission_protocol_int(2) == 1 # SSH - assert _job_submission_protocol_int(3) == 2 # GLOBUS - assert _job_submission_protocol_int(4) == 3 # UNICORE - assert _job_submission_protocol_int(5) == 4 # JSP_CLOUD -> CLOUD - assert _job_submission_protocol_int(6) == 5 # SSH_FORK - assert _job_submission_protocol_int(7) == 6 # LOCAL_FORK - - def test_data_movement_protocol_proto_to_thrift(self): - # proto: 0 UNKNOWN, 1 LOCAL, 2 SCP, 3 SFTP, 4 GRID_FTP, 5 UNICORE_SS - assert _data_movement_protocol_int(0) is None - assert _data_movement_protocol_int(1) == 0 # LOCAL - assert _data_movement_protocol_int(2) == 1 # SCP - assert _data_movement_protocol_int(3) == 2 # SFTP - assert _data_movement_protocol_int(4) is None # GRID_FTP (proto-only) - assert _data_movement_protocol_int(5) == 4 # UNICORE_STORAGE_SERVICE - - -# --------------------------------------------------------------------------- -# build_gateway_resource_profile (write path) -# --------------------------------------------------------------------------- - -class TestBuildGatewayResourceProfile: - def test_scalar_fields(self): - pb = build_gateway_resource_profile({ - "gateway_id": "default", - "credential_store_token": "cred", - "identity_server_tenant": "tenant", - "identity_server_pwd_cred_token": "pwd", - }) - assert pb.gateway_id == "default" - assert pb.credential_store_token == "cred" - assert pb.identity_server_tenant == "tenant" - assert pb.identity_server_pwd_cred_token == "pwd" - - def test_protocol_thrift_int_round_trip(self): - # Thrift SSH=1 -> proto SSH=2; Thrift SFTP=2 -> proto SFTP=3 - pb = build_gateway_resource_profile({ - "compute_resource_preferences": [{ - "compute_resource_id": "cr-1", - "preferred_job_submission_protocol": 1, - "preferred_data_movement_protocol": 2, - }], - }) - c = pb.compute_resource_preferences[0] - assert c.preferred_job_submission_protocol == 2 # proto SSH - assert c.preferred_data_movement_protocol == 3 # proto SFTP - - def test_nested_storage_preference(self): - pb = build_gateway_resource_profile({ - "storage_preferences": [{ - "storage_resource_id": "store-1", - "login_user_name": "alice", - }], - }) - assert pb.storage_preferences[0].storage_resource_id == "store-1" - assert pb.storage_preferences[0].login_user_name == "alice" - - def test_empty_lists(self): - pb = build_gateway_resource_profile({"gateway_id": "default"}) - assert list(pb.compute_resource_preferences) == [] - assert list(pb.storage_preferences) == [] - - -# --------------------------------------------------------------------------- -# Orchestration — stub client -# --------------------------------------------------------------------------- - -class _FakeCompute: - def __init__(self, profile): - self._profile = profile - self.updated_gateway_id = None - self.updated_profile = None - - def get_gateway_resource_profile(self, gateway_id): - return self._profile - - def update_gateway_resource_profile(self, gateway_id, profile): - self.updated_gateway_id = gateway_id - self.updated_profile = profile - - -class _FakeClient: - def __init__(self, profile, gateway_id="default", username="alice"): - self.compute = _FakeCompute(profile) - self.gateway_id = gateway_id - self.username = username - - -class TestGetGatewayResourceProfile: - """``get_gateway_resource_profile`` is proto-direct: it returns a - ``WithAccess[GatewayResourceProfile]`` carrying the raw proto verbatim plus - the gateway-catalog access flags (``is_owner`` always ``False``; - ``user_has_write_access`` is the supplied gateway-admin flag).""" - - def _profile(self): - return _make_profile( - gateway_id="default", credential_store_token="cred", - compute_resource_preferences=[ - _make_compute_preference( - compute_resource_id="cr-1", - preferred_job_submission_protocol=2)], - storage_preferences=[ - _make_storage_preference(storage_resource_id="store-1")]) - - def test_returns_withaccess_carrying_the_proto(self): - profile = self._profile() - client = _FakeClient(profile) - result = get_gateway_resource_profile(client, "default", has_write=True) - assert isinstance(result, WithAccess) - # the proto flows through wholesale — no field copied out - assert result.message is profile - assert result.message.gateway_id == "default" - assert result.message.credential_store_token == "cred" - assert (result.message.compute_resource_preferences[0] - .compute_resource_id == "cr-1") - assert (result.message.storage_preferences[0].storage_resource_id - == "store-1") - - def test_is_owner_always_false(self): - client = _FakeClient(self._profile()) - result = get_gateway_resource_profile(client, "default", has_write=True) - assert result.is_owner is False - - def test_has_write_forwarded(self): - client = _FakeClient(self._profile()) - assert get_gateway_resource_profile( - client, "default", has_write=True).user_has_write_access is True - assert get_gateway_resource_profile( - client, "default", has_write=False).user_has_write_access is False - - -class TestUpdateGatewayResourceProfile: - """``update_gateway_resource_profile`` builds the proto from the snake_case - write dict, persists it via the facade, then re-fetches via - ``get_gateway_resource_profile`` so the return is a - ``WithAccess[GatewayResourceProfile]`` matching the read path.""" - - def _profile(self): - return _make_profile( - gateway_id="default", credential_store_token="cred") - - def test_persists_and_refetches(self): - client = _FakeClient(self._profile()) - result = update_gateway_resource_profile( - client, "default", - {"gateway_id": "default", "credential_store_token": "cred"}, - has_write=True) - assert client.compute.updated_gateway_id == "default" - assert client.compute.updated_profile is not None - assert isinstance(result, WithAccess) - assert result.message.gateway_id == "default" - assert result.user_has_write_access is True - - def test_builds_proto_from_data(self): - client = _FakeClient(self._profile()) - update_gateway_resource_profile( - client, "default", - {"gateway_id": "default", "identity_server_tenant": "t"}, - has_write=True) - assert client.compute.updated_profile.identity_server_tenant == "t" - - -# --------------------------------------------------------------------------- -# Gateway storage-preference orchestration (standalone family) -# --------------------------------------------------------------------------- - -class _FakeStoragePrefCompute: - """Stub ``compute`` facade for the standalone storage-preference family.""" - - def __init__(self, prefs): - # prefs: dict storage_resource_id -> StoragePreference proto - self._prefs = dict(prefs) - self.added = [] - self.updated = [] - self.deleted = [] - - def get_all_gateway_storage_preferences(self, gateway_id): - self.last_list_gateway = gateway_id - return list(self._prefs.values()) - - def get_gateway_storage_preference(self, gateway_id, storage_resource_id): - return self._prefs[storage_resource_id] - - def add_gateway_storage_preference(self, gateway_id, storage_resource_id, pref): - self.added.append((gateway_id, storage_resource_id, pref)) - self._prefs[storage_resource_id] = pref - - def update_gateway_storage_preference(self, gateway_id, storage_resource_id, pref): - self.updated.append((gateway_id, storage_resource_id, pref)) - self._prefs[storage_resource_id] = pref - - def delete_gateway_storage_preference(self, gateway_id, storage_resource_id): - self.deleted.append((gateway_id, storage_resource_id)) - self._prefs.pop(storage_resource_id, None) - - -class _FakeStoragePrefClient: - def __init__(self, prefs, gateway_id="default", username="alice"): - self.compute = _FakeStoragePrefCompute(prefs) - self.gateway_id = gateway_id - self.username = username - - -class TestListGatewayStoragePreferences: - """Proto-direct: ``list`` returns a ``list[StoragePreference]`` (bare protos, - no envelope, no dict transform).""" - - def test_returns_protos(self): - client = _FakeStoragePrefClient({ - "store-1": _make_storage_preference( - storage_resource_id="store-1", login_user_name="alice"), - "store-2": _make_storage_preference( - storage_resource_id="store-2", login_user_name="bob"), - }) - out = list_gateway_storage_preferences(client, "default") - assert client.compute.last_list_gateway == "default" - assert all( - isinstance(p, _gp_pb2().StoragePreference) for p in out) - assert {p.storage_resource_id for p in out} == {"store-1", "store-2"} - - def test_empty(self): - client = _FakeStoragePrefClient({}) - assert list_gateway_storage_preferences(client, "default") == [] - - -class TestGetGatewayStoragePreference: - """Proto-direct: ``get`` returns the raw ``StoragePreference`` proto.""" - - def test_returns_proto(self): - pref = _make_storage_preference( - storage_resource_id="store-1", file_system_root_location="/data") - client = _FakeStoragePrefClient({"store-1": pref}) - out = get_gateway_storage_preference(client, "default", "store-1") - # the proto flows through wholesale — no field copied out - assert out is pref - assert out.storage_resource_id == "store-1" - assert out.file_system_root_location == "/data" - - def test_empty_token_stays_empty_string(self): - # proto-direct drops the legacy empty-token -> None coercion; the proto's - # empty string flows through verbatim. - client = _FakeStoragePrefClient({ - "store-1": _make_storage_preference( - storage_resource_id="store-1", - resource_specific_credential_store_token=""), - }) - out = get_gateway_storage_preference(client, "default", "store-1") - assert out.resource_specific_credential_store_token == "" - - -class TestCreateGatewayStoragePreference: - def test_persists_and_refetches(self): - client = _FakeStoragePrefClient({}) - out = create_gateway_storage_preference(client, "default", { - "storage_resource_id": "store-new", - "login_user_name": "alice", - "file_system_root_location": "/data", - }) - assert len(client.compute.added) == 1 - gw, srid, pref = client.compute.added[0] - assert gw == "default" - assert srid == "store-new" - assert pref.login_user_name == "alice" - assert isinstance(out, _gp_pb2().StoragePreference) - assert out.storage_resource_id == "store-new" - assert out.login_user_name == "alice" - - -class TestUpdateGatewayStoragePreference: - def test_path_id_authoritative(self): - client = _FakeStoragePrefClient({ - "store-1": _make_storage_preference(storage_resource_id="store-1"), - }) - out = update_gateway_storage_preference(client, "default", "store-1", { - # a divergent id in the body must be ignored in favour of the path - "storage_resource_id": "WRONG", - "login_user_name": "carol", - }) - assert len(client.compute.updated) == 1 - gw, srid, pref = client.compute.updated[0] - assert srid == "store-1" - assert pref.storage_resource_id == "store-1" - assert pref.login_user_name == "carol" - assert isinstance(out, _gp_pb2().StoragePreference) - assert out.storage_resource_id == "store-1" - - -class TestDeleteGatewayStoragePreference: - def test_delegates_to_facade(self): - client = _FakeStoragePrefClient({ - "store-1": _make_storage_preference(storage_resource_id="store-1"), - }) - result = delete_gateway_storage_preference(client, "default", "store-1") - assert result is None - assert client.compute.deleted == [("default", "store-1")] - - -# --------------------------------------------------------------------------- -# ComputeResourceDescription family (proto-direct) -# --------------------------------------------------------------------------- -# -# ``get_compute_resource`` is proto-direct: it returns the raw -# ``ComputeResourceDescription`` proto verbatim (this family carries no -# ownership / sharing fields, so there is no ``WithAccess`` envelope and no dict -# transform). ``list_compute_resource_names`` passes the raw id->name map -# straight through. The proto -> snake_case JSON serialization (enums as NAMES, -# verbatim file-system map keys) is pinned by the portal contract-snapshot test. - -def _cr_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.computeresource import ( # noqa: E501 - compute_resource_pb2, - ) - return compute_resource_pb2 - - -def _dm_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.data.movement import ( - data_movement_pb2, - ) - return data_movement_pb2 - - -def _make_compute_resource(**kwargs): - return _cr_pb2().ComputeResourceDescription(**kwargs) - - -class _FakeComputeCR: - def __init__(self, cr, names): - self._cr = cr - self._names = names - - def get_compute_resource(self, compute_resource_id): - return self._cr - - def get_all_compute_resource_names(self): - return dict(self._names) - - -class _FakeCRClient: - def __init__(self, cr, names, gateway_id="default", username="alice"): - self.compute = _FakeComputeCR(cr, names) - self.gateway_id = gateway_id - self.username = username - - -class TestGetComputeResource: - """Proto-direct: ``get`` returns the raw ``ComputeResourceDescription`` - proto (no envelope, no dict transform).""" - - def test_returns_proto_verbatim(self): - cr = _make_compute_resource( - compute_resource_id="cr-1", host_name="host", - batch_queues=[_cr_pb2().BatchQueue(queue_name="normal")]) - client = _FakeCRClient(cr, {}) - out = get_compute_resource(client, "cr-1") - # the proto flows through wholesale — no field copied out - assert out is cr - assert isinstance(out, _cr_pb2().ComputeResourceDescription) - assert out.compute_resource_id == "cr-1" - assert out.host_name == "host" - assert out.batch_queues[0].queue_name == "normal" - - -class TestListComputeResourceNames: - def test_passthrough_map(self): - client = _FakeCRClient(None, {"cr-1": "host-1", "cr-2": "host-2"}) - out = list_compute_resource_names(client) - assert out == {"cr-1": "host-1", "cr-2": "host-2"} - - -# =========================================================================== -# GroupResourceProfile -# =========================================================================== - -def _grp(): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.groupresourceprofile import ( # noqa: E501 - group_resource_profile_pb2, - ) - return group_resource_profile_pb2 - - -def _make_slurm_pref(**kwargs): - g = _grp() - slurm = g.SlurmComputeResourcePreference( - allocation_project_number="alloc-1", - preferred_batch_queue="normal", - ssh_account_provisioner="prov", - group_ssh_account_provisioner_configs=[ - g.GroupAccountSSHProvisionerConfig( - resource_id="r1", config_name="cn", config_value="cv")], - reservations=[ - g.ComputeResourceReservation( - reservation_id="rid", queue_names=["q1"], - start_time=1705320000000, end_time=0)], - ) - base = dict( - compute_resource_id="cr-slurm", - override_by_airavata=True, - preferred_job_submission_protocol=2, # proto SSH -> Thrift 1 - preferred_data_movement_protocol=3, # proto SFTP -> Thrift 2 - resource_type=g.ResourceType.SLURM, - specific_preferences=g.EnvironmentSpecificPreferences(slurm=slurm), - ) - base.update(kwargs) - return g.GroupComputeResourcePreference(**base) - - -def _make_aws_pref(**kwargs): - g = _grp() - base = dict( - compute_resource_id="cr-aws", - group_resource_profile_id="grp-1", - resource_type=g.ResourceType.AWS, - specific_preferences=g.EnvironmentSpecificPreferences( - aws=g.AwsComputeResourcePreference( - region="us-east-1", preferred_ami_id="ami-1", - preferred_instance_type="t2.micro")), - ) - base.update(kwargs) - return g.GroupComputeResourcePreference(**base) - - -def _make_group_profile(**kwargs): - g = _grp() - base = dict( - gateway_id="default", - group_resource_profile_id="grp-1", - group_resource_profile_name="Test GRP", - compute_preferences=[_make_slurm_pref(), _make_aws_pref()], - compute_resource_policies=[ - g.ComputeResourcePolicy( - resource_policy_id="rp-1", compute_resource_id="cr-slurm", - allowed_batch_queues=["normal", "long"])], - batch_queue_resource_policies=[ - g.BatchQueueResourcePolicy( - resource_policy_id="bq-1", compute_resource_id="cr-slurm", - queuename="normal", max_allowed_nodes=10, - max_allowed_cores=100, max_allowed_walltime=60)], - creation_time=1705320000000, - updated_time=1705323600000, - default_credential_store_token="def-tok", - ) - base.update(kwargs) - return g.GroupResourceProfile(**base) - - -class TestBuildGroupResourceProfile: - def test_forces_gateway_id_and_builds_tree(self): - client = _FakeGroupClient(_make_group_profile()) - proto = build_group_resource_profile(client, { - "gateway_id": "ignored", - "group_resource_profile_name": "New", - "compute_preferences": [{ - "compute_resource_id": "cr-1", - "overrideby_airavata": True, - "resource_type": 0, # Thrift SLURM - "allocation_project_number": "ap", - "specific_preferences": {"slurm": { - "preferred_batch_queue": "q"}}, - }], - "compute_resource_policies": [{ - "resource_policy_id": "rp", "allowed_batch_queues": ["a"]}], - "batch_queue_resource_policies": [{ - "resource_policy_id": "bq", "queuename": "q", - "max_allowed_nodes": 5}], - "default_credential_store_token": "t", - }) - assert proto.gateway_id == "default" # forced from client - assert proto.group_resource_profile_name == "New" - cp = proto.compute_preferences[0] - assert cp.override_by_airavata is True - assert cp.resource_type == _grp().ResourceType.SLURM # Thrift 0 -> proto - assert cp.specific_preferences.WhichOneof("preferences") == "slurm" - assert cp.specific_preferences.slurm.preferred_batch_queue == "q" - # flattened allocation_project_number folded into the slurm member - assert (cp.specific_preferences.slurm.allocation_project_number - == "ap") - assert proto.compute_resource_policies[0].resource_policy_id == "rp" - assert proto.batch_queue_resource_policies[0].max_allowed_nodes == 5 - - -# --------------------------------------------------------------------------- -# GroupResourceProfile orchestration (fake-client) -# --------------------------------------------------------------------------- - -class _FakeGroupCompute: - def __init__(self, profile): - self._profile = profile - self.created = None - self.updated = None - self.removed_prefs = [] - self.removed_compute_policies = [] - self.removed_bq_policies = [] - self.removed_profile = None - - def get_group_resource_list(self): - return [self._profile] - - def get_group_resource_profile(self, grp_id): - return self._profile - - def create_group_resource_profile(self, profile): - self.created = profile - # server assigns id + creation_time - profile.group_resource_profile_id = "grp-new" - profile.creation_time = 1705320000000 - return profile - - def update_group_resource_profile(self, grp_id, profile): - self.updated = (grp_id, profile) - - def remove_group_compute_prefs(self, grp_id, compute_resource_id): - self.removed_prefs.append((grp_id, compute_resource_id)) - - def remove_group_compute_resource_policy(self, policy_id): - self.removed_compute_policies.append(policy_id) - - def remove_group_batch_queue_resource_policy(self, policy_id): - self.removed_bq_policies.append(policy_id) - - def remove_group_resource_profile(self, grp_id): - self.removed_profile = grp_id - - -class _FakeGroupClient: - def __init__(self, profile, gateway_id="default", username="alice"): - self.compute = _FakeGroupCompute(profile) - self.gateway_id = gateway_id - self.username = username - - -class TestGroupResourceProfileOrchestration: - def test_list_returns_withaccess_carrying_the_proto(self): - profile = _make_group_profile() - client = _FakeGroupClient(profile) - out = list_group_resource_profiles( - client, has_write_by_id={"grp-1": True}) - assert len(out) == 1 - assert isinstance(out[0], WithAccess) - # the proto flows through wholesale — no field copied out. - assert out[0].message is profile - assert out[0].is_owner is False - assert out[0].user_has_write_access is True - - def test_list_default_false(self): - client = _FakeGroupClient(_make_group_profile()) - out = list_group_resource_profiles(client) - assert out[0].user_has_write_access is False - - def test_get_returns_withaccess_carrying_the_proto(self): - profile = _make_group_profile() - client = _FakeGroupClient(profile) - r = get_group_resource_profile(client, "grp-1", has_write=False) - assert isinstance(r, WithAccess) - assert r.message is profile - assert r.message.group_resource_profile_id == "grp-1" - assert r.is_owner is False - assert r.user_has_write_access is False - - def test_get_forwards_has_write_true(self): - client = _FakeGroupClient(_make_group_profile()) - r = get_group_resource_profile(client, "grp-1", has_write=True) - assert r.user_has_write_access is True - - def test_create_persists_and_wraps(self): - client = _FakeGroupClient(_make_group_profile()) - r = create_group_resource_profile( - client, {"group_resource_profile_name": "New"}) - assert client.compute.created is not None - assert client.compute.created.gateway_id == "default" - assert isinstance(r, WithAccess) - # the server-assigned id is on the wrapped proto. - assert r.message.group_resource_profile_id == "grp-new" - assert r.is_owner is False - # newly created profile is owned by the caller -> has_write defaults True - assert r.user_has_write_access is True - - def test_update_removes_orphans(self): - # original has cr-slurm + cr-aws prefs, rp-1 + bq-1 policies - original = _make_group_profile() - client = _FakeGroupClient(original) - # new payload keeps only cr-slurm; drops cr-aws, rp-1, bq-1 - update_group_resource_profile(client, "grp-1", { - "group_resource_profile_name": "Test GRP", - "compute_preferences": [{ - "compute_resource_id": "cr-slurm", "resource_type": 0}], - "compute_resource_policies": [], - "batch_queue_resource_policies": [], - }) - # cr-aws pref removed - assert ("grp-1", "cr-aws") in client.compute.removed_prefs - assert ("grp-1", "cr-slurm") not in client.compute.removed_prefs - assert "rp-1" in client.compute.removed_compute_policies - assert "bq-1" in client.compute.removed_bq_policies - assert client.compute.updated[0] == "grp-1" - - def test_delete(self): - client = _FakeGroupClient(_make_group_profile()) - delete_group_resource_profile(client, "grp-1") - assert client.compute.removed_profile == "grp-1" - - -# =========================================================================== -# Per-protocol job submission (Local / SSH / Unicore / Cloud) -# =========================================================================== -# -# Proto-direct: each ``get_{local,ssh,unicore,cloud}_job_submission`` returns the -# bare facade proto VERBATIM (no envelope, no dict transform). These resources -# carry no cross-service fields, so there is nothing to union in. The portal's -# ``to_jsonable`` serializes the proto to snake_case JSON (enums as member NAMES); -# that serialization is exercised by the portal contract snapshot, not here. - -def _sec_proto(name): - return _dm_pb2().SecurityProtocol.Value(name) - - -class _FakeJobSubCompute: - def __init__(self, local=None, ssh=None, unicore=None, cloud=None): - self._local = local - self._ssh = ssh - self._unicore = unicore - self._cloud = cloud - self.calls = [] - - def get_local_job_submission(self, sid): - self.calls.append(("local", sid)) - return self._local - - def get_ssh_job_submission(self, sid): - self.calls.append(("ssh", sid)) - return self._ssh - - def get_unicore_job_submission(self, sid): - self.calls.append(("unicore", sid)) - return self._unicore - - def get_cloud_job_submission(self, sid): - self.calls.append(("cloud", sid)) - return self._cloud - - -class _FakeJobSubClient: - def __init__(self, **kwargs): - self.compute = _FakeJobSubCompute(**kwargs) - - -class TestJobSubmissionOrchestration: - """Each helper returns the facade proto VERBATIM (identity), no transform.""" - - def test_get_local_returns_proto_verbatim(self): - c = _cr_pb2() - proto = c.LOCALSubmission( - job_submission_interface_id="ls-1", - security_protocol=_sec_proto("LOCAL")) - client = _FakeJobSubClient(local=proto) - result = get_local_job_submission(client, "ls-1") - assert result is proto - assert client.compute.calls == [("local", "ls-1")] - - def test_get_ssh_returns_proto_verbatim(self): - c = _cr_pb2() - proto = c.SSHJobSubmission( - job_submission_interface_id="ssh-1", - security_protocol=_sec_proto("SSH_KEYS"), - monitor_mode=c.MonitorMode.MONITOR_FORK) - client = _FakeJobSubClient(ssh=proto) - result = get_ssh_job_submission(client, "ssh-1") - assert result is proto - assert client.compute.calls == [("ssh", "ssh-1")] - - def test_get_unicore_returns_proto_verbatim(self): - c = _cr_pb2() - proto = c.UnicoreJobSubmission( - job_submission_interface_id="u-1", - security_protocol=_sec_proto("GSI"), - unicore_end_point_url="https://u") - client = _FakeJobSubClient(unicore=proto) - result = get_unicore_job_submission(client, "u-1") - assert result is proto - assert client.compute.calls == [("unicore", "u-1")] - - def test_get_cloud_returns_proto_verbatim(self): - c = _cr_pb2() - proto = c.CloudJobSubmission( - job_submission_interface_id="cl-1", - security_protocol=_sec_proto("OAUTH"), - provider_name=c.ProviderName.AWSEC2) - client = _FakeJobSubClient(cloud=proto) - result = get_cloud_job_submission(client, "cl-1") - assert result is proto - assert client.compute.calls == [("cloud", "cl-1")] - - -# --------------------------------------------------------------------------- -# Workspace defaults (edge-workspace-prefs) -# --------------------------------------------------------------------------- - -from types import SimpleNamespace # noqa: E402 - -from airavata_sdk.helpers.compute_resources import ( # noqa: E402 - accessible_group_resource_profile_ids, - most_recent_writeable_project_id, - resolve_workspace_defaults, - user_can_write, -) - - -class _FakeResearch: - def __init__(self, projects): - self._projects = projects - self.user_projects_calls = [] - - def get_user_projects(self, gateway_id, user_name, limit=-1, offset=0): - self.user_projects_calls.append((gateway_id, user_name, limit, offset)) - return self._projects - - -class _FakeComputeGrp: - def __init__(self, grp_ids): - self._grp_ids = grp_ids - self.group_resource_list_calls = 0 - - def get_group_resource_list(self): - self.group_resource_list_calls += 1 - return [ - SimpleNamespace(group_resource_profile_id=i) for i in self._grp_ids - ] - - -class _FakeSharing: - def __init__(self, writeable_ids): - self._writeable = set(writeable_ids) - self.calls = [] - - def user_has_access(self, resource_id, user_id, permission_type): - self.calls.append((resource_id, user_id, permission_type)) - return resource_id in self._writeable - - -class _FakeWorkspaceClient: - def __init__(self, *, project_ids=(), writeable_ids=(), grp_ids=(), - gateway_id="default", username="alice"): - self.research = _FakeResearch( - [SimpleNamespace(project_id=p) for p in project_ids]) - self.compute = _FakeComputeGrp(list(grp_ids)) - self.sharing = _FakeSharing(writeable_ids) - self.gateway_id = gateway_id - self.username = username - - -class TestWorkspaceDefaults: - def test_user_can_write_true(self): - client = _FakeWorkspaceClient(writeable_ids=["proj-1"]) - assert user_can_write(client, "proj-1") is True - assert client.sharing.calls == [("proj-1", "alice", "WRITE")] - - def test_user_can_write_false(self): - client = _FakeWorkspaceClient(writeable_ids=["proj-1"]) - assert user_can_write(client, "proj-2") is False - - def test_most_recent_writeable_project_picks_first_writeable(self): - # proj-1 not writeable, proj-2 writeable -> returns proj-2. - client = _FakeWorkspaceClient( - project_ids=["proj-1", "proj-2", "proj-3"], - writeable_ids=["proj-2", "proj-3"]) - assert most_recent_writeable_project_id(client) == "proj-2" - # gateway / user come from the client context. - assert client.research.user_projects_calls == [ - ("default", "alice", -1, 0)] - - def test_most_recent_writeable_project_none_when_no_writeable(self): - client = _FakeWorkspaceClient( - project_ids=["proj-1"], writeable_ids=[]) - assert most_recent_writeable_project_id(client) is None - - def test_most_recent_writeable_project_none_when_no_projects(self): - client = _FakeWorkspaceClient(project_ids=[], writeable_ids=[]) - assert most_recent_writeable_project_id(client) is None - - def test_accessible_grp_ids(self): - client = _FakeWorkspaceClient(grp_ids=["grp-1", "grp-2"]) - assert accessible_group_resource_profile_ids(client) == [ - "grp-1", "grp-2"] - - def test_accessible_grp_ids_empty(self): - client = _FakeWorkspaceClient(grp_ids=[]) - assert accessible_group_resource_profile_ids(client) == [] - - def test_resolve_defaults_full(self): - client = _FakeWorkspaceClient( - project_ids=["proj-1", "proj-2"], - writeable_ids=["proj-2"], - grp_ids=["grp-1", "grp-2"]) - defaults = resolve_workspace_defaults(client) - assert defaults == { - "most_recent_project_id": "proj-2", - "group_resource_profile_ids": ["grp-1", "grp-2"], - "most_recent_group_resource_profile_id": "grp-1", - } - - def test_resolve_defaults_empty(self): - client = _FakeWorkspaceClient( - project_ids=[], writeable_ids=[], grp_ids=[]) - defaults = resolve_workspace_defaults(client) - assert defaults == { - "most_recent_project_id": None, - "group_resource_profile_ids": [], - "most_recent_group_resource_profile_id": None, - } diff --git a/airavata-python-sdk/tests/helpers/test_credential_resources.py b/airavata-python-sdk/tests/helpers/test_credential_resources.py deleted file mode 100644 index 89880968122..00000000000 --- a/airavata-python-sdk/tests/helpers/test_credential_resources.py +++ /dev/null @@ -1,238 +0,0 @@ -"""Unit tests for airavata_sdk.helpers.credential_resources (proto-direct). - -The credential helpers return OBJECTS, not dicts: a -:class:`airavata_sdk.helpers._envelope.WithAccess` wrapping the raw -``credential_store_pb2.CredentialSummary`` proto plus the caller's access -flags. ``is_owner`` is always ``False`` (a credential has no owner); -``user_has_write_access`` is the CHAINED ``sharing.user_has_access`` WRITE -lookup keyed on the credential ``token``. - -These tests assert: - -* the return is a ``WithAccess`` whose ``.message`` is the raw proto (no field - copied out, ``type`` left as the proto enum, not a string); -* ``is_owner`` is ``False`` and ``user_has_write_access`` reflects the chained - sharing call; -* the chained ``sharing.user_has_access`` call is keyed on the ``token`` with - ``permission_type="WRITE"``; -* the create/delete orchestration still drives the raw facade correctly. - -Snake_case JSON rendering (enum NAMES, ``persisted_time`` epoch-millis string) -is the portal renderer's responsibility and is pinned by the portal contract -snapshot test, not here. -""" - -from airavata_sdk.generated.org.apache.airavata.model.credential.store import ( - credential_store_pb2 as pb2, -) -from airavata_sdk.helpers._envelope import WithAccess -from airavata_sdk.helpers.credential_resources import ( - create_password_credential, - create_ssh_credential, - delete_credential_summary, - get_all_credential_summaries, - get_credential_summary, -) - - -# --------------------------------------------------------------------------- -# Helpers / stubs -# --------------------------------------------------------------------------- - -def _make_summary(**kwargs): - return pb2.CredentialSummary(**kwargs) - - -class _FakeCredential: - def __init__(self, summary): - self._summary = summary - self.generated = None - self.registered = None - self.deleted_ssh = None - self.deleted_pwd = None - self.list_calls = [] - - def get_credential_summary(self, token_id, gateway_id): - return self._summary - - def get_all_credential_summaries(self, gateway_id, type): - self.list_calls.append((gateway_id, type)) - return [self._summary] - - def generate_and_register_ssh_keys(self, gateway_id, username, description): - self.generated = (gateway_id, username, description) - return "new-ssh-token" - - def register_pwd_credential(self, gateway_id, password_credential): - self.registered = (gateway_id, password_credential) - return "new-pwd-token" - - def delete_ssh_pub_key(self, token, gateway_id): - self.deleted_ssh = (token, gateway_id) - - def delete_pwd_credential(self, token, gateway_id): - self.deleted_pwd = (token, gateway_id) - - -class _FakeSharing: - def __init__(self, has_access=True): - self._has_access = has_access - self.calls = [] - - def user_has_access(self, resource_id, user_id, permission_type): - self.calls.append((resource_id, user_id, permission_type)) - return self._has_access - - -class _FakeClient: - def __init__(self, summary, gateway_id="gw1", username="alice", - sharing_has_access=True): - self.credential = _FakeCredential(summary) - self.sharing = _FakeSharing(sharing_has_access) - self.gateway_id = gateway_id - self.username = username - - -def _summary(type=pb2.SummaryType.SSH, token="tok-1"): - return _make_summary( - type=type, gateway_id="gw1", username="alice", - persisted_time=1705320000000, token=token, description="d") - - -# --------------------------------------------------------------------------- -# get_credential_summary — WithAccess[CredentialSummary] -# --------------------------------------------------------------------------- - -class TestGetCredentialSummary: - def test_returns_with_access(self): - client = _FakeClient(_summary()) - result = get_credential_summary(client, "tok-1") - assert isinstance(result, WithAccess) - - def test_message_is_the_raw_proto(self): - summary = _summary(token="tok-1") - client = _FakeClient(summary) - result = get_credential_summary(client, "tok-1") - assert result.message is summary - # The proto flows through wholesale — type stays the proto enum, not a - # rendered string. - assert result.message.type == pb2.SummaryType.SSH - assert result.message.token == "tok-1" - - def test_is_owner_always_false(self): - client = _FakeClient(_summary()) - result = get_credential_summary(client, "tok-1") - assert result.is_owner is False - - def test_has_write_keyed_on_token(self): - client = _FakeClient(_summary(token="tok-xyz")) - get_credential_summary(client, "tok-xyz") - assert client.sharing.calls == [("tok-xyz", "alice", "WRITE")] - - def test_user_has_write_access_true(self): - client = _FakeClient(_summary(), sharing_has_access=True) - result = get_credential_summary(client, "tok-1") - assert result.user_has_write_access is True - - def test_user_has_write_access_false(self): - client = _FakeClient(_summary(), sharing_has_access=False) - result = get_credential_summary(client, "tok-1") - assert result.user_has_write_access is False - - -# --------------------------------------------------------------------------- -# get_all_credential_summaries — list[WithAccess] -# --------------------------------------------------------------------------- - -class TestGetAllCredentialSummaries: - def test_concatenates_ssh_and_passwd_when_no_type(self): - client = _FakeClient(_summary()) - get_all_credential_summaries(client) - types = [t for (_, t) in client.credential.list_calls] - assert pb2.SummaryType.SSH in types - assert pb2.SummaryType.PASSWD in types - - def test_single_type_when_specified(self): - client = _FakeClient(_summary()) - get_all_credential_summaries( - client, summary_type=pb2.SummaryType.SSH) - assert client.credential.list_calls == [("gw1", pb2.SummaryType.SSH)] - - def test_returns_list_of_with_access(self): - client = _FakeClient(_summary()) - result = get_all_credential_summaries( - client, summary_type=pb2.SummaryType.SSH) - assert isinstance(result, list) - assert isinstance(result[0], WithAccess) - assert result[0].message.token == "tok-1" - assert result[0].message.type == pb2.SummaryType.SSH - assert result[0].is_owner is False - - def test_per_summary_write_lookup_keyed_on_token(self): - client = _FakeClient(_summary(token="tok-keyed")) - get_all_credential_summaries( - client, summary_type=pb2.SummaryType.SSH) - assert client.sharing.calls == [("tok-keyed", "alice", "WRITE")] - - def test_user_has_write_access_reflects_sharing(self): - client = _FakeClient(_summary(), sharing_has_access=False) - result = get_all_credential_summaries( - client, summary_type=pb2.SummaryType.SSH) - assert result[0].user_has_write_access is False - - -class TestCreateSshCredential: - def test_generates_with_context_and_description(self): - client = _FakeClient(_summary(token="new-ssh-token")) - create_ssh_credential(client, {"description": "key desc"}) - assert client.credential.generated == ("gw1", "alice", "key desc") - - def test_returns_with_access_for_new_token(self): - client = _FakeClient(_summary(token="new-ssh-token")) - result = create_ssh_credential(client, {"description": "key desc"}) - assert isinstance(result, WithAccess) - assert result.message.token == "new-ssh-token" - assert result.is_owner is False - - -class TestCreatePasswordCredential: - def test_builds_password_credential_proto(self): - client = _FakeClient(_summary(type=pb2.SummaryType.PASSWD, - token="new-pwd-token")) - create_password_credential(client, { - "username": "loginuser", - "password": "secret", - "description": "pw desc", - }) - gw, pc = client.credential.registered - assert gw == "gw1" - assert pc.gateway_id == "gw1" - assert pc.portal_user_name == "alice" - assert pc.login_user_name == "loginuser" - assert pc.password == "secret" - assert pc.description == "pw desc" - - def test_returns_with_access_for_new_token(self): - client = _FakeClient(_summary(type=pb2.SummaryType.PASSWD, - token="new-pwd-token")) - result = create_password_credential(client, { - "username": "u", "password": "p", "description": "d"}) - assert isinstance(result, WithAccess) - assert result.message.token == "new-pwd-token" - assert result.message.type == pb2.SummaryType.PASSWD - - -class TestDeleteCredentialSummary: - def test_ssh_dispatches_to_delete_ssh_pub_key(self): - summary = _summary(type=pb2.SummaryType.SSH, token="ssh-tok") - client = _FakeClient(summary) - delete_credential_summary(client, summary) - assert client.credential.deleted_ssh == ("ssh-tok", "gw1") - assert client.credential.deleted_pwd is None - - def test_passwd_dispatches_to_delete_pwd_credential(self): - summary = _summary(type=pb2.SummaryType.PASSWD, token="pwd-tok") - client = _FakeClient(summary) - delete_credential_summary(client, summary) - assert client.credential.deleted_pwd == ("pwd-tok", "gw1") - assert client.credential.deleted_ssh is None diff --git a/airavata-python-sdk/tests/helpers/test_iam_resources.py b/airavata-python-sdk/tests/helpers/test_iam_resources.py deleted file mode 100644 index 88337d7f1dc..00000000000 --- a/airavata-python-sdk/tests/helpers/test_iam_resources.py +++ /dev/null @@ -1,309 +0,0 @@ -"""Unit tests for airavata_sdk.helpers.iam_resources. - -The user-profiles family is **proto-direct**: ``get_user_profile`` returns the -raw ``UserProfile`` proto and ``get_all_user_profiles_in_gateway`` returns a -``list[UserProfile]`` — the family computes nothing cross-service, so there is -no dict transform and no envelope. The tests assert the protos flow through -the raw facade unchanged (identity, not value re-mapping). - -The IAM-user family is **proto-direct (composed)**: ``get_iam_user`` returns a -pydantic ``IAMUser`` and ``get_unverified_email_user`` an ``UnverifiedEmailUser`` -— the proto-derived scalars unioned with the cross-service / request-scoped / -ORM parts the ViewSet supplies. ``list_iam_users`` is a raw pass-through of the -IAM-admin ``UserProfile`` protos. - -Orchestration functions are tested via lightweight stub clients that record the -calls made. -""" - -from airavata_sdk.generated.org.apache.airavata.model.user import ( - user_profile_pb2 as pb2, -) -from airavata_sdk.helpers.iam_resources import ( - IAMUser, - UnverifiedEmailUser, - get_all_user_profiles_in_gateway, - get_iam_user, - get_unverified_email_user, - get_user_profile, - list_iam_users, -) - - -# --------------------------------------------------------------------------- -# Representative proto -# --------------------------------------------------------------------------- - -def _full_profile(): - return pb2.UserProfile( - user_model_version="1.0", - airavata_internal_user_id="internal-1", - user_id="alice@gw", - gateway_id="default", - emails=["a@x.com", "b@x.com"], - first_name="Alice", - last_name="Liddell", - middle_name="M", - name_prefix="Dr", - name_suffix="Jr", - orcid_id="0000-0001", - phones=["555-1234"], - country="US", - nationality=["American"], - home_organization="GT", - origination_affiliation="ARTISAN", - creation_time=1705320000000, - last_access_time=1705320005000, - valid_until=1705320009000, - state=pb2.Status.ACTIVE, - comments="hello", - labeled_uri=["http://a", "http://b"], - gpg_key="gpg123", - time_zone="UTC", - ) - - -# --------------------------------------------------------------------------- -# Orchestration functions — stub client (proto-direct returns) -# --------------------------------------------------------------------------- - -class _FakeIam: - def __init__(self, profile, profiles=None): - self._profile = profile - self._profiles = profiles if profiles is not None else [profile] - self.by_id_calls = [] - self.list_calls = [] - - def get_user_profile_by_id(self, user_id, gateway_id): - self.by_id_calls.append((user_id, gateway_id)) - return self._profile - - def get_all_user_profiles_in_gateway(self, gateway_id, offset, limit): - self.list_calls.append((gateway_id, offset, limit)) - return self._profiles - - -class _FakeClient: - def __init__(self, profile, profiles=None, gateway_id="gw1", - username="alice"): - self.iam = _FakeIam(profile, profiles) - self.gateway_id = gateway_id - self.username = username - - -class TestGetUserProfile: - def test_returns_the_raw_proto(self): - """Proto-direct: the facade's ``UserProfile`` flows through unchanged - (no transform, no envelope) — the same object identity is returned.""" - profile = _full_profile() - client = _FakeClient(profile) - result = get_user_profile(client, "alice@gw") - assert result is profile - assert isinstance(result, pb2.UserProfile) - # Proto fields are preserved verbatim; no '' -> None remapping, no - # field renames, the enum stays the proto enum value. - assert result.user_id == "alice@gw" - assert result.state == pb2.Status.ACTIVE - assert result.origination_affiliation == "ARTISAN" - - def test_lookup_uses_client_gateway(self): - client = _FakeClient(_full_profile()) - get_user_profile(client, "alice@gw") - assert client.iam.by_id_calls == [("alice@gw", "gw1")] - - -class TestGetAllUserProfilesInGateway: - def test_returns_list_of_protos(self): - p1 = _full_profile() - p2 = pb2.UserProfile(user_id="bob@gw") - client = _FakeClient(p1, profiles=[p1, p2]) - result = get_all_user_profiles_in_gateway(client) - assert all(isinstance(u, pb2.UserProfile) for u in result) - assert [u.user_id for u in result] == ["alice@gw", "bob@gw"] - # The protos themselves flow through (identity), only re-listed. - assert result[0] is p1 - assert result[1] is p2 - - def test_default_offset_and_limit(self): - client = _FakeClient(_full_profile()) - get_all_user_profiles_in_gateway(client) - assert client.iam.list_calls == [("gw1", 0, -1)] - - def test_custom_offset_and_limit(self): - client = _FakeClient(_full_profile()) - get_all_user_profiles_in_gateway(client, offset=5, limit=10) - assert client.iam.list_calls == [("gw1", 5, 10)] - - -# =========================================================================== -# IAM-user family (composed pydantic: IAMUser / UnverifiedEmailUser) -# =========================================================================== - -def _iam_profile(state=pb2.Status.ACTIVE, **overrides): - base = dict( - airavata_internal_user_id="alice@gw_internal", - user_id="alice@gw", - gateway_id="default", - emails=["alice@x.com", "alt@x.com"], - first_name="Alice", - last_name="Liddell", - creation_time=1705320000000, - state=state, - ) - base.update(overrides) - return pb2.UserProfile(**base) - - -class _FakeIamUsers: - def __init__(self, users): - self._users = users - self.list_calls = [] - - def get_iam_users(self, offset, limit, search): - self.list_calls.append((offset, limit, search)) - return list(self._users) - - -class _FakeIamUserClient: - def __init__(self, users, gateway_id="gw1", username="alice"): - self.iam = _FakeIamUsers(users) - self.gateway_id = gateway_id - self.username = username - - -def _call_get_iam_user(profile, **overrides): - kwargs = dict( - airavata_user_profile_exists=True, - user_has_write_access=True, - groups=[{"id": "g1", "name": "Group One"}], - external_idp_user_info={"idp_alias": "cilogon"}, - user_profile_invalid_fields=["phone"], - ) - kwargs.update(overrides) - return get_iam_user(_FakeIamUserClient([]), profile, **kwargs) - - -class TestGetIamUser: - - def test_returns_iam_user_model(self): - u = _call_get_iam_user(_iam_profile()) - assert isinstance(u, IAMUser) - - def test_scalar_and_derived_fields(self): - u = _call_get_iam_user(_iam_profile()) - assert u.airavata_internal_user_id == "alice@gw_internal" - assert u.user_id == "alice@gw" - assert u.gateway_id == "default" - # email is the FIRST element of the repeated emails field - assert u.email == "alice@x.com" - assert u.first_name == "Alice" - assert u.last_name == "Liddell" - assert u.airavata_user_profile_exists is True - - def test_composed_fields_passed_through(self): - u = _call_get_iam_user(_iam_profile()) - assert u.user_has_write_access is True - assert u.groups == [{"id": "g1", "name": "Group One"}] - assert u.external_idp_user_info == {"idp_alias": "cilogon"} - assert u.user_profile_invalid_fields == ["phone"] - - def test_composed_fields_default_empty(self): - u = get_iam_user( - _FakeIamUserClient([]), _iam_profile(), - airavata_user_profile_exists=False, - user_has_write_access=False) - assert u.groups == [] - assert u.external_idp_user_info == {} - assert u.user_profile_invalid_fields == [] - - def test_enabled_and_email_verified_active(self): - u = _call_get_iam_user(_iam_profile(state=pb2.Status.ACTIVE)) - assert u.enabled is True - assert u.email_verified is True - - def test_email_verified_confirmed_but_not_enabled(self): - u = _call_get_iam_user(_iam_profile(state=pb2.Status.CONFIRMED)) - assert u.enabled is False - assert u.email_verified is True - - def test_neither_enabled_nor_verified_for_other_state(self): - u = _call_get_iam_user(_iam_profile(state=pb2.Status.PENDING)) - assert u.enabled is False - assert u.email_verified is False - - def test_creation_time_is_epoch_millis_string(self): - u = _call_get_iam_user(_iam_profile()) - assert u.creation_time == "1705320000000" - - def test_creation_time_zero_is_string_zero(self): - """proto-direct int64 contract: 0 -> "0", never None / never epoch ISO.""" - u = _call_get_iam_user(_iam_profile(creation_time=0)) - assert u.creation_time == "0" - - def test_no_emails_renders_empty_email(self): - prof = pb2.UserProfile(user_id="bob@gw", state=pb2.Status.ACTIVE) - u = _call_get_iam_user(prof) - assert u.email == "" - - def test_no_url_field(self): - """The hyperlink is dropped; the frontend builds it from user_id.""" - u = _call_get_iam_user(_iam_profile()) - assert not hasattr(u, "url") - - def test_expected_field_set(self): - u = _call_get_iam_user(_iam_profile()) - assert set(u.model_dump().keys()) == { - "airavata_internal_user_id", "user_id", "gateway_id", "email", - "first_name", "last_name", "enabled", "email_verified", - "creation_time", "airavata_user_profile_exists", - "user_has_write_access", "groups", "external_idp_user_info", - "user_profile_invalid_fields", - } - - -class TestGetUnverifiedEmailUser: - - def test_returns_unverified_model(self): - u = get_unverified_email_user( - _FakeIamUserClient([]), _iam_profile(state=pb2.Status.CONFIRMED), - user_has_write_access=False) - assert isinstance(u, UnverifiedEmailUser) - - def test_subset_field_set(self): - u = get_unverified_email_user( - _FakeIamUserClient([]), _iam_profile(state=pb2.Status.CONFIRMED), - user_has_write_access=True) - assert set(u.model_dump().keys()) == { - "user_id", "gateway_id", "email", "first_name", "last_name", - "enabled", "email_verified", "creation_time", - "user_has_write_access", - } - - def test_derived_flags(self): - u = get_unverified_email_user( - _FakeIamUserClient([]), _iam_profile(state=pb2.Status.CONFIRMED), - user_has_write_access=False) - assert u.enabled is False - assert u.email_verified is True - assert u.email == "alice@x.com" - assert u.user_has_write_access is False - - def test_creation_time_is_epoch_millis_string(self): - u = get_unverified_email_user( - _FakeIamUserClient([]), _iam_profile(), - user_has_write_access=False) - assert u.creation_time == "1705320000000" - - -class TestListIamUsers: - def test_passes_through_protos(self): - p = _iam_profile() - client = _FakeIamUserClient([p]) - result = list_iam_users(client, offset=2, limit=5, search="ali") - assert result == [p] - assert client.iam.list_calls == [(2, 5, "ali")] - - def test_defaults(self): - client = _FakeIamUserClient([]) - list_iam_users(client) - assert client.iam.list_calls == [(0, -1, "")] diff --git a/airavata-python-sdk/tests/helpers/test_research_resources.py b/airavata-python-sdk/tests/helpers/test_research_resources.py deleted file mode 100644 index b1fb0b9bb89..00000000000 --- a/airavata-python-sdk/tests/helpers/test_research_resources.py +++ /dev/null @@ -1,2357 +0,0 @@ -"""Unit tests for airavata_sdk.helpers.research_resources. - -PROJECT FAMILY (proto-direct reference) ---------------------------------------- -The project family follows the proto-direct architecture: the helpers return -the raw ``workspace_pb2.Project`` proto unioned with the caller's sharing-access -flags in a :class:`~airavata_sdk.helpers._envelope.WithAccess` container. The -tests below assert that ``get_project`` / ``list_projects`` / ``create_project`` -/ ``update_project`` return a ``WithAccess`` carrying the proto message plus the -two bools (``is_owner`` / ``user_has_write_access``), and that the chained -``sharing.user_has_access`` call is made with the right arguments. There is no -dict transform to test — the portal's generic renderer flattens the proto. - -Other families still use the legacy dict path and are tested via a lightweight -stub client that records the calls made. -""" - -from airavata_sdk.helpers._envelope import WithAccess -from airavata_sdk.helpers.research_resources import ( - create_application_module, - create_notification, - create_project, - delete_notification, - get_application_module, - get_experiment_statistics, - get_notification, - get_project, - list_application_modules, - list_notifications, - list_projects, - search_experiments, - update_application_module, - update_notification, - update_project, -) - - -# --------------------------------------------------------------------------- -# Helpers -# --------------------------------------------------------------------------- - -def _make_project(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.workspace import workspace_pb2 - return workspace_pb2.Project(**kwargs) - - -# --------------------------------------------------------------------------- -# Project family — proto-direct + WithAccess (stub client) -# --------------------------------------------------------------------------- - -class _FakeResearch: - def __init__(self, project): - self._project = project - self.created_project = None - self.updated_project = None - self.created_gateway_id = None - - def get_project(self, project_id): - return self._project - - def get_user_projects(self, gateway_id, user_name, limit=-1, offset=0): - return [self._project] - - def create_project(self, gateway_id, project): - self.created_project = project - self.created_gateway_id = gateway_id - return "new-proj-id" - - def update_project(self, project_id, project): - self.updated_project = project - - -class _FakeSharing: - def __init__(self, has_access=True): - self._has_access = has_access - self.calls = [] - - def user_has_access(self, resource_id, user_id, permission_type): - self.calls.append((resource_id, user_id, permission_type)) - return self._has_access - - -class _FakeClient: - def __init__(self, project, gateway_id="gw1", username="alice", - sharing_has_access=True): - self.research = _FakeResearch(project) - self.sharing = _FakeSharing(sharing_has_access) - self.gateway_id = gateway_id - self.username = username - - -class TestGetProject: - """``get_project`` returns ``WithAccess[Project]`` — the raw proto plus the - two sharing-access bools. No dict transform; the proto flows through.""" - - def _project(self): - return _make_project( - project_id="proj-1", owner="alice", gateway_id="gw1", - name="Test", creation_time=1705320000000, - ) - - def test_returns_with_access_container(self): - client = _FakeClient(self._project()) - result = get_project(client, "proj-1") - assert isinstance(result, WithAccess) - - def test_message_is_the_proto(self): - p = self._project() - client = _FakeClient(p) - result = get_project(client, "proj-1") - # The exact proto object flows through wholesale — not copied. - assert result.message is p - assert result.message.project_id == "proj-1" - assert result.message.owner == "alice" - - def test_is_owner_true_when_username_matches(self): - client = _FakeClient(self._project(), username="alice") - result = get_project(client, "proj-1") - assert result.is_owner is True - - def test_is_owner_false_when_username_differs(self): - client = _FakeClient(self._project(), username="bob") - result = get_project(client, "proj-1") - assert result.is_owner is False - - def test_user_has_write_access_forwarded_from_sharing(self): - client = _FakeClient(self._project(), sharing_has_access=False) - result = get_project(client, "proj-1") - assert result.user_has_write_access is False - - def test_user_has_write_access_true_from_sharing(self): - client = _FakeClient(self._project(), sharing_has_access=True) - result = get_project(client, "proj-1") - assert result.user_has_write_access is True - - def test_sharing_called_with_correct_args(self): - client = _FakeClient(self._project(), username="alice") - get_project(client, "proj-1") - assert len(client.sharing.calls) == 1 - resource_id, user_id, perm = client.sharing.calls[0] - assert resource_id == "proj-1" - assert user_id == "alice" - assert perm == "WRITE" - - -class TestListProjects: - def _project(self): - return _make_project( - project_id="proj-2", owner="alice", gateway_id="gw1", - name="Listed Project", creation_time=1705320000000, - ) - - def test_returns_list_of_with_access(self): - client = _FakeClient(self._project()) - results = list_projects(client) - assert len(results) == 1 - assert isinstance(results[0], WithAccess) - - def test_message_carries_proto_and_flags(self): - client = _FakeClient(self._project()) - result = list_projects(client)[0] - assert result.message.project_id == "proj-2" - assert result.is_owner is True - assert result.user_has_write_access is True - - def test_passes_limit_and_offset(self): - p = self._project() - client = _FakeClient(p) - # Overwrite get_user_projects to capture args - calls = [] - original = client.research.get_user_projects - - def capturing(gateway_id, user_name, limit=-1, offset=0): - calls.append((gateway_id, user_name, limit, offset)) - return original(gateway_id, user_name, limit, offset) - - client.research.get_user_projects = capturing - list_projects(client, limit=10, offset=5) - assert calls[0][2] == 10 - assert calls[0][3] == 5 - - -class TestCreateProject: - def test_returns_with_access_after_create(self): - p = _make_project(project_id="new-proj-id", owner="alice", - gateway_id="gw1", name="New Project") - client = _FakeClient(p) - result = create_project( - client, {"name": "New Project", "description": "Desc"}) - assert isinstance(result, WithAccess) - assert result.message.project_id == "new-proj-id" - - def test_sets_owner_from_client(self): - p = _make_project(project_id="new-proj-id", owner="alice", - gateway_id="gw1", name="New Project") - client = _FakeClient(p, username="alice") - create_project(client, {"name": "New Project"}) - assert client.research.created_project.owner == "alice" - - def test_sets_gateway_id_from_client(self): - p = _make_project(project_id="new-proj-id", owner="alice", - gateway_id="gw1", name="New Project") - client = _FakeClient(p, gateway_id="gw1") - create_project(client, {"name": "New Project"}) - assert client.research.created_gateway_id == "gw1" - - -class TestUpdateProject: - def _base_project(self): - return _make_project( - project_id="proj-3", owner="alice", gateway_id="gw1", - name="Old Name", description="Old Desc", - ) - - def test_updates_name(self): - client = _FakeClient(self._base_project()) - update_project(client, "proj-3", {"name": "New Name"}) - assert client.research.updated_project.name == "New Name" - - def test_updates_description(self): - client = _FakeClient(self._base_project()) - update_project(client, "proj-3", {"description": "New Desc"}) - assert client.research.updated_project.description == "New Desc" - - def test_returns_with_access(self): - p = self._base_project() - client = _FakeClient(p) - result = update_project(client, "proj-3", {"name": "Updated"}) - assert isinstance(result, WithAccess) - assert result.message.project_id == "proj-3" - - -# =========================================================================== -# ApplicationModule -# =========================================================================== - -def _make_app_module(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.appdeployment import ( # noqa: E501 - app_deployment_pb2, - ) - return app_deployment_pb2.ApplicationModule(**kwargs) - - -# The application-module family follows the proto-direct architecture -# (gateway-catalog variant): the helpers return the raw -# ``app_deployment_pb2.ApplicationModule`` proto wrapped in a ``WithAccess`` -# container. Unlike the project family there is no ownership concept — the -# proto has no ``owner`` field — so ``is_owner`` is always ``False`` and -# ``user_has_write_access`` is the gateway-admin flag the ViewSet passes in as -# ``has_write`` (NOT a chained ``sharing.user_has_access`` call). There is no -# dict transform to test; the portal's generic renderer flattens the proto. - - -class _FakeAppResearch: - def __init__(self, module): - self._module = module - self.registered_module = None - self.registered_gateway_id = None - self.updated_module = None - self.updated_id = None - - def get_application_module(self, app_module_id): - return self._module - - def get_accessible_app_modules(self, gateway_id): - return [self._module] - - def get_all_app_modules(self, gateway_id): - return [self._module] - - def register_application_module(self, gateway_id, application_module): - self.registered_module = application_module - self.registered_gateway_id = gateway_id - return "new-mod-id" - - def update_application_module(self, app_module_id, application_module): - self.updated_id = app_module_id - self.updated_module = application_module - - -class _FakeAppClient: - def __init__(self, module, gateway_id="gw1", username="alice"): - self.research = _FakeAppResearch(module) - self.gateway_id = gateway_id - self.username = username - - -class TestGetApplicationModule: - """``get_application_module`` returns ``WithAccess[ApplicationModule]`` — the - raw proto plus the gateway-catalog access flags (``is_owner`` always - ``False``; ``user_has_write_access`` forwarded from ``has_write``).""" - - def _module(self): - return _make_app_module( - app_module_id="mod-1", app_module_name="App", - app_module_version="1.0", app_module_description="d", - ) - - def test_returns_with_access_container(self): - client = _FakeAppClient(self._module()) - result = get_application_module(client, "mod-1", has_write=True) - assert isinstance(result, WithAccess) - - def test_message_is_the_proto(self): - m = self._module() - client = _FakeAppClient(m) - result = get_application_module(client, "mod-1", has_write=True) - # The exact proto object flows through wholesale — not copied. - assert result.message is m - assert result.message.app_module_id == "mod-1" - - def test_is_owner_always_false(self): - client = _FakeAppClient(self._module()) - result = get_application_module(client, "mod-1", has_write=True) - assert result.is_owner is False - - def test_has_write_forwarded_true(self): - client = _FakeAppClient(self._module()) - result = get_application_module(client, "mod-1", has_write=True) - assert result.user_has_write_access is True - - def test_has_write_forwarded_false(self): - client = _FakeAppClient(self._module()) - result = get_application_module(client, "mod-1", has_write=False) - assert result.user_has_write_access is False - - -class TestListApplicationModules: - def _module(self): - return _make_app_module( - app_module_id="mod-2", app_module_name="Listed", - ) - - def test_accessible_only_uses_accessible_facade(self): - client = _FakeAppClient(self._module()) - calls = [] - client.research.get_accessible_app_modules = lambda gateway_id: ( - calls.append(("accessible", gateway_id)) or [self._module()]) - client.research.get_all_app_modules = lambda gateway_id: ( - calls.append(("all", gateway_id)) or [self._module()]) - list_application_modules(client, has_write=True, accessible_only=True) - assert calls[0][0] == "accessible" - - def test_all_uses_all_facade(self): - client = _FakeAppClient(self._module()) - calls = [] - client.research.get_accessible_app_modules = lambda gateway_id: ( - calls.append(("accessible", gateway_id)) or [self._module()]) - client.research.get_all_app_modules = lambda gateway_id: ( - calls.append(("all", gateway_id)) or [self._module()]) - list_application_modules(client, has_write=True, accessible_only=False) - assert calls[0][0] == "all" - - def test_returns_list_of_with_access(self): - client = _FakeAppClient(self._module()) - results = list_application_modules(client, has_write=True) - assert len(results) == 1 - assert isinstance(results[0], WithAccess) - - def test_message_carries_proto_and_flags(self): - client = _FakeAppClient(self._module()) - result = list_application_modules(client, has_write=True)[0] - assert result.message.app_module_id == "mod-2" - assert result.is_owner is False - assert result.user_has_write_access is True - - -class TestCreateApplicationModule: - def test_returns_with_access_after_create(self): - m = _make_app_module( - app_module_id="new-mod-id", app_module_name="New") - client = _FakeAppClient(m) - result = create_application_module( - client, {"app_module_name": "New", "app_module_version": "1"}, - has_write=True) - assert isinstance(result, WithAccess) - assert result.message.app_module_id == "new-mod-id" - - def test_sets_fields_on_proto(self): - m = _make_app_module(app_module_id="new-mod-id", app_module_name="New") - client = _FakeAppClient(m) - create_application_module( - client, - {"app_module_name": "New", "app_module_version": "2", - "app_module_description": "desc"}, - has_write=True) - reg = client.research.registered_module - assert reg.app_module_name == "New" - assert reg.app_module_version == "2" - assert reg.app_module_description == "desc" - - def test_uses_client_gateway_id(self): - m = _make_app_module(app_module_id="new-mod-id", app_module_name="New") - client = _FakeAppClient(m, gateway_id="gw1") - create_application_module( - client, {"app_module_name": "New"}, has_write=True) - assert client.research.registered_gateway_id == "gw1" - - -class TestUpdateApplicationModule: - def _base_module(self): - return _make_app_module( - app_module_id="mod-3", app_module_name="Old", - app_module_version="1", app_module_description="old", - ) - - def test_updates_name(self): - client = _FakeAppClient(self._base_module()) - update_application_module( - client, "mod-3", {"app_module_name": "New"}, has_write=True) - assert client.research.updated_module.app_module_name == "New" - - def test_updates_version_and_description(self): - client = _FakeAppClient(self._base_module()) - update_application_module( - client, "mod-3", - {"app_module_version": "2", "app_module_description": "new"}, - has_write=True) - assert client.research.updated_module.app_module_version == "2" - assert client.research.updated_module.app_module_description == "new" - - def test_returns_with_access(self): - client = _FakeAppClient(self._base_module()) - result = update_application_module( - client, "mod-3", {"app_module_name": "Updated"}, has_write=True) - assert isinstance(result, WithAccess) - assert result.message.app_module_id == "mod-3" - - -# =========================================================================== -# ExperimentSummary (experiment-search) -# =========================================================================== - -def _make_experiment_summary(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.experiment import ( - experiment_pb2, - ) - return experiment_pb2.ExperimentSummaryModel(**kwargs) - - -class _FakeExpResearch: - def __init__(self, summaries): - self._summaries = summaries - self.search_args = None - - def search_experiments(self, gateway_id, user_name, filters=None, - limit=-1, offset=0): - self.search_args = (gateway_id, user_name, filters, limit, offset) - return list(self._summaries) - - -class _FakeExpClient: - def __init__(self, summaries, gateway_id="gw1", username="alice", - sharing_has_access=True): - self.research = _FakeExpResearch(summaries) - self.sharing = _FakeSharing(sharing_has_access) - self.gateway_id = gateway_id - self.username = username - - -class TestSearchExperiments: - """``search_experiments`` returns ``list[WithAccess[ExperimentSummaryModel]]`` - — each raw proto unioned with the two sharing-access bools. No dict - transform; the proto flows through wholesale. ``is_owner`` is always - ``False`` (the summary proto has no ``owner`` field) and - ``user_has_write_access`` is a per-experiment chained sharing WRITE lookup.""" - - def _summary(self): - return _make_experiment_summary( - experiment_id="exp-1", project_id="proj-1", gateway_id="gw1", - name="Searched", creation_time=1705320000000, - experiment_status="EXECUTING", - ) - - def test_returns_list_of_with_access(self): - client = _FakeExpClient([self._summary()]) - results = search_experiments(client) - assert len(results) == 1 - assert isinstance(results[0], WithAccess) - - def test_message_is_the_proto(self): - s = self._summary() - client = _FakeExpClient([s]) - result = search_experiments(client)[0] - # The exact proto object flows through wholesale — not copied. - assert result.message is s - assert result.message.experiment_id == "exp-1" - assert result.message.experiment_status == "EXECUTING" - - def test_is_owner_always_false(self): - """ExperimentSummaryModel has no owner field; is_owner is trivially - False (matching the legacy serializer, which had no isOwner flag).""" - client = _FakeExpClient([self._summary()], username="alice") - result = search_experiments(client)[0] - assert result.is_owner is False - - def test_user_has_write_access_true_from_sharing(self): - client = _FakeExpClient([self._summary()], sharing_has_access=True) - result = search_experiments(client)[0] - assert result.user_has_write_access is True - - def test_write_access_forwarded_false(self): - client = _FakeExpClient([self._summary()], sharing_has_access=False) - result = search_experiments(client)[0] - assert result.user_has_write_access is False - - def test_passes_gateway_and_username_and_filters(self): - client = _FakeExpClient([self._summary()], gateway_id="gw1", - username="alice") - search_experiments( - client, filters={"USER_NAME": "alice"}, limit=10, offset=5) - gw, user, filters, limit, offset = client.research.search_args - assert gw == "gw1" - assert user == "alice" - assert filters == {"USER_NAME": "alice"} - assert limit == 10 - assert offset == 5 - - def test_none_filters_becomes_empty_dict(self): - client = _FakeExpClient([self._summary()]) - search_experiments(client) - _, _, filters, _, _ = client.research.search_args - assert filters == {} - - def test_sharing_keyed_on_experiment_id(self): - client = _FakeExpClient([self._summary()], username="alice") - search_experiments(client) - assert len(client.sharing.calls) == 1 - resource_id, user_id, perm = client.sharing.calls[0] - assert resource_id == "exp-1" - assert user_id == "alice" - assert perm == "WRITE" - - -# =========================================================================== -# ExperimentStatistics (experiment-statistics — proto-direct) -# =========================================================================== -# -# Proto-direct: ``get_experiment_statistics`` returns the -# ``experiment_pb2.ExperimentStatistics`` proto WHOLESALE. The proto already -# carries the full shape (six per-state counts + six per-state summary lists of -# ExperimentSummaryModel) and nothing cross-service is computed, so there is no -# dict transform and no WithAccess/pydantic wrapper to test — only that the proto -# is returned as-is and the facade is called with the right arguments. - -def _make_experiment_statistics(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.experiment import ( - experiment_pb2, - ) - return experiment_pb2.ExperimentStatistics(**kwargs) - - -class _FakeStatsResearch: - def __init__(self, stats): - self._stats = stats - self.call_args = None - - def get_experiment_statistics(self, gateway_id, from_time, to_time, - user_name="", application_name="", - resource_host_name="", limit=0, offset=0): - self.call_args = dict( - gateway_id=gateway_id, from_time=from_time, to_time=to_time, - user_name=user_name, application_name=application_name, - resource_host_name=resource_host_name, limit=limit, offset=offset) - return self._stats - - -class _FakeStatsClient: - def __init__(self, stats, gateway_id="gw1", username="alice"): - self.research = _FakeStatsResearch(stats) - self.gateway_id = gateway_id - self.username = username - - -class TestGetExperimentStatistics: - def _summary(self, **kwargs): - base = dict( - experiment_id="exp-1", project_id="proj-1", gateway_id="gw1", - name="E", creation_time=1705320000000, - experiment_status="COMPLETED", - ) - base.update(kwargs) - return _make_experiment_summary(**base) - - def _full_stats(self): - return _make_experiment_statistics( - all_experiment_count=10, - completed_experiment_count=4, - cancelled_experiment_count=1, - failed_experiment_count=2, - created_experiment_count=2, - running_experiment_count=1, - all_experiments=[self._summary(experiment_id="all-1")], - completed_experiments=[self._summary(experiment_id="comp-1")], - failed_experiments=[self._summary(experiment_id="fail-1")], - cancelled_experiments=[self._summary(experiment_id="canc-1")], - created_experiments=[self._summary(experiment_id="crea-1")], - running_experiments=[self._summary(experiment_id="run-1")], - ) - - def _stats(self): - return _make_experiment_statistics(all_experiment_count=3) - - def test_returns_the_proto_directly(self): - """No dict transform, no wrapper — the proto flows through wholesale.""" - from airavata_sdk.generated.org.apache.airavata.model.experiment import ( - experiment_pb2, - ) - stats = self._stats() - client = _FakeStatsClient(stats) - result = get_experiment_statistics(client, from_time=1000, to_time=2000) - assert isinstance(result, experiment_pb2.ExperimentStatistics) - assert result is stats - - def test_proto_carries_counts_and_summary_lists(self): - client = _FakeStatsClient(self._full_stats()) - result = get_experiment_statistics(client, from_time=1, to_time=2) - assert result.all_experiment_count == 10 - assert result.completed_experiment_count == 4 - assert result.cancelled_experiment_count == 1 - assert result.failed_experiment_count == 2 - assert result.created_experiment_count == 2 - assert result.running_experiment_count == 1 - assert result.all_experiments[0].experiment_id == "all-1" - assert result.completed_experiments[0].experiment_id == "comp-1" - assert result.failed_experiments[0].experiment_id == "fail-1" - assert result.cancelled_experiments[0].experiment_id == "canc-1" - assert result.created_experiments[0].experiment_id == "crea-1" - assert result.running_experiments[0].experiment_id == "run-1" - - def test_passes_bounds_and_gateway(self): - client = _FakeStatsClient(self._stats(), gateway_id="gw1") - get_experiment_statistics( - client, from_time=1000, to_time=2000, limit=25, offset=5) - args = client.research.call_args - assert args["gateway_id"] == "gw1" - assert args["from_time"] == 1000 - assert args["to_time"] == 2000 - assert args["limit"] == 25 - assert args["offset"] == 5 - - def test_none_filters_normalised_to_empty_string(self): - client = _FakeStatsClient(self._stats()) - get_experiment_statistics( - client, from_time=1000, to_time=2000, - user_name=None, application_name=None, resource_host_name=None) - args = client.research.call_args - assert args["user_name"] == "" - assert args["application_name"] == "" - assert args["resource_host_name"] == "" - - def test_filters_forwarded(self): - client = _FakeStatsClient(self._stats()) - get_experiment_statistics( - client, from_time=1000, to_time=2000, - user_name="bob", application_name="Gaussian", - resource_host_name="host-x") - args = client.research.call_args - assert args["user_name"] == "bob" - assert args["application_name"] == "Gaussian" - assert args["resource_host_name"] == "host-x" - - -# =========================================================================== -# Notification — proto-direct + WithAccess (gateway-catalog variant) -# =========================================================================== -# -# Like the application-module family, the notification helpers return the raw -# ``workspace_pb2.Notification`` proto wrapped in a ``WithAccess`` container. -# There is no ownership concept (the proto has no ``owner`` field), so -# ``is_owner`` is always ``False`` and ``user_has_write_access`` is the -# gateway-admin flag the ViewSet passes in as ``has_write``. There is no dict -# transform to test — the portal's generic renderer flattens the proto (enums as -# NAMES, int64 timestamps as STRINGS); that JSON shape is pinned by the portal's -# ``test_notifications_contract.py`` snapshot. The create/update wire-decoders -# (``_to_epoch_ms`` / ``_to_priority_int``) remain on the write path and are -# tested by ``TestNotificationWireDecoders``. - -def _make_notification(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.workspace import ( - workspace_pb2, - ) - return workspace_pb2.Notification(**kwargs) - - -def _priority(name): - from airavata_sdk.generated.org.apache.airavata.model.workspace import ( - workspace_pb2, - ) - return getattr(workspace_pb2.NotificationPriority, name) - - -class _FakeNotifResearch: - def __init__(self, notification, listing=None): - self._notification = notification - self._listing = listing if listing is not None else [notification] - self.created = None - self.updated = None - self.deleted = None - - def get_notification(self, gateway_id, notification_id): - return self._notification - - def get_all_notifications(self, gateway_id): - return list(self._listing) - - def create_notification(self, notification): - self.created = notification - return "new-notif-id" - - def update_notification(self, notification): - self.updated = notification - - def delete_notification(self, gateway_id, notification_id): - self.deleted = (gateway_id, notification_id) - - -class _FakeNotifClient: - def __init__(self, notification, listing=None, gateway_id="gw1", - username="admin"): - self.research = _FakeNotifResearch(notification, listing) - self.gateway_id = gateway_id - self.username = username - - -class TestGetNotification: - """``get_notification`` returns ``WithAccess[Notification]`` — the raw proto - plus the gateway-catalog access flags (``is_owner`` always ``False``; - ``user_has_write_access`` forwarded from ``has_write``).""" - - def _n(self): - return _make_notification( - notification_id="notif-1", gateway_id="gw1", title="T", - creation_time=1705320000000, priority=_priority("NORMAL")) - - def test_returns_with_access_container(self): - client = _FakeNotifClient(self._n()) - result = get_notification(client, "notif-1", has_write=True) - assert isinstance(result, WithAccess) - - def test_message_is_the_proto(self): - n = self._n() - client = _FakeNotifClient(n) - result = get_notification(client, "notif-1", has_write=True) - # The exact proto object flows through wholesale — not copied. - assert result.message is n - assert result.message.notification_id == "notif-1" - assert result.message.priority == _priority("NORMAL") - - def test_is_owner_always_false(self): - client = _FakeNotifClient(self._n()) - result = get_notification(client, "notif-1", has_write=True) - assert result.is_owner is False - - def test_has_write_forwarded_true(self): - client = _FakeNotifClient(self._n()) - result = get_notification(client, "notif-1", has_write=True) - assert result.user_has_write_access is True - - def test_has_write_forwarded_false(self): - client = _FakeNotifClient(self._n()) - result = get_notification(client, "notif-1", has_write=False) - assert result.user_has_write_access is False - - -class TestListNotifications: - def _n(self, nid="notif-1"): - return _make_notification( - notification_id=nid, gateway_id="gw1", title="T", - priority=_priority("LOW")) - - def test_returns_list_of_with_access(self): - client = _FakeNotifClient( - self._n(), listing=[self._n("a"), self._n("b")]) - results = list_notifications(client, has_write=False) - assert len(results) == 2 - assert all(isinstance(r, WithAccess) for r in results) - - def test_messages_carry_protos_and_flags(self): - client = _FakeNotifClient( - self._n(), listing=[self._n("a"), self._n("b")]) - results = list_notifications(client, has_write=False) - assert {r.message.notification_id for r in results} == {"a", "b"} - assert all(r.is_owner is False for r in results) - assert all(r.user_has_write_access is False for r in results) - - def test_has_write_forwarded_to_every_item(self): - client = _FakeNotifClient( - self._n(), listing=[self._n("a"), self._n("b")]) - results = list_notifications(client, has_write=True) - assert all(r.user_has_write_access is True for r in results) - - -class TestCreateNotification: - def _n(self): - return _make_notification(notification_id="x", gateway_id="gw1") - - def test_returns_with_access_with_new_id(self): - client = _FakeNotifClient(self._n()) - result = create_notification( - client, {"title": "Hi", "notification_message": "msg", - "priority": _priority("HIGH")}, - has_write=True) - assert isinstance(result, WithAccess) - assert result.message.notification_id == "new-notif-id" - assert result.message.title == "Hi" - assert result.message.priority == _priority("HIGH") - assert result.is_owner is False - assert result.user_has_write_access is True - - def test_forces_gateway_id_from_client(self): - client = _FakeNotifClient(self._n(), gateway_id="gw1") - create_notification(client, {"title": "Hi"}, has_write=True) - assert client.research.created.gateway_id == "gw1" - - def test_has_write_forwarded(self): - client = _FakeNotifClient(self._n()) - result = create_notification( - client, {"title": "Hi"}, has_write=False) - assert result.user_has_write_access is False - - -class TestUpdateNotification: - def _base(self): - return _make_notification( - notification_id="notif-9", gateway_id="gw1", title="Old", - notification_message="oldmsg", priority=_priority("LOW")) - - def test_updates_title(self): - client = _FakeNotifClient(self._base()) - update_notification( - client, "notif-9", {"title": "New"}, has_write=True) - assert client.research.updated.title == "New" - # untouched field preserved from base - assert client.research.updated.notification_message == "oldmsg" - - def test_preserves_notification_id(self): - client = _FakeNotifClient(self._base()) - update_notification( - client, "notif-9", {"title": "New"}, has_write=True) - assert client.research.updated.notification_id == "notif-9" - - def test_returns_with_access(self): - client = _FakeNotifClient(self._base()) - result = update_notification( - client, "notif-9", {"title": "New"}, has_write=False) - assert isinstance(result, WithAccess) - assert result.message.notification_id == "notif-9" - assert result.message.title == "New" - assert result.is_owner is False - assert result.user_has_write_access is False - - -class TestDeleteNotification: - def test_calls_facade_with_gateway_and_id(self): - n = _make_notification(notification_id="notif-1", gateway_id="gw1") - client = _FakeNotifClient(n, gateway_id="gw1") - delete_notification(client, "notif-1") - assert client.research.deleted == ("gw1", "notif-1") - - -class TestNotificationWireDecoders: - """The create/update path accepts the portal wire format (ISO timestamps, - priority NAME strings) as well as already-decoded proto values.""" - - def test_create_accepts_iso_timestamps(self): - from airavata_sdk.helpers.research_resources import _to_epoch_ms - # JS Date toJSON form (millisecond precision, trailing Z) - assert _to_epoch_ms("2024-01-15T12:00:00.000Z") == 1705320000000 - # microsecond + Z (DRF output form) - assert _to_epoch_ms("2024-01-15T12:00:00.000000Z") == 1705320000000 - - def test_epoch_ms_passthrough_and_falsy(self): - from airavata_sdk.helpers.research_resources import _to_epoch_ms - assert _to_epoch_ms(1705320000000) == 1705320000000 - assert _to_epoch_ms(0) == 0 - assert _to_epoch_ms(None) == 0 - assert _to_epoch_ms("") == 0 - - def test_priority_name_decode(self): - from airavata_sdk.helpers.research_resources import _to_priority_int - assert _to_priority_int("LOW") == _priority("LOW") - assert _to_priority_int("NORMAL") == _priority("NORMAL") - assert _to_priority_int("HIGH") == _priority("HIGH") - - def test_priority_int_passthrough_and_unknown(self): - from airavata_sdk.helpers.research_resources import _to_priority_int - assert _to_priority_int(_priority("HIGH")) == _priority("HIGH") - assert _to_priority_int(None) == 0 - assert _to_priority_int("") == 0 - assert _to_priority_int("BOGUS") == 0 - - def test_create_with_wire_format_decodes_to_proto(self): - client = _FakeNotifClient( - _make_notification(notification_id="x", gateway_id="gw1")) - result = create_notification( - client, - {"title": "Hi", "published_time": "2024-01-15T12:10:00.000Z", - "priority": "NORMAL"}, - has_write=True) - # facade received the decoded proto (epoch-millis int + enum int) - assert client.research.created.published_time == 1705320600000 - assert client.research.created.priority == _priority("NORMAL") - # the returned WithAccess carries that same proto wholesale - assert result.message.published_time == 1705320600000 - assert result.message.priority == _priority("NORMAL") - - -# =========================================================================== -# Parser -# =========================================================================== - -def _make_parser(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.parser import ( # noqa: E501 - parser_pb2, - ) - return parser_pb2.Parser(**kwargs) - - -def _make_parser_input(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.parser import ( # noqa: E501 - parser_pb2, - ) - return parser_pb2.ParserInput(**kwargs) - - -def _make_parser_output(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.parser import ( # noqa: E501 - parser_pb2, - ) - return parser_pb2.ParserOutput(**kwargs) - - -def _io_type(name): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.parser import ( # noqa: E501 - parser_pb2, - ) - return getattr(parser_pb2.IOType, name) - - -class TestIoTypeValueCoercion: - """``_io_type_value`` accepts the proto member NAME or the proto integer.""" - - def test_name_string_to_proto_int(self): - from airavata_sdk.helpers.research_resources import _io_type_value - assert _io_type_value("FILE") == _io_type("FILE") - assert _io_type_value("PROPERTY") == _io_type("PROPERTY") - - def test_prefixed_name_accepted(self): - from airavata_sdk.helpers.research_resources import _io_type_value - assert _io_type_value("IO_TYPE_UNKNOWN") == 0 - assert _io_type_value("UNKNOWN") == 0 - - def test_proto_int_passthrough(self): - from airavata_sdk.helpers.research_resources import _io_type_value - assert _io_type_value(_io_type("FILE")) == _io_type("FILE") - assert _io_type_value(_io_type("PROPERTY")) == _io_type("PROPERTY") - - def test_none_and_unknown_to_zero(self): - from airavata_sdk.helpers.research_resources import _io_type_value - assert _io_type_value(None) == 0 - assert _io_type_value("") == 0 - assert _io_type_value("BOGUS") == 0 - assert _io_type_value(99) == 0 - assert _io_type_value(True) == 0 - - -class _FakeParserResearch: - def __init__(self, parser, listing=None): - self._parser = parser - self._listing = listing if listing is not None else [parser] - # The most recently saved proto, re-fetched by create/update. - self._saved_for_fetch = parser - self.saved = None - self.removed = None - - def get_parser(self, parser_id, gateway_id): - # Mirror the server: return the saved proto with the requested id. - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.parser import ( # noqa: E501 - parser_pb2, - ) - p = parser_pb2.Parser() - p.CopyFrom(self._saved_for_fetch) - p.id = parser_id - return p - - def list_all_parsers(self, gateway_id): - return list(self._listing) - - def save_parser(self, parser): - self.saved = parser - self._saved_for_fetch = parser - return "new-parser-id" - - def remove_parser(self, parser_id, gateway_id): - self.removed = (parser_id, gateway_id) - - -class _FakeParserClient: - def __init__(self, parser, listing=None, gateway_id="gw1", - username="alice"): - self.research = _FakeParserResearch(parser, listing) - self.gateway_id = gateway_id - self.username = username - - -class TestGetParser: - def _p(self): - return _make_parser( - id="parser-1", gateway_id="gw1", image_name="img", - input_files=[ - _make_parser_input( - id="in-1", name="infile", required_input=True, - parser_id="parser-1", type=_io_type("FILE")), - ], - output_files=[ - _make_parser_output( - id="out-1", name="outfile", required_output=False, - parser_id="parser-1", type=_io_type("PROPERTY")), - ], - ) - - def test_returns_the_proto_directly(self): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.parser import ( # noqa: E501 - parser_pb2, - ) - from airavata_sdk.helpers.research_resources import get_parser - client = _FakeParserClient(self._p()) - result = get_parser(client, "parser-1") - # proto-direct: the facade proto is returned as-is, not a dict / envelope - assert isinstance(result, parser_pb2.Parser) - assert result.id == "parser-1" - assert result.image_name == "img" - - def test_nested_files_and_enum_carried_on_proto(self): - from airavata_sdk.helpers.research_resources import get_parser - client = _FakeParserClient(self._p()) - result = get_parser(client, "parser-1") - assert result.input_files[0].name == "infile" - assert result.input_files[0].type == _io_type("FILE") - assert result.output_files[0].type == _io_type("PROPERTY") - - -class TestListParsers: - def _p(self, pid="parser-1"): - return _make_parser(id=pid, gateway_id="gw1") - - def test_returns_list_of_protos(self): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.parser import ( # noqa: E501 - parser_pb2, - ) - from airavata_sdk.helpers.research_resources import list_parsers - client = _FakeParserClient( - self._p(), listing=[self._p("a"), self._p("b")]) - results = list_parsers(client) - assert all(isinstance(r, parser_pb2.Parser) for r in results) - assert {r.id for r in results} == {"a", "b"} - - -class TestCreateParser: - def _p(self): - return _make_parser(id="x", gateway_id="gw1") - - def test_returns_proto_with_new_id(self): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.parser import ( # noqa: E501 - parser_pb2, - ) - from airavata_sdk.helpers.research_resources import create_parser - client = _FakeParserClient(self._p()) - result = create_parser( - client, - {"image_name": "img", "execution_command": "run", - "input_files": [ - {"name": "f", "required_input": True, "type": "FILE"}]}) - # proto-direct: the re-fetched proto carries the server-assigned id - assert isinstance(result, parser_pb2.Parser) - assert result.id == "new-parser-id" - assert result.image_name == "img" - assert result.input_files[0].type == _io_type("FILE") - - def test_forces_gateway_id_from_client(self): - from airavata_sdk.helpers.research_resources import create_parser - client = _FakeParserClient(self._p(), gateway_id="gw1") - create_parser(client, {"image_name": "img"}) - assert client.research.saved.gateway_id == "gw1" - - def test_input_type_name_decoded_to_proto(self): - from airavata_sdk.helpers.research_resources import create_parser - client = _FakeParserClient(self._p()) - create_parser( - client, - {"input_files": [{"name": "f", "type": "PROPERTY"}], - "output_files": [{"name": "g", "type": "FILE"}]}) - saved = client.research.saved - assert saved.input_files[0].type == _io_type("PROPERTY") - assert saved.output_files[0].type == _io_type("FILE") - - -class TestUpdateParser: - def _p(self): - return _make_parser(id="parser-9", gateway_id="gw1", image_name="old") - - def test_preserves_parser_id_on_save(self): - from airavata_sdk.helpers.research_resources import update_parser - client = _FakeParserClient(self._p()) - update_parser(client, "parser-9", {"image_name": "new"}) - assert client.research.saved.id == "parser-9" - - def test_returns_proto(self): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.parser import ( # noqa: E501 - parser_pb2, - ) - from airavata_sdk.helpers.research_resources import update_parser - client = _FakeParserClient(self._p()) - result = update_parser(client, "parser-9", {"image_name": "new"}) - assert isinstance(result, parser_pb2.Parser) - assert result.id == "parser-9" - assert result.image_name == "new" - - -class TestDeleteParser: - def test_calls_facade_with_id_and_gateway(self): - from airavata_sdk.helpers.research_resources import delete_parser - client = _FakeParserClient( - _make_parser(id="parser-1", gateway_id="gw1"), gateway_id="gw1") - delete_parser(client, "parser-1") - assert client.research.removed == ("parser-1", "gw1") - - -# =========================================================================== -# DataProduct -# =========================================================================== - -def _rc(): - from airavata_sdk.generated.org.apache.airavata.model.data.replica import ( # noqa: E501 - replica_catalog_pb2, - ) - return replica_catalog_pb2 - - -def _make_replica(**kwargs): - return _rc().DataReplicaLocationModel(**kwargs) - - -def _make_data_product(**kwargs): - return _rc().DataProductModel(**kwargs) - - - - -class _FakeDataProductResearch: - def __init__(self, data_product): - self._data_product = data_product - self.registered = None - - def get_data_product(self, product_uri): - return self._data_product - - def register_data_product(self, data_product): - self.registered = data_product - return "airavata-dp://new-uri" - - -class _FakeDataProductClient: - def __init__(self, data_product, gateway_id="gw1", username="alice"): - self.research = _FakeDataProductResearch(data_product) - self.gateway_id = gateway_id - self.username = username - - -class TestGetDataProduct: - """Proto-direct read path: ``get_data_product`` returns a - ``WithAccess[DataProductModel]`` — the raw proto unioned with the caller's - ``is_owner`` (SDK-trivial ``owner_name == username``) and - ``user_has_write_access`` (the request-bound *has_write* flag the ViewSet - passes in).""" - - def _dp(self, owner_name="alice"): - rc = _rc() - return _make_data_product( - product_uri="airavata-dp://1", gateway_id="gw1", - product_name="f.dat", owner_name=owner_name, - data_product_type=rc.DataProductType.FILE, - creation_time=1705320000000) - - def test_returns_with_access_carrying_the_proto(self): - from airavata_sdk.helpers._envelope import WithAccess - from airavata_sdk.helpers.research_resources import get_data_product - dp = self._dp() - client = _FakeDataProductClient(dp) - result = get_data_product( - client, "airavata-dp://1", has_write=True) - assert isinstance(result, WithAccess) - # The proto flows through wholesale — no field copied out. - assert result.message is dp - assert result.message.product_uri == "airavata-dp://1" - - def test_is_owner_true_when_owner_matches_username(self): - from airavata_sdk.helpers.research_resources import get_data_product - client = _FakeDataProductClient( - self._dp(owner_name="alice"), username="alice") - result = get_data_product(client, "airavata-dp://1", has_write=True) - assert result.is_owner is True - - def test_is_owner_false_when_owner_differs(self): - from airavata_sdk.helpers.research_resources import get_data_product - client = _FakeDataProductClient( - self._dp(owner_name="alice"), username="bob") - result = get_data_product(client, "airavata-dp://1", has_write=True) - assert result.is_owner is False - - def test_is_owner_false_when_owner_empty(self): - from airavata_sdk.helpers.research_resources import get_data_product - client = _FakeDataProductClient( - self._dp(owner_name=""), username="") - result = get_data_product(client, "airavata-dp://1", has_write=True) - # An empty owner_name never makes the (possibly empty) caller the owner. - assert result.is_owner is False - - def test_user_has_write_access_reflects_has_write(self): - from airavata_sdk.helpers.research_resources import get_data_product - client = _FakeDataProductClient(self._dp()) - assert get_data_product( - client, "airavata-dp://1", has_write=True).user_has_write_access - assert not get_data_product( - client, "airavata-dp://1", has_write=False).user_has_write_access - - -class TestDataProductForUpload: - def test_builds_proto_with_single_replica(self): - from airavata_sdk.helpers.research_resources import ( - data_product_for_upload, - ) - dp = data_product_for_upload( - gateway_id="gw1", owner_name="alice", product_name="f.dat", - file_path="/data/tmp/f.dat", storage_resource_id="storage-1", - content_type="text/plain", product_size=10) - rc = _rc() - assert dp.gateway_id == "gw1" - assert dp.owner_name == "alice" - assert dp.product_name == "f.dat" - assert dp.data_product_type == rc.DataProductType.FILE - assert dp.product_size == 10 - assert dp.product_metadata["mime-type"] == "text/plain" - assert len(dp.replica_locations) == 1 - r = dp.replica_locations[0] - assert r.file_path == "/data/tmp/f.dat" - assert r.storage_resource_id == "storage-1" - assert (r.replica_location_category - == rc.ReplicaLocationCategory.GATEWAY_DATA_STORE) - assert (r.replica_persistent_type - == rc.ReplicaPersistentType.TRANSIENT) - - def test_no_content_type_means_empty_metadata(self): - from airavata_sdk.helpers.research_resources import ( - data_product_for_upload, - ) - dp = data_product_for_upload( - gateway_id="gw1", owner_name="alice", product_name="f.dat", - file_path="/p", storage_resource_id="s") - assert dict(dp.product_metadata) == {} - - -class TestRegisterDataProduct: - def test_returns_uri_and_passes_proto(self): - from airavata_sdk.helpers.research_resources import ( - data_product_for_upload, register_data_product, - ) - client = _FakeDataProductClient(_make_data_product(product_uri="x")) - dp = data_product_for_upload( - gateway_id="gw1", owner_name="alice", product_name="f", - file_path="/p", storage_resource_id="s") - uri = register_data_product(client, dp) - assert uri == "airavata-dp://new-uri" - assert client.research.registered is dp - - -# =========================================================================== -# ApplicationInterface -# =========================================================================== - -def _io_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.application.io import ( - application_io_pb2, - ) - return application_io_pb2 - - -def _ai_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.appinterface import ( # noqa: E501 - app_interface_pb2, - ) - return app_interface_pb2 - - -def _make_input(**kwargs): - io = _io_pb2() - defaults = dict( - name="in1", value="v", type=io.DataType.STRING, - application_argument="-i", standard_input=False, - user_friendly_description="ufd", meta_data='{"a": 1}', - input_order=2, is_required=True, - required_to_added_to_command_line=True, data_staged=False, - storage_resource_id="sr1", is_read_only=False, override_filename="of") - defaults.update(kwargs) - return io.InputDataObjectType(**defaults) - - -def _make_output(**kwargs): - io = _io_pb2() - defaults = dict( - name="out1", value="ov", type=io.DataType.URI, - application_argument="-o", is_required=True, - required_to_added_to_command_line=False, data_movement=True, - location="loc", search_query="sq", output_streaming=False, - storage_resource_id="sr2", meta_data="") - defaults.update(kwargs) - return io.OutputDataObjectType(**defaults) - - -def _make_interface(**kwargs): - ai = _ai_pb2() - defaults = dict( - application_interface_id="echo_abc", application_name="Echo", - application_description="desc", application_modules=["mod1"], - archive_working_directory=True, has_optional_file_inputs=True, - application_inputs=[_make_input()], - application_outputs=[_make_output()]) - defaults.update(kwargs) - return ai.ApplicationInterfaceDescription(**defaults) - - - - -class _FakeAppInterfaceResearch: - def __init__(self, interface): - self._interface = interface - self.registered = None - self.updated = None - self.deleted = None - - def get_application_interface(self, app_interface_id): - return self._interface - - def get_all_application_interfaces(self, gateway_id): - return [self._interface] - - def register_application_interface(self, gateway_id, application_interface): - self.registered = (gateway_id, application_interface) - return "new-iface-id" - - def update_application_interface(self, app_interface_id, - application_interface): - self.updated = (app_interface_id, application_interface) - - def delete_application_interface(self, app_interface_id): - self.deleted = app_interface_id - - -class _FakeAppInterfaceClient: - def __init__(self, interface, gateway_id="gw1", username="alice"): - self.research = _FakeAppInterfaceResearch(interface) - self.gateway_id = gateway_id - self.username = username - - -class TestApplicationInterfaceOrchestration: - def test_get_returns_with_access(self): - from airavata_sdk.helpers._envelope import WithAccess - from airavata_sdk.helpers.research_resources import ( - get_application_interface, - ) - client = _FakeAppInterfaceClient(_make_interface()) - result = get_application_interface(client, "echo_abc", has_write=True) - # Gateway-catalog WithAccess: the raw proto under .message, no owner, - # write access forwarded from the gateway-admin flag. - assert isinstance(result, WithAccess) - assert result.message is client.research._interface - assert result.message.application_interface_id == "echo_abc" - assert result.is_owner is False - assert result.user_has_write_access is True - - def test_get_forwards_has_write_false(self): - from airavata_sdk.helpers.research_resources import ( - get_application_interface, - ) - client = _FakeAppInterfaceClient(_make_interface()) - result = get_application_interface(client, "echo_abc", has_write=False) - assert result.user_has_write_access is False - - def test_list_returns_with_access(self): - from airavata_sdk.helpers._envelope import WithAccess - from airavata_sdk.helpers.research_resources import ( - list_application_interfaces, - ) - client = _FakeAppInterfaceClient(_make_interface()) - items = list_application_interfaces(client, has_write=False) - assert len(items) == 1 - assert isinstance(items[0], WithAccess) - assert items[0].message is client.research._interface - assert items[0].is_owner is False - assert items[0].user_has_write_access is False - - def test_create_builds_proto_and_refetches(self): - from airavata_sdk.helpers.research_resources import ( - create_application_interface, - ) - client = _FakeAppInterfaceClient(_make_interface()) - data = { - "application_name": "NewApp", - "application_description": "nd", - "application_modules": ["m1"], - "archive_working_directory": True, - "application_inputs": [{ - "name": "i", "type": "URI", "meta_data": {"x": 1}}], - "application_outputs": [{"name": "o", "type": "STDOUT"}], - } - create_application_interface(client, data, has_write=True) - gw, proto = client.research.registered - assert gw == "gw1" - assert proto.application_name == "NewApp" - assert proto.application_modules == ["m1"] - io = _io_pb2() - assert proto.application_inputs[0].type == io.DataType.URI - assert proto.application_inputs[0].meta_data == '{"x": 1}' - assert proto.application_outputs[0].type == io.DataType.STDOUT - - def test_update_merges_and_forces_id(self): - from airavata_sdk.helpers.research_resources import ( - update_application_interface, - ) - client = _FakeAppInterfaceClient(_make_interface()) - update_application_interface( - client, "echo_abc", {"application_name": "Renamed"}, - has_write=True) - iface_id, proto = client.research.updated - assert iface_id == "echo_abc" - assert proto.application_interface_id == "echo_abc" - assert proto.application_name == "Renamed" - # Untouched fields retained from the base proto. - assert proto.application_description == "desc" - - def test_delete(self): - from airavata_sdk.helpers.research_resources import ( - delete_application_interface, - ) - client = _FakeAppInterfaceClient(_make_interface()) - delete_application_interface(client, "echo_abc") - assert client.research.deleted == "echo_abc" - - -class TestDataTypeIntCoercion: - def test_name_to_int(self): - from airavata_sdk.helpers.research_resources import _data_type_int - io = _io_pb2() - assert _data_type_int("STRING") == io.DataType.STRING - assert _data_type_int("URI") == io.DataType.URI - - def test_int_passthrough(self): - from airavata_sdk.helpers.research_resources import _data_type_int - io = _io_pb2() - assert _data_type_int(io.DataType.FLOAT) == io.DataType.FLOAT - - def test_none_and_unknown(self): - from airavata_sdk.helpers.research_resources import _data_type_int - assert _data_type_int(None) == 0 - assert _data_type_int("") == 0 - assert _data_type_int("NOPE") == 0 - - -class TestMetaDataStr: - def test_none_to_empty(self): - from airavata_sdk.helpers.research_resources import _meta_data_str - assert _meta_data_str(None) == "" - - def test_string_passthrough(self): - from airavata_sdk.helpers.research_resources import _meta_data_str - assert _meta_data_str('{"a": 1}') == '{"a": 1}' - - def test_dict_dumps(self): - from airavata_sdk.helpers.research_resources import _meta_data_str - import json - assert json.loads(_meta_data_str({"a": 1})) == {"a": 1} - - -# =========================================================================== -# ApplicationDeployment (proto-direct + WithAccess envelope) -# =========================================================================== -# -# The application-deployment family follows the proto-direct architecture -# (sharing-controlled gateway-catalog variant): the read helpers return the raw -# ``app_deployment_pb2.ApplicationDeploymentDescription`` proto wrapped in a -# ``WithAccess`` container. The deployment proto has no ``owner`` field, so -# ``is_owner`` is always ``False``; ``user_has_write_access`` is a CHAINED -# ``sharing.user_has_access`` WRITE lookup keyed on ``app_deployment_id`` (the -# legacy ``user_has_access(request, app_deployment_id)``). There is no dict -# transform, no Thrift-int parallelism mapping, and no order-sorting to test — -# the portal's generic renderer flattens the proto (enums as NAMES, nested lists -# in proto order). - - -def _ad_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.appdeployment import ( # noqa: E501 - app_deployment_pb2, - ) - return app_deployment_pb2 - - -def _par_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.parallelism import ( - parallelism_pb2, - ) - return parallelism_pb2 - - -def _make_deployment(**kwargs): - ad = _ad_pb2() - return ad.ApplicationDeploymentDescription(**kwargs) - - -class _FakeDeploymentSharing: - def __init__(self, has_access=True): - self._has_access = has_access - self.calls = [] - - def user_has_access(self, resource_id, user_id, permission_type): - self.calls.append((resource_id, user_id, permission_type)) - if isinstance(self._has_access, dict): - return bool(self._has_access.get(resource_id, False)) - return self._has_access - - -class _FakeDeploymentResearch: - def __init__(self, deployment=None, deployments=None): - self._deployment = deployment - self._deployments = deployments or [] - self.registered = None - self.updated = None - self.deleted = None - - def get_application_deployment(self, app_deployment_id): - return self._deployment - - def get_accessible_application_deployments(self, gateway_id): - return list(self._deployments) - - def get_application_deployments_for_app_module_and_group_resource_profile( - self, app_module_id, group_resource_profile_id): - self.module_profile_args = (app_module_id, group_resource_profile_id) - return list(self._deployments) - - def register_application_deployment(self, gateway_id, application_deployment): - self.registered = application_deployment - self.registered_gateway_id = gateway_id - return "dep-new" - - def update_application_deployment(self, app_deployment_id, application_deployment): - self.updated = (app_deployment_id, application_deployment) - - def delete_application_deployment(self, app_deployment_id): - self.deleted = app_deployment_id - - -class _FakeDeploymentClient: - def __init__(self, research, sharing_has_access=True, - username="alice", gateway_id="default"): - self.research = research - self.sharing = _FakeDeploymentSharing(sharing_has_access) - self.username = username - self.gateway_id = gateway_id - - -class TestParallelismInputToProtoInt: - def test_name_string_accepted(self): - from airavata_sdk.helpers.research_resources import ( - _parallelism_input_to_proto_int, - ) - par = _par_pb2() - assert _parallelism_input_to_proto_int("MPI") == \ - par.ApplicationParallelismType.MPI - assert _parallelism_input_to_proto_int( - "APPLICATION_PARALLELISM_TYPE_OPENMP") == \ - par.ApplicationParallelismType.OPENMP - - def test_proto_int_passthrough(self): - from airavata_sdk.helpers.research_resources import ( - _parallelism_input_to_proto_int, - ) - par = _par_pb2() - assert _parallelism_input_to_proto_int( - par.ApplicationParallelismType.CRAY_MPI) == \ - par.ApplicationParallelismType.CRAY_MPI - - def test_none_and_unknown_to_zero(self): - from airavata_sdk.helpers.research_resources import ( - _parallelism_input_to_proto_int, - ) - assert _parallelism_input_to_proto_int(None) == 0 - assert _parallelism_input_to_proto_int("") == 0 - assert _parallelism_input_to_proto_int("NOPE") == 0 - - -class TestBuildApplicationDeployment: - def test_build_from_snake_case(self): - from airavata_sdk.helpers.research_resources import ( - _build_application_deployment, - ) - client = _FakeDeploymentClient(_FakeDeploymentResearch()) - data = { - "app_module_id": "mod-1", - "compute_host_id": "host-1", - "executable_path": "/bin/run", - "parallelism": "MPI", # proto member NAME (wire format) - "module_load_cmds": [{"command": "x", "command_order": 0}], - "set_environment": [{"name": "N", "value": "V", "env_path_order": 0}], - "default_node_count": 3, - "editable_by_user": True, - } - pb = _build_application_deployment(client, data) - par = _par_pb2() - assert pb.app_module_id == "mod-1" - assert pb.parallelism == par.ApplicationParallelismType.MPI - assert pb.module_load_cmds[0].command == "x" - assert pb.set_environment[0].name == "N" - assert pb.default_node_count == 3 - assert pb.editable_by_user is True - - -class TestGetApplicationDeployment: - """``get_application_deployment`` returns ``WithAccess[...Deployment]`` — the - raw proto plus ``is_owner`` (always ``False``) and the chained sharing WRITE - flag keyed on ``app_deployment_id``.""" - - def _deployment(self): - par = _par_pb2() - return _make_deployment( - app_deployment_id="dep-1", app_module_id="m", - parallelism=par.ApplicationParallelismType.MPI) - - def test_returns_with_access_container(self): - from airavata_sdk.helpers.research_resources import ( - get_application_deployment, - ) - client = _FakeDeploymentClient( - _FakeDeploymentResearch(deployment=self._deployment())) - result = get_application_deployment(client, "dep-1") - assert isinstance(result, WithAccess) - - def test_message_is_the_proto(self): - from airavata_sdk.helpers.research_resources import ( - get_application_deployment, - ) - dep = self._deployment() - client = _FakeDeploymentClient( - _FakeDeploymentResearch(deployment=dep)) - result = get_application_deployment(client, "dep-1") - # The exact proto object flows through wholesale — not copied. - assert result.message is dep - assert result.message.app_deployment_id == "dep-1" - - def test_is_owner_always_false(self): - from airavata_sdk.helpers.research_resources import ( - get_application_deployment, - ) - client = _FakeDeploymentClient( - _FakeDeploymentResearch(deployment=self._deployment())) - result = get_application_deployment(client, "dep-1") - assert result.is_owner is False - - def test_write_access_reflects_sharing(self): - from airavata_sdk.helpers.research_resources import ( - get_application_deployment, - ) - client = _FakeDeploymentClient( - _FakeDeploymentResearch(deployment=self._deployment()), - sharing_has_access=True) - assert get_application_deployment( - client, "dep-1").user_has_write_access is True - client = _FakeDeploymentClient( - _FakeDeploymentResearch(deployment=self._deployment()), - sharing_has_access=False) - assert get_application_deployment( - client, "dep-1").user_has_write_access is False - - def test_chained_sharing_call_arguments(self): - from airavata_sdk.helpers.research_resources import ( - get_application_deployment, - ) - client = _FakeDeploymentClient( - _FakeDeploymentResearch(deployment=self._deployment()), - username="alice") - get_application_deployment(client, "dep-1") - assert len(client.sharing.calls) == 1 - resource_id, user_id, perm = client.sharing.calls[0] - assert resource_id == "dep-1" - assert user_id == "alice" - assert perm == "WRITE" - - -class TestListApplicationDeployments: - def test_per_deployment_chained_write_lookup(self): - from airavata_sdk.helpers.research_resources import ( - list_application_deployments, - ) - d1 = _make_deployment(app_deployment_id="a") - d2 = _make_deployment(app_deployment_id="b") - client = _FakeDeploymentClient( - _FakeDeploymentResearch(deployments=[d1, d2]), - sharing_has_access={"a": True, "b": False}) - out = list_application_deployments(client) - assert all(isinstance(x, WithAccess) for x in out) - by_id = {x.message.app_deployment_id: x for x in out} - assert by_id["a"].user_has_write_access is True - assert by_id["b"].user_has_write_access is False - assert by_id["a"].is_owner is False - # One chained WRITE lookup per deployment, keyed on app_deployment_id. - keyed = {c[0]: c[2] for c in client.sharing.calls} - assert keyed == {"a": "WRITE", "b": "WRITE"} - - -class TestListApplicationDeploymentsForModuleAndProfile: - def test_uses_module_profile_facade_and_wraps(self): - from airavata_sdk.helpers.research_resources import ( - list_application_deployments_for_module_and_profile, - ) - d1 = _make_deployment(app_deployment_id="a") - research = _FakeDeploymentResearch(deployments=[d1]) - client = _FakeDeploymentClient(research, sharing_has_access=True) - out = list_application_deployments_for_module_and_profile( - client, "mod-1", "grp-1") - assert research.module_profile_args == ("mod-1", "grp-1") - assert isinstance(out[0], WithAccess) - assert out[0].message.app_deployment_id == "a" - assert out[0].user_has_write_access is True - - -class TestCreateUpdateDeleteApplicationDeployment: - def test_create_registers_and_refetches_with_access(self): - from airavata_sdk.helpers.research_resources import ( - create_application_deployment, - ) - created = _make_deployment(app_deployment_id="dep-new", app_module_id="m") - research = _FakeDeploymentResearch(deployment=created) - client = _FakeDeploymentClient(research) - out = create_application_deployment( - client, {"app_module_id": "m"}, has_write=True) - assert research.registered is not None - assert isinstance(out, WithAccess) - assert out.message.app_deployment_id == "dep-new" - assert out.is_owner is False - # has_write is forwarded, not chained, for the freshly created record. - assert out.user_has_write_access is True - assert client.sharing.calls == [] - - def test_update_forces_id_and_returns_with_access(self): - from airavata_sdk.helpers.research_resources import ( - update_application_deployment, - ) - existing = _make_deployment(app_deployment_id="dep-1", app_module_id="m") - research = _FakeDeploymentResearch(deployment=existing) - client = _FakeDeploymentClient(research) - out = update_application_deployment( - client, "dep-1", {"app_module_id": "m2"}, has_write=False) - sent_id, sent_pb = research.updated - assert sent_id == "dep-1" - assert sent_pb.app_deployment_id == "dep-1" - assert isinstance(out, WithAccess) - assert out.user_has_write_access is False - - def test_delete_calls_facade(self): - from airavata_sdk.helpers.research_resources import ( - delete_application_deployment, - ) - research = _FakeDeploymentResearch() - client = _FakeDeploymentClient(research) - delete_application_deployment(client, "dep-x") - assert research.deleted == "dep-x" - - -# =========================================================================== -# Experiment (experiments-core) -# =========================================================================== - -def _make_experiment(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.experiment import ( - experiment_pb2, - ) - return experiment_pb2.ExperimentModel(**kwargs) - - -def _make_job(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.job import job_pb2 - return job_pb2.JobModel(**kwargs) - - -class _FakeExpCoreResearch: - def __init__(self, experiment=None, jobs=None, experiments=None): - self._experiment = experiment - self._jobs = jobs or [] - self._experiments = experiments or [] - self.created = None - self.created_gateway_id = None - self.updated = None - - def get_experiment(self, experiment_id): - return self._experiment - - def get_experiments_in_project(self, project_id, limit=-1, offset=0): - self.in_project_args = (project_id, limit, offset) - return self._experiments - - def get_job_details(self, experiment_id): - return self._jobs - - def create_experiment(self, gateway_id, experiment): - self.created = experiment - self.created_gateway_id = gateway_id - return "new-exp-id" - - def update_experiment(self, experiment_id, experiment): - self.updated = (experiment_id, experiment) - - -class _FakeExpCoreSharing: - def __init__(self, has_access=True): - self._has_access = has_access - self.calls = [] - - def user_has_access(self, resource_id, user_id, permission_type): - self.calls.append((resource_id, user_id, permission_type)) - return self._has_access - - -class _FakeExpCoreClient: - def __init__(self, research, gateway_id="gw1", username="alice", - sharing_has_access=True): - self.research = research - self.sharing = _FakeExpCoreSharing(sharing_has_access) - self.gateway_id = gateway_id - self.username = username - - - - -class TestGetExperiment: - """``get_experiment`` returns ``WithAccess[ExperimentModel]``: the raw proto - (the whole tree flows through wholesale for the renderer to serialize), with - ``is_owner`` trivially ``False`` and ``user_has_write_access`` a chained - sharing WRITE lookup keyed on ``experiment_id``.""" - - def _client(self, sharing_has_access=True): - e = _make_experiment(experiment_id="exp-1", experiment_name="E") - return _FakeExpCoreClient( - _FakeExpCoreResearch(experiment=e), - sharing_has_access=sharing_has_access) - - def test_returns_with_access_container(self): - from airavata_sdk.helpers.research_resources import get_experiment - result = get_experiment(self._client(), "exp-1") - assert isinstance(result, WithAccess) - - def test_message_is_the_proto(self): - from airavata_sdk.generated.org.apache.airavata.model.experiment import ( - experiment_pb2, - ) - from airavata_sdk.helpers.research_resources import get_experiment - result = get_experiment(self._client(), "exp-1") - assert isinstance(result.message, experiment_pb2.ExperimentModel) - assert result.message.experiment_id == "exp-1" - assert result.message.experiment_name == "E" - - def test_is_owner_always_false(self): - from airavata_sdk.helpers.research_resources import get_experiment - result = get_experiment(self._client(), "exp-1") - assert result.is_owner is False - - def test_user_has_write_access_true_from_sharing(self): - from airavata_sdk.helpers.research_resources import get_experiment - result = get_experiment( - self._client(sharing_has_access=True), "exp-1") - assert result.user_has_write_access is True - - def test_user_has_write_access_false_from_sharing(self): - from airavata_sdk.helpers.research_resources import get_experiment - result = get_experiment( - self._client(sharing_has_access=False), "exp-1") - assert result.user_has_write_access is False - - def test_sharing_keyed_on_experiment_id(self): - from airavata_sdk.helpers.research_resources import get_experiment - client = self._client() - get_experiment(client, "exp-1") - assert client.sharing.calls == [("exp-1", "alice", "WRITE")] - - -class TestGetExperimentProto: - def test_returns_raw_proto(self): - from airavata_sdk.helpers.research_resources import get_experiment_proto - e = _make_experiment(experiment_id="exp-1", experiment_name="E") - client = _FakeExpCoreClient(_FakeExpCoreResearch(experiment=e)) - result = get_experiment_proto(client, "exp-1") - # The proto message itself is returned, not a WithAccess wrapper. - assert result is e - assert result.experiment_id == "exp-1" - assert result.experiment_name == "E" - - -class TestListExperimentJobs: - def test_returns_raw_job_protos(self): - from airavata_sdk.generated.org.apache.airavata.model.job import job_pb2 - from airavata_sdk.helpers.research_resources import list_experiment_jobs - jobs = [_make_job(job_id="j1"), _make_job(job_id="j2")] - client = _FakeExpCoreClient(_FakeExpCoreResearch(jobs=jobs)) - result = list_experiment_jobs(client, "exp-1") - # Proto-direct: each element is the raw JobModel proto (no transform, no - # sharing wrapper — a job has no ownership concept). - assert all(isinstance(j, job_pb2.JobModel) for j in result) - assert [j.job_id for j in result] == ["j1", "j2"] - - -class TestGetExperimentsInProject: - def test_returns_with_access_with_per_experiment_sharing(self): - from airavata_sdk.helpers.research_resources import ( - get_experiments_in_project, - ) - exps = [_make_experiment(experiment_id="a"), - _make_experiment(experiment_id="b")] - # has_access False only for "b": the fake returns a single value, so use - # a per-id discriminating sharing stub. - client = _FakeExpCoreClient(_FakeExpCoreResearch(experiments=exps)) - - class _PerIdSharing: - calls = [] - - def user_has_access(self, resource_id, user_id, permission_type): - self.calls.append((resource_id, user_id, permission_type)) - return resource_id == "a" - - client.sharing = _PerIdSharing() - result = get_experiments_in_project(client, "proj-1") - assert all(isinstance(r, WithAccess) for r in result) - by_id = { - r.message.experiment_id: r.user_has_write_access for r in result} - assert by_id == {"a": True, "b": False} - # Each experiment triggers its own chained WRITE lookup. - assert client.sharing.calls == [ - ("a", "alice", "WRITE"), ("b", "alice", "WRITE")] - - def test_passes_limit_and_offset(self): - from airavata_sdk.helpers.research_resources import ( - get_experiments_in_project, - ) - research = _FakeExpCoreResearch(experiments=[]) - client = _FakeExpCoreClient(research) - get_experiments_in_project(client, "proj-1", limit=5, offset=10) - assert research.in_project_args == ("proj-1", 5, 10) - - -class TestCreateExperiment: - def test_builds_creates_and_returns_with_access(self): - from airavata_sdk.helpers.research_resources import create_experiment - # The created experiment is re-fetched via get_experiment, so the fake - # research returns it from get_experiment(new-id). - refetched = _make_experiment( - experiment_id="new-exp-id", experiment_name="New", - project_id="proj-1") - research = _FakeExpCoreResearch(experiment=refetched) - client = _FakeExpCoreClient(research) - result = create_experiment( - client, - {"project_id": "proj-1", "experiment_name": "New", - "description": "d"}) - assert isinstance(result, WithAccess) - assert result.message.experiment_id == "new-exp-id" - # The proto sent to create_experiment carried the forced context. - assert research.created.project_id == "proj-1" - assert research.created.gateway_id == "gw1" - assert research.created.user_name == "alice" - assert research.created_gateway_id == "gw1" - - def test_user_configuration_data_built_when_present(self): - from airavata_sdk.helpers.research_resources import create_experiment - research = _FakeExpCoreResearch( - experiment=_make_experiment(experiment_id="new-exp-id")) - client = _FakeExpCoreClient(research) - create_experiment(client, { - "project_id": "p", "experiment_name": "E", - "user_configuration_data": { - "airavata_auto_schedule": True, - "computational_resource_scheduling": { - "resource_host_id": "h", "total_cpu_count": 4}}}) - ucd = research.created.user_configuration_data - assert ucd.airavata_auto_schedule is True - assert ucd.computational_resource_scheduling.total_cpu_count == 4 - - -class TestUpdateExperiment: - def test_pushes_with_forced_id_and_returns_with_access(self): - from airavata_sdk.helpers.research_resources import update_experiment - refetched = _make_experiment( - experiment_id="exp-9", experiment_name="Updated") - research = _FakeExpCoreResearch(experiment=refetched) - client = _FakeExpCoreClient(research) - result = update_experiment( - client, "exp-9", {"experiment_name": "Updated"}) - sent_id, sent_pb = research.updated - assert sent_id == "exp-9" - assert sent_pb.experiment_id == "exp-9" - assert sent_pb.experiment_name == "Updated" - assert isinstance(result, WithAccess) - assert result.message.experiment_id == "exp-9" - - -class TestExperimentTypeInt: - def test_thrift_int_round_trip(self): - from airavata_sdk.helpers.research_resources import _experiment_type_int - # Thrift 0 -> proto SINGLE_APPLICATION (1), Thrift 1 -> WORKFLOW (2). - assert _experiment_type_int(0) == 1 - assert _experiment_type_int(1) == 2 - - def test_name_string_accepted(self): - from airavata_sdk.helpers.research_resources import _experiment_type_int - assert _experiment_type_int("SINGLE_APPLICATION") == 1 - assert _experiment_type_int("WORKFLOW") == 2 - - def test_none_maps_to_zero(self): - from airavata_sdk.helpers.research_resources import _experiment_type_int - assert _experiment_type_int(None) == 0 - assert _experiment_type_int("") == 0 - - -# --------------------------------------------------------------------------- -# FullExperiment -# --------------------------------------------------------------------------- - -def _make_full_input(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.application.io import ( - application_io_pb2 as io, - ) - return io.InputDataObjectType(**kwargs) - - -def _make_full_output(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.application.io import ( - application_io_pb2 as io, - ) - return io.OutputDataObjectType(**kwargs) - - -def _make_full_data_product(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.data.replica import ( - replica_catalog_pb2, - ) - return replica_catalog_pb2.DataProductModel(**kwargs) - - -def _make_app_interface(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.appinterface import ( # noqa: E501 - app_interface_pb2, - ) - return app_interface_pb2.ApplicationInterfaceDescription(**kwargs) - - -def _make_compute_resource(**kwargs): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.computeresource import ( # noqa: E501 - compute_resource_pb2, - ) - return compute_resource_pb2.ComputeResourceDescription(**kwargs) - - -def _dp_write(_dp): - """Stub per-data-product write resolver (the ViewSet supplies one).""" - return True - - -def _output_views(_experiment, _app_interface): - return {} - - -class TestCollectDataProductUris: - def test_single_uri_types_collected(self): - from airavata_sdk.helpers.research_resources import ( - _collect_data_product_uris, - ) - from airavata_sdk.generated.org.apache.airavata.model.application.io import ( # noqa: E501 - application_io_pb2 as io, - ) - outs = [ - _make_full_output(name="o1", value="airavata-dp://1", type=io.DataType.URI), - _make_full_output(name="o2", value="airavata-dp://2", - type=io.DataType.STDOUT), - # not a dp uri -> skipped - _make_full_output(name="o3", value="plain.txt", type=io.DataType.URI), - ] - assert _collect_data_product_uris(outs) == [ - "airavata-dp://1", "airavata-dp://2"] - - def test_uri_collection_expanded_after_singles(self): - from airavata_sdk.helpers.research_resources import ( - _collect_data_product_uris, - ) - from airavata_sdk.generated.org.apache.airavata.model.application.io import ( # noqa: E501 - application_io_pb2 as io, - ) - items = [ - _make_full_output(name="a", value="airavata-dp://single", - type=io.DataType.URI), - _make_full_output(name="b", - value="airavata-dp://x,airavata-dp://y", - type=io.DataType.URI_COLLECTION), - ] - assert _collect_data_product_uris(items) == [ - "airavata-dp://single", "airavata-dp://x", "airavata-dp://y"] - - -class _FakeFullResearch: - def __init__(self, *, experiment, project=None, app_interface=None, - app_module=None, data_products=None, jobs=None): - self._experiment = experiment - self._project = project - self._app_interface = app_interface - self._app_module = app_module - self._data_products = data_products or {} - self._jobs = jobs or [] - - def get_experiment(self, experiment_id): - return self._experiment - - def get_data_product(self, uri): - return self._data_products[uri] - - def get_application_interface(self, app_interface_id): - if self._app_interface is None: - raise RuntimeError("no app interface") - return self._app_interface - - def get_application_module(self, app_module_id): - return self._app_module - - def get_project(self, project_id): - return self._project - - def get_job_details(self, experiment_id): - return self._jobs - - -class _FakeCompute: - def __init__(self, compute_resource=None): - self._compute_resource = compute_resource - - def get_compute_resource(self, compute_resource_id): - if self._compute_resource is None: - raise RuntimeError("no compute resource") - return self._compute_resource - - -class _FakeFullClient: - def __init__(self, research, compute=None, gateway_id="gw1", - username="alice"): - self.research = research - self.compute = compute or _FakeCompute() - self.gateway_id = gateway_id - self.username = username - self.sharing = _FakeSharing(True) - - -# --------------------------------------------------------------------------- -# FullExperiment — proto-direct composed pydantic shape -# --------------------------------------------------------------------------- -# -# ``get_full_experiment`` returns a :class:`FullExperiment` pydantic model whose -# fields carry the component protos / ``WithAccess`` envelopes WHOLESALE: the -# experiment is ``WithAccess[ExperimentModel]``, the project (when readable) is -# ``WithAccess[Project]``, the application module (when resolvable) is -# ``WithAccess[ApplicationModule]``, the compute resource is the raw -# ``ComputeResourceDescription`` proto, the input/output data products are -# ``WithAccess[DataProductModel]`` and the jobs are raw ``JobModel`` protos. The -# portal renderer flattens the whole tree; these tests assert on the OBJECTS -# (no dict literals) — the JSON shape is pinned by the portal contract snapshot. - - -class TestGetFullExperiment: - def _wire(self, *, with_refs=True): - from airavata_sdk.generated.org.apache.airavata.model.application.io import ( # noqa: E501 - application_io_pb2 as io, - ) - from airavata_sdk.generated.org.apache.airavata.model.experiment import ( - experiment_pb2, - ) - from airavata_sdk.generated.org.apache.airavata.model.scheduling import ( - scheduling_pb2, - ) - ucd = experiment_pb2.UserConfigurationDataModel( - computational_resource_scheduling=( - scheduling_pb2.ComputationalResourceSchedulingModel( - resource_host_id="comp-1"))) - e = _make_experiment( - experiment_id="exp-1", project_id="proj-1", gateway_id="gw1", - user_name="alice", experiment_name="E", execution_id="iface-1", - experiment_inputs=[ - _make_full_input(name="in", value="airavata-dp://i", - type=io.DataType.URI)], - experiment_outputs=[ - _make_full_output(name="out", value="airavata-dp://o", - type=io.DataType.URI)], - user_configuration_data=ucd, - ) - ai = _make_app_interface( - application_interface_id="iface-1", - application_modules=["mod-1"]) if with_refs else None - module = _make_app_module( - app_module_id="mod-1", app_module_name="mod") if with_refs else None - compute = _make_compute_resource( - compute_resource_id="comp-1", - host_name="hpc") if with_refs else None - project = _make_project(project_id="proj-1", owner="alice") - jobs = [_make_job(job_id="j1")] - data_products = { - "airavata-dp://i": _make_full_data_product( - product_uri="airavata-dp://i", owner_name="alice"), - "airavata-dp://o": _make_full_data_product( - product_uri="airavata-dp://o", owner_name="bob"), - } - research = _FakeFullResearch( - experiment=e, project=project, app_interface=ai, app_module=module, - data_products=data_products, jobs=jobs) - client = _FakeFullClient(research, compute=_FakeCompute(compute)) - return client - - def _call(self, client, **overrides): - from airavata_sdk.helpers.research_resources import get_full_experiment - kwargs = dict( - project_has_read=True, - module_has_write=True, - data_product_write_fn=_dp_write, - output_views_fn=_output_views, - ) - kwargs.update(overrides) - return get_full_experiment(client, "exp-1", **kwargs) - - # ------------------------------------------------------------------ - # Composed pydantic shape - # ------------------------------------------------------------------ - - def test_returns_full_experiment_model(self): - from airavata_sdk.helpers.research_resources import FullExperiment - fe = self._call(self._wire(with_refs=True)) - assert isinstance(fe, FullExperiment) - assert fe.experiment_id == "exp-1" - - def test_experiment_is_with_access_carrying_proto(self): - from airavata_sdk.generated.org.apache.airavata.model.experiment import ( - experiment_pb2, - ) - fe = self._call(self._wire(with_refs=True)) - assert isinstance(fe.experiment, WithAccess) - assert isinstance(fe.experiment.message, experiment_pb2.ExperimentModel) - assert fe.experiment.message.experiment_id == "exp-1" - # WRITE comes from the chained sharing call (stub returns True). - assert fe.experiment.user_has_write_access is True - - def test_project_is_with_access_carrying_proto(self): - from airavata_sdk.generated.org.apache.airavata.model.workspace import ( - workspace_pb2, - ) - fe = self._call(self._wire(with_refs=True)) - assert isinstance(fe.project, WithAccess) - assert isinstance(fe.project.message, workspace_pb2.Project) - assert fe.project.message.project_id == "proj-1" - # is_owner SDK-trivial: project.owner == client.username ("alice"). - assert fe.project.is_owner is True - assert fe.project.user_has_write_access is True - - def test_application_module_is_with_access_carrying_proto(self): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.appdeployment import ( # noqa: E501 - app_deployment_pb2, - ) - fe = self._call(self._wire(with_refs=True)) - assert isinstance(fe.application_module, WithAccess) - assert isinstance( - fe.application_module.message, - app_deployment_pb2.ApplicationModule) - assert fe.application_module.message.app_module_id == "mod-1" - # gateway-catalog: no ownership, write flag is module_has_write. - assert fe.application_module.is_owner is False - assert fe.application_module.user_has_write_access is True - - def test_compute_resource_is_raw_proto(self): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.computeresource import ( # noqa: E501 - compute_resource_pb2, - ) - fe = self._call(self._wire(with_refs=True)) - assert isinstance( - fe.compute_resource, - compute_resource_pb2.ComputeResourceDescription) - assert fe.compute_resource.compute_resource_id == "comp-1" - - def test_data_products_are_with_access_carrying_protos(self): - from airavata_sdk.generated.org.apache.airavata.model.data.replica import ( - replica_catalog_pb2, - ) - fe = self._call(self._wire(with_refs=True)) - assert [w.message.product_uri for w in fe.input_data_products] == [ - "airavata-dp://i"] - assert [w.message.product_uri for w in fe.output_data_products] == [ - "airavata-dp://o"] - for w in fe.input_data_products + fe.output_data_products: - assert isinstance(w, WithAccess) - assert isinstance(w.message, replica_catalog_pb2.DataProductModel) - # write flag is the resolver result (stub returns True). - assert w.user_has_write_access is True - # is_owner SDK-trivial: owner_name == client.username ("alice"). - assert fe.input_data_products[0].is_owner is True # owner_name="alice" - assert fe.output_data_products[0].is_owner is False # owner_name="bob" - - def test_jobs_are_raw_protos(self): - from airavata_sdk.generated.org.apache.airavata.model.job import job_pb2 - fe = self._call(self._wire(with_refs=True)) - assert [j.job_id for j in fe.job_details] == ["j1"] - assert all(isinstance(j, job_pb2.JobModel) for j in fe.job_details) - - def test_output_views_passed_through(self): - def _views(_e, _ai): - return {"out": ["plugin-a"]} - fe = self._call(self._wire(with_refs=True), output_views_fn=_views) - assert fe.output_views == {"out": ["plugin-a"]} - - # ------------------------------------------------------------------ - # Optional references - # ------------------------------------------------------------------ - - def test_project_omitted_without_read(self): - fe = self._call(self._wire(with_refs=True), project_has_read=False) - assert fe.project is None - - def test_unresolvable_references_become_none(self): - # No app interface (raises) and no compute resource (raises) -> both None, - # swallowed exactly like the old view's broad try/except. - fe = self._call(self._wire(with_refs=False), module_has_write=False) - assert fe.application_module is None - assert fe.compute_resource is None - # Data products + jobs still resolve. - assert len(fe.input_data_products) == 1 - assert len(fe.output_data_products) == 1 - - def test_data_product_write_resolver_invoked_per_product(self): - seen = [] - - def _write(dp): - seen.append(dp.product_uri) - return dp.product_uri.endswith("o") - - fe = self._call(self._wire(with_refs=True), data_product_write_fn=_write) - # Both products resolved (outputs first, then inputs). - assert set(seen) == {"airavata-dp://i", "airavata-dp://o"} - assert fe.input_data_products[0].user_has_write_access is False - assert fe.output_data_products[0].user_has_write_access is True diff --git a/airavata-python-sdk/tests/helpers/test_sharing_resources.py b/airavata-python-sdk/tests/helpers/test_sharing_resources.py deleted file mode 100644 index 81630153d9b..00000000000 --- a/airavata-python-sdk/tests/helpers/test_sharing_resources.py +++ /dev/null @@ -1,573 +0,0 @@ -"""Unit tests for airavata_sdk.helpers.sharing_resources. - -The **groups** family is proto-direct: ``get_group`` / ``list_groups`` / -``create_group`` / ``update_group`` return the raw ``GroupModel`` proto wrapped -in a :class:`WithGroupAccess` envelope (proto under ``.message`` + the six -computed access booleans). Tests assert the proto flows through untouched and -the chained flag-computing calls are made with the right arguments. - -The **shared-entities** family is also proto-direct: ``get_shared_entity`` / -``get_all_shared_entity`` return a composed pydantic :class:`SharedEntity` that -carries the underlying ``UserProfile`` protos and per-group -:class:`WithGroupAccess` envelopes WHOLESALE, with ``permission_type`` as the -permission member NAME string. Tests assert the protos / envelopes flow through -untouched and the orchestration fires the right chained calls. - -Orchestration functions are tested via lightweight stub clients that record the -calls made. -""" - -from airavata_sdk.generated.org.apache.airavata.model.group import ( - group_manager_pb2 as gm_pb2, -) -from airavata_sdk.generated.org.apache.airavata.model.user import ( - user_profile_pb2 as up_pb2, -) -from airavata_sdk.helpers._envelope import WithGroupAccess -from airavata_sdk.helpers.sharing_resources import ( - GroupPermission, - SharedEntity, - UserPermission, - _build_group, - _compute_revokes_and_grants, - _group_flags, - _member_admin_diff, - _user_at_gateway, - _username_from_internal_id, - apply_sharing_update, - compute_sharing_deltas, - create_group, - delete_group, - get_all_shared_entity, - get_group, - get_shared_entity, - list_groups, - update_group, -) - - -# --------------------------------------------------------------------------- -# Test data -# --------------------------------------------------------------------------- - -def _group( - id="g1", - name="Group One", - owner_id="alice@default", - description="A test group", - members=None, - admins=None, -): - return gm_pb2.GroupModel( - id=id, - name=name, - owner_id=owner_id, - description=description, - members=members if members is not None else ["alice@default"], - admins=admins if admins is not None else ["alice@default"], - ) - - -# --------------------------------------------------------------------------- -# Stub client -# --------------------------------------------------------------------------- - -class _GatewayGroups: - def __init__(self): - self.admins_group_id = "admins-grp" - self.read_only_admins_group_id = "ro-admins-grp" - self.default_gateway_users_group_id = "default-users-grp" - - -class _FakeSharing: - def __init__(self, groups=None, admin_access=True): - self._groups = groups or [] - self._admin_access = admin_access - self.calls = [] - - def gm_get_groups(self): - self.calls.append(("gm_get_groups",)) - return list(self._groups) - - def gm_get_group(self, group_id): - self.calls.append(("gm_get_group", group_id)) - for g in self._groups: - if g.id == group_id: - return g - return self._groups[0] if self._groups else _group(id=group_id) - - def gm_has_admin_access(self, group_id, admin_id): - self.calls.append(("gm_has_admin_access", group_id, admin_id)) - return self._admin_access - - def gm_create_group(self, group): - self.calls.append(("gm_create_group", group)) - return "new-group-id" - - def gm_update_group(self, group): - self.calls.append(("gm_update_group", group)) - - def gm_delete_group(self, group_id, owner_id): - self.calls.append(("gm_delete_group", group_id, owner_id)) - - def gm_add_users_to_group(self, user_ids, group_id): - self.calls.append(("gm_add_users_to_group", list(user_ids), group_id)) - - def gm_remove_users_from_group(self, user_ids, group_id): - self.calls.append( - ("gm_remove_users_from_group", list(user_ids), group_id)) - - def gm_add_group_admins(self, group_id, admin_ids): - self.calls.append(("gm_add_group_admins", group_id, list(admin_ids))) - - def gm_remove_group_admins(self, group_id, admin_ids): - self.calls.append(("gm_remove_group_admins", group_id, list(admin_ids))) - - -class _FakeCompute: - def __init__(self): - self.calls = 0 - - def get_gateway_groups(self): - self.calls += 1 - return _GatewayGroups() - - -class _FakeClient: - def __init__(self, groups=None, admin_access=True, - username="alice", gateway_id="default"): - self.sharing = _FakeSharing(groups, admin_access) - self.compute = _FakeCompute() - self.username = username - self.gateway_id = gateway_id - - -# --------------------------------------------------------------------------- -# Context helpers -# --------------------------------------------------------------------------- - -class TestContextHelpers: - def test_user_at_gateway(self): - c = _FakeClient(username="bob", gateway_id="gw1") - assert _user_at_gateway(c) == "bob@gw1" - - def test_group_flags_owner_member_admin(self): - c = _FakeClient(groups=[_group()]) - g = _group(owner_id="alice@default", members=["alice@default"]) - flags = _group_flags(c, g) - assert flags["is_admin"] is True - assert flags["is_owner"] is True - assert flags["is_member"] is True - assert flags["is_gateway_admins_group"] is False - - def test_group_flags_gateway_admins_group(self): - c = _FakeClient(admin_access=False) - g = _group(id="admins-grp", owner_id="someoneelse@default", members=[]) - flags = _group_flags(c, g) - assert flags["is_admin"] is False - assert flags["is_owner"] is False - assert flags["is_member"] is False - assert flags["is_gateway_admins_group"] is True - - def test_group_flags_reuses_passed_gateway_groups(self): - c = _FakeClient() - gg = { - "admins_group_id": "x", - "read_only_admins_group_id": "y", - "default_gateway_users_group_id": "z", - } - _group_flags(c, _group(), gateway_groups=gg) - # No GetGatewayGroups RPC when caller supplies the map. - assert c.compute.calls == 0 - - -# --------------------------------------------------------------------------- -# Read orchestration -# --------------------------------------------------------------------------- - -class TestGetGroup: - def test_returns_with_group_access(self): - g = _group(id="g1") - result = get_group(_FakeClient(groups=[g]), "g1") - # proto-direct: the raw GroupModel flows through under .message - assert isinstance(result, WithGroupAccess) - assert result.message is g - assert result.message.id == "g1" - # the six computed flags are carried alongside the proto - assert result.is_owner is True - assert result.is_member is True - assert result.is_admin is True - assert result.is_gateway_admins_group is False - assert result.is_read_only_gateway_admins_group is False - assert result.is_default_gateway_users_group is False - - -class TestListGroups: - def test_returns_list_of_with_group_access(self): - g1 = _group(id="g1") - g2 = _group(id="g2") - result = list_groups(_FakeClient(groups=[g1, g2])) - assert all(isinstance(r, WithGroupAccess) for r in result) - assert [r.message.id for r in result] == ["g1", "g2"] - # the protos are passed through wholesale, not copied - assert result[0].message is g1 - assert result[1].message is g2 - - def test_offset_limit_slicing(self): - groups = [_group(id=f"g{i}") for i in range(5)] - result = list_groups(_FakeClient(groups=groups), limit=2, offset=1) - assert [r.message.id for r in result] == ["g1", "g2"] - - def test_gateway_groups_fetched_once(self): - groups = [_group(id=f"g{i}") for i in range(3)] - c = _FakeClient(groups=groups) - list_groups(c) - assert c.compute.calls == 1 - - -# --------------------------------------------------------------------------- -# Write orchestration -# --------------------------------------------------------------------------- - -class TestBuildGroup: - def test_forces_owner_from_client(self): - c = _FakeClient(username="bob", gateway_id="gw1") - g = _build_group(c, {"name": "N", "description": "D", - "members": ["x@gw1"], "admins": ["x@gw1"]}) - assert g.owner_id == "bob@gw1" - assert g.name == "N" - assert g.description == "D" - assert list(g.members) == ["x@gw1"] - assert list(g.admins) == ["x@gw1"] - - def test_defaults(self): - c = _FakeClient(username="bob", gateway_id="gw1") - g = _build_group(c, {}) - assert g.name == "" - assert g.description == "" - assert list(g.members) == [] - assert list(g.admins) == [] - - -class TestCreateGroup: - def test_assigns_id_and_returns_tuple(self): - c = _FakeClient() - result, proto, added = create_group( - c, {"name": "N", "members": ["alice@default", "bob@default"]}) - assert proto.id == "new-group-id" - # the read shape is a WithGroupAccess wrapping the same proto - assert isinstance(result, WithGroupAccess) - assert result.message is proto - assert result.message.id == "new-group-id" - # added members exclude the owner - assert "bob@default" in added - assert c.sharing.calls[0][0] == "gm_create_group" - - -class TestMemberAdminDiff: - def test_added_and_removed_members(self): - existing = _group(members=["a@gw", "b@gw"], admins=[]) - diff = _member_admin_diff(existing, {"members": ["b@gw", "c@gw"]}) - assert set(diff["added_members"]) == {"c@gw"} - assert set(diff["removed_members"]) == {"a@gw"} - - def test_admin_not_member_added_to_members(self): - existing = _group(members=["a@gw"], admins=[]) - diff = _member_admin_diff( - existing, {"members": ["a@gw"], "admins": ["d@gw"]}) - assert "d@gw" in diff["added_admins"] - # admin not in members -> added to members too - assert "d@gw" in diff["added_members"] - assert "d@gw" in diff["members"] - - def test_absent_keys_keep_existing(self): - existing = _group(members=["a@gw"], admins=["a@gw"]) - diff = _member_admin_diff(existing, {}) - assert set(diff["members"]) == {"a@gw"} - assert set(diff["admins"]) == {"a@gw"} - assert diff["added_members"] == [] - assert diff["removed_members"] == [] - - -class TestUpdateGroup: - def test_fires_membership_rpcs(self): - existing = _group(id="g1", members=["a@gw"], admins=["a@gw"]) - c = _FakeClient(groups=[existing]) - result, proto, added = update_group( - c, "g1", - {"name": "Renamed", "members": ["a@gw", "x@gw"]}) - names = [call[0] for call in c.sharing.calls] - assert "gm_add_users_to_group" in names - assert "gm_update_group" in names - assert proto.name == "Renamed" - assert "x@gw" in added - - def test_name_and_description_patched(self): - existing = _group(id="g1", description="old") - c = _FakeClient(groups=[existing]) - result, proto, added = update_group( - c, "g1", {"description": "new"}) - assert proto.description == "new" - # the read shape wraps the patched proto (proto-direct) - assert isinstance(result, WithGroupAccess) - assert result.message is proto - assert result.message.description == "new" - - -class TestDeleteGroup: - def test_uses_owner_id(self): - existing = _group(id="g1", owner_id="alice@default") - c = _FakeClient(groups=[existing]) - delete_group(c, "g1") - assert ("gm_delete_group", "g1", "alice@default") in c.sharing.calls - - -# =========================================================================== -# SharedEntity family -# =========================================================================== - -def _user_profile(user_id="bob@default", first_name="Bob"): - return up_pb2.UserProfile( - airavata_internal_user_id=user_id, - user_id=user_id, - gateway_id="default", - first_name=first_name, - ) - - -class TestUsernameFromInternalId: - def test_strips_gateway(self): - assert _username_from_internal_id("bob@default") == "bob" - - def test_rightmost_at(self): - # rindex picks the last @, so an @ in the username is preserved. - assert _username_from_internal_id("a@b@default") == "a@b" - - -class TestComputeRevokesAndGrants: - def test_grant_read(self): - revokes, grants = _compute_revokes_and_grants(None, "READ") - assert revokes == set() - assert grants == {"READ"} - - def test_grant_write_implies_read(self): - revokes, grants = _compute_revokes_and_grants(None, "WRITE") - assert grants == {"READ", "WRITE"} - - def test_upgrade_read_to_write(self): - revokes, grants = _compute_revokes_and_grants("READ", "WRITE") - assert revokes == set() - assert grants == {"WRITE"} - - def test_downgrade_manage_to_read(self): - revokes, grants = _compute_revokes_and_grants( - "MANAGE_SHARING", "READ") - assert revokes == {"WRITE", "MANAGE_SHARING"} - assert grants == set() - - def test_revoke_all(self): - revokes, grants = _compute_revokes_and_grants("WRITE", None) - assert revokes == {"READ", "WRITE"} - assert grants == set() - - -class TestComputeSharingDeltas: - def test_grant_and_revoke_buckets(self): - existing = {"bob@default": "READ"} - new = {"bob@default": "WRITE", "carol@default": "MANAGE_SHARING"} - deltas = compute_sharing_deltas(existing, new) - assert "bob@default" in deltas["grant"]["WRITE"] - assert "carol@default" in deltas["grant"]["READ"] - assert "carol@default" in deltas["grant"]["WRITE"] - assert "carol@default" in deltas["grant"]["MANAGE_SHARING"] - # bob keeps READ (no revoke for him) - assert deltas["revoke"]["READ"] == [] - - def test_revoke_when_removed(self): - existing = {"bob@default": "WRITE"} - new = {} - deltas = compute_sharing_deltas(existing, new) - assert set(deltas["revoke"]["READ"]) == {"bob@default"} - assert set(deltas["revoke"]["WRITE"]) == {"bob@default"} - - -# --------------------------------------------------------------------------- -# Shared-entity orchestration stubs -# --------------------------------------------------------------------------- - -class _FakeSharingSE: - """Sharing facade stub for shared-entity orchestration tests. - - *direct_users* / *direct_groups* (and the ``accessible`` variants) are - ``{permission_name -> [id, ...]}`` maps. - """ - - def __init__(self, direct_users=None, direct_groups=None, - accessible_users=None, accessible_groups=None, - groups=None, manage_sharing=True): - self._direct_users = direct_users or {} - self._direct_groups = direct_groups or {} - self._accessible_users = accessible_users or {} - self._accessible_groups = accessible_groups or {} - self._groups = {g.id: g for g in (groups or [])} - self._manage_sharing = manage_sharing - self.calls = [] - - def get_all_directly_accessible_users(self, entity_id, name): - return list(self._direct_users.get(name, [])) - - def get_all_directly_accessible_groups(self, entity_id, name): - return list(self._direct_groups.get(name, [])) - - def get_all_accessible_users(self, entity_id, name): - return list(self._accessible_users.get(name, [])) - - def get_all_accessible_groups(self, entity_id, name): - return list(self._accessible_groups.get(name, [])) - - def gm_get_group(self, group_id): - return self._groups.get(group_id, _group(id=group_id)) - - def gm_has_admin_access(self, group_id, admin_id): - return False - - def user_has_access(self, resource_id, user_id, permission_type): - self.calls.append( - ("user_has_access", resource_id, user_id, permission_type)) - return self._manage_sharing - - def share_resource_with_users(self, entity_id, perms): - self.calls.append(("share_users", entity_id, perms)) - - def share_resource_with_groups(self, entity_id, perms): - self.calls.append(("share_groups", entity_id, perms)) - - def revoke_sharing_of_resource_from_users(self, entity_id, perms): - self.calls.append(("revoke_users", entity_id, perms)) - - def revoke_sharing_of_resource_from_groups(self, entity_id, perms): - self.calls.append(("revoke_groups", entity_id, perms)) - - -class _FakeIam: - def __init__(self, profiles=None): - # {username -> UserProfile} - self._profiles = profiles or {} - - def get_user_profile_by_id(self, user_id, gateway_id): - return self._profiles.get( - user_id, _user_profile(user_id=f"{user_id}@{gateway_id}")) - - -class _FakeClientSE: - def __init__(self, sharing, iam, username="alice", gateway_id="default"): - self.sharing = sharing - self.iam = iam - self.username = username - self.gateway_id = gateway_id - - -_GG = { - "admins_group_id": "x", - "read_only_admins_group_id": "y", - "default_gateway_users_group_id": "z", -} - - -class TestGetSharedEntity: - def test_directly_accessible_tree(self): - # owner alice; bob has WRITE; group grp1 has READ - sharing = _FakeSharingSE( - direct_users={ - "READ": ["bob@default", "alice@default"], - "WRITE": ["bob@default"], - "MANAGE_SHARING": [], - "OWNER": ["alice@default"], - }, - direct_groups={ - "READ": ["grp1@default"], - "WRITE": [], - "MANAGE_SHARING": [], - }, - groups=[_group(id="grp1@default", name="G1")], - manage_sharing=True, - ) - bob = _user_profile(user_id="bob@default", first_name="Bob") - alice = _user_profile(user_id="alice@default", first_name="Alice") - iam = _FakeIam(profiles={"alice": alice, "bob": bob}) - c = _FakeClientSE(sharing, iam, username="alice@default") - se = get_shared_entity(c, "ent-1", gateway_groups=_GG) - - # proto-direct composed shape: a pydantic SharedEntity - assert isinstance(se, SharedEntity) - assert se.entity_id == "ent-1" - # owner removed from users list -> only bob remains - assert len(se.user_permissions) == 1 - up = se.user_permissions[0] - assert isinstance(up, UserPermission) - # the raw UserProfile proto flows through wholesale (not copied) - assert up.user is bob - assert up.user.user_id == "bob@default" - # permission_type is the member NAME string - assert up.permission_type == "WRITE" - # owner is the raw UserProfile proto, passed through - assert se.owner is alice - assert se.owner.user_id == "alice@default" - # group permission carries a WithGroupAccess envelope + the NAME - assert len(se.group_permissions) == 1 - gp = se.group_permissions[0] - assert isinstance(gp, GroupPermission) - assert isinstance(gp.group, WithGroupAccess) - assert gp.group.message.id == "grp1@default" - assert gp.permission_type == "READ" - # entity-level flags - assert se.is_owner is True # owner.user_id == client.username - assert se.has_sharing_permission is True - - def test_all_uses_accessible_accessor(self): - sharing = _FakeSharingSE( - accessible_users={ - "READ": ["alice@default", "bob@default"], - "WRITE": [], - "MANAGE_SHARING": [], - "OWNER": ["alice@default"], - }, - accessible_groups={"READ": [], "WRITE": [], "MANAGE_SHARING": []}, - manage_sharing=False, - ) - iam = _FakeIam() - c = _FakeClientSE(sharing, iam, username="alice@default") - se = get_all_shared_entity(c, "ent-2", gateway_groups=_GG) - assert len(se.user_permissions) == 1 - assert se.user_permissions[0].user.user_id == "bob@default" - assert se.user_permissions[0].permission_type == "READ" - assert se.has_sharing_permission is False - - -class TestApplySharingUpdate: - def test_fires_grant_and_revoke_rpcs(self): - sharing = _FakeSharingSE() - iam = _FakeIam() - c = _FakeClientSE(sharing, iam) - apply_sharing_update( - c, "ent-1", - existing_user_permissions={"bob@default": "READ"}, - new_user_permissions={"bob@default": "WRITE"}, # grant - existing_group_permissions={"grp@default": "WRITE"}, - new_group_permissions={}, # revoke - ) - names = [call[0] for call in sharing.calls] - assert "share_users" in names # WRITE granted to bob - assert "revoke_groups" in names # group fully revoked - - def test_noop_when_unchanged(self): - sharing = _FakeSharingSE() - c = _FakeClientSE(sharing, _FakeIam()) - apply_sharing_update( - c, "ent-1", - existing_user_permissions={"bob@default": "WRITE"}, - new_user_permissions={"bob@default": "WRITE"}, - existing_group_permissions={}, - new_group_permissions={}, - ) - assert sharing.calls == [] diff --git a/airavata-python-sdk/tests/helpers/test_storage_resources.py b/airavata-python-sdk/tests/helpers/test_storage_resources.py deleted file mode 100644 index d59bbc82807..00000000000 --- a/airavata-python-sdk/tests/helpers/test_storage_resources.py +++ /dev/null @@ -1,561 +0,0 @@ -"""Unit tests for airavata_sdk.helpers.storage_resources. - -The **storage-resources** family is proto-direct: ``get_storage_resource`` -returns the raw ``StorageResourceDescription`` proto as-is (no transform, no -envelope) and ``list_storage_resource_names`` returns the raw name map. These -tests assert exactly that — the proto identity / fields and the name map — via a -lightweight stub client that records the calls made. - -The OTHER families in the module (per-protocol data movement, user-storage, -data-product download) are still on the legacy ``_x_dict`` + camelize path and -keep their existing transform-level tests below. -""" - -from airavata_sdk.helpers.storage_resources import ( - get_grid_ftp_data_movement, - get_local_data_movement, - get_scp_data_movement, - get_storage_resource, - list_storage_resource_names, -) - - -def _sr_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.appcatalog.storageresource import ( # noqa: E501 - storage_resource_pb2, - ) - return storage_resource_pb2 - - -def _dm_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.data.movement import ( - data_movement_pb2, - ) - return data_movement_pb2 - - -def _make_dmi(**kwargs): - return _dm_pb2().DataMovementInterface(**kwargs) - - -def _make_storage_resource(**kwargs): - return _sr_pb2().StorageResourceDescription(**kwargs) - - -# --------------------------------------------------------------------------- -# Storage-resources family — proto-direct (returns the proto / name map as-is) -# --------------------------------------------------------------------------- - -class _FakeStorage: - def __init__(self, resource=None, names=None): - self._resource = resource - self._names = names or {} - self.requested_id = None - self.list_called = False - - def get_storage_resource(self, storage_resource_id): - self.requested_id = storage_resource_id - return self._resource - - def get_all_storage_resource_names(self): - self.list_called = True - return dict(self._names) - - -class _FakeClient: - def __init__(self, resource=None, names=None, - gateway_id="default", username="alice"): - self.storage = _FakeStorage(resource, names) - self.gateway_id = gateway_id - self.username = username - - -class TestGetStorageResource: - def _full(self): - return _make_storage_resource( - storage_resource_id="store-1", - host_name="store.example.com", - storage_resource_description="desc", - enabled=True, - data_movement_interfaces=[ - _make_dmi( - data_movement_interface_id="dm-1", - data_movement_protocol=_dm_pb2().DataMovementProtocol.SCP, - priority_order=5, - creation_time=1705320000000, - update_time=0, - storage_resource_id="store-1", - ), - ], - creation_time=1705320000000, - update_time=0, - ) - - def test_returns_proto_directly(self): - # Proto-direct: the SDK returns the gRPC message itself, NOT a dict. - sr = self._full() - client = _FakeClient(resource=sr) - out = get_storage_resource(client, "store-1") - assert client.storage.requested_id == "store-1" - assert out is sr - assert isinstance(out, _sr_pb2().StorageResourceDescription) - - def test_proto_fields_intact(self): - client = _FakeClient(resource=self._full()) - out = get_storage_resource(client, "store-1") - assert out.storage_resource_id == "store-1" - assert out.host_name == "store.example.com" - assert out.enabled is True - # Nested interface + enum stay native proto values (rendered to the - # member NAME by the portal's MessageToDict, not a Thrift int here). - assert len(out.data_movement_interfaces) == 1 - dmi = out.data_movement_interfaces[0] - assert dmi.data_movement_protocol == _dm_pb2().DataMovementProtocol.SCP - assert dmi.creation_time == 1705320000000 - - -class TestListStorageResourceNames: - def test_returns_name_map(self): - client = _FakeClient(names={"store-1": "host1", "store-2": "host2"}) - out = list_storage_resource_names(client) - assert client.storage.list_called is True - assert out == {"store-1": "host1", "store-2": "host2"} - - def test_empty(self): - client = _FakeClient(names={}) - assert list_storage_resource_names(client) == {} - - -# =========================================================================== -# Per-protocol data movement (Local / SCP / GridFTP) — proto-direct -# =========================================================================== -# -# Each ``get_*_data_movement`` helper returns the raw facade proto as-is (no -# transform, no envelope): the resources carry no hyperlink / ownership / -# sharing fields, mirroring the per-protocol job-submission family. The portal's -# MessageToDict renders ``security_protocol`` to the member NAME, not a Thrift -# int — that is the portal contract test's concern, not these unit tests. - -class _FakeDmStorage: - def __init__(self, local=None, scp=None, grid_ftp=None): - self._local = local - self._scp = scp - self._grid_ftp = grid_ftp - self.requested_id = None - - def get_local_data_movement(self, data_movement_id): - self.requested_id = data_movement_id - return self._local - - def get_scp_data_movement(self, data_movement_id): - self.requested_id = data_movement_id - return self._scp - - def get_grid_ftp_data_movement(self, data_movement_id): - self.requested_id = data_movement_id - return self._grid_ftp - - -class _FakeDmClient: - def __init__(self, **kwargs): - self.storage = _FakeDmStorage(**kwargs) - - -class TestDataMovementProtoDirect: - def test_get_local_returns_proto_directly(self): - # Proto-direct: the SDK returns the gRPC message itself, NOT a dict. - local = _dm_pb2().LOCALDataMovement(data_movement_interface_id="l-1") - client = _FakeDmClient(local=local) - out = get_local_data_movement(client, "l-1") - assert client.storage.requested_id == "l-1" - assert out is local - assert isinstance(out, _dm_pb2().LOCALDataMovement) - assert out.data_movement_interface_id == "l-1" - - def test_get_scp_returns_proto_directly(self): - scp = _dm_pb2().SCPDataMovement( - data_movement_interface_id="scp-1", - security_protocol=_dm_pb2().SecurityProtocol.SSH_KEYS, - alternative_scp_host_name="alt.host", - ssh_port=2222, - ) - client = _FakeDmClient(scp=scp) - out = get_scp_data_movement(client, "scp-1") - assert client.storage.requested_id == "scp-1" - assert out is scp - assert isinstance(out, _dm_pb2().SCPDataMovement) - assert out.data_movement_interface_id == "scp-1" - assert out.alternative_scp_host_name == "alt.host" - assert out.ssh_port == 2222 - # The enum stays a native proto value (rendered to the member NAME by - # the portal's MessageToDict, not a Thrift int here). - assert out.security_protocol == _dm_pb2().SecurityProtocol.SSH_KEYS - - def test_get_grid_ftp_returns_proto_directly(self): - grid_ftp = _dm_pb2().GridFTPDataMovement( - data_movement_interface_id="g-1", - security_protocol=_dm_pb2().SecurityProtocol.GSI, - grid_ftp_end_points=["ep1", "ep2"], - ) - client = _FakeDmClient(grid_ftp=grid_ftp) - out = get_grid_ftp_data_movement(client, "g-1") - assert client.storage.requested_id == "g-1" - assert out is grid_ftp - assert isinstance(out, _dm_pb2().GridFTPDataMovement) - assert list(out.grid_ftp_end_points) == ["ep1", "ep2"] - assert out.security_protocol == _dm_pb2().SecurityProtocol.GSI - - -# =========================================================================== -# User-storage paths (file/directory listings) — proto-direct -# =========================================================================== -# -# ``get_file_metadata`` returns the raw ``FileMetadataResponse`` proto as-is; -# ``list_dir`` / ``list_experiment_dir`` return the raw ``ListDirResponse`` -# proto as-is (its ``directories`` / ``files`` are each a -# ``FileMetadataResponse``). No ``_x_dict`` transform, no envelope. The -# per-entry path-permission flags (``user_has_write_access`` / ``is_shared_dir``) -# and the experiment-dir relative-path rewrite are portal concerns layered on the -# rendered proto by the ViewSet — the portal contract test pins that shape. - -from airavata_sdk.helpers.storage_resources import ( # noqa: E402 - create_dir, - delete_dir, - delete_file, - dir_exists, - get_file_metadata, - list_dir, - list_experiment_dir, - resolve_user_storage_path, -) - - -def _fs_pb2(): - from airavata_sdk.generated.services import file_service_pb2 - return file_service_pb2 - - -def _make_meta(**kwargs): - return _fs_pb2().FileMetadataResponse(**kwargs) - - -class _FakeUserStorage: - def __init__(self, listing=None, metadata=None, exists=True): - self._listing = listing - self._metadata = metadata - self._exists = exists - self.calls = [] - - def dir_exists(self, path): - self.calls.append(("dir_exists", path)) - return self._exists - - def create_dir(self, path): - self.calls.append(("create_dir", path)) - - def delete_file(self, path): - self.calls.append(("delete_file", path)) - - def delete_dir(self, path): - self.calls.append(("delete_dir", path)) - - def list_dir(self, path): - self.calls.append(("list_dir", path)) - return self._listing - - def get_file_metadata(self, path): - self.calls.append(("get_file_metadata", path)) - return self._metadata - - -class _FakeResearch: - def __init__(self, experiment=None): - self._experiment = experiment - - def get_experiment(self, experiment_id): - return self._experiment - - -class _FakeUsClient: - def __init__(self, storage=None, research=None): - self.storage = storage - self.research = research - - -class _FakeExperiment: - """Minimal proto-like experiment with a data dir.""" - - def __init__(self, data_dir, has_ucd=True): - self._data_dir = data_dir - self._has_ucd = has_ucd - - class _UCD: - experiment_data_dir = data_dir - self.user_configuration_data = _UCD() - - def HasField(self, name): - return self._has_ucd - - -class TestResolveUserStoragePath: - def test_bare_relative(self): - client = _FakeUsClient() - assert resolve_user_storage_path(client, "foo/bar") == "~/foo/bar" - - def test_leading_slash_stripped(self): - client = _FakeUsClient() - assert resolve_user_storage_path(client, "/foo") == "~/foo" - - def test_already_tilde(self): - client = _FakeUsClient() - assert resolve_user_storage_path(client, "~/foo") == "~/foo" - - def test_experiment_relative(self): - client = _FakeUsClient( - research=_FakeResearch( - _FakeExperiment("/data/exp-1"))) - out = resolve_user_storage_path(client, "out.txt", experiment_id="exp-1") - assert out == "/data/exp-1/out.txt" - - def test_experiment_empty_path(self): - client = _FakeUsClient( - research=_FakeResearch(_FakeExperiment("~/data/exp-1"))) - out = resolve_user_storage_path(client, "", experiment_id="exp-1") - assert out == "~/data/exp-1" - - -class TestUserStorageOrchestration: - def test_dir_exists_create_delete(self): - storage = _FakeUserStorage(exists=True) - client = _FakeUsClient(storage=storage) - assert dir_exists(client, "~/p") is True - create_dir(client, "~/p") - delete_file(client, "~/f") - delete_dir(client, "~/p") - assert ("create_dir", "~/p") in storage.calls - assert ("delete_file", "~/f") in storage.calls - assert ("delete_dir", "~/p") in storage.calls - - -class TestGetFileMetadataProtoDirect: - def test_returns_proto_directly(self): - # Proto-direct: the SDK returns the gRPC message itself, NOT a dict. - meta = _make_meta(name="a.txt", path="/home/u/a.txt", size=5, - modified_time=1705320000000, content_type="text/plain", - data_product_uri="airavata-dp://x", is_directory=False) - storage = _FakeUserStorage(metadata=meta) - client = _FakeUsClient(storage=storage) - out = get_file_metadata(client, "~/a.txt") - assert out is meta - assert isinstance(out, _fs_pb2().FileMetadataResponse) - assert ("get_file_metadata", "~/a.txt") in storage.calls - - def test_proto_fields_intact(self): - meta = _make_meta(name="a.txt", path="/home/u/a.txt", size=5, - modified_time=1705320000000, content_type="text/plain", - data_product_uri="airavata-dp://x") - client = _FakeUsClient(storage=_FakeUserStorage(metadata=meta)) - out = get_file_metadata(client, "~/a.txt") - assert out.name == "a.txt" - assert out.path == "/home/u/a.txt" - assert out.size == 5 - assert out.modified_time == 1705320000000 - assert out.content_type == "text/plain" - assert out.data_product_uri == "airavata-dp://x" - assert out.is_directory is False - - -class TestListDirProtoDirect: - def _listing(self): - return _fs_pb2().ListDirResponse( - directories=[_make_meta(name="d", path="/home/u/d", size=0, - is_directory=True)], - files=[_make_meta(name="f.txt", path="/home/u/f.txt", size=2, - modified_time=1705320000000)], - ) - - def test_returns_proto_directly(self): - # Proto-direct: the SDK returns the ListDirResponse message, NOT a dict. - listing = self._listing() - storage = _FakeUserStorage(listing=listing) - client = _FakeUsClient(storage=storage) - out = list_dir(client, "~/") - assert out is listing - assert isinstance(out, _fs_pb2().ListDirResponse) - assert ("list_dir", "~/") in storage.calls - - def test_proto_entries_intact(self): - client = _FakeUsClient(storage=_FakeUserStorage(listing=self._listing())) - out = list_dir(client, "~/") - assert len(out.directories) == 1 - assert out.directories[0].name == "d" - assert out.directories[0].is_directory is True - assert len(out.files) == 1 - assert out.files[0].name == "f.txt" - assert out.files[0].size == 2 - - -class TestListExperimentDirProtoDirect: - def _listing(self): - return _fs_pb2().ListDirResponse( - directories=[_make_meta(name="sub", path="/data/exp/sub", size=0, - is_directory=True)], - files=[_make_meta(name="o.txt", path="/data/exp/o.txt", size=3, - modified_time=1705320000000)], - ) - - def test_returns_proto_directly(self): - listing = self._listing() - storage = _FakeUserStorage(listing=listing) - client = _FakeUsClient(storage=storage) - out = list_experiment_dir(client, "/data/exp") - assert out is listing - assert isinstance(out, _fs_pb2().ListDirResponse) - assert ("list_dir", "/data/exp") in storage.calls - - def test_proto_entries_intact(self): - client = _FakeUsClient(storage=_FakeUserStorage(listing=self._listing())) - out = list_experiment_dir(client, "/data/exp") - assert out.directories[0].path == "/data/exp/sub" - assert out.files[0].name == "o.txt" - - -# =========================================================================== -# Data-product file download (output-view-provider data generation) -# =========================================================================== - -from airavata_sdk.helpers.storage_resources import ( # noqa: E402 - data_product_file_path, - download_data_product_files, - file_exists, -) - - -def _rc_pb2(): - from airavata_sdk.generated.org.apache.airavata.model.data.replica import ( - replica_catalog_pb2, - ) - return replica_catalog_pb2 - - -def _make_data_product(*, replica_paths=None, **kwargs): - rc = _rc_pb2() - replicas = [ - rc.DataReplicaLocationModel(file_path=p) for p in (replica_paths or []) - ] - return rc.DataProductModel(replica_locations=replicas, **kwargs) - - -class TestDataProductFilePath: - def test_no_replicas_is_none(self): - assert data_product_file_path(_make_data_product()) is None - - def test_empty_file_path_is_none(self): - assert data_product_file_path( - _make_data_product(replica_paths=[""])) is None - - def test_absolute_path_passthrough(self): - dp = _make_data_product(replica_paths=["/storage/tmp/out.txt"]) - assert data_product_file_path(dp) == "/storage/tmp/out.txt" - - def test_tilde_path_passthrough(self): - dp = _make_data_product(replica_paths=["~/out.txt"]) - assert data_product_file_path(dp) == "~/out.txt" - - def test_relative_path_is_tilde_prefixed(self): - dp = _make_data_product(replica_paths=["sub/out.txt"]) - assert data_product_file_path(dp) == "~/sub/out.txt" - - def test_first_replica_used(self): - dp = _make_data_product(replica_paths=["/a.txt", "/b.txt"]) - assert data_product_file_path(dp) == "/a.txt" - - -class _FakeDownloadStorage: - def __init__(self, *, existing_paths=None, contents=None, names=None): - self._existing = set(existing_paths or []) - self._contents = contents or {} - self._names = names or {} - self.calls = [] - - def file_exists(self, path): - self.calls.append(("file_exists", path)) - return path in self._existing - - def download_file(self, path): - self.calls.append(("download_file", path)) - resp = _fs_pb2().DownloadFileResponse( - content=self._contents.get(path, b""), - name=self._names.get(path, ""), - ) - return resp - - -class _FakeDownloadResearch: - def __init__(self, products_by_uri=None): - self._products = products_by_uri or {} - self.requested = [] - - def get_data_product(self, uri): - self.requested.append(uri) - return self._products[uri] - - -class _FakeDownloadClient: - def __init__(self, storage=None, research=None): - self.storage = storage - self.research = research - - -class TestFileExists: - def test_delegates_to_facade(self): - storage = _FakeDownloadStorage(existing_paths=["/a.txt"]) - client = _FakeDownloadClient(storage=storage) - assert file_exists(client, "/a.txt") is True - assert file_exists(client, "/missing.txt") is False - assert ("file_exists", "/a.txt") in storage.calls - - -class TestDownloadDataProductFiles: - def test_downloads_existing_files_in_order(self): - dp1 = _make_data_product(replica_paths=["/storage/a.txt"]) - dp2 = _make_data_product(replica_paths=["/storage/b.txt"]) - research = _FakeDownloadResearch({ - "airavata-dp://1": dp1, - "airavata-dp://2": dp2, - }) - storage = _FakeDownloadStorage( - existing_paths=["/storage/a.txt", "/storage/b.txt"], - contents={"/storage/a.txt": b"AAA", "/storage/b.txt": b"BBB"}, - names={"/storage/a.txt": "a.txt"}, - ) - client = _FakeDownloadClient(storage=storage, research=research) - files = download_data_product_files( - client, ["airavata-dp://1", "airavata-dp://2"]) - assert len(files) == 2 - assert files[0].read() == b"AAA" - assert files[0].name == "a.txt" - assert files[1].read() == b"BBB" - # Empty download name falls back to the path basename. - assert files[1].name == "b.txt" - - def test_skips_products_with_no_replica(self): - dp = _make_data_product(replica_paths=[]) - research = _FakeDownloadResearch({"airavata-dp://x": dp}) - storage = _FakeDownloadStorage() - client = _FakeDownloadClient(storage=storage, research=research) - files = download_data_product_files(client, ["airavata-dp://x"]) - assert files == [] - # No file_exists / download_file calls for a product without a replica. - assert storage.calls == [] - - def test_skips_missing_files(self): - dp = _make_data_product(replica_paths=["/storage/gone.txt"]) - research = _FakeDownloadResearch({"airavata-dp://g": dp}) - storage = _FakeDownloadStorage(existing_paths=[]) - client = _FakeDownloadClient(storage=storage, research=research) - files = download_data_product_files(client, ["airavata-dp://g"]) - assert files == [] - assert ("file_exists", "/storage/gone.txt") in storage.calls - # download_file is not attempted when the file does not exist. - assert ("download_file", "/storage/gone.txt") not in storage.calls diff --git a/airavata-python-sdk/tests/test_auth_channel.py b/airavata-python-sdk/tests/test_auth_channel.py new file mode 100644 index 00000000000..7a39adb323d --- /dev/null +++ b/airavata-python-sdk/tests/test_auth_channel.py @@ -0,0 +1,75 @@ +"""Contract for the ``airavata.auth`` authenticated gRPC channel. + +The portal (and any client) wires to the *raw* generated stubs; auth is the one +Python-centric concern that stays. ``authenticated_channel`` returns a channel +that injects ``authorization: Bearer `` on every outbound call via a +client interceptor, so call sites are pure ``stub.Method(request)`` with no +per-call metadata threading. +""" + +from collections import namedtuple + +from airavata.auth.channel import BearerAuthInterceptor + +# Mirror grpc.ClientCallDetails' attribute surface for interceptor unit tests. +_CallDetails = namedtuple( + "_CallDetails", + ("method", "timeout", "metadata", "credentials", "wait_for_ready", "compression"), +) + + +def _details(metadata=None): + return _CallDetails( + method="/svc/Method", + timeout=None, + metadata=metadata, + credentials=None, + wait_for_ready=None, + compression=None, + ) + + +class TestBearerAuthInterceptor: + def test_injects_bearer_authorization_metadata(self): + captured = {} + + def continuation(call_details, request): + captured["metadata"] = list(call_details.metadata) + return "response" + + result = BearerAuthInterceptor("tok123").intercept_unary_unary( + continuation, _details(metadata=None), "req" + ) + + assert result == "response" + assert ("authorization", "Bearer tok123") in captured["metadata"] + + def test_preserves_existing_metadata(self): + captured = {} + + def continuation(call_details, request): + captured["metadata"] = list(call_details.metadata) + return "ok" + + BearerAuthInterceptor("t").intercept_unary_unary( + continuation, _details(metadata=[("x-existing", "y")]), "req" + ) + + assert ("x-existing", "y") in captured["metadata"] + assert ("authorization", "Bearer t") in captured["metadata"] + + def test_applies_to_all_four_call_types(self): + seen = [] + + def continuation(call_details, request): + seen.append(list(call_details.metadata)) + return "r" + + interceptor = BearerAuthInterceptor("tok") + interceptor.intercept_unary_unary(continuation, _details(), "req") + interceptor.intercept_unary_stream(continuation, _details(), "req") + interceptor.intercept_stream_unary(continuation, _details(), iter([])) + interceptor.intercept_stream_stream(continuation, _details(), iter([])) + + assert len(seen) == 4 + assert all(("authorization", "Bearer tok") in md for md in seen) diff --git a/airavata-python-sdk/tests/test_client_username.py b/airavata-python-sdk/tests/test_client_username.py deleted file mode 100644 index 410085270c1..00000000000 --- a/airavata-python-sdk/tests/test_client_username.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Tests for the username property on AiravataClient.""" -from airavata_sdk.client import AiravataClient - - -def _client_with_claims(claims): - """Construct an AiravataClient shell without opening a gRPC channel.""" - c = AiravataClient.__new__(AiravataClient) - c.claims = claims - return c - - -def test_username_returns_value_from_claims(): - c = _client_with_claims({"gatewayID": "default", "userName": "default-admin"}) - assert AiravataClient.username.fget(c) == "default-admin" - - -def test_username_none_when_key_missing(): - c = _client_with_claims({"gatewayID": "default"}) - assert AiravataClient.username.fget(c) is None - - -def test_username_none_when_claims_none(): - c = _client_with_claims(None) - assert AiravataClient.username.fget(c) is None - - -def test_username_none_when_claims_empty(): - c = _client_with_claims({}) - assert AiravataClient.username.fget(c) is None diff --git a/airavata-python-sdk/tests/test_experiments_gridsearch_wiring.py b/airavata-python-sdk/tests/test_experiments_gridsearch_wiring.py new file mode 100644 index 00000000000..c1568e4bb6e --- /dev/null +++ b/airavata-python-sdk/tests/test_experiments_gridsearch_wiring.py @@ -0,0 +1,228 @@ +# 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. +# + +"""Wiring tests for the ExperimentSetService gRPC client methods in ``_apiserver``. + +These tests assert that: + - the ``_experiment_set`` stub is built from the same authenticated_channel + - ``create_experiment_set`` routes to ``ExperimentSetServiceStub.CreateExperimentSet`` + with the prebuilt ``CreateExperimentSetRequest`` passed through unchanged + - ``launch_experiment_set`` builds a ``LaunchExperimentSetRequest`` with the right fields + - ``get_experiment_set`` builds a ``GetExperimentSetRequest`` with the right set_id + - ``get_experiment_set_status`` builds a ``GetExperimentSetRequest`` (same shape) and + routes to ``GetExperimentSetStatus`` + - ``list_experiment_sets`` builds a ``ListExperimentSetsRequest`` with limit/offset + +No live server is needed; all stubs are mocked. +""" + +from unittest import mock + +from airavata.services import ( + experiment_service_pb2, + experiment_set_service_pb2, + experiment_set_service_pb2_grpc, +) + +from airavata.experiments._apiserver import APIServerClient + + +def _client(): + return APIServerClient(access_token="test-token") + + +# ----------------------------------------------------------------- stub wiring + +def test_experiment_set_stub_is_built(): + c = _client() + assert hasattr(c, "_experiment_set"), "_experiment_set stub not built" + assert isinstance(c._experiment_set, experiment_set_service_pb2_grpc.ExperimentSetServiceStub) + + +# --------------------------------------------------- create_experiment_set + +def test_create_experiment_set_routes_to_stub(): + c = _client() + c._experiment_set = mock.Mock() + + req = experiment_set_service_pb2.CreateExperimentSetRequest( + set_name="my-sweep", + sweep=experiment_set_service_pb2.SweepSpec( + base=experiment_service_pb2.ExperimentSpec( + experiment_name="sweep-base", + project_id="proj-1", + application_interface_id="iface-1", + inputs={"param_a": "1.0"}, + resource=experiment_service_pb2.ResourceSpec( + compute_resource_id="cr-1", + group_resource_profile_id="grp-1", + node_count=1, + total_cpu_count=4, + queue_name="normal", + wall_time_limit=60, + ), + ), + sweep_axes={"param_a": experiment_set_service_pb2.ValueList(values=["1.0", "2.0", "3.0"])}, + name_prefix="sweep-base", + ), + ) + + c.create_experiment_set(req) + + c._experiment_set.CreateExperimentSet.assert_called_once() + (passed_req,), _ = c._experiment_set.CreateExperimentSet.call_args + # the wrapper passes the request through unchanged + assert passed_req is req + assert passed_req.set_name == "my-sweep" + assert passed_req.sweep.sweep_axes["param_a"].values[:] == ["1.0", "2.0", "3.0"] + assert passed_req.sweep.base.inputs["param_a"] == "1.0" + assert passed_req.sweep.base.resource.compute_resource_id == "cr-1" + + +# --------------------------------------------------- launch_experiment_set + +def test_launch_experiment_set_builds_request(): + c = _client() + c._experiment_set = mock.Mock() + + c.launch_experiment_set("set-42", notification_email="user@example.com") + + c._experiment_set.LaunchExperimentSet.assert_called_once() + (req,), _ = c._experiment_set.LaunchExperimentSet.call_args + assert isinstance(req, experiment_set_service_pb2.LaunchExperimentSetRequest) + assert req.experiment_set_id == "set-42" + assert req.notification_email == "user@example.com" + + +def test_launch_experiment_set_default_email(): + c = _client() + c._experiment_set = mock.Mock() + + c.launch_experiment_set("set-99") + + (req,), _ = c._experiment_set.LaunchExperimentSet.call_args + assert req.experiment_set_id == "set-99" + assert req.notification_email == "" + + +# --------------------------------------------------- get_experiment_set + +def test_get_experiment_set_builds_request(): + c = _client() + c._experiment_set = mock.Mock() + + c.get_experiment_set("set-7") + + c._experiment_set.GetExperimentSet.assert_called_once() + (req,), _ = c._experiment_set.GetExperimentSet.call_args + assert isinstance(req, experiment_set_service_pb2.GetExperimentSetRequest) + assert req.experiment_set_id == "set-7" + + +# --------------------------------------------------- get_experiment_set_status + +def test_get_experiment_set_status_builds_get_request(): + c = _client() + c._experiment_set = mock.Mock() + + c.get_experiment_set_status("set-7") + + c._experiment_set.GetExperimentSetStatus.assert_called_once() + (req,), _ = c._experiment_set.GetExperimentSetStatus.call_args + assert isinstance(req, experiment_set_service_pb2.GetExperimentSetRequest) + assert req.experiment_set_id == "set-7" + + +# --------------------------------------------------- list_experiment_sets + +def test_list_experiment_sets_default_pagination(): + c = _client() + c._experiment_set = mock.Mock() + + c.list_experiment_sets() + + c._experiment_set.ListExperimentSets.assert_called_once() + (req,), _ = c._experiment_set.ListExperimentSets.call_args + assert isinstance(req, experiment_set_service_pb2.ListExperimentSetsRequest) + assert req.limit == 0 + assert req.offset == 0 + + +def test_list_experiment_sets_custom_pagination(): + c = _client() + c._experiment_set = mock.Mock() + + c.list_experiment_sets(limit=10, offset=20) + + (req,), _ = c._experiment_set.ListExperimentSets.call_args + assert req.limit == 10 + assert req.offset == 20 + + +# --------------------------------------------------- high-level gridsearch helper + +def test_gridsearch_builds_create_request_and_calls_api(): + """gridsearch() builds a CreateExperimentSetRequest with correct sweep axes and base spec, + calls create_experiment_set on the api_server_client, and returns the ExperimentSet.""" + from airavata.experiments.gridsearch import gridsearch + from unittest.mock import MagicMock, patch + + fake_set = experiment_set_service_pb2.ExperimentSet( + experiment_set_id="set-new", + set_name="lr-sweep", + ) + + mock_client = MagicMock() + mock_client.create_experiment_set.return_value = fake_set + + mock_operator = MagicMock() + mock_operator.api_server_client = mock_client + + result = gridsearch( + operator=mock_operator, + set_name="lr-sweep", + project_id="proj-1", + application_interface_id="iface-1", + inputs={"lr": "0.01", "epochs": "10"}, + resource=dict( + compute_resource_id="cr-1", + group_resource_profile_id="grp-1", + node_count=1, + total_cpu_count=4, + queue_name="normal", + wall_time_limit=60, + ), + sweep_axes={"lr": ["0.01", "0.001", "0.0001"]}, + ) + + assert result is fake_set + mock_client.create_experiment_set.assert_called_once() + (req,), _ = mock_client.create_experiment_set.call_args + assert isinstance(req, experiment_set_service_pb2.CreateExperimentSetRequest) + assert req.set_name == "lr-sweep" + assert req.sweep.base.project_id == "proj-1" + assert req.sweep.base.application_interface_id == "iface-1" + assert req.sweep.base.inputs["lr"] == "0.01" + assert req.sweep.base.inputs["epochs"] == "10" + assert req.sweep.base.resource.compute_resource_id == "cr-1" + assert req.sweep.base.resource.group_resource_profile_id == "grp-1" + assert req.sweep.base.resource.node_count == 1 + assert req.sweep.base.resource.total_cpu_count == 4 + assert req.sweep.base.resource.queue_name == "normal" + assert req.sweep.base.resource.wall_time_limit == 60 + axes = req.sweep.sweep_axes + assert list(axes["lr"].values) == ["0.01", "0.001", "0.0001"] + assert req.sweep.name_prefix == "lr-sweep" diff --git a/airavata-python-sdk/tests/test_experiments_wiring.py b/airavata-python-sdk/tests/test_experiments_wiring.py new file mode 100644 index 00000000000..7ebc5c8d101 --- /dev/null +++ b/airavata-python-sdk/tests/test_experiments_wiring.py @@ -0,0 +1,137 @@ +# 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. +# + +"""Wiring tests for airavata.experiments' local gRPC client (``_apiserver``). + +The Airavata Python SDK is now generated-only: ``airavata.experiments`` builds +its own thin client over the raw generated stubs + ``airavata.auth``, replacing +the deleted ``airavata.clients`` facade. These tests pin the wiring without +a live server — the service stubs are constructed off an ``authenticated_channel`` +and each operator-facing method routes to the right stub with the right request +message (the same request shapes the old ``APIServerClient`` built, so the +764-line ``AiravataOperator`` call sites are untouched). +""" + +from unittest import mock + +from airavata.model.data.replica.replica_catalog_pb2 import ( + DataProductModel, +) +from airavata.services import ( + application_catalog_service_pb2, + data_product_service_pb2, + experiment_service_pb2, + experiment_service_pb2_grpc, + group_resource_profile_service_pb2, + project_service_pb2, + resource_service_pb2, +) + +from airavata.experiments._apiserver import APIServerClient + + +def _client(): + # authenticated_channel builds a lazy gRPC channel — no connection needed. + return APIServerClient(access_token="test-token") + + +def test_builds_the_seven_service_stubs(): + c = _client() + for attr in ( + "_experiment", + "_app_catalog", + "_resource", + "_gw_profile", + "_grp_profile", + "_project", + "_data_product", + ): + assert getattr(c, attr) is not None, f"stub {attr} not built" + assert isinstance( + c._experiment, experiment_service_pb2_grpc.ExperimentServiceStub + ) + + +def test_get_experiment_routes_to_experiment_stub(): + c = _client() + c._experiment = mock.Mock() + c.get_experiment("exp-1") + c._experiment.GetExperiment.assert_called_once() + (req,), _ = c._experiment.GetExperiment.call_args + assert isinstance(req, experiment_service_pb2.GetExperimentRequest) + assert req.experiment_id == "exp-1" + + +def test_launch_experiment_passes_gateway_and_id(): + c = _client() + c._experiment = mock.Mock() + c.launch_experiment("exp-1", "gw-1") + (req,), _ = c._experiment.LaunchExperiment.call_args + assert isinstance(req, experiment_service_pb2.LaunchExperimentRequest) + assert req.experiment_id == "exp-1" + assert req.gateway_id == "gw-1" + + +def test_terminate_experiment_passes_gateway_and_id(): + c = _client() + c._experiment = mock.Mock() + c.terminate_experiment("exp-1", "gw-1") + (req,), _ = c._experiment.TerminateExperiment.call_args + assert req.experiment_id == "exp-1" + assert req.gateway_id == "gw-1" + + +def test_register_data_product_routes_to_data_product_stub(): + c = _client() + c._data_product = mock.Mock() + c.register_data_product(DataProductModel(product_name="f.txt")) + (req,), _ = c._data_product.RegisterDataProduct.call_args + assert isinstance(req, data_product_service_pb2.RegisterDataProductRequest) + assert req.data_product.product_name == "f.txt" + + +def test_get_user_projects_carries_defaults(): + c = _client() + c._project = mock.Mock() + c.get_user_projects("gw-1", "alice") + (req,), _ = c._project.GetUserProjects.call_args + assert isinstance(req, project_service_pb2.GetUserProjectsRequest) + assert req.gateway_id == "gw-1" + assert req.user_name == "alice" + assert req.limit == -1 + + +def test_resource_and_catalog_and_group_reads_route_correctly(): + c = _client() + c._resource = mock.Mock() + c._app_catalog = mock.Mock() + c._grp_profile = mock.Mock() + + c.get_all_compute_resource_names() + (req,), _ = c._resource.GetAllComputeResourceNames.call_args + assert isinstance(req, resource_service_pb2.GetAllComputeResourceNamesRequest) + + c.get_application_inputs("iface-1") + (req,), _ = c._app_catalog.GetApplicationInputs.call_args + assert isinstance(req, application_catalog_service_pb2.GetApplicationInputsRequest) + assert req.app_interface_id == "iface-1" + + c.get_group_resource_profile("grp-1") + (req,), _ = c._grp_profile.GetGroupResourceProfile.call_args + assert isinstance( + req, group_resource_profile_service_pb2.GetGroupResourceProfileRequest + ) + assert req.group_resource_profile_id == "grp-1" diff --git a/airavata-server/src/main/java/org/apache/airavata/server/config/ServiceWiringConfig.java b/airavata-server/src/main/java/org/apache/airavata/server/config/ServiceWiringConfig.java index fea39f45af8..c9ec01c47ec 100644 --- a/airavata-server/src/main/java/org/apache/airavata/server/config/ServiceWiringConfig.java +++ b/airavata-server/src/main/java/org/apache/airavata/server/config/ServiceWiringConfig.java @@ -20,6 +20,7 @@ package org.apache.airavata.server.config; import org.apache.airavata.compute.service.GroupResourceProfileService; +import org.apache.airavata.interfaces.ExperimentStoragePrep; import org.apache.airavata.research.service.ExperimentService; import org.springframework.context.annotation.Configuration; @@ -31,7 +32,10 @@ public class ServiceWiringConfig { public ServiceWiringConfig( - ExperimentService experimentService, GroupResourceProfileService groupResourceProfileService) { + ExperimentService experimentService, + GroupResourceProfileService groupResourceProfileService, + ExperimentStoragePrep experimentStoragePrep) { experimentService.setGroupResourceProfileListProvider(groupResourceProfileService::getGroupResourceList); + experimentService.setExperimentStoragePrep(experimentStoragePrep); } } diff --git a/airavata-server/src/main/java/org/apache/airavata/server/grpc/services/UserProfileGrpcService.java b/airavata-server/src/main/java/org/apache/airavata/server/grpc/services/UserProfileGrpcService.java index 3767a82fbae..bfc3f08cbb9 100644 --- a/airavata-server/src/main/java/org/apache/airavata/server/grpc/services/UserProfileGrpcService.java +++ b/airavata-server/src/main/java/org/apache/airavata/server/grpc/services/UserProfileGrpcService.java @@ -23,8 +23,11 @@ import io.grpc.stub.StreamObserver; import java.util.List; import org.apache.airavata.api.iam.userprofile.*; +import org.apache.airavata.config.RequestContext; +import org.apache.airavata.grpc.GrpcRequestContext; import org.apache.airavata.grpc.GrpcStatusMapper; import org.apache.airavata.iam.repository.UserProfileRepository; +import org.apache.airavata.iam.service.UserPreferencesService; import org.apache.airavata.model.user.proto.UserProfile; import org.springframework.stereotype.Component; @@ -32,9 +35,11 @@ public class UserProfileGrpcService extends UserProfileServiceGrpc.UserProfileServiceImplBase { private final UserProfileRepository userProfileRepository; + private final UserPreferencesService userPreferencesService; - public UserProfileGrpcService() { + public UserProfileGrpcService(UserPreferencesService userPreferencesService) { this.userProfileRepository = new UserProfileRepository(); + this.userPreferencesService = userPreferencesService; } @Override @@ -136,4 +141,26 @@ public void doesUserExist(DoesUserExistRequest request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + observer.onNext(userPreferencesService.getUserPreferences(ctx)); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } + + @Override + public void updateUserPreferences(UserPreferences request, StreamObserver observer) { + try { + RequestContext ctx = GrpcRequestContext.current(); + observer.onNext(userPreferencesService.updateUserPreferences(ctx, request)); + observer.onCompleted(); + } catch (Exception e) { + observer.onError(GrpcStatusMapper.toStatusException(e)); + } + } } diff --git a/airavata-server/src/main/resources/db/migration/airavata/V1__Baseline_schema.sql b/airavata-server/src/main/resources/db/migration/airavata/V1__Baseline_schema.sql index fe7d6f0341c..d806fd633b4 100644 --- a/airavata-server/src/main/resources/db/migration/airavata/V1__Baseline_schema.sql +++ b/airavata-server/src/main/resources/db/migration/airavata/V1__Baseline_schema.sql @@ -942,4 +942,32 @@ CREATE TABLE `user_storage_preference` ( PRIMARY KEY (`GATEWAY_ID`,`STORAGE_RESOURCE_ID`,`USER_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; +CREATE TABLE `experiment_set` ( + `id` varchar(48) NOT NULL, + `createdAt` datetime(6) NOT NULL, + `gatewayId` varchar(255) NOT NULL, + `owner` varchar(255) NOT NULL, + `setName` varchar(255) NOT NULL, + `sweepSpecJson` longtext DEFAULT NULL, + `updatedAt` datetime(6) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; +CREATE TABLE `experiment_set_member` ( + `id` varchar(48) NOT NULL, + `experimentId` varchar(255) NOT NULL, + `ordinal` int(11) NOT NULL, + `experiment_set_id` varchar(48) NOT NULL, + PRIMARY KEY (`id`), + KEY `FK7jxgcnx5bslj9v24wr47r5j38` (`experiment_set_id`), + CONSTRAINT `FK7jxgcnx5bslj9v24wr47r5j38` FOREIGN KEY (`experiment_set_id`) REFERENCES `experiment_set` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; +CREATE TABLE `user_preferences` ( + `gatewayId` varchar(255) NOT NULL, + `userId` varchar(255) NOT NULL, + `preferencesJson` text DEFAULT NULL, + `createdAt` datetime(6) DEFAULT NULL, + `updatedAt` datetime(6) DEFAULT NULL, + PRIMARY KEY (`gatewayId`,`userId`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + SET FOREIGN_KEY_CHECKS=1; diff --git a/conf/keycloak/realm-default.json b/conf/keycloak/realm-default.json index a918e4d1694..506ed8ea8f8 100644 --- a/conf/keycloak/realm-default.json +++ b/conf/keycloak/realm-default.json @@ -1644,7 +1644,7 @@ "implicitFlowEnabled": false, "directAccessGrantsEnabled": false, "serviceAccountsEnabled": false, - "authorizationServicesEnabled": true, + "authorizationServicesEnabled": false, "publicClient": true, "frontchannelLogout": false, "protocol": "openid-connect", @@ -1663,7 +1663,7 @@ "nodeReRegistrationTimeout": -1, "protocolMappers": [ { - "id": "f15a7de0-0c1e-40d8-bd05-c1aaf0deb3e1", + "id": "0192199a-880f-4e03-a109-dbf8656603de", "name": "Client IP Address", "protocol": "openid-connect", "protocolMapper": "oidc-usersessionmodel-note-mapper", @@ -1679,7 +1679,7 @@ } }, { - "id": "a0956d0b-e5c4-4d9a-aebf-89efa6881438", + "id": "6a05d416-5476-478e-905d-9f5fd1f027f6", "name": "Client ID", "protocol": "openid-connect", "protocolMapper": "oidc-usersessionmodel-note-mapper", @@ -1695,7 +1695,7 @@ } }, { - "id": "6863299e-7d4f-43f4-8d0e-fc8cd4a8ceac", + "id": "4e9c2726-5cc0-4605-be1c-b8481f9989f2", "name": "Client Host", "protocol": "openid-connect", "protocolMapper": "oidc-usersessionmodel-note-mapper", @@ -1724,15 +1724,7 @@ "offline_access", "preferred_username", "microprofile-jwt" - ], - "authorizationSettings": { - "allowRemoteResourceManagement": true, - "policyEnforcementMode": "ENFORCING", - "resources": [], - "policies": [], - "scopes": [], - "decisionStrategy": "UNANIMOUS" - } + ] } ], "clientScopes": [ diff --git a/dev-tools/load-client/load_client.py b/dev-tools/load-client/load_client.py index ec65712994b..6a74d5d3343 100644 --- a/dev-tools/load-client/load_client.py +++ b/dev-tools/load-client/load_client.py @@ -34,8 +34,8 @@ os.environ.setdefault('GATEWAY_URL', "https://gateway.dev.cybershuttle.org") os.environ.setdefault('STORAGE_RESOURCE_HOST', "gateway.dev.cybershuttle.org") -from airavata_auth.device_auth import AuthContext -from airavata_experiments.airavata import AiravataOperator +from airavata.auth.device_auth import AuthContext +from airavata.experiments.airavata import AiravataOperator from airavata.model.status.ttypes import ExperimentState logging.basicConfig( diff --git a/dev-tools/scripts/test_python_sdk.py b/dev-tools/scripts/test_python_sdk.py index dedcebd7b67..8a27eaca70f 100755 --- a/dev-tools/scripts/test_python_sdk.py +++ b/dev-tools/scripts/test_python_sdk.py @@ -1,93 +1,83 @@ #!/usr/bin/env python3 -""" -Integration test for Python SDK against running Armeria gRPC server. -Prerequisites: server running on localhost:9090, Keycloak at localhost:18080 +"""Integration smoke test for the Python SDK against a running Armeria gRPC server. + +The SDK is generated-only: there is no hand-written client wrapper. This script +talks to the server exactly the way the portal and airavata.experiments do — +raw protoc-generated stubs over an airavata.auth ``authenticated_channel``. + +Prerequisites: server running on localhost:9090 (e.g. via ``tilt up``). Usage: - python3 scripts/test_python_sdk.py [--host localhost] [--port 9090] + python3 scripts/test_python_sdk.py [--host localhost] [--port 9090] [--token ] """ -import sys -import os import argparse +import os +import sys + +# Add the SDK to the path so the generated stubs + airavata.auth import. +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "airavata-python-sdk")) -# Add SDK to path -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'airavata-python-sdk')) def test_imports(): - """Test all SDK modules can be imported.""" + """The generated stubs + the auth channel helper import cleanly.""" print("Testing imports...") - from airavata_sdk.clients.api_server_client import APIServerClient - from airavata_sdk.clients.credential_store_client import CredentialStoreClient - from airavata_sdk.clients.sharing_registry_client import SharingRegistryClient - from airavata_sdk.clients.group_manager_client import GroupManagerClient - from airavata_sdk.clients.iam_admin_client import IAMAdminClient - from airavata_sdk.clients.user_profile_client import UserProfileClient - from airavata_sdk.clients.tenant_profile_client import TenantProfileClient - from airavata_sdk.clients.keycloak_token_fetcher import Authenticator + from airavata.auth import authenticated_channel # noqa: F401 + from airavata.services import ( # noqa: F401 + experiment_service_pb2, + experiment_service_pb2_grpc, + project_service_pb2, + project_service_pb2_grpc, + resource_service_pb2, + resource_service_pb2_grpc, + ) print(" All imports OK") -def test_channel_creation(host, port): - """Test gRPC channel can be created.""" - print("Testing gRPC channel creation...") - import grpc - channel = grpc.insecure_channel(f"{host}:{port}") - # Try to get channel state +def test_channel_creation(host, port): + """An authenticated channel can be created and reports connectivity.""" + print("Testing authenticated_channel creation...") + from airavata.auth import authenticated_channel + channel = authenticated_channel(host, port, "test-token") state = channel.check_connectivity_state(True) print(f" Channel state: {state}") - channel.close() print(" Channel OK") -def test_api_client(host, port, token=None): - """Test APIServerClient methods.""" - print("Testing APIServerClient...") - os.environ['API_SERVER_HOSTNAME'] = host - os.environ['API_SERVER_PORT'] = str(port) - from airavata_sdk.clients.api_server_client import APIServerClient +def test_reads(host, port, token=None): + """A couple of read RPCs over raw stubs (auth errors are fine — the point is wiring).""" + print("Testing reads over raw stubs...") + from airavata.auth import authenticated_channel + from airavata.services import ( + project_service_pb2, + project_service_pb2_grpc, + resource_service_pb2, + resource_service_pb2_grpc, + ) - client = APIServerClient(access_token=token or "test-token") + channel = authenticated_channel(host, port, token or "test-token") - # Test gateway operations (should work or return auth error) + resource = resource_service_pb2_grpc.ResourceServiceStub(channel) try: - gateways = client.get_all_gateways() - print(f" get_all_gateways: {len(gateways)} gateways") + resp = resource.GetAllComputeResourceNames( + resource_service_pb2.GetAllComputeResourceNamesRequest() + ) + print(f" GetAllComputeResourceNames: {len(resp.compute_resource_names)} resources") except Exception as e: - print(f" get_all_gateways: {type(e).__name__}: {e}") + print(f" GetAllComputeResourceNames: {type(e).__name__}: {e}") - # Test project listing + projects = project_service_pb2_grpc.ProjectServiceStub(channel) try: - projects = client.get_user_projects("default", "admin", 10, 0) - print(f" get_user_projects: {len(projects)} projects") + resp = projects.GetUserProjects( + project_service_pb2.GetUserProjectsRequest( + gateway_id="default", user_name="admin", limit=10, offset=0 + ) + ) + print(f" GetUserProjects: {len(resp.projects)} projects") except Exception as e: - print(f" get_user_projects: {type(e).__name__}: {e}") + print(f" GetUserProjects: {type(e).__name__}: {e}") - # Test experiment search - try: - experiments = client.search_experiments("default", "admin", {}, 10, 0) - print(f" search_experiments: {len(experiments)} experiments") - except Exception as e: - print(f" search_experiments: {type(e).__name__}: {e}") - - print(" APIServerClient tests done") - -def test_sharing_client(host, port, token=None): - """Test SharingRegistryClient.""" - print("Testing SharingRegistryClient...") - os.environ['API_SERVER_HOSTNAME'] = host - os.environ['API_SERVER_PORT'] = str(port) - - from airavata_sdk.clients.sharing_registry_client import SharingRegistryClient - - client = SharingRegistryClient(access_token=token or "test-token") - - try: - domains = client.get_domains(0, -1) - print(f" get_domains: {len(domains)} domains") - except Exception as e: - print(f" get_domains: {type(e).__name__}: {e}") + print(" Read tests done") - print(" SharingRegistryClient tests done") if __name__ == "__main__": parser = argparse.ArgumentParser() @@ -100,7 +90,6 @@ def test_sharing_client(host, port, token=None): test_imports() test_channel_creation(args.host, args.port) - test_api_client(args.host, args.port, args.token) - test_sharing_client(args.host, args.port, args.token) + test_reads(args.host, args.port, args.token) print("\n=== Done ===")