INSTRUCTION stringlengths 1 46.3k | RESPONSE stringlengths 75 80.2k |
|---|---|
To create an organization Jira administrator global permission or agent permission is required
depending on the settings
:param name: str
:return: Organization data | def create_organization(self, name):
"""
To create an organization Jira administrator global permission or agent permission is required
depending on the settings
:param name: str
:return: Organization data
"""
log.warning('Creating organization...')
url =... |
Adds an organization to a servicedesk for a given servicedesk ID and organization ID
:param service_desk_id: str
:param organization_id: int
:return: | def add_organization(self, service_desk_id, organization_id):
"""
Adds an organization to a servicedesk for a given servicedesk ID and organization ID
:param service_desk_id: str
:param organization_id: int
:return:
"""
log.warning('Adding organization...')
... |
Removes an organization from a servicedesk for a given servicedesk ID and organization ID
:param service_desk_id: str
:param organization_id: int
:return: | def remove_organization(self, service_desk_id, organization_id):
"""
Removes an organization from a servicedesk for a given servicedesk ID and organization ID
:param service_desk_id: str
:param organization_id: int
:return:
"""
log.warning('Removing organization.... |
Deletes an organization for a given organization ID
:param organization_id:
:return: | def delete_organization(self, organization_id):
"""
Deletes an organization for a given organization ID
:param organization_id:
:return:
"""
log.warning('Deleting organization...')
url = 'rest/servicedeskapi/organization/{}'.format(organization_id)
retur... |
Adds users to an organization
users_list is a list of strings
:param organization_id: str
:param users_list: list
:return: | def add_users_to_organization(self, organization_id, users_list):
"""
Adds users to an organization
users_list is a list of strings
:param organization_id: str
:param users_list: list
:return:
"""
log.warning('Adding users...')
url = 'rest/service... |
Removes users from an organization
users_list is a list of strings
:param organization_id: str
:param users_list: list
:return: | def remove_users_from_organization(self, organization_id, users_list):
"""
Removes users from an organization
users_list is a list of strings
:param organization_id: str
:param users_list: list
:return:
"""
log.warning('Removing users...')
url = '... |
Add attachment as a comment.
Setting attachment visibility is dependent on the user's permission. For example,
Agents can create either public or internal attachments, while Unlicensed users can only create internal
attachments, and Customers can only create public attachments.
An addi... | def create_attachment(self, service_desk_id, issue_id_or_key, filename, public=True, comment=None):
"""
Add attachment as a comment.
Setting attachment visibility is dependent on the user's permission. For example,
Agents can create either public or internal attachments, while Unlicense... |
Create temporary attachment, which can later be converted into permanent attachment
:param service_desk_id: str
:param filename: str
:return: Temporary Attachment ID | def attach_temporary_file(self, service_desk_id, filename):
"""
Create temporary attachment, which can later be converted into permanent attachment
:param service_desk_id: str
:param filename: str
:return: Temporary Attachment ID
"""
headers = {'X-Atlassian-Token... |
Adds temporary attachment that were created using attach_temporary_file function to a customer request
:param issue_id_or_key: str
:param temp_attachment_id: str, ID from result attach_temporary_file function
:param public: bool (default is True)
:param comment: str (default is None)
... | def add_attachment(self, issue_id_or_key, temp_attachment_id, public=True, comment=None):
"""
Adds temporary attachment that were created using attach_temporary_file function to a customer request
:param issue_id_or_key: str
:param temp_attachment_id: str, ID from result attach_temporar... |
Get the SLA information for a customer request for a given request ID or key and SLA metric ID
IMPORTANT: The calling user must be an agent
:param issue_id_or_key: str
:param sla_id: str
:return: SLA information | def get_sla_by_id(self, issue_id_or_key, sla_id):
"""
Get the SLA information for a customer request for a given request ID or key and SLA metric ID
IMPORTANT: The calling user must be an agent
:param issue_id_or_key: str
:param sla_id: str
:return: SLA information
... |
Get all approvals on a request, for a given request ID/Key
:param issue_id_or_key: str
:param start: OPTIONAL: int
:param limit: OPTIONAL: int
:return: | def get_approvals(self, issue_id_or_key, start=0, limit=50):
"""
Get all approvals on a request, for a given request ID/Key
:param issue_id_or_key: str
:param start: OPTIONAL: int
:param limit: OPTIONAL: int
:return:
"""
url = 'rest/servicedeskapi/request... |
Get an approval for a given approval ID
:param issue_id_or_key: str
:param approval_id: str
:return: | def get_approval_by_id(self, issue_id_or_key, approval_id):
"""
Get an approval for a given approval ID
:param issue_id_or_key: str
:param approval_id: str
:return:
"""
url = 'rest/servicedeskapi/request/{0}/approval/{1}'.format(issue_id_or_key, approval_id)
... |
Get queue settings on project
:param project_key: str
:return: | def get_queue_settings(self, project_key):
"""
Get queue settings on project
:param project_key: str
:return:
"""
url = 'rest/servicedeskapi/queues/{}'.format(project_key)
return self.get(url, headers=self.experimental_headers) |
Adds one or more existing customers to the given service desk.
If you need to create a customer, see Create customer method.
Administer project permission is required, or agents if public signups
and invites are enabled for the Service Desk project.
:param service_desk_id: str
... | def add_customers(self, service_desk_id, list_of_usernames):
"""
Adds one or more existing customers to the given service desk.
If you need to create a customer, see Create customer method.
Administer project permission is required, or agents if public signups
and invites are en... |
Returns a page of queues defined inside a service desk, for a given service desk ID.
The returned queues will include an issue count for each queue (represented in issueCount field)
if the query param includeCount is set to true (defaults to false).
Permissions: The calling user must be an agen... | def get_queues(self, service_desk_id, include_count=False, start=0, limit=50):
"""
Returns a page of queues defined inside a service desk, for a given service desk ID.
The returned queues will include an issue count for each queue (represented in issueCount field)
if the query param incl... |
Returns a page of issues inside a queue for a given queue ID.
Only fields that the queue is configured to show are returned.
For example, if a queue is configured to show only Description and Due Date,
then only those two fields are returned for each issue in the queue.
Permissions: The... | def get_issues_in_queue(self, service_desk_id, queue_id, start=0, limit=50):
"""
Returns a page of issues inside a queue for a given queue ID.
Only fields that the queue is configured to show are returned.
For example, if a queue is configured to show only Description and Due Date,
... |
Generic method to return a generator with the results returned from Bamboo. It is intended to work for
responses in the form:
{
'results':
{
'size': 5,
'start-index': 0,
'max-result': 5,
'result': []
},
... | def _get_generator(self, path, elements_key='results', element_key='result', data=None, flags=None,
params=None, headers=None):
"""
Generic method to return a generator with the results returned from Bamboo. It is intended to work for
responses in the form:
{
... |
Returns a generator with the plans in a given project
:param project_key: Project key
:return: Generator with plans | def project_plans(self, project_key):
"""
Returns a generator with the plans in a given project
:param project_key: Project key
:return: Generator with plans
"""
resource = 'project/{}'.format(project_key, max_results=25)
return self.base_list_call(resource, expan... |
Get results as generic method
:param project_key:
:param plan_key:
:param job_key:
:param build_number:
:param expand:
:param favourite:
:param clover_enabled:
:param issue_key:
:param start_index:
:param max_results:
:return: | def results(self, project_key=None, plan_key=None, job_key=None, build_number=None, expand=None, favourite=False,
clover_enabled=False, issue_key=None, start_index=0, max_results=25):
"""
Get results as generic method
:param project_key:
:param plan_key:
:param jo... |
Get Plan results
:param project_key:
:param plan_key:
:param expand:
:param favourite:
:param clover_enabled:
:param label:
:param issue_key:
:param start_index:
:param max_results:
:return: | def plan_results(self, project_key, plan_key, expand=None, favourite=False, clover_enabled=False, label=None,
issue_key=None, start_index=0, max_results=25):
"""
Get Plan results
:param project_key:
:param plan_key:
:param expand:
:param favourite:
... |
Returns details of a specific build result
:param expand: expands build result details on request. Possible values are: artifacts, comments, labels,
Jira Issues, stages. stages expand is available only for top level plans. It allows to drill down to job results
using stages.stage.results.result.... | def build_result(self, build_key, expand=None):
"""
Returns details of a specific build result
:param expand: expands build result details on request. Possible values are: artifacts, comments, labels,
Jira Issues, stages. stages expand is available only for top level plans. It allows to ... |
Returns the current status of each deployment environment
If no project id is provided, returns all projects. | def deployment_dashboard(self, project_id=None):
"""
Returns the current status of each deployment environment
If no project id is provided, returns all projects.
"""
resource = 'deploy/dashboard/{}'.format(project_id) if project_id else 'deploy/dashboard'
return self.get... |
api/1.0/plan/{projectKey}-{buildKey}/branch | def plan_branches(self, plan_key, expand=None, favourite=False, clover_enabled=False, max_results=25):
"""api/1.0/plan/{projectKey}-{buildKey}/branch"""
resource = 'plan/{}/branch'.format(plan_key)
return self.base_list_call(resource, expand, favourite, clover_enabled, max_results,
... |
>>> is_email('username@example.com')
True
>>> is_email('example.com')
False
>>> is_email('firstname.lastname@domain.co.uk')
True | def is_email(string):
"""
>>> is_email('username@example.com')
True
>>> is_email('example.com')
False
>>> is_email('firstname.lastname@domain.co.uk')
True
"""
email_regex = r'^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$'
if isinstance(string, str) and not re.match(email_rege... |
>>> html_email('username@example.com')
'<a href="mailto:username@example.com">username@example.com</a>' | def html_email(email, title=None):
"""
>>> html_email('username@example.com')
'<a href="mailto:username@example.com">username@example.com</a>'
"""
if not title:
title = email
return '<a href="mailto:{email}">{title}</a>'.format(email=email, title=title) |
>>> html_list(['example.com', 'admin1@example.com', 'admin2@example.com'])
'<ul>
<li>example.com</li>
<li><a href="mailto:admin1@example.com">admin1@example.com</a></li>
<li><a href="mailto:admin2@example.com">admin2@example.com</a></li>
</ul>' | def html_list(data):
"""
>>> html_list(['example.com', 'admin1@example.com', 'admin2@example.com'])
'<ul>
<li>example.com</li>
<li><a href="mailto:admin1@example.com">admin1@example.com</a></li>
<li><a href="mailto:admin2@example.com">admin2@example.com</a></li>
</ul>'
"""
... |
>>> html_table_header_row(['administrators', 'key', 'leader', 'project'])
'\\n\\t<tr><th>Administrators</th><th>Key</th><th>Leader</th><th>Project</th></tr>'
>>> html_table_header_row(['key', 'project', 'leader', 'administrators'])
'\\n\\t<tr><th>Key</th><th>Project</th><th>Leader</th><th>Administrators</th... | def html_table_header_row(data):
"""
>>> html_table_header_row(['administrators', 'key', 'leader', 'project'])
'\\n\\t<tr><th>Administrators</th><th>Key</th><th>Leader</th><th>Project</th></tr>'
>>> html_table_header_row(['key', 'project', 'leader', 'administrators'])
'\\n\\t<tr><th>Key</th><th>Proj... |
>>> headers = ['administrators', 'key', 'leader', 'project']
>>> data = {'key': 'DEMO', 'project': 'Demonstration', 'leader': 'leader@example.com', 'administrators': ['admin1@example.com', 'admin2@example.com']}
>>> html_row_with_ordered_headers(data, headers)
'\\n\\t<tr><td><ul><li><a href="mailto:admin1@e... | def html_row_with_ordered_headers(data, headers):
"""
>>> headers = ['administrators', 'key', 'leader', 'project']
>>> data = {'key': 'DEMO', 'project': 'Demonstration', 'leader': 'leader@example.com', 'administrators': ['admin1@example.com', 'admin2@example.com']}
>>> html_row_with_ordered_headers(data... |
>>> ordering = ['administrators', 'key', 'leader', 'project']
>>> data = [ \
{'key': 'DEMO', 'project': 'Demo project', 'leader': 'lead@example.com', \
'administrators': ['admin@example.com', 'root@example.com']},]
>>> html_table_from_dict(data, ordering)
'<table>
<tbody>\\n
... | def html_table_from_dict(data, ordering):
"""
>>> ordering = ['administrators', 'key', 'leader', 'project']
>>> data = [ \
{'key': 'DEMO', 'project': 'Demo project', 'leader': 'lead@example.com', \
'administrators': ['admin@example.com', 'root@example.com']},]
>>> html_table_from_dic... |
Provide plugins info
:param limit:
:param offset:
:return: | def get_plugins_info(self, limit=10, offset=10):
"""
Provide plugins info
:param limit:
:param offset:
:return:
"""
params = {}
if offset:
params['offset'] = offset
if limit:
params['limit'] = limit
url = 'rest/1.0/p... |
Provide vendors info
:param limit:
:param offset:
:return: | def get_vendors_info(self, limit=10, offset=10):
"""
Provide vendors info
:param limit:
:param offset:
:return:
"""
params = {}
if offset:
params['offset'] = offset
if limit:
params['limit'] = limit
url = 'rest/1.0/v... |
Information about applications
:param limit:
:param offset:
:return: | def get_application_info(self, limit=10, offset=10):
"""
Information about applications
:param limit:
:param offset:
:return:
"""
params = {}
if offset:
params['offset'] = offset
if limit:
params['limit'] = limit
url... |
Provide the project list
:param limit: OPTIONAL 25 is default
:return: | def project_list(self, limit=None):
"""
Provide the project list
:param limit: OPTIONAL 25 is default
:return:
"""
params = {}
if limit:
params['limit'] = limit
return (self.get('rest/api/1.0/projects', params=params) or {}).get('values') |
Provide project info
:param key:
:return: | def project(self, key):
"""
Provide project info
:param key:
:return:
"""
url = 'rest/api/1.0/projects/{0}'.format(key)
return (self.get(url) or {}).get('values') |
Create project
:param key:
:param name:
:param description:
:return: | def create_project(self, key, name, description=""):
"""
Create project
:param key:
:param name:
:param description:
:return:
"""
url = 'rest/api/1.0/projects'
data = {"key": key,
"name": name,
"description": descrip... |
Get project administrators for project
:param key: project key
:return: project administrators | def project_users_with_administrator_permissions(self, key):
"""
Get project administrators for project
:param key: project key
:return: project administrators
"""
project_administrators = [user['user'] for user in self.project_users(key)
... |
Get Project Groups
:param key:
:param limit: OPTIONAL: The limit of the number of groups to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:param filter_str: OPTIONAL: group filter string
:return: | def project_groups(self, key, limit=99999, filter_str=None):
"""
Get Project Groups
:param key:
:param limit: OPTIONAL: The limit of the number of groups to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:param... |
Get repository Groups
:param project_key:
:param repo_key:
:param limit: OPTIONAL: The limit of the number of groups to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:param filter_str: OPTIONAL: group filter string
... | def repo_groups(self, project_key, repo_key, limit=99999, filter_str=None):
"""
Get repository Groups
:param project_key:
:param repo_key:
:param limit: OPTIONAL: The limit of the number of groups to return, this may be restricted by
fixed system limit... |
Get group of members
:param group:
:param limit: OPTIONAL: The limit of the number of users to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:return: | def group_members(self, group, limit=99999):
"""
Get group of members
:param group:
:param limit: OPTIONAL: The limit of the number of users to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:return:
"""
... |
Get the list of project administrators
:return: | def all_project_administrators(self):
"""
Get the list of project administrators
:return:
"""
for project in self.project_list():
log.info('Processing project: {0} - {1}'.format(project.get('key'), project.get('name')))
yield {
'project_key... |
Get repositories list from project
:param project_key:
:param start: OPTIONAL: The start of the
:param limit: OPTIONAL: The limit of the number of repositories to return, this may be restricted by
fixed system limits. Default by built-in method: 25
:return: | def repo_list(self, project_key, start=None, limit=25):
"""
Get repositories list from project
:param project_key:
:param start: OPTIONAL: The start of the
:param limit: OPTIONAL: The limit of the number of repositories to return, this may be restricted by
... |
Create a new repository.
Requires an existing project in which this repository will be created. The only parameters which will be used
are name and scmId.
The authenticated user must have PROJECT_ADMIN permission for the context project to call this resource.
:param project_key: The p... | def create_repo(self, project_key, repository, forkable=False, is_private=True):
"""Create a new repository.
Requires an existing project in which this repository will be created. The only parameters which will be used
are name and scmId.
The authenticated user must have PROJECT_ADMIN ... |
Get all repositories list from project
:param project_key:
:return: | def repo_all_list(self, project_key):
"""
Get all repositories list from project
:param project_key:
:return:
"""
url = 'rest/api/1.0/projects/{projectKey}/repos'.format(projectKey=project_key)
params = {}
start = 0
params['start'] = start
... |
Retrieve the branches matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param start:
:param project:
:param repository:
:param base: base branch/tag to compare each branch to (for the... | def get_branches(self, project, repository, base=None, filter=None, start=0, limit=99999, details=True,
order_by='MODIFICATION'):
"""
Retrieve the branches matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the specified reposit... |
Creates a branch using the information provided in the request.
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:param project_key: The project matching the projectKey supplied in the resource path as shown in URL.
:type project_key: str... | def create_branch(self, project_key, repository, name, start_point, message=""):
"""Creates a branch using the information provided in the request.
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:param project_key: The project matching ... |
Get pull requests
:param project:
:param repository:
:param state:
:param order: OPTIONAL: defaults to NEWEST) the order to return pull requests in, either OLDEST
(as in: "oldest first") or NEWEST.
:param limit:
:param start:
:retur... | def get_pull_requests(self, project, repository, state='OPEN', order='newest', limit=100, start=0):
"""
Get pull requests
:param project:
:param repository:
:param state:
:param order: OPTIONAL: defaults to NEWEST) the order to return pull requests in, either OLDEST
... |
Get pull requests activities
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:return: | def get_pull_requests_activities(self, project, repository, pull_request_id):
"""
Get pull requests activities
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:return:
"""
url = 'rest/api/1.0/proj... |
Delete branch from related repo
:param self:
:param project:
:param repository:
:param name:
:param end_point:
:return: | def delete_branch(self, project, repository, name, end_point):
"""
Delete branch from related repo
:param self:
:param project:
:param repository:
:param name:
:param end_point:
:return:
"""
url = 'rest/branch-utils/1.0/projects/{project}/... |
Get pull requests changes
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:return: | def get_pull_requests_changes(self, project, repository, pull_request_id):
"""
Get pull requests changes
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:return:
"""
url = 'rest/api/1.0/projects/{... |
Get pull requests commits
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:return: | def get_pull_requests_commits(self, project, repository, pull_request_id):
"""
Get pull requests commits
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:return:
"""
url = 'rest/api/1.0/projects/{... |
Add comment into pull request
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:param text comment text
:return: | def add_pull_request_comment(self, project, repository, pull_request_id, text):
"""
Add comment into pull request
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:param text comment text
:return:
... |
Retrieve a pull request.
The authenticated user must have REPO_READ permission
for the repository that this pull request targets to call this resource.
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:return: | def get_pullrequest(self, project, repository, pull_request_id):
"""
Retrieve a pull request.
The authenticated user must have REPO_READ permission
for the repository that this pull request targets to call this resource.
:param project:
:param repository:
:param p... |
Retrieve the tags matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
:param project:
:param repository:
:param filter:
:param start:
:param limit: OPTIONAL: The limit of the numbe... | def get_tags(self, project, repository, filter='', limit=1000, order_by=None, start=0):
"""
Retrieve the tags matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
:param project:
:param rep... |
Retrieve a tag in the specified repository.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
Search uri is api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags/{name:.*}
:param project:
:param repository:
:param tag_name... | def get_project_tags(self, project, repository, tag_name):
"""
Retrieve a tag in the specified repository.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
Search uri is api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags/{name... |
Creates a tag using the information provided in the {@link RestCreateTagRequest request}
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:param project:
:param repository:
:param tag_name:
:param commit_revision: commit has... | def set_tag(self, project, repository, tag_name, commit_revision, description=None):
"""
Creates a tag using the information provided in the {@link RestCreateTagRequest request}
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:para... |
Creates a tag using the information provided in the {@link RestCreateTagRequest request}
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:param project:
:param repository:
:param tag_name:
:return: | def delete_tag(self, project, repository, tag_name):
"""
Creates a tag using the information provided in the {@link RestCreateTagRequest request}
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:param project:
:param reposi... |
Get commit list from repo
:param project:
:param repository:
:param hash_oldest:
:param hash_newest:
:param limit: OPTIONAL: The limit of the number of commits to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:retu... | def get_commits(self, project, repository, hash_oldest, hash_newest, limit=99999):
"""
Get commit list from repo
:param project:
:param repository:
:param hash_oldest:
:param hash_newest:
:param limit: OPTIONAL: The limit of the number of commits to return, this m... |
Retrieve a single commit identified by its ID>. In general, that ID is a SHA1.
From 2.11, ref names like "refs/heads/master" are no longer accepted by this resource.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param project:
... | def get_commit_info(self, project, repository, commit, path=None):
"""
Retrieve a single commit identified by its ID>. In general, that ID is a SHA1.
From 2.11, ref names like "refs/heads/master" are no longer accepted by this resource.
The authenticated user must have REPO_READ permissi... |
Get change log between 2 refs
:param project:
:param repository:
:param ref_from:
:param ref_to:
:param limit: OPTIONAL: The limit of the number of changes to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:return: | def get_changelog(self, project, repository, ref_from, ref_to, limit=99999):
"""
Get change log between 2 refs
:param project:
:param repository:
:param ref_from:
:param ref_to:
:param limit: OPTIONAL: The limit of the number of changes to return, this may be rest... |
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.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param pr... | def get_file_list(self, project, repository, query, limit=100000):
"""
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.
The authenticated user must have REP... |
Retrieve the raw content for a file path at a specified revision.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param project:
:param repository:
:param filename:
:param at: OPTIONAL ref string
:param markup: i... | def get_content_of_file(self, project, repository, filename, at=None, markup=None):
"""
Retrieve the raw content for a file path at a specified revision.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param project:
:par... |
Reindex all of the Jira issues related to this repository, including branches and pull requests.
This automatically happens as part of an upgrade, and calling this manually should only be required
if something unforeseen happens and the index becomes out of sync.
The authenticated user must have... | def reindex_repo_dev_panel(self, project, repository):
"""
Reindex all of the Jira issues related to this repository, including branches and pull requests.
This automatically happens as part of an upgrade, and calling this manually should only be required
if something unforeseen happens ... |
Get branches permissions from a given repo
:param project:
:param repository:
:param limit:
:return: | def get_branches_permissions(self, project, repository, limit=25):
"""
Get branches permissions from a given repo
:param project:
:param repository:
:param limit:
:return:
"""
url = 'rest/branch-permissions/2.0/projects/{project}/repos/{repository}/restric... |
Forks a repository within the same project.
:param project:
:param repository:
:param new_repository:
:return: | def fork_repository(self, project, repository, new_repository):
"""
Forks a repository within the same project.
:param project:
:param repository:
:param new_repository:
:return:
"""
url = 'rest/api/1.0/projects/{project}/repos/{repository}'.format(project... |
Get branching model
:param project:
:param repository:
:return: | def get_branching_model(self, project, repository):
"""
Get branching model
:param project:
:param repository:
:return:
"""
url = 'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'.format(
project=project,
... |
Set branching model
:param project:
:param repository:
:param data:
:return: | def set_branching_model(self, project, repository, data):
"""
Set branching model
:param project:
:param repository:
:param data:
:return:
"""
url = 'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'.format(
... |
Enable branching model by setting it with default configuration
:param project:
:param repository:
:return: | def enable_branching_model(self, project, repository):
"""
Enable branching model by setting it with default configuration
:param project:
:param repository:
:return:
"""
default_model_data = {'development': {'refId': None, 'useDefault': True},
... |
Disable branching model
:param project:
:param repository:
:return: | def disable_branching_model(self, project, repository):
"""
Disable branching model
:param project:
:param repository:
:return:
"""
url = 'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'.format(
project=project,
... |
Get request based on the python-requests module. You can override headers, and also, get not json response
:param path:
:param data:
:param flags:
:param params:
:param headers:
:param not_json_response: OPTIONAL: For get content from raw requests packet
:return: | def get(self, path, data=None, flags=None, params=None, headers=None, not_json_response=None):
"""
Get request based on the python-requests module. You can override headers, and also, get not json response
:param path:
:param data:
:param flags:
:param params:
:pa... |
Deletes resources at given paths.
:rtype: dict
:return: Empty dictionary to have consistent interface.
Some of Atlassian REST resources don't return any content. | def delete(self, path, data=None, headers=None, params=None):
"""
Deletes resources at given paths.
:rtype: dict
:return: Empty dictionary to have consistent interface.
Some of Atlassian REST resources don't return any content.
"""
self.request('DELETE', path=path... |
Detect errors in space
:param confluence:
:param space_key:
:return: | def check_unknown_attachment_in_space(confluence, space_key):
"""
Detect errors in space
:param confluence:
:param space_key:
:return:
"""
page_ids = get_all_pages_ids(confluence, space_key)
print("Start review pages {} in {}".format(len(page_ids), space_key))
for page_id in... |
Get all found pages with order by created date
:param confluence:
:param word:
:return: json answer | def search_word(confluence, word):
"""
Get all found pages with order by created date
:param confluence:
:param word:
:return: json answer
"""
cql = "siteSearch ~ {} order by created".format(word)
answers = confluence.cql(cql)
for answer in answers.get('results'):
p... |
Get all found pages with order by created date
:param confluence:
:param space
:param word:
:return: json answer | def search_word_in_space(confluence, space, word):
"""
Get all found pages with order by created date
:param confluence:
:param space
:param word:
:return: json answer
"""
cql = "space.key={} and (text ~ {})".format(space, word)
answers = confluence.cql(cql, expand='space,bo... |
Remove all pages from trash for related space
:param limit:
:param confluence:
:param space_key:
:return: | def clean_pages_from_space(confluence, space_key, limit=500):
"""
Remove all pages from trash for related space
:param limit:
:param confluence:
:param space_key:
:return:
"""
flag = True
while flag:
values = confluence.get_all_pages_from_space_trash(space=space_key, start=0,... |
Main function for retrieve space keys and provide space for cleaner
:param confluence:
:return: | def clean_all_trash_pages_from_all_spaces(confluence):
"""
Main function for retrieve space keys and provide space for cleaner
:param confluence:
:return:
"""
limit = 50
flag = True
i = 0
while flag:
space_lists = confluence.get_all_spaces(start=i * limit, limit=limit)
... |
:param confluence:
:param space_key:
:return: | def get_all_page_ids_from_space(confluence, space_key):
"""
:param confluence:
:param space_key:
:return:
"""
limit = 500
flag = True
step = 0
page_ids = []
while flag:
values = confluence.get_all_pages_from_space(space=space_key, start=limit * step, limit=limit)
... |
Threshold used to determine if your content qualifies as spam.
On a scale from 1 to 10, with 10 being most strict, or most likely to
be considered as spam.
:param value: Threshold used to determine if your content qualifies as
spam.
On a scale from 1 ... | def threshold(self, value):
"""Threshold used to determine if your content qualifies as spam.
On a scale from 1 to 10, with 10 being most strict, or most likely to
be considered as spam.
:param value: Threshold used to determine if your content qualifies as
spam.
... |
An Inbound Parse URL to send a copy of your email.
If defined, a copy of your email and its spam report will be sent here.
:param value: An Inbound Parse URL to send a copy of your email.
If defined, a copy of your email and its spam report will be sent here.
:type value: string | def post_to_url(self, value):
"""An Inbound Parse URL to send a copy of your email.
If defined, a copy of your email and its spam report will be sent here.
:param value: An Inbound Parse URL to send a copy of your email.
If defined, a copy of your email and its spam report will be sent ... |
Get a JSON-ready representation of this SpamCheck.
:returns: This SpamCheck, ready for use in a request body.
:rtype: dict | def get(self):
"""
Get a JSON-ready representation of this SpamCheck.
:returns: This SpamCheck, ready for use in a request body.
:rtype: dict
"""
spam_check = {}
if self.enable is not None:
spam_check["enable"] = self.enable
if self.threshold... |
The actual HTML content.
:param value: The actual HTML content.
:type value: string | def content(self, value):
"""The actual HTML content.
:param value: The actual HTML content.
:type value: string
"""
self._validator.validate_message_dict(value)
self._content = value |
Get a JSON-ready representation of this HtmlContent.
:returns: This HtmlContent, ready for use in a request body.
:rtype: dict | def get(self):
"""
Get a JSON-ready representation of this HtmlContent.
:returns: This HtmlContent, ready for use in a request body.
:rtype: dict
"""
content = {}
if self.mime_type is not None:
content["type"] = self.mime_type
if self.content... |
Get a JSON-ready representation of this BCCSettings.
:returns: This BCCSettings, ready for use in a request body.
:rtype: dict | def get(self):
"""
Get a JSON-ready representation of this BCCSettings.
:returns: This BCCSettings, ready for use in a request body.
:rtype: dict
"""
bcc_settings = {}
if self.enable is not None:
bcc_settings["enable"] = self.enable
if self.e... |
Set the default header for a Twilio SendGrid v3 API call | def _default_headers(self):
"""Set the default header for a Twilio SendGrid v3 API call"""
headers = {
"Authorization": 'Bearer {}'.format(self.api_key),
"User-agent": self.useragent,
"Accept": 'application/json'
}
if self.impersonate_subuser:
... |
Make a Twilio SendGrid v3 API request with the request body generated by
the Mail object
:param message: The Twilio SendGrid v3 API request body generated by the Mail
object
:type message: Mail | def send(self, message):
"""Make a Twilio SendGrid v3 API request with the request body generated by
the Mail object
:param message: The Twilio SendGrid v3 API request body generated by the Mail
object
:type message: Mail
"""
if isinsta... |
Ensure an item is appended to a list or create a new empty list
:param new_items: the item(s) to append
:type new_items: list(obj)
:param append_to: the list on which to append the items
:type append_to: list()
:param index: index of the list on which to append the items
... | def _ensure_append(self, new_items, append_to, index=0):
"""Ensure an item is appended to a list or create a new empty list
:param new_items: the item(s) to append
:type new_items: list(obj)
:param append_to: the list on which to append the items
:type append_to: list()
... |
Ensure an item is inserted to a list or create a new empty list
:param new_items: the item(s) to insert
:type new_items: list(obj)
:param insert_to: the list on which to insert the items at index 0
:type insert_to: list() | def _ensure_insert(self, new_items, insert_to):
"""Ensure an item is inserted to a list or create a new empty list
:param new_items: the item(s) to insert
:type new_items: list(obj)
:param insert_to: the list on which to insert the items at index 0
:type insert_to: list()
... |
Flatten a dict
:param dicts: Flatten a dict
:type dicts: list(dict) | def _flatten_dicts(self, dicts):
"""Flatten a dict
:param dicts: Flatten a dict
:type dicts: list(dict)
"""
d = dict()
list_of_dicts = [d.get() for d in dicts or []]
return {k: v for d in list_of_dicts for k, v in d.items()} |
Adds emails to the Personalization object
:param emails: An Email or list of Email objects
:type emails: Email, list(Email)
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilization f... | def _set_emails(
self, emails, global_substitutions=None, is_multiple=False, p=0):
"""Adds emails to the Personalization object
:param emails: An Email or list of Email objects
:type emails: Email, list(Email)
:param global_substitutions: A dict of substitutions for all reci... |
Adds To objects to the Personalization object
:param to_emails: An To or list of To objects
:type to_emails: To, list(To), str, tuple
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personi... | def to(self, to_emails, global_substitutions=None, is_multiple=False, p=0):
"""Adds To objects to the Personalization object
:param to_emails: An To or list of To objects
:type to_emails: To, list(To), str, tuple
:param global_substitutions: A dict of substitutions for all recipients
... |
Add a Personaliztion object
:param personalizations: Add a Personalization object
:type personalizations: Personalization
:param index: The index where to add the Personalization
:type index: int | def add_personalization(self, personalization, index=0):
"""Add a Personaliztion object
:param personalizations: Add a Personalization object
:type personalizations: Personalization
:param index: The index where to add the Personalization
:type index: int
"""
sel... |
Adds a To object to the Personalization object
:param to_emails: A To object
:type to_emails: To, str, tuple
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilization for each recipie... | def add_to(
self, to_email, global_substitutions=None, is_multiple=False, p=0):
"""Adds a To object to the Personalization object
:param to_emails: A To object
:type to_emails: To, str, tuple
:param global_substitutions: A dict of substitutions for all recipients
:ty... |
Adds Cc objects to the Personalization object
:param cc_emails: An Cc or list of Cc objects
:type cc_emails: Cc, list(Cc), tuple
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilizat... | def cc(self, cc_emails, global_substitutions=None, is_multiple=False, p=0):
"""Adds Cc objects to the Personalization object
:param cc_emails: An Cc or list of Cc objects
:type cc_emails: Cc, list(Cc), tuple
:param global_substitutions: A dict of substitutions for all recipients
... |
Adds a Cc object to the Personalization object
:param to_emails: An Cc object
:type to_emails: Cc
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilization for each recipient
... | def add_cc(
self, cc_email, global_substitutions=None, is_multiple=False, p=0):
"""Adds a Cc object to the Personalization object
:param to_emails: An Cc object
:type to_emails: Cc
:param global_substitutions: A dict of substitutions for all recipients
:type global_s... |
Adds Bcc objects to the Personalization object
:param bcc_emails: An Bcc or list of Bcc objects
:type bcc_emails: Bcc, list(Bcc), tuple
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new perso... | def bcc(
self,
bcc_emails,
global_substitutions=None,
is_multiple=False,
p=0):
"""Adds Bcc objects to the Personalization object
:param bcc_emails: An Bcc or list of Bcc objects
:type bcc_emails: Bcc, list(Bcc), tuple
:param gl... |
Adds a Bcc object to the Personalization object
:param to_emails: An Bcc object
:type to_emails: Bcc
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilization for each recipient
... | def add_bcc(
self,
bcc_email,
global_substitutions=None,
is_multiple=False,
p=0):
"""Adds a Bcc object to the Personalization object
:param to_emails: An Bcc object
:type to_emails: Bcc
:param global_substitutions: A dict of su... |
The subject of the email(s)
:param value: The subject of the email(s)
:type value: Subject, string | def subject(self, value):
"""The subject of the email(s)
:param value: The subject of the email(s)
:type value: Subject, string
"""
if isinstance(value, Subject):
if value.personalization is not None:
try:
personalization = \
... |
Add headers to the email
:param value: A list of Header objects or a dict of header key/values
:type value: Header, list(Header), dict | def header(self, headers):
"""Add headers to the email
:param value: A list of Header objects or a dict of header key/values
:type value: Header, list(Header), dict
"""
if isinstance(headers, list):
for h in headers:
self.add_header(h)
else:
... |
Add headers to the email globaly or to a specific Personalization
:param value: A Header object or a dict of header key/values
:type value: Header, dict | def add_header(self, header):
"""Add headers to the email globaly or to a specific Personalization
:param value: A Header object or a dict of header key/values
:type value: Header, dict
"""
if header.personalization is not None:
try:
personalization =... |
Add substitutions to the email
:param value: Add substitutions to the email
:type value: Substitution, list(Substitution) | def substitution(self, substitution):
"""Add substitutions to the email
:param value: Add substitutions to the email
:type value: Substitution, list(Substitution)
"""
if isinstance(substitution, list):
for s in substitution:
self.add_substitution(s)
... |
Add a substitution to the email
:param value: Add a substitution to the email
:type value: Substitution | def add_substitution(self, substitution):
"""Add a substitution to the email
:param value: Add a substitution to the email
:type value: Substitution
"""
if substitution.personalization:
try:
personalization = \
self._personalizatio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.