cvpysdk
cvpysdk copied to clipboard
Add new mysql instance
We are trying to create mysql instance @ 11.32 commserve:
>>> restore_from = 'a-o0'
>>> client_to_restore = commcell.clients.get(restore_from)
>>> agent = client.agents.get('mysql')
>>> print(agent)
"Mysql" Agent instance for Client: "a-o0"
>>> inst = agent.instances
>>> print(inst)
S. No. Instance Agent Client
1 a-o0_3306 mysql a-o0
2 a-o0_3307 mysql a-o0
>>> database_options = {'storage_policy': 'MYSQL_DATA_SP',
... 'port': 'a-o0:3307',
... 'mysql_user_name':'root',
... 'mysql_password':'bbbbbb',
... 'binary_directory':'/usr/bin',
... 'config_file':'/etc/mysql/my_myrestore.cnf',
... 'log_data_directory':'/data/my/myrestore/binlogs',
... 'data_directory':'/data/my/myrestore/dane',
... 'version': '8.0.36-28'
... }
>>> inst.add_mysql_instance(instance_name='testtt', database_options=database_options)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "~/venv/lib/python3.12/site-packages/cvpysdk/instance.py", line 1623, in add_mysql_instance
self._process_add_response(request_json)
File "~/venv/lib/python3.12/site-packages/cvpysdk/instance.py", line 418, in _process_add_response
raise SDKException('Response', '101', self._update_response_(response.text))
cvpysdk.exception.SDKException: Response was not success
}subclientId":0,"clientId":461,"instanceName":"testtt","instanceId":-1,"_type_":0"entity":{
From WebServier.log :
0208 403 05/23 21:39:05 403 - WEBAPI-STARTED processing [POST]:[/Instance] request. : /Instance : AdditionalInfo[ ConsoleType[PythonSDK]]
**30208 403 05/23 21:39:05 403 CreateInstance - request handling interrupted : ['CV.WebServer.Handlers.HandlerException: XML error: please refer to logs for more details.**
at CV.WebServer.Handlers.CVWebHandlerInstance.CreateInstance(CreateInstanceRequest req, Int32 userId, Int32 localeId)
at CV.WebServer.Controllers.InstanceController.CreateInstance(CreateInstanceRequest req)
at lambda_method381(Closure , Object , Object[] )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
What we're doing wrong?