예제 #1
0
    def get_base_parser(self):
        parser = argparse.ArgumentParser(
            prog='monasca',
            description=__doc__.strip(),
            epilog='See "monasca help COMMAND" '
                   'for help on a specific command.',
            add_help=False,
            # formatter_class=HelpFormatter,
            formatter_class=lambda prog: argparse.HelpFormatter(
                prog,
                max_help_position=29)
        )

        # Global arguments
        parser.add_argument('-h', '--help',
                            action='store_true',
                            help=argparse.SUPPRESS)

        parser.add_argument('-j', '--json',
                            action='store_true',
                            help='output raw json response')

        parser.add_argument('--version',
                            action='version',
                            version=monascaclient.__version__,
                            help="Shows the client version and exits.")

        parser.add_argument('-d', '--debug',
                            default=bool(utils.env('MONASCA_DEBUG')),
                            action='store_true',
                            help='Defaults to env[MONASCA_DEBUG].')

        parser.add_argument('-v', '--verbose',
                            default=False, action="store_true",
                            help="Print more verbose output.")

        parser.add_argument('-k', '--insecure',
                            default=False,
                            action='store_true',
                            help="Explicitly allow the client to perform "
                            "\"insecure\" SSL (https) requests. The server's "
                            "certificate will not be verified against any "
                            "certificate authorities. "
                            "This option should be used with caution.")

        parser.add_argument('--cert-file',
                            help='Path of certificate file to use in SSL '
                            'connection. This file can optionally be '
                            'prepended with the private key.')

        parser.add_argument(
            '--key-file',
            help='Path of client key to use in SSL connection. '
            'This option is not necessary if your key is'
            ' prepended to your cert file.')

        parser.add_argument('--os-cacert',
                            default=utils.env('OS_CACERT'),
                            help='Specify a CA bundle file to use in verifying'
                            ' a TLS (https) server certificate. Defaults to'
                            ' env[OS_CACERT]. Without either of these, the'
                            ' client looks for the default system CA'
                            ' certificates.')

        parser.add_argument('--keystone_timeout',
                            default=20,
                            help='Number of seconds to wait for a response from keystone.')

        parser.add_argument('--os-username',
                            default=utils.env('OS_USERNAME'),
                            help='Defaults to env[OS_USERNAME].')

        parser.add_argument('--os_username',
                            help=argparse.SUPPRESS)

        parser.add_argument('--os-password',
                            default=utils.env('OS_PASSWORD'),
                            help='Defaults to env[OS_PASSWORD].')

        parser.add_argument('--os_password',
                            help=argparse.SUPPRESS)

        parser.add_argument('--os-user-domain-id',
                            default=utils.env('OS_USER_DOMAIN_ID'),
                            help='Defaults to env[OS_USER_DOMAIN_ID].')

        parser.add_argument('--os-user-domain-name',
                            default=utils.env('OS_USER_DOMAIN_NAME'),
                            help='Defaults to env[OS_USER_DOMAIN_NAME].')

        parser.add_argument('--os-project-id',
                            default=utils.env('OS_PROJECT_ID'),
                            help='Defaults to env[OS_PROJECT_ID].')

        parser.add_argument('--os_project_id',
                            help=argparse.SUPPRESS)

        parser.add_argument('--os-project-name',
                            default=utils.env('OS_PROJECT_NAME'),
                            help='Defaults to env[OS_PROJECT_NAME].')

        parser.add_argument('--os_project_name',
                            help=argparse.SUPPRESS)

        parser.add_argument('--os-domain-id',
                            default=utils.env('OS_DOMAIN_ID'),
                            help='Defaults to env[OS_DOMAIN_ID].')

        parser.add_argument('--os_domain_id',
                            help=argparse.SUPPRESS)

        parser.add_argument('--os-domain-name',
                            default=utils.env('OS_DOMAIN_NAME'),
                            help='Defaults to env[OS_DOMAIN_NAME].')

        parser.add_argument('--os_domain_name',
                            help=argparse.SUPPRESS)

        parser.add_argument('--os-auth-url',
                            default=utils.env('OS_AUTH_URL'),
                            help='Defaults to env[OS_AUTH_URL].')

        parser.add_argument('--os_auth_url',
                            help=argparse.SUPPRESS)

        parser.add_argument('--os-region-name',
                            default=utils.env('OS_REGION_NAME'),
                            help='Defaults to env[OS_REGION_NAME].')

        parser.add_argument('--os_region_name',
                            help=argparse.SUPPRESS)

        parser.add_argument('--os-auth-token',
                            default=utils.env('OS_AUTH_TOKEN'),
                            help='Defaults to env[OS_AUTH_TOKEN].')

        parser.add_argument('--os_auth_token',
                            help=argparse.SUPPRESS)

        parser.add_argument('--os-no-client-auth',
                            default=utils.env('OS_NO_CLIENT_AUTH'),
                            action='store_true',
                            help="Do not contact keystone for a token. "
                                 "Defaults to env[OS_NO_CLIENT_AUTH].")

        parser.add_argument('--monasca-api-url',
                            default=utils.env('MONASCA_API_URL'),
                            help='Defaults to env[MONASCA_API_URL].')

        parser.add_argument('--monasca_api_url',
                            help=argparse.SUPPRESS)

        parser.add_argument('--monasca-api-version',
                            default=utils.env(
                                'MONASCA_API_VERSION',
                                default='2_0'),
                            help='Defaults to env[MONASCA_API_VERSION] or 2_0')

        parser.add_argument('--monasca_api_version',
                            help=argparse.SUPPRESS)

        parser.add_argument('--os-service-type',
                            default=utils.env('OS_SERVICE_TYPE'),
                            help='Defaults to env[OS_SERVICE_TYPE].')

        parser.add_argument('--os_service_type',
                            help=argparse.SUPPRESS)

        parser.add_argument('--os-endpoint-type',
                            default=utils.env('OS_ENDPOINT_TYPE'),
                            help='Defaults to env[OS_ENDPOINT_TYPE].')

        parser.add_argument('--os_endpoint_type',
                            help=argparse.SUPPRESS)

        return parser
예제 #2
0
           'kibana',
           'elasticsearch',
           'logstash',
           'beaver']

ceilometer = ['ceilometer-api',
              'ceilometer-polling',
              'ceilometer-agent-notification']

openstack = ['rabbitmq',
             'mysqld']

hos = ['haproxy']

keystone = {
    'username': utils.env('OS_USERNAME'),
    'password': utils.env('OS_PASSWORD'),
    'token': utils.env('OS_AUTH_TOKEN'),
    'auth_url': utils.env('OS_AUTH_URL'),
    'service_type': utils.env('OS_SERVICE_TYPE'),
    'endpoint_type': utils.env('OS_ENDPOINT_TYPE'),
    'os_cacert': utils.env('OS_CACERT'),
    'user_domain_id': utils.env('OS_USER_DOMAIN_ID'),
    'user_domain_name': utils.env('OS_USER_DOMAIN_NAME'),
    'project_id': utils.env('OS_PROJECT_ID'),
    'project_name': utils.env('OS_PROJECT_NAME'),
    'domain_id': utils.env('OS_DOMAIN_ID'),
    'domain_name': utils.env('OS_DOMAIN_NAME'),
    'region_name': utils.env('OS_REGION_NAME')
}
예제 #3
0
    'org.apache.spark.deploy.master.Master',
    'org.apache.spark.deploy.worker.Worker'
]

logging = ['monasca-log-api', 'kibana', 'elasticsearch', 'logstash', 'beaver']

ceilometer = [
    'ceilometer-api', 'ceilometer-polling', 'ceilometer-agent-notification'
]

openstack = ['rabbitmq', 'mysqld']

hos = ['haproxy']

keystone = {
    'username': utils.env('OS_USERNAME'),
    'password': utils.env('OS_PASSWORD'),
    'token': utils.env('OS_AUTH_TOKEN'),
    'auth_url': utils.env('OS_AUTH_URL'),
    'service_type': utils.env('OS_SERVICE_TYPE'),
    'endpoint_type': utils.env('OS_ENDPOINT_TYPE'),
    'os_cacert': utils.env('OS_CACERT'),
    'user_domain_id': utils.env('OS_USER_DOMAIN_ID'),
    'user_domain_name': utils.env('OS_USER_DOMAIN_NAME'),
    'project_id': utils.env('OS_PROJECT_ID'),
    'project_name': utils.env('OS_PROJECT_NAME'),
    'domain_id': utils.env('OS_DOMAIN_ID'),
    'domain_name': utils.env('OS_DOMAIN_NAME'),
    'region_name': utils.env('OS_REGION_NAME')
}
예제 #4
0
    def get_base_parser(self):
        parser = argparse.ArgumentParser(
            prog='monasca',
            description=__doc__.strip(),
            epilog='See "monasca help COMMAND" '
            'for help on a specific command.',
            add_help=False,
            # formatter_class=HelpFormatter,
            formatter_class=lambda prog: argparse.HelpFormatter(
                prog, max_help_position=29))

        # Global arguments
        parser.add_argument('-h',
                            '--help',
                            action='store_true',
                            help=argparse.SUPPRESS)

        parser.add_argument('-j',
                            '--json',
                            action='store_true',
                            help='output raw json response')

        parser.add_argument('--version',
                            action='version',
                            version=monascaclient.__version__,
                            help="Shows the client version and exits.")

        parser.add_argument('-d',
                            '--debug',
                            default=bool(utils.env('MONASCA_DEBUG')),
                            action='store_true',
                            help='Defaults to env[MONASCA_DEBUG].')

        parser.add_argument('-v',
                            '--verbose',
                            default=False,
                            action="store_true",
                            help="Print more verbose output.")

        parser.add_argument('-k',
                            '--insecure',
                            default=False,
                            action='store_true',
                            help="Explicitly allow the client to perform "
                            "\"insecure\" SSL (https) requests. The server's "
                            "certificate will not be verified against any "
                            "certificate authorities. "
                            "This option should be used with caution.")

        parser.add_argument('--cert-file',
                            help='Path of certificate file to use in SSL '
                            'connection. This file can optionally be '
                            'prepended with the private key.')

        parser.add_argument(
            '--key-file',
            help='Path of client key to use in SSL connection. '
            'This option is not necessary if your key is'
            ' prepended to your cert file.')

        parser.add_argument('--os-cacert',
                            default=utils.env('OS_CACERT'),
                            help='Specify a CA bundle file to use in verifying'
                            ' a TLS (https) server certificate. Defaults to'
                            ' env[OS_CACERT]. Without either of these, the'
                            ' client looks for the default system CA'
                            ' certificates.')

        parser.add_argument(
            '--keystone_timeout',
            default=20,
            help='Number of seconds to wait for a response from keystone.')

        parser.add_argument('--os-username',
                            default=utils.env('OS_USERNAME'),
                            help='Defaults to env[OS_USERNAME].')

        parser.add_argument('--os_username', help=argparse.SUPPRESS)

        parser.add_argument('--os-password',
                            default=utils.env('OS_PASSWORD'),
                            help='Defaults to env[OS_PASSWORD].')

        parser.add_argument('--os_password', help=argparse.SUPPRESS)

        parser.add_argument('--os-user-domain-id',
                            default=utils.env('OS_USER_DOMAIN_ID'),
                            help='Defaults to env[OS_USER_DOMAIN_ID].')

        parser.add_argument('--os-user-domain-name',
                            default=utils.env('OS_USER_DOMAIN_NAME'),
                            help='Defaults to env[OS_USER_DOMAIN_NAME].')

        parser.add_argument('--os-project-id',
                            default=utils.env('OS_PROJECT_ID'),
                            help='Defaults to env[OS_PROJECT_ID].')

        parser.add_argument('--os_project_id', help=argparse.SUPPRESS)

        parser.add_argument('--os-project-name',
                            default=utils.env('OS_PROJECT_NAME'),
                            help='Defaults to env[OS_PROJECT_NAME].')

        parser.add_argument('--os_project_name', help=argparse.SUPPRESS)

        parser.add_argument('--os-domain-id',
                            default=utils.env('OS_DOMAIN_ID'),
                            help='Defaults to env[OS_DOMAIN_ID].')

        parser.add_argument('--os_domain_id', help=argparse.SUPPRESS)

        parser.add_argument('--os-domain-name',
                            default=utils.env('OS_DOMAIN_NAME'),
                            help='Defaults to env[OS_DOMAIN_NAME].')

        parser.add_argument('--os_domain_name', help=argparse.SUPPRESS)

        parser.add_argument('--os-auth-url',
                            default=utils.env('OS_AUTH_URL'),
                            help='Defaults to env[OS_AUTH_URL].')

        parser.add_argument('--os_auth_url', help=argparse.SUPPRESS)

        parser.add_argument('--os-region-name',
                            default=utils.env('OS_REGION_NAME'),
                            help='Defaults to env[OS_REGION_NAME].')

        parser.add_argument('--os_region_name', help=argparse.SUPPRESS)

        parser.add_argument('--os-auth-token',
                            default=utils.env('OS_AUTH_TOKEN'),
                            help='Defaults to env[OS_AUTH_TOKEN].')

        parser.add_argument('--os_auth_token', help=argparse.SUPPRESS)

        parser.add_argument('--os-no-client-auth',
                            default=utils.env('OS_NO_CLIENT_AUTH'),
                            action='store_true',
                            help="Do not contact keystone for a token. "
                            "Defaults to env[OS_NO_CLIENT_AUTH].")

        parser.add_argument('--monasca-api-url',
                            default=utils.env('MONASCA_API_URL'),
                            help='Defaults to env[MONASCA_API_URL].')

        parser.add_argument('--monasca_api_url', help=argparse.SUPPRESS)

        parser.add_argument('--monasca-api-version',
                            default=utils.env('MONASCA_API_VERSION',
                                              default='2_0'),
                            help='Defaults to env[MONASCA_API_VERSION] or 2_0')

        parser.add_argument('--monasca_api_version', help=argparse.SUPPRESS)

        parser.add_argument('--os-service-type',
                            default=utils.env('OS_SERVICE_TYPE'),
                            help='Defaults to env[OS_SERVICE_TYPE].')

        parser.add_argument('--os_service_type', help=argparse.SUPPRESS)

        parser.add_argument('--os-endpoint-type',
                            default=utils.env('OS_ENDPOINT_TYPE'),
                            help='Defaults to env[OS_ENDPOINT_TYPE].')

        parser.add_argument('--os_endpoint_type', help=argparse.SUPPRESS)

        return parser
예제 #5
0
import sys
import time
import multiprocessing
import random
import argparse

from monascaclient.common import utils
from monascaclient import client
from monascaclient import ksclient

max_wait_time = 20
min_wait_time = 5

keystone = {
    "username": utils.env("OS_USERNAME"),
    "password": utils.env("OS_PASSWORD"),
    "token": utils.env("OS_AUTH_TOKEN"),
    "auth_url": utils.env("OS_AUTH_URL"),
    "service_type": utils.env("OS_SERVICE_TYPE"),
    "endpoint_type": utils.env("OS_ENDPOINT_TYPE"),
    "os_cacert": utils.env("OS_CACERT"),
    "user_domain_id": utils.env("OS_USER_DOMAIN_ID"),
    "user_domain_name": utils.env("OS_USER_DOMAIN_NAME"),
    "project_id": utils.env("OS_PROJECT_ID"),
    "project_name": utils.env("OS_PROJECT_NAME"),
    "domain_id": utils.env("OS_DOMAIN_ID"),
    "domain_name": utils.env("OS_DOMAIN_NAME"),
    "region_name": utils.env("OS_REGION_NAME"),
}