Learn R Programming

AzureML (version 0.1.1)

publishWebService: Publish a function to Microsoft Azure

Description

Publish a function to Microsoft Azure Machine Learning as a web service. The web service created is a standard Azure ML web service, and can be utilized from any web or mobile platform. as long as the user has the API key and URL. The function to be published can use arbitrary objects and packages. Currently, the function to be published can only take in primitive data types as input, i.e. no data frames or lists, but support for those functions will be added in the future.

Usage

publishWebService(functionName, serviceName, inputSchema, outputSchema, wkID,
  authToken)

Arguments

functionName
function name as a string to be published
serviceName
name of the new web service
inputSchema
list of input parameters of format list("arg1"="type", "arg2"="type", ...)
outputSchema
list of outputs of format list("output1"="type", "output2"="type", ...)
wkID
the workspace ID
authToken
primary authorization token

Value

  • nested list, the first element is a list containing information about the new web service, the second element is a list of its endpoints

See Also

getWSDetails getEndpoints discoverSchema consumeLists Other publishing functions: updateWebService

Examples

Run this code
add <- function(x,y) { return(x+y) }
newService <- publishWebService("add", "add",
 list("x"="int","y"="int"), list("z"="int"), wsID, authToken)
webserviceDetails <- newService[[1]]
endpoints <- newService[[2]]
helpURL <- endpoints[[1]]$HelpLocation
pKey <- endpoints[[1]]$PrimaryKey
apiURL <- endpoints[[1]]$ApiLocation

Run the code above in your browser using DataLab