Ejemplo n.º 1
0
# See the License for the specific language governing permissions and
# limitations under the License.

import json

from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages
from saharaclient.api import base as api_base

from saharadashboard.api import client as saharaclient
from saharadashboard.utils import importutils

# horizon.api is for backward compatibility with folsom
glance = importutils.import_any('openstack_dashboard.api.glance',
                                'horizon.api.glance')


class ImageForm(forms.SelfHandlingForm):
    image_id = forms.CharField(widget=forms.HiddenInput())
    tags_list = forms.CharField(widget=forms.HiddenInput())
    user_name = forms.CharField(max_length=80, label=_("User Name"))
    description = forms.CharField(max_length=80,
                                  label=_("Description"),
                                  required=False,
                                  widget=forms.Textarea(attrs={'cols': 80,
                                                               'rows': 20}))

    def handle(self, request, data):
        try:
            sahara = saharaclient.client(request)
Ejemplo n.º 2
0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from saharadashboard.image_registry.views import EditTagsView
from saharadashboard.image_registry.views import ImageRegistryView
from saharadashboard.image_registry.views import RegisterImageView
from saharadashboard.utils import importutils

urls = importutils.import_any('django.conf.urls.defaults', 'django.conf.urls')
patterns = urls.patterns
url = urls.url

urlpatterns = patterns(
    '',
    url(r'^$', ImageRegistryView.as_view(), name='index'),
    url(r'^$', ImageRegistryView.as_view(), name='image_registry'),
    url(r'^edit_tags/(?P<image_id>[^/]+)/$',
        EditTagsView.as_view(),
        name='edit_tags'),
    url(r'^register/$', RegisterImageView.as_view(), name='register'),
)
Ejemplo n.º 3
0
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import logging

from horizon import exceptions

from saharaclient.api import base as api_base
from saharaclient import client as api_client
from saharadashboard.utils import importutils


# horizon.api is for backward compatibility with folsom
base = importutils.import_any('openstack_dashboard.api.base',
                              'horizon.api.base')

keystone = importutils.import_any('openstack_dashboard.api.keystone',
                                  'horizon.api.keystone')

LOG = logging.getLogger(__name__)


def get_horizon_parameter(name, default_value):
    import openstack_dashboard.settings

    if hasattr(openstack_dashboard.settings, name):
        return getattr(openstack_dashboard.settings, name)
    else:
        logging.info('Parameter %s is not found in local_settings.py, '
                     'using default "%s"' % (name, default_value))
Ejemplo n.º 4
0
from django.utils.translation import ugettext as _
from horizon import exceptions
from horizon import forms
from horizon import workflows
from saharaclient.api import base as api_base

from saharadashboard.api import client as saharaclient
from saharadashboard.api.client import SAHARA_USE_NEUTRON
import saharadashboard.cluster_templates.workflows.create as t_flows
from saharadashboard.utils import importutils
from saharadashboard.utils import neutron_support
import saharadashboard.utils.workflow_helpers as whelpers

neutron = importutils.import_any('openstack_dashboard.api.quantum',
                                 'openstack_dashboard.api.neutron',
                                 'horizon.api.quantum',
                                 'horizon.api.neutron')

nova = importutils.import_any('openstack_dashboard.api.nova',
                              'horizon.api.nova')

LOG = logging.getLogger(__name__)

KEYPAIR_IMPORT_URL = "horizon:project:access_and_security:keypairs:import"


class SelectPluginAction(t_flows.SelectPluginAction):
    class Meta:
        name = _("Select plugin and hadoop version for cluster")
        help_text_template = ("clusters/_create_general_help.html")
Ejemplo n.º 5
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import logging

from django.utils.translation import ugettext_lazy as _

from horizon import tabs

from saharadashboard.api.client import client as saharaclient
from saharadashboard.utils import importutils
from saharadashboard.utils import workflow_helpers as helpers
nova = importutils.import_any('openstack_dashboard.api.nova',
                              'horizon.api.nova')

LOG = logging.getLogger(__name__)


class GeneralTab(tabs.Tab):
    name = _("General Info")
    slug = "cluster_template_details_tab"
    template_name = ("cluster_templates/_details.html")

    def get_context_data(self, request):
        template_id = self.tab_group.kwargs['template_id']
        sahara = saharaclient(request)
        template = sahara.cluster_templates.get(template_id)
        return {"template": template}
Ejemplo n.º 6
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from horizon import exceptions
from horizon import forms
from horizon import workflows

from saharadashboard.utils import importutils
from saharadashboard.utils import neutron_support
import saharadashboard.utils.workflow_helpers as whelpers

neutron = importutils.import_any('openstack_dashboard.api.quantum',
                                 'openstack_dashboard.api.neutron',
                                 'horizon.api.quantum',
                                 'horizon.api.neutron')

nova = importutils.import_any('openstack_dashboard.api.nova',
                              'horizon.api.nova')

from django.utils.translation import ugettext as _

from saharaclient.api import base as api_base
from saharadashboard.api import client as saharaclient
from saharadashboard.api.client import SAHARA_USE_NEUTRON
import saharadashboard.cluster_templates.workflows.create as t_flows

import logging

LOG = logging.getLogger(__name__)
Ejemplo n.º 7
0
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.


import saharadashboard.jobs.views as views
from saharadashboard.utils import importutils

urls = importutils.import_any('django.conf.urls.defaults',
                              'django.conf.urls')
patterns = urls.patterns
url = urls.url


urlpatterns = patterns('',
                       url(r'^$', views.JobsView.as_view(),
                           name='index'),
                       url(r'^$', views.JobsView.as_view(),
                           name='jobs'),
                       url(r'^create-job$',
                           views.CreateJobView.as_view(),
                           name='create-job'),
                       url(r'^launch-job$',
                           views.LaunchJobView.as_view(),
                           name='launch-job'),
Ejemplo n.º 8
0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.


import saharadashboard.job_executions.views as views
from saharadashboard.jobs import views as job_views
from saharadashboard.utils import importutils

urls = importutils.import_any("django.conf.urls.defaults", "django.conf.urls")
patterns = urls.patterns
url = urls.url


urlpatterns = patterns(
    "",
    url(r"^$", views.JobExecutionsView.as_view(), name="index"),
    url(r"^$", views.JobExecutionsView.as_view(), name="job-executions"),
    url(r"^launch-job$", job_views.LaunchJobView.as_view()),
    url(r"^launch-job-new-cluster$", job_views.LaunchJobNewClusterView.as_view()),
    url(r"^(?P<job_execution_id>[^/]+)$", views.JobExecutionDetailsView.as_view(), name="details"),
)
Ejemplo n.º 9
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import logging

from horizon import exceptions

from saharaclient.api import base as api_base
from saharaclient import client as api_client
from saharadashboard.utils import importutils

# horizon.api is for backward compatibility with folsom
base = importutils.import_any('openstack_dashboard.api.base',
                              'horizon.api.base')

keystone = importutils.import_any('openstack_dashboard.api.keystone',
                                  'horizon.api.keystone')

LOG = logging.getLogger(__name__)


def get_horizon_parameter(name, default_value):
    import openstack_dashboard.settings

    if hasattr(openstack_dashboard.settings, name):
        return getattr(openstack_dashboard.settings, name)
    else:
        logging.info('Parameter %s is not found in local_settings.py, '
                     'using default "%s"' % (name, default_value))
Ejemplo n.º 10
0
import logging

from django.utils.translation import ugettext as _

from horizon import exceptions
from horizon import workflows

from saharaclient.api import base as api_base
from saharadashboard.api import client as saharaclient
from saharadashboard.utils import importutils

import saharadashboard.api.helpers as helpers
import saharadashboard.utils.workflow_helpers as whelpers

# horizon.api is for backward compatibility with folsom
nova = importutils.import_any('openstack_dashboard.api.nova',
                              'horizon.api.nova')

network = importutils.import_any('openstack_dashboard.api.network',
                                 'horizon.api.network')

LOG = logging.getLogger(__name__)


class GeneralConfigAction(workflows.Action):
    nodegroup_name = forms.CharField(label=_("Template Name"), required=True)

    description = forms.CharField(label=_("Description"),
                                  required=False,
                                  widget=forms.Textarea)

    flavor = forms.ChoiceField(label=_("OpenStack Flavor"), required=True)
Ejemplo n.º 11
0
# See the License for the specific language governing permissions and
# limitations under the License.

import json

from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages

from saharaclient.api import base as api_base
from saharadashboard.api import client as saharaclient
from saharadashboard.utils import importutils

# horizon.api is for backward compatibility with folsom
glance = importutils.import_any('openstack_dashboard.api.glance',
                                'horizon.api.glance')


class ImageForm(forms.SelfHandlingForm):
    image_id = forms.CharField(widget=forms.HiddenInput())
    tags_list = forms.CharField(widget=forms.HiddenInput())
    user_name = forms.CharField(max_length=80, label=_("User Name"))
    description = forms.CharField(max_length=80,
                                  label=_("Description"),
                                  required=False,
                                  widget=forms.Textarea(attrs={
                                      'cols': 80,
                                      'rows': 20
                                  }))

    def handle(self, request, data):
Ejemplo n.º 12
0
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import logging

from horizon import exceptions
from saharaclient.api import base as api_base
from saharaclient import client as api_client

from saharadashboard.utils import importutils


# horizon.api is for backward compatibility with folsom
base = importutils.import_any("openstack_dashboard.api.base", "horizon.api.base")

keystone = importutils.import_any("openstack_dashboard.api.keystone", "horizon.api.keystone")

LOG = logging.getLogger(__name__)


def get_horizon_parameter(name, default_value):
    import openstack_dashboard.settings

    if hasattr(openstack_dashboard.settings, name):
        return getattr(openstack_dashboard.settings, name)
    else:
        logging.info("Parameter %s is not found in local_settings.py, " 'using default "%s"' % (name, default_value))
        return default_value