Skip to content

Commit

Permalink
Merge pull request #2 from hskwirblies/add-metadata
Browse files Browse the repository at this point in the history
add option to pass release metadata
  • Loading branch information
al4 authored Jun 23, 2016
2 parents f55326a + c44e546 commit a36f7dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions orloclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_release(self, release_id):
:param release_id:
:return:
"""

response_dict = self.get_release_json(release_id)
self.logger.debug(response_dict)

Expand Down Expand Up @@ -133,14 +133,15 @@ def get_release_json(self, release_id):
return self._expect_200_json_response(response)

def create_release(self, user, platforms,
team=None, references=None, note=None):
team=None, references=None, note=None, metadata=None):
"""
Create a release using the REST API
:param string user: User performing the release
:param list platforms: List of strings, platforms being released to
:param string team: Team responsible for the release
:param list references: List of strings, external references, e.g. Jira ticket
:param string note: Free-text field for additional information
:param dict metadata: dictionary containing arbitrary data
"""

data = {
Expand All @@ -154,6 +155,8 @@ def create_release(self, user, platforms,
data['references'] = references
if note:
data['note'] = note
if metadata:
data['metadata'] = metadata

req_url = '{}/releases'.format(self.uri)
self.logger.debug("Posting to {}:\n{}".format(req_url, data))
Expand Down Expand Up @@ -352,4 +355,3 @@ def get_versions(self):
self.logger.debug(response)

return self._expect_200_json_response(response)

0 comments on commit a36f7dd

Please sign in to comment.