Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-4729

Rest API does not accept commands to modify

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 6.4.6
    • N/A
    • REST-API
    • None

    Description

      Rest API does not work according to documentation to change a server to maintenance state.
      Test #1

      root@mxscl:~$ maxctrl list servers
      ┌─────────┬───────────────┬──────┬─────────────┬───────────────────────────────────┬─────────────┐
      │ Server  │ Address       │ Port │ Connections │ State                             │ GTID        │
      ├─────────┼───────────────┼──────┼─────────────┼───────────────────────────────────┼─────────────┤
      │ serverA │ 192.168.8.157 │ 3306 │ 0           │ Master, Running                   │ 0-1-3192705 │
      ├─────────┼───────────────┼──────┼─────────────┼───────────────────────────────────┼─────────────┤
      │ serverB │ 192.168.8.158 │ 3306 │ 0           │ Running, Slave of External Server │ 0-1-3192705 │
      └─────────┴───────────────┴──────┴─────────────┴───────────────────────────────────┴─────────────┘
      root@mxscl:~$ curl -X PUT -d '{"data": {"id": "serverB", "type": "servers", "attributes": { "state": "Maintenance" } } }' http://127.0.0.1:8989/v1/servers/serverB
      root@mxscl:~$ maxctrl list servers
      ┌─────────┬───────────────┬──────┬─────────────┬───────────────────────────────────┬─────────────┐
      │ Server  │ Address       │ Port │ Connections │ State                             │ GTID        │
      ├─────────┼───────────────┼──────┼─────────────┼───────────────────────────────────┼─────────────┤
      │ serverA │ 192.168.8.157 │ 3306 │ 0           │ Master, Running                   │ 0-1-3192717 │
      ├─────────┼───────────────┼──────┼─────────────┼───────────────────────────────────┼─────────────┤
      │ serverB │ 192.168.8.158 │ 3306 │ 0           │ Running, Slave of External Server │ 0-1-3192717 │
      └─────────┴───────────────┴──────┴─────────────┴───────────────────────────────────┴─────────────┘
      root@mxscl:~$
      

      Test #2

      root@mxscl:~$ curl 127.0.0.1:8989/v1/servers/serverB > serverB.txt
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100  8749  100  8749    0     0  4271k      0 --:--:-- --:--:-- --:--:-- 8543k
      root@mxscl:~$ perl -p -i -e "s/Running/Maintenance/g" serverB.txt
      root@mxscl:~$ grep Maintenance serverB.txt
                  "state": "Maintenance",
      root@mxscl:~$ curl -X PATCH -d @serverB.txt http://127.0.0.1:8989/v1/servers/serverB
      root@mxscl:~$ maxctrl list servers
      ┌─────────┬───────────────┬──────┬─────────────┬───────────────────────────────────┬─────────────┐
      │ Server  │ Address       │ Port │ Connections │ State                             │ GTID        │
      ├─────────┼───────────────┼──────┼─────────────┼───────────────────────────────────┼─────────────┤
      │ serverA │ 192.168.8.157 │ 3306 │ 0           │ Master, Running                   │ 0-1-3192420 │
      ├─────────┼───────────────┼──────┼─────────────┼───────────────────────────────────┼─────────────┤
      │ serverB │ 192.168.8.158 │ 3306 │ 0           │ Running, Slave of External Server │ 0-1-3192420 │
      └─────────┴───────────────┴──────┴─────────────┴───────────────────────────────────┴─────────────┘
      root@mxscl:~$
      

      These commands will work:

      curl -X PUT http://127.0.0.1:8989/v1/servers/serverB/set?state=maintenance
      curl -X PUT http://127.0.0.1:8989/v1/servers/serverB/clear?state=maintenance
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            edward Edward Stoever
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.