diff options
| author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-06-25 14:55:20 +0200 |
|---|---|---|
| committer | John Villalovos <john@sodarock.com> | 2022-06-25 07:46:06 -0700 |
| commit | 8f8611a1263b8c19fd19ce4a904a310b0173b6bf (patch) | |
| tree | 34c42142dc95e809f300f0e69a6d87ec49e138d5 /docs | |
| parent | 522ecffdb6f07e6c017139df4eb5d3fc42a585b7 (diff) | |
| download | gitlab-8f8611a1263b8c19fd19ce4a904a310b0173b6bf.tar.gz | |
docs(projects): provide more detailed import examples
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/gl_objects/projects.rst | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/docs/gl_objects/projects.rst b/docs/gl_objects/projects.rst index 7569d74..82a7430 100644 --- a/docs/gl_objects/projects.rst +++ b/docs/gl_objects/projects.rst @@ -289,15 +289,30 @@ generated by GitLab you need to: with open('/tmp/export.tgz', 'wb') as f: export.download(streamed=True, action=f.write) -Import the project:: +Import the project into the current user's namespace:: + + with open('/tmp/export.tgz', 'rb') as f: + output = gl.projects.import_project( + f, path='my_new_project', name='My New Project' + ) - output = gl.projects.import_project(open('/tmp/export.tgz', 'rb'), 'my_new_project') # Get a ProjectImport object to track the import status project_import = gl.projects.get(output['id'], lazy=True).imports.get() while project_import.import_status != 'finished': time.sleep(1) project_import.refresh() +Import the project into a namespace and override parameters:: + + with open('/tmp/export.tgz', 'rb') as f: + output = gl.projects.import_project( + f, + path='my_new_project', + name='My New Project', + namespace='my-group', + override_params={'visibility': 'private'}, + ) + Project custom attributes ========================= |
