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
  • Arguments
  • Keyword Arguments
  • Returns
  • Example
  • VMware
  • MSSQL
  • Oracle Database
  • Oracle Host
  • Volume Group
  • AHV
  • Fileset
  1. Data Management Functions

assign_sla

Assign a Rubrik object to an SLA Domain.

def assign_sla(self, object_name, sla_name, object_type, log_backup_frequency_in_seconds=None, log_retention_hours=None, copy_only=None, windows_host=None, nas_host=None, share=None, log_backup_frequency_in_minutes=None, num_channels=4, hostname=None, timeout=30)

Arguments

Name

Type

Description

Choices

object_name

str or list

The name of the Rubrik object you wish to assign to an SLA Domain. When the 'object_type' is 'volume_group', the object_name can be a list of volumes.

sla_name

str

The name of the SLA Domain you wish to assign an object to. To exclude the object from all SLA assignments use do not protect as the sla_name. To assign the selected object to the SLA of the next higher level object use clear as the sla_name.

object_type

str

The Rubrik object type you want to assign to the SLA Domain.

vmware, mssql_host, volume_group, ahv, oracle_db, oracle_host

Keyword Arguments

Name

Type

Description

Choices

Default

log_backup_frequency_in_seconds

int

The MSSQL Log Backup frequency you'd like to specify with the SLA. Required when the object_type is mssql_host.

None

log_retention_hours

int

The MSSQL or Oracle Log Retention frequency you'd like to specify with the SLA. Required when the object_type is mssql_host.

None

copy_only

bool

Take Copy Only Backups with MSSQL. Required when the object_type is mssql_host.

None

windows_host

str

The name of the Windows host that contains the relevant volume group. Required when the object_type is volume_group.

None

nas_host

str

The name of the NAS host that contains the relevant share. Required when the object_type is fileset.

None

share

str

The name of the network share a fileset will be created for. Required when the object_type is fileset.

None

log_backup_frequency_in_minutes

int

The Oracle Log Backup frequency you'd like to specify with the SLA. Required when the object_type is oracle_db or oracle_host.

None

num_channels

int

Number of RMAN channels used to backup the Oracle database. Required when the object_type is oracle_host.

4

hostname

str

The hostname, or one of the hostnames in a RAC cluster, or the RAC cluster name. Required when the object_type is oracle_db.

None

timeout

str

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

30

Returns

Type

Return Value

str

No change required. The vSphere VM 'object_name' is already assigned to the 'sla_name' SLA Domain.

str

No change required. The MSSQL Instance 'object_name' is already assigned to the 'sla_name' SLA Domain with the following log settings: log_backup_frequency_in_seconds: log_backup_frequency_in_seconds, log_retention_hours: log_retention_hours and copy_only: copy_only

str

No change required. The Oracle Database 'object_name' is already assigned to the 'sla_name' SLA Domain with the following log settings: log_backup_frequency_in_minutes: log_backup_frequency_in_seconds, log_retention_hours: log_retention_hours and num_channels: num_channels.

str

No change required. The Oracle Host 'object_name' is already assigned to the 'sla_name' SLA Domain with the following log settings: log_backup_frequency_in_seconds: log_backup_frequency_in_seconds. log_retention_hours: log_retention_hours, and num_channels: num_channels

str

No change required. The 'object_name' volume_group is already assigned to the 'sla_name' SLA Domain.

dict

The full API reponse for POST /internal/sla_domain/{sla_id}/assign.

dict

The full API response for PATCH /internal/volume_group/{id}.

dict

The full API response for PATCH /internal/oracle/db/{id}.

dict

The full API response for PATCH /internal/oracle/host/{id}.

Example

VMware

import rubrik_cdm

rubrik = rubrik_cdm.Connect()

vm_name = "python-sdk-demo"
sla_name = "Gold"
object_type = "vmware"

assign_sla = rubrik.assign_sla(vm_name, sla_name, object_type)

MSSQL

import rubrik_cdm

rubrik = rubrik_cdm.Connect()

object_name = 'python-sdk.demo.com'
object_type = 'mssql_host'

sla_name = 'Gold'
log_backup_frequency_in_seconds = 600
log_retention_hours = 12
copy_only = False

assignsla = rubrik.assign_sla(object_name, sla_name, object_type, logBackupFrequencyInSeconds, logRetentionHours, copyOnly)

Oracle Database

import rubrik_cdm

rubrik = rubrik_cdm.Connect()

object_name = 'HRDB50'
object_type = 'oracle_db'
hostname = 'python-sdk.demo.com'

sla_name = 'Gold'
log_backup_frequency_in_minutes = 30
log_retention_hours = 720
num_channels = 4

assignsla = rubrik.assign_sla(
    object_name, 
    sla_name, 
    object_type, 
    log_backup_frequency_in_minutes=log_backup_frequency_in_minutes, 
    log_retention_hours=log_retention_hours, 
    num_channels=num_channels,
    hostname=hostname)

Oracle Host

import rubrik_cdm

rubrik = rubrik_cdm.Connect()

object_name = 'python-sdk.demo.com'
object_type = 'oracle_host'

sla_name = 'Gold'
log_backup_frequency_in_minutes = 30
log_retention_hours = 720
num_channels = 4

assignsla = rubrik.assign_sla(
    object_name, 
    sla_name, 
    object_type, 
    log_backup_frequency_in_minutes=log_backup_frequency_in_minutes, 
    log_retention_hours=log_retention_hours, 
    num_channels=num_channels)

Volume Group

import rubrik_cdm

rubrik = rubrik_cdm.Connect()

# Note: To escape the "\" character, you need to use an extra "\". In
# other words, the "C:\" volume is shown as "C:\\" in the Python code.
object_name = ["C:\\", "D:\\"]
windows_host = "windows2016.rubrik.com"
sla_name = "Gold"

assign_sla = rubrik.assign_sla(object_name, sla_name, "volume_group", windows_host=windows_host)

AHV

import rubrik_cdm

rubrik = rubrik_cdm.Connect()

vm_name = "python-sdk-demo"
sla_name = "Gold"

assign_sla = rubrik.assign_sla(object_name, sla_name, "ahv")
=======

Fileset

import rubrik_cdm

rubrik = rubrik_cdm.Connect()

object_name = 'nas_fileset'
object_type = 'fileset'

sla_name = 'Gold'
nas_host = 'nas-server.rubrik.com'
share = '/nas_share'

assign_sla = rubrik.assign_sla(object_name, sla_name, object_type, nas_host=nas_host, share=share)
Previousupdate_aws_s3_cloudoutNextbegin_managed_volume_snapshot

Last updated 5 years ago