보존 플래그 설정
curl --request PUT \
--url https://api.example.com/v1/datasets/{dataset_id}/retention \
--header 'Content-Type: application/json' \
--data '
{
"retained": true
}
'import requests
url = "https://api.example.com/v1/datasets/{dataset_id}/retention"
payload = { "retained": True }
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({retained: true})
};
fetch('https://api.example.com/v1/datasets/{dataset_id}/retention', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/datasets/{dataset_id}/retention",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'retained' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/datasets/{dataset_id}/retention"
payload := strings.NewReader("{\n \"retained\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/v1/datasets/{dataset_id}/retention")
.header("Content-Type", "application/json")
.body("{\n \"retained\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/datasets/{dataset_id}/retention")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"retained\": true\n}"
response = http.request(request)
puts response.read_bodyDatasets
보존 플래그 설정
장기 보존 플래그 설정/해제.
PUT
/
v1
/
datasets
/
{dataset_id}
/
retention
보존 플래그 설정
curl --request PUT \
--url https://api.example.com/v1/datasets/{dataset_id}/retention \
--header 'Content-Type: application/json' \
--data '
{
"retained": true
}
'import requests
url = "https://api.example.com/v1/datasets/{dataset_id}/retention"
payload = { "retained": True }
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({retained: true})
};
fetch('https://api.example.com/v1/datasets/{dataset_id}/retention', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/datasets/{dataset_id}/retention",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'retained' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/datasets/{dataset_id}/retention"
payload := strings.NewReader("{\n \"retained\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/v1/datasets/{dataset_id}/retention")
.header("Content-Type", "application/json")
.body("{\n \"retained\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/datasets/{dataset_id}/retention")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"retained\": true\n}"
response = http.request(request)
puts response.read_bodyPUT https://api-datahub.octoparse.com/v1/datasets/{dataset_id}/retention
인증: API 키 필요(Authorization: Bearer <API Key>).
실행 결과는 생성 후 기본 90일 보관. 보존 플래그 데이터셋은 만료 정리 제외. 플래그는 명시적 사용자 선언. 읽기로 연장되지 않으며 설정/해제는 멱등.
본인 데이터셋만 표시 가능. 타인·공개 시드·없는 id는 404. 시드는 본인 출력이 아니고 정리 대상도 아니라 표시 무의미. 표시 게이트가 가시성보다 좁음.
요청
경로 파라미터
string
필수
데이터셋 id.
요청 body
boolean
필수
보존
true, 해제 false.요청 예시
curl -X PUT -H "Authorization: Bearer $OCTOPARSE_API_KEY" -H "Content-Type: application/json" -d '{"retained": true}' "https://api-datahub.octoparse.com/v1/datasets/ds_0bd5345d13d0/retention"
응답
200 성공
{
"data": {
"dataset_id": "ds_0bd5345d13d0",
"retained": true
}
}
오류
| HTTP | code | category | 설명 |
|---|---|---|---|
| 401 | unauthorized | forbidden | API 키 누락 또는 무효. |
| 404 | dataset-not-found | not_found | 데이터셋 없음·본인 것 아님·공개 시드(표시 불가). |
{"error": {code, category, message, retryable}}입니다. 오류 참고.
클라이언트 라이브러리
client.set_dataset_retention("ds_0bd5345d13d0", retained=True)
await client.setDatasetRetention("ds_0bd5345d13d0", true);