Skip to content

Commit

Permalink
R-41853: Mirrored changes made in gitlab.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaddad committed Dec 2, 2020
1 parent 096ac68 commit 7fac0c6
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 8 deletions.
55 changes: 49 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ To generate an EDM API token:

#. Log in to the operating system CLI with your EDM credentials.

#. To create the token, enter **edm\_apitoken\_gen**.
#. To create the token, enter 'services aaa local apitoken generate <username> <one-word-description>'.

The system responds with the new API token, for example:

.. code:: json
{ "admin": "LMttPZ45FXnJT6IokVh6Px-otiKGDMkUdyQmJMWmWGz" }
Added token: LMttPZ45FXnJT6IokVh6Px-otiKGDMkUdyQmJMWmWGz


#. For later use, copy the token and then paste it to a text file.
Expand All @@ -47,9 +45,9 @@ To generate an EDM API token:

To View or delete a token, use one of the following commands.

* edm\_apitoken\_show
* services aaa local apitoken show

* edm\_apitoken\_delete
* services aaa local apitoken remove

Using the Client
----------------
Expand Down Expand Up @@ -155,6 +153,51 @@ Add or Update the CTI configuration:
dev.configuration.cti.update(cti_token='ajfdgFJGFGmh27hnbv')
Executive Reporting
~~~~~~~~~~~~~~~~~~~

Create a new report:

.. code:: python
dev.reports.create(name='Example Report')
Update a report:

.. code:: python
dev.reports.update(id=1, name='Updated Example Report')
Partial update a report:

.. code:: python
dev.reports.partial_update(id=1, name='Updated Example Report')
View a condensed list of all reports:

.. code:: python
dev.reports.show(page=1, pageSize=100, order='asc', orderBy='createdAt')
View single report:

.. code:: python
dev.reports.show(id=3)
View report status:

.. code:: python
dev.reports.show(id=3, show_status=True)
Delete a report:

.. code:: python
dev.reports.delete(id=1)
Running Unit Tests
------------------

Expand Down
4 changes: 2 additions & 2 deletions edmclient/rest_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, host, apitoken, api_version, raise_on_error=False):
self.apiversion = api_version
self.raise_on_error = raise_on_error
self._headers = {
'Authorization': 'NSAPITOKENID {}'.format(self.apitoken),
'X-Arbux-APIToken': self.apitoken,
}

@staticmethod
Expand Down Expand Up @@ -113,4 +113,4 @@ def _put(self, item=None, **kwargs):
REST PUT method
"""
item = '/' + str(item) if item else ''
return self._make_request('PATCH', item=item, data=json.dumps(kwargs))
return self._make_request('PUT', item=item, data=json.dumps(kwargs))

0 comments on commit 7fac0c6

Please sign in to comment.