WebService::BitbucketServer::SSH::V1 - Bindings for a Bitbucket Server REST API
version 0.605
my $stash = WebService::BitbucketServer->new( base_url => 'https://stash.example.com/', username => 'bob', password => 'secret', ); my $api = $stash->ssh;
This is a Bitbucket Server REST API for SSH::V1.
Original API documentation created by and copyright Atlassian.
Get the instance of WebService::BitbucketServer passed to "new".
$api = WebService::BitbucketServer::SSH::V1->new(context => $webservice_bitbucketserver_obj);
Create a new API.
Normally you would use $webservice_bitbucketserver_obj->ssh instead.
$webservice_bitbucketserver_obj->ssh
Register a new SSH key and grants access to the repository identified in the URL.
POST keys/1.0/projects/{projectKey}/repos/{repositorySlug}/ssh
Responses:
200 - data, type: application/json
200
The newly created access key
400 - errors, type: application/json
400
The current request contains invalid or missing values.
401 - errors, type: application/json
401
The currently authenticated user has insufficient permissions to add an access key to the repository
404 - errors, type: application/json
404
The specified repository does not exist
Retrieves the access keys for the repository identified in the URL.
GET keys/1.0/projects/{projectKey}/repos/{repositorySlug}/ssh
Parameters:
filter - string, default: none
filter
if specified only SSH access keys with a label prefixed with the supplied string will be returned
effective - boolean, default: false
effective
Controls whether SSH access keys configured at the project level should be included in the results or not. When set to true all keys that have access to the repository (including project level keys) are included in the results. When set to false, only access keys configured for the specified repository are considered. Default is false.
true
false
repository
permission - string, default: none
permission
if specified only SSH access keys with at least the supplied permission will be returned Default is Permission.REPO_READ.
Permission.REPO_READ
200 - page, type: application/json
A single page of access keys for the repository.
The currently authenticated user has insufficient permissions to retrieve the access keys for this repository
GET keys/1.0/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}
keyId - int, default: none
keyId
the identifier of the SSH key
Remove an existing access key for the repository identified in the URL. If the same SSH key is used as an access key for multiple projects or repositories, only the access to the repository identified in the URL will be revoked.
DELETE keys/1.0/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}
The currently authenticated user has insufficient permissions to remove access keys for this repository
204 - data, type: application/json
204
The access key was deleted (or none was found matching the given id).
Updates the permission granted to the specified SSH key to the project identified in the URL.
PUT keys/1.0/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}/permission/{permission}
the SSH key ID
the new permission to be granted to the SSH key
The currently authenticated user has insufficient permissions on the project to edit its access keys
The specified project does not exist
Register a new SSH key and grants access to the project identified in the URL.
POST keys/1.0/projects/{projectKey}/ssh
The currently authenticated user has insufficient permissions to add an access key to the project.
Retrieves the access keys for the project identified in the URL.
GET keys/1.0/projects/{projectKey}/ssh
if specified only SSH access keys with at least the supplied permission will be returned Default is {@link Permission#PROJECT_READ}.
A single page of access keys associated with the project.
The currently authenticated user has insufficient permissions to retrieve the access keys for this project
GET keys/1.0/projects/{projectKey}/ssh/{keyId}
Remove an existing access key for the project identified in the URL. If the same SSH key is used as an access key for multiple projects or repositories, only the access to the project identified in the URL will be revoked.
DELETE keys/1.0/projects/{projectKey}/ssh/{keyId}
The currently authenticated user has insufficient permissions to remove access keys for this project
PUT keys/1.0/projects/{projectKey}/ssh/{keyId}/permission/{permission}
Remove an existing access key for the projects and repositories in the submitted entity. If the same SSH key is used as an access key for multiple projects or repositories not supplied, only the access to the projects or repositories identified will be revoked.
DELETE keys/1.0/ssh/{keyId}
The currently authenticated user has insufficient permissions to remove access keys for one or more of the specified projects or repositories
The access keys were deleted (or none was found matching the given id and repositories or projects).
On or more of the specified repositories or projects does not exist or the key itself does not exist
Retrieves all project-related access keys for the SSH key with id keyId. If the current user is not an admin any of the projects the key provides access to, none are returned.
GET keys/1.0/ssh/{keyId}/projects
the SSH key with ID keyId.
The specified key does not exist
Retrieves all repository-related access keys for the SSH key with id keyId. If the current user is not an admin of any of the projects the key provides access to, none are returned.
GET keys/1.0/ssh/{keyId}/repos
Retrieve a page of ssh keys.
GET ssh/1.0/keys
user - string, default: none
user
the username of the user to retrieve the keys for. If no username is specified, the ssh keys will be retrieved for the current authenticated user.
A page of ssh keys.
The currently authenticated user has insufficient permissions to retrieve the ssh keys. This is only possible when a user is explicitly supplied.
No user matches the supplied user
Delete all ssh keys for a supplied user.
DELETE ssh/1.0/keys
the username of the user to delete the keys for. If no username is specified, the ssh keys will be deleted for the current authenticated user.
The currently authenticated user has insufficient permissions to delete the ssh keys. This is only possible when a user is explicitly supplied.
204 - data, type: unknown
The ssh keys matching the supplied user were deleted.
Add a new ssh key to a supplied user.
POST ssh/1.0/keys
the username of the user to add the ssh key for. If no username is specified, the ssh key will be added for the current authenticated user.
201 - sshKey, type: application/json
201
The newly created ssh key.
The ssh key was not created because the key was not a valid RSA/DSA/ECDSA/Ed25519 key of a supported length.
Either there is no authenticated user or the currently authenticated user has insufficient permissions to add an ssh key. The latter is only possible when a user is explicitly supplied.
409 - errors, type: application/json
409
The ssh key already exists on the system.
Delete an ssh key.
DELETE ssh/1.0/keys/{keyId}
the id of the key to delete.
The currently authenticated user has insufficient permissions to delete the ssh key.
The ssh key matching the supplied id was deleted or did not exist.
GET ssh/1.0/settings
The ssh settings from upstream
The request was not authenticated
WebService::BitbucketServer
https://developer.atlassian.com/bitbucket/server/docs/latest/
Please report any bugs or feature requests on the bugtracker website https://github.com/chazmcgarvey/WebService-BitbucketServer/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Charles McGarvey <chazmcgarvey@brokenzipper.com>
This software is copyright (c) 2018 by Charles McGarvey.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install WebService::BitbucketServer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::BitbucketServer
CPAN shell
perl -MCPAN -e shell install WebService::BitbucketServer
For more information on module installation, please visit the detailed CPAN module installation guide.