Update repository policy
const url = 'http://localhost:3000/api/v1/system/repository-policy';const options = { method: 'PATCH', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"allowTenantOverride":true,"allowTenantOnlyRepos":true,"requireGlobalRepos":false,"credentialRotationDays":90,"syncIntervalMinMinutes":15,"syncIntervalMaxMinutes":1440}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url http://localhost:3000/api/v1/system/repository-policy \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "allowTenantOverride": true, "allowTenantOnlyRepos": true, "requireGlobalRepos": false, "credentialRotationDays": 90, "syncIntervalMinMinutes": 15, "syncIntervalMaxMinutes": 1440 }'Updates the repository policy configuration. Requires Super Admin privileges.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Allow tenants to override non-mandatory global repositories
Example
trueAllow tenants to create their own repositories
Example
trueGlobal repositories are required and visible to all tenants
Example
falseRecommended credential rotation period in days
Example
90Minimum sync interval allowed in minutes
Example
15Maximum sync interval allowed in minutes
Example
1440Responses
Section titled “ Responses ”Repository policy updated successfully
object
Unique identifier of the policy
Allow tenants to override non-mandatory global repositories
Allow tenants to create their own repositories
Global repositories are required and visible to all tenants
Recommended credential rotation period in days
Minimum sync interval allowed in minutes
Maximum sync interval allowed in minutes
Timestamp when the policy was created
Timestamp when the policy was last updated
Example
{ "id": "550e8400-e29b-41d4-a716-446655440000", "allowTenantOverride": true, "allowTenantOnlyRepos": true, "requireGlobalRepos": false, "credentialRotationDays": 90, "syncIntervalMinMinutes": 15, "syncIntervalMaxMinutes": 1440, "createdAt": "2024-01-15T12:00:00.000Z", "updatedAt": "2024-01-15T12:00:00.000Z"}Invalid input data
Unauthorized
Forbidden - requires Super Admin privileges
Repository policy not configured