Add dataset inputs to a dataset.
The process is not atomic, i.e. if there are errors with some dataset
inputs, others might still be added. The response reports
- SUCCESS if all dataset inputs were added,
- MIXED_STATUS if only some dataset inputs wer
开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
/v2/datasets/{datasetId}/inputs
请求参数
Path 参数
datasetId
string
必需
Identify dataset by id.
Body 参数application/json
Request to add one or more datasets.
userAppId
object(apiUserAppIDSet)
可选
Common message to identify the app in a url endpoint.
userId
string
Note user_id 'me' is reserved - it is the alias for the id of authorized user
可选
appId
string
可选
datasetInputs
array[object (DatasetInput) {2}]
可选
List of inputs that are requested to be added to this dataset. Identify each input by id field. All other inputs fields are ignored.
This is the new Search object used in saved searches.
query
object(apiQuery)
可选
This is the search query used in /searches, model training requests, bulk data exports, etc.
id
string
可选
Customer facing, external ID for search to be saved. Provided by the user, e.g. "saved-search-1. It is unique per application.
applicationId
string
可选
Application that owns this saved search.
name
string
可选
Human readable display name of the saved search.
asOf
string<date-time>
可选
"As of" timestamp, indicating a time in the past as of which we want to retrieve the annotations satisfying the query.
gitHash
string
可选
Git hash of the code that ran the filter.
createdAt
string<date-time>
可选
When the saved search was created.
modifiedAt
string<date-time>
可选
When the saved search was updated.
algorithm
string
The search algorithm to be used.
Options are are 'nearest_neighbor', 'brute_force', and 'avg_concept_brute_force'
The last two perform a brute force search visual search instead of a more scalable distributed
nearest neighbor search and should be used by advanced users only.
If not specified we default to nearest neighbor
可选
save
boolean
If true, save this search, and exit without executing the search.
If false execute the query
可选
minValue
number<float>
可选
Minimum value of confidence threshold score in result. Defaults to 0.0 which means we won't do any thresholding as all probabilities will likely be > 0.0.
visibility
object(clarifaiapiVisibility)
可选
Visibility represents how visible the given resource is to other users. When authenticating a request we can tell if a user is a collaborator or a teammate for the the app that contains the resource and set their allowed visibility. We use that to restrict what they are allowed to see: If AllowedVisibility is PRIVATE then we allow PRIVATE (10), ORG (30), PUBLIC (50) If AllowedVisibility is ORG then we allow ORG (30), PUBLIC (50) If AllowedVisibility is PUBLIC then we allow PUBLIC (50) only.
metric
enum<string>
可选
Metric used for search. Can be EUCLIDEAN_DISTANCE (default) or COSINE_DISTANCE. Currently only brute force search supports non-eudlicean metrics.
枚举值:
METRIC_NOT_SETEUCLIDEAN_DISTANCECOSINE_DISTANCE
默认值:
METRIC_NOT_SET
示例
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl--location--request POST 'http://dev-cn.your-api-server.com/v2/datasets//inputs' \
--header'Content-Type: application/json' \
--data-raw''
返回响应
🟢200A successful response.
application/json
Body
status
object(apistatusStatus)
可选
code
object
可选
description
string
可选
A longer description of the error.
details
string
可选
More details of the given error.
stackTrace
array[string]
可选
For some environment we may return a stack trace to help debug any issues.
percentCompleted
integer<int64>
specifically for long running jobs
可选
timeRemaining
integer<int64>
if status is pending, how much time is remaining (in seconds)
可选
reqId
string
If we want to return a request id in the base status field
可选
internalDetails
string
可选
Internal Annotation (do not set in production, for internal Clarifai use only).