Skip to content

Bundled Resources

Service Id: platform6.bundledresources

1. List Bundled Resource Ids

Header key Description Value
platform6.request.action The action to perform (required) list.ids
appKey The application key through which the resources are filtered

A valid response will be:

Header key Description
platform6.response.status OK
platform6.response.value The list of filtered identifiers

2. Get a resource’s properties

Header key Description Value
platform6.request.action The action to perform (required) props
id The identifier of the resource (required)

A valid response will be:

The list of the bundled resource’s properties.

Example

def cm = [ 
    headers: [ 
        'platform6.request.action': 'props',
        'id': 'Bundled resource #1' 
    ] 
]

print p6.service.request('platform6.bundledresources', cm).headers

If there are any properties, the response will be:

[ENV_NAME:dev]

If there are no properties, the response is null.

If the bundled resource doesn’t exist, it throws an error:

{
    "message" : "Unexpected exception getting the properties of a bundled resource: the bundled resource 'Bundled resource #1' is not found.",
    "stackTrace" : [
        "io.platform6.common.util.P6Exception: Unexpected exception getting the properties of a bundled resource: the bundled resource 'Bundled resource #1' is not found.",
        "    at io.platform6.core.service.applications.BundledResourcesService.notifyRequestMessage(BundledResourcesService.java:131)",
        "    at io.platform6.core.impl.servicecomponent.AbstractServiceComponent.onCommonMessage(AbstractServiceComponent.java:704)",
        "    at io.platform6.core.impl.platform.messagebus.BusQueueController$ServiceQueueRunner.run(BusQueueController.java:183)",
        "    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)",
        "    at java.util.concurrent.FutureTask.run(FutureTask.java:266)",
        "    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)",
        "    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)",
        "    at java.lang.Thread.run(Thread.java:748)"
    ]
}

3. Check if a resource is deployed

Header key Description Value
platform6.request.action The action to perform (required) is.deployed
id The identifier of the resource (required)

A valid response will be:

Header key Description
platform6.response.status boolean

Example

def cm = [ 
    headers: [ 
        'platform6.request.action': 'is.deployed',
        'id': 'Bundled resource #1' 
    ] 
]

print p6.service.request('platform6.bundledresources', cm).headers['platform6.response.status']

The response will be true if the resource is deployed, false if not.

If the bundled resource doesn’t exist, it will return false.

4. Deploy a resource

Header key Description Value
platform6.request.action The action to perform (required) deploy
id The identifier of the resource (required)

A valid response will be:

Header key Description
platform6.response.status boolean

5. Undeploy a resource

Header key Description Value
platform6.request.action The action to perform (required) undeploy
id The identifier of the resource (required)

A valid response will be:

Header key Description
platform6.response.status boolean