assetmanagement.clients package

Submodules

assetmanagement.clients.aspecttype_client module

Asset Management API

Service for configuring, reading and managing assets, asset ~ and aspect types. # noqa: E501

class AspecttypeClient(rest_client_config=None, mindsphere_credentials=None)[source]

Bases: object

static check_supported_field_types(field_type)[source]
delete_aspect_type(request_object)[source]

Delete aspect type

Delete an aspect type. Aspect type can only be deleted if there is no asset type using it.

Parameters:request_object (DeleteAspectTypeRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( id* - The type’s id is a unique identifier. The id’s length must be between 1 and 128 characters and matches the following symbols “A-Z”, “a-z”, “0-9”, “_” and “.” beginning with the tenant prefix what has a maximum of 8 characters. (e.g . ten_pref.type_id) )
Returns:None
get_aspect_type(request_object)[source]

Read an aspect type

Read an aspect type.

Parameters:request_object (GetAspectTypeRequest) – It contains the below parameters –>
( id* - The type’s id is a unique identifier. The id’s length must be between 1 and 128 characters and matches the following symbols “A-Z”, “a-z”, “0-9”, “_” and “.” beginning with the tenant prefix what has a maximum of 8 characters. (e.g . ten_pref.type_id) ),
( If-None-Match - ETag hash of previous request to allow caching )
Returns:AspectTypeResource
get_aspect_types_contains(field_type, filter_value)[source]

Filter aspect types by name or tenantId.

Returns aspect types whose name or tenantId contains the filter value. Only one field type and filter value can be passed. :param FieldTypeEnum field_type: Field type on which aspect types need to be filtered. :param str filter_value: Value based on which aspect types need to be filtered. :return: AspectTypeListResource of type JSON

get_aspect_types_ends_with(field_type, filter_value)[source]

Filter aspect types by name or tenantId.

Returns aspect types whose name or tenantId ends with the filter value. Only one field type and filter value can be passed. :param FieldTypeEnum field_type: Field type on which aspect types need to be filtered. :param str filter_value: Value based on which aspect types need to be filtered. :return: AspectTypeListResource of type JSON

get_aspect_types_equals_to(field_type, filter_value)[source]

Filter aspect types by name or tenantId.

Returns aspect types whose name or tenantId equals to filterValue. Only one field type and value can be passed at a time.

Parameters:
  • field_type (FieldTypeEnum) – Field type on which aspect types need to be filtered.
  • filter_value (str) – Value based on which aspect types need to be filtered.
Returns:

AspectTypeListResource of type JSON

get_aspect_types_like(field_type, *filter_value)[source]

Filter aspect types by name or tenantId.

Returns aspect types whose name or tenantId matches an array of filter values. One field type and multiple filter values can be passed.

Parameters:
  • field_type (FieldTypeEnum) – Field type on which aspect types need to be filtered.
  • filter_value (str) – Value based on which aspect types need to be filtered.
Returns:

AspectTypeListResource of type JSON

get_aspect_types_starts_with(field_type, filter_value)[source]

Filter aspect types by name or tenantId.

Returns aspect types whose name or tenantId starts with the filter value. Only one field type and filter value can be passed.

Parameters:
  • field_type (FieldTypeEnum) – Field type on which aspect types need to be filtered.
  • filter_value (stt) – Value based on which aspect types need to be filtered.
Returns:

AspectTypeListResource of type JSON

list_aspect_types(request_object)[source]

List all aspect types

List all aspect types

Parameters:request_object (ListAspectTypesRequest) – It contains the below parameters –>
( page - Specifies the requested page index ),
( size - Specifies the number of elements in a page ),
( sort - Specifies the ordering of returned elements ),
( filter - Specifies the additional filtering criteria ),
( If-None-Match - ETag hash of previous request to allow caching )
Returns:AspectTypeListResource
save_aspect_type(request_object)[source]

Create or Update an aspect type

Create or Update an aspect type. Only adding variables supported. User can increase the length of a static STRING variable. The length cannot be decreased. The length of a dynamic STRING variable cannot be changed.

Parameters:request_object (SaveAspectTypeRequest) – It contains the below parameters –>
( id* - The type’s id is a unique identifier. The id’s length must be between 1 and 128 characters and matches the following symbols “A-Z”, “a-z”, “0-9”, “_” and “.” beginning with the tenant prefix what has a maximum of 8 characters. (e.g . ten_pref.type_id) ),
( aspecttype* - aspect type ),
( If-Match - Last known version to facilitate optimistic locking. Required for modification. ), |br| ( If-None-Match - Set ifNoneMatch header to “” for ensuring create request )
Returns:AspectTypeResource
update_aspect_type(request_object)[source]

Patch an aspect type

Patch an aspect type. Only adding variables supported. Patching requires the inclusion of already existing variables. Other fields may be omitted. Conforms to RFC 7396 - JSON merge Patch.

Parameters:request_object (UpdateAspectTypeRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( id* - The type’s id is a unique identifier. The id’s length must be between 1 and 128 characters and matches the following symbols “A-Z”, “a-z”, “0-9”, “_” and “.” beginning with the tenant prefix what has a maximum of 8 characters. (e.g . ten_pref.type_id) ),
( aspecttype* - aspect type )
Returns:AspectTypeResource

assetmanagement.clients.assets_client module

Asset Management API

Service for configuring, reading and managing assets, asset ~ and aspect types. # noqa: E501

class AssetsClient(rest_client_config=None, mindsphere_credentials=None)[source]

Bases: object

add_asset(request_object)[source]

Create an asset

Creates a new asset with the provided content. Only instantiable types could be used.

Parameters:request_object (AddAssetRequest) – It contains the below parameters –>
( asset* - asset )
Returns:AssetResourceWithHierarchyPath
static check_supported_field_types(field_type)[source]
delete_asset(request_object)[source]

Delete an asset

Deletes the given asset. After deletion only users with admin role can read it, but modification is not possible anymore. It’s not possible to delete an asset if it has children.

Parameters:request_object (DeleteAssetRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( id* - Unique identifier )
Returns:None
delete_asset_file_assigment(request_object)[source]

Deletes a file assignment from an asset

Deletes a file assignment from an asset. If the asset’s parent type has defined a file with the same key, the key will be displayed with the inherited value.

Parameters:request_object (DeleteAssetFileAssigmentRequest) – It contains the below parameters –>
( id* - Unique identifier ),
( key* - Keyword for the file to be assigned to an asset or asset type. ),
( If-Match* - Last known version to facilitate optimistic locking )
Returns:AssetResourceWithHierarchyPath
delete_asset_with_confirmation(request_object)[source]

delete an asset confiramtion

Parameters:request_object (DeleteAssetConfirmationRequest) – Deletes an asset and returns a boolean which confirms deletion. It internally checks existence of the asset after we receive a confirmation from server. It retries 3 times for getting the confirmation from server. After deletion only users with admin role can read it, but modification is not possible anymore.It's not possible to delete an asset if it has children.
Returns:bool
get_asset(request_object)[source]

Returns an asset.

Read a single asset. All static properties of asset are returned.

Parameters:request_object (GetAssetRequest) – It contains the below parameters –>
( id* - Unique identifier ),
( If-None-Match - ETag hash of previous request to allow caching )
Returns:AssetResourceWithHierarchyPath
get_assets_contains(field_type, filter_value)[source]

Filter assets by name or assetId or tenantId or externalId or subTenant or parentId or typeId.

Returns assets whose name or tenantId contains the filter value. Only one field type and filter value can be passed. :param FieldTypeEnum field_type: Field type on which assets need to be filtered. :param str filter_value: Value based on which assets need to be filtered. :return: AssetListResource of type JSON

get_assets_ends_with(field_type, filter_value)[source]

Filter assets by name or assetId or tenantId or externalId or subTenant or parentId or typeId.

Returns assets whose name or tenantId ends with the filter value. Only one field type and filter value can be passed. :param FieldTypeEnum field_type: Field type on which assets need to be filtered. :param str filter_value: Value based on which assets need to be filtered. :return: AssetListResource of type JSON

get_assets_equals_to(field_type, filter_value)[source]

Filter assets by name or assetId or tenantId or externalId or subTenant or parentId or typeId.

Returns assets whose name or tenantId equals to filterValue. Only one field type and value can be passed at a time.

Parameters:
  • field_type (FieldTypeEnum) – Field type on which assets need to be filtered.
  • filter_value (str) – Value based on which assets need to be filtered.
Returns:

AssetListResource of type JSON

get_assets_like(field_type, *filter_value)[source]

Filter assets by name or assetId or tenantId or externalId or subTenant or parentId or typeId.

Returns assets whose name or tenantId matches an array of filter values. One field type and multiple filter values can be passed.

Parameters:
  • field_type (FieldTypeEnum) – Field type on which assets need to be filtered.
  • filter_value (str) – Variable array of values based on which assets need to be filtered.
Returns:

AssetListResource of type JSON

get_assets_of_type(filter)[source]

Filter all Assets by asset type id. Returns all assets of a particular asset type. Only one field type and filter value can be passed. :param str filter: filter assets of a particular asset type. :return: AssetListResource of type JSON

get_assets_starts_with(field_type, filter_value)[source]

Filter assets by name or assetId or tenantId or externalId or subTenant or parentId or typeId.

Returns assets whose name or tenantId starts with the filter value. Only one field type and filter value can be passed.

Parameters:
  • field_type (FieldTypeEnum) – Field type on which assets need to be filtered.
  • filter_value (str) – Value based on which assets need to be filtered.
Returns:

AssetListResource of type JSON

get_root_asset(request_object)[source]

Returns the root asset of the user.

Read the root asset of the user, from which the whole asset hierarchy can be rebuilt.

Parameters:request_object (GetRootAssetRequest) – It contains the below parameters –>
( If-None-Match - ETag hash of previous request to allow caching )
Returns:RootAssetResource
list_assets(request_object)[source]

List all available assets

List all assets available for the authenticated user. ## Filter Supports all basic fields and the ‘hasType’ filter which search for the assets with type that originated from the given asset type. # Examples Example: This filter searches for assets which type is exactly the given type: ` { "typeId": "mandal.ship" } ` Beyond the basic fields we can search for assets which type is inherited from the given type: ` { "hasType": "mandal.ship" } `

Parameters:request_object (ListAssetsRequest) – It contains the below parameters –>
( page - Specifies the requested page index ),
( size - Specifies the number of elements in a page ),
( sort - Specifies the ordering of returned elements ),
( filter - Specifies the additional filtering criteria ),
( If-None-Match - ETag hash of previous request to allow caching )
Returns:AssetListResource
move_asset(request_object)[source]

Move an asset

Moves an asset (and all it’s children) in the instance hierarchy

Parameters:request_object (MoveAssetRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( id* - Unique identifier ),
( moveParameters* - parameters for the asset move )
Returns:AssetResourceWithHierarchyPath
replace_asset(request_object)[source]

Update an asset

Updates an asset with the provided content. Only values can be modified, asset’s structure have to be modified in asset’s type

Parameters:request_object (ReplaceAssetRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( id* - Unique identifier ),
( asset* - asset )
Returns:AssetResourceWithHierarchyPath
save_asset_file_assignment(request_object)[source]

Save an file assignment to an asset

Save a file assignment to a given asset

Parameters:request_object (SaveAssetFileAssignmentRequest) – It contains the below parameters –>
( id* - Unique identifier ),
( key* - Keyword for the file to be assigned to an asset or asset type. ),
( If-Match* - Last known version to facilitate optimistic locking ),
( assignment* - Data for file assignment )
Returns:AssetResourceWithHierarchyPath
update_asset(request_object)[source]

Patch an asset

Patch an asset with the provided content. Only values can be modified, asset’s structure have to be modified in asset’s type. Conforms to RFC 7396 - JSON merge Patch.

Parameters:request_object (UpdateAssetRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( id* - Unique identifier ),
( asset* - asset )
Returns:AssetResourceWithHierarchyPath

assetmanagement.clients.assettype_client module

Asset Management API

Service for configuring, reading and managing assets, asset ~ and aspect types. # noqa: E501

class AssettypeClient(rest_client_config=None, mindsphere_credentials=None)[source]

Bases: object

static check_supported_field_types(field_type)[source]
delete_asset_type(request_object)[source]

Delete an asset type

Deletes an asset type. Deletion only possible when the type has no child-type and there is no asset that instantiate it.

Parameters:request_object (DeleteAssetTypeRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( id* - The type’s id is a unique identifier. The id’s length must be between 1 and 128 characters and matches the following symbols “A-Z”, “a-z”, “0-9”, “_” and “.” beginning with the tenant prefix what has a maximum of 8 characters. (e.g . ten_pref.type_id) )
Returns:None
delete_asset_type_file_assignment(request_object)[source]

Deletes a file assignment from an asset type

Deletes a file assignment from an asset type. If the type’s parent has defined a file with the same key, the key will be displayed with the inherited value.

Parameters:request_object (DeleteAssetTypeFileAssignmentRequest) – It contains the below parameters –>
( id* - The type’s id is a unique identifier. The id’s length must be between 1 and 128 characters and matches the following symbols “A-Z”, “a-z”, “0-9”, “_” and “.” beginning with the tenant prefix what has a maximum of 8 characters. (e.g . ten_pref.type_id) ),
( key* - Keyword for the file to be assigned to an asset or asset type. ),
( If-Match* - Last known version to facilitate optimistic locking )
Returns:AssetTypeResource
get_asset_type(request_object)[source]

Read an asset type

Read an asset type

Parameters:request_object (GetAssetTypeRequest) – It contains the below parameters –>
( id* - The type’s id is a unique identifier. The id’s length must be between 1 and 128 characters and matches the following symbols “A-Z”, “a-z”, “0-9”, “_” and “.” beginning with the tenant prefix what has a maximum of 8 characters. (e.g . ten_pref.type_id) ),
( If-None-Match - ETag hash of previous request to allow caching ),
( exploded - Specifies if the asset type should include all of it’s inherited variables and aspects. Default is false. )
Returns:AssetTypeResource
get_asset_types_contains(field_type, filter_value)[source]

Filter asset types by name or tenantId or parentTypeId.

Returns asset types whose name or tenantId or parentTypeId contains the filter value. Only one field type and filter value can be passed. :param FieldTypeEnum field_type: Field type on which asset types need to be filtered. :param str filter_value: Value based on which asset types need to be filtered. :return: AssetTypeListResource of type JSON

get_asset_types_ends_with(field_type, filter_value)[source]

Filter asset types by name or tenantId or parentTypeId.

Returns asset types whose name or tenantId or parentTypeId ends with the filter value. Only one field type and filter value can be passed. :param FieldTypeEnum field_type: Field type on which asset types need to be filtered. :param str filter_value: Value based on which asset types need to be filtered. :return: AssetTypeListResource of type JSON

get_asset_types_equals_to(field_type, filter_value)[source]

Filter asset types by name or tenantId or parentTypeId.

Returns asset types whose name or tenantId or parentTypeId equals to filterValue. Only one field type and value can be passed at a time.

Parameters:
  • field_type (FieldTypeEnum) – Field type on which asset types need to be filtered.
  • filter_value (str) – Value based on which asset types need to be filtered.
Returns:

AssetTypeListResource of type JSON

get_asset_types_like(field_type, *filter_value)[source]

Filter asset types by name or tenantId or parentTypeId.

Returns asset types whose name or tenantId or parentTypeId matches an array of filter values. One field type and multiple filter values can be passed.

Parameters:
  • field_type (FieldTypeEnum) – Field type on which asset types need to be filtered.
  • filter_value (str) – Variable array of values based on which asset types need to be filtered.
Returns:

AssetTypeListResource of type JSON

get_asset_types_starts_with(field_type, filter_value)[source]

Filter asset types by name or tenantId or parentTypeId.

Returns asset types whose name or tenantId or parentTypeId starts with the filter value. Only one field type and filter value can be passed.

Parameters:
  • field_type (FieldTypeEnum) – Field type on which asset types need to be filtered.
  • filter_value (stt) – Value based on which asset types need to be filtered.
Returns:

AssetTypeListResource of type JSON

list_asset_types(request_object)[source]

List all asset types

List all asset types

Parameters:request_object (ListAssetTypesRequest) – It contains the below parameters –>
( page - Specifies the requested page index ),
( size - Specifies the number of elements in a page ),
( sort - Specifies the ordering of returned elements ),
( filter - Specifies the additional filtering criteria ),
( If-None-Match - ETag hash of previous request to allow caching ),
( exploded - Specifies if the asset type should include all of it’s inherited variables and aspects. Default is false. )
Returns:AssetTypeListResource
save_asset_type(request_object)[source]

Create or Update an asset type

Create or Update an asset type User can increase the length of a STRING variable. The length cannot be decreased.

Parameters:request_object (SaveAssetTypeRequest) – It contains the below parameters –>
( id* - The type’s id is a unique identifier. The id’s length must be between 1 and 128 characters and matches the following symbols “A-Z”, “a-z”, “0-9”, “_” and “.” beginning with the tenant prefix what has a maximum of 8 characters. (e.g . ten_pref.type_id) ),
( assettype* - asset type ),
( If-Match - Last known version to facilitate optimistic locking. Required for modification. ), |br| ( If-None-Match - Set ifNoneMatch header to “” for ensuring create request ),
( exploded - Specifies if the asset type should include all of it’s inherited variables and aspects. Default is false. )
Returns:AssetTypeResource
save_asset_type_file_assignment(request_object)[source]

Add a new file assignment to an asset type

Add a new file assignment to a given asset type. All asset which extends these types will have its file by default.

Parameters:request_object (SaveAssetTypeFileAssignmentRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( id* - The type’s id is a unique identifier. The id’s length must be between 1 and 128 characters and matches the following symbols “A-Z”, “a-z”, “0-9”, “_” and “.” beginning with the tenant prefix what has a maximum of 8 characters. (e.g . ten_pref.type_id) ),
( key* - Keyword for the file to be assigned to an asset or asset type. ),
( assignment* - Data for file assignment )
Returns:AssetTypeResource
update_asset_type(request_object)[source]

Patch an asset type

Patch an asset type. Patching requires the inclusion of all existing variables and aspects. Missing file assignments will be deleted. Other fields may be omitted. Conforms to RFC 7396 - JSON merge Patch.

Parameters:request_object (UpdateAssetTypeRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( id* - The type’s id is a unique identifier. The id’s length must be between 1 and 128 characters and matches the following symbols “A-Z”, “a-z”, “0-9”, “_” and “.” beginning with the tenant prefix what has a maximum of 8 characters. (e.g . ten_pref.type_id) ),
( assettype* - asset type ),
( exploded - Specifies if the asset type should include all of it’s inherited variables and aspects. Default is false. )
Returns:AssetTypeResource

assetmanagement.clients.billboard_client module

Asset Management API

Service for configuring, reading and managing assets, asset ~ and aspect types. # noqa: E501

class BillboardClient(rest_client_config=None, mindsphere_credentials=None)[source]

Bases: object

get_billboard()[source]

List all links for available resources

List all links for available resources

Returns:BillboardResource

assetmanagement.clients.files_client module

Asset Management API

Service for configuring, reading and managing assets, asset ~ and aspect types. # noqa: E501

class FilesClient(rest_client_config=None, mindsphere_credentials=None)[source]

Bases: object

delete_file(request_object)[source]

Delete a file.

  • Deletion is blocked if there are any file assignment with the given fileId.
Parameters:request_object (DeleteFileRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( fileId* - Unique identifier of the file. )
Returns:None
download_file(request_object)[source]

Returns a file by its id

Returns a file by its id

Parameters:request_object (DownloadFileRequest) – It contains the below parameters –>
( fileId* - Unique identifier of the file. )
Returns:str
get_file(request_object)[source]

Returns a file’s metadata by its id

Returns a file’s metadata by its id

Parameters:request_object (GetFileRequest) – It contains the below parameters –>
( fileId* - Unique identifier of the file. ),
( If-None-Match - ETag hash of previous request to allow caching )
Returns:FileMetadataResource
list_files(request_object)[source]

Get metadata of uploaded files.

Returns all visible file metadata for the tenant. Will NOT return the files.

Parameters:request_object (ListFilesRequest) – It contains the below parameters –>
( page - Specifies the requested page index ),
( size - Specifies the number of elements in a page ),
( sort - Specifies the ordering of returned elements ),
( filter - Specifies the additional filtering criteria ),
( If-None-Match - ETag hash of previous request to allow caching )
Returns:FileMetadataListResource
replace_file(request_object)[source]

Update a file

Update a previously uploaded file * Max file size is 5 MB.

Parameters:request_object (ReplaceFileRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( fileId* - Unique identifier of the file. ),
( file* - The file to upload. The file size cannot be more than 5 MB. ),
( name* - The name of the file ),
( scope* - The scope of the file ),
( description - The description of the file )
Returns:FileMetadataResource
upload_file(request_object)[source]

Upload files to be used in Asset Management.

  • Uploaded files are only visible for the uploader tenant. * Max file size is 5 MB.
Parameters:request_object (UploadFileRequest) – It contains the below parameters –>
( file* - The file to upload. The file size cannot be more than 5 MB. ),
( name* - The name of the file ),
( scope - The scope of the file ),
( description - The description of the file )
Returns:FileMetadataResource

assetmanagement.clients.locations_client module

Asset Management API

Service for configuring, reading and managing assets, asset ~ and aspect types. # noqa: E501

class LocationsClient(rest_client_config=None, mindsphere_credentials=None)[source]

Bases: object

delete_asset_location(request_object)[source]

Delete location assigned to given asset.

  • Only those locations can be deleted here which assigned to the given asset. * If the location inherited from an ancestor asset, you have to delete the location with the assigned assetId (using ‘location’ url in AssetResource object with DELETE method). * The response contains the updated AssetResource with the inherited Location details.
Parameters:request_object (DeleteAssetLocationRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( id* - Unique identifier )
Returns:AssetResourceWithHierarchyPath
save_asset_location(request_object)[source]

Create or Update location assigned to given asset

  • If the given asset has own location, this endpoint will update that location. * If the given asset has no location, this endpoint will create a new location and update the given asset. * If the given asset has inherited location, this endpoint will create a new location and update the given asset. If you wanted to update the inherited location you have to use the ‘location’ url in AssetResource object (with PUT method).
Parameters:request_object (SaveAssetLocationRequest) – It contains the below parameters –>
( If-Match* - Last known version to facilitate optimistic locking ),
( id* - Unique identifier ),
( location* - location )
Returns:None

assetmanagement.clients.structure_client module

Asset Management API

Service for configuring, reading and managing assets, asset ~ and aspect types. # noqa: E501

class StructureClient(rest_client_config=None, mindsphere_credentials=None)[source]

Bases: object

list_asset_aspects(request_object)[source]

Get all aspects of an asset

Get all static and dynamic aspects of a given asset

Parameters:request_object (ListAssetAspectsRequest) – It contains the below parameters –>
( id* - Unique identifier ),
( page - Specifies the requested page index ),
( size - Specifies the number of elements in a page ),
( sort - Specifies the ordering of returned elements ),
( filter - Specifies the additional filtering criteria ),
( If-None-Match - ETag hash of previous request to allow caching )
Returns:AspectListResource
list_asset_variables(request_object)[source]

Get all variables of an asset

Get all variables of a given asset including inherited ones

Parameters:request_object (ListAssetVariablesRequest) – It contains the below parameters –>
( id* - Unique identifier ),
( page - Specifies the requested page index ),
( size - Specifies the number of elements in a page ),
( sort - Specifies the ordering of returned elements ),
( filter - Specifies the additional filtering criteria ),
( If-None-Match - ETag hash of previous request to allow caching )
Returns:VariableListResource

Module contents