Python-gitlab Creating a project in a subgroup

97 Views Asked by At

My namespace structure is something like https://gitlab.com/ES/BSK/Projectx I'm trying to create a project under the BSK subgroup like projectx.

Each time I try to create a project using the attribute "namespace_id" : "group_id" it ends creating the project in my user space and not in the group's space. It creates username/project instead of ES/BSK/project.

I use the Following commands:

group_id = gl.groups.list(search='group_name')[0].id

project_created = gl.projects.create({'name': 'UDS', 'namedspace_id': group_id})

OR

project_created = gl.projects.create({'name': 'UDS', 'namedspace_id': 78})

where 78 is the id for the group

1

There are 1 best solutions below

0
jfschaefer On

This looks like an unfortunate typo: It should be namespace_id, not namedspace_id.

With the wrong spelling, the entry is presumably ignored and the default value used instead (according to the documentation, the default is the current user's namespace).