10000 Merge pull request #850 from Udit107710/metadata/parameters · cfmayden/server-client-python@29a71b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 29a71b0

Browse files
authored
Merge pull request tableau#850 from Udit107710/metadata/parameters
feat: accept parameters for post endpoint
2 parents 6547f6b + 78c34f8 commit 29a71b0

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

tableauserverclient/server/endpoint/endpoint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,14 @@ def put_request(self, url, xml_request=None, content_type="text/xml"):
127127
content_type=content_type,
128128
)
129129

130-
def post_request(self, url, xml_request, content_type="text/xml"):
130+
def post_request(self, url, xml_request, content_type="text/xml", parameters=None):
131131
return self._make_request(
132132
self.parent_srv.session.post,
133133
url,
134134
content=xml_request,
135135
auth_token=self.parent_srv.auth_token,
136136
content_type=content_type,
137+
parameters=parameters,
137138
)
138139

139140

tableauserverclient/server/endpoint/metadata_endpoint.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ def control_baseurl(self):
5757
return "{0}/api/metadata/v1/control".format(self.parent_srv.server_address)
5858

5959
@api("3.5")
60-
def query(self, query, variables=None, abort_on_error=False):
60+
def query(self, query, variables=None, abort_on_error=False, parameters=None):
6161
logger.info("Querying Metadata API")
62+
6263
url = self.baseurl
6364

6465
try:
@@ -67,7 +68,7 @@ def query(self, query, variables=None, abort_on_error=False):
6768
raise InvalidGraphQLQuery("Must provide a string")
6869

6970
# Setting content type because post_reuqest defaults to text/xml
70-
server_response = self.post_request(url, graphql_query, content_type="application/json")
71+
server_response = self.post_request(url, graphql_query, content_type="application/json", parameters=parameters)
7172
results = server_response.json()
7273

7374
if abort_on_error and results.get("errors", None):

tableauserverclient/server/endpoint/permissions_endpoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def delete(self, resource, rules):
4444

4545
for rule in rules:
4646
for capability, mode in rule.capabilities.items():
47-
" /permissions/groups/group-id/capability-name/capability-mode"
47+
"/permissions/groups/group-id/capability-name/capability-mode"
4848
url = "{0}/{1}/permissions/{2}/{3}/{4}/{5}".format(
4949
self.owner_baseurl(),
5050
resource.id,

tableauserverclient/server/endpoint/server_info_endpoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def baseurl(self):
1717

1818
@api(version="2.4")
1919
def get(self):
20-
""" Retrieve the server info for the server. This is an unauthenticated call """
20+
"""Retrieve the server info for the server. This is an unauthenticated call"""
2121
try:
2222
server_response = self.get_unauthenticated_request(self.baseurl)
2323
except ServerResponseError as e:

tableauserverclient/server/request_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def get_query_params(self):
9898

9999

100100
class _FilterOptionsBase(RequestOptionsBase):
101-
""" Provide a basic implementation of adding view filters to the url """
101+
"""Provide a basic implementation of adding view filters to the url"""
102102

103103
def __init__(self):
104104
self.view_filters = []

0 commit comments

Comments
 (0)
0