Class AdminApi
java.lang.Object
nl.bimbase.bimworks.client.apis.SubApi
nl.bimbase.bimworks.client.apis.AdminApi
Administrator API calls, generally require elevated privileges
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.node.ObjectNodeCreate an API token restricted to the given scopes (the preferred variant — seeScope).createApiToken(UUID nodeUuid, String name, Set<String> allowedCorsDomains, Set<String> whiteListedIpAddresses, Set<ApiTokenCredential> credentials) createApiToken(UUID nodeUuid, String name, Set<String> allowedCorsDomains, Set<String> whiteListedIpAddresses, Set<ApiTokenCredential> credentials, LocalDate expiresOn) voiddeleteApiToken(UUID uuid) com.fasterxml.jackson.databind.JsonNodeAccounts visible to the caller (its organization; every organization for a super admin).com.fasterxml.jackson.databind.node.ArrayNodelistAccountUserFeatures(UUID accountUuid) Every user feature with its enabled flag for the account (own account, or super admin).com.fasterxml.jackson.databind.node.ArrayNodelistFolderApiTokens(UUID nodeUuid) API tokens rooted at the given folder (secret redacted).com.fasterxml.jackson.databind.JsonNoderotateApiTokenSecret(UUID uuid) Replace the secret of an API token; the old secret stops working immediately.voidsetUserFeature(UUID accountUuid, String feature, boolean enabled) Super admin only: switch a user feature for an account.voidUpdate name, scopes and/or expiry of an API token; null leaves a property unchanged.Methods inherited from class SubApi
getBimWorksClient
-
Constructor Details
-
AdminApi
-
-
Method Details
-
createApiToken
public String createApiToken(UUID nodeUuid, String name, Set<String> allowedCorsDomains, Set<String> whiteListedIpAddresses, Set<ApiTokenCredential> credentials) throws nl.sascom.backplane.common.ExecuteException, InterruptedException, BimWorksException - Throws:
nl.sascom.backplane.common.ExecuteExceptionInterruptedExceptionBimWorksException
-
createApiToken
public String createApiToken(UUID nodeUuid, String name, Set<String> allowedCorsDomains, Set<String> whiteListedIpAddresses, Set<ApiTokenCredential> credentials, LocalDate expiresOn) throws nl.sascom.backplane.common.ExecuteException, InterruptedException, BimWorksException - Parameters:
expiresOn- the day the token stops working (usable through the whole of that UTC day); null for the server's default (one month ahead). The server refuses a date further ahead than its configured maximum (three years).- Throws:
nl.sascom.backplane.common.ExecuteExceptionInterruptedExceptionBimWorksException
-
createApiToken
public com.fasterxml.jackson.databind.node.ObjectNode createApiToken(UUID nodeUuid, String name, EnumSet<Scope> scopes, LocalDate expiresOn) throws BimWorksException Create an API token restricted to the given scopes (the preferred variant — seeScope). The token value is returned once and never again.- Returns:
{token, expires_on}- Throws:
BimWorksException
-
listFolderApiTokens
public com.fasterxml.jackson.databind.node.ArrayNode listFolderApiTokens(UUID nodeUuid) throws BimWorksException API tokens rooted at the given folder (secret redacted).- Throws:
BimWorksException
-
updateApiToken
public void updateApiToken(UUID uuid, String name, EnumSet<Scope> scopes, LocalDate expiresOn) throws BimWorksException Update name, scopes and/or expiry of an API token; null leaves a property unchanged.- Throws:
BimWorksException
-
rotateApiTokenSecret
Replace the secret of an API token; the old secret stops working immediately. @return the new token value- Throws:
BimWorksException
-
deleteApiToken
- Throws:
BimWorksException
-
listAccounts
Accounts visible to the caller (its organization; every organization for a super admin).- Throws:
BimWorksException
-
listOrganizations
- Throws:
BimWorksException
-
listAccountUserFeatures
public com.fasterxml.jackson.databind.node.ArrayNode listAccountUserFeatures(UUID accountUuid) throws BimWorksException Every user feature with its enabled flag for the account (own account, or super admin).- Throws:
BimWorksException
-
setUserFeature
public void setUserFeature(UUID accountUuid, String feature, boolean enabled) throws BimWorksException Super admin only: switch a user feature for an account.- Throws:
BimWorksException
-