@itentialopensource/adapter-bitbucket
Version:
This adapter integrates with system described as: bitbucket.
966 lines (953 loc) • 93.7 kB
Markdown
## Using this Adapter
The `adapter.js` file contains the calls the adapter makes available to the rest of the Itential Platform. The API detailed for these calls should be available through JSDOC. The following is a brief summary of the calls.
### Generic Adapter Calls
These are adapter methods that Itential Platform or you might use. There are some other methods not shown here that might be used for internal adapter functionality.
<table border="1" class="bordered-table">
<tr>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Method Signature</span></th>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Workflow?</span></th>
</tr>
<tr>
<td style="padding:15px">connect()</td>
<td style="padding:15px">This call is run when the Adapter is first loaded by the Itential Platform. It validates the properties have been provided correctly.</td>
<td style="padding:15px">No</td>
</tr>
<tr>
<td style="padding:15px">healthCheck(callback)</td>
<td style="padding:15px">This call ensures that the adapter can communicate with Adapter for Bitbucket. The actual call that is used is defined in the adapter properties and .system entities action.json file.</td>
<td style="padding:15px">No</td>
</tr>
<tr>
<td style="padding:15px">refreshProperties(properties)</td>
<td style="padding:15px">This call provides the adapter the ability to accept property changes without having to restart the adapter.</td>
<td style="padding:15px">No</td>
</tr>
<tr>
<td style="padding:15px">encryptProperty(property, technique, callback)</td>
<td style="padding:15px">This call will take the provided property and technique, and return the property encrypted with the technique. This allows the property to be used in the adapterProps section for the credential password so that the password does not have to be in clear text. The adapter will decrypt the property as needed for communications with Adapter for Bitbucket.</td>
<td style="padding:15px">No</td>
</tr>
<tr>
<td style="padding:15px">iapUpdateAdapterConfiguration(configFile, changes, entity, type, action, callback)</td>
<td style="padding:15px">This call provides the ability to update the adapter configuration from Itential Platform - includes actions, schema, mockdata and other configurations.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapSuspendAdapter(mode, callback)</td>
<td style="padding:15px">This call provides the ability to suspend the adapter and either have requests rejected or put into a queue to be processed after the adapter is resumed.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapUnsuspendAdapter(callback)</td>
<td style="padding:15px">This call provides the ability to resume a suspended adapter. Any requests in queue will be processed before new requests.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapGetAdapterQueue(callback)</td>
<td style="padding:15px">This call will return the requests that are waiting in the queue if throttling is enabled.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapFindAdapterPath(apiPath, callback)</td>
<td style="padding:15px">This call provides the ability to see if a particular API path is supported by the adapter.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapTroubleshootAdapter(props, adapter, callback)</td>
<td style="padding:15px">This call can be used to check on the performance of the adapter - it checks connectivity, healthcheck and basic get calls.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapRunAdapterHealthcheck(adapter, callback)</td>
<td style="padding:15px">This call will return the results of a healthcheck.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapRunAdapterConnectivity(callback)</td>
<td style="padding:15px">This call will return the results of a connectivity check.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapRunAdapterBasicGet(maxCalls, callback)</td>
<td style="padding:15px">This call will return the results of running basic get API calls. By default 5 get calls without parameters will be run. You can ask for more or less by setting maxCalls.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapMoveAdapterEntitiesToDB(callback)</td>
<td style="padding:15px">This call will push the adapter configuration from the entities directory into the Adapter or Itential Platform Database.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapDeactivateTasks(tasks, callback)</td>
<td style="padding:15px">This call provides the ability to remove tasks from the adapter.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapActivateTasks(tasks, callback)</td>
<td style="padding:15px">This call provides the ability to add deactivated tasks back into the adapter.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapExpandedGenericAdapterRequest(metadata, uriPath, restMethod, pathVars, queryData, requestBody, addlHeaders, callback)</td>
<td style="padding:15px">This is an expanded Generic Call. The metadata object allows us to provide many new capabilities within the generic request.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">genericAdapterRequest(uriPath, restMethod, queryData, requestBody, addlHeaders, callback)</td>
<td style="padding:15px">This call allows you to provide the path to have the adapter call. It is an easy way to incorporate paths that have not been built into the adapter yet.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">genericAdapterRequestNoBasePath(uriPath, restMethod, queryData, requestBody, addlHeaders, callback)</td>
<td style="padding:15px">This call is the same as the genericAdapterRequest only it does not add a base_path or version to the call.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapRunAdapterLint(callback)</td>
<td style="padding:15px">Runs lint on the addapter and provides the information back.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapRunAdapterTests(callback)</td>
<td style="padding:15px">Runs baseunit and unit tests on the adapter and provides the information back.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapGetAdapterInventory(callback)</td>
<td style="padding:15px">This call provides some inventory related information about the adapter.</td>
<td style="padding:15px">Yes</td>
</tr>
</table>
<br>
### Adapter Cache Calls
These are adapter methods that are used for adapter caching. If configured, the adapter will cache based on the interval provided. However, you can force a population of the cache manually as well.
<table border="1" class="bordered-table">
<tr>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Method Signature</span></th>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Workflow?</span></th>
</tr>
<tr>
<td style="padding:15px">iapPopulateEntityCache(entityTypes, callback)</td>
<td style="padding:15px">This call populates the adapter cache.</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">iapRetrieveEntitiesCache(entityType, options, callback)</td>
<td style="padding:15px">This call retrieves the specific items from the adapter cache.</td>
<td style="padding:15px">Yes</td>
</tr>
</table>
<br>
### Adapter Broker Calls
These are adapter methods that are used to integrate to Itential Platform Brokers. This adapter currently supports the following broker calls.
<table border="1" class="bordered-table">
<tr>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Method Signature</span></th>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Workflow?</span></th>
</tr>
<tr>
<td style="padding:15px">hasEntities(entityType, entityList, callback)</td>
<td style="padding:15px">This call is utilized by the Itential Platform Device Broker to determine if the adapter has a specific entity and item of the entity.</td>
<td style="padding:15px">No</td>
</tr>
<tr>
<td style="padding:15px">getDevice(deviceName, callback)</td>
<td style="padding:15px">This call returns the details of the requested device.</td>
<td style="padding:15px">No</td>
</tr>
<tr>
<td style="padding:15px">getDevicesFiltered(options, callback)</td>
<td style="padding:15px">This call returns the list of devices that match the criteria provided in the options filter.</td>
<td style="padding:15px">No</td>
</tr>
<tr>
<td style="padding:15px">isAlive(deviceName, callback)</td>
<td style="padding:15px">This call returns whether the device status is active</td>
<td style="padding:15px">No</td>
</tr>
<tr>
<td style="padding:15px">getConfig(deviceName, format, callback)</td>
<td style="padding:15px">This call returns the configuration for the selected device.</td>
<td style="padding:15px">No</td>
</tr>
<tr>
<td style="padding:15px">iapGetDeviceCount(callback)</td>
<td style="padding:15px">This call returns the count of devices.</td>
<td style="padding:15px">No</td>
</tr>
</table>
<br>
### Specific Adapter Calls
Specific adapter calls are built based on the API of the Bitbucket. The Adapter Builder creates the proper method comments for generating JS-DOC for the adapter. This is the best way to get information on the calls.
<table border="1" class="bordered-table">
<tr>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Method Signature</span></th>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Path</span></th>
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Workflow?</span></th>
</tr>
<tr>
<td style="padding:15px">deleteAddon(callback)</td>
<td style="padding:15px"></td>
<td style="padding:15px">{base_path}/{version}/addon?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">putAddon(callback)</td>
<td style="padding:15px"></td>
<td style="padding:15px">{base_path}/{version}/addon?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getAddonLinkers(callback)</td>
<td style="padding:15px"></td>
<td style="padding:15px">{base_path}/{version}/addon/linkers?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getAddonLinkersLinkerKey(linkerKey, callback)</td>
<td style="padding:15px"></td>
<td style="padding:15px">{base_path}/{version}/addon/linkers/{pathv1}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">deleteAddonLinkersLinkerKeyValues(linkerKey, callback)</td>
<td style="padding:15px"></td>
<td style="padding:15px">{base_path}/{version}/addon/linkers/{pathv1}/values?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getAddonLinkersLinkerKeyValues(linkerKey, callback)</td>
<td style="padding:15px"></td>
<td style="padding:15px">{base_path}/{version}/addon/linkers/{pathv1}/values?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postAddonLinkersLinkerKeyValues(linkerKey, callback)</td>
<td style="padding:15px"></td>
<td style="padding:15px">{base_path}/{version}/addon/linkers/{pathv1}/values?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">putAddonLinkersLinkerKeyValues(linkerKey, callback)</td>
<td style="padding:15px"></td>
<td style="padding:15px">{base_path}/{version}/addon/linkers/{pathv1}/values?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">deleteAddonLinkersLinkerKeyValues2(linkerKey, callback)</td>
<td style="padding:15px"></td>
<td style="padding:15px">{base_path}/{version}/addon/linkers/{pathv1}/values/?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getAddonLinkersLinkerKeyValues2(linkerKey, callback)</td>
<td style="padding:15px"></td>
<td style="padding:15px">{base_path}/{version}/addon/linkers/{pathv1}/values/?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getHookEvents(callback)</td>
<td style="padding:15px">Returns the webhook resource or subject types on which webhooks can
be registered.
Each resource/subject type contains an `events` link that returns the
paginated list of specific events each individual subject type can
emit.
This endpoint is publicly accessible and does not require
authentication or scopes.
Example:
```
$ curl https://api.bitbucket.org/2.0/hook_events
{
"repository": {
"links": {
"events": {
"href": "https://api.bitbucket.org/2.0/hook_eve...(description truncated)</td>
<td style="padding:15px">{base_path}/{version}/hook_events?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getHookEventsSubjectType(subjectType = 'user', callback)</td>
<td style="padding:15px">Returns a paginated list of all valid webhook events for the
specified entity.
This is public data that does not require any scopes or authentication.
Example:
NOTE: The following example is a truncated response object for the `team` `subject_type`.
We return the same structure for the other `subject_type` objects.
```
$ curl https://api.bitbucket.org/2.0/hook_events/team
{
"page": 1,
"pagelen": 30,
"size": 21,
"values": [
{
"category": "Repository",
...(description truncated)</td>
<td style="padding:15px">{base_path}/{version}/hook_events/{pathv1}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugHooks(username, repoSlug, callback)</td>
<td style="padding:15px">Returns a paginated list of webhooks installed on this repository.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/hooks?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postRepositoriesUsernameRepoSlugHooks(username, repoSlug, callback)</td>
<td style="padding:15px">Creates a new webhook on the specified repository.
Example:
```
$ curl -X POST -u credentials -H 'Content-Type: application/json' https://api.bitbucket.org/2.0/repositories/username/slug/hooks -d '
{
"description": "Webhook Description",
"url": "https://example.com/",
"active": true,
"events": [
"repo:push",
"issue:created",
"issue:updated"
]
}'
```
Note that this call requires the webhook scope, as well as any sco...(description truncated)</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/hooks?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">deleteRepositoriesUsernameRepoSlugHooksUid(username, repoSlug, uid, callback)</td>
<td style="padding:15px">Deletes the specified webhook subscription from the given
repository.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/hooks/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugHooksUid(username, repoSlug, uid, callback)</td>
<td style="padding:15px">Returns the webhook with the specified id installed on the specified
repository.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/hooks/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postRepositoriesUsernameRepoSlugSrc(username, repoSlug, body, filename, attribute, callback)</td>
<td style="padding:15px">Creates a new repository.
Note: In order to set the project for the newly created repository,
pass in either the project key or the project UUID as part of the
request body as shown in the examples below:
```
$ curl -X POST -H "Content-Type: application/json" -d '{
"scm": "git",
"project": {
"key": "MARS"
}
}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
```
or
```
$ curl -X POST -H "Content-Type: application/json" -d '{
"scm": "git",
"project": ...(description truncated)</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/src?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">CreateACommitByUploadingAFile(username, repoSlug, message, author, parents, files, branch, callback)</td>
<td style="padding:15px">This endpoint is used to create new commits in the repository by uploading files.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/src?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">putRepositoriesUsernameRepoSlugHooksUid(username, repoSlug, uid, callback)</td>
<td style="padding:15px">Updates the specified webhook subscription.
The following properties can be mutated:
* `description`
* `url`
* `active`
* `events`</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/hooks/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositories(after, callback)</td>
<td style="padding:15px">Returns a paginated list of all public repositories.
This endpoint also supports filtering and sorting of the results. See
[filtering and sorting](../meta/filtering) for more details.</td>
<td style="padding:15px">{base_path}/{version}/repositories?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsername(username, role = 'admin', callback)</td>
<td style="padding:15px">Returns a paginated list of all repositories owned by the specified
account or UUID.
The result can be narrowed down based on the authenticated user's role.
E.g. with `?role=contributor`, only those repositories that the
authenticated user has write access to are returned (this includes any
repo the user is an admin on, as that implies write access).
This endpoint also supports filtering and sorting of the results. See
[filtering and sorting](../../meta/filtering) for more details.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">deleteRepositoriesUsernameRepoSlug(username, repoSlug, callback)</td>
<td style="padding:15px">Deletes the repository. This is an irreversible operation.
This does not affect its forks.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlug(username, repoSlug, callback)</td>
<td style="padding:15px">Returns the object describing this repository.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postRepositoriesUsernameRepoSlug(username, repoSlug, body, callback)</td>
<td style="padding:15px">Creates a new repository.
Note: In order to set the project for the newly created repository,
pass in either the project key or the project UUID as part of the
request body as shown in the examples below:
```
$ curl -X POST -H "Content-Type: application/json" -d '{
"scm": "git",
"project": {
"key": "MARS"
}
}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
```
or
```
$ curl -X POST -H "Content-Type: application/json" -d '{
"scm": "git",
"project": ...(description truncated)</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">putRepositoriesUsernameRepoSlug(username, repoSlug, body, callback)</td>
<td style="padding:15px">Since this endpoint can be used to both update and to create a
repository, the request body depends on the intent.
### Creation
See the POST documentation for the repository endpoint for an example
of the request body.
### Update
Note: Changing the `name` of the repository will cause the location to
be changed. This is because the URL of the repo is derived from the
name (a process called slugification). In such a scenario, it is
possible for the request to fail if the newly created slug conflic...(description truncated)</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugCommitNodeStatuses(username, repoSlug, node, callback)</td>
<td style="padding:15px">Returns all statuses (e.g. build results) for a specific commit.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commit/{pathv3}/statuses?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postRepositoriesUsernameRepoSlugCommitNodeStatusesBuild(username, repoSlug, node, callback)</td>
<td style="padding:15px">Creates a new build status against the specified commit.
If the specified key already exists, the existing status object will
be overwritten.
When creating a new commit status, you can use a URI template for the URL.
Templates are URLs that contain variable names that Bitbucket will
evaluate at runtime whenever the URL is displayed anywhere similar to
parameter substitution in
[Bitbucket Connect](https://developer.atlassian.com/bitbucket/concepts/context-parameters.html).
For example, one could ...(description truncated)</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commit/{pathv3}/statuses/build?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugCommitNodeStatusesBuildKey(username, repoSlug, node, key, callback)</td>
<td style="padding:15px">Returns the specified build status for a commit.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commit/{pathv3}/statuses/build/{pathv4}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">putRepositoriesUsernameRepoSlugCommitNodeStatusesBuildKey(username, repoSlug, node, key, body, callback)</td>
<td style="padding:15px">Used to update the current status of a build status object on the
specific commit.
This operation can also be used to change other properties of the
build status:
* `state`
* `name`
* `description`
* `url`
* `refname`
The `key` cannot be changed.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commit/{pathv3}/statuses/build/{pathv4}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugForks(username, repoSlug, callback)</td>
<td style="padding:15px">Returns a paginated list of all the forks of the specified
repository.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/forks?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugPullrequestsPullRequestIdStatuses(username, repoSlug, pullRequestId, callback)</td>
<td style="padding:15px">Returns all statuses (e.g. build results) for the given pull
request.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/pullrequests/{pathv3}/statuses?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugWatchers(username, repoSlug, callback)</td>
<td style="padding:15px">Returns a paginated list of all the watchers on the specified
repository.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/watchers?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getTeamsUsernameHooks(username, callback)</td>
<td style="padding:15px">Returns a paginated list of webhooks installed on this team.</td>
<td style="padding:15px">{base_path}/{version}/teams/{pathv1}/hooks?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postTeamsUsernameHooks(username, callback)</td>
<td style="padding:15px">Creates a new webhook on the specified team.
Team webhooks are fired for events from all repositories belonging to
that team account.
Note that only admins can install webhooks on teams.</td>
<td style="padding:15px">{base_path}/{version}/teams/{pathv1}/hooks?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">deleteTeamsUsernameHooksUid(username, uid, callback)</td>
<td style="padding:15px">Deletes the specified webhook subscription from the given team
account.</td>
<td style="padding:15px">{base_path}/{version}/teams/{pathv1}/hooks/{pathv2}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getTeamsUsernameHooksUid(username, uid, callback)</td>
<td style="padding:15px">Returns the webhook with the specified id installed on the given
team account.</td>
<td style="padding:15px">{base_path}/{version}/teams/{pathv1}/hooks/{pathv2}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">putTeamsUsernameHooksUid(username, uid, callback)</td>
<td style="padding:15px">Updates the specified webhook subscription.
The following properties can be mutated:
* `description`
* `url`
* `active`
* `events`</td>
<td style="padding:15px">{base_path}/{version}/teams/{pathv1}/hooks/{pathv2}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getTeams(role = 'admin', callback)</td>
<td style="padding:15px">Returns all the teams that the authenticated user is associated
with.</td>
<td style="padding:15px">{base_path}/{version}/teams?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getTeamsUsername(username, callback)</td>
<td style="padding:15px">Gets the public information associated with a team.
If the team's profile is private, `location`, `website` and
`created_on` elements are omitted.</td>
<td style="padding:15px">{base_path}/{version}/teams/{pathv1}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getTeamsUsernameFollowers(username, callback)</td>
<td style="padding:15px">Returns the list of accounts that are following this team.</td>
<td style="padding:15px">{base_path}/{version}/teams/{pathv1}/followers?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getTeamsUsernameFollowing(username, callback)</td>
<td style="padding:15px">Returns the list of accounts this team is following.</td>
<td style="padding:15px">{base_path}/{version}/teams/{pathv1}/following?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getTeamsUsernameMembers(username, callback)</td>
<td style="padding:15px">All members of a team.
Returns all members of the specified team. Any member of any of the
team's groups is considered a member of the team. This includes users
in groups that may not actually have access to any of the team's
repositories.
Note that members using the "private profile" feature are not included.</td>
<td style="padding:15px">{base_path}/{version}/teams/{pathv1}/members?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getUsersUsernameHooks(username, callback)</td>
<td style="padding:15px">Returns a paginated list of webhooks installed on this user account.</td>
<td style="padding:15px">{base_path}/{version}/users/{pathv1}/hooks?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postUsersUsernameHooks(username, callback)</td>
<td style="padding:15px">Creates a new webhook on the specified user account.
Account-level webhooks are fired for events from all repositories
belonging to that account.
Note that one can only register webhooks on one's own account, not that
of others.</td>
<td style="padding:15px">{base_path}/{version}/users/{pathv1}/hooks?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">deleteUsersUsernameHooksUid(username, uid, callback)</td>
<td style="padding:15px">Deletes the specified webhook subscription from the given user
account.</td>
<td style="padding:15px">{base_path}/{version}/users/{pathv1}/hooks/{pathv2}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getUsersUsernameHooksUid(username, uid, callback)</td>
<td style="padding:15px">Returns the webhook with the specified id installed on the given
user account.</td>
<td style="padding:15px">{base_path}/{version}/users/{pathv1}/hooks/{pathv2}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">putUsersUsernameHooksUid(username, uid, callback)</td>
<td style="padding:15px">Updates the specified webhook subscription.
The following properties can be mutated:
* `description`
* `url`
* `active`
* `events`</td>
<td style="padding:15px">{base_path}/{version}/users/{pathv1}/hooks/{pathv2}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getTeamsUsernameRepositories(username, callback)</td>
<td style="padding:15px">All repositories owned by a user/team. This includes private
repositories, but filtered down to the ones that the calling user has
access to.</td>
<td style="padding:15px">{base_path}/{version}/teams/{pathv1}/repositories?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getUsersUsernameRepositories(username, callback)</td>
<td style="padding:15px">All repositories owned by a user/team. This includes private
repositories, but filtered down to the ones that the calling user has
access to.</td>
<td style="padding:15px">{base_path}/{version}/users/{pathv1}/repositories?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getUser(callback)</td>
<td style="padding:15px">Returns the currently logged in user.</td>
<td style="padding:15px">{base_path}/{version}/user?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getUserEmails(callback)</td>
<td style="padding:15px">Returns all the authenticated user's email addresses. Both
confirmed and unconfirmed.</td>
<td style="padding:15px">{base_path}/{version}/user/emails?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getUserEmailsEmail(email, callback)</td>
<td style="padding:15px">Returns details about a specific one of the authenticated user's
email addresses.
Details describe whether the address has been confirmed by the user and
whether it is the user's primary address or not.</td>
<td style="padding:15px">{base_path}/{version}/user/emails/{pathv1}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getUsersUsername(username, callback)</td>
<td style="padding:15px">Gets the public information associated with a user account.
If the user's profile is private, `location`, `website` and
`created_on` elements are omitted.</td>
<td style="padding:15px">{base_path}/{version}/users/{pathv1}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getUsersUsernameFollowers(username, callback)</td>
<td style="padding:15px">Returns the list of accounts that are following this team.</td>
<td style="padding:15px">{base_path}/{version}/users/{pathv1}/followers?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getUsersUsernameFollowing(username, callback)</td>
<td style="padding:15px">Returns the list of accounts this user is following.</td>
<td style="padding:15px">{base_path}/{version}/users/{pathv1}/following?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugSrcNodePath(username, node, pathParam, repoSlug, format = 'meta', callback)</td>
<td style="padding:15px"></td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/src/{pathv3}/{pathv4}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugBranchRestrictions(username, repoSlug, callback)</td>
<td style="padding:15px">Returns a paginated list of all branch restrictions on the
repository.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/branch-restrictions?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postRepositoriesUsernameRepoSlugBranchRestrictions(username, repoSlug, body, callback)</td>
<td style="padding:15px">Creates a new branch restriction rule for a repository.
`kind` describes what will be restricted. Allowed values are: `push`,
`force`, `delete`, and `restrict_merges`.
Different kinds of branch restrictions have different requirements:
* `push` and `restrict_merges` require `users` and `groups` to be
specified. Empty lists are allowed, in which case permission is
denied for everybody.
* `force` can not be specified in a Mercurial repository.
`pattern` is used to determine which branches will...(description truncated)</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/branch-restrictions?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">deleteRepositoriesUsernameRepoSlugBranchRestrictionsId(username, repoSlug, id, callback)</td>
<td style="padding:15px">Deletes an existing branch restriction rule.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/branch-restrictions/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugBranchRestrictionsId(username, repoSlug, id, callback)</td>
<td style="padding:15px">Returns a specific branch restriction rule.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/branch-restrictions/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">putRepositoriesUsernameRepoSlugBranchRestrictionsId(username, repoSlug, id, body, callback)</td>
<td style="padding:15px">Updates an existing branch restriction rule.
Fields not present in the request body are ignored.
See [`POST`](../../branch-restrictions#post) for details.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/branch-restrictions/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">deleteRepositoriesUsernameRepoSlugCommitNodeApprove(username, repoSlug, node, callback)</td>
<td style="padding:15px">Redact the authenticated user's approval of the specified commit.
This operation is only available to users that have explicit access to
the repository. In contrast, just the fact that a repository is
publicly accessible to users does not give them the ability to approve
commits.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commit/{pathv3}/approve?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postRepositoriesUsernameRepoSlugCommitNodeApprove(username, repoSlug, node, callback)</td>
<td style="padding:15px">Approve the specified commit as the authenticated user.
This operation is only available to users that have explicit access to
the repository. In contrast, just the fact that a repository is
publicly accessible to users does not give them the ability to approve
commits.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commit/{pathv3}/approve?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugCommitRevision(username, repoSlug, revision, callback)</td>
<td style="padding:15px">Returns the specified commit.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commit/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugCommitShaComments(username, sha, repoSlug, callback)</td>
<td style="padding:15px">Returns the commit's comments.
This includes both global and inline comments.
The default sorting is oldest to newest and can be overridden with
the `sort` query parameter.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commit/{pathv3}/comments?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugCommitShaCommentsCommentId(username, sha, commentId, repoSlug, callback)</td>
<td style="padding:15px">Returns the specified commit comment.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commit/{pathv3}/comments/{pathv4}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugCommits(username, repoSlug, callback)</td>
<td style="padding:15px">These are the repository's commits. They are paginated and returned
in reverse chronological order, similar to the output of `git log` and
`hg log`. Like these tools, the DAG can be filtered.
## GET /repositories/{username}/{repo_slug}/commits/
Returns all commits in the repo in topological order (newest commit
first). All branches and tags are included (similar to
`git log --all` and `hg log`).
## GET /repositories/{username}/{repo_slug}/commits/master
Returns all commits on rev `master` (simil...(description truncated)</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commits?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postRepositoriesUsernameRepoSlugCommits(username, repoSlug, callback)</td>
<td style="padding:15px">Identical to `GET /repositories/{username}/{repo_slug}/commits`,
except that POST allows clients to place the include and exclude
parameters in the request body to avoid URL length issues.
**Note that this resource does NOT support new commit creation.**</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commits?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugCommitsRevision(username, revision, repoSlug, callback)</td>
<td style="padding:15px">These are the repository's commits. They are paginated and returned
in reverse chronological order, similar to the output of `git log` and
`hg log`. Like these tools, the DAG can be filtered.
## GET /repositories/{username}/{repo_slug}/commits/
Returns all commits in the repo in topological order (newest commit
first). All branches and tags are included (similar to
`git log --all` and `hg log`).
## GET /repositories/{username}/{repo_slug}/commits/master
Returns all commits on rev `master` (simil...(description truncated)</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commits/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postRepositoriesUsernameRepoSlugCommitsRevision(username, revision, repoSlug, callback)</td>
<td style="padding:15px">Identical to `GET /repositories/{username}/{repo_slug}/commits`,
except that POST allows clients to place the include and exclude
parameters in the request body to avoid URL length issues.
**Note that this resource does NOT support new commit creation.**</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/commits/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugDiffSpec(username, spec, repoSlug, context, pathParam, callback)</td>
<td style="padding:15px">Produces a raw, git-style diff for either a single commit (diffed
against its first parent), or a revspec of 2 commits (e.g.
`3a8b42..9ff173` where the first commit represents the source and the
second commit the destination).
In case of the latter (diffing a revspec), a 3-way diff, or merge diff,
is computed. This shows the changes introduced by the left branch
(`3a8b42` in our example) as compared againt the right branch
(`9ff173`).
This is equivalent to merging the left branch into the right ...(description truncated)</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/diff/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugPatchSpec(username, spec, repoSlug, callback)</td>
<td style="padding:15px">Produces a raw patch for a single commit (diffed against its first
parent), or a patch-series for a revspec of 2 commits (e.g.
`3a8b42..9ff173` where the first commit represents the source and the
second commit the destination).
In case of the latter (diffing a revspec), a patch series is returned
for the commits on the source branch (`3a8b42` and its ancestors in
our example). For Mercurial, a single patch is returned that combines
the changes of all commits on the source branch.
While similar ...(description truncated)</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/patch/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugComponents(username, repoSlug, callback)</td>
<td style="padding:15px">Returns the components that have been defined in the issue tracker.
This resource is only available on repositories that have the issue
tracker enabled.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/components?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugComponentsComponentId(username, repoSlug, componentId, callback)</td>
<td style="padding:15px">Returns the specified issue tracker component object.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/components/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugIssues(username, repoSlug, callback)</td>
<td style="padding:15px">Returns the issues in the issue tracker.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/issues?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postRepositoriesUsernameRepoSlugIssues(username, repoSlug, body, callback)</td>
<td style="padding:15px">Creates a new issue.
This call requires authentication. Private repositories or private
issue trackers require the caller to authenticate with an account that
has appropriate authorisation.
The authenticated user is used for the issue's `reporter` field.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/issues?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">deleteRepositoriesUsernameRepoSlugIssuesIssueId(username, issueId, repoSlug, callback)</td>
<td style="padding:15px">Deletes the specified issue. This requires write access to the
repository.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/issues/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugIssuesIssueId(username, issueId, repoSlug, callback)</td>
<td style="padding:15px">Returns the specified issue.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/issues/{pathv3}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugIssuesIssueIdAttachments(username, repoSlug, issueId, callback)</td>
<td style="padding:15px">Returns all attachments for this issue.
This returns the files' meta data. This does not return the files'
actual contents.
The files are always ordered by their upload date.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/issues/{pathv3}/attachments?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">postRepositoriesUsernameRepoSlugIssuesIssueIdAttachments(username, repoSlug, issueId, callback)</td>
<td style="padding:15px">Upload new issue attachments.
To upload files, perform a `multipart/form-data` POST containing one
or more file fields.
When a file is uploaded with the same name as an existing attachment,
then the existing file will be replaced.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/issues/{pathv3}/attachments?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">deleteRepositoriesUsernameRepoSlugIssuesIssueIdAttachmentsPath(username, pathParam, issueId, repoSlug, callback)</td>
<td style="padding:15px">Deletes an attachment.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/issues/{pathv3}/attachments/{pathv4}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugIssuesIssueIdAttachmentsPath(username, pathParam, issueId, repoSlug, callback)</td>
<td style="padding:15px">Returns the contents of the specified file attachment.
Note that this endpoint does not return a JSON response, but instead
returns a redirect pointing to the actual file that in turn will return
the raw contents.
The redirect URL contains a one-time token that has a limited lifetime.
As a result, the link should not be persisted, stored, or shared.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/issues/{pathv3}/attachments/{pathv4}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugIssuesIssueIdComments(username, issueId, repoSlug, callback)</td>
<td style="padding:15px">Returns all comments that were made on the specified issue.
The default sorting is oldest to newest and can be overridden with
the `sort` query parameter.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/issues/{pathv3}/comments?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugIssuesIssueIdCommentsCommentId(username, commentId, issueId, repoSlug, callback)</td>
<td style="padding:15px">Returns the specified issue comment object.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/issues/{pathv3}/comments/{pathv4}?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">deleteRepositoriesUsernameRepoSlugIssuesIssueIdVote(username, repoSlug, issueId, callback)</td>
<td style="padding:15px">Retract your vote.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/issues/{pathv3}/vote?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">getRepositoriesUsernameRepoSlugIssuesIssueIdVote(username, repoSlug, issueId, callback)</td>
<td style="padding:15px">Check whether the authenticated user has voted for this issue.
A 204 status code indicates that the user has voted, while a 404
implies they haven't.</td>
<td style="padding:15px">{base_path}/{version}/repositories/{pathv1}/{pathv2}/issues/{pathv3}/vote?{query}</td>
<td style="padding:15px">Yes</td>
</tr>
<tr>
<td style="padding:15px">