<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
    <chapter id="implementing-cp">
      <title>Implementing support as a cloud provider</title>
      <para>
        Cloud providers need to create #CloudProvidersAccountExporter objects for
        every account they like to expose to the API and use the #CloudProvidersAccountExporter
        API to set the properties of the accounts. Also a #CloudProvidersProviderExporter
        needs to be created in order to hold all the #CloudProvidersAccountExporter objects
        that will be added to the provider when created.
        #CloudProvidersProviderExporter also export properties that define the provider
        that can be set using the #CloudProvidersProviderExporter API.
      </para>
      <para>
        To register your cloud provider, you need to expose the interface it is implementing in its desktop file
      </para>
      <example>
        <title>Example desktop file to register a cloud provider</title>
        <programlisting>
          [Desktop Entry]
          Type=Application
          Name=mycloudprovider example server
          NoDisplay=true
          Implements=org.freedesktop.CloudProviders

          [org.freedesktop.CloudProviders]
          BusName=org.mycloudprovider.CloudProviders.ServerExample
          ObjectPath=/org/mycloudprovider/CloudProviders/ServerExample
        </programlisting>
      </example>
      <para>
        In previous versions, to register your cloud provider you needed to provide a file in DATADIR/cloud-providers.
        This way of registering providers is still working but is not compatible with containerization.
      </para>
      <example>
        <title>Example file to register a cloud provider in previous versions</title>
        <programlisting>
          [Cloud Provider]
          BusName=org.mycloudprovider.CloudProviders.ServerExample
          ObjectPath=/org/mycloudprovider/CloudProviders/ServerExample
          Version=1
        </programlisting>
      </example>
    </chapter>
