Skip to content

After upgrading to 2.0.1, TM1py fails when a URL contains 'api/v1' inside. #1056

@svbtropical

Description

@svbtropical

Describe the bug
TM1py fails to get some data from TM1 (I'm using V11) when the URL contains '/api/v1'.

To Reproduce

Establish a connection using TM1Py 2.0.1 to a TM1 instance and retrieve for instance the count of subsets, like this:

	from tm1py import TM1Service
	tm1 = TM1Service(...)
	connection = tm1.connection.GET("/api/v1/Dimensions('Organization')/Hierarchies('Organization')/Subsets('North')/Elements/$count")

An error is triggered:

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "C:\Users\elias\anaconda3\envs\test-service\lib\site-packages\TM1py\Services\RestService.py", line 500, in GET
    return self.request(
  File "C:\Users\elias\anaconda3\envs\test-service\lib\site-packages\TM1py\Services\RestService.py", line 296, in request
    self.verify_response(response=response)
  File "C:\Users\elias\anaconda3\envs\test-service\lib\site-packages\TM1py\Services\RestService.py", line 888, in verify_response
    raise TM1pyRestException(response.text,
TM1py.Exceptions.Exceptions.TM1pyRestException: Text: '{"error":{"code":"278","message":"'api' resource can not be resolved on type 'EntityContainer'."}}' - Status Code: 404 - Reason: 'Not Found' - Headers: {'Content-Length': '106', 'Connection': 'keep-alive', 'Content-Encoding': 'gzip', 'Cache-Control': 'no-cache', 'Content-Type': 'application/json; charset=utf-8', 'OData-Version': '4.0'}

But, after removing the "/api/v1/" part from the URL, like below:

	from tm1py import TM1Service
	tm1 = TM1Service(...)
	connection = tm1.connection.GET("/Dimensions('Organization')/Hierarchies('Organization')/Subsets('North')/Elements/$count")

It works!

Expected behavior
TM1py should accept URLs containing '/api/v1' when the TM1 Version accepts them.

Version
TM1py 2.0.1
TM1 Server Version: 11.8.01900.10

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions