Giter VIP home page Giter VIP logo

cookiecutter-waldur-plugin's Introduction

Usage

In order to create proper plugin repository structure, please execute following steps:

  1. Install cookiecutter
  2. Install NodeConductor plugin cookiecutter:
cookiecutter https://github.com/opennode/cookiecutter-nodeconductor-plugin.git

You will be prompted to enter values of some variables. Note, that in brackets will be suggested default values.

  • plugin_name - name of the plugin. i.e. SugarCRM
  • plugin_repo - name of the plugin's repository. i.e. nodeconductor-sugarcrm
  • plugin_source - name of the directory inside src folder. i.e. nodeconductor_sugarcrm
  • plugin_extension_class - name of the class inside extension.py file i.e. SugarCRMExtension
  • plugin_app_config_class - name of the class inside apps.py file i.e. SugarCRMConfig
  • plugin_short_description - short description of the plugin
  • nodeconductor_version - version of the NodeConductor application this plugin depends on. i.e. 0.95.0
  • year - current year i.e. 2016
  • organization - name of the organization i.e. OpenNode
  • github_username - GitHub username i.e. opennode

Implementing services

Usually NodeConductor plugin implements service, for example for OpenStack or Zabbix. Service consists of backend class, database models and API views. Service catalog maintains metadata about all connected services.

In order to specify ID of service settings in the database, add the following property to the application configuration class in apps.py file. Note that once service_name is set up, it should not be modified without migration.

service_name = '{{ cookiecutter.plugin_name }}'

It is assumed that service backend is implemented in backend.py file. In order to connect backend class to the service catalog, add the following code to ready method of the application configuration class. When service backend is connected, related database models are connected as well.

from nodeconductor.structure import SupportedServices
from .backend import Backend
SupportedServices.register_backend(Backend)

Adding new URLs

If NodeConductor plugin adds a new Django URL, it should be registered in urls.py file:

urlpatterns = patterns('',
    url(r'^my/new/url/', views.page),
)

See also: https://docs.djangoproject.com/en/1.8/topics/http/urls/#url-dispatcher

For Django to be able to use these URL configurations make sure this method exists in extension.py or add it:

@staticmethod
def django_urls():
    from .urls import urlpatterns
    return urlpatterns

cookiecutter-waldur-plugin's People

Contributors

ambientlighter avatar hudolejev avatar livenson avatar tsudmi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.