Rubrik SDK for Python
1.0.0
1.0.0
  • Introduction
  • Getting Started
    • Quick Start
  • Base API Calls
    • delete
    • get
    • job_status
    • patch
    • post
    • put
    • query
  • Bootstrap Functions
    • setup_cluster
    • status
  • Cluster Functions
    • add_floating_ips
    • add_guest_credential
    • add_vcenter
    • cluster_node_id
    • cluster_node_ip
    • cluster_node_name
    • cluster_support_tunnel
    • cluster_version
    • configure_cluster_location
    • configure_dns_servers
    • configure_login_banner
    • configure_ntp
    • configure_replication_nat
    • configure_replication_private
    • configure_search_domain
    • configure_smtp_settings
    • configure_syslog
    • configure_timezone
    • configure_vlan
    • create_user
    • delete_guest_credential
    • delete_proxy
    • end_user_authorization
    • get_all_vcenters
    • get_floating_ips
    • minimum_installed_cdm_version
    • read_only_authorization
    • refresh_vcenter
    • remove_floating_ips
    • update_proxy
  • Cloud Functions
    • add_aws_native_account
    • aws_s3_cloudon
    • aws_s3_cloudout
    • azure_cloudon
    • azure_cloudout
    • update_aws_native_account
    • update_aws_s3_cloudout
  • Data Management Functions
    • assign_sla
    • begin_managed_volume_snapshot
    • create_sla
    • delete_sla
    • end_managed_volume_snapshot
    • get_all_hosts
    • get_esxi_subnets
    • get_sla_objects
    • get_sql_db
    • get_sql_db_files
    • get_sql_live_mount
    • get_vsphere_live_mount
    • get_vsphere_live_mount_names
    • get_vsphere_vm
    • get_vsphere_vm_details
    • get_vsphere_vm_file
    • get_vsphere_vm_snapshot
    • object_id
    • on_demand_snapshot
    • pause_snapshots
    • register_vm
    • resume_snapshots
    • set_esxi_subnets
    • sql_db_export
    • sql_instant_recovery
    • sql_live_mount
    • sql_live_unmount
    • vcenter_refresh_vm
    • vsphere_instant_recovery
    • vsphere_live_mount
    • vsphere_live_unmount
  • Physical Host Functions
    • add_host_share
    • add_nas_share_to_host
    • add_physical_host
    • assign_physical_host_fileset
    • create_nas_fileset
    • create_physical_fileset
    • delete_physical_host
  • SDK Helper Functions
    • log
    • exceptions
  • Internal Functions
    • _api_validation
    • _authorization_header
    • _common_api
    • _date_time_conversion
    • _header
    • _platform_user_agent
    • _time_in_range
    • _validate_sql_db
    • _validate_sql_recovery_point
Powered by GitBook
On this page
  • Keyword Arguments
  • Returns
  • Example
  1. Data Management Functions

get_sql_db

Retrieves summary information for SQL databases. Each keyword argument is a query parameter to filter the database details returned i.e. you can query for a specific database name, hostname, instance, is_relic, effective_sla_domain etc.

def get_sql_db(self, db_name=None, instance=None, hostname=None, availability_group=None, effective_sla_domain=None, primary_cluster_id='local', sla_assignment=None, limit=None, offset=None,  is_relic=None, is_live_mount=None, is_log_shipping_secondary=None, sort_by=None, sort_order=None, timeout=15)

Keyword Arguments

Name

Type

Description

Choices

Default

db_name

str

Filter by a substring of the database name.

instance

str

The SQL instance name of the database.

hostname

str

The SQL host name of the database.

availability_group

str

Filter by the name of the Always On Availability Group.

effective_sla_domain

str

Filter by the name of the effective SLA Domain.

primary_cluster_id

str

Filter by primary cluster ID, or local.

local

sla_assignment

str

Filter by SLA Domain assignment type.

Direct, Derived, Unassigned

limit

int

Limit the number of matches returned.

offset

int

Ignore these many matches in the beginning.

is_relic

bool

Filter by the isRelic field of the database.

is_live_mount

bool

Filter database summary information by the value of the isLiveMount field.

is_log_shipping_secondary

bool

Filter database summary information by the value of the isLogShippingSecondary field.

sort_by

str

Sort results based on the specified attribute.

effectiveSlaDomainName, name

sort_order

str

Sort order, either ascending or descending.

asc, desc

timeout

int

The number of seconds to wait to establish a connection the Rubrik cluster before returning a timeout error.

15

Returns

Type

Return Value

dict

The full response of GET /v1/mssql/db?{query}.

Example

import rubrik_cdm

rubrik = rubrik_cdm.Connect()

db_name = "python-sdk-demo"
instance = 'MSSQLSERVER'
hostname = 'sql.rubrikdemo.com'
availability_group = 'sql.rubrikdemo.com'
effective_sla_domain = 'Gold'
primary_cluster_id = 'local'
sla_assignment = 'Direct'

get_db = rubrik.get_sql_db(name=name, instance=instance, hostname=hostname, availability_group=availability_group, effective_sla_domain=effective_sla_domain, primary_cluster_id=primary_cluster_id, sla_assignment=sla_assignment)
Previousget_sla_objectsNextget_sql_db_files

Last updated 5 years ago