module Octokit::Client::SourceImport
Methods for the Source Import API
Public Instance Methods
Stop an import for a repository.
@param repo [Integer, String, Hash, Repository] A GitHub repository. @return [Boolean] True if the import has been cancelled, false otherwise. @see developer.github.com/v3/migration/source_imports/#cancel-an-import
@example
@client.cancel_source_import("octokit/octokit.rb")
# File lib/octokit/client/source_import.rb, line 87 def cancel_source_import(repo, options = {}) options = ensure_api_media_type(:source_imports, options) boolean_from_response :delete, "#{Repository.path repo}/import", options end
View the progress of an import.
@param repo [Integer, String, Hash, Repository] A GitHub repository. @return [Sawyer::Resource] Hash representing the progress of the import @see developer.github.com/v3/migration/source_imports/#get-import-progress
@example
@client.source_import_progress("octokit/octokit.rb")
# File lib/octokit/client/source_import.rb, line 39 def source_import_progress(repo, options = {}) options = ensure_api_media_type(:source_imports, options) get "#{Repository.path repo}/import", options end
Start a source import to a GitHub repository using GitHub Importer.
@param repo [Integer, String, Hash, Repository] A GitHub repository. @param vcs [String] The originating VCS type. Can be one of “subversion”, “git”, “mercurial”, or “tfvc”. @param vcs_url [String] The URL of the originating repository. @param options [Hash] @option options [String] :vcs_username If authentication is required, the username to provide to vcs_url. @option options [String] :vcs_password If authentication is required, the password to provide to vcs_url. @option options [String] :tfvc_project For a tfvc import, the name of the project that is being imported. @return [Sawyer::Resource] Hash representing the repository import @see developer.github.com/v3/migration/source_imports/#start-an-import
@example
@client.import("octokit/octokit.rb", "subversion", "http://svn.mycompany.com/svn/myproject" { :vcs_username" => "octocat", :vcs_password => "secret" })
# File lib/octokit/client/source_import.rb, line 26 def start_source_import(repo, vcs, vcs_url, options = {}) options = ensure_api_media_type(:source_imports, options.merge(:vcs => vcs, :vcs_url => vcs_url)) put "#{Repository.path repo}/import", options end