summaryrefslogtreecommitdiff
path: root/openstack_dashboard/static/app/resources/resources.module.js
blob: 195500ae60272abb32ef7cc0caf448f5681002af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
 *    (c) Copyright 2016 Hewlett-Packard Development Company, L.P.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * 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.
 */
(function () {
  'use strict';

  /**
   * @ngdoc overview
   * @name horizon.app.resources
   * @description
   *
   * # horizon.app.resources
   *
   * This module hosts registered resource types.  This module file may
   * contain individual registrations, or may have sub-modules that
   * more fully contain registrations.
   */
  angular
    .module('horizon.app.resources', [])
    .run(performRegistrations);

  performRegistrations.$inject = [
    'horizon.framework.conf.resource-type-registry.service'
  ];

  function performRegistrations(registry) {
    // The items in this long list of registrations should ideally placed into
    // respective module declarations.  However, until they are more fully
    // fleshed out there's no reason to pollute the directory/file structure.
    // As a model, the Images registration happens in the images module.
    registry.getResourceType('OS::Glance::Metadef')
      .setNames('Metadata Definition', 'Metadata Definitions',
                ngettext('Metadata Definition', 'Metadata Definitions', 1));
    registry.getResourceType('OS::Nova::Server')
      .setNames('Instance', 'Instances', ngettext('Instance', 'Instances', 1));
    registry.getResourceType('OS::Nova::Flavor')
      .setNames('Flavor', 'Flavors', ngettext('Flavor', 'Flavors', 1));
    registry.getResourceType('OS::Nova::Hypervisor')
      .setNames('Hypervisor', 'Hypervisors',
                ngettext('Hypervisor', 'Hypervisors', 1));
    registry.getResourceType('OS::Nova::Keypair')
      .setNames('Key Pair', 'Key Pairs', ngettext('Key Pair', 'Key Pairs', 1));
    registry.getResourceType('OS::Designate::Zone')
      .setNames('DNS Domain', 'DNS Domains',
                ngettext('DNS Domain', 'DNS Domains', 1));
    registry.getResourceType('OS::Designate::RecordSet')
      .setNames('DNS Record', 'DNS Records',
                ngettext('DNS Record', 'DNS Records', 1));
    registry.getResourceType('OS::Cinder::Backup')
      .setNames('Volume Backup', 'Volume Backups',
                ngettext('Volume Backup', 'Volume Backups', 1));
    registry.getResourceType('OS::Cinder::Snapshot')
      .setNames('Volume Snapshot', 'Volume Snapshots',
                ngettext('Volume Snapshot', 'Volume Snapshots', 1));
    registry.getResourceType('OS::Cinder::Volume')
      .setNames('Volume', 'Volumes', ngettext('Volume', 'Volumes', 1));
    registry.getResourceType('OS::Neutron::HealthMonitor')
      .setNames('Network Health Monitor', 'Network Health Monitors',
                ngettext('Network Health Monitor', 'Network Health Monitors', 1));
    registry.getResourceType('OS::Neutron::Net')
      .setNames('Network', 'Networks', ngettext('Network', 'Networks', 1));
    registry.getResourceType('OS::Neutron::Pool')
      .setNames('Load Balancer Pool', 'Load Balancer Pools',
                ngettext('Load Balancer Pool', 'Load Balancer Pools', 1));
    registry.getResourceType('OS::Neutron::PoolMember')
      .setNames('Load Balancer Pool Member', 'Load Balancer Pool Members',
                ngettext('Load Balancer Pool Member', 'Load Balancer Pool Members', 1));
    registry.getResourceType('OS::Neutron::Port')
      .setNames('Network Port', 'Network Ports',
                ngettext('Network Port', 'Network Ports', 1));
    registry.getResourceType('OS::Neutron::Router')
      .setNames('Network Router', 'Network Routers',
                ngettext('Network Router', 'Network Routers', 1));
    registry.getResourceType('OS::Neutron::Subnet')
      .setNames('Network Subnet', 'Network Subnets',
                ngettext('Network Subnet', 'Network Subnets', 1));
    registry.getResourceType('OS::Neutron::FloatingIP')
     .setNames('Floating IP', 'Floating IPs',
               ngettext('Floating IP', 'Floating IPs', 1));
    registry.getResourceType('OS::Neutron::SecurityGroup')
      .setNames('Security Group', 'Security Groups',
                ngettext('Security Group', 'Security Groups', 1));
    registry.getResourceType('OS::Neutron::Trunk')
      .setNames('Trunk', 'Trunks', ngettext('Trunk', 'Trunks', 1));
    registry.getResourceType('OS::Keystone::User')
      .setNames('User', 'Users', ngettext('User', 'Users', 1));
    registry.getResourceType('OS::Keystone::Group')
      .setNames('Group', 'Groups', ngettext('Group', 'Groups', 1));
    registry.getResourceType('OS::Keystone::Project')
      .setNames('Project', 'Projects', ngettext('Project', 'Projects', 1));
    registry.getResourceType('OS::Keystone::Role')
      .setNames('Role', 'Roles', ngettext('Role', 'Roles', 1));
  }
})();