Bundled Resource

Purpose

Bundled Resources service actions. A bundled resource is either a JAR file or data file (CSV, Excel) that is used by Groovy scripts. They are uploaded in the Portal, and can be packaged in an application.

Resource deployment will create a target file using the bundled resource’s definition and copy the content into the file. Un-deployment will ensure the file is removed.

A resource’s id consists of the application key and the bundled resource’s name separated with a dot ..

Methods

Binding name: bundled


Method: boolean isDeployed(String resourceId)

True if the bundled resource has been deployed.


Method: boolean deploy(String resourceId)

Deploy the bundled resource identified it’s id.


Method: boolean undeploy(String resourceId)

Undeploy the bundled resource identified by it’s id.


Method: Map<String, String> resourceProperties(String resourceId)

Get the properties associated with a resource identified by it’s id.


Method: String[] listResources()

Get a list of all defined bundled resource ids.

Examples

println "Resources:\n" + bundled.listResources()

println bundled.resourceProperties(".MyTestResource")

println "MyTestResource deployed? " + bundled.isDeployed(".MyTestResource")

println "Deploying..."
bundled.deploy(".MyTestResource")

assert true == bundled.isDeployed(".MyTestResource") : "Deployment failed!"

println "Undeploying..."
bundled.undeploy(".MyTestResource")

assert true != bundled.isDeployed(".MyTestResource") : "Undeployment failed!"