codeScanningGetVariantAnalysis
Get the summary of a CodeQL variant analysis
Details
- Method:
GET - Path:
/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id} - Operation ID:
code-scanning/get-variant-analysis
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"
},
"codeql_variant_analysis_id": {
"description": "The unique identifier of the variant analysis.",
"required": true,
"location": "path",
"type": "integer"
}
}Response Schema
{
"title": "Variant Analysis",
"description": "A run of a CodeQL query against one or more repositories.",
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "The ID of the variant analysis."
},
"controller_repo": {
"title": "Simple Repository",
"description": "A GitHub repository.",
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1296269,
"description": "A unique identifier of the repository."
},
"node_id": {
"type": "string",
"example": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"description": "The GraphQL identifier of the repository."
},
"name": {
"type": "string",
"example": "Hello-World",
"description": "The name of the repository."
},
"full_name": {
"type": "string",
"example": "octocat/Hello-World",
"description": "The full, globally unique, name of the repository."
},
"owner": {
"title": "Simple User",
"description": "A GitHub user.",
"type": "object",
"properties": {
"name": {
"nullable": true,
"type": "string"
},
"email": {
"nullable": true,
"type": "string"
},
"login": {
"type": "string",
"example": "octocat"
},
"id": {
"type": "integer",
"format": "int64",
"example": 1
},
"node_id": {
"type": "string",
"example": "MDQ6VXNlcjE="
},
"avatar_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/images/error/octocat_happy.gif"
},
"gravatar_id": {
"type": "string",
"example": "41d064eb2195891e12d0413f63227ea7",
"nullable": true
},
"url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat"
},
"html_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/octocat"
},
"followers_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/followers"
},
"following_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/following{/other_user}"
},
"gists_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/gists{/gist_id}"
},
"starred_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/starred{/owner}{/repo}"
},
"subscriptions_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/subscriptions"
},
"organizations_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/orgs"
},
"repos_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/repos"
},
"events_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/events{/privacy}"
},
"received_events_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/received_events"
},
"type": {
"type": "string",
"example": "User"
},
"site_admin": {
"type": "boolean"
},
"starred_at": {
"type": "string",
"example": "\"2020-07-09T00:17:55Z\""
},
"user_view_type": {
"type": "string",
"example": "public"
}
},
"required": [
"avatar_url",
"events_url",
"followers_url",
"following_url",
"gists_url",
"gravatar_id",
"html_url",
"id",
"node_id",
"login",
"organizations_url",
"received_events_url",
"repos_url",
"site_admin",
"starred_url",
"subscriptions_url",
"type",
"url"
]
},
"private": {
"type": "boolean",
"description": "Whether the repository is private."
},
"html_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/octocat/Hello-World",
"description": "The URL to view the repository on GitHub.com."
},
"description": {
"type": "string",
"example": "This your first repo!",
"nullable": true,
"description": "The repository description."
},
"fork": {
"type": "boolean",
"description": "Whether the repository is a fork."
},
"url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World",
"description": "The URL to get more information about the repository from the GitHub API."
},
"archive_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
"description": "A template for the API URL to download the repository as an archive."
},
"assignees_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
"description": "A template for the API URL to list the available assignees for issues in the repository."
},
"blobs_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
"description": "A template for the API URL to create or retrieve a raw Git blob in the repository."
},
"branches_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
"description": "A template for the API URL to get information about branches in the repository."
},
"collaborators_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
"description": "A template for the API URL to get information about collaborators of the repository."
},
"comments_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
"description": "A template for the API URL to get information about comments on the repository."
},
"commits_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
"description": "A template for the API URL to get information about commits on the repository."
},
"compare_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
"description": "A template for the API URL to compare two commits or refs."
},
"contents_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
"description": "A template for the API URL to get the contents of the repository."
},
"contributors_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/contributors",
"description": "A template for the API URL to list the contributors to the repository."
},
"deployments_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/deployments",
"description": "The API URL to list the deployments of the repository."
},
"downloads_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/downloads",
"description": "The API URL to list the downloads on the repository."
},
"events_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/events",
"description": "The API URL to list the events of the repository."
},
"forks_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/forks",
"description": "The API URL to list the forks of the repository."
},
"git_commits_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
"description": "A template for the API URL to get information about Git commits of the repository."
},
"git_refs_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
"description": "A template for the API URL to get information about Git refs of the repository."
},
"git_tags_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
"description": "A template for the API URL to get information about Git tags of the repository."
},
"issue_comment_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
"description": "A template for the API URL to get information about issue comments on the repository."
},
"issue_events_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
"description": "A template for the API URL to get information about issue events on the repository."
},
"issues_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
"description": "A template for the API URL to get information about issues on the repository."
},
"keys_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
"description": "A template for the API URL to get information about deploy keys on the repository."
},
"labels_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
"description": "A template for the API URL to get information about labels of the repository."
},
"languages_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/languages",
"description": "The API URL to get information about the languages of the repository."
},
"merges_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/merges",
"description": "The API URL to merge branches in the repository."
},
"milestones_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
"description": "A template for the API URL to get information about milestones of the repository."
},
"notifications_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
"description": "A template for the API URL to get information about notifications on the repository."
},
"pulls_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
"description": "A template for the API URL to get information about pull requests on the repository."
},
"releases_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
"description": "A template for the API URL to get information about releases on the repository."
},
"stargazers_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/stargazers",
"description": "The API URL to list the stargazers on the repository."
},
"statuses_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
"description": "A template for the API URL to get information about statuses of a commit."
},
"subscribers_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/subscribers",
"description": "The API URL to list the subscribers on the repository."
},
"subscription_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/subscription",
"description": "The API URL to subscribe to notifications for this repository."
},
"tags_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/tags",
"description": "The API URL to get information about tags on the repository."
},
"teams_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/teams",
"description": "The API URL to list the teams on the repository."
},
"trees_url": {
"type": "string",
"example": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
"description": "A template for the API URL to create or retrieve a raw Git tree of the repository."
},
"hooks_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/hooks",
"description": "The API URL to list the hooks on the repository."
}
},
"required": [
"archive_url",
"assignees_url",
"blobs_url",
"branches_url",
"collaborators_url",
"comments_url",
"commits_url",
"compare_url",
"contents_url",
"contributors_url",
"deployments_url",
"description",
"downloads_url",
"events_url",
"fork",
"forks_url",
"full_name",
"git_commits_url",
"git_refs_url",
"git_tags_url",
"hooks_url",
"html_url",
"id",
"node_id",
"issue_comment_url",
"issue_events_url",
"issues_url",
"keys_url",
"labels_url",
"languages_url",
"merges_url",
"milestones_url",
"name",
"notifications_url",
"owner",
"private",
"pulls_url",
"releases_url",
"stargazers_url",
"statuses_url",
"subscribers_url",
"subscription_url",
"tags_url",
"teams_url",
"trees_url",
"url"
]
},
"actor": {
"title": "Simple User",
"description": "A GitHub user.",
"type": "object",
"properties": {
"name": {
"nullable": true,
"type": "string"
},
"email": {
"nullable": true,
"type": "string"
},
"login": {
"type": "string",
"example": "octocat"
},
"id": {
"type": "integer",
"format": "int64",
"example": 1
},
"node_id": {
"type": "string",
"example": "MDQ6VXNlcjE="
},
"avatar_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/images/error/octocat_happy.gif"
},
"gravatar_id": {
"type": "string",
"example": "41d064eb2195891e12d0413f63227ea7",
"nullable": true
},
"url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat"
},
"html_url": {
"type": "string",
"format": "uri",
"example": "https://github.com/octocat"
},
"followers_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/followers"
},
"following_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/following{/other_user}"
},
"gists_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/gists{/gist_id}"
},
"starred_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/starred{/owner}{/repo}"
},
"subscriptions_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/subscriptions"
},
"organizations_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/orgs"
},
"repos_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/repos"
},
"events_url": {
"type": "string",
"example": "https://api.github.com/users/octocat/events{/privacy}"
},
"received_events_url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/users/octocat/received_events"
},
"type": {
"type": "string",
"example": "User"
},
"site_admin": {
"type": "boolean"
},
"starred_at": {
"type": "string",
"example": "\"2020-07-09T00:17:55Z\""
},
"user_view_type": {
"type": "string",
"example": "public"
}
},
"required": [
"avatar_url",
"events_url",
"followers_url",
"following_url",
"gists_url",
"gravatar_id",
"html_url",
"id",
"node_id",
"login",
"organizations_url",
"received_events_url",
"repos_url",
"site_admin",
"starred_url",
"subscriptions_url",
"type",
"url"
]
},
"query_language": {
"type": "string",
"description": "The language targeted by the CodeQL query",
"enum": [
"actions",
"cpp",
"csharp",
"go",
"java",
"javascript",
"python",
"ruby",
"rust",
"swift"
]
},
"query_pack_url": {
"type": "string",
"description": "The download url for the query pack."
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "The date and time at which the variant analysis was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ."
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "The date and time at which the variant analysis was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ."
},
"completed_at": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "The date and time at which the variant analysis was completed, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Will be null if the variant analysis has not yet completed or this information is not available."
},
"status": {
"type": "string",
"enum": [
"in_progress",
"succeeded",
"failed",
"cancelled"
]
},
"actions_workflow_run_id": {
"type": "integer",
"description": "The GitHub Actions workflow run used to execute this variant analysis. This is only available if the workflow run has started."
},
"failure_reason": {
"type": "string",
"enum": [
"no_repos_queried",
"actions_workflow_run_failed",
"internal_error"
],
"description": "The reason for a failure of the variant analysis. This is only available if the variant analysis has failed."
},
"scanned_repositories": {
"type": "array",
"items": {
"type": "object",
"properties": {
"repository": {
"title": "Repository Identifier",
"description": "Repository Identifier",
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1296269,
"description": "A unique identifier of the repository."
},
"name": {
"type": "string",
"example": "Hello-World",
"description": "The name of the repository."
},
"full_name": {
"type": "string",
"example": "octocat/Hello-World",
"description": "The full, globally unique, name of the repository."
},
"private": {
"type": "boolean",
"description": "Whether the repository is private."
},
"stargazers_count": {
"type": "integer",
"example": 80
},
"updated_at": {
"type": "string",
"format": "date-time",
"example": "2011-01-26T19:14:43Z",
"nullable": true
}
},
"required": [
"full_name",
"id",
"name",
"private",
"stargazers_count",
"updated_at"
]
},
"analysis_status": {
"type": "string",
"description": "The new status of the CodeQL variant analysis repository task.",
"enum": [
"pending",
"in_progress",
"succeeded",
"failed",
"canceled",
"timed_out"
]
},
"result_count": {
"type": "integer",
"description": "The number of results in the case of a successful analysis. This is only available for successful analyses."
},
"artifact_size_in_bytes": {
"type": "integer",
"description": "The size of the artifact. This is only available for successful analyses."
},
"failure_message": {
"type": "string",
"description": "The reason of the failure of this repo task. This is only available if the repository task has failed."
}
},
"required": [
"repository",
"analysis_status"
]
}
},
"skipped_repositories": {
"type": "object",
"description": "Information about repositories that were skipped from processing. This information is only available to the user that initiated the variant analysis.",
"properties": {
"access_mismatch_repos": {
"type": "object",
"properties": {
"repository_count": {
"type": "integer",
"description": "The total number of repositories that were skipped for this reason.",
"example": 2
},
"repositories": {
"type": "array",
"description": "A list of repositories that were skipped. This list may not include all repositories that were skipped. This is only available when the repository was found and the user has access to it.",
"items": {
"title": "Repository Identifier",
"description": "Repository Identifier",
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1296269,
"description": "A unique identifier of the repository."
},
"name": {
"type": "string",
"example": "Hello-World",
"description": "The name of the repository."
},
"full_name": {
"type": "string",
"example": "octocat/Hello-World",
"description": "The full, globally unique, name of the repository."
},
"private": {
"type": "boolean",
"description": "Whether the repository is private."
},
"stargazers_count": {
"type": "integer",
"example": 80
},
"updated_at": {
"type": "string",
"format": "date-time",
"example": "2011-01-26T19:14:43Z",
"nullable": true
}
},
"required": [
"full_name",
"id",
"name",
"private",
"stargazers_count",
"updated_at"
]
}
}
},
"required": [
"repository_count",
"repositories"
]
},
"not_found_repos": {
"type": "object",
"properties": {
"repository_count": {
"type": "integer",
"description": "The total number of repositories that were skipped for this reason.",
"example": 2
},
"repository_full_names": {
"type": "array",
"description": "A list of full repository names that were skipped. This list may not include all repositories that were skipped.",
"items": {
"type": "string"
}
}
},
"required": [
"repository_count",
"repository_full_names"
]
},
"no_codeql_db_repos": {
"type": "object",
"properties": {
"repository_count": {
"type": "integer",
"description": "The total number of repositories that were skipped for this reason.",
"example": 2
},
"repositories": {
"type": "array",
"description": "A list of repositories that were skipped. This list may not include all repositories that were skipped. This is only available when the repository was found and the user has access to it.",
"items": {
"title": "Repository Identifier",
"description": "Repository Identifier",
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1296269,
"description": "A unique identifier of the repository."
},
"name": {
"type": "string",
"example": "Hello-World",
"description": "The name of the repository."
},
"full_name": {
"type": "string",
"example": "octocat/Hello-World",
"description": "The full, globally unique, name of the repository."
},
"private": {
"type": "boolean",
"description": "Whether the repository is private."
},
"stargazers_count": {
"type": "integer",
"example": 80
},
"updated_at": {
"type": "string",
"format": "date-time",
"example": "2011-01-26T19:14:43Z",
"nullable": true
}
},
"required": [
"full_name",
"id",
"name",
"private",
"stargazers_count",
"updated_at"
]
}
}
},
"required": [
"repository_count",
"repositories"
]
},
"over_limit_repos": {
"type": "object",
"properties": {
"repository_count": {
"type": "integer",
"description": "The total number of repositories that were skipped for this reason.",
"example": 2
},
"repositories": {
"type": "array",
"description": "A list of repositories that were skipped. This list may not include all repositories that were skipped. This is only available when the repository was found and the user has access to it.",
"items": {
"title": "Repository Identifier",
"description": "Repository Identifier",
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1296269,
"description": "A unique identifier of the repository."
},
"name": {
"type": "string",
"example": "Hello-World",
"description": "The name of the repository."
},
"full_name": {
"type": "string",
"example": "octocat/Hello-World",
"description": "The full, globally unique, name of the repository."
},
"private": {
"type": "boolean",
"description": "Whether the repository is private."
},
"stargazers_count": {
"type": "integer",
"example": 80
},
"updated_at": {
"type": "string",
"format": "date-time",
"example": "2011-01-26T19:14:43Z",
"nullable": true
}
},
"required": [
"full_name",
"id",
"name",
"private",
"stargazers_count",
"updated_at"
]
}
}
},
"required": [
"repository_count",
"repositories"
]
}
},
"required": [
"access_mismatch_repos",
"not_found_repos",
"no_codeql_db_repos",
"over_limit_repos"
]
}
},
"required": [
"id",
"controller_repo",
"actor",
"query_language",
"query_pack_url",
"status"
]
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('github')
# Call this tool
result = await agent.call_tool('codeScanningGetVariantAnalysis', {
# Add required parameters here
})