sdi.clients package¶
Submodules¶
sdi.clients.custom_datatypes_client module¶
SDI - Semantic Data Interconnect APIs
-
class
CustomDatatypesClient
(rest_client_config=None, mindsphere_credentials=None)[source]¶ Bases:
object
-
create_data_types
(request_object)[source]¶ Custom datatype registration.
Initiates a registration for list of custom datatypes for given datatype name and regular expression patterns. There can be one or more pattern for a given custom data type. The custom datatype is being used by DataUpload process during schema generation. The custom datatype registration is rejected for the current tenant if invalid regular expression pattern is provided. The custom datatype applies to all the files ingested for the current tenant. The tenant can have maximum 200 datatypes per tenant and each datatype cannot exceed 10 regular expression pattern per datatypename. This returns unique **name* that can be used to retrieve the custom data type.
Parameters: request_object (DataTypesPostRequest) – It contains the below parameters –>
( dataTypeDefinition* - dataTypeDefinition )Returns: DataTypeDefinition
-
create_suggest_patterns
(request_object)[source]¶ Generates the regular expression patterns for a given set of sample values
Generates the regular expression patterns for a given set of sample values. In this case sampleValues generates a number of regex patterns and tries to match with patterns provided in testValues. The response contains any of testValues that matches sampleValues as probable pattern match.
Parameters: request_object (SuggestPatternsPostRequest) – It contains the below parameters –>
( sampleValues* - sampleValues ),
( testValues* - testValues )Returns: ListOfPatterns
-
delete_data_types_name
(name)[source]¶ Deletes custom datatype for a given datatype name
Deletes custom datatype for a given datatype name if it is not being used by any schema
Parameters: request_object (DataTypesNameDeleteRequest) – It contains the below parameters –>
( name* - name )Returns: None
-
get_data_types
(request_object)[source]¶ Retrieves the custom datatypes for the current tenant.
Retrieves custom datatypes for the current tenant containing data type name and one or more registered patterns.
Parameters: request_object (DataTypesGetRequest) – It contains the below parameters –>
( pageToken - Selects next page. Value must be taken rom response body property ‘page.nextToken’. If omitted, first page is returned. )Returns: ListOfDataTypeDefinition
-
sdi.clients.data_ingest_client module¶
SDI - Semantic Data Interconnect APIs
-
class
DataIngestClient
(rest_client_config=None, mindsphere_credentials=None)[source]¶ Bases:
object
-
create_data_upload
(file)[source]¶ Upload the given file for the current tenant. The input file must be less than 100MB in size.
Initiate the file upload process for provided file under the current tenant.
Parameters: file (DataUploadPostRequest) – It contains the below parameters –>
( file* - Select the file to Upload for SDI process )Returns: SdiFileUploadResponse
-
create_ingest_jobs
(request_object)[source]¶ Ingest the provided file and start SDI’s schema generation process.
Initiate the data ingestion and start the SDI’s schema generation process for the current tenant. This operation currently supports CSV and XML format files. The XML format file requires root element information that is entry point for this operation. This is provided as either rootTag parameter to this operation or registered as part of Data Registry API operation. There are two modes for data ingest. * Default: Allows performing the data ingest without need of any Data Registry. In this case service processes files with default policy for schema generation. The schema generated this way cannot be versioned or changed with different files. This mode is used for quick validating the generated schema. * Dataregistry: The operation uses Data Registry for ingested file to generate schema. This is preferred mode as it allows more validation against the Data Registry and create multiple schema based on different domains created under Data Registry. Using this mode customer can create combination of schemas from different domain and query them or use for analytical modelling. This works in combination with Data Registry API.
Parameters: request_object (IngestJobsPostRequest) – It contains the below parameters –>
( ingestData* - Specifies the file path and Data Registry information to initiate data ingest process. The ‘{filePath}’ is required parameter and valid file path used during file upload operations. The ‘{dataTag}’ and ‘{sourceName}’ are the valid Data Registry source name and data tag. The ‘{rootTag}’ is optional and applies to XML formatted files. )Returns: SdiJobStatusResponse
-
get_ingest_job_status
(request_object)[source]¶ Retrieve a list of jobIds.
Get a list of jobIds that is ingested, this jobId can be used to find detailed status using ingestJobStatus.
Parameters: request_object (IngestJobStatusGetRequest) – It contains the below parameters –>
( pageToken - Selects next page. Value must be taken rom response body property ‘page.nextToken’. If omitted, first page is returned. )Returns: ListOfJobIds
-
get_ingest_job_status_id
(id)[source]¶ Retreive the job status.
Retrieve the job status based on jobid for the current tenant. The jobid belongs to data ingestion process started for the current tenant.
Parameters: id (IngestJobStatusIdGetRequest) – It contains the below parameters –>
( id* - job ID )Returns: SdiJobStatusResponse
-
sdi.clients.data_lake_client module¶
SDI - Semantic Data Interconnect APIs
-
class
DataLakeClient
(rest_client_config=None, mindsphere_credentials=None)[source]¶ Bases:
object
-
create_data_lakes
(request_object)[source]¶ Creates a data lake record with a given data lake type and base path
Creates a data lake record with given data lake type, name and base path. To use IDL as preferred data lake, use type as MindSphere and name as IDL. The possible values for type is MindSphere or Custom.
Parameters: request_object (DataLakesPostRequest) – It contains the below parameters –>
( createDataLakeRequest* - createDataLakeRequest )Returns: CreateDataLakeResponse
-
get_data_lakes
()[source]¶ Retrieves all DataLakes
Retrieves base path for a given data lake type, this will return an empty array when no datalake is found.
Returns: DataLakeList
-
get_data_lakes_id
(data_lake_id)[source]¶ Retrieves DataLake for a given DataLake Id
Retrieves DataLake for a given DataLake Id
Parameters: request_object (DataLakesIdGetRequest) – It contains the below parameters –>
( id* - id of the data lake )Returns: DataLakeResponse
-
update_data_lakes_id
(id, request_object)[source]¶ Updates base path for a given data lake type
Updates base path for a given data lake type
Parameters: request_object (DataLakesIdPatchRequest) – It contains the below parameters –>
( id* - id of the data lake ),
( updateDataLakeRequest* - updateDataLakeRequest )Returns: DataLakeResponse
-
sdi.clients.data_query_operations_client module¶
SDI - Semantic Data Interconnect APIs
-
class
DataQueryOperationsClient
(rest_client_config=None, mindsphere_credentials=None)[source]¶ Bases:
object
-
create_queries
(request_object)[source]¶ Create new queries
Returns id of created query
Parameters: request_object (QueriesPostRequest) – It contains the below parameters –>
( dataQuerySQLRequest* - dataQuerySQLRequest )Returns: DataQuerySQLResponse
-
create_queries_id_execution_jobs
(id, request_object)[source]¶ Create execution job for dynamic query. There is soft limit of upto 10 number of parameters and aliases.
Returns id of created job
Parameters: request_object (QueriesIdExecutionJobsPostRequest) – It contains the below parameters –>
( id* - query id ),
( dataQueryExecuteRequest* - dataQueryExecuteRequest )Returns: DataQueryExecuteQueryResponse
-
delete_execution_jobs_id
(id)[source]¶ Delete job by job id
Returns NO CONTENT HTTP Status
Parameters: request_object (ExecutionJobsIdDeleteRequest) – It contains the below parameters –>
( id* - id )Returns: str
-
delete_queries_id
(id)[source]¶ Delete query by query id
Returns NO CONTENT HTTP Status
Parameters: id (QueriesIdDeleteRequest) – It contains the below parameters –>
( id* - id )Returns: str
-
get_execution_jobs
(request_object)[source]¶ Retrieve all jobs
Returns a list of Data Query Execution Model
Parameters: request_object (ExecutionJobsGetRequest) – It contains the below parameters –>
( pageToken - Selects next page. Value must be taken rom response body property ‘page.nextToken’. If omitted, first page is returned. ),
( queryId - Filter based on query id ),
( status - Filter based on job status )Returns: ResponseAllDataQueryExecutionResponse
-
get_execution_jobs_id
(id)[source]¶ Retrieve job details by job id
Returns Data Query Execution Model
Parameters: id (ExecutionJobsIdGetRequest) – It contains the below parameters –>
( id* - execution jobId )Returns: DataQueryExecutionResponse
-
get_execution_jobs_id_results
(id, range)[source]¶ Retrieve query results by job id
Returns query results
Parameters: request_object (ExecutionJobsIdResultsGetRequest) – It contains the below parameters –>
( id* - execution jobId ),
( Range - Part of a file to return in Bytes, eg bytes=200-600 )Returns: QueryResult
-
get_queries
(request_object)[source]¶ Retrieve all queries
Returns a list of Data Query SQL Model
Parameters: request_object (QueriesGetRequest) – It contains the below parameters –>
( pageToken - Selects next page. Value must be taken rom response body property ‘page.nextToken’. If omitted, first page is returned. ),
( executable - Filter based on executable flag ),
( isDynamic - Filter based on isDynamic flag ),
( ontologyId - Filter based on ontology id )Returns: ResponseAllDataSQLQuery
-
get_queries_id
(request_object)[source]¶ Retrieve query by query id
Returns a Data Query SQL Model
Parameters: request_object (QueriesIdGetRequest) – It contains the below parameters –>
( id* - id )Returns: NativeQueryGetResponse
-
get_queries_id_execution_jobs_latest_results
(id, range)[source]¶ Retrieve latest query results by query id
Returns query results
Parameters: request_object (QueriesIdExecutionJobsLatestResultsGetRequest) – It contains the below parameters –>
( id* - query id ),
( Range - Part of a file to return in Bytes, eg bytes=200-600 )Returns: QueryResult
-
sdi.clients.data_registry_client module¶
SDI - Semantic Data Interconnect APIs
-
class
DataRegistryClient
(rest_client_config=None, mindsphere_credentials=None)[source]¶ Bases:
object
-
create_data_registries
(request_object)[source]¶ Add a new Data Registry entry
Initiate creation of Data Registry for the current tenant. The Data Registry information is used during data ingest for the tenant. Only one Data Registry can be created for a request. The dataTag, sourceName and fileUploadStrategy is required to create Date Registry otherwise creation is rejected. DataUpload will allow only files to be uploaded matching this Data Registry. This returns unique registryId for each request that can be used to retrieve the created registry. The tenant cannot have more than 500 data registries in the system. The schemaFrozen flag must be set to false during creation of a registry. It can be set to true after creation of the initial schema for the registry. Data partitioning on the registry can be optionally enabled by specifying a single partitionKey at the time of registry creation. The property value can be set to “sdi-default-partition-key” to enable default partitioning based on the sdi_hour attribute. The property can also be set to a custom attribute present in the data to enable custom partitioning based on that attribute.
Parameters: request_object (DataRegistriesPostRequest) – It contains the below parameters –>
( createDataRegistryRequest* - createDataRegistryRequest )Returns: DataRegistry
-
delete_data_registries_id
(id)[source]¶ Deletes Data Registry for a given registry id
Deletes registry for a registry id
-
get_data_registries
(request_object)[source]¶ Retrieves Data Registry entries
Retrieves all Data Registry entries, Data Registry based on sourceName, dataTag or combination of sourceName and dataTag.
Parameters: request_object (DataRegistriesGetRequest) – It contains the below parameters –>
( dataTag - dataTag ),
( sourceName - sourceName ),
( pageToken - Selects next page. Value must be taken rom response body property ‘page.nextToken’. If omitted, first page is returned. )Returns: ListOfRegistryResponse
-
get_data_registries_id
(id)[source]¶ Retrieves Data Registry for a given registry id
Retrieves registry for a registry id
Parameters: request_object (DataRegistriesIdGetRequest) – It contains the below parameters –>
( id* - Unique identifier of the Data Registry. )Returns: DataRegistry
-
update_data_registries_id
(id, request_object)[source]¶ Updates a Data Registry
Update Data Registry entries for a given Data Registry Id. The registry attributes sourceName, dataTag and partitionKeys cannot be updated.
Parameters: request_object (DataRegistriesIdPatchRequest) – It contains the below parameters –>
( id* - Unique identifier of the Data Registry. ),
( updateDataRegistryRequest* - updateDataRegistryRequest )Returns: DataRegistry
-
sdi.clients.iot_dataregistry_client module¶
SDI - Semantic Data Interconnect APIs
-
class
IotDataRegistryClient
(rest_client_config=None, mindsphere_credentials=None)[source]¶ Bases:
object
-
create_iot_data_registries
(request_object)[source]¶ Add a new IoT Data Registry entry
Create new IoT Data Registry with MindSphereAssetId and AspectName
Parameters: request_object (IotDataRegistriesPostRequest) – It contains the below parameters –>
( IotDataRegistry* - IotDataRegistry object )Returns: IotDataRegistryResponse
-
get_iot_data_registries
(request_object)[source]¶ Retrieves an IoT Data Registry entries
Retrieves an IoT Data Registry with MindSphere AssetId and AspectName
Parameters: request_object (IotDataRegistriesGetRequest) – It contains the below parameters –>
( filter - filter ),
( pageToken - Selects next page. Value must be taken rom response body property ‘page.nextToken’. If omitted, first page is returned. )Returns: ListOfIoTRegistryResponse
-
sdi.clients.ontologies_client module¶
SDI - Semantic Data Interconnect APIs
-
class
OntologiesClient
(rest_client_config=None, mindsphere_credentials=None)[source]¶ Bases:
object
-
delete_ontologies_id
(id)[source]¶ Delete ontology
Delete ontology
Parameters: id (OntologiesIdDeleteRequest) – It contains the below parameters –>
( id* - id )Returns: None
-
get_ontologies
(request_object)[source]¶ Retrieve all ontologies
Returns a list of ontologies
Parameters: request_object (OntologiesGetRequest) – It contains the below parameters –>
( pageToken - Selects next page. Value must be taken rom response body property ‘page.nextToken’. If omitted, first page is returned. )Returns: ResponseAllOntologies
-
get_ontologies_id
(id, range)[source]¶ Retrieve ontology.
Retrieve ontology.
Parameters: request_object (OntologiesIdGetRequest) – It contains the below parameters –>
( id* - id ),
( Range - Part of a file to return in Bytes, eg bytes=200-600 )Returns: OntologyResponseData
-
infer_ontology
(request_object)[source]¶ Infer semantic model based on two or more generated schemas. Currently it supports infer of upto 20 schemas.
Infer semantic model to create ontology based on two or more schemas
Parameters: request_object (InferOntologyPostRequest) – It contains the below parameters –>
( inferSchemaSearchRequest* - Provide two or more schemas to infer an ontology. )Returns: None
-
sdi.clients.ontologies_operations_client module¶
SDI - Semantic Data Interconnect APIs
-
class
OntologiesOperationsClient
(rest_client_config=None, mindsphere_credentials=None)[source]¶ Bases:
object
-
create_ontology_jobs
(request_object)[source]¶ Upload file and submit job for create/update ontology
Upload file and submit job for create/update ontology
Parameters: request_object (OntologyJobsPostRequest) – It contains the below parameters –>
( ontologyName* - - Ontology name should be unique. ),
( ontologyDescription - - Ontology description. ),
( ontologyId - - Provide OntologyId for updating existing ontology. If empty then will create new ontology. ),
( keyMappingType - - Define keyMappingType for ontology. ),
( file - - We support JSON and OWL file pre-defined format. )Returns: OntologyJob
-
sdi.clients.schema_registry_client module¶
SDI - Semantic Data Interconnect APIs
-
class
SchemaRegistryClient
(rest_client_config=None, mindsphere_credentials=None)[source]¶ Bases:
object
-
create_search_schemas
(query_parameters, request_object)[source]¶ Search schema for ingested data.
The data ingestion API creates and stores the schemas for each ingested file. This schema can be retrieved based on schema name, or source name and data tag combination. SchemaSearchRequest is limited to 20 schemas atmost.
Parameters: request_object (SearchSchemasPostRequest) – It contains the below parameters –>
( schemaSearchRequest* - schemaSearchRequest ),
( pageToken - Selects next page. Value must be taken rom response body property ‘page.nextToken’. If omitted, first page is returned. )Returns: ListOfSchemaRegistry
-