tableau / server-client-python

A Python library for the Tableau Server REST API
https://tableau.github.io/server-client-python/
MIT License
656 stars 420 forks source link

[TYPE 3] [Async Publish - add object id] #1437

Open jorwoods opened 1 month ago

jorwoods commented 1 month ago

Summary

When publishing workbooks/datasources with as_job and querying for job status via Jobs.get_by_id, Jobs should return details about the object that was published.

Request Type

If you know, say which of these types your request is in the title, and follow the suggestions for that type when writing your description.

Type 3: new functionality Requests for totally new functionality will generally be passed to the relevant dev team, but we probably can't give any useful estimate of how or when it might be implemented. If it is a feature that is 'about' the API or programmable access, here might be the best place to suggest it, but generally feature requests will be more visible in the Tableau Community Ideas forum and should go there instead.

Description

A clear and concise description of what the feature request is. If you think that the value of this feature might not be obvious, include information like how often it is needed, amount of work saved, etc. If your feature request is related to a file or server in a specific state, describe the starting state when the feature can be used, and the end state after using it. If it involves modifying files, an example file may be helpful.


When content has been published asynchronously, it returns a JobItem. After waiting for the job to complete via server.jobs.wait_for_job, the resulting JobItem has no detail about the object created. Example XML returned:

<?xml version='1.0' encoding='UTF-8'?>
<tsResponse xmlns="http://tableau.com/api"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api https://help.tableau.com/samples/en-us/rest_api/ts-api_3_23.xsd">
    <job id="27f7539d-43a9-47ad-bdd5-48db01bb54f6" 
        mode="Asynchronous" 
        type="PublishWorkbook" 
        progress="100" 
        createdAt="2024-08-07T23:03:26Z" 
        updatedAt="2024-08-07T23:03:28Z" 
        completedAt="2024-08-07T23:03:28Z" 
        finishCode="0">
        <statusNotes/>
    </job>
</tsResponse>

If a workbook/datasource element could be added when the type is a publish, it would simplify follow-up actions in scripts.

bryceglarsen commented 1 month ago

Thanks for adding, @jorwoods!