You are here

function hosting_example_hosting_service_type in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 example/example_service/hosting_example.module \hosting_example_hosting_service_type()
  2. 7.3 example/example_service/hosting_example.module \hosting_example_hosting_service_type()

Expose a type of service to the Service API.

Return a new type of service (such as http, dns, db etc.) to the service API.

This information will be used to display the server node form, allowing you to create services of this type.

Just defining a service type without any implementations of it, will automatically provide the "None" implementation.

You will then need to create a new file in the same directory as your module named "$module.service.inc, containing at least a single class named "provisionService_$service", which extends the base provisionService class.

Return value

an associative array with the index declaring the service type, and containing another associative array of properties. At present only the 'title' property is required for display of the server node form.

See also

hosting_server_services()

Related topics

File

example/hosting_example.module, line 46
Example of the Hosting Services API.

Code

function hosting_example_hosting_service_type() {
  return array(
    'example' => array(
      // Machine name
      'title' => t('Example service'),
      // Human-readable name
      'weight' => 0,
    ),
  );
}