Create Teams via REST API #3164
Unanswered
ChristopherFoerster
asked this question in
Q&A
Replies: 1 comment
-
workaround:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
as part of our automation activities (python) we struggle to create teams with all needed details.
For permissions I tried name only, name + descriptions (copied from GET of a single team).
For mappedLdapGroups I tried dn only using web entry of an existing team and also the rest entry value. Both are simply ignored without an error. Any Idea on permissions or mappedLdapGroups ?
X API Key is from admin group with all permissions. PUT for creation and POST for update show 201 and 200 - so no errors but for boths the data below is not working.
PUT:
data = {
"name": input.project,
"permissions": [{'name': 'BOM_UPLOAD', 'description': 'Allows the ability to upload CycloneDX and SPDX Bill-of-Material (BOM) documents'}, {'name': 'POLICY_VIOLATION_ANALYSIS', 'description': 'Provides the ability to make analysis decisions on policy violations'}, {'name': 'PORTFOLIO_MANAGEMENT', 'description': 'Allows the creation, modification, and deletion of data in the portfolio'}, {'name': 'PROJECT_CREATION_UPLOAD', 'description': 'Provides the ability to optionally create project (if non-existent) on BOM or scan upload'}, {'name': 'VIEW_POLICY_VIOLATION', 'description': 'Provides the ability to view policy violations'}, {'name': 'VIEW_PORTFOLIO', 'description': 'Provides the ability to view the portfolio of projects, components, dependencies, and licenses'}, {'name': 'VIEW_VULNERABILITY', 'description': 'Provides the ability to view the vulnerabilities projects are affected by'}, {'name': 'VULNERABILITY_ANALYSIS', 'description': 'Provides the ability to make analysis decisions on vulnerabilities affecting projects in the portfolio'}],
#"mappedLdapGroups": [
# {
# "dn": "CN="+ input.group +",OU=APPLICATION,OU=Groups,OU=ELA,DC=globaldir,DC=infra,DC=gtsinput.group"
# }
#]
}
POST:
data = {
"uuid": result["uuid"], # from result of PUT which does not need UUID
"name": result["name"],
"permissions": [{'name': 'BOM_UPLOAD', 'description': 'Allows the ability to upload CycloneDX and SPDX Bill-of-Material (BOM) documents'}, {'name': 'POLICY_VIOLATION_ANALYSIS', 'description': 'Provides the ability to make analysis decisions on policy violations'}, {'name': 'PORTFOLIO_MANAGEMENT', 'description': 'Allows the creation, modification, and deletion of data in the portfolio'}, {'name': 'PROJECT_CREATION_UPLOAD', 'description': 'Provides the ability to optionally create project (if non-existent) on BOM or scan upload'}, {'name': 'VIEW_POLICY_VIOLATION', 'description': 'Provides the ability to view policy violations'}, {'name': 'VIEW_PORTFOLIO', 'description': 'Provides the ability to view the portfolio of projects, components, dependencies, and licenses'}, {'name': 'VIEW_VULNERABILITY', 'description': 'Provides the ability to view the vulnerabilities projects are affected by'}, {'name': 'VULNERABILITY_ANALYSIS', 'description': 'Provides the ability to make analysis decisions on vulnerabilities affecting projects in the portfolio'}],
"mappedLdapGroups": [
{
"dn": "CN="+ input.group +",OU=APPLICATION,OU=Groups,OU=ELA,DC=globaldir,DC=infra,DC=gts"
}
]
}
Beta Was this translation helpful? Give feedback.
All reactions