migrationsStartImport
Start an import
Details
- Method:
PUT - Path:
/repos/{owner}/{repo}/import - Operation ID:
migrations/start-import
Parameters
{
"owner": {
"description": "The account owner of the repository. The name is not case sensitive.",
"required": true,
"location": "path",
"type": "string"
},
"repo": {
"description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
"required": true,
"location": "path",
"type": "string"
},
"vcs_url": {
"description": "The URL of the originating repository.",
"required": true,
"location": "body",
"type": "string"
},
"vcs": {
"description": "The originating VCS type. Without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response.",
"required": false,
"location": "body",
"type": "string",
"enum": [
"subversion",
"git",
"mercurial",
"tfvc"
]
},
"vcs_username": {
"description": "If authentication is required, the username to provide to `vcs_url`.",
"required": false,
"location": "body",
"type": "string"
},
"vcs_password": {
"description": "If authentication is required, the password to provide to `vcs_url`.",
"required": false,
"location": "body",
"type": "string"
},
"tfvc_project": {
"description": "For a tfvc import, the name of the project that is being imported.",
"required": false,
"location": "body",
"type": "string"
}
}Response Schema
{
"title": "Import",
"description": "A repository import from an external source.",
"type": "object",
"properties": {
"vcs": {
"type": "string",
"nullable": true
},
"use_lfs": {
"type": "boolean"
},
"vcs_url": {
"description": "The URL of the originating repository.",
"type": "string"
},
"svc_root": {
"type": "string"
},
"tfvc_project": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"auth",
"error",
"none",
"detecting",
"choose",
"auth_failed",
"importing",
"mapping",
"waiting_to_push",
"pushing",
"complete",
"setup",
"unknown",
"detection_found_multiple",
"detection_found_nothing",
"detection_needs_auth"
]
},
"status_text": {
"type": "string",
"nullable": true
},
"failed_step": {
"type": "string",
"nullable": true
},
"error_message": {
"type": "string",
"nullable": true
},
"import_percent": {
"type": "integer",
"nullable": true
},
"commit_count": {
"type": "integer",
"nullable": true
},
"push_percent": {
"type": "integer",
"nullable": true
},
"has_large_files": {
"type": "boolean"
},
"large_files_size": {
"type": "integer"
},
"large_files_count": {
"type": "integer"
},
"project_choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"vcs": {
"type": "string"
},
"tfvc_project": {
"type": "string"
},
"human_name": {
"type": "string"
}
}
}
},
"message": {
"type": "string"
},
"authors_count": {
"type": "integer",
"nullable": true
},
"url": {
"type": "string",
"format": "uri"
},
"html_url": {
"type": "string",
"format": "uri"
},
"authors_url": {
"type": "string",
"format": "uri"
},
"repository_url": {
"type": "string",
"format": "uri"
},
"svn_root": {
"type": "string"
}
},
"required": [
"vcs",
"vcs_url",
"status",
"url",
"repository_url",
"html_url",
"authors_url"
]
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('github')
# Call this tool
result = await agent.call_tool('migrationsStartImport', {
# Add required parameters here
})