Skip to content

[patch] remove uuid for Predict II #755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions iotfunctions/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def retrieve_entity_type_metadata(raise_error=True, **kwargs):
"""
db = kwargs['_db']
# get kpi functions metadata
meta = db.http_request(object_type='input', object_name=kwargs['resourceUuId'], request='GET',
meta = db.http_request(object_type='input', object_name=kwargs['resourceId'], request='GET',
raise_error=raise_error)
try:
meta = json.loads(meta)
Expand Down Expand Up @@ -1894,7 +1894,7 @@ def publish_kpis(self, raise_error=True):
'output': output_item_name
}
export.append(kpi_function_metadata)
response = self.db.http_request(object_type='kpiFunctions', object_name=self._entity_type_id,
response = self.db.http_request(object_type='kpiFunctions', object_name=self._entity_type_uuid,
request='POST',
payload=kpi_function_metadata, raise_error=raise_error)

Expand Down Expand Up @@ -1945,7 +1945,7 @@ def create_sample_data(self, drop_existing, generate_days, generate_entities=Non
# Write dimension data to the entity list
if self._generated_dimension_payload:
logger.debug(self._generated_dimension_payload)
response = self.db.http_request(object_type='dimensions', object_name=self._entity_type_id,
response = self.db.http_request(object_type='dimensions', object_name=self._entity_type_uuid,
request='PUT',
payload=self._generated_dimension_payload, raise_error=True)

Expand All @@ -1959,7 +1959,7 @@ def populate_entity_list_table(self):
payload_new_devices.append({"name": self._start_entity_id + i})

try:
response = self.db.http_request(object_type='devices', object_name=self._entity_type_id, request='POST',
response = self.db.http_request(object_type='devices', object_name=self._entity_type_uuid, request='POST',
payload=payload_new_devices, raise_error=True)
except Exception as ex:
raise RuntimeError("Devices could not be created in configuration.") from ex
Expand Down Expand Up @@ -2076,7 +2076,7 @@ def get_server_params(self):
logger.debug(msg)
return {}

meta = self.db.http_request(object_type='constants', object_name=self._entity_type_id, request='GET')
meta = self.db.http_request(object_type='constants', object_name=self._entity_type_uuid, request='GET')
try:
meta = json.loads(meta)
except (TypeError, json.JSONDecodeError):
Expand Down Expand Up @@ -2167,7 +2167,6 @@ class ServerEntityType(EntityType):
def __init__(self, resource_id, db, db_schema):

self.db = db
self.resource_id = resource_id

# get server metadata
server_meta = db.http_request(object_type='input', object_name=resource_id, request='GET',
Expand Down Expand Up @@ -2215,6 +2214,7 @@ def __init__(self, resource_id, db, db_schema):

# map server properties to entity type properties
self._entity_type_id = server_meta['resourceId']
self._entity_type_uuid = server_meta['resourceUuId']
self._db_schema = server_meta['schemaName']
self._timestamp = server_meta['metricTimestampColumn']
self._dimension_table_name = server_meta['dimensionsTable']
Expand Down Expand Up @@ -2242,7 +2242,7 @@ def __init__(self, resource_id, db, db_schema):
# server and copied onto the entity type

params = {}
c_meta = db.http_request(object_type='constants', object_name=resource_id, request='GET')
c_meta = db.http_request(object_type='constants', object_name=self._entity_type_uuid, request='GET')
try:
c_meta = json.loads(c_meta)
except (TypeError, json.JSONDecodeError):
Expand Down Expand Up @@ -2539,7 +2539,7 @@ def publish_kpis(self, raise_error=True):
if output_meta:
kpi_function_metadata['outputMeta'] = output_meta
export.append(kpi_function_metadata)
response = self.db.http_request(object_type='kpiFunctions', object_name=self._entity_type_id,
response = self.db.http_request(object_type='kpiFunctions', object_name=self._entity_type_uuid,
request='POST',
payload=kpi_function_metadata, raise_error=raise_error)

Expand Down
Loading