8000 Document the `metadata.query` method by vogelsgesang · Pull Request #896 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

Document the metadata.query method #896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/api-ref.md
8000
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,55 @@ Returns the `JobItem` requested.
```


<br>
<br>

---

## Metadata

Using the `metadata` endpoint, one can use GraphQL to query metadata on, e.g., workbooks, datasources, the fields contained within them, and the relationships between them.

### Metadata methods


The Metadata methods call the [Metadata API](https://help.tableau.com/current/api/metadata_api/en-us/index.html) which is a GraphQL interface allowing to query metadata about objects on the server (workbooks, datasources, ...) and the relationships between them.


Source files: server/endpoint/metadata_endpoint.py

<br>
<br>


#### metadata.query


```py
metadata.query(query, variables=None, abort_on_error=False)
```

Executes a metadata query and returns the result.


**Parameters**

Name | Description
:--- | :---
`query` | The GraphQL query
`variables` | Variables for the GraphQL query
`abort_on_error` | Whether to t C1B4 hrow an exception on error


**Returns**

The method returns the query results as a stucture of `list`s and `dict`s as returned by the `json` package.


**Example**

See the `metadata_query.py` sample in the Samples directory.

<br>
<br>

Expand Down
1 change: 1 addition & 0 deletions docs/samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ The following list describes the samples available in the repository:
* `kill_all_jobs.py` Kills all running jobs.
* `list.py` Lists all datasources or workbooks of a site.
* `login.py` Demonstrates logging in to the server with either username/password or personal access token.
* `metadata_query.py` Uses the metadata API to query information on a published data source.
* `move_workbook_projects.py` Moves a workbook from one project to another.
* `move_workbook_sites.py` Downloads a workbook, stores it in-memory, and uploads it to another site.
* `pagination_sample.py` Uses the Pager generator to iterate over all the items on the server.
Expand Down
0