Package com.structurizr.api
Class AdminApiClient
java.lang.Object
com.structurizr.api.AbstractApiClient
com.structurizr.api.AdminApiClient
A client for the Structurizr Admin API.
-
Field Summary
Fields inherited from class com.structurizr.api.AbstractApiClient
agent, STRUCTURIZR_CLOUD_SERVICE_API_URL, STRUCTURIZR_FOR_JAVA_AGENT, url, VERSION, WORKSPACE_PATH -
Constructor Summary
ConstructorsConstructorDescriptionAdminApiClient(String url, String username, String apiKey) Creates a new admin API client. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new workspace.voiddeleteWorkspace(int workspaceId) Deletes a workspace.Gets a list of all workspaces.Methods inherited from class com.structurizr.api.AbstractApiClient
getAgent, setAgent, setUrl
-
Constructor Details
-
AdminApiClient
Creates a new admin API client.- Parameters:
url- the URL of your Structurizr instanceusername- the username (only required for the Structurizr cloud service)apiKey- the API key of your workspace
-
-
Method Details
-
getWorkspaces
Gets a list of all workspaces.- Returns:
- a List of WorkspaceMetadata objects
- Throws:
StructurizrClientException- if an error occurs
-
createWorkspace
Creates a new workspace.- Returns:
- a WorkspaceMetadata object representing the new workspace
- Throws:
StructurizrClientException- if an error occurs
-
deleteWorkspace
Deletes a workspace.- Parameters:
workspaceId- the ID of the workspace to delete- Throws:
StructurizrClientException- if an error occurs
-