import itertools from keystoneclient.v2_0 import client as ksclient from glance.registry import client from ceilometer import plugin from ceilometer.counter import Counter from ceilometer.openstack.common import cfg from ceilometer.openstack.common import timeutils cfg.CONF.register_opts([ cfg.StrOpt('glance_registry_host', default='localhost', help="URL of Glance API server"), cfg.IntOpt('glance_registry_port', default=9191, help="URL of Glance API server"), ]) class _Base(plugin.PollsterBase): @staticmethod def get_registry_client(): k = ksclient.Client(username=cfg.CONF.os_username, password=cfg.CONF.os_password, tenant_id=cfg.CONF.os_tenant_id, tenant_name=cfg.CONF.os_tenant_name, auth_url=cfg.CONF.os_auth_url) return client.RegistryClient(cfg.CONF.glance_registry_host, cfg.CONF.glance_registry_port, auth_tok=k.auth_token)
help='ZeroMQ bind address. Should be a wildcard (*), ' 'an ethernet interface, or IP. ' 'The "host" option should point or resolve to this ' 'address.'), # The module.Class to use for matchmaking. cfg.StrOpt( 'rpc_zmq_matchmaker', default=('ceilometer.openstack.common.rpc.' 'matchmaker.MatchMakerLocalhost'), help='MatchMaker driver', ), # The following port is unassigned by IANA as of 2012-05-21 cfg.IntOpt('rpc_zmq_port', default=9501, help='ZeroMQ receiver listening port'), cfg.IntOpt('rpc_zmq_contexts', default=1, help='Number of ZeroMQ contexts, defaults to 1'), cfg.StrOpt('rpc_zmq_ipc_dir', default='/var/run/openstack', help='Directory for holding IPC sockets'), cfg.StrOpt('rpc_zmq_host', default=socket.gethostname(), help='Name of this node. Must be a valid hostname, FQDN, or ' 'IP address. Must match "host" option, if running Nova.') ] # These globals are defined in register_opts(conf), # a mandatory initialization call
A remote procedure call (rpc) abstraction. For some wrappers that add message versioning to rpc, see: rpc.dispatcher rpc.proxy """ from ceilometer.openstack.common import cfg from ceilometer.openstack.common import importutils rpc_opts = [ cfg.StrOpt('rpc_backend', default='%s.impl_kombu' % __package__, help="The messaging module to use, defaults to kombu."), cfg.IntOpt('rpc_thread_pool_size', default=64, help='Size of RPC thread pool'), cfg.IntOpt('rpc_conn_pool_size', default=30, help='Size of RPC connection pool'), cfg.IntOpt('rpc_response_timeout', default=60, help='Seconds to wait for a response from call or multicall'), cfg.IntOpt('rpc_cast_timeout', default=30, help='Seconds to wait before a cast expires (TTL). ' 'Only supported by impl_zmq.'), cfg.ListOpt('allowed_rpc_exception_modules', default=[ 'ceilometer.openstack.common.exception', 'nova.exception',
# 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 os from nova import flags from ceilometer.openstack.common import log from ceilometer.openstack.common import cfg cfg.CONF.register_opts([ cfg.IntOpt('periodic_interval', default=60, help='seconds between running periodic tasks') ]) CLI_OPTIONS = [ cfg.StrOpt('os-username', default=os.environ.get('OS_USERNAME', 'glance'), help='Username to use for openstack service access'), cfg.StrOpt('os-password', default=os.environ.get('OS_PASSWORD', 'admin'), help='Password to use for openstack service access'), cfg.StrOpt('os-tenant-id', default=os.environ.get('OS_TENANT_ID', ''), help='Tenant ID to use for openstack service access'), cfg.StrOpt('os-tenant-name', default=os.environ.get('OS_TENANT_NAME', 'admin'),
help='SSL version to use (valid only if SSL enabled)'), cfg.StrOpt('kombu_ssl_keyfile', default='', help='SSL key file (valid only if SSL enabled)'), cfg.StrOpt('kombu_ssl_certfile', default='', help='SSL cert file (valid only if SSL enabled)'), cfg.StrOpt('kombu_ssl_ca_certs', default='', help=('SSL certification authority file ' '(valid only if SSL enabled)')), cfg.StrOpt('rabbit_host', default='localhost', help='the RabbitMQ host'), cfg.IntOpt('rabbit_port', default=5672, help='the RabbitMQ port'), cfg.BoolOpt('rabbit_use_ssl', default=False, help='connect over SSL for RabbitMQ'), cfg.StrOpt('rabbit_userid', default='guest', help='the RabbitMQ userid'), cfg.StrOpt('rabbit_password', default='guest', help='the RabbitMQ password'), cfg.StrOpt('rabbit_virtual_host', default='/', help='the RabbitMQ virtual host'), cfg.IntOpt('rabbit_retry_interval', default=1,
# 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 flask.helpers from ceilometer.openstack.common import cfg from ceilometer.openstack.common import jsonutils # Replace the json module used by flask with the one from # openstack.common so we can take advantage of the fact that it knows # how to serialize more complex objects. flask.helpers.json = jsonutils # Register options for the service API_SERVICE_OPTS = [ cfg.IntOpt( 'metering_api_port', default=9000, help='The port for the ceilometer API server', ), ] cfg.CONF.register_opts(API_SERVICE_OPTS)