public class AssetClient extends MindsphereAPIClient
Modifier and Type | Class and Description |
---|---|
static class |
AssetClient.ClientBuilder |
MindsphereAPIClient.Builder<T extends MindsphereAPIClient.Builder<T>>
credentials, restClientConfig, restTemplate
Modifier | Constructor and Description |
---|---|
protected |
AssetClient(AssetClient.ClientBuilder builder) |
Modifier and Type | Method and Description |
---|---|
static AssetClient.ClientBuilder |
builder() |
AssetResource |
createAsset(AssetDto asset)
Create an asset Creates a new asset with the provided content
|
boolean |
deleteAsset(String id,
String ifMatch)
Delete an asset
After deletion only users with admin role can read it,
but modification is not possible anymore.
|
AssetResource |
deleteFileAssignment(String id,
String key,
String ifMatch)
Deletes a file assignment from an asset.
|
AssetResource |
getAssetById(String id)
Returns an asset.
|
AssetResource |
getAssetById(String id,
String ifNoneMatch)
Returns an asset.
|
Assets |
getAssets()
List all available assets #Filter Supports all basic fields.
|
Assets |
getAssets(Integer page,
Integer size)
List all available assets #Filter Supports all basic fields.
|
Assets |
getAssets(Integer page,
Integer size,
String sort,
String filter,
String ifNoneMatch)
List all available assets #Filter Supports all basic fields.
|
Assets |
getAssets(String sort,
String filter)
List all available assets #Filter Supports all basic fields.
|
AssetResource |
getRootAsset()
Returns the root asset of the user.
|
AssetResource |
getRootAsset(String ifNoneMatch)
Returns the root asset of the user.
|
AssetResource |
moveAsset(String id,
AssetMoveDto moveParameters,
String ifMatch)
Move an asset Moves an asset (and all it's children) in the instance
hierarchy
|
AssetResource |
updateAsset(String id,
AssetUpdateDto asset,
String ifMatch)
Update an asset Updates an asset with the provided content.
|
AssetResource |
updateFileAssignment(String id,
String key,
FileAssignmentDto assignment,
String ifMatch)
Save a file assignment to a given asset.
|
protected AssetClient(AssetClient.ClientBuilder builder)
public static AssetClient.ClientBuilder builder()
public Assets getAssets(Integer page, Integer size, String sort, String filter, String ifNoneMatch) throws MindsphereException
Response Status Codes
200 - Array of assets matched the tenant scope and filter criterias
304 - The answer's content has not changed since the last request
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
page
- Specifies the requested page indexsize
- Specifies the number of elements in a pagesort
- Specifies the ordering of returned elementsfilter
- Specifies the additional filtering criteria, e.g. "{\"name\":\"asset_name\"}" or as an encoded string, "%7B%22name%22:%22asset_name%22%7D"ifNoneMatch
- ETag hash of previous request to allow cachingMindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic Assets getAssets() throws MindsphereException
Response Status Codes
200 - Array of assets matched the tenant scope and filter criterias
304 - The answer's content has not changed since the last request
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
MindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic Assets getAssets(Integer page, Integer size) throws MindsphereException
Response Status Codes
200 - Array of assets matched the tenant scope and filter criterias
304 - The answer's content has not changed since the last request
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
page
- Specifies the requested page indexsize
- Specifies the number of elements in a pageMindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic Assets getAssets(String sort, String filter) throws MindsphereException
Response Status Codes
200 - Array of assets matched the tenant scope and filter criterias
304 - The answer's content has not changed since the last request
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
sort
- Specifies the ordering of returned elementsfilter
- Specifies the additional filtering criteria, e.g. "{\"name\":\"asset_name\"}" or as an encoded string, "%7B%22name%22:%22asset_name%22%7D"MindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic AssetResource getAssetById(String id, String ifNoneMatch) throws MindsphereException
Response Status Codes
200 - Returns an asset with its static properties.
304 - Resource asset is not modified
401 - User is not authenticated
403 - User is not authorized for request
404 - Not found
500 - Server error, for more information see errorcode and message
id
- Unique identifierifNoneMatch
- ETag hash of previous request to allow cachingMindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic AssetResource getAssetById(String id) throws MindsphereException
Response Status Codes
200 - Returns an asset with its static properties.
304 - Resource asset is not modified
401 - User is not authenticated
403 - User is not authorized for request
404 - Not found
500 - Server error, for more information see errorcode and message
id
- Unique identifierMindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic AssetResource moveAsset(String id, AssetMoveDto moveParameters, String ifMatch) throws MindsphereException
Response Status Codes
200 - The asset is moved
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
id
- Unique identifiermoveParameters
- parameters for the asset moveifMatch
- Last known version to facilitate optimistic lockingMindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic AssetResource updateAsset(String id, AssetUpdateDto asset, String ifMatch) throws MindsphereException
Response Status Codes 200 - The asset is updated
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
id
- Unique identifierasset
- assetifMatch
- Last known version to facilitate optimistic lockingMindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic AssetResource createAsset(AssetDto asset) throws MindsphereException
Response Status Codes
201 - The asset is created
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
asset
- assetMindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic AssetResource getRootAsset(String ifNoneMatch) throws MindsphereException
Response Status Codes
200 - Returns the root asset of the user.
304 - Resource asset is not modified
401 - User is not authenticated
403 - User is not authorized for request
404 - Not found
500 - Server error, for more information see errorcode and message
ifNoneMatch
- ETag hash of previous request to allow cachingMindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic AssetResource getRootAsset() throws MindsphereException
Response Status Codes
200 - Returns the root asset of the user.
304 - Resource asset is not modified
401 - User is not authenticated
403 - User is not authorized for request
404 - Not found
500 - Server error, for more information see errorcode and message
MindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic boolean deleteAsset(String id, String ifMatch) throws MindsphereException
204 - Asset deletion was successful
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
id
- Unique identifierifMatch
- Last known version to facilitate optimistic lockingMindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResource updateFileAssignment(String id, String key, FileAssignmentDto assignment, String ifMatch) throws MindsphereException
200 - The assignment has been updated or a new assignment has been added
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
id
- Unique identifier.key
- Keyword for the file to be assigned to an asset or asset type.assignment
- Data for file assignment.ifMatch
- Last known version to facilitate optimistic locking.MindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetResource deleteFileAssignment(String id, String key, String ifMatch) throws MindsphereException
200 - The assignment has been deleted
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - Asset not found
412 - Asset is changed in the background
500 - Server error, for more information see errorcode and message
id
- Unique identifier.key
- Keyword for the file to be assigned to an asset or asset type.ifMatch
- Last known version to facilitate optimistic locking.MindsphereException
- if an error occurs while attempting to invoke the API.