Module cvpysdk.subclients.bigdataappssubclient
Module for operating on a Big Data Apps Subclient
Bigdataappssubclient
init() – Just inializes all properties related to its super class
set_data_access_nodes(data_access_nodes) – adds the passed json object as data access nodes for this subclient.
Expand source code Browse git
# -*- coding: utf-8 -*-
# --------------------------------------------------------------------------
# Copyright Commvault Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# --------------------------------------------------------------------------
"""
Module for operating on a Big Data Apps Subclient
BigDataAppsSubclient:
__init__() -- Just inializes all properties related to its super class
set_data_access_nodes(data_access_nodes) -- adds the passed json object as data access
nodes for this subclient.
"""
from __future__ import unicode_literals
from ..subclients.fssubclient import FileSystemSubclient
from ..exception import SDKException
class BigDataAppsSubclient(FileSystemSubclient):
"""
Derived class from FileSystemSubclient. Can perform fs subclient operations.
"""
def __new__(cls, backupset_object, subclient_name, subclient_id=None):
"""
Object creation function for BigDataAppsSubclient which returns appropiate
sub class object based on cluster type
Args:
backupset_object (obj) -- Backupset object associated with the
subclient
subclient_name (str) -- Subclient name
subclient_id (int) -- Subclient Id
Returns:
object (obj) -- Object associated with the Bigdatapps subclient
"""
from ..subclients.splunksubclient import SplunkSubclient
from ..subclients.index_server_subclient import IndexServerSubclient
cluster_types = {
16: SplunkSubclient,
6: IndexServerSubclient
}
bigdata_apps_cluster_type = backupset_object._instance_object.properties. \
get('distributedClusterInstance', {}).get('clusterType', -1)
if bigdata_apps_cluster_type in cluster_types.keys():
cluster_type = cluster_types[bigdata_apps_cluster_type]
return object.__new__(cluster_type)
return object.__new__(cls)
def set_data_access_nodes(self, data_access_nodes):
"""
Sets the Data Access Nodes for the distributed apps subclient.
Args :
data_access_nodes (list) : Sets the list of client nodes passed as
data access node for this distributed apps
subclient
Raise SDK Exception :
If unable to set data access nodes property of the subclient.
"""
data_access_nodes_client_json = []
for access_node in data_access_nodes:
data_access_nodes_client_json.append({"clientName": access_node})
data_access_nodes_json = {
"dataAccessNodes": data_access_nodes_client_json
}
request_json = {
"subClientProperties": {
"dfsSubclientProp": {
"distributedDataAccessNodes": data_access_nodes_json
}
}
}
flag, response = self._cvpysdk_object.make_request(
'POST', self._SUBCLIENT, request_json)
output = self._process_update_response(flag, response)
if output[0]:
return
o_str = 'Failed to update properties of subclient\nError: "{0}"'
raise SDKException('Subclient', '102', o_str.format(output[2]))
Classes
class BigDataAppsSubclient (backupset_object, subclient_name, subclient_id=None)
-
Derived class from FileSystemSubclient. Can perform fs subclient operations.
Initialise the Subclient object.
Args
backupset_object (object) – instance of the Backupset class
subclient_name (str) – name of the subclient
subclient_id (str) – id of the subclient default: None
Returns
object - instance of the Subclient class
Expand source code Browse git
class BigDataAppsSubclient(FileSystemSubclient): """ Derived class from FileSystemSubclient. Can perform fs subclient operations. """ def __new__(cls, backupset_object, subclient_name, subclient_id=None): """ Object creation function for BigDataAppsSubclient which returns appropiate sub class object based on cluster type Args: backupset_object (obj) -- Backupset object associated with the subclient subclient_name (str) -- Subclient name subclient_id (int) -- Subclient Id Returns: object (obj) -- Object associated with the Bigdatapps subclient """ from ..subclients.splunksubclient import SplunkSubclient from ..subclients.index_server_subclient import IndexServerSubclient cluster_types = { 16: SplunkSubclient, 6: IndexServerSubclient } bigdata_apps_cluster_type = backupset_object._instance_object.properties. \ get('distributedClusterInstance', {}).get('clusterType', -1) if bigdata_apps_cluster_type in cluster_types.keys(): cluster_type = cluster_types[bigdata_apps_cluster_type] return object.__new__(cluster_type) return object.__new__(cls) def set_data_access_nodes(self, data_access_nodes): """ Sets the Data Access Nodes for the distributed apps subclient. Args : data_access_nodes (list) : Sets the list of client nodes passed as data access node for this distributed apps subclient Raise SDK Exception : If unable to set data access nodes property of the subclient. """ data_access_nodes_client_json = [] for access_node in data_access_nodes: data_access_nodes_client_json.append({"clientName": access_node}) data_access_nodes_json = { "dataAccessNodes": data_access_nodes_client_json } request_json = { "subClientProperties": { "dfsSubclientProp": { "distributedDataAccessNodes": data_access_nodes_json } } } flag, response = self._cvpysdk_object.make_request( 'POST', self._SUBCLIENT, request_json) output = self._process_update_response(flag, response) if output[0]: return o_str = 'Failed to update properties of subclient\nError: "{0}"' raise SDKException('Subclient', '102', o_str.format(output[2]))
Ancestors
Subclasses
Methods
def set_data_access_nodes(self, data_access_nodes)
-
Sets the Data Access Nodes for the distributed apps subclient. Args :
data_access_nodes (list) : Sets the list of client nodes passed as data access node for this distributed apps subclient
Raise SDK Exception :
If unable to set data access nodes property of the subclient.
Expand source code Browse git
def set_data_access_nodes(self, data_access_nodes): """ Sets the Data Access Nodes for the distributed apps subclient. Args : data_access_nodes (list) : Sets the list of client nodes passed as data access node for this distributed apps subclient Raise SDK Exception : If unable to set data access nodes property of the subclient. """ data_access_nodes_client_json = [] for access_node in data_access_nodes: data_access_nodes_client_json.append({"clientName": access_node}) data_access_nodes_json = { "dataAccessNodes": data_access_nodes_client_json } request_json = { "subClientProperties": { "dfsSubclientProp": { "distributedDataAccessNodes": data_access_nodes_json } } } flag, response = self._cvpysdk_object.make_request( 'POST', self._SUBCLIENT, request_json) output = self._process_update_response(flag, response) if output[0]: return o_str = 'Failed to update properties of subclient\nError: "{0}"' raise SDKException('Subclient', '102', o_str.format(output[2]))
Inherited members
FileSystemSubclient
:allow_multiple_readers
archiver_retention
archiver_retention_days
backup
backup_nodes
backup_only_archiving_candidate
backup_private_authorities
backup_queue_data
backup_retention
backup_retention_days
backup_savf_file_data
backup_spool_file_data
backup_using_multiple_drives
block_level_backup_option
browse
catalog_acl
content
create_file_level_index_option
data_readers
deduplication_options
description
disable_backup
disable_content_indexing
disable_intelli_snap
disk_cleanup
disk_cleanup_rules
display_name
enable_backup
enable_backup_at_time
enable_content_indexing
enable_dc_content_indexing
enable_intelli_snap
enable_synclib
enable_trueup
enable_trueup_days
encryption_flag
exception_content
exclude_from_sla
file_version
filter_content
find
find_all_versions
find_latest_job
generate_signature_on_ibmi
get_ma_associated_storagepolicy
global_filter_status
ibmi_compression
ibmi_dr_config
impersonate_user
index_pruning_cycles_retention
index_pruning_days_retention
index_pruning_type
index_server
is_backup_enabled
is_blocklevel_backup_enabled
is_default_subclient
is_intelli_snap_enabled
is_on_demand_subclient
is_trueup_enabled
last_backup_time
list_media
name
network_agent
network_share_auto_mount
next_backup_time
object_level_backup
onetouch_option
onetouch_server
onetouch_server_directory
other_pending_changes
pending_record_changes
plan
pre_post_commands
properties
read_buffer_size
refresh
restore_in_place
restore_out_of_place
run_backup_copy
save_access_path
save_while_active_option
scan_type
set_backup_nodes
set_proxy_for_snap
snapshot_engine_name
software_compression
storage_ma
storage_ma_id
storage_policy
subclient_guid
subclient_id
subclient_name
system_state_option
target_release
trueup_days
trueup_option
unset_proxy_for_snap
update_history
update_properties
use_vss