Resource types — php-opencloud 1.12.1 documentation

# Resource types

When you define a template, you must use resource types supported by your cloud.

## List resource types

You can list all supported resource types as shown in the following example:

    $resourceTypes = $orchestrationService->listResourceTypes();
    foreach ($resourceTypes as $resourceType) {
        /** @var $resourceType OpenCloud\Orchestration\Resource\ResourceType **/
    }

Get the executable PHP script for this example

## Get resource type

You can retrieve a specific resource type’s schema as shown in the following example:

    /** @var $resourceType OpenCloud\Orchestration\Resource\ResourceType **/
    $resourceType = $orchestrationService->getResourceType('OS::Nova::Server');

Get the executable PHP script for this example

## Get resource type template

You can retrieve a specific resource type’s representation as it would appear in a template, as shown in the following example:

    /** @var $resourceTypeTemplate string **/
    $resourceTypeTemplate = $resourceType->getTemplate();

Get the executable PHP script for this example