Introduction

Installation

The SDK has been tested against Python 2.7.6 and Python 3.6.4.

Install from source:

git clone https://github.com/rubrik-devops/rubrik-mosaic-sdk-for-python
cd rubrik-mosaic-sdk-for-python
python setup.py install

Configuration

Before you begin to use the Rubrik Mosaic Python SDK, you should first setup your authentication credentials. By default, the SDK will attempt to read the the Rubrik Mosaic Cluster credentials from the following environment variables:

  • rubrik_mosaic_node_ip

  • rubrik_mosaic_username

  • rubrik_mosaic_password

Usage

To use the SDK, you must first instantiate a new variable, in thise case mosaic, to connect to the Rubrik Mosaic Cluster.

import rubrik_mosaic
mosaic = rubrik_mosaic.Connect()

Note: You may use any variable name to connect to the Rubrik Mosaic Cluster.

If you have not configured the correct environment variables you may also manually pass in the required authentication credentials.

Debug

To enable debuging set the Connect() enable_logging keyword argument to True.

Example

Script:

Output:

Certificate Verification

When connecting to a Rubrik Mosaic cluster without certificate verification enabled you will receive the following warning message:

To supress this warning add the following code to your script:

Last updated

Was this helpful?