Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyOTRS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Som Connexió
OTRS
PyOTRS
Commits
ab1822f9
Commit
ab1822f9
authored
4 years ago
by
Robert Habermann
Browse files
Options
Downloads
Patches
Plain Diff
make sure to send HTTP GET with get parameters (instead of json body)
parent
ecbc4ec6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyotrs/lib.py
+19
-2
19 additions, 2 deletions
pyotrs/lib.py
with
19 additions
and
2 deletions
pyotrs/lib.py
+
19
−
2
View file @
ab1822f9
...
...
@@ -128,6 +128,7 @@ class HTTPError(PyOTRSError):
class
Article
(
object
):
"""
PyOTRS Article class
"""
def
__init__
(
self
,
dct
):
fields
=
{}
for
key
,
value
in
dct
.
items
():
...
...
@@ -300,6 +301,7 @@ class Article(object):
class
Attachment
(
object
):
"""
PyOTRS Attachment class
"""
def
__init__
(
self
,
dct
):
self
.
__dict__
=
dct
...
...
@@ -499,6 +501,7 @@ class Ticket(object):
dynamic_fields (list): List of DynamicField objects
"""
def
__init__
(
self
,
dct
):
# store OTRS Top Level fields
self
.
fields
=
{}
...
...
@@ -730,6 +733,7 @@ class SessionStore(object):
ArgumentMissingError
"""
def
__init__
(
self
,
file_path
=
None
,
session_timeout
=
None
,
value
=
None
,
created
=
None
,
expires
=
None
):
if
not
file_path
:
...
...
@@ -874,6 +878,7 @@ class Client(object):
"
/otrs/nph-genericinterface.pl/Webservice/
"
"""
def
__init__
(
self
,
baseurl
=
None
,
username
=
None
,
...
...
@@ -974,6 +979,7 @@ class Client(object):
* session_create
* session_restore_or_set_up_new # try to get session_id from a (json) file on disc
"""
def
session_check_is_valid
(
self
,
session_id
=
None
):
"""
check whether session_id is currently valid
...
...
@@ -1074,6 +1080,7 @@ class Client(object):
GenericInterface::Operation::Ticket::TicketCreate
* ticket_create
"""
def
ticket_create
(
self
,
ticket
=
None
,
article
=
None
,
...
...
@@ -1131,6 +1138,7 @@ class Client(object):
* ticket_get_by_list
* ticket_get_by_number
"""
def
ticket_get_by_id
(
self
,
ticket_id
,
articles
=
False
,
...
...
@@ -1274,6 +1282,7 @@ class Client(object):
* ticket_search
* ticket_search_full_text
"""
def
ticket_search
(
self
,
dynamic_fields
=
None
,
**
kwargs
):
"""
Search for ticket
...
...
@@ -1341,6 +1350,7 @@ class Client(object):
* ticket_update
* ticket_update_set_pending
"""
def
ticket_update
(
self
,
ticket_id
,
article
=
None
,
...
...
@@ -1560,6 +1570,7 @@ class Client(object):
GenericInterface::Operation::Link::LinkAdd
* link_add
"""
def
link_add
(
self
,
src_object_id
,
dst_object_id
,
...
...
@@ -1604,6 +1615,7 @@ class Client(object):
GenericInterface::Operation::Link::LinkDelete
* link_delete
"""
def
link_delete
(
self
,
src_object_id
,
dst_object_id
,
...
...
@@ -1645,9 +1657,10 @@ class Client(object):
GenericInterface::Operation::Link::LinkDeleteAll
* link_delete_all
"""
def
link_delete_all
(
self
,
object_id
,
object_type
=
"
Ticket
"
,):
object_type
=
"
Ticket
"
,
):
"""
link_delete_all
Args:
...
...
@@ -1676,6 +1689,7 @@ class Client(object):
GenericInterface::Operation::Link::LinkList
* link_list
"""
def
link_list
(
self
,
src_object_id
,
src_object_type
=
"
Ticket
"
,
...
...
@@ -1727,6 +1741,7 @@ class Client(object):
GenericInterface::Operation::Link::PossibleLinkList
* link_possible_link_list
"""
def
link_possible_link_list
(
self
):
"""
link_possible_link_list
...
...
@@ -1752,6 +1767,7 @@ class Client(object):
GenericInterface::Operation::Link::PossibleObjectsList
* link_possible_objects_list
"""
def
link_possible_objects_list
(
self
,
object_type
=
"
Ticket
"
):
"""
link_possible_objects_list
...
...
@@ -1783,6 +1799,7 @@ class Client(object):
GenericInterface::Operation::Link::PossibleTypesList
* link_possible_types_list
"""
def
link_possible_types_list
(
self
,
src_object_type
=
"
Ticket
"
,
dst_object_type
=
"
Ticket
"
):
...
...
@@ -1910,7 +1927,7 @@ class Client(object):
headers
.
update
({
"
Content-Type
"
:
"
application/json
"
})
json_payload
=
json
.
dumps
(
payload
)
# print("sending {0} to {1} as {2}".format(payload, url, http_method.upper()))
try
:
response
=
requests
.
request
(
http_method
.
upper
(),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment