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 subclientRaise 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_readersarchiver_retentionarchiver_retention_daysbackupbackup_nodesbackup_only_archiving_candidatebackup_private_authoritiesbackup_queue_databackup_retentionbackup_retention_daysbackup_savf_file_databackup_spool_file_databackup_using_multiple_drivesblock_level_backup_optionbrowsecatalog_aclcontentcreate_file_level_index_optiondata_readersdeduplication_optionsdescriptiondisable_backupdisable_content_indexingdisable_intelli_snapdisk_cleanupdisk_cleanup_rulesdisplay_nameenable_backupenable_backup_at_timeenable_content_indexingenable_dc_content_indexingenable_intelli_snapenable_synclibenable_trueupenable_trueup_daysencryption_flagexception_contentexclude_from_slafile_versionfilter_contentfindfind_all_versionsfind_latest_jobgenerate_signature_on_ibmiget_ma_associated_storagepolicyglobal_filter_statusibmi_compressionibmi_dr_configimpersonate_userindex_pruning_cycles_retentionindex_pruning_days_retentionindex_pruning_typeindex_serveris_backup_enabledis_blocklevel_backup_enabledis_default_subclientis_intelli_snap_enabledis_on_demand_subclientis_trueup_enabledlast_backup_timelist_medianamenetwork_agentnetwork_share_auto_mountnext_backup_timeobject_level_backuponetouch_optiononetouch_serveronetouch_server_directoryother_pending_changespending_record_changesplanpre_post_commandspropertiesread_buffer_sizerefreshrestore_in_placerestore_out_of_placerun_backup_copysave_access_pathsave_while_active_optionscan_typeset_backup_nodesset_proxy_for_snapsnapshot_engine_namesoftware_compressionstorage_mastorage_ma_idstorage_policysubclient_guidsubclient_idsubclient_namesystem_state_optiontarget_releasetrueup_daystrueup_optionunset_proxy_for_snapupdate_historyupdate_propertiesuse_vss