Doug Creighton
09/26/2024, 3:27 PM# Get declarative workspace
declarative_workspace = sdk_production.catalog_workspace.get_declarative_workspace(workspace_id="tenant-reporting-base")
sdk_sandbox.catalog_workspace.put_declarative_workspace(workspace_id="tenant-reporting-base-clone",workspace=declarative_workspace)
Error
---------------------------------------------------------------------------
UnauthorizedException Traceback (most recent call last)
Cell In[26], line 1
----> 1 sdk_sandbox.catalog_workspace.put_declarative_workspace(workspace_id="tenant-reporting-base",workspace=declarative_workspace)
File ~/Library/Python/3.9/lib/python/site-packages/gooddata_sdk/catalog/workspace/service.py:342, in CatalogWorkspaceService.put_declarative_workspace(self, workspace_id, workspace, standalone_copy)
340 workspace = copy.deepcopy(workspace)
341 workspace.remove_wdf_refs()
--> 342 self._layout_api.put_workspace_layout(workspace_id, workspace.to_api())
File ~/Library/Python/3.9/lib/python/site-packages/gooddata_api_client/api/layout_api.py:3358, in LayoutApi.put_workspace_layout(self, workspace_id, declarative_workspace_model, **kwargs)
3354 kwargs['workspace_id'] = \
3355 workspace_id
3356 kwargs['declarative_workspace_model'] = \
3357 declarative_workspace_model
-> 3358 return self.put_workspace_layout_endpoint.call_with_http_info(**kwargs)
File ~/Library/Python/3.9/lib/python/site-packages/gooddata_api_client/api_client.py:880, in Endpoint.call_with_http_info(self, **kwargs)
877 if content_types_list:
878 params['header']['Content-Type'] = content_types_list
--> 880 return self.api_client.call_api(
881 self.settings['endpoint_path'], self.settings['http_method'],
882 params['path'],
883 params['query'],
884 params['header'],
...
UnauthorizedException: Status Code: 401
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Date': 'Thu, 26 Sep 2024 15:22:03 GMT', 'Content-Length': '9', 'Connection': 'keep-alive', 'Vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'X-Content-Type-Options': 'nosniff', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains', 'X-XSS-Protection': '0', 'Referrer-Policy': 'no-referrer', 'set-cookie': 'SPRING_REDIRECT_URI=; Max-Age=0; Expires=Thu, 26 Sep 2024 15:22:03 GMT; Path=/; Secure; HTTPOnly; SameSite=None'})
HTTP response body: /appLogin
Ivana Gasparekova
09/26/2024, 6:25 PMDoug Creighton
09/26/2024, 7:31 PMIvana Gasparekova
09/26/2024, 9:23 PMDoug Creighton
09/27/2024, 2:34 PMsdk_production
or sdk_sandbox
But it goes like its supposed to - I have successfully pulled the workspace but getting denied as you can see from the error on the put
from gooddata_sdk import GoodDataSdk
host = {}
token = {}
sdk_sandbox = GoodDataSdk.create(host, token)
Ivana Gasparekova
09/30/2024, 9:54 AMIvana Gasparekova
10/01/2024, 3:17 PMDoug Creighton
10/02/2024, 5:01 PMDoug Creighton
10/02/2024, 8:53 PMDoug Creighton
10/04/2024, 5:12 PMIvana Gasparekova
10/07/2024, 3:37 PMRadek Novacek
10/14/2024, 8:47 AMGreta
10/17/2024, 7:26 AMRadek Novacek
10/17/2024, 9:17 AMMoises Morales
10/18/2024, 12:22 PM