Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Response was empty.
"""
if not (isinstance(index_server_roles, list) and isinstance(index_server_node_names, list)
and isinstance(index_server_name, basestring)):
raise SDKException('IndexServers', '101')
cloud_meta_infos = {
'INDEXLOCATION': index_directory,
'REPLICATION': '1',
'LANGUAGE': '0'
}
node_meta_infos = {
'PORTNO': '20000',
'JVMMAXMEMORY': '8191'
}
role_meta_infos = {}
req_json = deepcopy(IndexServerConstants.REQUEST_JSON)
req_json['cloudInfoEntity'] = {
'cloudName': index_server_name,
'cloudDisplayName': index_server_name
}
if is_cloud:
index_pool_obj = self._commcell_object.index_pools[index_pool_name]
req_json['type'] = 5
req_json['solrCloudInfo']['cloudPoolInfo'] = {
'cloudId': int(index_pool_obj['pool_id'])
}
role_meta_infos['ISCLOUDMODE'] = '3'
node_meta_infos['WEBSERVER'] = 'true'
for node_name in index_server_node_names:
node_obj = self._commcell_object.clients[node_name]
node_data = {
"opType": IndexServerConstants.OPERATION_ADD,
def cloud_id(self):
"""Returns the cloud id of index server"""
return self._properties[IndexServerConstants.CLOUD_ID]
def cloud_name(self):
"""Returns the internal cloud name of index server"""
return self._properties[IndexServerConstants.CLOUD_NAME]
def client_name(self):
"""Returns the client name of index server"""
return self._properties[IndexServerConstants.CLIENT_NAME]
def type(self):
"""Returns the type of index server"""
return self._properties[IndexServerConstants.TYPE]
def index_server_client_id(self):
"""Returns the index server client id of index server"""
return self._properties[IndexServerConstants.INDEX_SERVER_CLIENT_ID]
index_location (str) -- index server data directory
node_name (str) -- index server node name
node_params (dict) -- parameters to be passed
[
{
"name" : ,
"value" :
}
]
Raises:
SDKException:
Response was not success.
Response was empty.
"""
json_req = deepcopy(IndexServerConstants.REQUEST_JSON)
json_req['opType'] = IndexServerConstants.OPERATION_EDIT
json_req['cloudNodes'] = [{
"opType": IndexServerConstants.OPERATION_EDIT,
"nodeClientEntity": {
"clientId": int(self._commcell_obj.clients.get(node_name).client_id)
},
"nodeMetaInfos": [
{
"name": "INDEXLOCATION",
"value": index_location
}
]
}]
json_req['cloudInfoEntity']['cloudId'] = self.cloud_id
for param in node_params:
json_req['cloudNodes'][0]['nodeMetaInfos'].append(param)
flag, response = self._cvpysdk_object.make_request(
def server_type(self):
"""Returns the server type of index server"""
return self._properties[IndexServerConstants.SERVER_TYPE]
def client_id(self):
"""Returns the client id of index server"""
return self._properties[IndexServerConstants.CLIENT_ID]
def host_name(self):
"""Returns the host name of index server"""
return self._properties[IndexServerConstants.HOST_NAME]