API¶
-
stashy.
connect
(url, username, password, verify=True)[source]¶ Connect to a Stash instance given a username and password.
This is only recommended via SSL. If you need are using self-signed certificates, you can use verify=False to ignore SSL verifcation.
-
class
stashy.admin.users.
Users
(url, client, parent, api_path=None, branches_api_path=None)[source]¶ -
add
(name, password, displayName, emailAddress, addToDefaultGroup=True)[source]¶ Add a user, returns a dictionary containing information about the newly created user
-
more_members
(user, filter=None)[source]¶ Retrieves a list of groups the specified user is a member of.
filter: if specified only groups with names containing the supplied string will be returned
-
-
class
stashy.admin.groups.
Groups
(url, client, parent, api_path=None, branches_api_path=None)[source]¶ -
-
more_members
(group, filter=None)[source]¶ Retrieves a list of users that are members of a specified group.
filter: return only users with usernames, display names or email addresses containing this string
-
-
class
stashy.permissions.
Users
(url, client, parent, api_path=None, branches_api_path=None)[source]¶ -
grant
(user, permission)[source]¶ Promote or demote the permission level of a user.
Depending on context, you may use one of the following set of permissions:
global permissions:
- LICENSED_USER
- PROJECT_CREATE
- ADMIN
- SYS_ADMIN
- project permissions:
- PROJECT_READ
- PROJECT_WRITE
- PROJECT_ADMIN
- repository permissions:
- REPO_READ
- REPO_WRITE
- REPO_ADMIN
-
-
class
stashy.permissions.
Groups
(url, client, parent, api_path=None, branches_api_path=None)[source]¶ -
grant
(group, permission)[source]¶ Promote or demote a user’s permission level.
Depending on context, you may use one of the following set of permissions:
global permissions:
- LICENSED_USER
- PROJECT_CREATE
- ADMIN
- SYS_ADMIN
- project permissions:
- PROJECT_READ
- PROJECT_WRITE
- PROJECT_ADMIN
-
-
class
stashy.projects.
Projects
(url, client, parent, api_path=None, branches_api_path=None)[source]¶
-
class
stashy.repos.
Repository
(slug, url, client, parent)[source]¶ -
branches
(filterText=None, orderBy=None, details=None)[source]¶ Retrieve the branches matching the supplied filterText param.
-
browse
(path='', at=None, type=False, blame='', noContent='')[source]¶ Retrieve a page of content for a file path at a specified revision.
-
changes
(until, since=None)[source]¶ Retrieve a page of changes made in a specified commit.
- since: the changeset to which until should be compared to produce a page of changes.
- If not specified the parent of the until changeset is used.
until: the changeset to retrieve file changes for.
-
commits
(until, since=None, path=None)[source]¶ Retrieve a page of changesets from a given starting commit or between two commits. The commits may be identified by hash, branch or tag name.
since: the changeset id or ref (exclusively) to restrieve changesets after until: the changeset id or ref (inclusively) to retrieve changesets before. path: an optional path to filter changesets by.
Support for withCounts is not implement.
-
default_branch
¶ Get or set the default branch
-
files
(path='', at=None)[source]¶ Retrieve a page of files from particular directory of a repository. The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
-
fork
(name=None, project=None)[source]¶ Fork the repository.
- name - Specifies the forked repository’s name
- Defaults to the name of the origin repository if not specified
- project - Specifies the forked repository’s target project by key
- Defaults to the current user’s personal project if not specified
-
get_all_branches
(items)[source]¶ Return list of all branches in this project and the repository :param items: limit parameter (max items in result) :return:
-
get_commit
(commit)[source]¶ Returns detailed information about a given commit :param commit: like “1c972ea39318a4b3ce99bc51ab03277138c586ea” :return:
Retrieve the tags matching the supplied filterText param.
-