import rubrik_mosaic

mosaic = rubrik_mosaic.Connect()

mosaic.get_jobs()
예제 #2
0
import rubrik_mosaic

mosaic = rubrik_mosaic.Connect(enable_logging=True)

mosaic.log('Python SDK')
            raise ValueError("The Datadog api key has not been provided.")
    if app_key is None:
        app_key = os.environ.get('dd_app_key')
        if app_key is None:
            raise ValueError("The Datadog app key has not been provided.")
    #connect to datadog api
    options = {'api_key': api_key, 'app_key': app_key}
    initialize(**options)


#connect to datadog
connect_datadog(dd_api_key, dd_app_key)

#connect to mosaic cluster
rubrik = rubrik_mosaic.Connect(node_ip=rubrik_mosaic_node_ip,
                               username=rubrik_mosaic_username,
                               password=rubrik_mosaic_password,
                               enable_logging=logging_enabled)


def post_metrics(rubrik, enable_logging=False):
    #dict to iterate metrics
    metrics = {}
    #get number of objects protected via mosaic
    if enable_logging:
        log('post_metrics - getting protected_object_count')
    metrics['protected_object_count'] = rubrik.get_protected_object_count()
    if enable_logging:
        log('post_metrics - protected_object_count: {}'.format(
            metrics['protected_object_count']))
    #get size under protection
    if enable_logging: