update_database()

Update a database.

Signature

update_database(array $parameters): mixed

Parameters

Pass these parameters as KasRequestParams. Every request also requires kas_login, kas_auth_type, and kas_auth_data, as shown in SOAP with PHP.

Name Description Requirement
database_login The database login Required
database_new_password The new database password Optional
database_comment The database comment Optional
database_allowed_hosts Allowed IP addresses that may connect to the database Optional

PHP example

<?php

// $sessionToken is returned by KasAuth, see SOAP with PHP.
$parameters = [
    'database_login' => 'd0123456',
    'database_new_password' => 'password',
    'database_comment' => 'comment',
];

try {
    $client = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl');
    $response = $client->KasApi(json_encode([
        'kas_login' => 'w0123456',
        'kas_auth_type' => 'session',
        'kas_auth_data' => $sessionToken,
        'kas_action' => 'update_database',
        'KasRequestParams' => $parameters,
    ]));
    print_r($response);
} catch (SoapFault $fault) {
    echo 'Error: ' . $fault->faultstring;
}

Responses and error codes

  • TRUE the action was carried out
  • missing_parameter a required parameter is missing
  • nothing_to_do nothing was changed
  • cant_connect_to_mysql_on_this_server
  • database_comment_syntax_incorrect
  • database_login_not_found
  • database_allowed_hosts_syntax_incorrect
  • no_mysql_on_this_server
  • password_syntax_incorrect