Module cvpysdk.subclients.cloudapps.spanner_subclient
File for operating on a Google Cloud Spanner Subclient.
GoogleSpannerSubclient is the only class defined in this file.
GoogleSpannerSubclient: Derived class from CloudAppsSubclient Base class, representing a Google Cloud Spanner subclient, and to perform operations on that subclient
Googlespannersubclient
_get_subclient_properties() – gets the properties of Google Subclient
content() – sets the content of the subclient
discover() – runs database discovery on subclient
GoogleSpannerSubclient Attributes:
content -- Returns the subclient content list
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.
# --------------------------------------------------------------------------
"""File for operating on a Google Cloud Spanner Subclient.
GoogleSpannerSubclient is the only class defined in this file.
GoogleSpannerSubclient: Derived class from CloudAppsSubclient Base class, representing a
Google Cloud Spanner subclient, and to perform operations on that subclient
GoogleSpannerSubclient:
_get_subclient_properties() -- gets the properties of Google Subclient
content() -- sets the content of the subclient
discover() -- runs database discovery on subclient
GoogleSpannerSubclient Attributes:
content -- Returns the subclient content list
"""
from ...exception import SDKException
from ..casubclient import CloudAppsSubclient
class GoogleSpannerSubclient(CloudAppsSubclient):
"""Derived class from CloudAppsSubclient Base class, representing a Google Cloud Spanner subclient,
and to perform operations on that subclient."""
def _get_subclient_properties(self):
"""Gets the subclient related properties of Google Cloud Spanner subclient.."""
super(GoogleSpannerSubclient, self)._get_subclient_properties()
if 'backupObject' in self._subclient_properties['cloudAppsSubClientProp']['cloudSpannerSubclient']:
self._content = \
self._subclient_properties['cloudAppsSubClientProp']['cloudSpannerSubclient']['backupObject']
self._spanner_content = []
for database in self._content:
self._spanner_content.append(database['dbName'])
@property
def content(self):
"""
Returns the subclient content list
Returns:
list - list of subclient content
"""
return self._spanner_content
@content.setter
def content(self, subclient_content):
"""Sets content to the Google Spanner Subclient
Args:
subclient_content (list) -- list of the content to add to the subclient
"""
content = []
for database in subclient_content:
temp_content_dict = {
"cloudAppsSubClientProp": {
"cloudSpannerSubclient": {
"backupObject": {
"dbName": database
}
}
}
}
content.append(temp_content_dict)
self._set_subclient_properties("_content", content)
Classes
class GoogleSpannerSubclient (backupset_object, subclient_name, subclient_id=None)
-
Derived class from CloudAppsSubclient Base class, representing a Google Cloud Spanner subclient, and to perform operations on that subclient.
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 GoogleSpannerSubclient(CloudAppsSubclient): """Derived class from CloudAppsSubclient Base class, representing a Google Cloud Spanner subclient, and to perform operations on that subclient.""" def _get_subclient_properties(self): """Gets the subclient related properties of Google Cloud Spanner subclient..""" super(GoogleSpannerSubclient, self)._get_subclient_properties() if 'backupObject' in self._subclient_properties['cloudAppsSubClientProp']['cloudSpannerSubclient']: self._content = \ self._subclient_properties['cloudAppsSubClientProp']['cloudSpannerSubclient']['backupObject'] self._spanner_content = [] for database in self._content: self._spanner_content.append(database['dbName']) @property def content(self): """ Returns the subclient content list Returns: list - list of subclient content """ return self._spanner_content @content.setter def content(self, subclient_content): """Sets content to the Google Spanner Subclient Args: subclient_content (list) -- list of the content to add to the subclient """ content = [] for database in subclient_content: temp_content_dict = { "cloudAppsSubClientProp": { "cloudSpannerSubclient": { "backupObject": { "dbName": database } } } } content.append(temp_content_dict) self._set_subclient_properties("_content", content)
Ancestors
Instance variables
var content
-
Returns the subclient content list
Returns: list - list of subclient content
Expand source code Browse git
@property def content(self): """ Returns the subclient content list Returns: list - list of subclient content """ return self._spanner_content
Inherited members
CloudAppsSubclient
:allow_multiple_readers
backup
browse
data_readers
deduplication_options
description
disable_backup
disable_intelli_snap
display_name
enable_backup
enable_backup_at_time
enable_intelli_snap
enable_trueup
enable_trueup_days
encryption_flag
exclude_from_sla
find
find_latest_job
get_ma_associated_storagepolicy
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
next_backup_time
plan
properties
read_buffer_size
refresh
restore_in_place
restore_out_of_place
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
unset_proxy_for_snap
update_properties