Skip to content

Migrate get_job() (singular) to v1 API #341

@toph-allen

Description

@toph-allen

Similarly to #340, the singular get_job() uses an unversioned API and should move to the v1 endpoint.

The unversioned endpoint currently in use returns the stdout and stderr of the process. This is the only reason I imagine a user would want to use this function over the get_jobs() function.

The v1 endpoints for getting a single job just returns the same data as get_jobs(). There are two additional endpoints, though, that return the logs and any error message for a given process.

So get_job_logs() and get_job_error()

Perhaps return the logs as a data frame, with each message on a row, and separate columns for timestamp, data, and source (stdout, stderr).

Still run into the problem of having to pass in both a content item and a job key with the current approach, e.g.:

CONTENT_GUID <- "guid"

client <- connect()
item <- content_item(CONTENT_GUID)
jobs <- get_jobs(item)
key <- jobs$key[1]
logs <- get_job_logs(item, key)

If get_jobs() returned a list of job class objects, we could just pass in the single job (the job object could contain a reference to its parent content item). But in the current mode of returning job data as a data frame, you get to, well, interact with that data with data frame semantics, which is really nice and feels like second nature to me (e.g. dplyr::filter etc.).

Metadata

Metadata

Assignees

Labels

cookbookSupporting recipes in the Connect Cookbook

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions