RosvQuery1 | R Documentation |
An R6 class to provide a lower-level interface to the query endpoint of the OSV API.
Pageination is implemented via httr2::req_perform_iterative()
and a private method for
extracting tokens automatically. When initialized, the page_token is set to NULL
;
if a token is generated for large results the process is handled internally. The response object
will contain a list of all returned responses before any formatting occurred. The content field will
contain the list of vulnerabilities which may be further parsed into a table format.
An R6 object to operate with OSV query endpoint.
request
Request object made by httr2
.
content
Body contents of response from OSV API.
response
Response object returned from OSV API.
new()
Set the core request details for subsequent use when called in run()
method.
RosvQuery1$new( commit = NULL, version = NULL, name = NULL, ecosystem = NULL, purl = NULL )
commit
Commit hash to query against (do not use when version set).
version
Version of package.
name
Name of package.
ecosystem
Ecosystem package lives within (must be set if using name
).
purl
URL for package (do not use if name
or ecosystem
is set).
run()
Perform the request and return response for OSV API call.
RosvQuery1$run()
parse()
Parse the contents returned into a tidier format. Can
use future
plans to help parallelize. Not all contents are parsed.
RosvQuery1$parse()
print()
Print basic details of query object to screen.
RosvQuery1$print(...)
...
Reserved for possible future use.
clone()
The objects of this class are cloneable with this method.
RosvQuery1$clone(deep = FALSE)
deep
Whether to make a deep clone.
https://google.github.io/osv.dev/post-v1-query/
query <- RosvQuery1$new(commit = '6879efc2c1596d11a6a6ad296f80063b558d5e0f')
query
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.