Skip to content

Commit faf3330

Browse files
committed
Extended timeout from 4 to 30 seconds
1 parent f4251e3 commit faf3330

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

php-client/class.phpipam-api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ private function curl_set_connection ($token_file) {
648648
CURLOPT_URL => $url,
649649
CURLOPT_HEADER => 0,
650650
CURLOPT_VERBOSE => $this->debug,
651-
CURLOPT_TIMEOUT => 4,
651+
CURLOPT_TIMEOUT => 30,
652652
CURLOPT_HTTPHEADER => array("Content-Type: application/json"),
653653
CURLOPT_USERAGENT => 'phpipam-api php class',
654654
// ssl
@@ -839,7 +839,7 @@ private function curl_authenticate () {
839839
CURLOPT_URL => $this->api_url.$this->api_app_id."/user/",
840840
CURLOPT_HEADER => 0,
841841
CURLOPT_VERBOSE => $this->debug,
842-
CURLOPT_TIMEOUT => 4,
842+
CURLOPT_TIMEOUT => 30,
843843
CURLOPT_USERAGENT => 'phpipam-api php class',
844844
// ssl
845845
CURLOPT_SSL_VERIFYHOST => 0,

php-client/example.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@
1414
# init object with settings from
1515
$API = new phpipam_api_client ($api_url, $api_app_id, $api_key, $api_username, $api_password, $result_format);
1616
# debug - only to debug curl
17-
$API->set_debug (false);
17+
$API->set_debug (true);
1818
# execute - result is stored to $API->result, save it to own array if multiple calls needed after execute
19-
$API->execute ("GET", "sections", array(5), array(), $token_file);
19+
20+
$API->execute ("POST", "addresses", array("first_free", "7"), array(), $token_file);
21+
22+
23+
// $API->execute ("DELETE", "subnets", array(7, "permissions"), array(), $token_file);
24+
// $API->execute ("POST", "vrf", array(), array("number"=>"114","name"=>"API"), $token_file);
2025
# ger result
2126
$result = $API->get_result();
2227

2328
# print result
24-
print_r($result);
25-
?>
29+
print_r(json_decode($result, true));
30+
?>

0 commit comments

Comments
 (0)