public class ImportExportApi extends AbstractApi
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.CommitBuildState, Constants.Encoding, Constants.EpicOrderBy, Constants.GroupOrderBy, Constants.GroupSearchScope, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestSearchIn, Constants.MergeRequestState, Constants.MilestoneState, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.ProjectSearchScope, Constants.SearchScope, Constants.SortOrder, Constants.StateEvent, Constants.TagOrderBy, Constants.TargetType, Constants.TodoAction, Constants.TodoState, Constants.TodoType, Constants.TokenType
gitLabApi
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
Constructor and Description |
---|
ImportExportApi(GitLabApi gitLabApi) |
Modifier and Type | Method and Description |
---|---|
File |
downloadExport(Object projectIdOrPath,
File directory)
Download the finished export.
|
File |
downloadExport(Object projectIdOrPath,
File directory,
String filename)
Download the finished export.
|
ExportStatus |
getExportStatus(Object projectIdOrPath)
Get the status of export.
|
ImportStatus |
getImportStatus(Object projectIdOrPath)
Get the status of an import.
|
void |
scheduleExport(Object projectIdOrPath)
Schedule an export.
|
void |
scheduleExport(Object projectIdOrPath,
String description)
Schedule an export.
|
void |
scheduleExport(Object projectIdOrPath,
String description,
Map<String,String> upload,
String uploadUrl,
String uploadHttpMethod)
Schedule an export.
|
ImportStatus |
startImport(Object namespaceIdOrPath,
File exportFile,
String path,
Boolean overwrite,
Project overrideParams)
Import an exported project.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, post, post, post, post, post, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, urlEncode, validate
public ImportExportApi(GitLabApi gitLabApi)
public void scheduleExport(Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/export
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic void scheduleExport(Object projectIdOrPath, String description) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/export
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancedescription
- overrides the project description, optionalGitLabApiException
- if any exception occurspublic void scheduleExport(Object projectIdOrPath, String description, Map<String,String> upload, String uploadUrl, String uploadHttpMethod) throws GitLabApiException
GitLab Endpoint: POST /projects/:id/export
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancedescription
- overrides the project description, optionalupload
- Mao that contains the information to upload the exported project to a web serveruploadUrl
- the URL to upload the projectuploadHttpMethod
- the HTTP method to upload the exported project.
Only PUT and POST methods allowed. Default is PUTGitLabApiException
- if any exception occurspublic ExportStatus getExportStatus(Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/export
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occurspublic File downloadExport(Object projectIdOrPath, File directory) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/export/download
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancedirectory
- the File instance of the directory to save the export file to, if null will use "java.io.tmpdir"GitLabApiException
- if any exception occurspublic File downloadExport(Object projectIdOrPath, File directory, String filename) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/export/download
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancedirectory
- the File instance of the directory to save the export file to, if null will use "java.io.tmpdir"filename
- Name to give to the downloaded file. If null then we try to get from Content-Disposition header
or to compute one from parametersGitLabApiException
- if any exception occurspublic ImportStatus startImport(Object namespaceIdOrPath, File exportFile, String path, Boolean overwrite, Project overrideParams) throws GitLabApiException
Import an exported project. The following properties on the Project instance are utilized in the creation of the new project:
GitLab Endpoint: POST /projects/import
namespaceIdOrPath
- the ID or path of the namespace that the project will be imported to. Defaults to the current user’s namespaceexportFile
- the project export file to be importedpath
- the name and path for the new projectoverwrite
- if there is a project with the same path the import will overwrite it. Defaults to falseoverrideParams
- overriding project params, supports all fields defined by the ProjectApi, optionalGitLabApiException
- if any exception occurspublic ImportStatus getImportStatus(Object projectIdOrPath) throws GitLabApiException
GitLab Endpoint: GET /projects/:id/import
projectIdOrPath
- the new (imported) project identifier in the form of an Integer(ID), String(path), or Project instanceGitLabApiException
- if any exception occursCopyright © 2019. All rights reserved.