Title: | Functions to Interact with the ICES Data Submission Utility (DATSU) |
---|---|
Description: | Functions to Interact with the ICES Data Submission Utility (DATSU) <https://datsu.ices.dk/web/index.aspx>. |
Authors: | Colin Millar [aut, cre], Carlos Pinto [aut], Laura Andreea Petre [aut] |
Maintainer: | Colin Millar <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.2.0 |
Built: | 2024-10-25 05:28:55 UTC |
Source: | CRAN |
utility to build a url with optional query arguments
datsu_api(service, ...)
datsu_api(service, ...)
service |
the name of the service |
... |
name arguments will be added as queries |
a complete url as a character string
datsu_api("hi", bye = 21) datsu_api("getDataverIDs")
datsu_api("hi", bye = 21) datsu_api("getDataverIDs")
A list of the available fields for the specified format and record (optional filter). in this list it is specified the field type, if it is mandatory and if it is linked with any vocabulary.
getDataFieldsDescription(datasetverID, recordType = NULL)
getDataFieldsDescription(datasetverID, recordType = NULL)
datasetverID |
the dataset ID |
recordType |
string name of the record type, optional |
List of the supported records and fields.
## Not run: getDataFieldsDescription(145) getDataFieldsDescription(145, "VE") ## End(Not run)
## Not run: getDataFieldsDescription(145) getDataFieldsDescription(145, "VE") ## End(Not run)
This API allows the user to have a list of all the datasets IDs that can be screened in the DATSU API.
getDataverIDs()
getDataverIDs()
The list of Datasets that can be screened in DATSU with the IDs
## Not run: formats <- getDataverIDs() formats[grep("vms", tolower(formats$description)), ] ## End(Not run)
## Not run: formats <- getDataverIDs() formats[grep("vms", tolower(formats$description)), ] ## End(Not run)
This API allows the user to have a list of all the datasets IDs that can be screened in the DATSU API.
getListQCChecks(datasetverID, recordType = NULL)
getListQCChecks(datasetverID, recordType = NULL)
datasetverID |
the dataset ID |
recordType |
string name of the record type, optional |
The list of Datasets that can be screened in DATSU with the IDs
## Not run: getListQCChecks(145) getListQCChecks(145, "VE") ## End(Not run)
## Not run: getListQCChecks(145) getListQCChecks(145, "VE") ## End(Not run)
This API of the web service returns a list of the sessions for the authenticated user.
getMySessionsList()
getMySessionsList()
The details of the users sessions
## Not run: getMySessionsList() ## End(Not run)
## Not run: getMySessionsList() ## End(Not run)
A list of the available records for the specified format
getRecordIDs(datasetverID)
getRecordIDs(datasetverID)
datasetverID |
the dataset ID |
List of the supported records for the specified records
## Not run: getRecordIDs(145) ## End(Not run)
## Not run: getRecordIDs(145) ## End(Not run)
This API allows the user to view the details of a specific session.
getScreeningSessionDetails(sessionID)
getScreeningSessionDetails(sessionID)
sessionID |
the session ID |
Details of the session
## Not run: getScreeningSessionDetails(10) ## End(Not run)
## Not run: getScreeningSessionDetails(10) ## End(Not run)
A list of the messages for the specified session ID
getScreeningSessionMessages(sessionID)
getScreeningSessionMessages(sessionID)
sessionID |
the session ID |
List of the messages for the specified session
## Not run: messages <- getScreeningSessionMessages(10) ## End(Not run)
## Not run: messages <- getScreeningSessionMessages(10) ## End(Not run)
This API allows the user to screen a file using the API
getScreeningSessionsList(dataSetVerID, year = NULL, country = NULL)
getScreeningSessionsList(dataSetVerID, year = NULL, country = NULL)
dataSetVerID |
the dataset version id |
year |
filter by year, optional |
country |
filter by country, optional |
The details of the sessions
## Not run: getScreeningSessionsList(145) getScreeningSessionsList(145, year = 2020) ## End(Not run)
## Not run: getScreeningSessionsList(145) getScreeningSessionsList(145, year = 2020) ## End(Not run)
This API allows the user to screen a file using the API.
uploadDatsuFileFireAndForget( fileToUpload, dataSetVerID, emailAddress = NULL, sendEmail = TRUE, errorLimit = 30000, verbose = FALSE )
uploadDatsuFileFireAndForget( fileToUpload, dataSetVerID, emailAddress = NULL, sendEmail = TRUE, errorLimit = 30000, verbose = FALSE )
fileToUpload |
the filename of the file to upload |
dataSetVerID |
The version of the dataset |
emailAddress |
alternative email address of the user, if NULL, email address from ICES token is used |
sendEmail |
it is set to TRUE by default, this will specify if the user will to receive an email when the session is finished |
errorLimit |
does not need to be specified, it is 30000 by default |
verbose |
get verbose output from the POST request, default FALSE |
The ID of the DATSU session
## Not run: filename <- system.file("test_files/vms_test.csv", package = "icesDatsu") id <- uploadDatsuFileFireAndForget(filename, 145) getScreeningSessionDetails(id) messages <- getScreeningSessionMessages(id) head(messages) uploadDatsuFileFireAndForget(filename, 145, sendEmail = FALSE) ## End(Not run)
## Not run: filename <- system.file("test_files/vms_test.csv", package = "icesDatsu") id <- uploadDatsuFileFireAndForget(filename, 145) getScreeningSessionDetails(id) messages <- getScreeningSessionMessages(id) head(messages) uploadDatsuFileFireAndForget(filename, 145, sendEmail = FALSE) ## End(Not run)