PHPでApache CouchDBにアクセスして、UUIDを取得です。 アクセスURLの末尾に「_uuids」を指定すればOK。「/_uuids?count=10」という具合にすると、一度に10個取得できます。
参考サイト
CouchDB for PHP developers - CRUD(Inchooさん)
UUID がぶつかる可能性を考えなくていい理由(Qiita)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://admin:password@127.0.0.1:5984/_uuids');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-type: application/json',
'Accept: */*'
));
$response = curl_exec($ch);
$_response = json_decode($response, true);
$UUID = $_response['uuids'];
curl_close($ch);
header('content-type: application/json; charset=utf-8');
echo $response ;
?>
{
"uuids": [
"58c65c9e0b312f7c034933d0ec007bd2"
]
}
参考サイト
CouchDB for PHP developers - CRUD(Inchooさん)
UUID がぶつかる可能性を考えなくていい理由(Qiita)