amsPublishArtifact
Publish an R Object as an Artifact to AMS

Description

Publishes an R object (typically a model) as an artifact to an existing AMS project. If an artifact by the same name already exists in the AMS project, then the R object replaces it. If it is a new artifact, then it is added to the project. The artifact is committed to the AMS, but it must be approved before it is visible to all users.

Usage

amsPublishArtifact(x, projectName, path = NULL,
  commitMessage = "Commit Message", objDescription = NULL,
  url, apiToken, port = 2185)

Arguments

object a R object to be published.
projectName a character value. The name of an existing project in the AMS.
path a character value. The path name to use for the artifact in AMS. The default is the name of the object provided as object.
commitMessage a character value. The message for the commit.
objDescription a character value describing the object. The default is to use the call component of object if it exists.
url the URL for the AMS. The default is the cached value saved when amsLogin was called.
apiToken a character value. The API token to connect to the AMS. The default is the cached value created when amsLogin was called.
port an numeric value. The port for connecting to the AMS. The default is the cached value saved when amsLogin was called.

Details

For an artifact with the same name (path) in the AMS project, this function is equivalent to calling the sequence amsCheckoutArtifact, amsUpdateArtifact, asmCommitArtifact.
A warning is issued if the return status is not 200 (success).
Value
returns a list with components:
body a character vector with the body of the results from the connection to the AMS. This character vector is in JSON format.
status an integer representing return code from the connection to the AMS. A value of 200 indicates a successful operation.
headers a character vector containing the headers returned from the connection to the AMS.
Note
R objects are converted to a base64 encoded string by amsPackObject before being uploaded to the AMS.
See Also
amsCheckoutArtifact, amsUpdateArtifact, asmCommitArtifact
Examples
## Not run: 
amsLogin("http://localhost", "fakeuser", "fakepassword")
projTable <- amsListProjects()
newmodel <- lm(ozone ~ temperature + wind, data=Sdatasets::air)
zpublish <- amsPublishArtifact(newmodel, projTable[1, "projectName"],
  commitMessage = "Air model with temperature and wind") 
## End(Not run)
Package AMS version 6.1.1-7
Package Index