Skip to content

Instantly share code, notes, and snippets.

@drew-russell
Created March 11, 2020 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drew-russell/2d2fad76ca7c094bcdddd37b7970fe3d to your computer and use it in GitHub Desktop.
Save drew-russell/2d2fad76ca7c094bcdddd37b7970fe3d to your computer and use it in GitHub Desktop.
Example Python script that calls the Rubrik CDM GraphQL Service using the Rubrik Python SDK
import rubrik_cdm
rubrik = rubrik_cdm.Connect(node_ip, username, password, enable_logging=True)
operation_name = "ClusterDetails"
query = """
ClusterDetails($clusterID: String!) {
cluster(id: $clusterID) {
version
}
}
"""
variables = {
"clusterID": "me"
}
cluster_details = rubrik.query(query, operation_name, variables)
print(cluster_details)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment