<commit_before>NodeConductor Extensions
========================

NodeConductor extensions are developed as auto-configurable plugins. It's only
required to add desired application to INSTALLED_APPS. Extensions' URL's will
be registered automatically if settings.NODECONDUCTOR['EXTENSIONS AUTOREGISTER']
is True, which is default.

The plugin is expected to expose of all the application to be included in the
``entry_points``, for example:

.. code-block:: python

    entry_points={
       'nodeconductor_extensions': (
           'nodeconductor_plugin_app = nodeconductor_plugin.app.urls',
           ),
    }


DigitalOcean Extension
======================

DigitalOcean service provides an interface to DigitalOcean and allows to provision and import Droplets.

DigitalOcean services list
--------------------------

To get a list of services, run GET against **/api/digitalocean/** as authenticated user.

Import Droplet
--------------

Get a list of droplet available for import in this service,
run GET against **/api/digitalocean/<service_uuid>/link/**

In order to link a Droplet with NodeConductor issue a POST to the same endpoint.
Example of a request:

.. code-block:: http

    POST /api/digitalocean/aadf9bf2370c406f9b1390f93928f9fa/link/ HTTP/1.1
    Content-Type: application/json
    Accept: application/json
    Authorization: Token <PASSWORD>
    Host: example.com

    {
        "backend_id": "4039243"
        "service_project_link": "http://example.com/api/digitalocean-service-project-link/2/"
    }
<commit_msg>Fix docs for Droplet import<commit_after>NodeConductor Extensions
========================

NodeConductor extensions are developed as auto-configurable plugins. It's only
required to add desired application to INSTALLED_APPS. Extensions' URL's will
be registered automatically if settings.NODECONDUCTOR['EXTENSIONS AUTOREGISTER']
is True, which is default.

The plugin is expected to expose of all the application to be included in the
``entry_points``, for example:

.. code-block:: python

    entry_points={
       'nodeconductor_extensions': (
           'nodeconductor_plugin_app = nodeconductor_plugin.app.urls',
           ),
    }


DigitalOcean Extension
======================

DigitalOcean service provides an interface to DigitalOcean and allows to provision and import Droplets.

DigitalOcean services list
--------------------------

To get a list of services, run GET against **/api/digitalocean/** as authenticated user.

Import Droplet
--------------

Get a list of droplet available for import in this service,
run GET against **/api/digitalocean/<service_uuid>/link/**

In order to link a Droplet with NodeConductor issue a POST to the same endpoint.
Example of a request:

.. code-block:: http

    POST /api/digitalocean/aadf9bf2370c406f9b1390f93928f9fa/link/ HTTP/1.1
    Content-Type: application/json
    Accept: application/json
    Authorization: Token <PASSWORD>
    Host: example.com

    {
        "backend_id": "4039243",
        "project": "http://example.com/api/projects/e5f973af2eb14d2d8c38d62bcbaccb33/"
    }

{'fraction_non_alphanumeric': 0.127190136275146, 'fraction_numerical': 0.02336145360155743, 'mean_word_length': 3.587797619047619, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4712835', 'n_tokens_mistral': 947, 'n_tokens_neox': 850, 'n_words': 288}