Remove a location from a cluster
curl --request DELETE \
--url https://api.ridergy.com/v1/clusters/{clusterId}/locations/{locationId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ridergy.com/v1/clusters/{clusterId}/locations/{locationId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ridergy.com/v1/clusters/{clusterId}/locations/{locationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ridergy.com/v1/clusters/{clusterId}/locations/{locationId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ridergy.com/v1/clusters/{clusterId}/locations/{locationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.delete("https://api.ridergy.com/v1/clusters/{clusterId}/locations/{locationId}")
.header("Authorization", "Bearer <token>")
.asString();{
"clusterId": "clst_20260612_a1b2c3d4",
"tenantUuid": "<string>",
"name": "North Campus",
"locationIds": [
"3632155",
"3632156"
],
"limitKw": 200,
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
集群
从集群中移除位置
从集群的 locationIds 中移除一个位置。这是
PATCH /clusters/{clusterId}(使用缩短后的 locationIds
数组)的原子化替代方案,因此并发的移除操作不会相互冲突。
集群必须始终至少保留一个成员位置。移除最后一个位置会返回
400 CLUSTER_EMPTY 错误。此时请改用
DELETE /clusters/{clusterId} 删除整个集群。
DELETE
/
clusters
/
{clusterId}
/
locations
/
{locationId}
Remove a location from a cluster
curl --request DELETE \
--url https://api.ridergy.com/v1/clusters/{clusterId}/locations/{locationId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ridergy.com/v1/clusters/{clusterId}/locations/{locationId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ridergy.com/v1/clusters/{clusterId}/locations/{locationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ridergy.com/v1/clusters/{clusterId}/locations/{locationId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ridergy.com/v1/clusters/{clusterId}/locations/{locationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.delete("https://api.ridergy.com/v1/clusters/{clusterId}/locations/{locationId}")
.header("Authorization", "Bearer <token>")
.asString();{
"clusterId": "clst_20260612_a1b2c3d4",
"tenantUuid": "<string>",
"name": "North Campus",
"locationIds": [
"3632155",
"3632156"
],
"limitKw": 200,
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
授权
通过 POST /oauth/token 使用 client_credentials 授权获取的 OAuth 2.0 访问令牌。
租户和 scopes 嵌入在 JWT 中。无需额外的请求头。

