Merge branch '2.3' into 2.4
This commit is contained in:
@ -317,11 +317,26 @@ In our example we are linking the `server1` server to the `RW-Split-Router`
|
|||||||
service. As was seen with the previous example, the easiest way to do this is to
|
service. As was seen with the previous example, the easiest way to do this is to
|
||||||
store the result, edit it and then send it back with a HTTP PATCH.
|
store the result, edit it and then send it back with a HTTP PATCH.
|
||||||
|
|
||||||
If we want to remove a server from _all_ services, we can set the
|
If we want to remove a server from _all_ services and monitors, we can set the
|
||||||
`relationships` field to `{}`. The REST API interprets this as an instruction
|
`data` member of the `services` and `monitors` relationships to an empty array:
|
||||||
to remove the server from all services and monitors. This is useful if you want
|
|
||||||
to delete the server which can only be done if it has no relationships to other
|
```
|
||||||
objects.
|
{
|
||||||
|
"data": {
|
||||||
|
"relationships": {
|
||||||
|
"services": {
|
||||||
|
"data": []
|
||||||
|
},
|
||||||
|
"monitors": {
|
||||||
|
"data": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This is useful if you want to delete the server which can only be done if it has
|
||||||
|
no relationships to other objects.
|
||||||
|
|
||||||
## Deleting Objects
|
## Deleting Objects
|
||||||
|
|
||||||
@ -333,6 +348,9 @@ following command.
|
|||||||
curl -X DELETE 127.0.0.1:8989/v1/servers/server1
|
curl -X DELETE 127.0.0.1:8989/v1/servers/server1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
In order to delete an object, it must not have any relationships to other
|
||||||
|
objects.
|
||||||
|
|
||||||
## Further Reading
|
## Further Reading
|
||||||
|
|
||||||
The full list of all available endpoints in MaxScale can be found in the
|
The full list of all available endpoints in MaxScale can be found in the
|
||||||
|
@ -305,19 +305,13 @@ public:
|
|||||||
mysql_close(m_conn);
|
mysql_close(m_conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool connect()
|
void ssl(bool value)
|
||||||
{
|
{
|
||||||
mysql_close(m_conn);
|
m_ssl = value;
|
||||||
m_conn = mysql_init(NULL);
|
|
||||||
|
|
||||||
// MXS-2568: This fixes mxs1828_double_local_infile
|
|
||||||
mysql_optionsv(m_conn, MYSQL_OPT_LOCAL_INFILE, (void*)"1");
|
|
||||||
|
|
||||||
return mysql_real_connect(m_conn, m_host.c_str(), m_user.c_str(), m_pw.c_str(), m_db.c_str(), m_port,
|
|
||||||
NULL, CLIENT_MULTI_STATEMENTS)
|
|
||||||
&& mysql_errno(m_conn) == 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool connect();
|
||||||
|
|
||||||
void disconnect()
|
void disconnect()
|
||||||
{
|
{
|
||||||
mysql_close(m_conn);
|
mysql_close(m_conn);
|
||||||
|
@ -604,3 +604,21 @@ int get_int_version(std::string version)
|
|||||||
str >> major >> dot >> minor >> dot >> patch;
|
str >> major >> dot >> minor >> dot >> patch;
|
||||||
return major * 10000 + minor * 100 + patch;
|
return major * 10000 + minor * 100 + patch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Connection::connect()
|
||||||
|
{
|
||||||
|
mysql_close(m_conn);
|
||||||
|
m_conn = mysql_init(NULL);
|
||||||
|
|
||||||
|
// MXS-2568: This fixes mxs1828_double_local_infile
|
||||||
|
mysql_optionsv(m_conn, MYSQL_OPT_LOCAL_INFILE, (void*)"1");
|
||||||
|
|
||||||
|
if (m_ssl)
|
||||||
|
{
|
||||||
|
set_ssl(m_conn);
|
||||||
|
}
|
||||||
|
|
||||||
|
return mysql_real_connect(m_conn, m_host.c_str(), m_user.c_str(), m_pw.c_str(), m_db.c_str(), m_port,
|
||||||
|
NULL, CLIENT_MULTI_STATEMENTS)
|
||||||
|
&& mysql_errno(m_conn) == 0;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user