Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • gitkeep
  • dev
  • master
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issue/2309-docs
  • Issue/2355-topLevelOrg
  • Issue/2328-noFailOnLog
  • Hotfix/2371-fixGitLabinRCV
  • Issue/2287-guestRole
  • Fix/xxxx-activateGitlab
  • Test/xxxx-enablingGitLab
  • Issue/2349-gitlabHttps
  • Issue/2259-updatePids
  • Issue/2101-gitLabResTypeUi
  • Hotfix/2202-fixNaNQuota
  • Issue/2246-quotaResoval
  • Issue/2221-projectDateCreated
  • Hotfix/2224-quotaSizeAnalytics
  • Fix/xxxx-resourceVisibility
  • Issue/2000-gitlabResourcesAPI
  • Issue/1321-pidEnquiryOverhaul
  • Hotfix/2203-quotaMembersFix
  • Issue/1861-searchMetadata
  • Issue/1951-quotaImplementation
  • Issue/1860-searchScoping
  • uiv2
  • Issue/2072-wormResourceType
  • Issue/2061-activateResourceTypeRdss3nrw
  • Hotfix/2077-fixSupportAdminLog
  • Hotfix/2087-efNet6
  • Issue/1910-MigrationtoNET6.0
  • Sprint/2022-05
  • Issue/1971-projectForDev
  • Hotfix/1917-PublicFilesVisibility
  • Hotfix/2015-PublicFilesVisibility
  • Issue/2008-quotaManagement
  • Issue/1971-projectEditCreateMigration
  • Issue/2001-extendAnalyticsLogger
  • Issue/1825-codeQualityPipelines
  • Issue/1825-codeQualityPipelinesNew
  • Issue/1957-resourceAppMigrationNew
  • Issue/1927-projectAppMigration
  • Issue/1940ResouceKeysForNRWAndTUDO
  • Sprint/2022-01
  • Issue/1866-ExtendResourceTypeConfigurationTUDo
  • Issue/1877-ExtendResourceTypeConfigurationNRWFHs
  • Sprint/2021-2022
  • Sprint/2021-23
  • Hotfix/1796-projectDdos
  • Hotfix/64-releaseUDE
  • Sprint/2021-19
  • Product/1629-onboardingOtherUniversities
  • Issues/0028-maxQuotaFix
  • Topic/1714-newResourceTypesUDE
  • Topic/1711-extendResourceTypeConfiguration
  • Hotfix/1704-FixingArchiveFlag
  • Hotfix/1669-RDS-S3QuotaManagement
  • Sprint/2021-15
  • Hotfix/1668-versionResourceConfigDepVersion
  • Sprint/2021-13
  • Product/1600-rdsS3QuotaManagement
  • Sprint/2021-12
  • Product/1548-projectInviteMngmnt
  • Topic/1531-UseMangmntTableView
  • Topic/1568-quotaApiAdjustments
  • Hotfix/1615-membersCreatingProject
  • Sprint/2021-11
  • Hotfix/1590-quotaFix
  • Hotfix/1584-fixResourceLoader
  • Sprint/2021-10
  • Topic/1530-invitationUserManagement
  • Sprint/2021-09
  • Product/1442-projectInviteMngmnt
  • Topic/1529-HandleExternalUserInvitation
  • Sprint/2021-08
  • Product/1414-fhPrivileges
  • Product/202-userInvitation
  • Topic/1453-userInvitation
  • Hotfix/1466-projectCreationTimeout
  • Topic/1425-fhPrivileges
  • Hotfix/1262-fixStatuscode
  • Hotfix/1433-defaultQuota
  • Sprint/2021-05
  • Product/1188-LoggingExtended
  • Topic/1221-LogginExtendedNew
  • Product/1100-fdsS3
  • Topic/1292-FdsS3
  • Hotfix/1383-topLevel
  • Hotfix/1370-swaggerDescription
  • Hotfix/1357-ymlFile
  • Sprint/2021-03
  • Product/1287-dotnet5Sharepoint
  • Topic/1335-dotnet5Apis
  • Sprint/2021-02
  • Hotfix/1308-versionConflict
  • Sprint/2021-01
  • Product/588-quotaManagement
  • Topic/1279-quotaManagement
  • Topic/1221-LoggingExtended
  • Product/1215-gitlabCleanUp
  • v1.0.0
  • v1.1.0
  • v1.10.0
  • v1.11.0
  • v1.11.1
  • v1.12.0
  • v1.13.0
  • v1.13.1
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.16.0
  • v1.16.1
  • v1.17.0
  • v1.17.1
  • v1.18.0
  • v1.19.0
  • v1.2.0
  • v1.2.1
  • v1.20.0
  • v1.20.1
  • v1.20.2
  • v1.21.0
  • v1.21.1
  • v1.22.0
  • v1.23.0
  • v1.23.1
  • v1.23.2
  • v1.23.3
  • v1.24.0
  • v1.24.1
  • v1.25.0
  • v1.25.1
  • v1.3.0
  • v1.4.0
  • v1.4.1
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.6.1
  • v1.6.2
  • v1.7.0
  • v1.7.1
  • v1.8.0
  • v1.9.0
  • v2.0.0
  • v2.0.1
  • v2.0.2
  • v2.1.0
  • v2.1.1
  • v2.1.2
  • v2.2.0
  • v2.2.1
  • v2.2.2
  • v2.2.3
  • v2.2.4
  • v2.2.5
  • v2.3.0
  • v2.4.0
  • v2.4.1
  • v2.4.2
  • v2.4.3
  • v2.5.0
  • v2.5.1
  • v2.5.2
  • v2.5.3
  • v2.5.4
  • v2.6.0
  • v2.6.1
  • v2.6.2
  • v2.7.0
  • v2.8.0
  • v2.8.1
  • v2.8.2
  • v2.8.3
  • v2.8.4
  • v2.9.0
  • v3.0.0
  • v3.0.1
  • v4.0.0
  • v4.0.1
  • v4.0.2
  • v4.0.3
  • v4.1.0
  • v4.1.1
  • v4.2.0
  • v4.2.1
  • v4.2.2
  • v4.2.3
  • v4.2.4
  • v4.2.5
  • v4.2.6
  • v4.2.7
  • v4.2.8
  • v4.3.0
  • v4.3.1
  • v4.3.2
  • v4.3.3
  • v4.3.4
  • v4.4.0
200 results

Target

Select target project
  • Coscine / backend / apis / Project
1 result
Select Git revision
  • gitkeep
  • dev
  • master
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issue/2309-docs
  • Issue/2355-topLevelOrg
  • Issue/2328-noFailOnLog
  • Hotfix/2371-fixGitLabinRCV
  • Issue/2287-guestRole
  • Fix/xxxx-activateGitlab
  • Test/xxxx-enablingGitLab
  • Issue/2349-gitlabHttps
  • Issue/2259-updatePids
  • Issue/2101-gitLabResTypeUi
  • Hotfix/2202-fixNaNQuota
  • Issue/2246-quotaResoval
  • Issue/2221-projectDateCreated
  • Hotfix/2224-quotaSizeAnalytics
  • Fix/xxxx-resourceVisibility
  • Issue/2000-gitlabResourcesAPI
  • Issue/1321-pidEnquiryOverhaul
  • Hotfix/2203-quotaMembersFix
  • Issue/1861-searchMetadata
  • Issue/1951-quotaImplementation
  • Issue/1860-searchScoping
  • uiv2
  • Issue/2072-wormResourceType
  • Issue/2061-activateResourceTypeRdss3nrw
  • Hotfix/2077-fixSupportAdminLog
  • Hotfix/2087-efNet6
  • Issue/1910-MigrationtoNET6.0
  • Sprint/2022-05
  • Issue/1971-projectForDev
  • Hotfix/1917-PublicFilesVisibility
  • Hotfix/2015-PublicFilesVisibility
  • Issue/2008-quotaManagement
  • Issue/1971-projectEditCreateMigration
  • Issue/2001-extendAnalyticsLogger
  • Issue/1825-codeQualityPipelines
  • Issue/1825-codeQualityPipelinesNew
  • Issue/1957-resourceAppMigrationNew
  • Issue/1927-projectAppMigration
  • Issue/1940ResouceKeysForNRWAndTUDO
  • Sprint/2022-01
  • Issue/1866-ExtendResourceTypeConfigurationTUDo
  • Issue/1877-ExtendResourceTypeConfigurationNRWFHs
  • Sprint/2021-2022
  • Sprint/2021-23
  • Hotfix/1796-projectDdos
  • Hotfix/64-releaseUDE
  • Sprint/2021-19
  • Product/1629-onboardingOtherUniversities
  • Issues/0028-maxQuotaFix
  • Topic/1714-newResourceTypesUDE
  • Topic/1711-extendResourceTypeConfiguration
  • Hotfix/1704-FixingArchiveFlag
  • Hotfix/1669-RDS-S3QuotaManagement
  • Sprint/2021-15
  • Hotfix/1668-versionResourceConfigDepVersion
  • Sprint/2021-13
  • Product/1600-rdsS3QuotaManagement
  • Sprint/2021-12
  • Product/1548-projectInviteMngmnt
  • Topic/1531-UseMangmntTableView
  • Topic/1568-quotaApiAdjustments
  • Hotfix/1615-membersCreatingProject
  • Sprint/2021-11
  • Hotfix/1590-quotaFix
  • Hotfix/1584-fixResourceLoader
  • Sprint/2021-10
  • Topic/1530-invitationUserManagement
  • Sprint/2021-09
  • Product/1442-projectInviteMngmnt
  • Topic/1529-HandleExternalUserInvitation
  • Sprint/2021-08
  • Product/1414-fhPrivileges
  • Product/202-userInvitation
  • Topic/1453-userInvitation
  • Hotfix/1466-projectCreationTimeout
  • Topic/1425-fhPrivileges
  • Hotfix/1262-fixStatuscode
  • Hotfix/1433-defaultQuota
  • Sprint/2021-05
  • Product/1188-LoggingExtended
  • Topic/1221-LogginExtendedNew
  • Product/1100-fdsS3
  • Topic/1292-FdsS3
  • Hotfix/1383-topLevel
  • Hotfix/1370-swaggerDescription
  • Hotfix/1357-ymlFile
  • Sprint/2021-03
  • Product/1287-dotnet5Sharepoint
  • Topic/1335-dotnet5Apis
  • Sprint/2021-02
  • Hotfix/1308-versionConflict
  • Sprint/2021-01
  • Product/588-quotaManagement
  • Topic/1279-quotaManagement
  • Topic/1221-LoggingExtended
  • Product/1215-gitlabCleanUp
  • v1.0.0
  • v1.1.0
  • v1.10.0
  • v1.11.0
  • v1.11.1
  • v1.12.0
  • v1.13.0
  • v1.13.1
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.16.0
  • v1.16.1
  • v1.17.0
  • v1.17.1
  • v1.18.0
  • v1.19.0
  • v1.2.0
  • v1.2.1
  • v1.20.0
  • v1.20.1
  • v1.20.2
  • v1.21.0
  • v1.21.1
  • v1.22.0
  • v1.23.0
  • v1.23.1
  • v1.23.2
  • v1.23.3
  • v1.24.0
  • v1.24.1
  • v1.25.0
  • v1.25.1
  • v1.3.0
  • v1.4.0
  • v1.4.1
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.6.1
  • v1.6.2
  • v1.7.0
  • v1.7.1
  • v1.8.0
  • v1.9.0
  • v2.0.0
  • v2.0.1
  • v2.0.2
  • v2.1.0
  • v2.1.1
  • v2.1.2
  • v2.2.0
  • v2.2.1
  • v2.2.2
  • v2.2.3
  • v2.2.4
  • v2.2.5
  • v2.3.0
  • v2.4.0
  • v2.4.1
  • v2.4.2
  • v2.4.3
  • v2.5.0
  • v2.5.1
  • v2.5.2
  • v2.5.3
  • v2.5.4
  • v2.6.0
  • v2.6.1
  • v2.6.2
  • v2.7.0
  • v2.8.0
  • v2.8.1
  • v2.8.2
  • v2.8.3
  • v2.8.4
  • v2.9.0
  • v3.0.0
  • v3.0.1
  • v4.0.0
  • v4.0.1
  • v4.0.2
  • v4.0.3
  • v4.1.0
  • v4.1.1
  • v4.2.0
  • v4.2.1
  • v4.2.2
  • v4.2.3
  • v4.2.4
  • v4.2.5
  • v4.2.6
  • v4.2.7
  • v4.2.8
  • v4.3.0
  • v4.3.1
  • v4.3.2
  • v4.3.3
  • v4.3.4
  • v4.4.0
200 results
Show changes

Commits on Source 5

3 files
+ 30
11
Compare changes
  • Side-by-side
  • Inline

Files

+23 −10
Original line number Diff line number Diff line
@@ -44,9 +44,6 @@ namespace Coscine.Api.Project.Controllers
        private readonly InvitationModel _invitationModel;
        private readonly RoleModel _roleModel;
        private readonly UserModel _userModel;
        private readonly int _maxAvailable = 100;
        private readonly string _userUrlPrefix = "https://purl.org/coscine/users";
        private readonly Uri _orgPrefixUrl = new Uri("http://www.w3.org/ns/org#");
        private readonly RdfStoreConnector _rdfStoreConnector;

        /// <summary>
@@ -213,10 +210,16 @@ namespace Coscine.Api.Project.Controllers
                Id = x.Id,
                Name = x.DisplayName,
                Used = CalculateUsed(x, projectGuid),
                Allocated = projectQuota == null ? 0 : projectQuota.Quota
                Allocated = projectQuota == null ? 0 : projectQuota.Quota,
                Maximum = projectQuota.MaxQuota
            };
        }

        private int GetMaxQuota(Guid projectId, Guid resourceTypeId)
        {
            return _projectQuotaModel.GetWhere(x => x.ProjectId == projectId && x.ResourceTypeId == resourceTypeId).MaxQuota;
        }

        private int CalculateUsed(ResourceType resourceType, Guid projectId)
        {
            var resourceTypeDefinition = ResourceTypeFactory.CreateResourceTypeObject(resourceType.DisplayName, _configuration);
@@ -281,7 +284,8 @@ namespace Coscine.Api.Project.Controllers
                Id = resourceTypeGuid,
                Name = resourceType.DisplayName,
                Used = CalculateUsed(resourceType, projectGuid),
                Allocated = projectQuota.Quota
                Allocated = projectQuota.Quota,
                Maximum = projectQuota.MaxQuota
            };

            return Json(projectQuotaReturnObject);
@@ -327,7 +331,7 @@ namespace Coscine.Api.Project.Controllers
                return NotFound($"Could not find resourceType with id: {resourceTypeId}");
            }

            return Json(new MaxProjectQuota { Id = resourceTypeGuid, Available = _maxAvailable });
            return Json(new MaxProjectQuota { Id = resourceTypeGuid, Available = GetMaxQuota(projectGuid, resourceTypeGuid) });
        }

        /// <summary>
@@ -371,9 +375,16 @@ namespace Coscine.Api.Project.Controllers
                return NotFound($"Could not find resourceType with id: {resourceTypeId}");
            }

            if (resourceType.DisplayName.Equals("rdss3"))
            var resourceTypeDefinition = ResourceTypeFactory.CreateResourceTypeObject(resourceType.DisplayName, _configuration);

            if (resourceTypeDefinition == null)
            {
                return BadRequest($"Cannot adjust quota for rdss3.");
                return BadRequest($"No provider for: \"{resourceType.DisplayName}\".");
            }

            if (!resourceTypeDefinition.GetResourceTypeInformation().Result.IsQuotaAdjustable)
            {
                return BadRequest($"Cannot adjust quota for {resourceType.DisplayName}.");
            }

            if (updateProjectQuotaObject.Allocated < 0)
@@ -389,9 +400,11 @@ namespace Coscine.Api.Project.Controllers
                return BadRequest($"Cannot set quota ({updateProjectQuotaObject.Allocated}) below the used value ({used}).");
            }

            if (updateProjectQuotaObject.Allocated > _maxAvailable)
            var maxAvailabe = GetMaxQuota(projectGuid, resourceTypeGuid);

            if (updateProjectQuotaObject.Allocated > maxAvailabe)
            {
                return BadRequest($"Cannot set quota to {updateProjectQuotaObject.Allocated}. It would exceed the limit of {_maxAvailable}");
                return BadRequest($"Cannot set quota to {updateProjectQuotaObject.Allocated}. It would exceed the limit of {maxAvailabe}");
            }

            projectQuotaForCurrent.Quota = updateProjectQuotaObject.Allocated;
+2 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
		<AssemblyName>Coscine.Api.Project</AssemblyName>
		<GenerateDocumentationFile>true</GenerateDocumentationFile>
		<TargetFramework>net5.0</TargetFramework>
		<Version>2.3.0</Version>
		<Version>2.4.0</Version>
	</PropertyGroup>
	<PropertyGroup>
		<Authors>RWTH Aachen University</Authors>
@@ -23,5 +23,6 @@
		<PackageReference Include="Coscine.Logging" Version="2.*-*" />
		<PackageReference Include="Coscine.Metadata" Version="2.*-*" />
		<PackageReference Include="Coscine.ResourceLoader" Version="2.*-*" />
		<PackageReference Include="Coscine.ResourceTypeBase" Version="2.*-*" />
	</ItemGroup>
</Project>
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -23,5 +23,10 @@ namespace Coscine.Api.Project.ReturnObjects
        /// How much space is availabe to be taken by resources (in gb).
        /// </summary>
        public int Allocated { get; set; }

        /// <summary>
        /// Maximum amount of quota (in gb).
        /// </summary>
        public int Maximum { get; set; }
    }
}