Skip to content
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

Adminhost Util Functions doesn't work #1161

Open
onefloid opened this issue Oct 11, 2024 · 0 comments
Open

Adminhost Util Functions doesn't work #1161

onefloid opened this issue Oct 11, 2024 · 0 comments

Comments

@onefloid
Copy link
Contributor

Hi,

at the moment I try out the features to get, create and delete TM1 Instances using functions in Util.py

The following functions doesnt work for my setup with v11.

  • create_server_on_adminhost
  • delete_server_on_adminhost
  • update_server_on_adminhost

The error message ist:

Traceback (most recent call last):
File "D:\dev\tm1-deploy\tm1server.py", line 29, in
create_server_on_adminhost(server_as_dict=new_server)
File "D:\dev\tm1-deploy.venv\Lib\site-packages\TM1py\Utils\Utils.py", line 205, in create_server_on_adminhost
response.raise_for_status()
File "D:\dev\tm1-deploy.venv\Lib\site-packages\requests\models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://localhost:5895/Servers

The function get_all_servers_from_adminhost works.

I think the following change in commit 4a47b53 breaks these functions because the api version is moved to the base_url property of the RestService. But the functions in Utils doesn't use the RestService. They construct the url itselfs.

The changes were necessary to enable a connection to v12 in IBM Cloud. Are these adminhost feature still available in v12?

Here one example of the changed code.

old
url = f"http://{adminhost}:5895/api/v1/Servers"

new
url = f"http://{adminhost}:5895/Servers"

https://github.com/cubewise-code/tm1py/blame/4a5fed26a9bd378091d9581c46f1fb55910b0f6f/TM1py/Utils/Utils.py#L203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant