cloudos-cli 2.42.0__tar.gz → 2.43.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/PKG-INFO +1 -1
- cloudos_cli-2.43.0/cloudos_cli/_version.py +1 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/clos.py +41 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/datasets/datasets.py +1 -5
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/jobs/job.py +1 -5
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli.egg-info/PKG-INFO +1 -1
- cloudos_cli-2.42.0/cloudos_cli/_version.py +0 -1
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/LICENSE +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/README.md +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/__init__.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/__main__.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/configure/__init__.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/configure/configure.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/datasets/__init__.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/import_wf/__init__.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/import_wf/import_wf.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/jobs/__init__.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/link/__init__.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/link/link.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/queue/__init__.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/queue/queue.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/utils/__init__.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/utils/array_job.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/utils/cloud.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/utils/details.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/utils/errors.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/utils/requests.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli/utils/resources.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli.egg-info/SOURCES.txt +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli.egg-info/dependency_links.txt +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli.egg-info/entry_points.txt +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli.egg-info/requires.txt +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/cloudos_cli.egg-info/top_level.txt +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/setup.cfg +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/setup.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/tests/__init__.py +0 -0
- {cloudos_cli-2.42.0 → cloudos_cli-2.43.0}/tests/functions_for_pytest.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.43.0'
|
|
@@ -883,3 +883,44 @@ class Cloudos:
|
|
|
883
883
|
if r.status_code >= 400:
|
|
884
884
|
raise BadRequestException(r)
|
|
885
885
|
return r
|
|
886
|
+
|
|
887
|
+
def get_project_id_from_name(self, workspace_id, project_name, verify=True):
|
|
888
|
+
"""Retrieve the project ID from its name.
|
|
889
|
+
|
|
890
|
+
Parameters
|
|
891
|
+
----------
|
|
892
|
+
workspace_id : str
|
|
893
|
+
The CloudOS workspace ID to search for the project.
|
|
894
|
+
project_name : str
|
|
895
|
+
The name of the project to search for.
|
|
896
|
+
verify : [bool | str], optional
|
|
897
|
+
Whether to use SSL verification or not. Alternatively, if
|
|
898
|
+
a string is passed, it will be interpreted as the path to
|
|
899
|
+
the SSL certificate file. Default is True.
|
|
900
|
+
|
|
901
|
+
Returns
|
|
902
|
+
-------
|
|
903
|
+
dict
|
|
904
|
+
The server response containing project details.
|
|
905
|
+
|
|
906
|
+
Raises
|
|
907
|
+
------
|
|
908
|
+
BadRequestException
|
|
909
|
+
If the request to retrieve the project fails with a status code
|
|
910
|
+
indicating an error.
|
|
911
|
+
"""
|
|
912
|
+
headers = {
|
|
913
|
+
"Content-type": "application/json",
|
|
914
|
+
"apikey": self.apikey
|
|
915
|
+
}
|
|
916
|
+
url = f"{self.cloudos_url}/api/v2/projects?teamId={workspace_id}&search={project_name}"
|
|
917
|
+
response = retry_requests_get(url, headers=headers, verify=verify)
|
|
918
|
+
if response.status_code >= 400:
|
|
919
|
+
raise BadRequestException(response)
|
|
920
|
+
content = json.loads(response.content)
|
|
921
|
+
|
|
922
|
+
project_id = next((p.get("_id") for p in content.get("projects", []) if p.get("name") == project_name), None)
|
|
923
|
+
if project_id is None:
|
|
924
|
+
raise ValueError(f"[Error] Project '{project_name}' was not found in workspace '{workspace_id}'")
|
|
925
|
+
|
|
926
|
+
return project_id
|
|
@@ -118,11 +118,7 @@ class Datasets(Cloudos):
|
|
|
118
118
|
elif "importsFile" in element.keys() and element["importsFile"] == importsfile:
|
|
119
119
|
return element["_id"]
|
|
120
120
|
elif resource == 'projects':
|
|
121
|
-
|
|
122
|
-
# New API projects endpoint spec
|
|
123
|
-
for element in content:
|
|
124
|
-
if element["name"] == name:
|
|
125
|
-
return element["_id"]
|
|
121
|
+
return self.get_project_id_from_name(workspace_id, self.project_name, verify=verify)
|
|
126
122
|
if mainfile is not None:
|
|
127
123
|
raise ValueError(f'[ERROR] A workflow named \'{name}\' with a mainFile \'{mainfile}\'' +
|
|
128
124
|
f' and an importsFile \'{importsfile}\' was not found')
|
|
@@ -164,11 +164,7 @@ class Job(Cloudos):
|
|
|
164
164
|
elif "importsFile" in element.keys() and element["importsFile"] == importsfile:
|
|
165
165
|
return element["_id"]
|
|
166
166
|
elif resource == 'projects':
|
|
167
|
-
|
|
168
|
-
# New API projects endpoint spec
|
|
169
|
-
for element in content:
|
|
170
|
-
if element["name"] == name:
|
|
171
|
-
return element["_id"]
|
|
167
|
+
return self.get_project_id_from_name(workspace_id, self.project_name, verify=verify)
|
|
172
168
|
if mainfile is not None:
|
|
173
169
|
raise ValueError(f'[ERROR] A workflow named \'{name}\' with a mainFile \'{mainfile}\'' +
|
|
174
170
|
f' and an importsFile \'{importsfile}\' was not found')
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '2.42.0'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|