def get_selected_resource_types(self):
        selected_resource_types = []
        selected_resource_types_str = setting_resource_selection.get_for_resource(DivvyPlugin.get_current_plugin())
        for resource_type_str in selected_resource_types_str:
            if not(resource_type_str in [cls.get_resource_type().lower() for cls in get_all_classes()]):
                logging.getLogger("DataExporter").error("%s is not a valid resources, skipping" % (resource_type_str))
                continue
            selected_resource_types.append(get_class_for_type(resource_type_str))

        return selected_resource_types
Exemplo n.º 2
0
    version                       = '1.0'
    last_updated_date             = '2016-04-30'
    author                        = 'Divvy Cloud Corp.'
    nickname                      = 'Slack Integration'
    default_language_description  = 'Collection of slack integrations'
    support_email                 = '*****@*****.**'
    support_url                   = 'http://support.divvycloud.com'
    main_url                      = 'http://www.divvycloud.com'
    managed                       = True


blueprint = Blueprint('slack', __name__, static_folder='html', template_folder='html')


#Setting Names
PREFIX           = DivvyPlugin.get_current_plugin().name
APIKEY           = PREFIX + '.apiKey'
CHANNEL          = PREFIX + '.channel'
USERNAME         = PREFIX + '.username'


#Plugin reference
PLUGIN_REF = DivvyPlugin.get_current_plugin()


#Register Global Settings
apiKey = GlobalSetting(
    name         = APIKEY,
    display_name = 'Slack API key',
    type_hint    = 'string',
    description  = 'This apiKey allows a user to access slack integration')
    This plugin exports all resource data for specific resource types to ElasticSearch every 30 mins. 
    The resource types in question are configured through the DivvyCloud UI
    """
    version = '1.0'
    last_updated_date = '2015-10-02'
    author = 'Brian Johnson - Divvy Cloud Corp.'
    nickname = 'ElasticSearch Data Exporter'
    default_language_description = 'Data Exporter for ElasticSearch'
    support_email = '*****@*****.**'
    support_url = 'http://support.divvycloud.com'
    main_url = 'http://www.divvycloud.com'
    category = 'Data Exporters'
    managed = False

# Prefix for settings and properties used by this plugin
_SETTING_PROPERTY_PREFIX = DivvyPlugin.get_current_plugin().name

# Global settings that are saved
_SETTING_RESOURCE_LIST            = '%s.export_list' % (_SETTING_PROPERTY_PREFIX)
_SETTING_ENABLED            = '%s.enabled' % (_SETTING_PROPERTY_PREFIX)

# Get the plugin resource id
_PLUGIN_RESOURCE_ID_STR = DivvyPlugin.get_current_plugin().get_resource_id().to_string()


# Define form elements for the plugin settings
resource_choices = [str(cls.get_resource_type()) for cls in get_all_classes() ]
setting_resource_selection = GlobalSetting(name=_SETTING_RESOURCE_LIST,display_name='Select Resources to export',type_hint='json_list',description='Select Resources to Export',choices=resource_choices)
setting_enabled = GlobalSetting(name=_SETTING_ENABLED,display_name='Enabled exporter',type_hint='bool',description='Enabled data exporter',default_value='false')

Exemplo n.º 4
0
    """
    version = '1.0'
    last_updated_date = '2015-08-05'
    author = 'DivvyCloud Inc.'
    nickname = 'DivvyCloud Image Whitelist'
    default_language_description = (
        'Fetches approved images from a remote location.')
    support_email = '*****@*****.**'
    support_url = 'http://support.divvycloud.com'
    main_url = 'http://www.divvycloud.com'
    category = 'Reports'
    managed = True


# Prefix for settings used by this plugin
_SETTING_PREFIX = DivvyPlugin.get_current_plugin().name

# Settings
SETTING_HARVEST_LOCATION = '%s.harvest_location' % _SETTING_PREFIX
IMAGE_WHITELIST_URL = GlobalSetting(
    name=SETTING_HARVEST_LOCATION,
    display_name='URL to Image Listing',
    type_hint='string',
    description='URL to fetch the image whitelist listing')


def load():
    pass


def unload():
    """
    Information about this plugin
    """
    version = '1.0'
    last_updated_date = '2015-10-02'
    author = 'Divvy Cloud Corp.'
    nickname = 'ElasticSearch Exporter'
    default_language_description = 'Data Exporter for ElasticSearch'
    support_email = '*****@*****.**'
    support_url = 'http://support.divvycloud.com'
    main_url = 'http://www.divvycloud.com'
    category = 'Data Exporter'
    managed = True

# Prefix for settings and properties used by this plugin
_SETTING_PROPERTY_PREFIX = DivvyPlugin.get_current_plugin().name

# Global settings that are saved
_SETTING_RESOURCE_LIST            = '%s.export_list' % (_SETTING_PROPERTY_PREFIX)
_SETTING_ENABLED            = '%s.enabled' % (_SETTING_PROPERTY_PREFIX)

resource_choices = [str(cls.get_resource_type()) for cls in get_all_classes() ]

setting_resource_selection = GlobalSetting(name=_SETTING_RESOURCE_LIST,display_name='Select Resources to export',type_hint='json_list',description='Select Resources to Export',choices=resource_choices)
setting_enabled = GlobalSetting(name=_SETTING_ENABLED,display_name='Enabled exporter',type_hint='bool',description='Enabled data exporter',default_value='false')
#
# @hookpoint('divvycloud.resource.modified')
# def export_on_modified(resource, old_resource, user_resource_id=None):
#     if(ResourceExporter.is_selected_resource_type(resource)):
#         exporter = ResourceExporter()
#         converted_resource = exporter.convert_resource(resource)