@@ -330,7 +330,7 @@ def get_projects_by_external_id(self, ext_id_name, ext_id_value=""):
330330 def get_projects_by_group (self , group , all_details = False ):
331331 """Get projects by group.
332332
333- API endpoint: GET /projects
333+ API endpoint: GET /projects?group=
334334
335335 :param group: the group the projects shall belong to
336336 :type group: string
@@ -349,6 +349,25 @@ def get_projects_by_group(self, group, all_details=False):
349349 resp = resp ["_embedded" ]["sw360:projects" ]
350350 return resp
351351
352+ def get_projects_by_tag (self , tag ):
353+ """Get projects by tag.
354+
355+ API endpoint: GET /projects?tag=
356+
357+ :param group: the group the projects shall belong to
358+ :type group: string
359+ :return: list of projects
360+ :rtype: list of JSON project objects
361+ :raises SW360Error: if there is a negative HTTP response
362+ """
363+ full_url = self .url + "resource/api/projects?tag=" + tag
364+ resp = self .api_get (full_url )
365+ if not resp :
366+ return None
367+
368+ resp = resp ["_embedded" ]["sw360:projects" ]
369+ return resp
370+
352371 def download_license_info (self , project_id , filename , generator = "XhtmlGenerator" ,
353372 variant = "DISCLOSURE" ):
354373 """Gets the license information, aka Readme_OSS for the project
@@ -587,6 +606,23 @@ def get_release_by_url(self, release_url):
587606 resp = self .api_get (release_url )
588607 return resp
589608
609+ def get_releases_by_name (self , name ):
610+ """Gets a list of releases that match the given name.
611+
612+ API endpoint: GET /releases?name=
613+
614+ :param name: the name
615+ :type name: string
616+ :return: list of releases
617+ :rtype: list of JSON release objects
618+ :raises SW360Error: if there is a negative HTTP response
619+ """
620+ full_url = self .url + "resource/api/releases?name=" + name
621+ resp = self .api_get (full_url )
622+ if resp and ("_embedded" in resp ) and ("sw360:releases" in resp ["_embedded" ]):
623+ resp = resp ["_embedded" ]["sw360:releases" ]
624+ return resp
625+
590626 def get_all_releases (self , fields = None , all_details = False ):
591627 """Get information of about all releases
592628
@@ -919,9 +955,9 @@ def update_component(self, component, component_id):
919955
920956 API endpoint: PATCH /components
921957
922- :param component: the new vedor data
958+ :param component: the new component data
923959 :param component_id: the id of the component to be updated
924- :type component: JSON vendor object
960+ :type component: JSON component object
925961 :type component_id: string
926962 :return: SW360 result
927963 :rtype: JSON SW360 result object
@@ -1013,15 +1049,32 @@ def get_users_of_component(self, component_id):
10131049
10141050 # ----- Vendor ----------------------------------------------------------
10151051
1052+ def get_all_vendors (self ):
1053+ """Returns all vendors
1054+
1055+ API endpoint: GET /vendors
1056+
1057+ :return: a vendor
1058+ :rtype: JSON vendor object
1059+ :raises SW360Error: if there is a negative HTTP response
1060+ """
1061+
1062+ resp = self .api_get (self .url + "resource/api/vendors" )
1063+ if not resp :
1064+ return None
1065+
1066+ resp = resp ["_embedded" ]["sw360:vendors" ]
1067+ return resp
1068+
10161069 def get_vendor (self , vendor_id ):
10171070 """Returns a vendor
10181071
10191072 API endpoint: GET /vendors/{id}
10201073
10211074 :param vendor_id: the id of the vendor to be requested
10221075 :type vendor_id: string
1023- :return: a vendor
1024- :rtype: JSON vendor object
1076+ :return: list of vendors
1077+ :rtype: list of JSON vendor objects
10251078 :raises SW360Error: if there is a negative HTTP response
10261079 """
10271080
0 commit comments