WebService::BitbucketServer::RefRestriction::V2 - 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->ref_restriction;
This is a Bitbucket Server REST API for RefRestriction::V2.
Original API documentation created by and copyright Atlassian.
Get the instance of WebService::BitbucketServer passed to "new".
$api = WebService::BitbucketServer::RefRestriction::V2->new(context => $webservice_bitbucketserver_obj);
Create a new API.
Normally you would use $webservice_bitbucketserver_obj->ref_restriction instead.
$webservice_bitbucketserver_obj->ref_restriction
Search for restrictions using the supplied parameters.
The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.
GET branch-permissions/2.0/projects/{projectKey}/repos/{repositorySlug}/restrictions
Parameters:
type - string, default: none
type
(optional) types of restrictions to filter on: one of 'read-only', 'no-deletes', 'fast-forward-only' or 'pull-request-only'.
matcherType - string, default: none
matcherType
(optional) matcher type to filter on: one of 'BRANCH', 'PATTERN', 'MODEL_CATEGORY' or 'MODEL_BRANCH'.
matcherId - string, default: none
matcherId
(optional) matcher id to filter on. Requires the matcherType parameter to be specified also.
Responses:
200 - page, type: application/json
200
404 - not-found, type: application/json
404
The restriction could not be found.
Create a restriction for the supplied branch or set of branches to be applied to the given repository.
A restriction means preventing writes on the specified branch(es) by all except a set of users and/or groups, or preventing specific operations such as branch deletion.
For example, you can restrict write access on 'master' to just the 'senior-developer' group, or prevent anyone from deleting that branch.
The request matcher and type must conform to the following.
The matcher can be one of the following types
'BRANCH' represents a specific Branch name. You must supply the fully qualified name of the ref to restrict, e.g. "refs/heads/master" instead of "master".
'PATTERN' represents a wildcard pattern that may match multiple branches. You must specify a valid Branch Permission Pattern.
'MODEL_CATEGORY' represents Branch prefixes in the Branching model for the repository. The 'id' must be one of
'FEATURE'
'BUGFIX'
'HOTFIX'
'RELEASE'
See the Branch REST API for more information.
'MODEL_BRANCH' represents either the Development or Production branch in the branching model for the repository. The 'id' must be one of
'development'
'production'
Type: Set and be one of
'pull-request-only'
'fast-forward-only'
'no-deletes'
'read-only'
POST branch-permissions/2.0/projects/{projectKey}/repos/{repositorySlug}/restrictions
200 - restriction, type: application/json
Response contains the ref restriction that was just created.
400 - errors, type: application/json
400
The request has failed validation.
401 - validation, type: application/json
401
The currently authenticated user has insufficient permissions to perform this operation.
Deletes a restriction as specified by a restriction id.
DELETE branch-permissions/2.0/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}
id - int, default: none
id
204 - data, type: unknown
204
an empty response indicating that the restriction no longer exists on the repository
Returns a restriction as specified by a restriction id.
GET branch-permissions/2.0/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}
The restriction that was created
404 - not-found, type: unknown
GET branch-permissions/2.0/projects/{projectKey}/restrictions
Create a restriction for the supplied branch or set of branches to be applied on all repositories in the given project.
'MODEL_CATEGORY' represents Branch prefixes in the Branching model for the project. The 'id' must be one of
'MODEL_BRANCH' represents either the Development or Production branch in the branching model for the project. The 'id' must be one of
The authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.
POST branch-permissions/2.0/projects/{projectKey}/restrictions
DELETE branch-permissions/2.0/projects/{projectKey}/restrictions/{id}
an empty response indicating that the restriction no longer exists on the project
GET branch-permissions/2.0/projects/{projectKey}/restrictions/{id}
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.